feat(contracts): field-level validation on the New Contract form #215
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/mapps-211-contract-form-field-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?
Replace the single shared
errorbanner 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/stepattributes 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 gainmaxlength(and matching inline length checks) via documented caps. Start/End dates are cross-checked so End must be on or after Start.Add
maxlengthsupport to the sharedInputandTextareacomponents, 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>