This commit is contained in:
@@ -14,12 +14,63 @@ TODO CLIENT STUFF
|
|||||||
|
|
||||||
TODO NEXT
|
TODO NEXT
|
||||||
|
|
||||||
|
Make the stuff happen to resolve the first open issue below
|
||||||
|
|
||||||
Issues:
|
Issues:
|
||||||
|
|
||||||
won't show multiple lines in v-alert from my code but will if static element with <br/> at end of each line
|
PENDING FIXED ISSUE: won't show multiple lines in v-alert from my code but will if static element with <br/> at end of each line
|
||||||
Not sure this is the correct approach, it's needing to iterate the return error object multiple times which is a code smell
|
|
||||||
|
ISSUE: Not sure this is the correct approach, it's needing to iterate the return error object multiple times which is a code smell
|
||||||
- Once to see if there are errors and another time to build up the errors
|
- Once to see if there are errors and another time to build up the errors
|
||||||
- Maybe it should be called once only as a method after the server returns the results and the gzvalidate populates a key on the data object in the form which in turn drives the error box?
|
- Maybe it should be called once only as a method after the server returns the results and the gzvalidate populates a key on the data object in the form which in turn drives the error box?
|
||||||
|
FIX:
|
||||||
|
Need to test with full features, so plow ahead getting to a normal cycle of errors and then go back and fix the things that don't work later
|
||||||
|
Scenarios:
|
||||||
|
- DONE: Local form validation errors display correctly and are cleared when edited
|
||||||
|
- Server form validation errors displayed correctly
|
||||||
|
- control ones under control where local form validation errors show
|
||||||
|
- whole object ones at top
|
||||||
|
- Server form validation errors cleared in individual inputs upon any change to them (but form overall ones stay until submitted)
|
||||||
|
- On submit:
|
||||||
|
- Doesn't happen if any local validation errors
|
||||||
|
- All server errors clear on submit
|
||||||
|
- Validation short circuits if form is loading and no data yet
|
||||||
|
- Validation short circuits if no server errors at all
|
||||||
|
|
||||||
|
DIRTY CHECKING to short circuit rule checks
|
||||||
|
|
||||||
|
direct control properties when control was changed / is dirty:
|
||||||
|
=-=-=-=-
|
||||||
|
hasColor: true
|
||||||
|
hasFocused: undefined
|
||||||
|
hasInput: true
|
||||||
|
hasMouseDown: undefined
|
||||||
|
initialValue: 8212
|
||||||
|
internalChange: true
|
||||||
|
isClearing: undefined
|
||||||
|
isFocused: true
|
||||||
|
isResetting: undefined
|
||||||
|
lazySelection: undefined
|
||||||
|
lazyValue: "82121"
|
||||||
|
|
||||||
|
|
||||||
|
Same properties when control was NOT changed:
|
||||||
|
=-=-=-
|
||||||
|
hasColor: undefined
|
||||||
|
hasFocused: undefined
|
||||||
|
hasInput: true
|
||||||
|
hasMouseDown: undefined
|
||||||
|
initialValue: null
|
||||||
|
internalChange: undefined
|
||||||
|
isClearing: undefined
|
||||||
|
isFocused: undefined
|
||||||
|
isResetting: undefined
|
||||||
|
lazySelection: undefined
|
||||||
|
lazyValue: undefined
|
||||||
|
|
||||||
|
LOADING CHECKING to short circuit rule checks when form is first loading
|
||||||
|
|
||||||
|
Vuetify Inputs have a loading property, can that be used to super short circuit rule checking?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -408,8 +408,11 @@ Here are all the API level error codes that can be returned by the API server:
|
|||||||
// ERROR BOX ERRORS
|
// ERROR BOX ERRORS
|
||||||
// displays any messages for error box on form which is the generic catch all for non field specific errors from server
|
// displays any messages for error box on form which is the generic catch all for non field specific errors from server
|
||||||
ErrorBoxErrors(v) {
|
ErrorBoxErrors(v) {
|
||||||
|
console.log("gzvalidate::ErrorBoxErrors called...");
|
||||||
|
console.log(v);
|
||||||
var errs = this.ServerErrors(v, "errorbox");
|
var errs = this.ServerErrors(v, "errorbox");
|
||||||
if (errs.length < 1) {
|
if (errs.length < 1) {
|
||||||
|
console.log("gzvalidate::ErrorBoxErrors - RETURN NO ERRORS, short circuit return");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,7 +421,8 @@ Here are all the API level error codes that can be returned by the API server:
|
|||||||
for (var i = 0; i < errs.length; i++) {
|
for (var i = 0; i < errs.length; i++) {
|
||||||
ret += errs[i] + "\r\n";
|
ret += errs[i] + "\r\n";
|
||||||
}
|
}
|
||||||
ret=ret.replace("\r\n"," <br/> ");
|
// ret=ret.replace("\r\n"," <br/> ");
|
||||||
|
console.log("gzvalidate::ErrorBoxErrors - RETURN WITH ERRORS");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<v-flex>
|
<v-flex>
|
||||||
<v-form ref="form">
|
<v-form ref="form">
|
||||||
<v-layout align-center justify-left row wrap>
|
<v-layout align-center justify-left row wrap>
|
||||||
<v-flex xs12 px-2>
|
<!-- <v-flex xs12 px-2>
|
||||||
<v-alert
|
<v-alert
|
||||||
color="warning"
|
color="warning"
|
||||||
icon="fa-exclamation-circle "
|
icon="fa-exclamation-circle "
|
||||||
@@ -11,13 +11,10 @@
|
|||||||
transition="scale-transition"
|
transition="scale-transition"
|
||||||
outline
|
outline
|
||||||
>
|
>
|
||||||
|
<div style="word-wrap: break-word;">{{someerror}}</div>
|
||||||
line one<br/>
|
|
||||||
line two
|
|
||||||
|
|
||||||
</v-alert>
|
</v-alert>
|
||||||
</v-flex>
|
</v-flex> -->
|
||||||
<v-flex xs12 px-2>
|
<v-flex xs12 mt-1 mb-2>
|
||||||
<v-alert
|
<v-alert
|
||||||
ref="errorbox"
|
ref="errorbox"
|
||||||
v-show="this.$gzv.ErrorBoxErrors(this)"
|
v-show="this.$gzv.ErrorBoxErrors(this)"
|
||||||
@@ -26,7 +23,7 @@
|
|||||||
value="true"
|
value="true"
|
||||||
transition="scale-transition"
|
transition="scale-transition"
|
||||||
outline
|
outline
|
||||||
>{{this.$gzv.ErrorBoxErrors(this)}}</v-alert>
|
><pre>{{this.$gzv.ErrorBoxErrors(this)}}</pre></v-alert>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
@@ -176,7 +173,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
obj: {},
|
obj: {},
|
||||||
serverError: {},
|
serverError: {},
|
||||||
formReady: false
|
formReady: false,
|
||||||
|
someerror: "blah blahv <br/> blah blah" + "\n test line 3" + "\r\n Test line 4"
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Reference in New Issue
Block a user