plan editor fix
This commit is contained in:
parent
cea2911e8b
commit
0ac77b6fa9
|
@ -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(
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue