Skip to content

Commit

Permalink
Merge pull request #927 from bluewave-labs/fix/maintenance-access-rights
Browse files Browse the repository at this point in the history
Allow demo user to create maintenance windows
  • Loading branch information
ajhollid authored Oct 11, 2024
2 parents 7a8d909 + 34e2ecd commit e052adf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Client/src/Pages/Maintenance/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const Maintenance = ({ isAdmin }) => {
/>
</Stack>
)}
{isAdmin && maintenanceWindows.length === 0 && (
{maintenanceWindows.length === 0 && (
<Fallback
title="maintenance window"
checks={[
Expand All @@ -102,7 +102,7 @@ const Maintenance = ({ isAdmin }) => {
"Stop sending alerts in maintenance windows",
]}
link="/maintenance/create"
isAdmin={isAdmin}
isAdmin={true}
/>
)}
</Box>
Expand Down
25 changes: 13 additions & 12 deletions Client/src/Pages/Monitors/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,19 @@ const Monitors = ({ isAdmin }) => {
mt={theme.spacing(5)}
>
<Greeting type="uptime" />
{monitorState?.monitorsSummary?.monitors?.length !== 0 && (
<Button
variant="contained"
color="primary"
onClick={() => {
navigate("/monitors/create");
}}
sx={{ fontWeight: 500 }}
>
Create monitor
</Button>
)}
{isAdmin &&
monitorState?.monitorsSummary?.monitors?.length !== 0 && (
<Button
variant="contained"
color="primary"
onClick={() => {
navigate("/monitors/create");
}}
sx={{ fontWeight: 500 }}
>
Create monitor
</Button>
)}
</Stack>
</Box>
{isAdmin && monitorState?.monitorsSummary?.monitors?.length === 0 && (
Expand Down

0 comments on commit e052adf

Please sign in to comment.