Skip to content

Commit

Permalink
[Discover] Prevent wrapping of time series cells
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <miki@amazon.com>
  • Loading branch information
AMoo-Miki committed Feb 2, 2024
1 parent 40e61ba commit 5bce3a4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
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

0 comments on commit 5bce3a4

Please sign in to comment.