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
Introduce hook to rediect to alerts page from within security solution and implement in Detection Response dashboard #152714
Introduce hook to rediect to alerts page from within security solution and implement in Detection Response dashboard #152714
Conversation
...lution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx
Outdated
Show resolved
Hide resolved
dff3815
to
f42eb8b
Compare
fieldName: 'kibana.alert.severity', | ||
}, | ||
] | ||
: []), |
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.
[] array is not a valid value for a page filter type, so in this case if we want to select alerts of all severities then we should be adding severity page filter with selected options as empty array ([]
) so that system knows that no value needs to be selected.
: []), | |
: [ | |
{ | |
title: 'Severity', | |
selectedOptions: [], | |
fieldName: 'kibana.alert.severity', | |
} | |
]), |
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.
Hey @logeekal , I don't think this is problematic :P
The whole block starts with the spread operator:
...
...(severity
? [
{
title: 'Severity',
selectedOptions: [severity],
fieldName: 'kibana.alert.severity',
},
]
: [])
So the existence of severity determines which array gets spread. if the empty array gets spread ( ...[]) this results in nothing being added to the outer array as there is nothing to iterate over.
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
...ck/plugins/security_solution/public/common/hooks/use_navigate_to_alerts_page_with_filters.ts
Outdated
Show resolved
Hide resolved
...solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.tsx
Outdated
Show resolved
Hide resolved
...lution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx
Outdated
Show resolved
Hide resolved
...lution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx
Outdated
Show resolved
Hide resolved
...solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.tsx
Outdated
Show resolved
Hide resolved
...solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.tsx
Outdated
Show resolved
Hide resolved
I'm also noticing behavior that after clicking through to open the alerts page within a given filter (i.e |
Thanks for catching that, I should have noted it in the Summary. We traced it down to here:
it uses a hook called Anyway, Jatin refactored
with a solution, so main has it working correctly. I did need to update my branch though 🤦 |
...solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/common/components/charts/donutchart.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/common/components/charts/donutchart.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/common/components/charts/donutchart.tsx
Outdated
Show resolved
Hide resolved
...lution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx
Outdated
Show resolved
Hide resolved
...ck/plugins/security_solution/public/common/hooks/use_navigate_to_alerts_page_with_filters.ts
Outdated
Show resolved
Hide resolved
...solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.tsx
Outdated
Show resolved
Hide resolved
…ub.com:jamster10/kibana into 149022-redirect-to-alerts-page-from-dashboards
…ub.com:jamster10/kibana into 149022-redirect-to-alerts-page-from-dashboards
…ub.com:jamster10/kibana into 149022-redirect-to-alerts-page-from-dashboards t push
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @jamster10 |
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.
Thanks for making the changes, LGTM!
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!
…n and implement in Detection Response dashboard (#152714) ## Summary Built upon @logeekal 's work, this PR adds the ability to navigate to the Alerts page with filters from anywhere within the application and thus requires the feature flag `alertsPageFiltersEnabled` 1. Hook for navigation: `useNavigateToAlertsPageWithFilters` returns a function that takes `FilterItemObj | FilterItemObj[]` and navigates the user to the Alert page. 2. Update Detection & Response : The dashboard has been updated to implement the above feature for all widgets with alert data: #149022 - Also affecting the Host and User explore pages (alerts by Severity) NOTE: Alerts by Severity is only affected with `chartEmbeddablesEnabled` DISABLED ![Recording 2023-03-08 at 21 38 55](https://user-images.githubusercontent.com/28942857/223910641-6e86ba76-1d63-4f61-8815-537a9df8cb02.gif) 3. Update `DonutChart` to take ownership of its `onElementClick`. It now takes a prop `onDonutPartitionClicked` that provides the name of the donut segment clicked. ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kristof-Pierre Cummings <kristofpierre.cummings@elastic.co>
…n and implement in Detection Response dashboard (elastic#152714) ## Summary Built upon @logeekal 's work, this PR adds the ability to navigate to the Alerts page with filters from anywhere within the application and thus requires the feature flag `alertsPageFiltersEnabled` 1. Hook for navigation: `useNavigateToAlertsPageWithFilters` returns a function that takes `FilterItemObj | FilterItemObj[]` and navigates the user to the Alert page. 2. Update Detection & Response : The dashboard has been updated to implement the above feature for all widgets with alert data: elastic#149022 - Also affecting the Host and User explore pages (alerts by Severity) NOTE: Alerts by Severity is only affected with `chartEmbeddablesEnabled` DISABLED ![Recording 2023-03-08 at 21 38 55](https://user-images.githubusercontent.com/28942857/223910641-6e86ba76-1d63-4f61-8815-537a9df8cb02.gif) 3. Update `DonutChart` to take ownership of its `onElementClick`. It now takes a prop `onDonutPartitionClicked` that provides the name of the donut segment clicked. ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kristof-Pierre Cummings <kristofpierre.cummings@elastic.co>
Summary
Built upon @logeekal 's work, this PR adds the ability to navigate to the Alerts page with filters from anywhere within the application and thus requires the feature flag
alertsPageFiltersEnabled
Hook for navigation:
useNavigateToAlertsPageWithFilters
returns a function that takesFilterItemObj | FilterItemObj[]
and navigates the user to the Alert page.Update Detection & Response :
The dashboard has been updated to implement the above feature for all widgets with alert data: [SecuritySolution] Link to alerts page with certain filters applied #149022 - Also affecting the Host and User explore pages (alerts by Severity)
NOTE: Alerts by Severity is only affected with
chartEmbeddablesEnabled
DISABLEDDonutChart
to take ownership of itsonElementClick
. It now takes a proponDonutPartitionClicked
that provides the name of the donut segment clicked.Checklist
Delete any items that are not applicable to this PR.