Fix incorrect load state when selecting all hosts from the hosts filter (#3426)

This commit is contained in:
Luke Heath 2021-12-22 20:56:52 -06:00 committed by GitHub
parent 51b19b445f
commit 1d891cd343
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 9 deletions

View file

@ -0,0 +1 @@
* Fix incorrect load state when selecting all hosts from the hosts filter.

View file

@ -530,9 +530,8 @@ const ManageHostsPage = ({
softwareId,
]);
const handleLabelChange = ({ slug }: ILabel) => {
const handleLabelChange = ({ slug }: ILabel): boolean => {
if (!slug) {
console.error("Slug was missing. This should not happen.");
return false;
}
@ -580,6 +579,8 @@ const ManageHostsPage = ({
queryParams: newQueryParams,
})
);
return true;
};
const handleChangePoliciesFilter = (response: PolicyResponse) => {
@ -1480,13 +1481,12 @@ const ManageHostsPage = ({
return <TableDataError />;
}
// Hosts have not been set up for this instance yet.
// There are no hosts for this instance yet
if (
(getStatusSelected() === ALL_HOSTS_LABEL && selectedLabel.count === 0) ||
(getStatusSelected() === ALL_HOSTS_LABEL &&
filteredHostCount === 0 &&
searchQuery === "" &&
!isHostsLoading)
getStatusSelected() === ALL_HOSTS_LABEL &&
filteredHostCount === 0 &&
searchQuery === "" &&
!isHostsLoading
) {
return (
<NoHosts
@ -1566,6 +1566,7 @@ const ManageHostsPage = ({
(isPremiumTier && !currentTeam?.id && !isLoadingTeams)) &&
!isGlobalSecretsLoading &&
!globalSecrets?.length;
return ((canEnrollHosts && noTeamEnrollSecrets) ||
(canEnrollGlobalHosts && noGlobalEnrollSecrets)) &&
showNoEnrollSecretBanner ? (

View file

@ -3,7 +3,6 @@
*/
import React from "react";
import Button from "components/buttons/Button";
import { ITeam } from "interfaces/team";
import RoboDogImage from "../../../../../../assets/images/robo-dog-176x144@2x.png";