Skip to content

Commit ef83e77

Browse files
[Security Solution][Resolver] Show origin node details in panel on load (#73313)
* show origin node details in panel on load * added comment Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent ddff1c9 commit ef83e77

File tree

1 file changed

+16
-2
lines changed
  • x-pack/plugins/security_solution/public/resolver/view

1 file changed

+16
-2
lines changed

x-pack/plugins/security_solution/public/resolver/view/map.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/* eslint-disable react/display-name */
1010

11-
import React, { useContext } from 'react';
11+
import React, { useContext, useEffect } from 'react';
1212
import { useSelector } from 'react-redux';
1313
import { useEffectOnce } from 'react-use';
1414
import { EuiLoadingSpinner } from '@elastic/eui';
@@ -68,11 +68,25 @@ export const ResolverMap = React.memo(function ({
6868
const hasError = useSelector(selectors.hasError);
6969
const activeDescendantId = useSelector(selectors.ariaActiveDescendant);
7070
const { colorMap } = useResolverTheme();
71-
const { cleanUpQueryParams } = useResolverQueryParams();
71+
const {
72+
cleanUpQueryParams,
73+
queryParams: { crumbId },
74+
pushToQueryParams,
75+
} = useResolverQueryParams();
76+
7277
useEffectOnce(() => {
7378
return () => cleanUpQueryParams();
7479
});
7580

81+
useEffect(() => {
82+
// When you refresh the page after selecting a process in the table view (not the timeline view)
83+
// The old crumbId still exists in the query string even though a resolver is no longer visible
84+
// This just makes sure the activeDescendant and crumbId are in sync on load for that view as well as the timeline
85+
if (activeDescendantId && crumbId !== activeDescendantId) {
86+
pushToQueryParams({ crumbId: activeDescendantId, crumbEvent: '' });
87+
}
88+
}, [crumbId, activeDescendantId, pushToQueryParams]);
89+
7690
return (
7791
<StyledMapContainer className={className} backgroundColor={colorMap.resolverBackground}>
7892
{isLoading ? (

0 commit comments

Comments
 (0)