Skip to content

Commit

Permalink
[7.x] [Security Solution][Resolver] Undo origin panel update (#73501) (
Browse files Browse the repository at this point in the history
…#73586)

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
michaelolo24 and elasticmachine authored Jul 29, 2020
1 parent f252181 commit c80c6b8
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions x-pack/plugins/security_solution/public/resolver/view/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

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

import React, { useContext, useEffect } from 'react';
import React, { useContext } from 'react';
import { useSelector } from 'react-redux';
import { useEffectOnce } from 'react-use';
import { EuiLoadingSpinner } from '@elastic/eui';
Expand Down Expand Up @@ -68,25 +68,12 @@ export const ResolverMap = React.memo(function ({
const hasError = useSelector(selectors.hasError);
const activeDescendantId = useSelector(selectors.ariaActiveDescendant);
const { colorMap } = useResolverTheme();
const {
cleanUpQueryParams,
queryParams: { crumbId },
pushToQueryParams,
} = useResolverQueryParams();
const { cleanUpQueryParams } = useResolverQueryParams();

useEffectOnce(() => {
return () => cleanUpQueryParams();
});

useEffect(() => {
// When you refresh the page after selecting a process in the table view (not the timeline view)
// The old crumbId still exists in the query string even though a resolver is no longer visible
// This just makes sure the activeDescendant and crumbId are in sync on load for that view as well as the timeline
if (activeDescendantId && crumbId !== activeDescendantId) {
pushToQueryParams({ crumbId: activeDescendantId, crumbEvent: '' });
}
}, [crumbId, activeDescendantId, pushToQueryParams]);

return (
<StyledMapContainer className={className} backgroundColor={colorMap.resolverBackground}>
{isLoading ? (
Expand Down

0 comments on commit c80c6b8

Please sign in to comment.