From bf78064081dac6003c17144de0c3704adeb6e1e0 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 14:55:06 -0700 Subject: [PATCH] [Multiple Datasource] Pass selected data sources to plugin consumers when the multi-select component initially loads (#6333) (#6335) * Add callback function to initial load Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com> * Add to CHANGELOG Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com> --------- Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com> (cherry picked from commit cb24346566283e9e2e267ef4476ae5996c4d7f58) Signed-off-by: github-actions[bot] # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] --- .../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 8405a37a43c..2bcf5789918 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(() => {