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,9 +414,14 @@ 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;
|
||||||
}
|
}
|
||||||
this.onSubmit();
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
formSubmit(): void {
|
||||||
|
if (this.checkValidity())
|
||||||
|
this.onSubmit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public isFormValid() {
|
public isFormValid() {
|
||||||
|
@ -548,10 +553,10 @@ 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 {
|
||||||
|
|
Loading…
Reference in New Issue