Allow validation of workflow while viewing a diagram.
This commit is contained in:
parent
7f96ad5653
commit
b97c5fe396
|
@ -57,6 +57,8 @@
|
|||
|
||||
<button mat-button (click)="saveChanges()" [disabled]="!hasChanged()"><mat-icon>save</mat-icon></button>
|
||||
|
||||
<button mat-button (click)="validate()" [disabled]="hasChanged()"><mat-icon>verified_user</mat-icon></button>
|
||||
|
||||
<button mat-button [matMenuTriggerFor]="downloadMenu" title="Download diagram">
|
||||
<mat-icon>save_alt</mat-icon>
|
||||
<mat-icon>arrow_drop_down</mat-icon>
|
||||
|
|
|
@ -148,6 +148,16 @@ export class ModelerComponent implements AfterViewInit {
|
|||
}
|
||||
}
|
||||
|
||||
validate() {
|
||||
this.api.validateWorkflowSpecification(this.diagramFileMeta.workflow_spec_id).subscribe(apiErrors => {
|
||||
if (apiErrors && apiErrors.length > 0) {
|
||||
this.bottomSheet.open(ApiErrorsComponent, {data: {apiErrors: apiErrors}});
|
||||
} else {
|
||||
this.snackBar.open('Workflow specification is valid!', 'Ok', {duration: 5000});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
hasChanged(): boolean {
|
||||
return this.xml !== this.draftXml;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue