From 95b2ef6c74bbd049b9f8252a3069be15e8a4a109 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 09:10:39 -0700 Subject: [PATCH] fix(discover): break new lines in table cell (#7207) (#7468) * fix(discover): break new lines in table cell fixes #7177 * Changeset file for PR #7207 created/updated --------- (cherry picked from commit 4ff4c3c081cb70ef3a495cdcd76091c065385dc9) Signed-off-by: Joshua Li Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> --- 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 */} - +