ciyidogan commited on
Commit
abea6d7
·
verified ·
1 Parent(s): ccdbef1

Update flare-ui/src/app/dialogs/version-edit-dialog/version-edit-dialog.component.ts

Browse files
flare-ui/src/app/dialogs/version-edit-dialog/version-edit-dialog.component.ts CHANGED
@@ -55,6 +55,7 @@ export default class VersionEditDialogComponent implements OnInit {
55
  saving = false;
56
  publishing = false;
57
  creating = false;
 
58
 
59
  selectedTabIndex = 0;
60
  testUserMessage = '';
@@ -83,6 +84,11 @@ export default class VersionEditDialogComponent implements OnInit {
83
  if (this.selectedVersion) {
84
  this.loadVersion(this.selectedVersion);
85
  }
 
 
 
 
 
86
  }
87
 
88
  initializeForm() {
@@ -153,6 +159,8 @@ export default class VersionEditDialogComponent implements OnInit {
153
  (version.intents || []).forEach(intent => {
154
  this.intents.push(this.createIntentFormGroup(intent));
155
  });
 
 
156
  }
157
 
158
  async loadVersions() {
@@ -490,6 +498,8 @@ export default class VersionEditDialogComponent implements OnInit {
490
  ).toPromise();
491
 
492
  this.snackBar.open('Version saved successfully', 'Close', { duration: 3000 });
 
 
493
 
494
  if (result) {
495
  this.selectedVersion = result;
 
55
  saving = false;
56
  publishing = false;
57
  creating = false;
58
+ isDirty = false;
59
 
60
  selectedTabIndex = 0;
61
  testUserMessage = '';
 
84
  if (this.selectedVersion) {
85
  this.loadVersion(this.selectedVersion);
86
  }
87
+
88
+ this.versionForm.valueChanges.subscribe(() => {
89
+ this.isDirty = true;
90
+ });
91
+
92
  }
93
 
94
  initializeForm() {
 
159
  (version.intents || []).forEach(intent => {
160
  this.intents.push(this.createIntentFormGroup(intent));
161
  });
162
+
163
+ this.isDirty = false;
164
  }
165
 
166
  async loadVersions() {
 
498
  ).toPromise();
499
 
500
  this.snackBar.open('Version saved successfully', 'Close', { duration: 3000 });
501
+
502
+ this.isDirty = false;
503
 
504
  if (result) {
505
  this.selectedVersion = result;