From 978ac9155f9e1a352d1e83799d33dbda65044613 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Fri, 7 Feb 2025 11:03:34 +0000 Subject: [PATCH] refactor: update event type cases in NotificationRuleConditionUtil for consistency --- .../NotificationRules/NotificationRuleCondition.ts | 8 ++++---- .../NotificationRuleViewConditions.tsx | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Common/Types/ServiceProvider/NotificationRules/NotificationRuleCondition.ts b/Common/Types/ServiceProvider/NotificationRules/NotificationRuleCondition.ts index 4a3b8f747f..8857c2874f 100644 --- a/Common/Types/ServiceProvider/NotificationRules/NotificationRuleCondition.ts +++ b/Common/Types/ServiceProvider/NotificationRules/NotificationRuleCondition.ts @@ -199,7 +199,7 @@ export class NotificationRuleConditionUtil { eventType: NotificationRuleEventType, ): Array { switch (eventType) { - case NotificationRuleEventType.IncidentCreatedOrUpdated: + case NotificationRuleEventType.Incident: return [ NotificationRuleConditionCheckOn.IncidentName, NotificationRuleConditionCheckOn.IncidentDescription, @@ -208,7 +208,7 @@ export class NotificationRuleConditionUtil { NotificationRuleConditionCheckOn.Labels, NotificationRuleConditionCheckOn.Monitors, ]; - case NotificationRuleEventType.AlertCreatedOrUpdated: + case NotificationRuleEventType.Alert: return [ NotificationRuleConditionCheckOn.AlertName, NotificationRuleConditionCheckOn.AlertDescription, @@ -217,14 +217,14 @@ export class NotificationRuleConditionUtil { NotificationRuleConditionCheckOn.Labels, NotificationRuleConditionCheckOn.Monitors, ]; - case NotificationRuleEventType.MonitorStatusChanged: + case NotificationRuleEventType.MonitorStatus: return [ NotificationRuleConditionCheckOn.MonitorName, NotificationRuleConditionCheckOn.MonitorStatus, NotificationRuleConditionCheckOn.MonitorType, NotificationRuleConditionCheckOn.Monitors, ]; - case NotificationRuleEventType.ScheduledMaintenanceCreatedOrUpdated: + case NotificationRuleEventType.ScheduledMaintenance: return [ NotificationRuleConditionCheckOn.ScheduledMaintenanceName, NotificationRuleConditionCheckOn.ScheduledMaintenanceDescription, diff --git a/Dashboard/src/Components/ServiceProvider/NotificationRuleViewElement/NotificationRuleViewConditions.tsx b/Dashboard/src/Components/ServiceProvider/NotificationRuleViewElement/NotificationRuleViewConditions.tsx index 77fdf90ae5..2d541c3edb 100644 --- a/Dashboard/src/Components/ServiceProvider/NotificationRuleViewElement/NotificationRuleViewConditions.tsx +++ b/Dashboard/src/Components/ServiceProvider/NotificationRuleViewElement/NotificationRuleViewConditions.tsx @@ -50,9 +50,6 @@ const NotificationRuleConditions: FunctionComponent = ( {...props} key={index} notificationRuleCondition={i} - filterCondition={ - !isLastItem ? props.filterCondition : undefined - } />{" "} );