-
Notifications
You must be signed in to change notification settings - Fork 869
EuiDataGrid cellAction and expand popover #5132
Description
Request for update to options for EuiDataGrid cellAction
Reason for change
As more Solutions are using the EuiDataGrid for a wider range of use cases, we should consider baking in some guidelines to the component alongside best practices so we can remain consistent in our usage across Kibana.
Proposed change
One of our recommendations is that no more than 3 icons should be visible on hover (including the expand action). However, we have several use cases where additional actions are required.
Currently, it is possible to add as many actions as desired. However, we should follow a similar rationale as the EuiBasicTable.
There can only be up to 2 actions visible per row. When more than two actions are defined, the first 2
isPrimaryactions will stay visible, an ellipses icon button will hold all actions in a single popover.
For the purposes of the EuiDataGrid, the ellipses icon is replaced with the expand icon on a cell.
Implementation:
- distinguish between primary & non-primary actions
- limit the cell actions to the icons for 0...2 primary actions + expansion icon
- provide the actions & their grouping (primary vs. non) to the default popover, and render accordingly
- provide the actions & their grouping (primary vs. non) to custom popovers
- maybe also provide a React element that already has a ready-to-use structure, re-used from the default popover?
So with this in mind, we can (somehow) mark actions as primary and display up to the first 2 actions as the exposed hover actions. Within the expand popover, display these same actions in a horizontal row (current display option). Non-primary actions would not be visible on hover within the cell, and display in a vertical list below the primary actions row within the popover.
If no primary actions are found, then no actions (aside from expand) are shown on hover and all actions are displayed as a list within the popover.
