Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Prevent wrapping of time series cells #5779

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { DocViewFilterFn } from '../../doc_views/doc_views_types';

export interface TableCellProps {
columnId: string;
isTimeField?: boolean;
onFilter: DocViewFilterFn;
filterable?: boolean;
fieldMapping?: any;
Expand All @@ -26,16 +27,14 @@ export interface TableCellProps {

export const TableCell = ({
columnId,
isTimeField,
onFilter,
fieldMapping,
sanitizedCellValue,
}: TableCellProps) => {
return (
// eslint-disable-next-line react/no-danger
<td
data-test-subj="docTableField"
className="osdDocTableCell eui-textBreakAll eui-textBreakWord"
>
const content = (
<>
{/* eslint-disable-next-line react/no-danger */}
<span dangerouslySetInnerHTML={{ __html: sanitizedCellValue }} />
<span className="osdDocTableCell__filter">
<EuiToolTip
Expand Down Expand Up @@ -69,6 +68,19 @@ export const TableCell = ({
/>
</EuiToolTip>
</span>
</>
);

return isTimeField ? (
<td data-test-subj="docTableField" className="osdDocTableCell eui-textNoWrap">
{content}
</td>
) : (
<td
data-test-subj="docTableField"
className="osdDocTableCell eui-textBreakAll eui-textBreakWord"
>
<div className="osdDocTable__limitedHeight">{content}</div>
</td>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export const TableRow = ({
<TableCell
columnId={columnId}
onFilter={onFilter}
isTimeField={indexPattern.timeFieldName === columnId}
fieldMapping={fieldMapping}
sanitizedCellValue={sanitizedCellValue}
/>
Expand Down
Loading