diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts index 522c37945..3f7210658 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts @@ -92,6 +92,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme datasetProfileDefinitionModel: DatasetDescriptionFormEditorModel; availableProfiles: DatasetProfileModel[] = []; + finalize: boolean = false; itemId: string; dmpId: string; newDmpId: string; @@ -167,12 +168,13 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme const params = this.route.snapshot.params; const queryParams = this.route.snapshot.queryParams; + const data: any = this.route.snapshot.data; this.itemId = params['id']; this.dmpId = params['dmpId']; this.newDmpId = queryParams['newDmpId']; this.publicId = params['publicId']; this.profileUpdateId = params['updateId']; - + this.finalize = data.finalize; this.itemId ? this.downloadDocumentId = this.itemId : this.downloadDocumentId = this.publicId this.init(); @@ -234,8 +236,13 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme }, maxWidth: '30em' }); } + if(this.finalize && !this.lockStatus && !this.viewOnly) { + setTimeout(() => { + this.saveFinalize(); + }, 0); + } // this.availableProfiles = this.datasetWizardModel.dmp.profiles; - }) + }); }, error => { switch (error.status) { diff --git a/dmp-frontend/src/app/ui/dataset/dataset.routing.ts b/dmp-frontend/src/app/ui/dataset/dataset.routing.ts index 90f46c598..c3381dc06 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset.routing.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset.routing.ts @@ -28,6 +28,18 @@ const routes: Routes = [ }, canDeactivate:[CanDeactivateGuard] }, + { + path: 'edit/:id/finalize', + component: DatasetWizardComponent, + canActivate: [AuthGuard], + data: { + breadcrumb: true, + public: false, + title: 'GENERAL.TITLES.DATASET-EDIT', + finalize: true + }, + canDeactivate:[CanDeactivateGuard] + }, { path: 'publicEdit/:publicId', component: DatasetWizardComponent, diff --git a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts index 750f98a47..d77b058c3 100644 --- a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts +++ b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts @@ -498,7 +498,7 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit { takeUntil(this._destroyed) ) .subscribe( _ =>{ - this.router.navigate(['datasets','edit',dataset.id]); + this.router.navigate(['datasets','edit',dataset.id, 'finalize']); })