From e04f84fd1bd54fb9d129643a5a3a356ada143a8d Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Tue, 31 May 2022 12:33:43 +0200 Subject: [PATCH] Alerting: fix layout with long words / numbers (#49882) --- .../unified/components/AnnotationDetailsField.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/public/app/features/alerting/unified/components/AnnotationDetailsField.tsx b/public/app/features/alerting/unified/components/AnnotationDetailsField.tsx index 5d8061c220c..5c193fd1053 100644 --- a/public/app/features/alerting/unified/components/AnnotationDetailsField.tsx +++ b/public/app/features/alerting/unified/components/AnnotationDetailsField.tsx @@ -34,15 +34,22 @@ export const AnnotationDetailsField: FC = ({ annotationKey, value }) => { const AnnotationValue: FC = ({ annotationKey, value }) => { const styles = useStyles(getStyles); - if (wellableAnnotationKeys.includes(annotationKey)) { - return {value}; - } else if (value && value.startsWith('http')) { + + const needsWell = wellableAnnotationKeys.includes(annotationKey); + const needsLink = value && value.startsWith('http'); + + if (needsWell) { + return {value}; + } + + if (needsLink) { return ( {value} ); } + return <>{value}; };