diff --git a/client/src/Components/monitors/BulkEditNotificationsModal.tsx b/client/src/Components/monitors/BulkEditNotificationsModal.tsx index 54959bcb1..74d17cae8 100644 --- a/client/src/Components/monitors/BulkEditNotificationsModal.tsx +++ b/client/src/Components/monitors/BulkEditNotificationsModal.tsx @@ -2,6 +2,7 @@ import React, { useState, useEffect } from "react"; import { useTranslation } from "react-i18next"; import { useTheme } from "@mui/material/styles"; import { Dialog, Select, RadioWithDescription } from "@/Components/inputs"; +import { SPACING, LAYOUT } from "@/Utils/Theme/constants"; import Stack from "@mui/material/Stack"; import RadioGroup from "@mui/material/RadioGroup"; import MenuItem from "@mui/material/MenuItem"; @@ -58,7 +59,7 @@ export const BulkEditNotificationsModal: React.FC {error && {error}} @@ -84,7 +85,12 @@ export const BulkEditNotificationsModal: React.FC setAction(e.target.value as "add" | "remove" | "set")} + onChange={(e) => { + const val = e.target.value; + if (val === "add" || val === "remove" || val === "set") { + setAction(val); + } + }} > setNotificationIds(e.target.value as string[])} + onChange={(e) => { + const val = e.target.value; + if (typeof val === "string") { + setNotificationIds(val.split(",")); + } else if (Array.isArray(val)) { + setNotificationIds(val.filter((v) => typeof v === "string")); + } + }} fieldLabel={t("pages.common.monitors.bulkEdit.selectLabel")} placeholder={t("pages.common.monitors.bulkEdit.selectPlaceholder")} > diff --git a/client/src/Pages/Uptime/Monitors/Components/UptimeMonitorsTable.tsx b/client/src/Pages/Uptime/Monitors/Components/UptimeMonitorsTable.tsx index 40de2b491..827835705 100644 --- a/client/src/Pages/Uptime/Monitors/Components/UptimeMonitorsTable.tsx +++ b/client/src/Pages/Uptime/Monitors/Components/UptimeMonitorsTable.tsx @@ -23,6 +23,7 @@ import type { Monitor } from "@/Types/Monitor"; import type { ActionMenuItem } from "@/Components/actions-menu"; import type { RootState } from "@/Types/state"; import { Checkbox } from "@/Components/inputs"; +import { SPACING, LAYOUT } from "@/Utils/Theme/constants"; interface MonitorTableProps { monitors: Monitor[]; @@ -208,7 +209,7 @@ export const MonitorTable = ({ mobileLabel: t("common.table.headers.name"), content: ( handleSort(e, "name")} @@ -228,14 +229,14 @@ export const MonitorTable = ({ mobileLabel: t("common.table.headers.status"), content: ( handleSort(e, "status")} sx={{ cursor: "pointer" }} > - + {t("common.table.headers.status")} {renderSortIcon(sortField === "status")} @@ -260,14 +261,14 @@ export const MonitorTable = ({ mobileLabel: t("common.table.headers.type"), content: ( handleSort(e, "type")} sx={{ cursor: "pointer" }} > - + {t("common.table.headers.type")} {renderSortIcon(sortField === "type")} @@ -293,26 +294,18 @@ export const MonitorTable = ({ {isSmall && ( 0 && selectedMonitors.length === monitors.length} - indeterminate={ - selectedMonitors.length > 0 && selectedMonitors.length < monitors.length - } - onChange={(e) => { - if (e.target.checked) { - onSelectAll(monitors.map((m) => m.id)); - } else { - onSelectAll([]); - } - }} + checked={isAllSelected} + indeterminate={isSomeSelected} + onChange={(e) => handleSelectAll(e.target.checked)} /> { const { t } = useTranslation(); @@ -183,7 +184,7 @@ const UptimeMonitorsPage = () => {