From 957e509c8c7aa22414dcde200a324f9116910f90 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 25 Jul 2024 00:30:41 +0000 Subject: [PATCH] fix(discover): break new lines in table cell (#7207) * fix(discover): break new lines in table cell fixes #7177 Signed-off-by: Joshua Li * Changeset file for PR #7207 created/updated --------- Signed-off-by: Joshua Li Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 4ff4c3c081cb70ef3a495cdcd76091c065385dc9) Signed-off-by: github-actions[bot] --- changelogs/fragments/7207.yml | 2 ++ .../components/default_discover_table/_table_cell.scss | 4 ++++ .../components/default_discover_table/table_cell.tsx | 7 +++++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/7207.yml diff --git a/changelogs/fragments/7207.yml b/changelogs/fragments/7207.yml new file mode 100644 index 000000000000..177db9c49438 --- /dev/null +++ b/changelogs/fragments/7207.yml @@ -0,0 +1,2 @@ +fix: +- Break new lines in table cell in legacy discover ([#7207](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7207)) \ No newline at end of file diff --git a/src/plugins/discover/public/application/components/default_discover_table/_table_cell.scss b/src/plugins/discover/public/application/components/default_discover_table/_table_cell.scss index 5a6d69071ae7..980a335f35e2 100644 --- a/src/plugins/discover/public/application/components/default_discover_table/_table_cell.scss +++ b/src/plugins/discover/public/application/components/default_discover_table/_table_cell.scss @@ -104,3 +104,7 @@ $osdDocTableCellPadding: calc($ouiSizeM / 2); // corresponds to DataGrid medium font-size: inherit !important; } } + +.osdDocTableCell__dataField { + white-space: pre-wrap; +} 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 ea141b55f23e..ddeffcabc5bc 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 @@ -34,8 +34,11 @@ const TableCellUI = ({ }: TableCellProps) => { const content = ( <> - {/* eslint-disable-next-line react/no-danger */} - +