From e7f140cb514508cd10868758220f8ab0935a3db1 Mon Sep 17 00:00:00 2001 From: amentis Date: Thu, 4 Apr 2024 12:56:23 +0300 Subject: [PATCH] add response error code enum, belongsToTenant field, fix description template new version issue --- .../app/core/common/enum/respone-error-code.ts | 17 +++++++++++++++++ .../description-template-editor.component.ts | 2 +- dmp-frontend/src/common/base/base-editor.ts | 7 ++++++- .../src/common/base/base-entity.model.ts | 1 + 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 dmp-frontend/src/app/core/common/enum/respone-error-code.ts diff --git a/dmp-frontend/src/app/core/common/enum/respone-error-code.ts b/dmp-frontend/src/app/core/common/enum/respone-error-code.ts new file mode 100644 index 000000000..8fbd45b17 --- /dev/null +++ b/dmp-frontend/src/app/core/common/enum/respone-error-code.ts @@ -0,0 +1,17 @@ +export enum ResponseErrorCode { + HashConflict = 100, + Forbidden = 101, + SystemError =102, + MissingTenant = 103, + TenantCodeRequired = 108, + TenantNameRequired = 109, + TenantNotAllowed = 113, + DescriptionTemplateNewVersionConflict = 114, + DmpNewVersionConflict = 115, + DmpIsFinalized = 116, + + DmpBlueprintHasNoDescriptionTemplates = 120, + DmpBlueprintNewVersionConflict = 121, + DmpDescriptionTemplateCanNotRemove = 122, + TenantTampering = 123 +} \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts index 92f2e188c..a84bf1317 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts @@ -188,6 +188,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor { if (result) { this.formGroup.get('status').setValue(DescriptionTemplateStatus.Finalized); - if(this.isNewVersion) this.isNewVersion = false; this.persistEntity(); }}); } diff --git a/dmp-frontend/src/common/base/base-editor.ts b/dmp-frontend/src/common/base/base-editor.ts index f471e0146..2111040d2 100644 --- a/dmp-frontend/src/common/base/base-editor.ts +++ b/dmp-frontend/src/common/base/base-editor.ts @@ -24,6 +24,7 @@ import { isNullOrUndefined } from '@swimlane/ngx-datatable'; import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; import { AuthService } from '@app/core/services/auth/auth.service'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; +import { ResponseErrorCode } from '@app/core/common/enum/respone-error-code'; @Component({ selector: 'app-base-editor-component', @@ -120,9 +121,13 @@ export abstract class BaseEditor