Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/reference/Translations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,7 @@ Translation keys for the `Contractor.ContractorList` i18n namespace.
| <a id="property-contractorcontractorlisteditcta"></a> `editCta` | `"Edit"` |
| <a id="property-contractorcontractorlistemptytabledescription"></a> `emptyTableDescription` | `"Add contractors to get them setup for payroll."` |
| <a id="property-contractorcontractorlistemptytabletitle"></a> `emptyTableTitle` | `"You haven't added any contractors yet"` |
| <a id="property-contractorcontractorlisthamburgertitle"></a> `hamburgerTitle` | `"Actions for {{name}}"` |
| <a id="property-contractorcontractorlistlistheaders"></a> `listHeaders` | |
| `listHeaders.name` | `"Name"` |
| `listHeaders.status` | `"Status"` |
Expand Down Expand Up @@ -1671,7 +1672,7 @@ Translation keys for the `Contractor.ManagementContractorList` i18n namespace.
| `emptyState.onboarding` | |
| `emptyState.onboarding.description` | `"Contractors currently being onboarded will appear here"` |
| `emptyState.onboarding.title` | `"There are no contractors onboarding"` |
| <a id="property-contractormanagementcontractorlisthamburgertitle"></a> `hamburgerTitle` | `"Contractor actions menu"` |
| <a id="property-contractormanagementcontractorlisthamburgertitle"></a> `hamburgerTitle` | `"Actions for {{name}}"` |
| <a id="property-contractormanagementcontractorlistlastdaybadge"></a> `lastDayBadge` | `"Last day {{date}}"` |
| <a id="property-contractormanagementcontractorlistnamelabel"></a> `nameLabel` | `"Contractor name"` |
| <a id="property-contractormanagementcontractorlistonboardingstatuslabel"></a> `onboardingStatusLabel` | `"Onboarding status"` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('ManagementContractorList — Active tab', () => {
renderWithProviders(<ManagementContractorList companyId="company-123" onEvent={onEvent} />)

await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Contractor actions menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))
await user.click(await screen.findByRole('menuitem', { name: 'Dismiss contractor' }))

expect(onEvent).toHaveBeenCalledWith(contractorEvents.CONTRACTOR_DISMISS, {
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('ManagementContractorList — Active tab', () => {
renderWithProviders(<ManagementContractorList companyId="company-123" onEvent={onEvent} />)

await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Contractor actions menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))
await user.click(await screen.findByRole('menuitem', { name: 'Cancel dismissal' }))

expect(await screen.findByRole('dialog')).toBeTruthy()
Expand All @@ -142,7 +142,7 @@ describe('ManagementContractorList — Active tab', () => {
renderWithProviders(<ManagementContractorList companyId="company-123" onEvent={onEvent} />)

await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Contractor actions menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))
await user.click(await screen.findByRole('menuitem', { name: 'View details' }))

expect(onEvent).toHaveBeenCalledWith(contractorEvents.CONTRACTOR_VIEW, {
Expand Down Expand Up @@ -170,7 +170,7 @@ describe('ManagementContractorList — Onboarding tab', () => {
await screen.findByText('Ada Lovelace')

expect(screen.getByRole('button', { name: 'Continue' })).toBeInTheDocument()
await user.click(screen.getByRole('button', { name: 'Contractor actions menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))
expect(await screen.findByRole('menuitem', { name: 'Remove' })).toBeInTheDocument()
})

Expand Down Expand Up @@ -204,7 +204,7 @@ describe('ManagementContractorList — Onboarding tab', () => {

await user.click(await screen.findByRole('tab', { name: 'Onboarding' }))
await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Contractor actions menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))
await user.click(await screen.findByRole('menuitem', { name: 'Remove' }))

expect(deleteResolver).not.toHaveBeenCalled()
Expand Down Expand Up @@ -257,7 +257,7 @@ describe('ManagementContractorList — Dismissed tab', () => {

await user.click(await screen.findByRole('tab', { name: 'Dismissed' }))
await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Contractor actions menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))
await user.click(await screen.findByRole('menuitem', { name: 'Rehire contractor' }))

expect(onEvent).toHaveBeenCalledWith(contractorEvents.CONTRACTOR_REHIRE, {
Expand Down Expand Up @@ -287,7 +287,7 @@ describe('ManagementContractorList — Dismissed tab', () => {

await user.click(await screen.findByRole('tab', { name: 'Dismissed' }))
await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Contractor actions menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))
await user.click(await screen.findByRole('menuitem', { name: 'Cancel rehire' }))

expect(await screen.findByRole('dialog')).toBeTruthy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ export function ManagementContractorListView({
: t('continueCta')}
</Components.Button>
)}
<HamburgerMenu items={menuItems} triggerLabel={t('hamburgerTitle')} />
<HamburgerMenu
items={menuItems}
triggerLabel={t('hamburgerTitle', { name: contractorDisplayName(contractor) })}
/>
</Flex>
)
}
Expand Down Expand Up @@ -280,7 +283,12 @@ export function ManagementContractorListView({
})
}

return <HamburgerMenu items={menuItems} triggerLabel={t('hamburgerTitle')} />
return (
<HamburgerMenu
items={menuItems}
triggerLabel={t('hamburgerTitle', { name: contractorDisplayName(contractor) })}
/>
)
},
isFetching,
pagination,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('ContractorList hamburger menu edit/review CTA', () => {
renderWithProviders(<ContractorList companyId="company-123" onEvent={() => {}} />)

await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Open menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))

expect(await screen.findByRole('menuitem', { name: 'Edit' })).toBeTruthy()
})
Expand All @@ -58,7 +58,7 @@ describe('ContractorList hamburger menu edit/review CTA', () => {
renderWithProviders(<ContractorList companyId="company-123" onEvent={() => {}} />)

await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Open menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))

expect(await screen.findByRole('menuitem', { name: 'Review' })).toBeTruthy()
})
Expand All @@ -70,7 +70,7 @@ describe('ContractorList hamburger menu edit/review CTA', () => {
renderWithProviders(<ContractorList companyId="company-123" onEvent={() => {}} />)

await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Open menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))

