-
Notifications
You must be signed in to change notification settings - Fork 1
feat: implement PayrollHistory component with enhanced date formatting and i18n #578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
renderWithProviders(<ManageSignatories />) | ||
|
||
expect(screen.getByRole('heading')).toHaveTextContent('otherSignatoryTitle') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some changes to our translation provider and now these keys render as a by product.
@@ -1,27 +1,34 @@ | |||
import type { ReactElement } from 'react' | |||
import type React from 'react' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes here should allow all translation files to be loaded into tests w/o issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the complete PayrollHistory component with enhanced date formatting and comprehensive i18n support. The implementation includes locale-aware date formatting, dynamic i18n namespace loading in the test environment, and proper integration with the existing payroll management system.
- Implements PayrollHistory component with locale-aware date formatting using
parseDateStringToLocal
- Adds comprehensive test coverage for both the main component and presentation layer
- Updates i18n configuration to dynamically load translation namespaces in test environments
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
src/test-utils/renderWithProviders.tsx | Replaces static i18n initialization with dynamic namespace loading using Vite's glob function |
src/shared/constants.ts | Adds new payroll-related event constants for summary/receipt viewing and cancellation |
src/i18n/en/payroll.payrollhistory.json | Removes unused engineeringStaff label from translations |
src/components/Payroll/index.ts | Exports the new PayrollHistory component |
src/components/Payroll/helpers.ts | Adds utility functions for payroll type and status determination |
src/components/Payroll/helpers.test.ts | Comprehensive tests for the new utility functions |
src/components/Payroll/PayrollList/PayrollList.tsx | Refactors to use shared getPayrollType helper function |
src/components/Payroll/PayrollHistory/PayrollHistoryPresentation.tsx | Implements presentation component with DataView table and time filtering |
src/components/Payroll/PayrollHistory/PayrollHistoryPresentation.test.tsx | Complete test suite for the presentation component |
src/components/Payroll/PayrollHistory/PayrollHistory.tsx | Main component with API integration and business logic |
src/components/Payroll/PayrollHistory/PayrollHistory.test.tsx | Integration tests covering API calls and user interactions |
src/components/Payroll/PayrollHistory/PayrollHistory.stories.tsx | Updates story imports and data types |
src/components/Company/DocumentSigner/DocumentList/ManageSignatories.test.tsx | Updates to use renderWithProviders helper |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
e6a23d0
to
d40a8f7
Compare
β¦ng 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
- 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
- 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
90d8c5e
to
fc27613
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few things on this one, i think the only hard one is to update the cancel payroll menu item to be hidden according to the logic outline below unless you plan on doing it in a follow up
π― Overview
This PR implements the complete PayrollHistory component with enhanced date formatting and comprehensive i18n support.
π§ Technical Improvements
parseDateStringToLocal
Screenshots