Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lukasmasuch
Copy link
Collaborator

@lukasmasuch lukasmasuch commented Jan 27, 2025

Describe your changes

Allow users to show & hide dataframe columns from UI via the column menu:

image

This also adds a new toolbar action that allows showing & hiding all columns of the dataframe:

image

GitHub Issue Link (if applicable)

Testing Plan

  • Added unit & e2e tests.

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@lukasmasuch lukasmasuch marked this pull request as draft January 27, 2025 21:31
@lukasmasuch lukasmasuch added security-assessment-completed Security assessment has been completed for PR change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users labels Jan 27, 2025
const hideColumn = React.useCallback(
(columnId: string) => {
setColumnConfigMapping(prevColumnConfigMapping => {
const newColumnConfigMapping = new Map(prevColumnConfigMapping)
Copy link
Collaborator

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).

Copy link
Collaborator Author

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 => {
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed 👍

@lukasmasuch lukasmasuch changed the title [WIP] Allow hiding dataframe columns from UI Allow hiding dataframe columns from UI Feb 24, 2025
@lukasmasuch lukasmasuch marked this pull request as ready for review February 24, 2025 16:38
@lukasmasuch lukasmasuch merged commit e27748b into develop Feb 25, 2025
32 checks passed
@lukasmasuch lukasmasuch deleted the feature/dataframe-column-visibility-menu branch February 25, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show and hide dataframe columns in UI

4 participants