From 16b0a3089e0e3a69efabf4fb04efc9a17b896454 Mon Sep 17 00:00:00 2001 From: amentis Date: Wed, 29 May 2024 14:50:02 +0300 Subject: [PATCH] dmp new version keep title, descripion changes after blueprint change --- .../new-version-dialog/dmp-new-version-dialog.component.ts | 2 +- .../dmp-new-version-dialog.editor.model.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dmp-frontend/src/app/ui/dmp/new-version-dialog/dmp-new-version-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/new-version-dialog/dmp-new-version-dialog.component.ts index 0d59d026a..ce48dcaf9 100644 --- a/dmp-frontend/src/app/ui/dmp/new-version-dialog/dmp-new-version-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/new-version-dialog/dmp-new-version-dialog.component.ts @@ -113,7 +113,7 @@ export class NewVersionDmpDialogComponent extends BaseComponent { selectedBlueprintChanged(item: DmpBlueprint): void{ this.selectedBlueprintSections = item.definition?.sections?.filter(x => x.hasTemplates) || null; if(this.selectedBlueprintSections && this.hasDescriptions()) { - this.formGroup = this.editorModel.fromModel(this.dmp, item).buildForm(); + this.formGroup = this.editorModel.fromModel(this.dmp, item, this.formGroup.get('label').value, this.formGroup.get('description').value).buildForm(); } } diff --git a/dmp-frontend/src/app/ui/dmp/new-version-dialog/dmp-new-version-dialog.editor.model.ts b/dmp-frontend/src/app/ui/dmp/new-version-dialog/dmp-new-version-dialog.editor.model.ts index aa4f0f40f..b5c7b8cdc 100644 --- a/dmp-frontend/src/app/ui/dmp/new-version-dialog/dmp-new-version-dialog.editor.model.ts +++ b/dmp-frontend/src/app/ui/dmp/new-version-dialog/dmp-new-version-dialog.editor.model.ts @@ -19,11 +19,11 @@ export class DmpNewVersionDialogEditorModel implements NewVersionDmpPersist { constructor() { } - public fromModel(item: Dmp, blueprint: DmpBlueprint): DmpNewVersionDialogEditorModel { + public fromModel(item: Dmp, blueprint: DmpBlueprint, label?: string, description?: string): DmpNewVersionDialogEditorModel { if (item) { this.id = item.id; - this.label = this.label != undefined ? this.label : item.label; - this.description = this.description != undefined ? this.description : item.description; + this.label = label != undefined ? label : item.label; + this.description = description != undefined ? description : item.description; this.blueprintId = blueprint?.id != undefined ? blueprint.id : item.blueprint.id; this.hash= item.hash;