Commit 82668c9da23b6f92a45ff973afa07aae3b684371
1 parent
10b9e9c9
fix bug Json edit dialog: add validate
Showing
1 changed file
with
2 additions
and
2 deletions
@@ -194,7 +194,7 @@ export class JsonObjectEditComponent implements OnInit, ControlValueAccessor, Va | @@ -194,7 +194,7 @@ export class JsonObjectEditComponent implements OnInit, ControlValueAccessor, Va | ||
194 | } | 194 | } |
195 | 195 | ||
196 | beautifyJSON() { | 196 | beautifyJSON() { |
197 | - if (this.jsonEditor) { | 197 | + if (this.jsonEditor && this.objectValid) { |
198 | const res = JSON.stringify(this.modelValue, null, 2); | 198 | const res = JSON.stringify(this.modelValue, null, 2); |
199 | this.jsonEditor.setValue(res ? res : '', -1); | 199 | this.jsonEditor.setValue(res ? res : '', -1); |
200 | this.updateView(); | 200 | this.updateView(); |
@@ -202,7 +202,7 @@ export class JsonObjectEditComponent implements OnInit, ControlValueAccessor, Va | @@ -202,7 +202,7 @@ export class JsonObjectEditComponent implements OnInit, ControlValueAccessor, Va | ||
202 | } | 202 | } |
203 | 203 | ||
204 | minifyJSON() { | 204 | minifyJSON() { |
205 | - if (this.jsonEditor) { | 205 | + if (this.jsonEditor && this.objectValid) { |
206 | const res = JSON.stringify(this.modelValue); | 206 | const res = JSON.stringify(this.modelValue); |
207 | this.jsonEditor.setValue(res ? res : '', -1); | 207 | this.jsonEditor.setValue(res ? res : '', -1); |
208 | this.updateView(); | 208 | this.updateView(); |