MPDX-9768 - Remove required asterisk from MHA amount fields in MhaRequestSection#1853
Conversation
…since they are not required from the user
|
Preview branch generated at https://remove-required-asterisks.d3dytjb8adxkk5.amplifyapp.com |
Bundle sizes [mpdx-react]Compared against 8387c2f No significant changes found |
zweatshirt
left a comment
There was a problem hiding this comment.
🤖 Multi-Agent Code Review — ✅ CLEAN
Verdict: CLEAN — no issues found across 5 specialized agents (Architecture, Testing, Standards, UX, Financial Reporting). Unanimous, high confidence.
What this PR does
Removes the MUI required prop (the asterisk + aria-required) from the mhaAmount and spouseMhaAmount AutosaveTextField inputs in MhaRequestSection.tsx.
Why it's correct
requiredis a passthrough to MUITextField— purely visual. Validation is driven by the separateschemaprop.- The Yup schema in
useMhaRequestData.tsbuilds these fields viaamount(...)without{ required: true }, andyupHelpers.tsonly attaches.required()when that flag is set. So these fields were never validated as required — the asterisk was misleading. Removing it aligns the UI with the actual (optional) validation and removes a falsearia-required(an a11y improvement). - Convention confirmed: every sibling SalaryCalculator field pairs the visual
requiredprop withrequired: truein its schema (MaxAllowableSection,RequestedSalaryCard,ApprovalProcessCard,EffectiveDateStep).MhaRequestSectionwas the lone outlier; this diff brings it in line. - Financially inert: empty amounts safely coalesce to
0via?? 0across all consumers;progressPercentagedivisor is guarded. No NaN / divide-by-zero risk. - No stale tests: no test asserts the asterisk or
aria-requiredon these fields, so no test update was required.
Risk
Score 1/10 (LOW). Reviewer level: ANY. Single consumer (YourInformation.tsx); no breaking changes.
| Agent | Critical | High | Important | Suggestions |
|---|---|---|---|---|
| Architecture | 0 | 0 | 0 | 0 |
| Testing | 0 | 0 | 0 | 0 |
| Standards | 0 | 0 | 0 | 0 |
| UX | 0 | 0 | 0 | 0 |
| Financial Reporting | 0 | 0 | 0 | 0 |
There was a problem hiding this comment.
AI Review Auto-Approval
Risk Level: LOW (1/10)
Verdict: CLEAN (no issues found)
This PR was auto-approved because:
- The multi-agent AI review determined it is low risk
- No blocking issues were found
If you believe this PR needs human review, dismiss this approval and request a review manually.
Description
These two fields do not require input from the user. This PR removes the
requiredprop.https://jira.cru.org/browse/MPDX-9768
Testing
Checklist:
/pr-reviewcommand locally and fixed any relevant suggestions