This commit is contained in:
2019-04-04 17:20:42 +00:00
parent 8f6887d5f3
commit 67d46052c7
3 changed files with 26 additions and 48 deletions

View File

@@ -30,25 +30,10 @@ FIX:
- Server form validation errors displayed correctly
- 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: Found a way to trigger clearing but
- does it cause excessive re-validation??
- Remove server errors entirely if they were only related to the fields that are now removed from the details collection
- NOT NEEDED? - Possible solutions to old problem of not removing old server validation msgs:
- 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
- DONE Server form validation errors cleared in individual inputs upon any change to them and general if it only applies to validation
- On submit:
- Doesn't happen if any local validation errors
- All server errors clear on submit
- DONE: 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