From 928b4be2c2cc56928a2e9ef76bbcadbeb66c056d Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Mon, 14 Nov 2022 15:15:37 -0500 Subject: [PATCH] Fleet UI: Team saved across dashboard <> manage host link bug (#8704) --- frontend/pages/DashboardPage/DashboardPage.tsx | 2 ++ .../cards/LowDiskSpaceHosts/LowDiskSpaceHosts.tsx | 3 +++ .../pages/DashboardPage/cards/MissingHosts/MissingHosts.tsx | 3 +++ 3 files changed, 8 insertions(+) diff --git a/frontend/pages/DashboardPage/DashboardPage.tsx b/frontend/pages/DashboardPage/DashboardPage.tsx index 68cf55c678..cd5f554ef3 100644 --- a/frontend/pages/DashboardPage/DashboardPage.tsx +++ b/frontend/pages/DashboardPage/DashboardPage.tsx @@ -401,6 +401,7 @@ const DashboardPage = (): JSX.Element => { isLoadingHosts={isHostSummaryFetching} showHostsUI={showHostsUI} selectedPlatformLabelId={selectedPlatformLabelId} + currentTeamId={currentTeam?.id} /> ), }); @@ -414,6 +415,7 @@ const DashboardPage = (): JSX.Element => { isLoadingHosts={isHostSummaryFetching} showHostsUI={showHostsUI} selectedPlatformLabelId={selectedPlatformLabelId} + currentTeamId={currentTeam?.id} /> ), }); diff --git a/frontend/pages/DashboardPage/cards/LowDiskSpaceHosts/LowDiskSpaceHosts.tsx b/frontend/pages/DashboardPage/cards/LowDiskSpaceHosts/LowDiskSpaceHosts.tsx index 3569c02e3a..772d77987f 100644 --- a/frontend/pages/DashboardPage/cards/LowDiskSpaceHosts/LowDiskSpaceHosts.tsx +++ b/frontend/pages/DashboardPage/cards/LowDiskSpaceHosts/LowDiskSpaceHosts.tsx @@ -13,6 +13,7 @@ interface IHostSummaryProps { isLoadingHosts: boolean; showHostsUI: boolean; selectedPlatformLabelId?: number; + currentTeamId?: number; } const LowDiskSpaceHosts = ({ @@ -21,11 +22,13 @@ const LowDiskSpaceHosts = ({ isLoadingHosts, showHostsUI, selectedPlatformLabelId, + currentTeamId, }: IHostSummaryProps): JSX.Element => { // build the manage hosts URL filtered by low disk space only // currently backend cannot filter by both low disk space and label const queryParams = { low_disk_space: lowDiskSpaceGb, + team_id: currentTeamId, }; const queryString = buildQueryStringFromParams(queryParams); const endpoint = selectedPlatformLabelId diff --git a/frontend/pages/DashboardPage/cards/MissingHosts/MissingHosts.tsx b/frontend/pages/DashboardPage/cards/MissingHosts/MissingHosts.tsx index fd161c19e0..f66d9f1c44 100644 --- a/frontend/pages/DashboardPage/cards/MissingHosts/MissingHosts.tsx +++ b/frontend/pages/DashboardPage/cards/MissingHosts/MissingHosts.tsx @@ -12,6 +12,7 @@ interface IHostSummaryProps { isLoadingHosts: boolean; showHostsUI: boolean; selectedPlatformLabelId?: number; + currentTeamId?: number; } const MissingHosts = ({ @@ -19,10 +20,12 @@ const MissingHosts = ({ isLoadingHosts, showHostsUI, selectedPlatformLabelId, + currentTeamId, }: IHostSummaryProps): JSX.Element => { // build the manage hosts URL filtered by missing and platform const queryParams = { status: "missing", + team_id: currentTeamId, }; const queryString = buildQueryStringFromParams(queryParams); const endpoint = selectedPlatformLabelId