diff --git a/src/app/modeler/modeler.component.html b/src/app/modeler/modeler.component.html index 8a598bc..d6c040d 100644 --- a/src/app/modeler/modeler.component.html +++ b/src/app/modeler/modeler.component.html @@ -28,15 +28,20 @@ arrow_drop_down - f.id !== this.fileMetaId); + } + static isXmlFile(file: File) { return file.type.toLowerCase() === 'text/xml' || file.type.toLowerCase() === 'application/xml' || @@ -166,6 +170,25 @@ export class ModelerComponent implements AfterViewInit { } } + checkChangeBPMN(b: FileMeta) { + if (this.hasChanged()) { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + maxWidth: '300px', + data: { + title: 'Unsaved Changes!', + message: 'Are you sure you want to abandon changes?', + }, + }); + dialogRef.afterClosed().subscribe(dialogResult => { + if (dialogResult) { + this.router.navigate(['/modeler', this.workflowSpecId, b.id]); + } + }); + } else { + this.router.navigate(['/modeler', this.workflowSpecId, b.id]) + } + } + onFileSelected($event: Event) { this.diagramFile = ($event.target as HTMLFormElement).files[0]; this.onSubmitFileToOpen();