Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39d6ea9

Browse files
feat: implement PayrollHistory component with enhanced date formatting and i18n (#578)
* feat: implement PayrollHistory componetnt with enhanced date formatting and i18n - Add PayrollHistory component with comprehensive test coverage (707 tests passing) - Implement proper date formatting for pay periods (July 16–July 30, 2025) - Format pay dates as readable text (Aug 15, 2025 instead of 2025-08-15) - Add comprehensive i18n namespace loading in test environment - Remove hardcoded placeholder text and styling inconsistencies - Add proper locale-aware date formatting with parseDateStringToLocal - Include PayrollHistory types, stories, and complete API integration - Export PayrollHistory component for partner consumption - Fix i18n test infrastructure to support all translation namespaces * fix: update PayrollHistory namespace to match TypeScript constraints - Change namespace from 'Payroll.PayrollHistory' to 'payroll.payrollhistory' - Rename translation file to match expected format - Fix TypeScript errors in CI build - Maintain same functionality with corrected naming convention * fix: restore proper PayrollHistory namespace casing - Rename translation file to Payroll.PayrollHistory.json for correct casing - Update component usage to use 'Payroll.PayrollHistory' namespace - Regenerate TypeScript types with proper interface mapping - All tests passing with correct i18n integration - Fixes CI TypeScript errors while maintaining proper namespace conventions * fix: pr feedback * fix: build fix * fix: updating loc file * fix: loc issue * fix: wrap cancel mutation in base submit * fix: update translations and get things fixed * fix: prfeedback * fix: pr feedback --------- Co-authored-by: Steve Jensen <[email protected]>
1 parent 40cfea7 commit 39d6ea9

14 files changed

+851
-84
lines changed

src/components/Payroll/PayrollHistory/PayrollHistory.stories.tsx

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,39 @@
11
import { action } from '@ladle/react'
2+
import type { Payroll } from '@gusto/embedded-api/models/components/payroll'
23
import { PayrollHistoryPresentation } from './PayrollHistoryPresentation'
3-
import type { PayrollHistoryItem } from './PayrollHistoryPresentation'
4+
import type { PayrollHistoryItem } from './PayrollHistory'
45

56
export default {
67
title: 'Domain/Payroll/PayrollHistory',
78
}
89

10+
const createMockPayroll = (id: string, processed: boolean, cancellable: boolean): Payroll =>
11+
({
12+
payrollUuid: id,
13+
processed,
14+
checkDate: '2024-12-08',
15+
external: false,
16+
offCycle: false,
17+
payrollDeadline: new Date('2024-12-07T23:30:00Z'),
18+
payrollStatusMeta: {
19+
cancellable,
20+
expectedCheckDate: '2024-12-08',
21+
initialCheckDate: '2024-12-08',
22+
expectedDebitTime: '2024-12-07T23:30:00Z',
23+
payrollLate: false,
24+
initialDebitCutoffTime: '2024-12-07T23:30:00Z',
25+
},
26+
payPeriod: {
27+
startDate: '2024-11-24',
28+
endDate: '2024-12-07',
29+
payScheduleUuid: 'schedule-1',
30+
},
31+
totals: {
32+
netPay: '30198.76',
33+
grossPay: '38000.00',
34+
},
35+
}) as Payroll
36+
937
const mockPayrollHistory: PayrollHistoryItem[] = [
1038
{
1139
id: '1',
@@ -14,6 +42,7 @@ const mockPayrollHistory: PayrollHistoryItem[] = [
1442
payDate: 'Dec 8, 2024',
1543
status: 'In progress',
1644
amount: 30198.76,
45+
payroll: createMockPayroll('1', false, true),
1746
},
1847
{
1948
id: '2',
@@ -22,14 +51,16 @@ const mockPayrollHistory: PayrollHistoryItem[] = [
2251
payDate: 'Dec 8, 2024',
2352
status: 'Unprocessed',
2453
amount: 30198.76,
54+
payroll: createMockPayroll('2', false, true),
2555
},
2656
{
2757
id: '3',
2858
payPeriod: 'Aug 27 – Sep 10, 2025',
29-
type: 'Dismissal',
59+
type: 'External',
3060
payDate: 'Nov 24, 2024',
3161
status: 'Complete',
3262
amount: 30842.99,
63+
payroll: createMockPayroll('3', true, false),
3364
},
3465
{
3566
id: '4',
@@ -38,6 +69,7 @@ const mockPayrollHistory: PayrollHistoryItem[] = [
3869
payDate: 'Oct 1, 2024',
3970
status: 'Submitted',
4071
amount: 28456.5,
72+
payroll: createMockPayroll('4', false, true),
4173
},
4274
]
4375

0 commit comments

Comments
 (0)