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(flat-table-row): add support for controlling expanded rows externally FE-4007 #3916

Merged
merged 1 commit into from
Apr 22, 2021

Conversation

edleeks87
Copy link
Contributor

@edleeks87 edleeks87 commented Apr 15, 2021

fix #3875

Proposed behaviour

Adds useEffect to ensure expandable FlatTableRows update when the value of the expanded prop
changes

Current behaviour

expandable functionality cannot be controlled externally

Checklist

  • Commits follow our style guide
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Cypress automation tests added or updated if required
  • Storybook added or updated if required
  • Typescript d.ts file added or updated if required
  • Carbon implementation and Design System documentation are congruent

Additional context

Testing instructions

design-system-flat-table-expandable--controlled added

https://codesandbox.io/s/nice-almeida-j22d6

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 15, 2021

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 721f975:

Sandbox Source
carbon-quickstart Configuration
carbon-quickstart PR
friendly-matsumoto-exm3r PR
compassionate-johnson-9q1mw Issue #3875

DipperTheDan
DipperTheDan previously approved these changes Apr 15, 2021
dawidzarzycki
dawidzarzycki previously approved these changes Apr 19, 2021
@edleeks87 edleeks87 marked this pull request as ready for review April 19, 2021 08:38
@edleeks87 edleeks87 requested review from a team as code owners April 19, 2021 08:38
### Controlled

<Preview>
<Story name="controlled">
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to ignore this story in chromatic and add cypress test for that purpose because the only one way to check if it works properly

@ZhuoyuJin ZhuoyuJin dismissed stale reviews from dawidzarzycki and DipperTheDan via 0eb1a38 April 21, 2021 15:19
Scenario: You can expand all rows by clicking on Expand All
Given I open "Design System Flat Table Expandable" component page "controlled" in no iframe
And I click "Collapse All" button on preview
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove extra space between And and I.

@edleeks87 edleeks87 force-pushed the FE-4007-controlled-expansion branch from aa11df2 to 57522d2 Compare April 21, 2021 16:25
…ally

Adds `useEffect` to ensure `expandable` `FlatTableRows` update when the value of the `expanded` prop
changes

fix #3875
@edleeks87 edleeks87 force-pushed the FE-4007-controlled-expansion branch from 57522d2 to 721f975 Compare April 21, 2021 16:26
@edleeks87 edleeks87 merged commit 1014e1c into master Apr 22, 2021
@edleeks87 edleeks87 deleted the FE-4007-controlled-expansion branch April 22, 2021 08:14
@carbonci
Copy link
Collaborator

🎉 This PR is included in version 68.25.3 🎉

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.

FlatTableRow prop "expanded" does not work if controlled
8 participants