From e093cb04db851eb49acf44e3a112c991bdeba21c Mon Sep 17 00:00:00 2001 From: laurenashleigh Date: Mon, 27 Oct 2025 17:17:16 +0000 Subject: [PATCH] Use radio button for contact point - notification policy toggle --- .../components/RuleNotificationSection.tsx | 94 +++++++++++-------- .../rule-editor/EvaluationGroupFieldRow.tsx | 2 +- public/locales/en-US/grafana.json | 5 +- 3 files changed, 57 insertions(+), 44 deletions(-) diff --git a/public/app/features/alerting/unified/components/RuleNotificationSection.tsx b/public/app/features/alerting/unified/components/RuleNotificationSection.tsx index c0ea5991c6c..4ba8261f006 100644 --- a/public/app/features/alerting/unified/components/RuleNotificationSection.tsx +++ b/public/app/features/alerting/unified/components/RuleNotificationSection.tsx @@ -12,8 +12,8 @@ import { Field, Input, Label, + RadioButtonGroup, Stack, - Switch, Text, TextArea, TextLink, @@ -61,46 +61,57 @@ export function RuleNotificationSection() {
- - -
- - {t('alerting.simplified.notification.manual-routing.label', 'Manual routing')} - - { - const next = e.currentTarget.checked; - setValue('manualRouting', next, { shouldDirty: true, shouldValidate: true }); - setValue('editorSettings.simplifiedNotificationEditor', next, { - shouldDirty: true, - shouldValidate: true, - }); - }} - aria-labelledby={recipientLabelId} - aria-label={t('alerting.simplified.notification.manual-routing.aria', 'Toggle manual routing')} - /> -
+ + + +
+ { + const next = val === 'contact'; + setValue('manualRouting', next, { shouldDirty: true, shouldValidate: true }); + setValue('editorSettings.simplifiedNotificationEditor', next, { + shouldDirty: true, + shouldValidate: true, + }); + }} + aria-label={t('alerting.simplified.notification.manual-routing.aria', 'Toggle manual routing')} + /> +
+
+ + {useNotificationPolicy ? ( + + Notifications for firing alerts are routed to contact points based on matching labels and the + notification policy tree. + + ) : ( + + Notifications for firing alerts are routed to a selected contact point. + + )} +
{useNotificationPolicy ? (
@@ -226,6 +237,7 @@ function getStyles(theme: GrafanaTheme2) { alignItems: 'center', gap: theme.spacing(0.5), whiteSpace: 'nowrap', + maxWidth: '100%', }), }; } diff --git a/public/app/features/alerting/unified/components/rule-editor/EvaluationGroupFieldRow.tsx b/public/app/features/alerting/unified/components/rule-editor/EvaluationGroupFieldRow.tsx index 205bd682e0a..8a22fa32376 100644 --- a/public/app/features/alerting/unified/components/rule-editor/EvaluationGroupFieldRow.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/EvaluationGroupFieldRow.tsx @@ -71,7 +71,7 @@ export function EvaluationGroupFieldRow({ enableProvisionedGroups }: { enablePro : t('alerting.rule-form.evaluation.evaluation-group-and-interval', 'Evaluation group and interval'); return ( - +