Finilize from dataset overview will redirect the editor and then trigger Finalize button.

This commit is contained in:
Konstantinos Triantafyllou 2023-03-30 12:19:09 +03:00
parent 8c708f470d
commit fbaa175436
3 changed files with 22 additions and 3 deletions

View File

@ -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) {

View File

@ -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,

View File

@ -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']);
})