From 84e1faba37a61c9d8a9870be3cd9099167b3cb22 Mon Sep 17 00:00:00 2001 From: Huy Nguyen <73027756+huyaboo@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:53:04 +0000 Subject: [PATCH 1/2] Add callback function to initial load Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com> --- .../data_source_multi_selectable.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/data_source_management/public/components/data_source_multi_selectable/data_source_multi_selectable.tsx b/src/plugins/data_source_management/public/components/data_source_multi_selectable/data_source_multi_selectable.tsx index 8405a37a43c2..2bcf57899189 100644 --- a/src/plugins/data_source_management/public/components/data_source_multi_selectable/data_source_multi_selectable.tsx +++ b/src/plugins/data_source_management/public/components/data_source_multi_selectable/data_source_multi_selectable.tsx @@ -70,6 +70,10 @@ export class DataSourceMultiSelectable extends React.Component< ...this.state, selectedOptions, }); + + this.props.onSelectedDataSources( + selectedOptions.filter((option) => option.checked === 'on') + ); } }) .catch(() => { From b9ba13d85402578db59ad71f7591894cabefd311 Mon Sep 17 00:00:00 2001 From: Huy Nguyen <73027756+huyaboo@users.noreply.github.com> Date: Wed, 3 Apr 2024 18:36:29 +0000 Subject: [PATCH 2/2] Add to CHANGELOG Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com> --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa22c691941c..1b64758f4ca7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Multiple Datasource] Add multi data source support to sample vega visualizations ([#6218](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6218)) - [Multiple Datasource] Fetch data source title for DataSourceView when only id is provided ([#6315](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6315) - [Workspace] Add permission control logic ([#6052](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6052)) +- [Multiple Datasource] Pass selected data sources to plugin consumers when the multi-select component initially loads ([#6333](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6333)) ### 🐛 Bug Fixes