Skip to content

MPDX-9866 Disable all inputs of read-only goal calculations#1932

Open
wjames111 wants to merge 1 commit into
mainfrom
MPDX-9866
Open

MPDX-9866 Disable all inputs of read-only goal calculations#1932
wjames111 wants to merge 1 commit into
mainfrom
MPDX-9866

Conversation

@wjames111

Copy link
Copy Markdown
Contributor

Description

  • Depends on CruGlobal/mpdx_api#3472, which adds the GoalCalculation.readOnly field and rejects all mutations (including deletion) against read-only goals. Read-only goals are created automatically when a new staff member reports (MPDX-9865).
  • Fetch the new readOnly field in the goal calculator and goals list queries, and expose isReadOnly through GoalCalculatorContext.
  • Disable every input of a read-only goal while still showing the inputs and calculated totals: all autosave fields (via the central useGoalAutoSave hook), the SECA status select, the geographic location autocomplete, budget grid cell editing, Add Line Item and delete line-item actions, the Lump Sum/Line Item mode toggle, and the lump sum total field.
  • Guard the two effects that fire mutations automatically (incompatible benefits plan clearing and default line-item repopulation) so they don't run against read-only goals.
  • Hide the Delete button and show a "Read-Only" chip on read-only goal cards in the goals list (GoalCard.onDelete is now optional).
  • Related Jira: MPDX-9866, MPDX-9865

Note: until the API PR reaches staging, yarn gql on this branch needs a staging schema snapshot with readOnly grafted on (API_URL=<snapshot file> yarn gql).

Testing

  • Mark a goal calculation as read-only (until MPDX-9865's conversion is live, set it directly: UPDATE goal_calculations SET read_only = true WHERE id = '...' on staging, or mock readOnly: true locally)
  • Go to HR Tools → Goal Calculator
  • Check that the read-only goal's card shows a "Read-Only" chip and no Delete button, while other goals still have one
  • Open the read-only goal with View
  • Check that every field in Calculator Settings (goal name, personal, financial) is disabled but still shows its saved value
  • Check that in Household/Ministry Expenses the Lump Sum/Line Item toggle and Add Line Item are disabled, rows can't be edited by double-clicking, no delete icons appear on hover, and category totals still display
  • Check that the Summary Report still renders the calculated totals
  • Open a normal (non-read-only) goal and check everything is still editable

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels (Add the label "Preview" to automatically create a preview environment)
  • I have run the Claude Code /pr-review command locally and fixed any relevant suggestions
  • I have requested a review from another person on the project
  • I have tested my changes in preview or in staging
  • I have cleaned up my commit history

🤖 Generated with Claude Code

Senior staff goals converted from new staff goals (MPDX-9865) are marked
readOnly by the API and reject every mutation. Fetch the new readOnly field,
expose isReadOnly through GoalCalculatorContext, and disable all calculator
inputs (autosave fields, SECA select, geographic location autocomplete, budget
grids' cell editing, add/delete line items, and lump sum/line item toggles)
while still showing the inputs and calculated totals. Hide the delete button
and show a Read-Only badge on read-only goal cards.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wjames111 wjames111 self-assigned this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant