feat: add readOnly prop to PayrollOverview - #2616
Draft
dmortal wants to merge 2 commits into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
readOnlyprop toPayrollOverviewso a partner can render a submit-only reviewof 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_ONLYflow type, which similarly locks a payroll deep link down toshow/submit only (no edit, no cancel).
Changes
PayrollOverview: newreadOnly?: booleanprop (defaultfalse); when set, suppressesthe Edit action, the processing-failure retry CTA, and folds into the existing
cancellability check so Cancel is hidden too.
PayrollOverviewPresentation: newcanEdit?: booleanprop (defaulttrue) gating theEdit button, mirroring the existing
canCancelpattern.PayrollOverviewReadOnlyStorybook story.docs/reference/payroll/blocks.mdfrom updated TSDoc.Testing
npm run test -- --run src/components/Payroll/PayrollOverview— 40 tests pass, includingnew cases for Edit/Cancel suppression and Submit remaining functional in read-only mode.
npx tsc --noEmitandnpx eslint— clean (only a pre-existing, unrelatedexhaustive-depswarning).npm run docs:build— docs site builds cleanly with the regenerated reference.PayrollOverviewReadOnlystory under Domain/Payroll/PayrollOverview shows thesubmit-only actions row.
🤖 Generated with Claude Code