Skip to content

Commit

Permalink
refactor: update event type cases in NotificationRuleConditionUtil fo…
Browse files Browse the repository at this point in the history
…r consistency
  • Loading branch information
simlarsen committed Feb 7, 2025
1 parent cf9b4f0 commit 978ac91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export class NotificationRuleConditionUtil {
eventType: NotificationRuleEventType,
): Array<NotificationRuleConditionCheckOn> {
switch (eventType) {
case NotificationRuleEventType.IncidentCreatedOrUpdated:
case NotificationRuleEventType.Incident:
return [
NotificationRuleConditionCheckOn.IncidentName,
NotificationRuleConditionCheckOn.IncidentDescription,
Expand All @@ -208,7 +208,7 @@ export class NotificationRuleConditionUtil {
NotificationRuleConditionCheckOn.Labels,
NotificationRuleConditionCheckOn.Monitors,
];
case NotificationRuleEventType.AlertCreatedOrUpdated:
case NotificationRuleEventType.Alert:
return [
NotificationRuleConditionCheckOn.AlertName,
NotificationRuleConditionCheckOn.AlertDescription,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ const NotificationRuleConditions: FunctionComponent<ComponentProps> = (
{...props}
key={index}
notificationRuleCondition={i}
filterCondition={
!isLastItem ? props.filterCondition : undefined
}
/>{" "}
</li>
);
Expand Down

0 comments on commit 978ac91

Please sign in to comment.