-
Notifications
You must be signed in to change notification settings - Fork 65
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(component): add expandable rows #579
Conversation
b6294e8
to
5499fde
Compare
I'd like to propose several changes from the design perspective:
|
ef80291
to
1d79ef1
Compare
Great feedback @eugene-polev. To maintain scope of this PR, I have updated the icons and the column size, but we should move the rest of the planned changes to a separate PR. This will allow us to be certain of all the changes needed and to schedule time for those changes. |
Thanks @eugene-polev and @jorgemoya. I'm going to pass this PR since you're going to address his other feedback in another one. |
Currently requesting access to product-design assignment. |
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.
Few comments but looks really good! Great job on this.
/>, | ||
); | ||
|
||
expect(screen.queryAllByRole('row').length).toBe(7); |
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.
Instead of testing for length here, could we check for visibility of fields in the table/worksheet?
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.
Isn't querying and found a test that something was visible? Are you suggesting I test each row? Any guidance on this?
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.
Not sure this will work, but maybe something like this?
expect(screen.queryByRole('row', { name: /shoes name one/i })).not.toBeInTheDocument();
I'm mostly thinking of this part of RTL's documentation: https://testing-library.com/docs/guide-disappearance
packages/big-design/src/components/Worksheet/hooks/useNavigation/useNavigation.ts
Outdated
Show resolved
Hide resolved
packages/big-design/src/components/Worksheet/hooks/useExpandable/useExpandable.ts
Outdated
Show resolved
Hide resolved
packages/big-design/src/components/Worksheet/hooks/useExpandable/useExpandable.ts
Outdated
Show resolved
Hide resolved
packages/big-design/src/components/Worksheet/hooks/useExpandable/useExpandable.ts
Outdated
Show resolved
Hide resolved
packages/big-design/src/components/Worksheet/editors/TextEditor/styled.ts
Outdated
Show resolved
Hide resolved
@@ -11,7 +11,7 @@ interface StyledCellProps<Item> { | |||
} | |||
|
|||
export const StyledCell = styled.td<StyledCellProps<WorksheetItem>>` | |||
background-color: ${({ theme }) => theme.colors.white}; | |||
background-color: ${({ theme }) => theme.colors.inherit}; |
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.
I inherit now from the row.
/>, | ||
); | ||
|
||
expect(screen.queryAllByRole('row').length).toBe(7); |
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.
Isn't querying and found a test that something was visible? Are you suggesting I test each row? Any guidance on this?
What?
Add expandable rows functionality to Worksheet.
Why?
Per the feature request.
I did, however, move the buttons to their own column to handle keyboard navigation properly. I created a
ToggleEditor
component which isn't really an "Editor", but keeps it together with all the other components that render items inside the cells. This enabled me to listen to keyboard events succesfully.Screenshots/Screen Recordings
Testing/Proof
Unit tests and locally.