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.
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.
snide
left a comment
There was a problem hiding this comment.
As far as docs, design and functionality go. This is mergible.
thompsongl
left a comment
There was a problem hiding this comment.
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. |
snide
left a comment
There was a problem hiding this comment.
Checked locally. Thanks for the i18n fixes.
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_2993/ |
thompsongl
left a comment
There was a problem hiding this comment.
Latest commit changes look good 👍
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_2993/ |




Summary
Fixes #2622
toolbarVisibility.showColumnSelectorto allow objects as well. I think this nicely and naturally extends the existing design of thetoolbarVisibilityvalue, where false values disable, undefined/true values enable, and an object customizes furtherallowHideandallowReordervalues 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