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] Multi level grouping for alerts table #152862

Merged

Conversation

YulNaumenko
Copy link
Contributor

@YulNaumenko YulNaumenko commented Mar 7, 2023

Multi Level Grouping

Resolves #150516
Resolves #150514

Implements multi level grouping in Alerts table and Rule details table. Supports 3 levels deep.

grouping.mov

Test plan

https://docs.google.com/document/d/15oseanNzF-u-Xeoahy1IVxI4oV3wOuO8VhA886cA1U8/edit#

To do

@YulNaumenko YulNaumenko self-assigned this Mar 7, 2023
kibanamachine and others added 16 commits March 7, 2023 22:56
…ultilevel_grouping

# Conflicts:
#	packages/kbn-securitysolution-grouping/src/components/grouping.tsx
#	packages/kbn-securitysolution-grouping/src/components/types.ts
#	packages/kbn-securitysolution-grouping/src/hooks/use_get_group_selector.tsx
#	packages/kbn-securitysolution-grouping/src/hooks/use_grouping.tsx
#	x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_grouping.tsx
);
const onButtonClick = useCallback(() => {
if (!isPopoverOpen && takeActionItems.length === 0) {
setTakeActionItems(getTakeActionItems(groupFilter, groupNumber));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved take action component rendering to be on click. It was previously passed to the component in grouping.tsx variable called groupPanels. This caused multiple performance issues rendering each action for each group despite them not being shown yet, and on top of that groupPanels re-renders a lot. Some weird side effects avoided too just by moving this here.

Copy link
Contributor

@banderror banderror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rules area changes LGTM 👍 I tested it on the Rule Details page and it looks great!

@stephmilovic
Copy link
Contributor

@elasticmachine merge upstream

@stephmilovic
Copy link
Contributor

@elasticmachine merge upstream

@stephmilovic
Copy link
Contributor

@elasticmachine merge upstream

@stephmilovic
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Member

@machadoum machadoum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

return getLevel(
level + 1,
selectedGroups[level + 1],
JSON.stringify([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do these have to be stringified to only be parsed in a recursive next step?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is passed as an object it will cause unnecessary re-rendering

setAlertsQuery(queryGroups);
}
}, [queryGroups, selectedGroup, setAlertsQuery]);
resetAllPagination();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between this reset and the one on line 174? Is there a path for combining them so reset happens in one place?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This triggers a reset when the selectedGroup is changed. The call on 174 resets when the global filters change. The global filters come from security solution and the selected group comes from grouping package. I will combine them in the next PR

Copy link
Contributor

@michaelolo24 michaelolo24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Investigations area changes. The group transitions work so smoothly, nice work!

@michaelolo24
Copy link
Contributor

Fyi, just came across this bug: #155243 not sure if we'd want to disable column toggling or toggle columns for all table levels?

@stephmilovic
Copy link
Contributor

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

kibana-ci commented Apr 21, 2023

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/securitysolution-grouping 15 12 -3

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 9.1MB 9.1MB +2.8KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/securitysolution-grouping 4 6 +2
Unknown metric groups

API count

id before after diff
@kbn/securitysolution-grouping 20 17 -3

ESLint disabled line counts

id before after diff
enterpriseSearch 16 18 +2
securitySolution 394 397 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 17 19 +2
securitySolution 474 477 +3
total +5

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @stephmilovic

@stephmilovic stephmilovic merged commit 9eee24f into elastic:main Apr 24, 2023
22 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Apr 24, 2023
nikitaindik pushed a commit to nikitaindik/kibana that referenced this pull request Apr 25, 2023
…2862)

## Multi Level Grouping

Resolves elastic#150516
Resolves elastic#150514

Implements multi level grouping in Alerts table and Rule details table.
Supports 3 levels deep.


https://user-images.githubusercontent.com/6935300/232547389-7d778f69-d96d-4bd8-8560-f5ddd9fe8060.mov

### Test plan


https://docs.google.com/document/d/15oseanNzF-u-Xeoahy1IVxI4oV3wOuO8VhA886cA1U8/edit#

### To do

- [Cypress](elastic#150666)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:cloud-deploy Create or update a Cloud deployment Feature:Alerts Grouping Security Solution Alerts Grouping feature release_note:enhancement Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team v8.8.0
Projects
None yet
9 participants