dmp new version keep title, descripion changes after blueprint change
This commit is contained in:
parent
c237de889c
commit
16b0a3089e
|
@ -113,7 +113,7 @@ export class NewVersionDmpDialogComponent extends BaseComponent {
|
||||||
selectedBlueprintChanged(item: DmpBlueprint): void{
|
selectedBlueprintChanged(item: DmpBlueprint): void{
|
||||||
this.selectedBlueprintSections = item.definition?.sections?.filter(x => x.hasTemplates) || null;
|
this.selectedBlueprintSections = item.definition?.sections?.filter(x => x.hasTemplates) || null;
|
||||||
if(this.selectedBlueprintSections && this.hasDescriptions()) {
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,11 @@ export class DmpNewVersionDialogEditorModel implements NewVersionDmpPersist {
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
public fromModel(item: Dmp, blueprint: DmpBlueprint): DmpNewVersionDialogEditorModel {
|
public fromModel(item: Dmp, blueprint: DmpBlueprint, label?: string, description?: string): DmpNewVersionDialogEditorModel {
|
||||||
if (item) {
|
if (item) {
|
||||||
this.id = item.id;
|
this.id = item.id;
|
||||||
this.label = this.label != undefined ? this.label : item.label;
|
this.label = label != undefined ? label : item.label;
|
||||||
this.description = this.description != undefined ? this.description : item.description;
|
this.description = description != undefined ? description : item.description;
|
||||||
this.blueprintId = blueprint?.id != undefined ? blueprint.id : item.blueprint.id;
|
this.blueprintId = blueprint?.id != undefined ? blueprint.id : item.blueprint.id;
|
||||||
this.hash= item.hash;
|
this.hash= item.hash;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue