From b11daf57bb46fc103aa2a316f5f3d7c74e469d2c Mon Sep 17 00:00:00 2001 From: Konrad Lalik Date: Mon, 17 Mar 2025 15:09:52 +0100 Subject: [PATCH] Alerting: Fix rule instances table (#102290) Fix the condition for displaying alert instances table in RuleDetails component --- .../unified/components/rules/RuleDetails.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/public/app/features/alerting/unified/components/rules/RuleDetails.tsx b/public/app/features/alerting/unified/components/rules/RuleDetails.tsx index 2e5394fc02f..f5c562fb0c7 100644 --- a/public/app/features/alerting/unified/components/rules/RuleDetails.tsx +++ b/public/app/features/alerting/unified/components/rules/RuleDetails.tsx @@ -34,6 +34,8 @@ export const RuleDetails = ({ rule }: Props) => { } = rule; const annotations = useCleanAnnotations(rule.annotations); + const isAlertingRule = + rulerRuleType.any.alertingRule(rule.rulerRule) || prometheusRuleType.alertingRule(rule.promRule); return (
@@ -53,12 +55,11 @@ export const RuleDetails = ({ rule }: Props) => {
- {rulerRuleType.any.alertingRule(rule.rulerRule) || - (prometheusRuleType.alertingRule(rule.promRule) && ( - - - - ))} + {isAlertingRule && ( + + + + )} ); };