Added fallback UI when there are no incidents recorded
This commit is contained in:
1 parent
848ee60ca0
commit
f152f490e3
4 files changed
+81
-60
No files matched your search
@@ -107,18 +107,16 @@ const StepOne = ({ form, errors, onSubmit, onChange, onBack }) => {
|
|||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
<form noValidate spellCheck={false} onSubmit={onSubmit}>
|
<form noValidate spellCheck={false} onSubmit={onSubmit}>
|
||||||
<Box my={theme.gap.ml}>
|
<Field
|
||||||
<Field
|
id="register-lastname-input"
|
||||||
id="register-lastname-input"
|
label="Surname"
|
||||||
label="Surname"
|
isRequired={true}
|
||||||
isRequired={true}
|
placeholder="Ellis"
|
||||||
placeholder="Ellis"
|
autoComplete="family-name"
|
||||||
autoComplete="family-name"
|
value={form.lastName}
|
||||||
value={form.lastName}
|
onChange={onChange}
|
||||||
onChange={onChange}
|
error={errors.lastName}
|
||||||
error={errors.lastName}
|
/>
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
</form>
|
</form>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack direction="row" justifyContent="space-between">
|
<Stack direction="row" justifyContent="space-between">
|
||||||
@@ -267,21 +265,19 @@ const StepThree = ({ form, errors, onSubmit, onChange, onBack }) => {
|
|||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
<form noValidate spellCheck={false} onSubmit={onSubmit}>
|
<form noValidate spellCheck={false} onSubmit={onSubmit}>
|
||||||
<Box mt={theme.gap.ml}>
|
<Field
|
||||||
<Field
|
type="password"
|
||||||
type="password"
|
id="register-confirm-input"
|
||||||
id="register-confirm-input"
|
label="Confirm password"
|
||||||
label="Confirm password"
|
isRequired={true}
|
||||||
isRequired={true}
|
placeholder="Confirm your password"
|
||||||
placeholder="Confirm your password"
|
autoComplete="current-password"
|
||||||
autoComplete="current-password"
|
value={form.confirm}
|
||||||
value={form.confirm}
|
onChange={onChange}
|
||||||
onChange={onChange}
|
error={errors.confirm}
|
||||||
error={errors.confirm}
|
/>
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
</form>
|
</form>
|
||||||
<Stack gap={theme.gap.small} my={theme.gap.large}>
|
<Stack gap={theme.gap.small} mb={theme.gap.large}>
|
||||||
<Check
|
<Check
|
||||||
text="Must be at least 8 characters long"
|
text="Must be at least 8 characters long"
|
||||||
variant={
|
variant={
|
||||||
|
|||||||
@@ -135,6 +135,9 @@
|
|||||||
.auth .check span.MuiTypography-root {
|
.auth .check span.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-medium);
|
font-size: var(--env-var-font-size-medium);
|
||||||
}
|
}
|
||||||
|
.auth form + form {
|
||||||
|
margin: var(--env-var-spacing-1-plus) 0;
|
||||||
|
}
|
||||||
|
|
||||||
.auth > .MuiStack-root:nth-of-type(1) {
|
.auth > .MuiStack-root:nth-of-type(1) {
|
||||||
height: var(--env-var-nav-bar-height);
|
height: var(--env-var-nav-bar-height);
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import {
|
|||||||
Pagination,
|
Pagination,
|
||||||
PaginationItem,
|
PaginationItem,
|
||||||
Paper,
|
Paper,
|
||||||
|
Typography,
|
||||||
|
Box,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
|
|
||||||
import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded";
|
import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded";
|
||||||
@@ -105,41 +107,55 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TableContainer component={Paper}>
|
{checks?.length === 0 && selectedMonitor === "0" ? (
|
||||||
<Table>
|
<Box>
|
||||||
<TableHead>
|
<Typography textAlign="center">No incidents recorded yet.</Typography>
|
||||||
<TableRow>
|
</Box>
|
||||||
<TableCell>Monitor Name</TableCell>
|
) : checks?.length === 0 ? (
|
||||||
<TableCell>Status</TableCell>
|
<Box>
|
||||||
<TableCell>Date & Time</TableCell>
|
<Typography textAlign="center">
|
||||||
<TableCell>Message</TableCell>
|
The monitor you have selected, has no recorded incidents yet.
|
||||||
</TableRow>
|
</Typography>
|
||||||
</TableHead>
|
</Box>
|
||||||
<TableBody>
|
) : (
|
||||||
{checks.map((check) => {
|
<>
|
||||||
const status = check.status === true ? "up" : "down";
|
<TableContainer component={Paper}>
|
||||||
|
<Table>
|
||||||
return (
|
<TableHead>
|
||||||
<TableRow key={check._id}>
|
<TableRow>
|
||||||
<TableCell>{monitors[check.monitorId]?.name}</TableCell>
|
<TableCell>Monitor Name</TableCell>
|
||||||
<TableCell>
|
<TableCell>Status</TableCell>
|
||||||
<StatusLabel
|
<TableCell>Date & Time</TableCell>
|
||||||
status={status}
|
<TableCell>Message</TableCell>
|
||||||
text={status}
|
|
||||||
customStyles={{ textTransform: "capitalize" }}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell>
|
|
||||||
{new Date(check.createdAt).toLocaleString()}
|
|
||||||
</TableCell>
|
|
||||||
<TableCell>{check.statusCode}</TableCell>
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
</TableHead>
|
||||||
})}
|
<TableBody>
|
||||||
</TableBody>
|
{checks.map((check) => {
|
||||||
</Table>
|
const status = check.status === true ? "up" : "down";
|
||||||
</TableContainer>
|
|
||||||
{paginationComponent}
|
return (
|
||||||
|
<TableRow key={check._id}>
|
||||||
|
<TableCell>{monitors[check.monitorId]?.name}</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<StatusLabel
|
||||||
|
status={status}
|
||||||
|
text={status}
|
||||||
|
customStyles={{ textTransform: "capitalize" }}
|
||||||
|
/>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
{new Date(check.createdAt).toLocaleString()}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell>{check.statusCode}</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
</TableContainer>
|
||||||
|
{paginationComponent}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,6 +17,12 @@
|
|||||||
.incidents .MuiPagination-root {
|
.incidents .MuiPagination-root {
|
||||||
background-color: var(--env-var-color-8);
|
background-color: var(--env-var-color-8);
|
||||||
}
|
}
|
||||||
|
.incidents > .MuiBox-root {
|
||||||
|
background-color: var(--env-var-color-8);
|
||||||
|
border: solid 1px var(--env-var-color-6);
|
||||||
|
border-radius: var(--env-var-radius-1);
|
||||||
|
padding: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
/* remove later */
|
/* remove later */
|
||||||
.incidents .MuiSelect-select {
|
.incidents .MuiSelect-select {
|
||||||
|
|||||||
Reference in new issue
Block a user