feat(contracts): field-level validation on the New Contract form #215

Merged
nrupard merged 2 commits from feat/mapps-211-contract-form-field-validation into main 2026-06-16 15:51:57 +02:00
Owner

Replace the single shared error banner used for client validation with per-field error state on the New Contract form. Each failure now highlights its own field and shows the message under it; the banner is reserved for server/submit-time errors. All fields are validated and their errors collected before returning, so the form no longer aborts on the first failure and an empty required Company is flagged on its own field instead of being masked by an unrelated numeric error.

Value (USD), Line Item Qty, and Line Item Unit Price gain min/max/step attributes and reject negatives, over-scale, and out-of-range values with a field-level message. The Value validator distinguishes a non-numeric entry ("must be a number") from a numeric-but-too-large one ("is out of range"), fixing the misleading message a ~50-digit paste produced. Name, Contract Number, Notes, and Line Item Name gain maxlength (and matching inline length checks) via documented caps. Start/End dates are cross-checked so End must be on or after Start.

Add maxlength support to the shared Input and Textarea components, and unit tests covering the new validators.

#MAPPS-211

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Replace the single shared `error` banner used for client validation with per-field error state on the New Contract form. Each failure now highlights its own field and shows the message under it; the banner is reserved for server/submit-time errors. All fields are validated and their errors collected before returning, so the form no longer aborts on the first failure and an empty required Company is flagged on its own field instead of being masked by an unrelated numeric error. Value (USD), Line Item Qty, and Line Item Unit Price gain `min`/`max`/`step` attributes and reject negatives, over-scale, and out-of-range values with a field-level message. The Value validator distinguishes a non-numeric entry ("must be a number") from a numeric-but-too-large one ("is out of range"), fixing the misleading message a ~50-digit paste produced. Name, Contract Number, Notes, and Line Item Name gain `maxlength` (and matching inline length checks) via documented caps. Start/End dates are cross-checked so End must be on or after Start. Add `maxlength` support to the shared `Input` and `Textarea` components, and unit tests covering the new validators. #MAPPS-211 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(contracts): field-level validation on the New Contract form
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m50s
e1f9e84ef9
Replace the single shared `error` banner used for client validation with per-field error state on the New Contract form. Each failure now highlights its own field and shows the message under it; the banner is reserved for server/submit-time errors. All fields are validated and their errors collected before returning, so the form no longer aborts on the first failure and an empty required Company is flagged on its own field instead of being masked by an unrelated numeric error.

Value (USD), Line Item Qty, and Line Item Unit Price gain `min`/`max`/`step` attributes and reject negatives, over-scale, and out-of-range values with a field-level message. The Value validator distinguishes a non-numeric entry ("must be a number") from a numeric-but-too-large one ("is out of range"), fixing the misleading message a ~50-digit paste produced. Name, Contract Number, Notes, and Line Item Name gain `maxlength` (and matching inline length checks) via documented caps. Start/End dates are cross-checked so End must be on or after Start.

Add `maxlength` support to the shared `Input` and `Textarea` components, and unit tests covering the new validators.

#MAPPS-211

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into feat/mapps-211-contract-form-field-validation
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m5s
Create release / Create release from merged PR (pull_request) Has been skipped
c54d02da52
# Conflicts:
#	src/components/form.rs
nrupard deleted branch feat/mapps-211-contract-form-field-validation 2026-06-16 15:51:57 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!215
No description provided.