From 86994c73ce48afe2b61edd46894eef59b6c48d67 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 2 Nov 2020 17:36:59 +0200 Subject: [PATCH 1/2] Make Section ordinal to be required in the Dataset Template Editor --- .../app/ui/admin/dataset-profile/admin/section-editor-model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/section-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/section-editor-model.ts index 32eefaa3b..8edc81899 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/section-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/section-editor-model.ts @@ -31,7 +31,7 @@ export class SectionEditorModel extends BaseFormModel { page: [{ value: this.page, disabled: (disabled && !skipDisable.includes('SectionEditorModel.page')) }, [Validators.required]], title: [{ value: this.title, disabled: (disabled && !skipDisable.includes('SectionEditorModel.title')) }], description: [{ value: this.description, disabled: (disabled && !skipDisable.includes('SectionEditorModel.description')) }], - ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('SectionEditorModel.ordinal')) }], + ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('SectionEditorModel.ordinal')) }, [Validators.required]], defaultVisibility: [{ value: this.defaultVisibility, disabled: (disabled && !skipDisable.includes('SectionEditorModel.defaultVisibility')) }] }); const sectionsFormArray = new Array(); From c391cd5521858e9623d695ae9630295df416bf86 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 2 Nov 2020 17:38:19 +0200 Subject: [PATCH 2/2] Fix issue when saving Datasets --- .../ui/dataset/dataset-wizard/dataset-wizard.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 5855875f3..b0c9d7d36 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 @@ -624,15 +624,15 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr }); } - onCallbackSuccess(id?: String, saveType?: SaveType): void { + onCallbackSuccess(data?: DatasetWizardEditorModel, saveType?: SaveType): void { this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); - if (id) { + if (data) { if (saveType === this.saveAnd.addNew) { this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'new', this.formGroup.get('dmp').value.id]); }) } else if (saveType === this.saveAnd.close) { this.router.navigate(['/reload']).then(() => { this.router.navigate(['/plans', 'edit', this.formGroup.get('dmp').value.id]); }); } else { - this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'edit', id]); }); + this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'edit', data.id]); }); } } else { this.router.navigate(['/datasets']);