Skip to content

feat: add readOnly prop to PayrollOverview - #2616

Draft
dmortal wants to merge 2 commits into
mainfrom
feat/payroll-overview-readonly
Draft

feat: add readOnly prop to PayrollOverview#2616
dmortal wants to merge 2 commits into
mainfrom
feat/payroll-overview-readonly

Conversation

@dmortal

@dmortal dmortal commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a readOnly prop to PayrollOverview so a partner can render a submit-only review
of a specific, already-calculated payroll — hiding Edit and Cancel while keeping Submit
and receipt/paystub actions available. This brings the SDK to parity with gws-flows'
RUN_PAYROLL_READ_ONLY flow type, which similarly locks a payroll deep link down to
show/submit only (no edit, no cancel).

Changes

  • PayrollOverview: new readOnly?: boolean prop (default false); when set, suppresses
    the Edit action, the processing-failure retry CTA, and folds into the existing
    cancellability check so Cancel is hidden too.
  • PayrollOverviewPresentation: new canEdit?: boolean prop (default true) gating the
    Edit button, mirroring the existing canCancel pattern.
  • Added test coverage for both components and a new PayrollOverviewReadOnly Storybook story.
  • Regenerated docs/reference/payroll/blocks.md from updated TSDoc.

Testing

  • npm run test -- --run src/components/Payroll/PayrollOverview — 40 tests pass, including
    new cases for Edit/Cancel suppression and Submit remaining functional in read-only mode.
  • npx tsc --noEmit and npx eslint — clean (only a pre-existing, unrelated
    exhaustive-deps warning).
  • npm run docs:build — docs site builds cleanly with the regenerated reference.
  • Storybook: PayrollOverviewReadOnly story under Domain/Payroll/PayrollOverview shows the
    submit-only actions row.

🤖 Generated with Claude Code

dmortal and others added 2 commits August 21, 2026 16:06
Lets a partner render a submit-only view of a calculated payroll with
Edit and Cancel hidden, matching gws-flows' RUN_PAYROLL_READ_ONLY deep-link
behavior for a single payroll.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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