fix(projects): client-side inline validation on project forms [MAPPS-176] #154
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/MAPPS-176-project-form-validation"
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
Client-side counterpart to PMS-324: the project create and edit forms in mokosh-apps did almost no inline validation, so over-long names and bad budgets were sent to the server and the resulting errors surfaced as a generic "request failed" (MAPPS-176).
Changes
validate_project_name(required, trimmed, <= 80 chars) andvalidate_budget(optional; non-negative number with at most 2 decimal places), mirroring the server rules from PMS-324.ProjectNewPage) and the edit modal (on_save) to validate per field before submit, blocking submission and showing the message inline on the offending field via the existingInput { error }prop. Added per-field error signals for name / budget amount / budget hours in both forms.Verification
cargo test --lib validation_tests(container): green.cargo clippy --all-targets -- -D warnings,cargo fmt --all --check,cargo check --target wasm32-unknown-unknown: green.Server-side validation (the actual 422/500 fixes) is in PMS-324 (linked).
#MAPPS-176