From 3e2293957c2bca6b17029b238ba077f86236b87d Mon Sep 17 00:00:00 2001 From: Josh Romero Date: Tue, 6 Feb 2024 15:34:27 -0800 Subject: [PATCH] =?UTF-8?q?Fix=20(TableVis):=20Properly=20filter=20table?= =?UTF-8?q?=20columns=20when=20sending=20to=20filter=20=E2=80=A6=20(#5619)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix (TableVis): Properly filter table columns when sending to filter event handler Signed-off-by: Josh Romero * add changelog Signed-off-by: Josh Romero --------- Signed-off-by: Josh Romero Signed-off-by: Ashwin P Chandran Co-authored-by: Ashwin P Chandran --- CHANGELOG.md | 1 + .../public/components/table_vis_grid_columns.tsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a870385db189..0bccc24b4ab3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,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) +- [Table Visualization] Fix filter action buttons for split table aggregations ([#5619](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5619)) - [BUG][Multiple Datasource] Datasource id is required if multiple datasource is enabled and no default cluster supported [#5751](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5751) ### 🚞 Infrastructure diff --git a/src/plugins/vis_type_table/public/components/table_vis_grid_columns.tsx b/src/plugins/vis_type_table/public/components/table_vis_grid_columns.tsx index 6bd2c0f1739f..66aa5b6ab491 100644 --- a/src/plugins/vis_type_table/public/components/table_vis_grid_columns.tsx +++ b/src/plugins/vis_type_table/public/components/table_vis_grid_columns.tsx @@ -15,6 +15,7 @@ export const getDataGridColumns = ( event: IInterpreterRenderHandlers['event'], columnWidths: ColumnWidth[] ) => { + const formattedColumnIds = table.formattedColumns.map((column) => column.id); const filterBucket = (rowIndex: number, columnIndex: number, negate: boolean) => { event({ name: 'filterBucket', @@ -22,7 +23,7 @@ export const getDataGridColumns = ( data: [ { table: { - columns: table.columns, + columns: table.columns.filter((column) => formattedColumnIds.includes(column.id)), rows: table.rows, }, row: rowIndex,