From 0bcc60f437ed9cb553b06939de90c178fddb04c3 Mon Sep 17 00:00:00 2001 From: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com> Date: Thu, 25 Jan 2024 09:57:10 +0100 Subject: [PATCH] Alerting: Swap order between Annotations and Labels step in the alert rule form. (#81060) * Swap order between Annotations and Labels and notifications step, and update some texts * Update routing preview label size * Fix dashboard and panel label when are selected * Swap order in modify export form --- .../components/rule-editor/AnnotationHeaderField.tsx | 2 ++ .../unified/components/rule-editor/AnnotationsStep.tsx | 8 ++++---- .../unified/components/rule-editor/NotificationsStep.tsx | 6 +++--- .../rule-editor/alert-rule-form/AlertRuleForm.tsx | 4 ++-- .../rule-editor/alert-rule-form/ModifyExportRuleForm.tsx | 4 ++-- .../notificaton-preview/NotificationPreview.tsx | 3 ++- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/public/app/features/alerting/unified/components/rule-editor/AnnotationHeaderField.tsx b/public/app/features/alerting/unified/components/rule-editor/AnnotationHeaderField.tsx index 892fabb5278..b92f2568f04 100644 --- a/public/app/features/alerting/unified/components/rule-editor/AnnotationHeaderField.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/AnnotationHeaderField.tsx @@ -38,8 +38,10 @@ const AnnotationHeaderField = ({ switch (annotationField.key) { case Annotation.dashboardUID: label = 'Dashboard and panel'; + break; case Annotation.panelID: label = ''; + break; default: label = annotationLabels[annotation] && annotationLabels[annotation] + ' (optional)'; } diff --git a/public/app/features/alerting/unified/components/rule-editor/AnnotationsStep.tsx b/public/app/features/alerting/unified/components/rule-editor/AnnotationsStep.tsx index 10df3d5e940..010cba9f7a1 100644 --- a/public/app/features/alerting/unified/components/rule-editor/AnnotationsStep.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/AnnotationsStep.tsx @@ -95,11 +95,11 @@ const AnnotationsStep = () => { return ( - Add annotations to provide more context in your alert notifications. + Add more context in your notification messages. { } return ( - + {fields.map((annotationField, index: number) => { const isUrl = annotations[index]?.key?.toLocaleLowerCase().endsWith('url'); diff --git a/public/app/features/alerting/unified/components/rule-editor/NotificationsStep.tsx b/public/app/features/alerting/unified/components/rule-editor/NotificationsStep.tsx index f724766a65b..d4c9a8af1ee 100644 --- a/public/app/features/alerting/unified/components/rule-editor/NotificationsStep.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/NotificationsStep.tsx @@ -37,8 +37,8 @@ export const NotificationsStep = ({ alertUid }: NotificationsStepProps) => { return ( {type === RuleFormType.cloudRecording ? ( @@ -59,7 +59,7 @@ export const NotificationsStep = ({ alertUid }: NotificationsStepProps) => { {shouldAllowSimplifiedRouting && (
- Configure notifications + Notifications Select who should receive a notification when an alert rule fires. diff --git a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx index 47db55eda10..a7a5ef32199 100644 --- a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx @@ -240,10 +240,10 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => { {type === RuleFormType.cloudRecording && } {/* Step 4 & 5 */} - {/* Annotations only for cloud and Grafana */} - {type !== RuleFormType.cloudRecording && } {/* Notifications step*/} + {/* Annotations only for cloud and Grafana */} + {type !== RuleFormType.cloudRecording && } )} diff --git a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/ModifyExportRuleForm.tsx b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/ModifyExportRuleForm.tsx index a2a2433dda3..87f44a6c2b9 100644 --- a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/ModifyExportRuleForm.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/ModifyExportRuleForm.tsx @@ -97,10 +97,10 @@ export function ModifyExportRuleForm({ ruleForm, alertUid }: ModifyExportRuleFor /> {/* Step 4 & 5 */} - {/* Annotations only for cloud and Grafana */} - {/* Notifications step*/} + {/* Annotations only for cloud and Grafana */} +
diff --git a/public/app/features/alerting/unified/components/rule-editor/notificaton-preview/NotificationPreview.tsx b/public/app/features/alerting/unified/components/rule-editor/notificaton-preview/NotificationPreview.tsx index 1db96a0ff64..89752ea69f8 100644 --- a/public/app/features/alerting/unified/components/rule-editor/notificaton-preview/NotificationPreview.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/notificaton-preview/NotificationPreview.tsx @@ -71,7 +71,7 @@ export const NotificationPreview = ({
- Alert instance routing preview + Alert instance routing preview {isLoading && previewUninitialized && ( Loading... @@ -124,6 +124,7 @@ const getStyles = (theme: GrafanaTheme2) => ({ flex-direction: row; justify-content: space-between; align-items: flex-start; + margin-top: ${theme.spacing(1)}; `, collapseLabel: css` flex: 1;