Add checkboxes and field for notification (#490)

This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-07-30 12:54:22 -07:00
1 parent 960afd44f9
commit d135a986a3
1 file changed
+30 -49
@@ -11,6 +11,7 @@ import { useTheme } from "@emotion/react";
import WestRoundedIcon from "@mui/icons-material/WestRounded"; import WestRoundedIcon from "@mui/icons-material/WestRounded";
import Field from "../../../Components/Inputs/Field"; import Field from "../../../Components/Inputs/Field";
import Select from "../../../Components/Inputs/Select"; import Select from "../../../Components/Inputs/Select";
import Checkbox from "../../../Components/Inputs/Checkbox";
const CreateMonitor = () => { const CreateMonitor = () => {
const MS_PER_MINUTE = 60000; const MS_PER_MINUTE = 60000;
@@ -296,56 +297,36 @@ const CreateMonitor = () => {
</Box> </Box>
</Stack> </Stack>
</Stack> </Stack>
{/* TODO */}
{/* <Stack className="config-box">
<ConfigBox <Box>
leftLayout={ <Typography component="h2">Incident notifications</Typography>
<div className="config-box-desc"> <Typography component="p" mt={theme.gap.small}>
<div className="config-box-desc-title">Incident notifications</div> When there is an incident, notify users
<div className="config-box-desc-text"> </Typography>
When there is an incident, notify users. </Box>
</div> <Stack gap={theme.gap.large}>
</div> <Typography component="p" mt={theme.gap.small}>
}
rightLayout={
<div className="incident-notif-config">
<div className="incident-notif-config-title">
When there is a new incident, When there is a new incident,
</div> </Typography>
<div className="incident-notif-config-checks"> <Checkbox id="notify-sms" label="Notify via SMS (coming soon)" />
<CustomizableCheckBox <Checkbox
id="monitor-notify-sms" id="notify-email-default"
title="Notify via SMS (to be implemented)" label={`Notify via email (to ${user.email})`}
isChecked={notifications.viaSms} />
handleChange={() => handleCheck("viaSms", setNotifications)} <Checkbox
/> id="notify-email"
<CustomizableCheckBox label="Also notify via email to the following addresses:"
id="monitor-notify-email" />
title="Notify via email (to current email address)" <Field
isChecked={notifications.viaEmail} id="notify-email-list"
handleChange={() => handleCheck("viaEmail", setNotifications)} type="text"
/> label="You can separate multiple emails with a comma"
<CustomizableCheckBox placeholder="name@gmail.com"
id="monitor-notify-other" />
title="Notify via email (to another email address below)" </Stack>
isChecked={notifications.viaOther} </Stack>
handleChange={() => handleCheck("viaOther", setNotifications)}
/>
<div className="monitors-dropdown-holder">
<FlexibileTextField
id="monitor-notify-other-email"
placeholder="notifications@gmail.com"
type="email"
value={notifications.email}
onChange={(event) =>
handleChange(event, "email", setNotifications)
}
/>
</div>
</div>
</div>
}
/> */}
<Stack className="config-box"> <Stack className="config-box">
<Box> <Box>
<Typography component="h2">Advanced settings</Typography> <Typography component="h2">Advanced settings</Typography>