Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tags): update TagProps interface so only the data tag types are exported #5548

Merged
merged 2 commits into from
Oct 19, 2022

Conversation

edleeks87
Copy link
Contributor

fix #5534

Proposed behaviour

Updates the TagProps interface to ensure only the data- props are exported and extended in the public interfaces. A new private RestProps interface has been added to support passing the rest props object into the tags util. The previous implementation was preventing intellisense from displaying the correct types for the Sidebar component; instead it was being assigned any.

Current behaviour

The TagProps interface supports any type via [restKeys: string] any which prevents intellisense from computing the types of components and instead displaying any

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Typescript d.ts file added or updated if required

QA

  • Tested in CodeSandbox/storybook
  • Add new Cypress test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

Testing instructions

The following CodeSandbox is an example of the broken behaviour.
You can see the new behaviour by looking at the version in the comment by codesandbox[bot].

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 12, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0d46234:

Sandbox Source
carbon-quickstart Configuration
carbon-quickstart-typescript Configuration
carbon-quickstart PR
wonderful-browser-0i9eer Issue #5534
purple-leaf-de3swb Issue #5534

@cypress
Copy link

cypress bot commented Oct 12, 2022



Test summary

3402 0 3 0Flakiness 1


Run details

Project carbon
Status Passed
Commit e6d14ba
Started Oct 19, 2022 8:58 AM
Ended Oct 19, 2022 9:04 AM
Duration 05:45 💡
OS Linux Debian - 11.4
Browser Chrome 106

View run in Cypress Dashboard ➡️


Flakiness

src/components/tabs/tabs.test.js Flakiness
1 Testing Tabs component > should render Tabs component > should verify when tab 3 is hovered over that info message is displayed

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@robinzigmond robinzigmond self-requested a review October 12, 2022 14:29
@Parsium Parsium self-requested a review October 13, 2022 08:56
@edleeks87 edleeks87 force-pushed the FE-5407-update-tag-props-interface branch from 5f8f493 to 3102fd0 Compare October 13, 2022 16:10
robinzigmond
robinzigmond previously approved these changes Oct 14, 2022
Parsium
Parsium previously approved these changes Oct 14, 2022
@edleeks87 edleeks87 marked this pull request as ready for review October 14, 2022 10:44
@edleeks87 edleeks87 requested review from a team as code owners October 14, 2022 10:44
@edleeks87 edleeks87 dismissed stale reviews from Parsium and robinzigmond via 9a0ece5 October 17, 2022 10:34
@edleeks87 edleeks87 force-pushed the FE-5407-update-tag-props-interface branch from 3102fd0 to 9a0ece5 Compare October 17, 2022 10:34
robinzigmond
robinzigmond previously approved these changes Oct 17, 2022
Parsium
Parsium previously approved these changes Oct 18, 2022
@edleeks87 edleeks87 force-pushed the FE-5407-update-tag-props-interface branch from 9e5784c to 0c8a63a Compare October 18, 2022 11:07
Parsium
Parsium previously approved these changes Oct 18, 2022
robinzigmond
robinzigmond previously approved these changes Oct 18, 2022
DlgSHi
DlgSHi previously approved these changes Oct 19, 2022
…xported

Updates the `TagProps` interface to ensure only the `data-` props are exported and extended in the
public interfaces. A new private `RestProps` interface has been added to support passing the rest
props object into the `tags` util. The previous implementation was preventing `intellisense` from
displaying the correct types for the `Sidebar` component; instead it was being assigned `any`.

fix #5534
@edleeks87 edleeks87 dismissed stale reviews from DlgSHi, robinzigmond, and Parsium via e6d14ba October 19, 2022 08:54
@edleeks87 edleeks87 force-pushed the FE-5407-update-tag-props-interface branch from 0c8a63a to e6d14ba Compare October 19, 2022 08:54
@edleeks87 edleeks87 merged commit 2e7a55c into master Oct 19, 2022
@edleeks87 edleeks87 deleted the FE-5407-update-tag-props-interface branch October 19, 2022 09:13
@carbonci
Copy link
Collaborator

🎉 This PR is included in version 111.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Sidebar props not picked up correctly by TypeScript
5 participants