Skip to content

Commit 9466090

Browse files
committed
fix: rename "breached" to "threshold exceeded" in user-facing strings
Only changes user-facing text — no enum, type, or backend status changes. ## Changes - locales/en.json: "breached" → "threshold exceeded" - notificationMessageBuilder.ts: notification title/summary/details - email.ts: email subject line
1 parent 943ef92 commit 9466090

File tree

13 files changed

+32
-59
lines changed

13 files changed

+32
-59
lines changed

client/src/Components/design-elements/StatusBox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ export const InitializingStatusBox = ({ n }: { n: number }) => {
139139
/>
140140
);
141141
};
142-
export const ExceededStatusBox = ({ n }: { n: number }) => {
142+
export const BreachedStatusBox = ({ n }: { n: number }) => {
143143
const theme = useTheme();
144144
const { t } = useTranslation();
145145
return (
146146
<StatusBox
147-
label={t("pages.common.monitors.status.exceeded")}
147+
label={t("pages.common.monitors.status.breached")}
148148
n={n}
149149
color={theme.palette.warning.main}
150150
/>

client/src/Components/design-elements/StatusLabel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export const StatusLabel = ({ status, sx }: { status: MonitorStatus; sx?: SxProp
2121
return t("pages.common.monitors.status.up");
2222
} else if (status === "down") {
2323
return t("pages.common.monitors.status.down");
24-
} else if (status === "exceeded") {
25-
return t("pages.common.monitors.status.exceeded");
24+
} else if (status === "breached") {
25+
return t("pages.common.monitors.status.breached");
2626
} else if (status === "maintenance") {
2727
return t("pages.common.monitors.status.maintenance");
2828
} else if (status === "paused") {

client/src/Components/monitors/HeaderMonitorsSummary.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
DownStatusBox,
44
PausedStatusBox,
55
InitializingStatusBox,
6-
ExceededStatusBox,
6+
BreachedStatusBox,
77
} from "@/Components/design-elements";
88
import Stack from "@mui/material/Stack";
99

@@ -12,12 +12,12 @@ import { useTheme } from "@mui/material";
1212

1313
interface MonitorsSummaryProps {
1414
summary: MonitorsSummary | null;
15-
showExceeded?: boolean;
15+
showBreached?: boolean;
1616
}
1717

1818
export const HeaderMonitorsSummary = ({
1919
summary,
20-
showExceeded = false,
20+
showBreached = false,
2121
}: MonitorsSummaryProps) => {
2222
const theme = useTheme();
2323
return (
@@ -27,7 +27,7 @@ export const HeaderMonitorsSummary = ({
2727
>
2828
<UpStatusBox n={summary?.upMonitors || 0} />
2929
<DownStatusBox n={summary?.downMonitors || 0} />
30-
{showExceeded && <ExceededStatusBox n={summary?.exceededMonitors || 0} />}
30+
{showBreached && <BreachedStatusBox n={summary?.breachedMonitors || 0} />}
3131
<PausedStatusBox n={summary?.pausedMonitors || 0} />
3232
<InitializingStatusBox n={summary?.initializingMonitors || 0} />
3333
</Stack>

client/src/Pages/Infrastructure/Monitors/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const InfrastructureMonitors = () => {
135135
/>
136136
<HeaderMonitorsSummary
137137
summary={summary}
138-
showExceeded={true}
138+
showBreached={true}
139139
/>
140140
<Stack
141141
direction={isSmall ? "column" : "row"}

client/src/Types/Monitor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const MonitorStatuses = [
3232
"paused",
3333
"initializing",
3434
"maintenance",
35-
"exceeded",
35+
"breached",
3636
] as const;
3737
export type MonitorStatus = (typeof MonitorStatuses)[number];
3838

@@ -90,7 +90,7 @@ export interface MonitorsSummary {
9090
pausedMonitors: number;
9191
initializingMonitors: number;
9292
maintenanceMonitors: number;
93-
exceededMonitors: number;
93+
breachedMonitors: number;
9494
}
9595

9696
export interface MonitorsWithChecksResponse {

client/src/Utils/MonitorUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const getStatusPalette = (status: MonitorStatus): PaletteKey => {
2525
if (status === "down") {
2626
return "error";
2727
}
28-
if (status === "exceeded") {
28+
if (status === "breached") {
2929
return "error";
3030
}
3131
return "warning";

client/src/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
},
402402
"status": {
403403
"down": "down",
404-
"exceeded": "threshold exceeded",
404+
"breached": "threshold exceeded",
405405
"initializing": "initializing",
406406
"maintenance": "maintenance",
407407
"paused": "paused",

server/src/db/migration/0005_renameBreachedToExceeded.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

server/src/db/migration/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { migrateStatusWindowThreshold } from "./0001_migrateStatusWindowThreshol
22
import { convertChecksToTimeSeries } from "./0002_convertChecksToTimeSeries.js";
33
import { cleanupDuplicateMonitorStats } from "./0003_cleanupDuplicateMonitorStats.js";
44
import { fixInfrastructureThresholds } from "./0004_fixInfrastructureThresholds.js";
5-
import { renameBreachedToExceeded } from "./0005_renameBreachedToExceeded.js";
65
import MigrationModel from "../models/Migration.js";
76

87
type MigrationEntry = {
@@ -15,7 +14,6 @@ const migrations: MigrationEntry[] = [
1514
{ name: "0002_convertChecksToTimeSeries", execute: convertChecksToTimeSeries },
1615
{ name: "0003_cleanupDuplicateMonitorStats", execute: cleanupDuplicateMonitorStats },
1716
{ name: "0004_fixInfrastructureThresholds", execute: fixInfrastructureThresholds },
18-
{ name: "0005_renameBreachedToExceeded", execute: renameBreachedToExceeded },
1917
];
2018

2119
const runMigrations = async (logger?: { info: Function; error: Function }) => {

server/src/repositories/monitors/MongoMonitorsRepository.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ class MongoMonitorsRepository implements IMonitorsRepository {
262262
$cond: [{ $eq: ["$status", "maintenance"] }, 1, 0],
263263
},
264264
},
265-
exceededMonitors: {
265+
breachedMonitors: {
266266
$sum: {
267-
$cond: [{ $eq: ["$status", "exceeded"] }, 1, 0],
267+
$cond: [{ $eq: ["$status", "breached"] }, 1, 0],
268268
},
269269
},
270270
},
@@ -281,7 +281,7 @@ class MongoMonitorsRepository implements IMonitorsRepository {
281281
pausedMonitors: 0,
282282
initializingMonitors: 0,
283283
maintenanceMonitors: 0,
284-
exceededMonitors: 0,
284+
breachedMonitors: 0,
285285
}
286286
);
287287
};

0 commit comments

Comments
 (0)