check if blueprint is valid when finalizing in editor
This commit is contained in:
parent
2f4e123ac9
commit
0bd3422903
|
@ -399,9 +399,9 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
|
|||
this.descriptionTemplatesArray(sectionIndex).push(profile.buildForm());
|
||||
}
|
||||
|
||||
formSubmit(): void {
|
||||
checkValidity() {
|
||||
this.formService.touchAllFormFields(this.formGroup);
|
||||
if (!this.isFormValid()) { return; }
|
||||
if (!this.isFormValid()) { return false; }
|
||||
let errorMessages = [];
|
||||
if(!this.hasTitle()) {
|
||||
errorMessages.push("Title should be set.");
|
||||
|
@ -414,9 +414,14 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
|
|||
}
|
||||
if(errorMessages.length > 0) {
|
||||
this.showValidationErrorsDialog(undefined, errorMessages);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
this.onSubmit();
|
||||
return true;
|
||||
}
|
||||
|
||||
formSubmit(): void {
|
||||
if (this.checkValidity())
|
||||
this.onSubmit();
|
||||
}
|
||||
|
||||
public isFormValid() {
|
||||
|
@ -548,10 +553,10 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
|
|||
}
|
||||
|
||||
finalize() {
|
||||
//const data = this.form.value;
|
||||
this.formGroup.get('status').setValue(DmpProfileStatus.Finalized);
|
||||
|
||||
this.onSubmit();
|
||||
if (this.checkValidity()) {
|
||||
this.formGroup.get('status').setValue(DmpProfileStatus.Finalized);
|
||||
this.onSubmit();
|
||||
}
|
||||
}
|
||||
|
||||
downloadXML(): void {
|
||||
|
|
Loading…
Reference in New Issue