Fix bug on save dataset profile definition

This commit is contained in:
apapachristou 2020-11-12 17:57:09 +02:00
parent 0ad797d033
commit 50fc4612b7
1 changed files with 14 additions and 12 deletions

View File

@ -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(() => {