41
41
/>
42
42
</b-collapse >
43
43
44
+ <b-row v-if =" !firstEvaluation && !loadingData" align-h =" center" justify-content-md-center >
45
+ <b-col lg =" 4" sm =" 6" >
46
+ <b-alert v-if =" allJSONValid === false" show variant =" danger" >
47
+ Invalid JSON. Scroll for errors.
48
+ </b-alert >
49
+ <b-alert v-else-if =" ajvSchemaError.length !== 0" show variant =" danger" >
50
+ JSON Schema invalid. Scroll for errors.
51
+ </b-alert >
52
+ <b-alert v-else-if =" ajvValidationSuccess === null" show variant =" info" >
53
+ Checking validation
54
+ </b-alert >
55
+ <b-alert v-if =" ajvValidationSuccess === true" show variant =" success" >
56
+ Instance Validation Successful
57
+ </b-alert >
58
+ <b-alert v-if =" ajvValidationSuccess === false" show variant =" danger" >
59
+ Instance Validation Failed. Scroll for errors.
60
+ </b-alert >
61
+ </b-col >
62
+ </b-row >
63
+
44
64
<b-row class =" mb-3 no-gutters vld-parent" >
45
65
<loading
46
66
:active =" loadingData"
@@ -135,6 +155,7 @@ export default {
135
155
errorMessage: null ,
136
156
infoMessage: null ,
137
157
loadingData: true ,
158
+ firstEvaluation: true ,
138
159
checkingValidation: false ,
139
160
schema: null ,
140
161
primarySchemaText: defaultPrimarySchemaText,
@@ -146,6 +167,8 @@ export default {
146
167
editorTheme: ' default' ,
147
168
showFeatures: false ,
148
169
showSettings: false ,
170
+ // Expect this will be determined using a computed at some point
171
+ numberOfEditors: 2 ,
149
172
};
150
173
},
151
174
computed: {
@@ -185,6 +208,10 @@ export default {
185
208
handler : function () {
186
209
this .ajvValidationSuccess = null ;
187
210
this .validateIfPossible ();
211
+ const lintResults = Object .values (this .jsonLintValid );
212
+ if (lintResults .length === this .numberOfEditors && lintResults .every (v => v !== null )){
213
+ this .$set (this , ' firstEvaluation' , false );
214
+ }
188
215
},
189
216
deep: true ,
190
217
},
@@ -260,11 +287,10 @@ export default {
260
287
Vue .set (this , ' instanceText' , localStorage .getItem (' instanceText' ));
261
288
}
262
289
},
263
- validate : function () {
290
+ validate : async function () {
264
291
if (this .loadingData ){
265
292
return ;
266
293
}
267
- this .checkingValidation = true ;
268
294
this .ajvValidationSuccess = null ;
269
295
this .ajvSchemaError = [];
270
296
this .ajvValidationErrors = [];
@@ -303,6 +329,7 @@ export default {
303
329
},
304
330
validateIfPossible: _ .debounce (function () {
305
331
if (this .allJSONValid ) {
332
+ this .$set (this , ' checkingValidation' , true );
306
333
this .validate ();
307
334
}
308
335
}, 300 ),
0 commit comments