From 179753c608b2586c6e4a6d74a75d288f7f56c899 Mon Sep 17 00:00:00 2001 From: laurenashleigh Date: Fri, 24 Oct 2025 15:21:34 +0100 Subject: [PATCH] update rule definition section UI --- .../components/RuleDefinitionSection.tsx | 14 ++- .../components/RuleNotificationSection.tsx | 25 ++++-- .../rule-editor/FolderSelectorV2.tsx | 2 +- .../rule-editor/labels/LabelsFieldInForm.tsx | 56 ++---------- .../labels/LabelsFieldInFormV2.tsx | 86 +++++++++++++++++++ public/locales/en-US/grafana.json | 47 ++++++++++ 6 files changed, 169 insertions(+), 61 deletions(-) create mode 100644 public/app/features/alerting/unified/components/rule-editor/labels/LabelsFieldInFormV2.tsx diff --git a/public/app/features/alerting/unified/components/RuleDefinitionSection.tsx b/public/app/features/alerting/unified/components/RuleDefinitionSection.tsx index 197f741e764..14c9dec55e1 100644 --- a/public/app/features/alerting/unified/components/RuleDefinitionSection.tsx +++ b/public/app/features/alerting/unified/components/RuleDefinitionSection.tsx @@ -13,7 +13,7 @@ import { isCloudRecordingRuleByType, isGrafanaManagedRuleByType, isRecordingRule import { FolderSelectorV2 } from './rule-editor/FolderSelectorV2'; import { LabelsEditorModal } from './rule-editor/labels/LabelsEditorModal'; -import { LabelsFieldInForm } from './rule-editor/labels/LabelsFieldInForm'; +import { LabelsFieldInFormV2 } from './rule-editor/labels/LabelsFieldInFormV2'; export function RuleDefinitionSection({ type }: { type: RuleFormType }) { const styles = useStyles2(getStyles); @@ -43,7 +43,11 @@ export function RuleDefinitionSection({ type }: { type: RuleFormType }) { Name} + label={ + + Name + + } error={errors?.name?.message} invalid={!!errors.name?.message} > @@ -78,7 +82,7 @@ export function RuleDefinitionSection({ type }: { type: RuleFormType }) { {isGrafanaManagedRuleByType(type) && ( <> - setShowLabelsEditor(true)} labelVariant="small" /> + setShowLabelsEditor(true)} /> { @@ -128,5 +132,9 @@ function getStyles(theme: GrafanaTheme2) { fontWeight: 600, }), contentIndented: css({ marginLeft: `calc(20px + ${theme.spacing(1)})` }), + nameLabel: css({ + fontSize: theme.typography.bodySmall.fontSize, + fontWeight: 500, + }), }; } diff --git a/public/app/features/alerting/unified/components/RuleNotificationSection.tsx b/public/app/features/alerting/unified/components/RuleNotificationSection.tsx index ffce0f3fbdc..768b547edc8 100644 --- a/public/app/features/alerting/unified/components/RuleNotificationSection.tsx +++ b/public/app/features/alerting/unified/components/RuleNotificationSection.tsx @@ -4,9 +4,7 @@ import { useMemo, useState } from 'react'; import { notificationsAPIv0alpha1 } from '@grafana/alerting/unstable'; import type { GrafanaTheme2 } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; -import { Button, Combobox, ComboboxOption, Field, Input, Stack, TextArea, useStyles2 } from '@grafana/ui'; - -import { LinkToContactPoints } from './rule-editor/alert-rule-form/simplifiedRouting/contactPoint/ContactPointSelector'; +import { Button, Combobox, ComboboxOption, Field, Input, Stack, TextArea, TextLink, useStyles2 } from '@grafana/ui'; export function RuleNotificationSection() { const styles = useStyles2(getStyles); @@ -37,7 +35,7 @@ export function RuleNotificationSection() {
- + + + View or create contact points + + - +