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
Migrate Table to TypeScript #852
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/sumup/oss-circuit-ui/7rPZT8ctLYQekHt9v7zqNFUEQN41 |
Hey @robinmetral, Thanks! |
314c380
to
6f515d4
Compare
🦋 Changeset detectedLatest commit: b3c6637 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This also passes rowheaders={false} to the rendered component because it's not what's being testes here. With row headers, the first column of the table receives a "rowheader" WAI role instead of the "cell" role that we're targeting in the tests.
This commit also removes a custom keyboard event listener. Enter and space key down events are already handled as a click event. We were effectively triggering onClick twice - this was discovered by switching from fireEvent to userEvent. I'm leaving the test covering the keyboard event logic in the spec.
It will be assigned a value via defaultProps but should be optional from the point of view of its parents. This was breaking specs that were not explicitly passing a testid
Codecov Report
@@ Coverage Diff @@
## canary #852 +/- ##
==========================================
- Coverage 91.91% 91.89% -0.02%
==========================================
Files 161 161
Lines 2820 2888 +68
Branches 717 751 +34
==========================================
+ Hits 2592 2654 +62
- Misses 203 208 +5
- Partials 25 26 +1
|
…grate-table-to-typescript
☝️ @connor-baer I just merged Just need to migrate a couple more Table sub-components, clean up types across components (import them from one place instead of redeclaring), and this will be ready for review (probably by EOW!) 🎉 |
packages/circuit-ui/components/Table/components/TableBody/TableBody.spec.tsx
Show resolved
Hide resolved
packages/circuit-ui/components/Table/components/TableRow/TableRow.spec.tsx
Show resolved
Hide resolved
Codecov is suddenly unhappy, I think it's because of the null and undefined checks that we added to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so, so much for this fantastic contribution! I know how much work went into it 🙌🏻👏🏻
packages/circuit-ui/components/Table/components/TableBody/TableBody.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for the review! 🙌 I'm pushing most fixes in a minute, will follow-up in the individual comment threads for the rest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@connor-baer I think I addressed all the comments! I'll also check the keyboard events on different browsers now.
You can review the changes in this view (there are two commits, I had to push an extra small fix)
packages/circuit-ui/components/Table/components/TableHeader/TableHeader.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for addressing all my comments! Looks great 🤩
Co-authored-by: Connor Bär <connor-baer@users.noreply.github.com>
Addresses #516.
Purpose
Migrate the Table component to TypeScript.
Approach and changes
Definition of done