This commit is contained in:
@@ -14,7 +14,7 @@ TODO CLIENT STUFF
|
||||
|
||||
TODO NEXT
|
||||
|
||||
Make the stuff happen to resolve the first open issue below
|
||||
### THERE!
|
||||
|
||||
Issues:
|
||||
|
||||
@@ -31,6 +31,20 @@ FIX:
|
||||
- DONE control ones under control where local form validation errors show
|
||||
- DONE 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)
|
||||
- ###### HERE!!!!!!!!
|
||||
- Current issue: can't seem to remove the error from the control
|
||||
- The code to remove the server error from the data works fine, however it doesn't update the control and remove the server error until I edit any field to trigger validation again
|
||||
- Possible solutions:
|
||||
- LAST DITCH BEFORE ABANDONING THIS SYSTEM: Try making the whole form validate in the component and separately in gzvalidate
|
||||
- Move all server errors to the server error box and don't put them into the fields local validation errors (keep the two separate and try to avoid as many server errors as possible)
|
||||
- This might make sense since in reality we should almost never see a server error for a field unless a complex business rule is being broken or something, low level validation should handle it at the form level
|
||||
- Also, all this code is starting to get too complex and ugly and I'm worried about future proofing so a simpler method might be far better
|
||||
- Maybe like this: on submit clear local errors, put all server errors that come back into the form data locally so it gets picked up by the errorbox and don't involve gzvalidate at all!!
|
||||
- This way we don't need to use gzvalidate for anything but local shit
|
||||
- Also it separates the server error stuff from the validation stuff very neatly so there is no need for a lot of fragile fateful futurefrail fuckery
|
||||
|
||||
|
||||
|
||||
- On submit:
|
||||
- Doesn't happen if any local validation errors
|
||||
- All server errors clear on submit
|
||||
|
||||
@@ -477,10 +477,19 @@ Here are all the API level error codes that can be returned by the API server:
|
||||
return o.target == ref;
|
||||
});
|
||||
|
||||
//if a target was hit then need to trigger validate again for it to remove the error message
|
||||
if (m.length > 0) {
|
||||
var ctrl = getControl(v, ref);
|
||||
ctrl.errorMessages=[];
|
||||
}
|
||||
// //if a target was hit then need to trigger validate again for it to remove the error message
|
||||
//NOTHING SEEMS TO BE ABLE TO TRIGGER THIS
|
||||
|
||||
// if (m.length > 0) {
|
||||
// var ctrl = getControl(v, ref);
|
||||
// //ctrl.validate(true);
|
||||
// // ctrl.errorMessages.length=0;
|
||||
|
||||
// // var frm=getControl(v,"form");
|
||||
// // frm.validate();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<v-layout v-if="this.formReady">
|
||||
<v-flex>
|
||||
<v-form ref="form">
|
||||
<v-layout align-center justify-left row wrap>
|
||||
<v-layout align-center justify-left row wrap>
|
||||
<v-flex xs12 mt-1 mb-2>
|
||||
<v-alert
|
||||
ref="errorbox"
|
||||
@@ -178,13 +178,13 @@ export default {
|
||||
someerror:
|
||||
"blah blahv <br/> blah blah" + "\n test line 3" + "\r\n Test line 4"
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
Change(ref){
|
||||
},
|
||||
methods: {
|
||||
Change(ref) {
|
||||
//debugger;
|
||||
//console.log("CHANGE - " + ref);
|
||||
this.$gzv.Change(this,ref);
|
||||
} ,
|
||||
this.$gzv.Change(this, ref);
|
||||
},
|
||||
getDataFromApi() {
|
||||
var url = "Widget/" + this.$route.params.id;
|
||||
this.$gzapi.get(url).then(res => {
|
||||
@@ -198,8 +198,14 @@ export default {
|
||||
|
||||
var that = this;
|
||||
var url = "Widget/" + this.$route.params.id;
|
||||
//clear any errors that might be around from previous submit
|
||||
this.serverErrors = [];
|
||||
|
||||
//clear any errors that might be around from previous submit
|
||||
for (var variableKey in this.serverError) {
|
||||
if (this.serverError.hasOwnProperty(variableKey)) {
|
||||
delete this.serverError[variableKey];
|
||||
}
|
||||
}
|
||||
|
||||
this.$gzapi
|
||||
.upsert(url, this.obj)
|
||||
.then(res => {
|
||||
|
||||
Reference in New Issue
Block a user