feat: HolidayPolicyDetail presentational component (stateless UI)#1600
Merged
krisxcrash merged 7 commits intomainfrom Apr 30, 2026
Merged
feat: HolidayPolicyDetail presentational component (stateless UI)#1600krisxcrash merged 7 commits intomainfrom
krisxcrash merged 7 commits intomainfrom
Conversation
8 tasks
dmortal
approved these changes
Apr 24, 2026
serikjensen
reviewed
Apr 24, 2026
Comment on lines
+9
to
+20
| function countGridChildren(children: ReactNode): number { | ||
| let count = 0 | ||
| Children.forEach(children, child => { | ||
| if (isValidElement(child) && child.type === Fragment) { | ||
| const fragmentProps = child.props as { children?: ReactNode } | ||
| count += countGridChildren(fragmentProps.children) | ||
| } else if (child != null && typeof child !== 'boolean') { | ||
| count++ | ||
| } | ||
| }) | ||
| return count | ||
| } |
Member
There was a problem hiding this comment.
is there a reason we needed to do this for actions layout? it impacts a lot of surface area so we might be better served working around this one rather than making a change here. lmk what the use case is and we may have a workaround
serikjensen
reviewed
Apr 29, 2026
Comment on lines
+10
to
+15
| function unwrapFragment(node: ReactNode): ReactNode { | ||
| if (isValidElement(node) && node.type === Fragment) { | ||
| return (node.props as { children?: ReactNode }).children | ||
| } | ||
| return node | ||
| } |
…icyDetailLayout Introduce a reusable PolicyDetailLayout shell (DetailViewLayout + employees tab + remove dialog + success alert) and a HolidayPolicyDetailPresentation that composes it with a read-only holidays DataView tab. Includes Storybook stories and i18n keys. The PolicyDetailLayout is designed for reuse by future PTO/Sick detail views. SDK-569
ActionsLayout used Children.toArray to count grid columns, but React fragments are counted as a single child, producing repeat(1, max-content) instead of the intended multi-column layout. Add countGridChildren helper that flattens fragments before counting. Also convert story PolicyActions components to hooks so the fragment is passed directly as the actions prop rather than wrapped in an opaque component element.
79a8ca5 to
d8f1e93
Compare
serikjensen
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PolicyDetailLayoutinshared/PolicyDetailLayout/that composesDetailViewLayout, a built-in employees tab (EmployeeTable+HamburgerMenu), a destructive remove-employeeDialog, and a dismissible successAlert. Accepts afirstTabrender prop for domain-specific content.HolidayPolicyDetailPresentationinHolidayPolicyDetail/which composesPolicyDetailLayoutwith a read-only Holidays tab showing federal holidays viaDataView(Holiday, Observed date, Next observation columns).Company.TimeOff.PolicyDetailfor shared policy detail strings and extendsCompany.TimeOff.HolidayPolicywith holiday detail-specific keys.PolicyDetailLayout(generic shell) andHolidayPolicyDetailPresentation(holidays tab, employees tab, success alert, remove dialog, empty employees).PolicyDetailLayoutis designed for reuse by future PTO/Sick policy detail views (same tab structure, different first tab content).Resolves SDK-569
Test plan
PolicyDetailLayoutstories render in Storybook (TimeOff/PolicyDetailLayout)HolidayPolicyDetailstories render in Storybook (TimeOff/HolidayPolicyDetail)tsc --noEmitpasses with no type errors