From 912208c5e5caf7178153b5e0247baf3f213bd54e Mon Sep 17 00:00:00 2001 From: "Yuanqi(Ella) Zhu" Date: Tue, 16 Apr 2024 18:38:21 +0000 Subject: [PATCH] UI change for data source view to enable selectable Signed-off-by: Yuanqi(Ella) Zhu --- CHANGELOG.md | 1 + .../data_source_menu/data_source_menu.tsx | 1 + .../data_source_view.test.tsx.snap | 702 +++++++++++------- .../data_source_view/data_source_view.scss | 13 + .../data_source_view.test.tsx | 2 +- .../data_source_view/data_source_view.tsx | 143 ++-- 6 files changed, 532 insertions(+), 330 deletions(-) create mode 100644 src/plugins/data_source_management/public/components/data_source_view/data_source_view.scss diff --git a/CHANGELOG.md b/CHANGELOG.md index 77d1fad31e9c..d305f72d2014 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -95,6 +95,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [CSP Handler] Update CSP handler to only query and modify frame ancestors instead of all CSP directives ([#6398](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6398)) - [MD] Add OpenSearch cluster group label to top of single selectable dropdown ([#6400](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6400)) - [Multiple Datasource] Add error state to all data source menu components to show error component and consolidate all fetch errors ([#6440](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6440)) +- [Multiple Datasource] UI change for datasource view picker to enable selectable([#6497](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6497)) - [Workspace] Support workspace in saved objects client in server side. ([#6365](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6365)) - [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)) diff --git a/src/plugins/data_source_management/public/components/data_source_menu/data_source_menu.tsx b/src/plugins/data_source_management/public/components/data_source_menu/data_source_menu.tsx index bc645a0b885f..74e9e2d03b9b 100644 --- a/src/plugins/data_source_management/public/components/data_source_menu/data_source_menu.tsx +++ b/src/plugins/data_source_management/public/components/data_source_menu/data_source_menu.tsx @@ -39,6 +39,7 @@ export function DataSourceMenu(props: DataSourceMenuProps): ReactElement | dataSourceFilter={dataSourceFilter} onSelectedDataSources={onSelectedDataSources} uiSettings={uiSettings} + application={application} /> ); } diff --git a/src/plugins/data_source_management/public/components/data_source_view/__snapshots__/data_source_view.test.tsx.snap b/src/plugins/data_source_management/public/components/data_source_view/__snapshots__/data_source_view.test.tsx.snap index f0154f84d7e4..5dd8e6ec2821 100644 --- a/src/plugins/data_source_management/public/components/data_source_view/__snapshots__/data_source_view.test.tsx.snap +++ b/src/plugins/data_source_management/public/components/data_source_view/__snapshots__/data_source_view.test.tsx.snap @@ -1,252 +1,331 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`DataSourceView Should render successfully when provided datasource has not been filtered out 1`] = ` - - - + - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="dataSourceViewContextMenuPopover" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="dataSourceViewPopover" + isOpen={false} + ownFocus={true} + panelPaddingSize="none" +> + - - - + + + + + + + + + + `; exports[`DataSourceView Should return error when provided datasource has been filtered out 1`] = ` - - - + - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="dataSourceViewContextMenuPopover" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" + size="s" + > + + + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="dataSourceViewPopover" + isOpen={false} + ownFocus={true} + panelPaddingSize="none" +> + - - - + + + + + + + + + + `; exports[`DataSourceView When selected option is local cluster and hide local Cluster is true, should return error 1`] = ` - - - + - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="dataSourceViewContextMenuPopover" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" + size="s" + > + + + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="dataSourceViewPopover" + isOpen={false} + ownFocus={true} + panelPaddingSize="none" +> + - - - + + + + + + + + + + `; exports[`DataSourceView should call getDataSourceById when only pass id with no label 1`] = ` - - - + - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="dataSourceViewContextMenuPopover" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="dataSourceViewPopover" + isOpen={false} + ownFocus={true} + panelPaddingSize="none" +> + - - - + + + + + + + + + + `; exports[`DataSourceView should call notification warning when there is data source fetch error 1`] = ``; exports[`DataSourceView should render normally with local cluster not hidden 1`] = ` - - - test1 - - + - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="dataSourceViewContextMenuPopover" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" + size="s" + > + test1 + + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="dataSourceViewPopover" + isOpen={false} + ownFocus={true} + panelPaddingSize="none" +> + - - - + + + + + + + + + + `; exports[`DataSourceView should show popover when click on button 1`] = ` @@ -254,88 +333,159 @@ Object { "asFragment": [Function], "baseElement":
-
+
+
+