From 0ac77b6fa9a15d8ccd9c9164ce59799571802fc9 Mon Sep 17 00:00:00 2001 From: "CITE\\dtziotzios" Date: Thu, 11 Jul 2024 10:05:40 +0300 Subject: [PATCH] plan editor fix --- .../src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts b/frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts index dfb197c5a..65869ba1f 100644 --- a/frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts +++ b/frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts @@ -47,6 +47,7 @@ export class PlanEditorModel extends BaseEditorModel implements PlanPersist { item.blueprint.definition.sections.forEach(section => { if (section.hasTemplates) { + const isNew = (item.id == null); const sectionTemplatesFromPlan = item.planDescriptionTemplates?.filter(x => x.sectionId == section.id && x.isActive == IsActive.Active) || []; if (sectionTemplatesFromPlan.length > 0) { @@ -57,7 +58,7 @@ export class PlanEditorModel extends BaseEditorModel implements PlanPersist { descriptionTemplateGroupId: planDescriptionTemplate?.descriptionTemplateGroupId, })); }); - } else if (section.descriptionTemplates?.length > 0) { + } else if (section.descriptionTemplates?.length > 0 && isNew) { section.descriptionTemplates.forEach(blueprintDefinedDescriptionTemplate => { this.descriptionTemplates.push(new PlanDescriptionTemplateEditorModel(this.validationErrorModel).fromModel( {