From 51e04f8ee968c6a3810f7e0965eba56e308d37ab Mon Sep 17 00:00:00 2001 From: Anan Z Date: Mon, 5 Feb 2024 07:35:02 +0000 Subject: [PATCH] Make table size adjustable according to table rows and columns * Provide a unique key prop to the table component to force it to fully re-render when the key changes, which will force table to adjust its size. Issue Resolved https://github.com/opensearch-project/OpenSearch-Dashboards/issues/5440 Signed-off-by: Anan Z --- CHANGELOG.md | 1 + .../public/application/view_components/canvas/index.tsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20fbb8f92cf1..acfcd02c13d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Discover] Fix missing index pattern field from breaking Discover [#5626](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5626) - [BUG] Remove duplicate sample data as id 90943e30-9a47-11e8-b64d-95841ca0b247 ([5668](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5668)) - [BUG][Multiple Datasource] Fix datasource testing connection unexpectedly passed with wrong endpoint [#5663](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5663) +- [BUG][Discover] Make table size adjustable according to table rows and columns ([#5514](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5514)) ### 🚞 Infrastructure diff --git a/src/plugins/discover/public/application/view_components/canvas/index.tsx b/src/plugins/discover/public/application/view_components/canvas/index.tsx index d5c54158e997..40ccc3c7aa16 100644 --- a/src/plugins/discover/public/application/view_components/canvas/index.tsx +++ b/src/plugins/discover/public/application/view_components/canvas/index.tsx @@ -89,6 +89,7 @@ export default function DiscoverCanvas({ setHeaderActionMenu, history }: ViewPro }, [dispatch, filteredColumns, indexPattern]); const timeField = indexPattern?.timeFieldName ? indexPattern.timeFieldName : undefined; + const lastColumn = columns ? columns[columns.length - 1] : ''; return ( - + )}