mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Fleet UI: Only team ID query param persists between software tables (#16733)
This commit is contained in:
parent
12efe99ae4
commit
a0abf6a79c
1 changed files with 8 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ import teamsAPI, { ILoadTeamResponse } from "services/entities/teams";
|
|||
import { AppContext } from "context/app";
|
||||
import { NotificationContext } from "context/notification";
|
||||
import useTeamIdParam from "hooks/useTeamIdParam";
|
||||
import { buildQueryStringFromParams } from "utilities/url";
|
||||
|
||||
import Button from "components/buttons/Button";
|
||||
import MainContent from "components/MainContent";
|
||||
|
|
@ -256,7 +257,13 @@ const SoftwarePage = ({ children, router, location }: ISoftwarePageProps) => {
|
|||
|
||||
const navigateToNav = useCallback(
|
||||
(i: number): void => {
|
||||
const navPath = softwareSubNav[i].pathname.concat(location?.hash || "");
|
||||
// Only query param to persist between tabs is team id
|
||||
const teamIdParam = buildQueryStringFromParams({
|
||||
team_id: location?.query.team_id,
|
||||
});
|
||||
|
||||
const navPath = softwareSubNav[i].pathname.concat(`?${teamIdParam}`);
|
||||
|
||||
router.replace(navPath);
|
||||
},
|
||||
[location, router]
|
||||
|
|
|
|||
Loading…
Reference in a new issue