From f78f8dda364d065d4165a93c6ac2af0956d5d94f Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Mon, 9 Jan 2023 10:28:00 +0100 Subject: [PATCH 1/2] [FEATURE] Detector must have at least one alert set #288 Signed-off-by: Jovan Cvetkovic --- .../ConfigureAlerts/containers/ConfigureAlerts.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/pages/CreateDetector/components/ConfigureAlerts/containers/ConfigureAlerts.tsx b/public/pages/CreateDetector/components/ConfigureAlerts/containers/ConfigureAlerts.tsx index 9cf0ddbc1..5f4ce02b8 100644 --- a/public/pages/CreateDetector/components/ConfigureAlerts/containers/ConfigureAlerts.tsx +++ b/public/pages/CreateDetector/components/ConfigureAlerts/containers/ConfigureAlerts.tsx @@ -130,9 +130,13 @@ export default class ConfigureAlerts extends Component this.onDelete(index)}> - Remove alert trigger - + triggers.length > 1 ? ( + this.onDelete(index)}> + Remove alert trigger + + ) : ( + <> + ) } > From 3dbea63cb8c1a2a563320c4dd4ac1074386f0c52 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Tue, 10 Jan 2023 23:48:22 +0100 Subject: [PATCH 2/2] [FEATURE] Patch bad detector data for alerts #326 Signed-off-by: Jovan Cvetkovic --- public/pages/Alerts/containers/Alerts/Alerts.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/public/pages/Alerts/containers/Alerts/Alerts.tsx b/public/pages/Alerts/containers/Alerts/Alerts.tsx index 12e70b745..29e919325 100644 --- a/public/pages/Alerts/containers/Alerts/Alerts.tsx +++ b/public/pages/Alerts/containers/Alerts/Alerts.tsx @@ -303,6 +303,7 @@ class Alerts extends Component { if (alertsRes.ok) { const detectorAlerts = alertsRes.response.alerts.map((alert) => { const detector = detectors[id]; + if (!alert.detector_id) alert.detector_id = id; return { ...alert, detectorName: detector.name }; }); alerts = alerts.concat(detectorAlerts);