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());
|
this.descriptionTemplatesArray(sectionIndex).push(profile.buildForm());
|
||||||
}
|
}
|
||||||
|
|
||||||
formSubmit(): void {
|
checkValidity() {
|
||||||
this.formService.touchAllFormFields(this.formGroup);
|
this.formService.touchAllFormFields(this.formGroup);
|
||||||
if (!this.isFormValid()) { return; }
|
if (!this.isFormValid()) { return false; }
|
||||||
let errorMessages = [];
|
let errorMessages = [];
|
||||||
if(!this.hasTitle()) {
|
if(!this.hasTitle()) {
|
||||||
errorMessages.push("Title should be set.");
|
errorMessages.push("Title should be set.");
|
||||||
|
@ -414,8 +414,13 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
|
||||||
}
|
}
|
||||||
if(errorMessages.length > 0) {
|
if(errorMessages.length > 0) {
|
||||||
this.showValidationErrorsDialog(undefined, errorMessages);
|
this.showValidationErrorsDialog(undefined, errorMessages);
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
formSubmit(): void {
|
||||||
|
if (this.checkValidity())
|
||||||
this.onSubmit();
|
this.onSubmit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -548,11 +553,11 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
|
||||||
}
|
}
|
||||||
|
|
||||||
finalize() {
|
finalize() {
|
||||||
//const data = this.form.value;
|
if (this.checkValidity()) {
|
||||||
this.formGroup.get('status').setValue(DmpProfileStatus.Finalized);
|
this.formGroup.get('status').setValue(DmpProfileStatus.Finalized);
|
||||||
|
|
||||||
this.onSubmit();
|
this.onSubmit();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
downloadXML(): void {
|
downloadXML(): void {
|
||||||
this.dmpProfileService.downloadXML(this.dmpProfileId)
|
this.dmpProfileService.downloadXML(this.dmpProfileId)
|
||||||
|
|
Loading…
Reference in New Issue