|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import {Component, OnInit, ViewChild} from '@angular/core';
|
|
|
|
|
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
|
|
|
|
|
import {AbstractControl, FormArray, FormControl, FormGroup} from '@angular/forms';
|
|
|
|
|
import {MatDialog} from '@angular/material/dialog';
|
|
|
|
|
import {MatSnackBar} from '@angular/material/snack-bar';
|
|
|
|
@ -72,6 +72,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
|
|
|
|
|
hasChanges = false;
|
|
|
|
|
isDiscarded = false;
|
|
|
|
|
formGroupRawValue: any;
|
|
|
|
|
saving = false;
|
|
|
|
|
|
|
|
|
|
DatasetStatus = DatasetStatus;
|
|
|
|
|
dmpAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
|
|
|
|
@ -759,7 +760,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
save(saveType?: SaveType) {
|
|
|
|
|
|
|
|
|
|
this.saving = true;
|
|
|
|
|
Object.keys(this.formGroup.controls).forEach(controlName => {
|
|
|
|
|
if (controlName == 'datasetProfileDefinition') {
|
|
|
|
|
return;
|
|
|
|
@ -895,39 +896,40 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
|
|
|
|
|
this.router.navigate(['/reload']).then(() => {
|
|
|
|
|
this.router.navigate(['/plans', 'edit', this.formGroup.get('dmp').value.id]);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
} else if (saveType === SaveType.finalize) {
|
|
|
|
|
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.saving = false;
|
|
|
|
|
this.isNew = false;
|
|
|
|
|
// 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']);
|
|
|
|
|
}
|
|
|
|
|