From b38436eeb09bf92cb499ef3b1a31088816395a10 Mon Sep 17 00:00:00 2001 From: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com> Date: Tue, 19 Mar 2024 13:30:06 +0100 Subject: [PATCH] Alerting: Fix used badge in contact points list (#84714) Fix used badge in contact points list --- .../components/contact-points/components/UnusedBadge.tsx | 3 ++- .../alerting/unified/components/contact-points/utils.ts | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/features/alerting/unified/components/contact-points/components/UnusedBadge.tsx b/public/app/features/alerting/unified/components/contact-points/components/UnusedBadge.tsx index 73c11402c99..8d459985ee4 100644 --- a/public/app/features/alerting/unified/components/contact-points/components/UnusedBadge.tsx +++ b/public/app/features/alerting/unified/components/contact-points/components/UnusedBadge.tsx @@ -8,6 +8,7 @@ export const UnusedContactPointBadge = () => ( aria-label="unused" color="orange" icon="exclamation-triangle" - tooltip="This contact point is not used in any notification policy and it will not receive any alerts" + // is not used in any policy, but it can receive notifications from an auto auto generated policy. Non admin users can't see auto generated policies. + tooltip="This contact point is not used in any notification policy" /> ); diff --git a/public/app/features/alerting/unified/components/contact-points/utils.ts b/public/app/features/alerting/unified/components/contact-points/utils.ts index 479bde2b494..a07e3cc03dc 100644 --- a/public/app/features/alerting/unified/components/contact-points/utils.ts +++ b/public/app/features/alerting/unified/components/contact-points/utils.ts @@ -168,8 +168,7 @@ export function isAutoGeneratedPolicy(route: Route) { export function getUsedContactPoints(route: Route): string[] { const childrenContactPoints = route.routes?.flatMap((route) => getUsedContactPoints(route)) ?? []; - // we don't want to count the autogenerated policy for receiver level, for checking if a contact point is used - if (route.receiver && !isAutoGeneratedPolicy(route)) { + if (route.receiver) { return [route.receiver, ...childrenContactPoints]; }