expect(await screen.findByRole('menuitem', { name: 'Edit' })).toBeTruthy()
})
Expand All @@ -82,7 +82,7 @@ describe('ContractorList hamburger menu edit/review CTA', () => {
renderWithProviders(<ContractorList companyId="company-123" onEvent={() => {}} />)

await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Open menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))

expect(await screen.findByRole('menuitem', { name: 'Edit' })).toBeTruthy()
})
Expand All @@ -104,7 +104,7 @@ describe('ContractorList delete action', () => {
renderWithProviders(<ContractorList companyId="company-123" onEvent={onEvent} />)

await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Open menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))
await user.click(await screen.findByRole('menuitem', { name: 'Delete' }))

expect(deleteResolver).not.toHaveBeenCalled()
Expand All @@ -131,7 +131,7 @@ describe('ContractorList cancel self-onboarding action', () => {
renderWithProviders(<ContractorList companyId="company-123" onEvent={() => {}} />)

await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Open menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))

expect(await screen.findByRole('menuitem', { name: 'Cancel self-onboarding' })).toBeTruthy()
// Editing is blocked mid self-onboarding — the admin must cancel it first.
Expand All @@ -149,7 +149,7 @@ describe('ContractorList cancel self-onboarding action', () => {
renderWithProviders(<ContractorList companyId="company-123" onEvent={() => {}} />)

await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Open menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))

await screen.findByRole('menuitem', { name: /Edit|Review/ })
expect(
Expand Down Expand Up @@ -177,7 +177,7 @@ describe('ContractorList cancel self-onboarding action', () => {
renderWithProviders(<ContractorList companyId="company-123" onEvent={onEvent} />)

await screen.findByText('Ada Lovelace')
await user.click(screen.getByRole('button', { name: 'Open menu' }))
await user.click(screen.getByRole('button', { name: 'Actions for Ada Lovelace' }))
await user.click(await screen.findByRole('menuitem', { name: 'Cancel self-onboarding' }))

await waitFor(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ export function ContractorListView({
})
}

return <HamburgerMenu items={menuItems} />
return (
<HamburgerMenu
triggerLabel={t('hamburgerTitle', { name: contractorDisplayName(contractor) })}
items={menuItems}
/>
)
},
isFetching,
pagination,
Expand Down
1 change: 1 addition & 0 deletions src/i18n/en/Contractor.ContractorList.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"reviewCta": "Review",
"deleteCta": "Delete",
"cancelSelfOnboardingCta": "Cancel self-onboarding",
"hamburgerTitle": "Actions for {{name}}",
"emptyTableDescription": "Add contractors to get them setup for payroll.",
"emptyTableTitle": "You haven't added any contractors yet",
"listHeaders": {
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/en/Contractor.ManagementContractorList.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"cancelSelfOnboardingCta": "Cancel self-onboarding",
"cancelDismissalCta": "Cancel dismissal",
"cancelRehireCta": "Cancel rehire",
"hamburgerTitle": "Contractor actions menu",
"hamburgerTitle": "Actions for {{name}}",
"contractorListLabel": "List of contractors",
"emptyState": {
"active": {
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2147,6 +2147,8 @@ export namespace Translations {
deleteCta: string
/** @defaultValue `"Cancel self-onboarding"` */
cancelSelfOnboardingCta: string
/** @defaultValue `"Actions for {{name}}"` */
hamburgerTitle: string
/** @defaultValue `"Add contractors to get them setup for payroll."` */
emptyTableDescription: string
/** @defaultValue `"You haven't added any contractors yet"` */
Expand Down Expand Up @@ -2576,7 +2578,7 @@ export namespace Translations {
cancelDismissalCta: string
/** @defaultValue `"Cancel rehire"` */
cancelRehireCta: string
/** @defaultValue `"Contractor actions menu"` */
/** @defaultValue `"Actions for {{name}}"` */
hamburgerTitle: string
/** @defaultValue `"List of contractors"` */
contractorListLabel: string
Expand Down
Loading