diff --git a/src/app/modeler/modeler.component.html b/src/app/modeler/modeler.component.html index 33d5d7f..cf3dfc1 100644 --- a/src/app/modeler/modeler.component.html +++ b/src/app/modeler/modeler.component.html @@ -1,6 +1,6 @@ - + arrow_back Back diff --git a/src/app/modeler/modeler.component.ts b/src/app/modeler/modeler.component.ts index e6e3f65..36b2d34 100644 --- a/src/app/modeler/modeler.component.ts +++ b/src/app/modeler/modeler.component.ts @@ -125,10 +125,19 @@ export class ModelerComponent implements AfterViewInit { getFileName() { return this.diagramFile ? this.diagramFile.name : this.fileName || 'No file selected'; } - + checkSaved(){ + if (this.hasChanged()) { + const approve = window.confirm('Unsaved Changes - Are you sure?'); + if (approve) { + this.router.navigate(['/home', this.workflowSpec.name]); + } + } else { + this.router.navigate(['/home', this.workflowSpec.name]); + } + } onFileSelected($event: Event) { this.diagramFile = ($event.target as HTMLFormElement).files[0]; - this.onSubmitFileToOpen() + this.onSubmitFileToOpen(); this.isNew = true; }