diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.component.html b/dmp-frontend/src/app/ui/description/editor/description-editor.component.html index 7ad7c9dc0..f6b272edd 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.component.html @@ -64,7 +64,6 @@ - diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts index 1222bb869..8b2e8b501 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts @@ -63,6 +63,7 @@ export class DescriptionEditorComponent extends BaseEditor { onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete); this.descriptionIsOnceSaved = true; + if (this.formGroup.get('status').value == DescriptionStatus.Finalized) this.isFinalized = true; }, - error => this.onCallbackError(error) + error => { + if (this.formGroup.get('status').value == DescriptionStatus.Finalized){ + this.formGroup.get('status').setValue(DescriptionStatus.Draft); + this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-FINALIZE'), SnackBarNotificationLevel.Error); + }else{ + this.onCallbackError(error); + } + } ); } @@ -654,14 +664,7 @@ export class DescriptionEditorComponent extends BaseEditor { this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); - this.router.navigate(['/descriptions']); - }); - } - - saveAndAddNew(){ - this.formSubmit((data) => { - this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); - //TODO + this.backToDmp(); }); } @@ -757,7 +760,7 @@ export class DescriptionEditorComponent extends BaseEditor { + this.isFinalized = false; this.prepareForm(data); - this.onCallbackSuccess() + this.onCallbackSuccess(); }, (error: any) => { this.onCallbackError(error) }); diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html index fe4477875..d632e99ae 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html @@ -6,7 +6,7 @@
-
diff --git a/dmp-frontend/src/app/ui/tag/tags-field/tags-field.component.html b/dmp-frontend/src/app/ui/tag/tags-field/tags-field.component.html index f2799fd1f..d69798812 100644 --- a/dmp-frontend/src/app/ui/tag/tags-field/tags-field.component.html +++ b/dmp-frontend/src/app/ui/tag/tags-field/tags-field.component.html @@ -1,6 +1,6 @@ {{'DESCRIPTION-EDITOR.BASE-INFO.FIELDS.TAGS' | translate}} - + {{tag}}