Skip to content

Fixed apps/admin TypeScript build for ShareModal contentProps#27696

Merged
kevinansfield merged 1 commit intomainfrom
fix-share-modal-data-attr-types
May 6, 2026
Merged

Fixed apps/admin TypeScript build for ShareModal contentProps#27696
kevinansfield merged 1 commit intomainfrom
fix-share-modal-data-attr-types

Conversation

@kevinansfield
Copy link
Copy Markdown
Member

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 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)

- 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)
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f1b48761-faef-400b-a895-3319d5fa8772

📥 Commits

Reviewing files that changed from the base of the PR and between fcc6516 and dd29a22.

📒 Files selected for processing (2)
  • apps/admin/src/onboarding/components/share-publication-dialog.tsx
  • apps/shade/src/components/features/share-modal/share-modal.tsx
💤 Files with no reviewable changes (1)
  • apps/admin/src/onboarding/components/share-publication-dialog.tsx

Walkthrough

This 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<data-${string}, string | undefined> to the type union. In the share-publication-dialog component, the data-test-modal attribute is removed from the contentProps object passed to ShareModal, while the data-testid attribute remains. These changes expand the type system to accommodate flexible data attributes while removing a specific test attribute from one usage.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing a TypeScript build issue in apps/admin by addressing ShareModal's contentProps type handling for data attributes.
Description check ✅ Passed The description is directly related to the changeset, explaining the TS2353 build failure, the root cause, and the specific fixes applied to resolve the issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-share-modal-data-attr-types

Comment @coderabbitai help to get the list of available commands and usage tips.

@kevinansfield kevinansfield enabled auto-merge (squash) May 6, 2026 08:37
@kevinansfield kevinansfield merged commit db7b3f8 into main May 6, 2026
42 checks passed
@kevinansfield kevinansfield deleted the fix-share-modal-data-attr-types branch May 6, 2026 08:59
lujuldotcom pushed a commit to lujuldotcom/Ghost that referenced this pull request May 6, 2026
…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)
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.

1 participant