-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] add prevalence expanded section to expandable flyout #158606
Conversation
75334bf
to
d722b0f
Compare
d722b0f
to
bc59e78
Compare
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.
x-pack/plugins/security_solution/public/flyout/left/context.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/flyout/shared/utils/fetch_data.ts
Outdated
Show resolved
Hide resolved
...ins/security_solution/public/flyout/shared/hooks/use_fetch_field_value_pair_by_event_type.ts
Outdated
Show resolved
Hide resolved
...rity_solution/public/flyout/shared/hooks/use_fetch_field_value_pair_with_aggregation.test.ts
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.tsx
Outdated
Show resolved
Hide resolved
bc59e78
to
45adce3
Compare
I kept going back and fourth on this when I was developing it. I just added back the % in the cells directly and yeah it definitely looks better. Thanks! |
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.
looking good, one thing is that undefined
returned inside LeftFlyoutContext
, see my comment please:)
...ss/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_prevalence_tab.cy.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/flyout/left/components/analyze_graph.stories.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.test.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.test.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.tsx
Outdated
Show resolved
Hide resolved
} | ||
|
||
if (error) { | ||
return null; |
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.
actually maybe we should return something 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.
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.
this looks okay to me, but maybe @ferenrigue has some better idea:)
.../security_solution/public/flyout/left/components/prevalence_details_prevalence_cell.test.tsx
Outdated
Show resolved
Hide resolved
...ugins/security_solution/public/flyout/left/components/prevalence_details_prevalence_cell.tsx
Outdated
Show resolved
Hide resolved
...ins/security_solution/public/flyout/shared/hooks/use_fetch_field_value_pair_by_event_type.ts
Outdated
Show resolved
Hide resolved
2c8f2af
to
64a8a5f
Compare
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.
Desk tested and LGTM!
export const PREVALENCE_TABLE_ALERT_COUNT_COLUMN_TITLE = i18n.translate( | ||
'xpack.securitySolution.flyout.prevalenceTableAlertCountColumnTitle', | ||
{ | ||
defaultMessage: 'Alert Count', |
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.
elastic styles prefer sentence case: i.e. 'Alert count'
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.
yup, good point, fixed!
ce46f89
to
d34e775
Compare
- add doc - lefft and right context more consistent - add table column title translations - more % to cells instead of column title
- remove unnecessary Storybook stories (analyzer graph and session view) - replace as jest.Mock by jest.mocked where appropriate - improve useMemo inside PrevalenceDetails - cell components return error EuiIcon instead of null in case of errors
d34e775
to
241c92b
Compare
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Unknown metric groupsESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Summary
This PR adds the Prevalence details section under the Insights section of the left expanded panel of the expandable flyout.
The PR introduces the following main changes:
PrevalenceDetails
placeholder component now retrieves the highlighted fields (using the same hook thePrevalenceOverview
component was using, then displays a table with the calculated valuesPrevalenceDetailsCountCell
andPrevalenceDetailsPrevalenceCell
components, that are using within theEuiBasicTable
cellrender
methodsuseFetchUniqueByField
,useFetchFieldValuePairWithAggregation
anduseFetchFieldValuePairByEventType
) to fetch the data and do the necessary calculations. The hooks were very similar to the work done in the previous prevalence overview PR and were therefore made more generic and extracted to theshared
folder at the root of theflyout
folder. The hooks used within theright
folder were replaced by these new generic onesSome smaller changes were also made:
LeftFlyoutContext
was renamed toLeftPanelContext
to be consistent with theRightPanelContext
used in the other folderData is being fetched using ReactQuery.
How to test
xpack.securitySolution.enableExperimental: ['securityFlyoutEnabled']
to thekibana.json
fileyarn es snapshot --license trial
,yarn test:generate
andyarn start --no-base-path
How to generate correlations data
See the description of the previous PR and this comment to learn how to generate data.
https://github.com/elastic/security-team/issues/6423
TODO