Skip to content
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

[Security Solution] Replace HoverActions component and useHoverActions hook with the new CellActions for events viewer(alerts and events tables). #145666

Closed
YulNaumenko opened this issue Nov 18, 2022 · 2 comments
Assignees
Labels
8.7 candidate Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team technical debt Improvement of the software architecture and operational architecture

Comments

@YulNaumenko
Copy link
Contributor

Related to the Epic issue #144943
Prerequisites for the current issue is an implemented: #145663, #145657, #145662

  1. Replace HoverActions usage for ActionCell:

Screen Shot 2022-11-17 at 8 42 28 PM

  1. Replace the direct usage of timelines.getHoverActions for ExpandedCellValueActionsComponent

Screen Shot 2022-11-17 at 8 44 10 PM

  1. Decompose non draggable components from the DraggableWraper component usage, just for the getting HoverActions functionality

Screen Shot 2022-11-17 at 8 46 02 PM

  1. Replace direct usage of timelines.getHoverActions for the cellActions

Screen Shot 2022-11-17 at 8 48 33 PM

  1. Cleanup timelines plugin from the exposed as in the interface getHoverActions functionality
@YulNaumenko YulNaumenko added technical debt Improvement of the software architecture and operational architecture Team:Threat Hunting Security Solution Threat Hunting Team Team:Threat Hunting:Explore 8.7 candidate labels Nov 18, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@YulNaumenko YulNaumenko changed the title [Security Solution] Replace HoverActions component and useHoverActions hook with the new functionality based on the registry. [Security Solution] Replace HoverActions component and useHoverActions hook with the new CellActions for events viewer(alerts and events tables). Jan 12, 2023
@semd
Copy link
Contributor

semd commented Jan 13, 2023

Checklist:

  • Create new export from cell_actions to be injected in the EuiDataGrid column cellActions: EuiDataGridColumnCellAction[] prop
  • migrate alerts & events tables to use the new export
  • migrate the rest of the usual inline/hover cellActions:
    • Event detail flyout
    • Event detail page

semd added a commit that referenced this issue Jan 27, 2023
part of: #145666

## Summary

This PR contains changes in the `dataProvider` function for the
addToTimeline action:

- add support for empty values excluding the field, to make it
consistent with the legacy implementation.
- id changes removing the "draggable" word.
- extracted `getIdForField` function to reduce the main function
complexity (linter warning appeared)

This PR also introduces the `CellAction` type for action creation:

- `isCompatible` method parameters uses the new
`CellActionCompatibilityContext` type instead of
`CellActionExecutionContext`, it omits the `field.value` and the
references values, they are not needed to check the compatibility and,
in some situations, it is not possible to pass them.
- use CellAction type in all SecuritySolution action creators
- action creators now return plain objects instead of using
`createAction` (deprecated) function.
- all actions now check `fieldHasCellActions(field.name)` in the
`inCompatible` function, to keep the consistency with legacy code.
- `useLoadAction` hooks now integrate the error control, components
don't need to check the `error` anymore.

Co-authored-by: Kibana Machine <[email protected]>
kqualters-elastic pushed a commit to kqualters-elastic/kibana that referenced this issue Feb 6, 2023
…c#149527)

part of: elastic#145666

## Summary

This PR contains changes in the `dataProvider` function for the
addToTimeline action:

- add support for empty values excluding the field, to make it
consistent with the legacy implementation.
- id changes removing the "draggable" word.
- extracted `getIdForField` function to reduce the main function
complexity (linter warning appeared)

This PR also introduces the `CellAction` type for action creation:

- `isCompatible` method parameters uses the new
`CellActionCompatibilityContext` type instead of
`CellActionExecutionContext`, it omits the `field.value` and the
references values, they are not needed to check the compatibility and,
in some situations, it is not possible to pass them.
- use CellAction type in all SecuritySolution action creators
- action creators now return plain objects instead of using
`createAction` (deprecated) function.
- all actions now check `fieldHasCellActions(field.name)` in the
`inCompatible` function, to keep the consistency with legacy code.
- `useLoadAction` hooks now integrate the error control, components
don't need to check the `error` anymore.

Co-authored-by: Kibana Machine <[email protected]>
semd added a commit that referenced this issue Feb 13, 2023
…#149934)

issue: #145666

## Summary

Migrate DataTable component, used to render the alerts/events data grids
in different pages: Alerts, Explore pages (Hosts, Users, Network), and
also Rule preview. In summary, all data grids but Timeline.

The integration won't modify any action or change any functionality,
everything is supposed to keep working the same way from the User's
perspective. But it has a minor UI update in the actions tooltip layout:

*old*

![old](https://user-images.githubusercontent.com/17747913/215819948-9ef23f3f-58b2-4bd5-a9c3-6c365c2e9921.png)

*new*

![new](https://user-images.githubusercontent.com/17747913/215820225-9a736bf3-db8d-41e2-86c8-b709ef7a5f66.png)

This change was needed since the custom tooltip (old one) was adding too
many Security-related customizations to the generic EuiDataGrid's
_columnCellActions_, and also it had a lot of "action-specific"
complexity, which is against the idea of having an action-agnostic
generic component, to begin with.
So, in order to unify the CellActions user experience (icon, text,
layout...), we needed to use a more uniformed component, that will
render all the actions without any special case.

---------

Co-authored-by: Kibana Machine <[email protected]>
@semd semd closed this as completed Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.7 candidate Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

No branches or pull requests

4 participants