From f2cf61938dd61b1e1588e9e38830c1ac286777df Mon Sep 17 00:00:00 2001 From: Sofia Papacharalampous Date: Tue, 30 Apr 2024 13:00:53 +0300 Subject: [PATCH] added finalize function for description template type --- ...iption-template-type-editor.component.html | 2 +- ...cription-template-type-editor.component.ts | 31 +++++++++++++++++++ dmp-frontend/src/assets/i18n/en.json | 8 +++++ dmp-frontend/src/common/base/base-editor.ts | 3 -- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/dmp-frontend/src/app/ui/admin/description-types/editor/description-template-type-editor.component.html b/dmp-frontend/src/app/ui/admin/description-types/editor/description-template-type-editor.component.html index c72094294..404a057da 100644 --- a/dmp-frontend/src/app/ui/admin/description-types/editor/description-template-type-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/description-types/editor/description-template-type-editor.component.html @@ -17,7 +17,7 @@
- diff --git a/dmp-frontend/src/app/ui/admin/description-types/editor/description-template-type-editor.component.ts b/dmp-frontend/src/app/ui/admin/description-types/editor/description-template-type-editor.component.ts index b11ae5877..997893d75 100644 --- a/dmp-frontend/src/app/ui/admin/description-types/editor/description-template-type-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-types/editor/description-template-type-editor.component.ts @@ -25,6 +25,8 @@ import { DescriptionTemplateTypeEditorResolver } from './description-template-ty import { DescriptionTemplateTypeEditorService } from './description-template-type-editor.service'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { LockService } from '@app/core/services/lock/lock.service'; +import { FormValidationErrorsDialogComponent } from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component'; +import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status'; @Component({ templateUrl: './description-template-type-editor.component.html', @@ -175,4 +177,33 @@ export class DescriptionTemplateTypeEditorComponent extends BaseEditor { + if (result) { + this.formGroup.get('status').setValue(DescriptionTemplateTypeStatus.Finalized); + this.persistEntity(); + }}); + } } diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 2ef3e4ae0..5e19d6699 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1249,6 +1249,14 @@ "FINALIZE": "Finalize", "CANCEL": "Cancel", "DELETE": "Delete" + }, + "MESSAGES": { + "MISSING-FIELDS": "There are some required fields left unfilled. Please check the Template and make sure that all required questions are answered and URLs are provided with valid input. (Missing fields are marked in red color)" + }, + "FINALIZE-DIALOG": { + "TITLE": "Finalize this item?", + "CONFIRM": "Confirm", + "NEGATIVE": "Cancel" } }, "REFERENCE-TYPE-EDITOR": { diff --git a/dmp-frontend/src/common/base/base-editor.ts b/dmp-frontend/src/common/base/base-editor.ts index c66599d13..17d501e49 100644 --- a/dmp-frontend/src/common/base/base-editor.ts +++ b/dmp-frontend/src/common/base/base-editor.ts @@ -110,9 +110,6 @@ export abstract class BaseEditor