Fixed apps/admin TypeScript build for ShareModal contentProps#27696
Fixed apps/admin TypeScript build for ShareModal contentProps#27696kevinansfield merged 1 commit intomainfrom
Conversation
- DialogContent's prop type does not include an index signature for data-* attributes, so passing `data-testid` (or any data-* attr) as a literal in `contentProps` failed strict excess-property checks - widened ShareModal's `contentProps` type to also accept arbitrary `data-*` keys, matching how the attribute is consumed on the rendered DOM element - removed the vestigial `data-test-modal` attribute from the onboarding share dialog; nothing references it (the e2e helper uses the `data-testid` selector)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
WalkthroughThis pull request makes changes to the ShareModal component and its usage. In the ShareModal component definition, the contentProps type in ShareModalProps is updated to explicitly support arbitrary data attributes by adding a Record< 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…st#27696) ref https://linear.app/ghost/issue/BER-3587/ Follow-up to TryGhost#27625 — the apps/admin build was failing with a TS2353 error because Radix's `DialogContentProps` type does not include an index signature for `data-*` attributes, so passing `data-testid` (or any `data-*` attr) as a literal in `contentProps` failed strict excess-property checks. - widened `ShareModal`'s `contentProps` type to additionally accept arbitrary `data-*` keys, matching how the attribute is consumed on the rendered DOM element - removed the vestigial `data-test-modal` attribute from the onboarding share dialog; nothing references it (the e2e helper uses the `data-testid` selector)
ref https://linear.app/ghost/issue/BER-3587/
Follow-up to #27625 — the apps/admin build was failing with a TS2353 error because Radix's
DialogContentPropstype does not include an index signature fordata-*attributes, so passingdata-testid(or anydata-*attr) as a literal incontentPropsfailed strict excess-property checks.ShareModal'scontentPropstype to additionally accept arbitrarydata-*keys, matching how the attribute is consumed on the rendered DOM elementdata-test-modalattribute from the onboarding share dialog; nothing references it (the e2e helper uses thedata-testidselector)