From c4a495bb9ac15919f4aaf868bd255b3eb4d90085 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 3 Apr 2019 00:04:44 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 55 ++++++++++++++++++++- ayanova/src/api/gzvalidate.js | 10 ++-- ayanova/src/views/inventory-widget-edit.vue | 16 +++--- 3 files changed, 67 insertions(+), 14 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 5677f0e5..8d33b3ec 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -14,12 +14,63 @@ TODO CLIENT STUFF TODO NEXT +Make the stuff happen to resolve the first open issue below + Issues: -won't show multiple lines in v-alert from my code but will if static element with
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 +PENDING FIXED ISSUE: won't show multiple lines in v-alert from my code but will if static element with
at end of each line + +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 - 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? diff --git a/ayanova/src/api/gzvalidate.js b/ayanova/src/api/gzvalidate.js index e37862b8..bbe64602 100644 --- a/ayanova/src/api/gzvalidate.js +++ b/ayanova/src/api/gzvalidate.js @@ -332,7 +332,7 @@ Here are all the API level error codes that can be returned by the API server: //Keep top part if statement for gathering all overall errors, but then also run the field errors block and check for field errors where "target" is empty and add them in to the return as well //GENERAL ERROR - if (ref == "errorbox") { + if (ref == "errorbox") { //Add any general errors to ret var err = v.$gzlocale.get("ErrorAPI" + apiErrorCode.toString()); if (v.serverError.message) { @@ -347,7 +347,7 @@ Here are all the API level error codes that can be returned by the API server: //See if this key is in the details array var errorsForField = []; - if (ref == "errorbox") { + if (ref == "errorbox") { errorsForField = v.$_.filter(v.serverError.details, function(o) { return !o.target; }); @@ -408,8 +408,11 @@ Here are all the API level error codes that can be returned by the API server: // ERROR BOX ERRORS // displays any messages for error box on form which is the generic catch all for non field specific errors from server ErrorBoxErrors(v) { + console.log("gzvalidate::ErrorBoxErrors called..."); + console.log(v); var errs = this.ServerErrors(v, "errorbox"); if (errs.length < 1) { + console.log("gzvalidate::ErrorBoxErrors - RETURN NO ERRORS, short circuit return"); 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++) { ret += errs[i] + "\r\n"; } - ret=ret.replace("\r\n","
"); + // ret=ret.replace("\r\n","
"); + console.log("gzvalidate::ErrorBoxErrors - RETURN WITH ERRORS"); return ret; } }; diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index fd118730..d81a8630 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -3,7 +3,7 @@ - + + {{this.$gzv.ErrorBoxErrors(this)}} + >
{{this.$gzv.ErrorBoxErrors(this)}}
blah blah" + "\n test line 3" + "\r\n Test line 4" }; }, methods: {