Fleet UI: Clean up dashboard loading state (#12395)

This commit is contained in:
RachelElysia 2023-06-19 12:08:33 -04:00 committed by GitHub
parent 39a60e037e
commit 2efb48ee0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 8 deletions

View File

@ -0,0 +1 @@
- Clean up dashboard loading states

View File

@ -422,12 +422,18 @@ const DashboardPage = ({ router, location }: IDashboardProps): JSX.Element => {
setShowAddHostsModal(!showAddHostsModal); setShowAddHostsModal(!showAddHostsModal);
}; };
const { MANAGE_HOSTS } = paths;
const HostsSummaryCard = useInfoCard({ const HostsSummaryCard = useInfoCard({
title: "Hosts", title: "Hosts",
action: { action:
selectedPlatform === "all"
? {
type: "link", type: "link",
text: "View all hosts", text: "View all hosts",
}, }
: undefined,
actionUrl: selectedPlatform === "all" ? MANAGE_HOSTS : undefined,
total_host_count: (() => { total_host_count: (() => {
if (!isHostSummaryFetching && !errorHosts) { if (!isHostSummaryFetching && !errorHosts) {
return `${hostSummaryData?.totals_hosts_count}` || undefined; return `${hostSummaryData?.totals_hosts_count}` || undefined;
@ -596,7 +602,7 @@ const DashboardPage = ({ router, location }: IDashboardProps): JSX.Element => {
{useInfoCard({ {useInfoCard({
title: "Mobile device management (MDM)", title: "Mobile device management (MDM)",
titleDetail: mdmTitleDetail, titleDetail: mdmTitleDetail,
showTitle: !isMacAdminsFetching, showTitle: !isMdmFetching,
description: ( description: (
<p> <p>
MDM is used to change settings and install software on your hosts. MDM is used to change settings and install software on your hosts.

View File

@ -104,8 +104,5 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.loading-spinner {
margin-top: 33px;
}
} }
} }

View File

@ -1,6 +1,7 @@
.home-mdm { .home-mdm {
margin-top: $pad-large; margin-top: $pad-large;
position: relative; position: relative;
height: 100%; // centers loading spinner
.component__tabs-wrapper .table-container__header { .component__tabs-wrapper .table-container__header {
display: none; display: none;