From cacfd9375dbe0713d59241ea186ebf27a37051d6 Mon Sep 17 00:00:00 2001 From: amentis Date: Mon, 8 Jul 2024 15:15:58 +0300 Subject: [PATCH] hide undo finalize button in plan editor when plan is deposited --- .../ui/plan/plan-editor-blueprint/plan-editor.component.html | 4 ++-- .../ui/plan/plan-editor-blueprint/plan-editor.component.ts | 5 +++++ .../resolvers/plan-editor-enitity.resolver.ts | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.html b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.html index aa09802c3..0dff5a777 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.html +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.html @@ -57,12 +57,12 @@ -
+
- +
diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts index 128024480..74f6ec141 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts @@ -227,6 +227,7 @@ export class PlanEditorComponent extends BaseEditor imple if (data.planDescriptionTemplates) { data.planDescriptionTemplates = data.planDescriptionTemplates.filter(x => x.isActive === IsActive.Active); } + if (data.entityDois && data.entityDois.length > 0) data.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active); } this.item = data; @@ -400,6 +401,10 @@ export class PlanEditorComponent extends BaseEditor imple }); } + hasNotDoi() { + return (this.item.entityDois == null || this.item.entityDois.length == 0); + } + finalize() { const dialogRef = this.dialog.open(PlanFinalizeDialogComponent, { maxWidth: '500px', diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/resolvers/plan-editor-enitity.resolver.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/resolvers/plan-editor-enitity.resolver.ts index cec94bd7c..68f1aaee9 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/resolvers/plan-editor-enitity.resolver.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/resolvers/plan-editor-enitity.resolver.ts @@ -14,6 +14,7 @@ import { BaseEditorResolver } from '@common/base/base-editor.resolver'; import { Guid } from '@common/types/guid'; import { takeUntil, tap } from 'rxjs/operators'; import { nameof } from 'ts-simple-nameof'; +import { EntityDoi } from '@app/core/model/entity-doi/entity-doi'; @Injectable() export class PlanEditorEntityResolver extends BaseEditorResolver { @@ -84,6 +85,10 @@ export class PlanEditorEntityResolver extends BaseEditorResolver { [nameof(x => x.planDescriptionTemplates), nameof(x => x.descriptionTemplateGroupId)].join('.'), [nameof(x => x.planDescriptionTemplates), nameof(x => x.isActive)].join('.'), + [nameof(x => x.entityDois), nameof(x => x.id)].join('.'), + [nameof(x => x.entityDois), nameof(x => x.repositoryId)].join('.'), + [nameof(x => x.entityDois), nameof(x => x.doi)].join('.'), + [nameof(x => x.entityDois), nameof(x => x.isActive)].join('.'), ...PlanEditorEntityResolver.blueprintLookupFields(nameof(x => x.blueprint)),