-
Notifications
You must be signed in to change notification settings - Fork 4k
Allow hiding dataframe columns from UI #10264
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
Allow hiding dataframe columns from UI #10264
Conversation
| const hideColumn = React.useCallback( | ||
| (columnId: string) => { | ||
| setColumnConfigMapping(prevColumnConfigMapping => { | ||
| const newColumnConfigMapping = new Map(prevColumnConfigMapping) |
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.
Why do we need to create a new map object here? (Not suggesting it is wrong, just to understand).
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.
Good question. I'm not 100% sure why I wrapped that into a new map. It was something I already did in some similar merged code, but I think we can remove it. I will probably do it in a follow up PR since its now part of a utils function.
|
|
||
| const showColumn = React.useCallback( | ||
| (columnId: string) => { | ||
| setColumnConfigMapping(prevColumnConfigMapping => { |
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.
Just thinking this function could be pulled into a helper function. I guess it is a bit different then the logic in the other PR although shared between showColumn and hideColumn.
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.
Changed 👍
…e-column-visibility-menu
…e-column-visibility-menu
Describe your changes
Allow users to show & hide dataframe columns from UI via the column menu:
This also adds a new toolbar action that allows showing & hiding all columns of the dataframe:
GitHub Issue Link (if applicable)
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.