Skip to content

fix: [SDK-614] hide ACH deadline message in cancel dialog for check-only payrolls#1360

Merged
jeffredodd merged 2 commits intomainfrom
fix/SDK-614-cancel-dialog-check-only
Mar 26, 2026
Merged

fix: [SDK-614] hide ACH deadline message in cancel dialog for check-only payrolls#1360
jeffredodd merged 2 commits intomainfrom
fix/SDK-614-cancel-dialog-check-only

Conversation

@jeffredodd
Copy link
Copy Markdown
Contributor

Summary

  • Adds hasDirectDepositEmployees helper to conditionally show ACH deadline messaging
  • Hides "Run this payroll by X to ensure your employees are paid on time" in the PayrollOverview cancel dialog when all employees are paid by check
  • PayrollHistory dialog retains existing behavior (conditionally shows based on payrollDeadline presence)

Test plan

  • Added test asserting deadline is hidden for check-only payrolls
  • Added test asserting deadline is shown for direct deposit payrolls
  • All existing PayrollOverview and PayrollHistory tests pass (47 total)

Fixes SDK-614

Made with Cursor

Copilot AI review requested due to automatic review settings March 25, 2026 03:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the PayrollOverview cancel dialog to suppress ACH deadline messaging when the payroll is check-only, aligning the dialog copy with the actual payment method mix.

Changes:

  • Added a hasDirectDepositEmployees helper to detect whether direct deposit is present.
  • Wrapped the PayrollOverview cancel dialog “Run this payroll by X…” deadline copy behind the new helper.
  • Added tests to assert the deadline message is hidden for check-only payrolls and shown for direct deposit payrolls.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/components/Payroll/helpers.ts Introduces hasDirectDepositEmployees helper used to decide whether ACH messaging should render.
src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.tsx Conditionally renders the cancel-dialog deadline message based on the helper result.
src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.test.tsx Adds coverage for the updated cancel dialog behavior for check-only vs direct-deposit payrolls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +607 to +612
export const hasDirectDepositEmployees = (
employeeCompensations?: Array<{ paymentMethod?: string | null }>,
): boolean => {
if (!employeeCompensations || employeeCompensations.length === 0) return true
return employeeCompensations.some(comp => comp.paymentMethod !== 'Check')
}
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hasDirectDepositEmployees currently returns true for any payment method other than 'Check' (including 'Historical' and undefined/null) and also doesn't ignore excluded employees, so it can show the ACH deadline message when there are no direct-deposit employees (e.g., historical payrolls or only excluded DD employees). Consider accepting the real EmployeeCompensations/PayrollEmployeeCompensationsType shape (incl. excluded) and explicitly checking for PAYMENT_METHODS.directDeposit on non-excluded comps; also reconsider returning true for an empty list (or rename the helper to reflect an 'unknown => show' policy).

Copilot uses AI. Check for mistakes.
@jeffredodd jeffredodd added the bug Something isn't working label Mar 25, 2026
@jeffredodd jeffredodd changed the title fix: hide ACH deadline message in cancel dialog for check-only payrolls fix: hide ACH deadline message in cancel dialog for check-only payrolls [SDK-614] Mar 25, 2026
@jeffredodd jeffredodd removed the bug Something isn't working label Mar 25, 2026
@jeffredodd jeffredodd changed the title fix: hide ACH deadline message in cancel dialog for check-only payrolls [SDK-614] [SDK-614] fix: hide ACH deadline message in cancel dialog for check-only payrolls Mar 25, 2026
@jeffredodd jeffredodd changed the title [SDK-614] fix: hide ACH deadline message in cancel dialog for check-only payrolls fix: [SDK-614] hide ACH deadline message in cancel dialog for check-only payrolls Mar 25, 2026
@jeffredodd jeffredodd force-pushed the fix/SDK-614-cancel-dialog-check-only branch from 73b71d7 to 7116fb8 Compare March 25, 2026 17:54
@jeffredodd jeffredodd enabled auto-merge (squash) March 26, 2026 15:34
@jeffredodd jeffredodd force-pushed the fix/SDK-614-cancel-dialog-check-only branch from 7116fb8 to d7b0cab Compare March 26, 2026 15:35
When cancelling a check-only payroll, the dialog showed an irrelevant
ACH deadline message. Now the deadline is only shown when there are
direct deposit employees on the payroll.

SDK-614

Made-with: Cursor
Address Copilot review feedback: hasDirectDepositEmployees now filters
out excluded employees and explicitly checks for 'Direct Deposit'
rather than checking for != 'Check', avoiding false positives from
historical or null payment methods.

SDK-614

Made-with: Cursor
@jeffredodd jeffredodd force-pushed the fix/SDK-614-cancel-dialog-check-only branch from d7b0cab to 1cea76f Compare March 26, 2026 16:07
@jeffredodd jeffredodd merged commit c9fbba3 into main Mar 26, 2026
15 checks passed
@jeffredodd jeffredodd deleted the fix/SDK-614-cancel-dialog-check-only branch March 26, 2026 16:09
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.

3 participants