Moved component to the regular components dir.
This commit is contained in:
1 parent
915e88d187
commit
1105a38080
2 files changed
+19
-11
No files matched your search
+18
-10
@@ -13,8 +13,8 @@ import {
|
|||||||
Divider
|
Divider
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import TextInput from "../../../../../../src/Components/Inputs/TextInput";
|
import TextInput from "../Inputs/TextInput";
|
||||||
import Checkbox from "../../../../../../src/Components/Inputs/Checkbox";
|
import Checkbox from "../Inputs/Checkbox";
|
||||||
|
|
||||||
// Tab Panel component
|
// Tab Panel component
|
||||||
function TabPanel({ children, value, index, ...other }) {
|
function TabPanel({ children, value, index, ...other }) {
|
||||||
@@ -96,20 +96,18 @@ const NotificationIntegrationModal = ({
|
|||||||
|
|
||||||
const handleTestNotification = (type) => {
|
const handleTestNotification = (type) => {
|
||||||
console.log(`Testing ${type} notification`);
|
console.log(`Testing ${type} notification`);
|
||||||
// Here you would implement the actual test notification functionality
|
//implement the test notification functionality
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
// Create notifications array based on selected integrations
|
//notifications array for selected integrations
|
||||||
const notifications = [...(monitor?.notifications || [])];
|
const notifications = [...(monitor?.notifications || [])];
|
||||||
|
|
||||||
// Filter out existing integrations that will be updated
|
|
||||||
const existingTypes = ["slack", "discord", "telegram", "webhook"];
|
const existingTypes = ["slack", "discord", "telegram", "webhook"];
|
||||||
const filteredNotifications = notifications.filter(
|
const filteredNotifications = notifications.filter(
|
||||||
notification => !existingTypes.includes(notification.type)
|
notification => !existingTypes.includes(notification.type)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add selected integrations
|
|
||||||
if (integrations.slack) {
|
if (integrations.slack) {
|
||||||
filteredNotifications.push({
|
filteredNotifications.push({
|
||||||
type: "slack",
|
type: "slack",
|
||||||
@@ -157,13 +155,14 @@ const NotificationIntegrationModal = ({
|
|||||||
sx={{
|
sx={{
|
||||||
'& .MuiDialog-paper': {
|
'& .MuiDialog-paper': {
|
||||||
backgroundColor: theme.palette.primary.main,
|
backgroundColor: theme.palette.primary.main,
|
||||||
color: '#344054'
|
color: '#344054',
|
||||||
|
maxWidth: '775px'
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<Box sx={{ display: 'flex', height: '500px' }}>
|
<Box sx={{ display: 'flex', height: '300px' }}>
|
||||||
{/* Left sidebar with tabs */}
|
{/* Left sidebar with tabs */}
|
||||||
<Box sx={{
|
<Box sx={{
|
||||||
borderRight: 1,
|
borderRight: 1,
|
||||||
@@ -194,7 +193,7 @@ const NotificationIntegrationModal = ({
|
|||||||
borderRight: 'none',
|
borderRight: 'none',
|
||||||
'&.Mui-selected': {
|
'&.Mui-selected': {
|
||||||
color: theme.palette.primary.contrastText,
|
color: theme.palette.primary.contrastText,
|
||||||
backgroundColor: theme.palette.primary.main,
|
backgroundColor: theme.palette.tertiary.main, // Match the hover background color
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
border: 'none',
|
border: 'none',
|
||||||
borderBottom: 'none',
|
borderBottom: 'none',
|
||||||
@@ -397,11 +396,20 @@ const NotificationIntegrationModal = ({
|
|||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions sx={{ p: theme.spacing(4) }}>
|
<DialogActions sx={{
|
||||||
|
p: theme.spacing(4),
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'flex-end',
|
||||||
|
mb: theme.spacing(10),
|
||||||
|
mr: theme.spacing(10)
|
||||||
|
}}>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="accent"
|
color="accent"
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
|
sx={{
|
||||||
|
width: '120px'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Save
|
Save
|
||||||
</Button>
|
</Button>
|
||||||
@@ -23,7 +23,7 @@ import Radio from "../../../Components/Inputs/Radio";
|
|||||||
import Checkbox from "../../../Components/Inputs/Checkbox";
|
import Checkbox from "../../../Components/Inputs/Checkbox";
|
||||||
import Select from "../../../Components/Inputs/Select";
|
import Select from "../../../Components/Inputs/Select";
|
||||||
import ConfigBox from "../../../Components/ConfigBox";
|
import ConfigBox from "../../../Components/ConfigBox";
|
||||||
import NotificationIntegrationModal from "../Details/Components/NotificationIntegrationModal/NotificationIntegrationModal";
|
import NotificationIntegrationModal from "../../../Components/NotificationIntegrationModal/NotificationIntegrationModal";
|
||||||
const CreateMonitor = () => {
|
const CreateMonitor = () => {
|
||||||
const MS_PER_MINUTE = 60000;
|
const MS_PER_MINUTE = 60000;
|
||||||
const SELECT_VALUES = [
|
const SELECT_VALUES = [
|
||||||
|
|||||||
Reference in new issue
Block a user