Skip to content
This repository has been archived by the owner on Nov 8, 2020. It is now read-only.

Column Switcher: Improvements #13

Merged
merged 1 commit into from
Aug 23, 2018
Merged

Conversation

dmitriy-kudelko
Copy link
Collaborator

This PR:

  • changes the implementation so that onChange handler operates with dataKey rather than checkbox id
  • adds support for alwaysVisible column prop to disable hidning of certain columns
  • contains fixes to exclude columns with no title/dataKey provided from displaying in column switcher list

Copy link
Owner

@samrith-s samrith-s left a comment

Choose a reason for hiding this comment

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

Looks good. Please see minor comments!

{columns.map(({ title, dataKey, visible: isChecked }) => (
<ColumnSwitcherItem
key={dataKey}
{...{
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe we should create a variable and spread that here, because I feel this is a bit difficult to read, but we could always do this later.

}
};

Column.propTypes = {
Copy link
Owner

Choose a reason for hiding this comment

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

We could also add propTypes and defaultProps for other props passed to column component as well to make it easier to read and understand. I'll pick this one up if you are focusing on other features.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I think this is a good idea 'cause currently you can't rely on IDE's suggestions to insert a prop since they aren't listed in prop types.

Copy link
Owner

Choose a reason for hiding this comment

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

Yep, I will pick this up in a new PR later today.

@samrith-s samrith-s merged commit 5b6ccdb into master Aug 23, 2018
@samrith-s samrith-s deleted the fix/column-switcher-improvements branch August 23, 2018 10:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants