Skip to content

Commit 8df0767

Browse files
authored
Merge pull request #1673 from bluewave-labs/fix/fe/uptime-details-empty-views
add empty view for uptime details, resolves #1671
2 parents efdf3f0 + e35a0d4 commit 8df0767

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

Client/src/Pages/Uptime/Details/index.jsx

+20-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ import ChartBoxes from "./Components/ChartBoxes";
66
import ResponseTimeChart from "./Components/Charts/ResponseTimeChart";
77
import ResponseTable from "./Components/ResponseTable";
88
import UptimeStatusBoxes from "./Components/UptimeStatusBoxes";
9+
import GenericFallback from "../../../Components/GenericFallback";
910
// MUI Components
10-
import { Stack } from "@mui/material";
11+
import { Stack, Typography } from "@mui/material";
1112

1213
// Utils
1314
import { useState } from "react";
@@ -77,6 +78,24 @@ const UptimeDetails = () => {
7778
setRowsPerPage(event.target.value);
7879
};
7980

81+
// Empty view, displayed when loading is complete and there are no checks
82+
if (!monitorIsLoading && !checksAreLoading && checksCount === 0) {
83+
return (
84+
<Stack gap={theme.spacing(10)}>
85+
<Breadcrumbs list={BREADCRUMBS} />
86+
<MonitorStatusHeader
87+
path={"uptime"}
88+
isAdmin={isAdmin}
89+
shouldRender={!monitorIsLoading}
90+
monitor={monitor}
91+
/>
92+
<GenericFallback>
93+
<Typography>There is no history for this monitor yet.</Typography>
94+
</GenericFallback>
95+
</Stack>
96+
);
97+
}
98+
8099
return (
81100
<Stack gap={theme.spacing(10)}>
82101
<Breadcrumbs list={BREADCRUMBS} />

Client/src/Pages/Uptime/Monitors/index.jsx

-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ const UptimeMonitors = () => {
112112
if (networkError) {
113113
return (
114114
<GenericFallback>
115-
{" "}
116115
<Typography
117116
variant="h1"
118117
marginY={theme.spacing(4)}
@@ -135,7 +134,6 @@ const UptimeMonitors = () => {
135134
/>
136135
);
137136
}
138-
console.log({ isLoading });
139137

140138
return (
141139
<Stack

0 commit comments

Comments
 (0)