mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[SECURITY_SOLUTION] Fix URL params being carried across to URL routes for which they do not apply (#80726)
* Fix URL params issue on Admin section * Fix route location state being dropped during updates to other route properties
This commit is contained in:
parent
6472caae1d
commit
a91fbae424
3 changed files with 4 additions and 3 deletions
|
@ -278,6 +278,7 @@ export const replaceStateInLocation = <T>({
|
|||
replaceStateKeyInQueryString(urlStateKey, urlStateToReplace)(getQueryStringFromLocation(search))
|
||||
);
|
||||
if (history) {
|
||||
newLocation.state = history.location.state;
|
||||
history.replace(newLocation);
|
||||
}
|
||||
return newLocation.search;
|
||||
|
|
|
@ -11,6 +11,7 @@ import deepEqual from 'fast-deep-equal';
|
|||
|
||||
import { SpyRouteProps } from './types';
|
||||
import { useRouteSpy } from './use_route_spy';
|
||||
import { SecurityPageName } from '../../../../common/constants';
|
||||
|
||||
export const SpyRouteComponent = memo<
|
||||
SpyRouteProps & { location: H.Location; pageName: string | undefined }
|
||||
|
@ -50,6 +51,7 @@ export const SpyRouteComponent = memo<
|
|||
pathName: pathname,
|
||||
state,
|
||||
tabName,
|
||||
...(pageName === SecurityPageName.administration ? { search: search ?? '' } : {}),
|
||||
},
|
||||
});
|
||||
setIsInitializing(false);
|
||||
|
|
|
@ -45,9 +45,7 @@ export const TrustedAppsPage = memo(() => {
|
|||
return <BackToExternalAppButton {...routeState} />;
|
||||
}
|
||||
return null;
|
||||
// FIXME: Route state is being deleted by some parent component
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
}, [routeState]);
|
||||
|
||||
const addButton = (
|
||||
<EuiButton
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue