mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* [data views] Improve preview pane (#126013)
* fix preview pane
* fix preview pane
* one less span tag
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 7dbe341c78
)
* fix test
Co-authored-by: Matthew Kime <matt@mattki.me>
This commit is contained in:
parent
59c4a8bcdf
commit
78b17c4280
1 changed files with 5 additions and 2 deletions
|
@ -16,6 +16,7 @@ import React, {
|
|||
useRef,
|
||||
FunctionComponent,
|
||||
} from 'react';
|
||||
import { renderToString } from 'react-dom/server';
|
||||
import useDebounce from 'react-use/lib/useDebounce';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { get } from 'lodash';
|
||||
|
@ -107,8 +108,10 @@ const defaultParams: Params = {
|
|||
format: null,
|
||||
};
|
||||
|
||||
export const defaultValueFormatter = (value: unknown) =>
|
||||
`<span>${typeof value === 'object' ? JSON.stringify(value) : value ?? '-'}</span>`;
|
||||
export const defaultValueFormatter = (value: unknown) => {
|
||||
const content = typeof value === 'object' ? JSON.stringify(value) : value ?? '-';
|
||||
return renderToString(<>{content}</>);
|
||||
};
|
||||
|
||||
export const FieldPreviewProvider: FunctionComponent = ({ children }) => {
|
||||
const previewCount = useRef(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue