From 50fc4612b7e2f345079f3c7f6adf13996e9eb403 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Thu, 12 Nov 2020 17:57:09 +0200 Subject: [PATCH] Fix bug on save dataset profile definition --- .../dataset-wizard.component.ts | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts index 78688de88..24148d9ba 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts @@ -641,21 +641,23 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr this.router.navigate(['/reload']).then(() => { this.router.navigate(['/plans', 'edit', this.formGroup.get('dmp').value.id]); }); } else { this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data); - this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft; - if (this.formGroup.get('datasetProfileDefinition')) { - this.formGroup.removeControl('datasetProfileDefinition'); - this.getDefinition(data.profile.id); - this.maxStep = 1; - } else { - this.getDefinition(data.profile.id); - this.maxStep = 1; - } - - setTimeout(() => { this.formGroup = null; }); + // setTimeout(() => { this.formGroup = null; }); setTimeout(() => { - this.formGroup = this.datasetWizardModel.buildForm(); + this.formGroup.get('id').patchValue(data.id); + this.formGroup.get('modified').patchValue(data.modified); + this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); + + // this.formGroup = this.datasetWizardModel.buildForm(); + // if (this.formGroup.get('datasetProfileDefinition')) { + // this.formGroup.removeControl('datasetProfileDefinition'); + // this.getDefinition(data.profile.id); + // this.maxStep = 1; + // } else { + // this.getDefinition(data.profile.id); + // this.maxStep = 1; + // } }); setTimeout(() => {