Skip to content

Commit c438a72

Browse files
authored
Merge pull request #1789 from bluewave-labs/fix/fe/maintenance-background
Fix Maintenance page layout issue
2 parents e5246e8 + b856ce3 commit c438a72

File tree

1 file changed

+45
-59
lines changed

1 file changed

+45
-59
lines changed

src/Pages/Maintenance/index.jsx

+45-59
Original file line numberDiff line numberDiff line change
@@ -42,66 +42,52 @@ const Maintenance = () => {
4242
fetchMaintenanceWindows();
4343
}, [page, rowsPerPage, updateTrigger]);
4444

45+
if (maintenanceWindows.length === 0) {
46+
return (
47+
<Fallback
48+
title="maintenance window"
49+
checks={[
50+
"Mark your maintenance periods",
51+
"Eliminate any misunderstandings",
52+
"Stop sending alerts in maintenance windows",
53+
]}
54+
link="/maintenance/create"
55+
isAdmin={isAdmin}
56+
/>
57+
);
58+
}
59+
4560
return (
46-
<Box
47-
className="maintenance table-container"
48-
sx={{
49-
':has(> [class*="fallback__"])': {
50-
position: "relative",
51-
border: 1,
52-
borderColor: theme.palette.primary.lowContrast,
53-
borderRadius: theme.shape.borderRadius,
54-
borderStyle: "dashed",
55-
backgroundColor: theme.palette.primary.main,
56-
overflow: "hidden",
57-
},
58-
}}
59-
>
60-
{maintenanceWindows.length > 0 && (
61-
<Stack gap={theme.spacing(8)}>
62-
<Stack
63-
direction="row"
64-
justifyContent="space-between"
65-
alignItems="center"
66-
mt={theme.spacing(5)}
67-
>
68-
<Breadcrumbs list={[{ name: "maintenance", path: "/maintenance" }]} />
69-
<Button
70-
variant="contained"
71-
color="accent"
72-
onClick={() => {
73-
navigate("/maintenance/create");
74-
}}
75-
sx={{ fontWeight: 500 }}
76-
>
77-
Create maintenance window
78-
</Button>
79-
</Stack>
80-
<MaintenanceTable
81-
page={page}
82-
setPage={setPage}
83-
rowsPerPage={rowsPerPage}
84-
sort={sort}
85-
setSort={setSort}
86-
maintenanceWindows={maintenanceWindows}
87-
maintenanceWindowCount={maintenanceWindowCount}
88-
updateCallback={handleActionMenuDelete}
89-
/>
90-
</Stack>
91-
)}
92-
{maintenanceWindows.length === 0 && (
93-
<Fallback
94-
title="maintenance window"
95-
checks={[
96-
"Mark your maintenance periods",
97-
"Eliminate any misunderstandings",
98-
"Stop sending alerts in maintenance windows",
99-
]}
100-
link="/maintenance/create"
101-
isAdmin={isAdmin}
102-
/>
103-
)}
104-
</Box>
61+
<Stack gap={theme.spacing(10)}>
62+
<Stack
63+
direction="row"
64+
justifyContent="space-between"
65+
alignItems="center"
66+
mt={theme.spacing(5)}
67+
>
68+
<Breadcrumbs list={[{ name: "maintenance", path: "/maintenance" }]} />
69+
<Button
70+
variant="contained"
71+
color="accent"
72+
onClick={() => {
73+
navigate("/maintenance/create");
74+
}}
75+
sx={{ fontWeight: 500 }}
76+
>
77+
Create maintenance window
78+
</Button>
79+
</Stack>
80+
<MaintenanceTable
81+
page={page}
82+
setPage={setPage}
83+
rowsPerPage={rowsPerPage}
84+
sort={sort}
85+
setSort={setSort}
86+
maintenanceWindows={maintenanceWindows}
87+
maintenanceWindowCount={maintenanceWindowCount}
88+
updateCallback={handleActionMenuDelete}
89+
/>
90+
</Stack>
10591
);
10692
};
10793

0 commit comments

Comments
 (0)