|
|
|
@ -61,6 +61,7 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements
|
|
|
|
|
|
|
|
|
|
editMode = true;
|
|
|
|
|
// editMode = false;
|
|
|
|
|
saving = false;
|
|
|
|
|
|
|
|
|
|
breadCrumbs: Observable<BreadcrumbItem[]>;
|
|
|
|
|
isNew = true;
|
|
|
|
@ -416,6 +417,7 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
formSubmit(addNew?: boolean, showAddDatasetDialog?: boolean): void {
|
|
|
|
|
this.saving = true;
|
|
|
|
|
this.formService.touchAllFormFields(this.formGroup);
|
|
|
|
|
// if (this.isNewDataset) {
|
|
|
|
|
// if (!this.isDatasetFormValid) {
|
|
|
|
@ -440,6 +442,7 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements
|
|
|
|
|
const errmess = this._buildDMPDescriptionErrorMessages();
|
|
|
|
|
this.showValidationErrorsDialog(undefined, errmess);
|
|
|
|
|
this.hintErrors = true;
|
|
|
|
|
this.saving = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.onSubmit(addNew, showAddDatasetDialog);
|
|
|
|
@ -554,7 +557,8 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements
|
|
|
|
|
setTimeout(() => { this.formGroup = null; });
|
|
|
|
|
setTimeout(() => { this.formGroup = dmpEditorModel.buildForm(); });
|
|
|
|
|
setTimeout(() => { document.getElementById('editor-form').scrollTop = this.scrollTop; });
|
|
|
|
|
|
|
|
|
|
this.saving = false;
|
|
|
|
|
this.isNew = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.router.navigate(['/reload']).then(() => { this.router.navigate(['/plans']); });
|
|
|
|
|
}
|
|
|
|
@ -570,12 +574,14 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements
|
|
|
|
|
onCallbackError(error: any) {
|
|
|
|
|
this.uiNotificationService.snackBarNotification(error.error.message, SnackBarNotificationLevel.Error);
|
|
|
|
|
this.setErrorModel(error.error);
|
|
|
|
|
this.saving = false;
|
|
|
|
|
//this.validateAllFormFields(this.formGroup);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onCallbackSuccessAddNew(dmp?: DmpModel) {
|
|
|
|
|
// this.editDataset(dmp.id, true, this.isNew && !this.formGroup.get('datasets').value.length);
|
|
|
|
|
this.editDataset(dmp.id, true, false);
|
|
|
|
|
this.saving = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public setErrorModel(validationErrorModel: ValidationErrorModel) {
|
|
|
|
@ -883,12 +889,13 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addDataset() {
|
|
|
|
|
|
|
|
|
|
this.saving = true;
|
|
|
|
|
|
|
|
|
|
if(!this._isDMPDescriptionValid()){
|
|
|
|
|
const errmess = this._buildDMPDescriptionErrorMessages();
|
|
|
|
|
this.showValidationErrorsDialog(undefined, errmess);
|
|
|
|
|
this.hintErrors = true;
|
|
|
|
|
this.saving = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|