From 6013cb522524a0b82de63d31b905982148c4dc8f Mon Sep 17 00:00:00 2001 From: Sofia Papacharalampous Date: Mon, 8 Apr 2024 10:59:26 +0300 Subject: [PATCH] dmp editor > select default blueprint --- .../dmp-editor-blueprint/dmp-editor.component.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts index 7bc0d3bd1..1ad6f8c69 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts @@ -62,7 +62,6 @@ export class DmpEditorComponent extends BaseEditor implemen isNew = true; isDeleted = false; - goToNextStep = true; item: Dmp; selectedBlueprint: DmpBlueprint; step: number = 0; @@ -224,10 +223,6 @@ export class DmpEditorComponent extends BaseEditor implemen if (this.editorModel.status == DmpStatus.Finalized || this.isDeleted) { this.formGroup.disable(); } - - if (this.item != null && this.goToNextStep) { - this.nextStep(); - } } refreshData(): void { @@ -346,11 +341,14 @@ export class DmpEditorComponent extends BaseEditor implemen this.formGroup.get('blueprint').setValue(this.selectedBlueprint.id); const goToNextStep: boolean = this.formGroup.get('label').valid && this.formGroup.get('description').valid; - this.buildFormAfterBlueprintSelection(goToNextStep); + if (goToNextStep) { + this.buildFormAfterBlueprintSelection(); + this.nextStep(); + } }); } - private buildFormAfterBlueprintSelection(goToNextStep: boolean = true) { + private buildFormAfterBlueprintSelection() { const dmp: Dmp = { label: this.formGroup.get('label').value, description: this.formGroup.get('description').value, @@ -359,7 +357,6 @@ export class DmpEditorComponent extends BaseEditor implemen } this.prepareForm(dmp); - this.goToNextStep = true; //reset } //