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

feat(flat-table, flat-table-row): components can now be wrapped, subRows no longer need to be arrays FE-6050 #6220

Merged
merged 2 commits into from
Aug 30, 2023

Conversation

edleeks87
Copy link
Contributor

@edleeks87 edleeks87 commented Jul 26, 2023

fix #6219

  • some tests were refactored to RTL as they now need to be async to allow the update to occur before the assertion

Proposed behaviour

Adds data tags to FlatTableCheckbox

Refactors FlatTable and sub-components to allow consumers greater flexibility with respect to
wrapping the components by removing code that relied on iterating over children and cloning.

Refactors FlatTableRow so that it is no longer required that an array is passed to the subRows
prop. Adds FlatTableRowContext and SubRowProvider as well as adding data-sticky-align attribute to FlatTableRowHeader and id attribute to all row children to support expandable and sticky column functionality.

Current behaviour

Components rely heavily on children iteration and using cloning to pass props down to achieve desired functionality.

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Unit tests added or updated if required
  • Storybook added or updated 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].

https://codesandbox.io/s/romantic-kilby-mhhzsp?file=/src/App.js
https://codesandbox.io/s/table-forked-lq389j?file=/src/Table.js -- children mutation

@cypress
Copy link

cypress bot commented Jul 26, 2023

Passing run #17051 ↗︎

0 5492 41 0 Flakiness 0

Details:

feat(flat-table, flat-table-row): components can now be wrapped, subRows no long...
Project: carbon Commit: bbb9d5a3b8
Status: Passed Duration: 06:17 💡
Started: Jul 27, 2023 2:16 PM Ended: Jul 27, 2023 2:23 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@edleeks87 edleeks87 force-pushed the FE-6050-refactor-ft branch 3 times, most recently from 6db3883 to 2467ba4 Compare July 27, 2023 09:26
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 27, 2023

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 ea27a57:

Sandbox Source
carbon-quickstart Configuration
carbon-quickstart-typescript Configuration
carbon-quickstart PR
flamboyant-breeze-nt38yw PR
table (forked) PR

@DipperTheDan DipperTheDan self-requested a review July 27, 2023 12:43
@edleeks87 edleeks87 force-pushed the FE-6050-refactor-ft branch from 2467ba4 to bbb9d5a Compare July 27, 2023 14:14
DipperTheDan
DipperTheDan previously approved these changes Jul 27, 2023
@robinzigmond robinzigmond self-requested a review August 2, 2023 14:31
Copy link
Contributor

@robinzigmond robinzigmond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments submitted at halfway point to avoid losing them overnight - will complete the review tomorrow

EDIT: now complete

@edleeks87 edleeks87 force-pushed the FE-6050-refactor-ft branch from 8640053 to 4dfc828 Compare August 22, 2023 16:11
robinzigmond
robinzigmond previously approved these changes Aug 23, 2023
robinzigmond
robinzigmond previously approved these changes Aug 23, 2023
DipperTheDan
DipperTheDan previously approved these changes Aug 23, 2023
@edleeks87 edleeks87 marked this pull request as ready for review August 23, 2023 10:08
@edleeks87 edleeks87 requested a review from a team as a code owner August 23, 2023 10:08
@edleeks87 edleeks87 requested review from a team as code owners August 23, 2023 10:08
ZhuoyuJin
ZhuoyuJin previously approved these changes Aug 30, 2023
…ows no longer need to

be arrays

Refactors `FlatTable` and sub-components to allow consumers greater flexibility with respect to
wrapping the components by removing code that relied on iterating over children and cloning.
Refactors `FlatTableRow` so that it is no longer required that an array is passed to the
`subRows`
prop.

fix #6219
@edleeks87 edleeks87 merged commit 01e625d into master Aug 30, 2023
@edleeks87 edleeks87 deleted the FE-6050-refactor-ft branch August 30, 2023 16:15
@carbonci
Copy link
Collaborator

🎉 This PR is included in version 120.1.0 🎉

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.

Remove constraint on subRows prop type
5 participants