refactor(forms): report-all errors on contacts + asset-edit forms (PMS-518) #357
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-518-report-all-polish"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Follow-up polish on the PMS-518 migration (the bulk #356 and billing #354 are now merged). Converts the forms that were left short-circuiting to the report-all pattern, so every invalid field surfaces at once (each in its own inline slot) with the first invalid field focused - matching the rest of the migrated forms.
Changes
note_invalidin field order, singleif guard.blocked() { return; }, then unwrap the carried validator results. The Contact company-XOR error and the Site name error stay on the form-level banner (no inline slot); everything else is per-field. Bespoke validators kept (they parse-and-return the typed values the bodies use).Behaviour
No change beyond surfacing all errors together; values sent to the server are unchanged.
Verification
just checkparity via the rust-builder image:clippy --all-targets -- -D warnings,fmt --check,cargo check --target wasm32-unknown-unknown- all green.Follow-up polish on this branch: the contacts forms (Company / Contact / Site) and the Edit Asset modal were left short-circuiting (return on the first failed field) when they were first migrated - focus-first was added but only one error showed at a time. Convert them to the accumulate-then-bail pattern so every invalid field surfaces together, each in its own inline slot, with the first invalid field focused. - contacts CompanyForm / ContactForm / SiteFormModal: validate every field, set each field's inline err (Contact's company XOR + Site's name stay on the banner since they have no inline slot), guard.note_invalid in field order, single `if guard.blocked() { return; }`, then unwrap the carried validator results. Bespoke validators kept (they parse-and-return the typed values the body uses). - assets Edit Asset modal: add per-field inline slots for Name / Serial / Manufacturer / Model (matching the New Asset form), accumulate all four validations, bail+focus once. No behavior change beyond surfacing all errors together; values sent to the server are unchanged. just check parity (rust-builder image): clippy --all-targets -D warnings, fmt --check, cargo check --target wasm32-unknown-unknown all green. #PMS-518