diff --git a/CHANGELOG.md b/CHANGELOG.md
index c6b3ecdcec69..344a3345b76d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -101,6 +101,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [MD] Add dropdown header to data source single selector ([#6431](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6431))
- [Workspace] Add permission tab to workspace create update page ([#6378](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6378))
- [Workspace] Hide datasource and advanced settings menu in dashboard management when in workspace. ([#6455](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6455))
+- [Multiple Datasource] Modify selectable picker to remove group label and close popover after selection ([#6515](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6515))
- [Workspace] Add workspaces filter to saved objects page. ([#6458](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6458))
### 🐛 Bug Fixes
diff --git a/examples/multiple_data_source_examples/public/application.tsx b/examples/multiple_data_source_examples/public/application.tsx
index 16d9c928b04c..81248f8adccf 100644
--- a/examples/multiple_data_source_examples/public/application.tsx
+++ b/examples/multiple_data_source_examples/public/application.tsx
@@ -11,7 +11,7 @@ import { CoreStart, AppMountParameters } from '../../../src/core/public';
import { Home } from './components/home';
export const renderApp = (
- { notifications, http, savedObjects, application }: CoreStart,
+ { notifications, http, savedObjects, application, uiSettings }: CoreStart,
dataSource: DataSourcePluginSetup,
dataSourceManagement: DataSourceManagementPluginSetup,
{ appBasePath, element, setHeaderActionMenu }: AppMountParameters,
@@ -28,6 +28,7 @@ export const renderApp = (
dataSourceManagement={dataSourceManagement}
navigateToApp={application.navigateToApp}
navigation={navigation}
+ uiSettings={uiSettings}
/>,
element
);
diff --git a/examples/multiple_data_source_examples/public/components/data_source_list_active_example.tsx b/examples/multiple_data_source_examples/public/components/data_source_list_active_example.tsx
index 529d610c8132..81a15e2c03da 100644
--- a/examples/multiple_data_source_examples/public/components/data_source_list_active_example.tsx
+++ b/examples/multiple_data_source_examples/public/components/data_source_list_active_example.tsx
@@ -28,6 +28,7 @@ interface DataSourceListActiveExampleProps {
notifications: CoreStart['notifications'];
setActionMenu?: (menuMount: MountPoint | undefined) => void;
dataSourceManagement: DataSourceManagementPluginSetup;
+ uiSettings: CoreStart['uiSettings'];
}
export const DataSourceListActiveExample = ({
@@ -36,6 +37,7 @@ export const DataSourceListActiveExample = ({
notifications,
setActionMenu,
dataSourceManagement,
+ uiSettings,
}: DataSourceListActiveExampleProps) => {
const DataSourceMenu = dataSourceManagement.ui.getDataSourceMenu<
DataSourceAggregatedViewConfig
@@ -106,7 +108,10 @@ export const DataSourceListActiveExample = ({
fullWidth: false,
savedObjects: savedObjects.client,
notifications,
- displayAllCompatibleDataSources: true,
+ displayAllCompatibleDataSources: false,
+ // To see selected options, obtain the datasource id and paste it here. Note that this needs to be defined when displayAllCompatibleDataSources is false
+ activeDataSourceIds: [],
+ uiSettings,
}}
/>
)}
diff --git a/examples/multiple_data_source_examples/public/components/data_source_list_all_example.tsx b/examples/multiple_data_source_examples/public/components/data_source_list_all_example.tsx
index 26545fef70c7..570e51be36e9 100644
--- a/examples/multiple_data_source_examples/public/components/data_source_list_all_example.tsx
+++ b/examples/multiple_data_source_examples/public/components/data_source_list_all_example.tsx
@@ -28,6 +28,7 @@ interface DataSourceListAllExampleProps {
notifications: CoreStart['notifications'];
setActionMenu?: (menuMount: MountPoint | undefined) => void;
dataSourceManagement: DataSourceManagementPluginSetup;
+ uiSettings: CoreStart['uiSettings'];
}
export const DataSourceListAllExample = ({
@@ -36,6 +37,7 @@ export const DataSourceListAllExample = ({
notifications,
setActionMenu,
dataSourceManagement,
+ uiSettings,
}: DataSourceListAllExampleProps) => {
const DataSourceMenu = dataSourceManagement.ui.getDataSourceMenu<
DataSourceAggregatedViewConfig
@@ -100,6 +102,7 @@ export const DataSourceListAllExample = ({
savedObjects: savedObjects.client,
notifications,
displayAllCompatibleDataSources: true,
+ uiSettings,
}}
/>
)}
diff --git a/examples/multiple_data_source_examples/public/components/home.tsx b/examples/multiple_data_source_examples/public/components/home.tsx
index fe6ca1f285a4..c7a61c590c63 100644
--- a/examples/multiple_data_source_examples/public/components/home.tsx
+++ b/examples/multiple_data_source_examples/public/components/home.tsx
@@ -22,6 +22,7 @@ export interface HomeProps {
notifications: CoreStart['notifications'];
http: CoreStart['http'];
savedObjects: CoreStart['savedObjects'];
+ uiSettings: CoreStart['uiSettings'];
dataSourceEnabled: boolean;
dataSourceManagement: DataSourceManagementPluginSetup;
navigateToApp: CoreStart['application']['navigateToApp'];
@@ -65,6 +66,7 @@ export const Home = ({
basename,
notifications,
savedObjects,
+ uiSettings,
dataSourceEnabled,
setActionMenu,
dataSourceManagement,
@@ -133,6 +135,7 @@ export const Home = ({
dataSourceEnabled={dataSourceEnabled}
setActionMenu={setActionMenu}
dataSourceManagement={dataSourceManagement}
+ uiSettings={uiSettings}
/>
),
},
@@ -146,6 +149,7 @@ export const Home = ({
dataSourceEnabled={dataSourceEnabled}
setActionMenu={setActionMenu}
dataSourceManagement={dataSourceManagement}
+ uiSettings={uiSettings}
/>
),
},
diff --git a/src/plugins/data_source_management/public/components/data_source_aggregated_view/__snapshots__/data_source_aggregated_view.test.tsx.snap b/src/plugins/data_source_management/public/components/data_source_aggregated_view/__snapshots__/data_source_aggregated_view.test.tsx.snap
index e4f4b1f67c67..57ba243a476b 100644
--- a/src/plugins/data_source_management/public/components/data_source_aggregated_view/__snapshots__/data_source_aggregated_view.test.tsx.snap
+++ b/src/plugins/data_source_management/public/components/data_source_aggregated_view/__snapshots__/data_source_aggregated_view.test.tsx.snap
@@ -1,119 +1,155 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`DataSourceAggregatedView should render normally with data source filter 1`] = `
-
+
}
- }
->
-
-
-
-
-
- All
-
-
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`DataSourceAggregatedView: read active view (displayAllCompatibleDataSources is set to false) should render normally with local cluster and active selections configured 2`] = `
+
}
closePopover={[Function]}
@@ -124,169 +160,687 @@ exports[`DataSourceAggregatedView should render normally with data source filter
ownFocus={true}
panelPaddingSize="none"
>
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
-
+
`;
-exports[`DataSourceAggregatedView should render normally with local cluster and actice selections 1`] = `
-
+
}
- }
- savedObjectsClient={
- Object {
- "find": [MockFunction] {
- "calls": Array [
- Array [
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ id="dataSourceSViewContextMenuPopover"
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="none"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`DataSourceAggregatedView: read active view (displayAllCompatibleDataSources is set to false) should render normally with local cluster and active selections configured 4`] = `
+
+
}
- }
->
-
-
+`;
+
+exports[`DataSourceAggregatedView: read active view (displayAllCompatibleDataSources is set to false) should render normally with local cluster and active selections configured 5`] = `
+
+
+ }
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ id="dataSourceSViewContextMenuPopover"
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="none"
+ >
+
+
+
+
+
-
-
-
-
-
- Data sources
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`DataSourceAggregatedView: read active view (displayAllCompatibleDataSources is set to false) should render normally with local cluster and active selections configured 6`] = `
+
+
+ }
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ id="dataSourceSViewContextMenuPopover"
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="none"
>
-
- 1
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`DataSourceAggregatedView: read active view (displayAllCompatibleDataSources is set to false) should render normally with local cluster and active selections configured 7`] = `
+
}
closePopover={[Function]}
@@ -297,165 +851,564 @@ exports[`DataSourceAggregatedView should render normally with local cluster and
ownFocus={true}
panelPaddingSize="none"
>
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
-
+
`;
-exports[`DataSourceAggregatedView should render normally with local cluster hidden and all options 1`] = `
-
+
}
- }
- savedObjectsClient={
- Object {
- "find": [MockFunction] {
- "calls": Array [
- Array [
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ id="dataSourceSViewContextMenuPopover"
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="none"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`DataSourceAggregatedView: read all view (displayAllCompatibleDataSources is set to true) should render normally with local cluster configured, default datasource removed or added, and if activeDataSourceIds is present or filtered out 1`] = `
+
+
}
- }
->
-
-
+`;
+
+exports[`DataSourceAggregatedView: read all view (displayAllCompatibleDataSources is set to true) should render normally with local cluster configured, default datasource removed or added, and if activeDataSourceIds is present or filtered out 2`] = `
+
+
+ }
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ id="dataSourceSViewContextMenuPopover"
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="none"
+ >
+
+
+
+
+
-
-
-
-
-
- Data sources
-
-
-
-
-
-
+
+
+
+
+
+
+`;
+
+exports[`DataSourceAggregatedView: read all view (displayAllCompatibleDataSources is set to true) should render normally with local cluster configured, default datasource removed or added, and if activeDataSourceIds is present or filtered out 3`] = `
+
+
+ }
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ id="dataSourceSViewContextMenuPopover"
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="none"
>
-
- 0
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`DataSourceAggregatedView: read all view (displayAllCompatibleDataSources is set to true) should render normally with local cluster configured, default datasource removed or added, and if activeDataSourceIds is present or filtered out 4`] = `
+
}
closePopover={[Function]}
@@ -466,78 +1419,96 @@ exports[`DataSourceAggregatedView should render normally with local cluster hidd
ownFocus={true}
panelPaddingSize="none"
>
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+
-
+
`;
-exports[`DataSourceAggregatedView should render normally with local cluster not hidden and all options 1`] = `
+exports[`DataSourceAggregatedView: read all view (displayAllCompatibleDataSources is set to true) should render normally with local cluster configured, default datasource removed or added, and if activeDataSourceIds is present or filtered out 5`] = `
-
- Data sources
-
-
- All
-
}
closePopover={[Function]}
@@ -548,246 +1519,579 @@ exports[`DataSourceAggregatedView should render normally with local cluster not
ownFocus={true}
panelPaddingSize="none"
>
-
+
+
+
+
+
+
+
+
+
+
+
+
`;
-exports[`DataSourceAggregatedView should render popup when clicking on info icon 1`] = `
-Object {
- "asFragment": [Function],
- "baseElement":
-
-
-
- 1
-
-
-
+
+
+
+
+
+
+`;
+
+exports[`DataSourceAggregatedView: read all view (displayAllCompatibleDataSources is set to true) should render normally with local cluster configured, default datasource removed or added, and if activeDataSourceIds is present or filtered out 7`] = `
+
+
+ }
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ id="dataSourceSViewContextMenuPopover"
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="none"
+ >
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+`;
+
+exports[`DataSourceAggregatedView: read all view (displayAllCompatibleDataSources is set to true) should render normally with local cluster configured, default datasource removed or added, and if activeDataSourceIds is present or filtered out 8`] = `
+
+
+ }
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ id="dataSourceSViewContextMenuPopover"
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="none"
+ >
+
+
+
+
+
+
-
-
- You are in a dialog. To close this dialog, hit escape.
-
-
-
-
-
-
- Selected data sources
-
-
-
-
-
-
-
-
-
-
-
-
-
- ,
- "container":
-
+
+
+
+
+
+
+`;
+
+exports[`DataSourceAggregatedView: read all view (displayAllCompatibleDataSources is set to true) should render normally with local cluster configured, default datasource removed or added, and if activeDataSourceIds is present or filtered out 9`] = `
+
+
+ }
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ id="dataSourceSViewContextMenuPopover"
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="none"
+ >
+
-
-
-
+
+
- Data sources
-
-
-
-
- 1
-
-
+
+
+
+
+
+
+
+`;
+
+exports[`DataSourceAggregatedView: read all view (displayAllCompatibleDataSources is set to true) should render normally with local cluster configured, default datasource removed or added, and if activeDataSourceIds is present or filtered out 10`] = `
+
+
+ }
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ id="dataSourceSViewContextMenuPopover"
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="none"
+ >
+
-