diff --git a/.betterer.results b/.betterer.results index 5aa32246134..7dff19d1230 100644 --- a/.betterer.results +++ b/.betterer.results @@ -1692,10 +1692,7 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], [0, 0, 0, "No untranslated strings. Wrap text with ", "6"], [0, 0, 0, "No untranslated strings. Wrap text with ", "7"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "8"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "9"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "10"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "11"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "8"] ], "public/app/features/alerting/unified/components/expressions/ExpressionStatusIndicator.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] diff --git a/public/app/features/alerting/unified/components/expressions/Expression.tsx b/public/app/features/alerting/unified/components/expressions/Expression.tsx index 20a0a9561bb..863ca7bd9db 100644 --- a/public/app/features/alerting/unified/components/expressions/Expression.tsx +++ b/public/app/features/alerting/unified/components/expressions/Expression.tsx @@ -4,7 +4,7 @@ import { FC, useCallback, useState } from 'react'; import { useFormContext } from 'react-hook-form'; import { DataFrame, dateTimeFormat, GrafanaTheme2, isTimeSeriesFrames, LoadingState, PanelData } from '@grafana/data'; -import { Alert, AutoSizeInput, Button, clearButtonStyles, IconButton, Stack, useStyles2 } from '@grafana/ui'; +import { Alert, AutoSizeInput, Button, clearButtonStyles, IconButton, Stack, Text, useStyles2 } from '@grafana/ui'; import { ClassicConditions } from 'app/features/expressions/components/ClassicConditions'; import { Math } from 'app/features/expressions/components/Math'; import { Reduce } from 'app/features/expressions/components/Reduce'; @@ -359,6 +359,11 @@ interface FrameProps extends Pick { index: number; } +const OpeningBracket = () => {'{'}; +const ClosingBracket = () => {'}'}; +const Quote = () => {'"'}; +const Equals = () => {'='}; + const FrameRow: FC = ({ frame, index, isAlertCondition }) => { const styles = useStyles2(getStyles); @@ -377,23 +382,26 @@ const FrameRow: FC = ({ frame, index, isAlertCondition }) => {
- {hasLabels ? '' : name} - {hasLabels && ( - <> - {'{'} - {labels.map(([key, value], index) => ( - - {key} - = - " - {value} - " - {index < labels.length - 1 && , } - - ))} - {'}'} - - )} + + {hasLabels ? ( + <> + + {labels.map(([key, value], index) => ( + + {key} + + + {value} + + {index < labels.length - 1 && , } + + ))} + + + ) : ( + {title} + )} +
{value}
{showFiring && }