feat(2/5): add SelectEmployees presentational component (SDK-563)#1613
feat(2/5): add SelectEmployees presentational component (SDK-563)#1613jeffredodd merged 10 commits intomainfrom
Conversation
1bd2878 to
16ed8ed
Compare
1e664dd to
d906aa0
Compare
| import { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext' | ||
| import { useI18n } from '@/i18n' | ||
|
|
||
| export function SelectEmployeesPresentation({ |
There was a problem hiding this comment.
Nit: Does this really need to be called "Presentation"? Seems like presentation is usually the counterpart to a SelectEmployees but in this case that's not here since this is just a UI component?
| pagination={pagination} | ||
| additionalColumns={[ | ||
| { | ||
| key: 'department' as keyof EmployeeItem, |
There was a problem hiding this comment.
Nit: Can we edit the EmployeeItems we are getting instead of needing to cast these?
There was a problem hiding this comment.
Pull request overview
Adds the new Time Off “Select Employees” presentational screen and supporting infrastructure (translations + table/input enhancements) so both Time-Off and Holiday flows can reuse the same stateless UI.
Changes:
- Introduces
SelectEmployeespresentational component with optional reassignment warning, optional starting-balance column, and Back/Continue actions. - Extends shared
EmployeeTableto support better a11y labeling for per-row inputs and adjusts search behavior to use atype="search"input. - Adds i18n namespace/types for
Company.TimeOff.SelectEmployeesand Storybook/test coverage for the new component.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/i18next.d.ts | Adds TS typing for the new Company.TimeOff.SelectEmployees translation namespace. |
| src/i18n/en/Company.TimeOff.SelectEmployees.json | Adds English strings used by the new Select Employees screen. |
| src/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTableTypes.ts | Requires uuid on table items to support stable per-row IDs for labeling. |
| src/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.tsx | Adds per-row name id hooks for aria-labelledby and updates search handling. |
| src/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.test.tsx | Updates tests for the revised search clear behavior. |
| src/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.stories.tsx | Adds a “SearchActive” story for the new search behavior. |
| src/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.module.scss | Removes styles for the removed explicit clear button. |
| src/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTypes.ts | Defines props/types for the new presentational component (including optional balances/pagination). |
| src/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployees.tsx | Implements the Select Employees presentational layout and table wiring. |
| src/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployees.test.tsx | Adds unit tests for screen rendering, selection, search, and pagination. |
| src/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployees.stories.tsx | Adds Storybook scenarios (selection states, warning, pagination, filtering, empty). |
| src/components/Common/UI/TextInput/TextInputTypes.ts | Adds aria-labelledby passthrough typing for TextInput. |
| src/components/Common/UI/TextInput/TextInput.tsx | Wires aria-labelledby down to the underlying Input. |
| src/components/Common/UI/Input/InputTypes.ts | Adds aria-labelledby passthrough typing for Input. |
| e2e/package-lock.json | Adds an e2e lockfile that currently references a missing local tarball dependency. |
| docs/component-adapter/component-inventory.md | Documents aria-labelledby as a supported TextInput prop. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <Text variant="supporting"> | ||
| {showReassignmentWarning ? t('description') : t('holidayDescription')} | ||
| </Text> |
| showReassignmentWarning: boolean | ||
| balances?: Record<string, string> | ||
| onBalanceChange?: (uuid: string, value: string) => void | ||
| pagination?: PaginationControlProps |
| "": { | ||
| "name": "embedded-react-sdk-e2e", | ||
| "dependencies": { | ||
| "@gusto/embedded-react-sdk": "file:gusto-embedded-react-sdk-0.36.0.tgz" |
| import { defaultComponents } from '@/contexts/ComponentAdapter/adapters/defaultComponentAdapter' | ||
| import { mockUseContainerBreakpoints } from '@/test/setup' | ||
|
|
||
| vi.mock('@/i18n/I18n', () => ({ |
2118eeb to
f503451
Compare
…arch - Add min, max, maxLength passthrough props to Input and TextInput - Add search input with inline clear button to EmployeeTable - Add isFetching loading state and pagination support to EmployeeTable Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes the absolutely-positioned custom clear button and its SCSS.
The browser's built-in search cancel button is now used, which works
naturally with component adapter overrides since type is a standard
HTML attribute forwarded by any TextInput implementation.
Bridges native clear (fires onChange('')) to onSearchClear so
pagination resets in consumers remain intact.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Shared stateless UI consumed by both the time-off and holiday container components. Renders the employee table with search, multi-select, optional starting-balance column, reassignment warning, and Back/Continue actions. Storybook stories cover: default, partial/full selection, search filtered, empty results, with/without reassignment warning, pagination. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…emove redundant casts
24dcbf6 to
0826592
Compare
Addresses Copilot review feedback: balances was optional even when
onBalanceChange was provided, which would cause balance inputs to
appear stuck at empty if a caller forgot to pass balances. Default
to {} in destructuring to make the controlled contract explicit.
Summary
SelectEmployeesPresentation— shared stateless UI consumed by both the time-off and holiday container componentsCompany.TimeOff.SelectEmployees)Depends on: #1611
Test plan
npm run test -- --run src/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationnpm run storybook→Domain/TimeOff/SelectEmployees— all 7 stories render correctly🤖 Generated with Claude Code