Alerting: Fix used badge in contact points list (#84714)

Fix used badge in contact points list
This commit is contained in:
Sonia Aguilar 2024-03-19 13:30:06 +01:00 committed by GitHub
parent a095888522
commit b38436eeb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -8,6 +8,7 @@ export const UnusedContactPointBadge = () => (
aria-label="unused" aria-label="unused"
color="orange" color="orange"
icon="exclamation-triangle" 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"
/> />
); );

View File

@ -168,8 +168,7 @@ export function isAutoGeneratedPolicy(route: Route) {
export function getUsedContactPoints(route: Route): string[] { export function getUsedContactPoints(route: Route): string[] {
const childrenContactPoints = route.routes?.flatMap((route) => getUsedContactPoints(route)) ?? []; 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) {
if (route.receiver && !isAutoGeneratedPolicy(route)) {
return [route.receiver, ...childrenContactPoints]; return [route.receiver, ...childrenContactPoints];
} }