On a new Dataset when save is pressed it will reload the editor in order to reflect better the state of the Dataset

saml2
George Kalampokis 2 years ago
parent 4b879eb339
commit 5faa44c015

@ -895,38 +895,39 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
this.router.navigate(['/reload']).then(() => {
this.router.navigate(['/plans', 'edit', this.formGroup.get('dmp').value.id]);
});
} else if (saveType === SaveType.finalize) {
} else {
this.router.navigate(['/reload']).then(() => {
this.router.navigate(['/datasets', 'edit', data.id]);
});
} else {
this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data);
this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft;
// setTimeout(() => { this.formGroup = null; });
setTimeout(() => {
this.formGroup.get('id').patchValue(data.id);
this.formGroup.get('modified').patchValue(data.modified);
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
this.hasChanges = false;
// 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(() => {
document.getElementById('dataset-editor-form').scrollTop = this.scrollTop;
document.getElementById('stepper-options').scrollTop = this.tocScrollTop;
}, 500);
// this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'edit', data.id]); });
}
// } else {
// this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data);
// this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft;
// // setTimeout(() => { this.formGroup = null; });
// setTimeout(() => {
// this.formGroup.get('id').patchValue(data.id);
// this.formGroup.get('modified').patchValue(data.modified);
// this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
// this.hasChanges = false;
// // 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(() => {
// document.getElementById('dataset-editor-form').scrollTop = this.scrollTop;
// document.getElementById('stepper-options').scrollTop = this.tocScrollTop;
// }, 500);
// // this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'edit', data.id]); });
// }
} else {
this.router.navigate(['/datasets']);
}

Loading…
Cancel
Save