diff --git a/public/app/features/alerting/unified/components/rules/RulesTable.tsx b/public/app/features/alerting/unified/components/rules/RulesTable.tsx index d5a3453da7c..a65d4e69874 100644 --- a/public/app/features/alerting/unified/components/rules/RulesTable.tsx +++ b/public/app/features/alerting/unified/components/rules/RulesTable.tsx @@ -157,7 +157,7 @@ function useColumns(showSummaryColumn: boolean, showGroupColumn: boolean, showNe const isDeleting = !!(hasRuler(rulesSource) && rulerRulesLoaded(rulesSource) && promRule && !rulerRule); const isCreating = !!(hasRuler(rulesSource) && rulerRulesLoaded(rulesSource) && rulerRule && !promRule); - const isPaused = isGrafanaRulerRulePaused(rule); + const isPaused = isGrafanaRulerRule(rule.rulerRule) && isGrafanaRulerRulePaused(rule.rulerRule); return ; }, diff --git a/public/app/features/alerting/unified/utils/rules.ts b/public/app/features/alerting/unified/utils/rules.ts index 3885db0d20d..ca45ba028d4 100644 --- a/public/app/features/alerting/unified/utils/rules.ts +++ b/public/app/features/alerting/unified/utils/rules.ts @@ -5,7 +5,6 @@ import { Alert, AlertingRule, CloudRuleIdentifier, - CombinedRule, CombinedRuleGroup, CombinedRuleWithLocation, GrafanaRuleIdentifier, @@ -57,8 +56,8 @@ export function isGrafanaRulerRule(rule?: RulerRuleDTO): rule is RulerGrafanaRul return typeof rule === 'object' && 'grafana_alert' in rule; } -export function isGrafanaRulerRulePaused(rule: CombinedRule) { - return rule.rulerRule && isGrafanaRulerRule(rule.rulerRule) && Boolean(rule.rulerRule.grafana_alert.is_paused); +export function isGrafanaRulerRulePaused(rule: RulerGrafanaRuleDTO) { + return rule && isGrafanaRulerRule(rule) && Boolean(rule.grafana_alert.is_paused); } export function alertInstanceKey(alert: Alert): string {