-
Notifications
You must be signed in to change notification settings - Fork 842
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 DataGrid's columns popover to optionally not allow hiding and/or reordering #2993
Allow DataGrid's columns popover to optionally not allow hiding and/or reordering #2993
Conversation
…showColumnSelector
Preview documentation changes for this PR: https://eui.elastic.co/pr_2993/ |
Maybe we need a few states for this? What are y'all's thoughts on:
|
I think it's fine. If we decide we do care, I'd propose actually changing all the existing |
Pushed some design changes. Fixed the various states and icons. Whether or not you can or can not hide columns, we want to keep this button fairly singular in focus. So I kept the "columns" naming and changed the icon to something that works a little more generically. I also fixed the pluralization. Doing a quick docs change, but this should be safe for review now. I also fixed the styling changes when the label is not used. |
Preview documentation changes for this PR: https://eui.elastic.co/pr_2993/ |
className={controlBtnClasses} | ||
data-test-subj="dataGridColumnSelectorButton" | ||
onClick={() => setIsOpen(!isOpen)}> | ||
{numberOfHiddenFields > 0 ? numberOfHiddenFields : null} {buttonText} |
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'm not sure how EUI's i18n system works (or, how it integrates with Kibana) but should we pass the value into the translation string?
Different languages might put the number in a different position or might add a certain count word somewhere in the string as well so we usually want to keep the number and the phrase together.
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.
As far as docs, design and functionality go. This is mergible.
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.
should we pass the value into the translation string?
We've been inconsistent at best on this, but it makes sense.
Otherwise, code LGTM 👍
Preview documentation changes for this PR: https://eui.elastic.co/pr_2993/ |
…d toolbar visibility control to docs
Added another nested toggle to the docs for allowing/disabling column reordering, next to the one Dave added for column show/hide capability. Updated the I18n stuff to place the # of columns hidden value programatically. |
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.
Checked locally. Thanks for the i18n fixes.
Preview documentation changes for this PR: https://eui.elastic.co/pr_2993/ |
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.
Latest commit changes look good 👍
Preview documentation changes for this PR: https://eui.elastic.co/pr_2993/ |
Summary
Fixes #2622
toolbarVisibility.showColumnSelector
to allow objects as well. I think this nicely and naturally extends the existing design of thetoolbarVisibility
value, where false values disable, undefined/true values enable, and an object customizes furtherallowHide
andallowReorder
values ontoolbarVisibility.showColumnSelector
; this breaks with the existingshow*
pattern for naming. Do we care?@snide would you mind doing a design pass?
Checklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Checked in IE11 and Firefox