-
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
Table actions visibility #1103
Table actions visibility #1103
Conversation
Thanks so much for doing this @cchaos! I think this does a great job of addressing my original problem of not knowing if a table's rows can be edited or otherwise interacted with just by looking at the table. I have a few thoughts, just to share my stream of consciousness:
|
Thanks @cjcenizal !
I've also started adding some decision points to the main description of this PR. |
Ok, so I just pushed a couple commits, that address items 1 & 2 above.
The issue I'm having with item 2 is that, for the collapsed (all actions popover), the |
Everything works as described above. LGTM! cc/ @snide |
and wrapped action items with tooltip **if enabled and has description**
26c584e
to
c179b97
Compare
I tested this pretty thoroughly in Kibana master using a Saved objectsLikely happening because their are exactly two items. BeforeAfterML jobs listThis is because they are adding some extra bordering on things. Since the ML team requested this change, I think it's OK to expect them to convert their tables to use this stuff. The break below is purely visual and does not affect functionality in any way. BeforeAfterConclusionWe might want to label this one breaking. The changes look really easy to fix, but I don't have visibility into what the other teams are using this stuff for (thinking of cloud). Either that or we might want to rethink the 2 actions scenario. |
So it's mostly going to affect tables that have exactly 2 actions which are currently auto-populating into a popover so they didn't need to add the That ML issue actually comes from a different issue, where I'll set it as a breaking change, but it's not really breaking functionality, so I'm not too worried about changing it in general. |
- Changed ‘person’ to ‘user’ - Basic table now auto-applies `hasActions` and `isSelectable` to rows that provide those column types, but it’s still configurable too - Addressed opacity accessibility
Ok, this is ready for final (and code) review. |
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.
Two small changes, otherwise code and visuals look great
@@ -590,9 +597,9 @@ export class EuiBasicTable extends Component { | |||
<Fragment key={`row_${itemId}`}> | |||
<EuiTableRow | |||
aria-owns={expandedRowId} | |||
isSelectable={isSelectable} | |||
isSelectable={typeof isSelectable === 'boolean' ? isSelectable : calculatedHasSelection} |
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.
{isSelectable == null ? calculatedHasSelection : isSelectable}
IMO is easier to read, and it more clearly communicates that the variable is null vs. a value, instead of multiple kinds of values.
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.
Makes sense, done
isSelected={selected} | ||
hasActions={hasActions} | ||
hasActions={typeof hasActions === 'boolean' ? hasActions : calculatedHasActions} |
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.
same change here
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.
LGTM! Code review, pulled and tested locally, looks great!
Let's talk about the "breaking" changes in this quickly before we merge, might want to do it as a separate release after we push a new one. |
Understanding the breaking changeUp to two visible actions per row (not including the "More") Essentially, instead of completely hiding the icons until hover, their opacity is just reduced a bit and the actions object now doesn't collapse until there are more than 2 (not more than 1) options. If any are deemed Remedies If your table had exactly 2 actions and you are now seeing your table actions displayed as full buttons, add If your table had more than 2 actions and you now see the first two action as full buttons next to an ellipses, add |
Piggy-backing off of the discussion from #1080, here is a POC for altering the
EuiBasicTable
to utilize the concept agreed upon.I've commented out all but the Actions example in the docs to help zero in on the relevant example. I tried not to create any breaking changes.
Essentially, instead of completely hiding the icons until hover, their opacity is just reduced a bit and the actions object now doesn't collapse until there are more than 2 (not more than 1) options. If any are deemed
isPrimary
, those will be shown on hover alongside the "more" dropdown, though only the first 2 "primary" actions will be shown in case more were declared.The
isPrimary
prop added to the actions options, is my favorite prop name because it conflicts with our color scheme naming, but I'm having trouble coming up with a better one.Decisions: