diff --git a/public/app/features/alerting/unified/components/rule-editor/PreviewRule.tsx b/public/app/features/alerting/unified/components/rule-editor/PreviewRule.tsx index 3021c8a1e83..9cac7d83d27 100644 --- a/public/app/features/alerting/unified/components/rule-editor/PreviewRule.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/PreviewRule.tsx @@ -94,6 +94,7 @@ function getStyles(theme: GrafanaTheme2) { return { container: css` margin-top: ${theme.spacing(2)}; + max-width: ${theme.breakpoints.values.xxl}px; `, }; } diff --git a/public/app/features/alerting/unified/components/rule-editor/PreviewRuleResult.tsx b/public/app/features/alerting/unified/components/rule-editor/PreviewRuleResult.tsx index 492b208703d..0e77dbe8e67 100644 --- a/public/app/features/alerting/unified/components/rule-editor/PreviewRuleResult.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/PreviewRuleResult.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { css } from '@emotion/css'; import AutoSizer from 'react-virtualized-auto-sizer'; -import { useStyles2 } from '@grafana/ui'; +import { TableCellDisplayMode, useStyles2 } from '@grafana/ui'; import { PanelRenderer } from '@grafana/runtime'; -import { GrafanaTheme2, LoadingState } from '@grafana/data'; +import { FieldConfigSource, FieldMatcherID, GrafanaTheme2, LoadingState } from '@grafana/data'; import { PreviewRuleResponse } from '../../types/preview'; import { RuleFormType } from '../../types/rule-form'; import { messageFromError } from '../../utils/redux'; @@ -15,6 +15,15 @@ type Props = { export function PreviewRuleResult(props: Props): React.ReactElement | null { const { preview } = props; const styles = useStyles2(getStyles); + const fieldConfig: FieldConfigSource = { + defaults: {}, + overrides: [ + { + matcher: { id: FieldMatcherID.byName, options: 'Info' }, + properties: [{ id: 'custom.displayMode', value: TableCellDisplayMode.JSONView }], + }, + ], + }; if (!preview) { return null; @@ -37,7 +46,6 @@ export function PreviewRuleResult(props: Props): React.ReactElement | null { ); } - return (