From af4f2d4725e5063acf3f0222f439c7dc4f7cb260 Mon Sep 17 00:00:00 2001 From: Miki Date: Thu, 1 Feb 2024 19:04:42 -0800 Subject: [PATCH] [Discover] Prevent wrapping of time series cells Signed-off-by: Miki --- .../default_discover_table/table_cell.tsx | 24 ++++++++++++++----- .../default_discover_table/table_rows.tsx | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/plugins/discover/public/application/components/default_discover_table/table_cell.tsx b/src/plugins/discover/public/application/components/default_discover_table/table_cell.tsx index 16e6a0e13716..a542e70ff646 100644 --- a/src/plugins/discover/public/application/components/default_discover_table/table_cell.tsx +++ b/src/plugins/discover/public/application/components/default_discover_table/table_cell.tsx @@ -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; @@ -26,16 +27,14 @@ export interface TableCellProps { export const TableCell = ({ columnId, + isTimeField, onFilter, fieldMapping, sanitizedCellValue, }: TableCellProps) => { - return ( - // eslint-disable-next-line react/no-danger - + const content = ( + <> + {/* eslint-disable-next-line react/no-danger */} + + ); + + return isTimeField ? ( + + {content} + + ) : ( + +
{content}
); }; diff --git a/src/plugins/discover/public/application/components/default_discover_table/table_rows.tsx b/src/plugins/discover/public/application/components/default_discover_table/table_rows.tsx index af6d52d830b0..0885d7f9f1e7 100644 --- a/src/plugins/discover/public/application/components/default_discover_table/table_rows.tsx +++ b/src/plugins/discover/public/application/components/default_discover_table/table_rows.tsx @@ -108,6 +108,7 @@ export const TableRow = ({