[8.8] [Bug][Security Solution][Investigations] - check for additional filters object (#156990) (#157025)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Bug][Security Solution][Investigations] - check for additional
filters object (#156990)](https://github.com/elastic/kibana/pull/156990)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Michael
Olorunnisola","email":"michael.olorunnisola@elastic.co"},"sourceCommit":{"committedDate":"2023-05-08T16:38:48Z","message":"[Bug][Security
Solution][Investigations] - check for additional filters object
(#156990)\n\n## Summary\r\n\r\nIt is possible that the
`additionalFilters` object was not set on a\r\nuser's existing
configuration of the alert table in local storage if\r\nthey never
interacted with it since the feature was added. The object is\r\nset on
new initialization of the alert table, but for prior\r\nconfigurations,
only gets set if the user has interacted with the\r\n`additionalFilters`
dropdown in the alert page. This resulted in a type\r\nerror when
redirecting, which this PR
fixes.","sha":"45ee63a61ec16189e7c48394e592d1de670dad3c","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:Threat
Hunting:Investigations","v8.8.0","v8.9.0"],"number":156990,"url":"https://github.com/elastic/kibana/pull/156990","mergeCommit":{"message":"[Bug][Security
Solution][Investigations] - check for additional filters object
(#156990)\n\n## Summary\r\n\r\nIt is possible that the
`additionalFilters` object was not set on a\r\nuser's existing
configuration of the alert table in local storage if\r\nthey never
interacted with it since the feature was added. The object is\r\nset on
new initialization of the alert table, but for prior\r\nconfigurations,
only gets set if the user has interacted with the\r\n`additionalFilters`
dropdown in the alert page. This resulted in a type\r\nerror when
redirecting, which this PR
fixes.","sha":"45ee63a61ec16189e7c48394e592d1de670dad3c"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156990","number":156990,"mergeCommit":{"message":"[Bug][Security
Solution][Investigations] - check for additional filters object
(#156990)\n\n## Summary\r\n\r\nIt is possible that the
`additionalFilters` object was not set on a\r\nuser's existing
configuration of the alert table in local storage if\r\nthey never
interacted with it since the feature was added. The object is\r\nset on
new initialization of the alert table, but for prior\r\nconfigurations,
only gets set if the user has interacted with the\r\n`additionalFilters`
dropdown in the alert page. This resulted in a type\r\nerror when
redirecting, which this PR
fixes.","sha":"45ee63a61ec16189e7c48394e592d1de670dad3c"}}]}]
BACKPORT-->

Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
This commit is contained in:
Kibana Machine 2023-05-08 14:40:39 -04:00 committed by GitHub
parent dd0eab6441
commit 5f0d6dbc7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,7 @@ export const useInitFlyoutFromUrlParam = () => {
const { initialized, isLoading, totalCount, additionalFilters } = dataTableCurrent;
const isTableLoaded = initialized && !isLoading && totalCount > 0;
if (urlDetails) {
if (!additionalFilters.showBuildingBlockAlerts) {
if (!additionalFilters || !additionalFilters.showBuildingBlockAlerts) {
// We want to show building block alerts when loading the flyout in case the alert is a building block alert
dispatch(
dataTableActions.updateShowBuildingBlockAlertsFilter({