Logs: Fixed wrapping log lines from detected fields (#52108) (#52131)

* fixed wrap in detected fields

* removed cx

(cherry picked from commit 05ba08fd8b)

Co-authored-by: Sven Grossmann <Svennergr@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-07-13 03:38:33 -04:00
committed by GitHub
co-authored by Sven Grossmann
parent 8eda9c96d3
commit d351b07795
@@ -1,4 +1,4 @@
import { cx, css } from '@emotion/css';
import { css } from '@emotion/css';
import React, { PureComponent } from 'react';
import { LogRowModel, Field, LinkModel } from '@grafana/data';
@@ -19,12 +19,11 @@ class UnThemedLogRowMessageDetectedFields extends PureComponent<Props> {
render() {
const { row, showDetectedFields, getFieldLinks, wrapLogMessage } = this.props;
const fields = getAllFields(row, getFieldLinks);
const wrapClassName = cx(
wrapLogMessage &&
css`
white-space: pre-wrap;
`
);
const wrapClassName = wrapLogMessage
? ''
: css`
white-space: nowrap;
`;
const line = showDetectedFields
.map((parsedKey) => {