Fix title of manage hosts page UI for free version (#2467)

This commit is contained in:
gillespi314 2021-10-11 10:11:54 -05:00 committed by GitHub
parent 981028705e
commit daa8a5d31a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 10 deletions

1
changes/fix-2458 Normal file
View file

@ -0,0 +1 @@
* Fix missing default header on manage hosts page for Fleet Free version

View file

@ -224,14 +224,14 @@ const ManageHostsPage = ({
}
);
const { data: teams } = useQuery<ITeamsResponse, Error, ITeam[]>(
["teams"],
() => teamsAPI.loadAll(),
{
enabled: isPremiumTier,
select: (data: ITeamsResponse) => data.teams,
}
);
const { data: teams, isLoading: isLoadingTeams } = useQuery<
ITeamsResponse,
Error,
ITeam[]
>(["teams"], () => teamsAPI.loadAll(), {
enabled: !!isPremiumTier,
select: (data: ITeamsResponse) => data.teams,
});
useQuery<IPolicyAPIResponse, Error>(
["policy"],
@ -757,7 +757,7 @@ const ManageHostsPage = ({
};
const renderTeamsFilterDropdown = () => {
if (!isPremiumTier || !teams) {
if (isPremiumTier && isLoadingTeams) {
return null;
}
@ -766,7 +766,7 @@ const ManageHostsPage = ({
}
const teamOptions = generateTeamFilterDropdownOptions(
teams,
teams || [],
currentUser,
isOnGlobalTeam as boolean
);