TL;DR: Fixing some quite a few form validation bugs/quirks.
The goals of this PR:
Fix a couple of bugs
When applicable, update ErrorNotification live to keep it in sync with in-line validations. (The previous behavior had ErrorNotification only updating on submissions, not validations.)
Refactor to make validation slightly more consistent across the app and to eliminate duplicative actions (namely, setAlertErrorAction followed by setValidationAlertErrorsAction).
In the future, we will probably move away from the ErrorNotification altogether--similar to how things work with the new petitioner flow--but this at least keeps behavior consistent until then and hopefully will make a refactor easier.
An outline of the issues addressed:
After (almost) every field edit on the petitions clerk create case form, we were scrolling back to the ErrorNotification banner. (This was the original error of 10074).
2. In certain cases on the petitions clerk create case form, the form scrolled weirdly. (This was design debt 10357.) Not fixed!
In the PetitionsPayment forms, blank Payment Dates and Payment Methods led to 400 errors rather than validation errors. (See video below.)
Certain onBlurs/onChanges weren't providing live validation. (E.g., Status Report Order validation was not providing live validation updates.) There are probably still some that I have missed.
TL;DR: Fixing
somequite a few form validation bugs/quirks.The goals of this PR:
ErrorNotification
live to keep it in sync with in-line validations. (The previous behavior hadErrorNotification
only updating on submissions, not validations.)setAlertErrorAction
followed bysetValidationAlertErrorsAction
).In the future, we will probably move away from the
ErrorNotification
altogether--similar to how things work with the new petitioner flow--but this at least keeps behavior consistent until then and hopefully will make a refactor easier.An outline of the issues addressed:
ErrorNotification
banner. (This was the original error of 10074).2. In certain cases on the petitions clerk create case form, the form scrolled weirdly. (This was design debt 10357.)Not fixed!PetitionsPayment
forms, blank Payment Dates and Payment Methods led to 400 errors rather than validation errors. (See video below.)https://github.com/user-attachments/assets/f6888b74-2aa3-4bea-b6ae-90ed7cdf33e7