Skip to content

refactor(SDK-561): rename SelectPolicyType to PolicyTypeSelector pattern#1505

Merged
krisxcrash merged 5 commits intomainfrom
kw/feat/sdk-561-policy-type-selector
Apr 8, 2026
Merged

refactor(SDK-561): rename SelectPolicyType to PolicyTypeSelector pattern#1505
krisxcrash merged 5 commits intomainfrom
kw/feat/sdk-561-policy-type-selector

Conversation

@krisxcrash
Copy link
Copy Markdown
Contributor

Summary

  • Move SelectPolicyTypePresentation, types, test, and stories from TimeOffManagement/SelectPolicyType/ into PolicyTypeSelector/ and rename to follow SDK naming conventions (PolicyTypeSelectorPresentation, PolicyTypeSelectorTypes, etc.)
  • Rename SelectPolicyType type to PolicyType and SelectPolicyTypePresentationProps to PolicyTypeSelectorPresentationProps for consistency
  • Update PolicyTypeSelector.tsx to import from co-located files instead of cross-referencing TimeOffManagement/
  • Delete TimeOffManagement/SelectPolicyType/ directory

Stacks on #1497.

Test plan

  • npm run test -- --run src/components/UNSTABLE_TimeOff/PolicyTypeSelector/ (17 tests pass)
  • npm run build passes
  • Formatting and lint checks pass
  • State machine wiring verified: PolicyTypeSelectorContextualPolicyTypeSelectorPolicyTypeSelectorPresentation
  • Verify stories render in Storybook

@krisxcrash krisxcrash changed the base branch from kw/feat/sdk-561-select-holidays to main April 8, 2026 21:33
Stateless UI for the holiday selection step in the time-off policy
creation flow. Renders a multi-select DataView table with Holiday,
Observed date, and Next observation columns, plus Back/Continue
actions via ActionsLayout.

- SelectHolidaysTypes.ts: HolidayItem and props interfaces
- SelectHolidaysPresentation.tsx: component using DataView, i18n, ComponentsContext
- Storybook stories: AllSelected, PartialSelection, EditMode variants
- Vitest + RTL tests for rendering and interactions
- i18n: added nextObservation, backCta, tableLabel keys
- Fix DataTable to support isItemSelected for controlled checkboxes
  (previously only DataCards used isItemSelected, causing desktop
  checkboxes to always render unchecked)
- Add mode prop to SelectHolidaysPresentation: 'select' (default)
  shows checkboxes + header + Back/Continue actions; 'view' renders
  a read-only table with no checkboxes or actions
- Add ViewMode Storybook story and 3 view mode tests
Move SelectHolidays logic into HolidaySelectionForm and rename
presentation/types/tests/stories to follow SDK naming conventions
(HolidaySelectionForm* pattern, co-located under HolidaySelectionForm/).
Move presentation, types, test, and stories files from
TimeOffManagement/SelectPolicyType/ into PolicyTypeSelector/ and rename
to follow SDK naming conventions (PolicyTypeSelectorPresentation, etc.).
@krisxcrash krisxcrash force-pushed the kw/feat/sdk-561-policy-type-selector branch from eb4301f to e565077 Compare April 8, 2026 22:04
Rebase left behind imports pointing to the old
TimeOffManagement/SelectPolicyType path. Updated index.ts and
TimeOffFlowComponents.tsx to use the new PolicyTypeSelector path
and regenerated the endpoint inventory.
@krisxcrash krisxcrash merged commit 81ed137 into main Apr 8, 2026
15 checks passed
@krisxcrash krisxcrash deleted the kw/feat/sdk-561-policy-type-selector branch April 8, 2026 22:14
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.

2 participants