From 0e12ff232fc9b8e20fdeecb4b8adce161e572d8b Mon Sep 17 00:00:00 2001 From: "Yuanqi(Ella) Zhu" <53279298+zhyuanqi@users.noreply.github.com> Date: Fri, 19 Apr 2024 11:19:27 -0700 Subject: [PATCH] fix on data source selectable and readonly component are not consistent (#6545) Signed-off-by: Yuanqi(Ella) Zhu --- CHANGELOG.md | 1 + .../data_source_selectable.test.tsx.snap | 160 ++++++++---------- .../data_source_selectable.tsx | 21 +-- .../data_source_view.test.tsx.snap | 110 +++++------- .../data_source_view/data_source_view.tsx | 18 +- .../drop_down_header.test.tsx.snap | 83 ++++----- .../drop_down_header/drop_down_header.tsx | 6 +- 7 files changed, 179 insertions(+), 220 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e30eac70f9..4db3f3299dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -135,6 +135,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Dynamic Configurations] Fix dynamic config API calls to pass correct input ([#6474](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6474)) - [BUG][Multiple Datasource] Modify the button of selectable component to fix the title overflow issue ([#6465](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6465)) - [BUG][Multiple Datasource] Validation succeed as long as status code in response is 200 ([#6399](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6399)) +- [BUG][Multiple Datasource] Fix on data source selectable and readonly component are not consistent ([#6545]https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6545) - [BUG][Multiple Datasource] Add validation for title length to be no longer than 32 characters [#6452](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6452)) ### 🚞 Infrastructure diff --git a/src/plugins/data_source_management/public/components/data_source_selectable/__snapshots__/data_source_selectable.test.tsx.snap b/src/plugins/data_source_management/public/components/data_source_selectable/__snapshots__/data_source_selectable.test.tsx.snap index 79d158ee3be..b3abb935afe 100644 --- a/src/plugins/data_source_management/public/components/data_source_selectable/__snapshots__/data_source_selectable.test.tsx.snap +++ b/src/plugins/data_source_management/public/components/data_source_selectable/__snapshots__/data_source_selectable.test.tsx.snap @@ -29,6 +29,9 @@ exports[`DataSourceSelectable should filter options if configured 1`] = ` ownFocus={true} panelPaddingSize="none" > + - - - + - - - + - - -
+
+
+
+ DATA SOURCES + ( + 3 + ) +
+
+
+ +
+
+
-
-
- DATA SOURCES - ( - 3 - ) -
-
-
- -
-
-
-
-
- +
+ class="euiFormControlLayoutCustomIcon" + > + +
diff --git a/src/plugins/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx b/src/plugins/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx index 2259f93fbbe..c1aafb0b2a3 100644 --- a/src/plugins/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx +++ b/src/plugins/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx @@ -11,8 +11,7 @@ import { EuiPanel, EuiButtonEmpty, EuiSelectable, - EuiSpacer, - EuiHorizontalRule, + EuiPopoverTitle, } from '@elastic/eui'; import { ApplicationStart, @@ -270,14 +269,16 @@ export class DataSourceSelectable extends React.Component< anchorPosition="downLeft" data-test-subj={'dataSourceSelectableContextMenuPopover'} > + - - - - + {(list, search) => ( <> - {search} + {search} {list} )} 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 954e4924795..efe373e7d82 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 @@ -24,24 +24,18 @@ exports[`DataSourceView Should render successfully when provided datasource has ownFocus={true} panelPaddingSize="none" > + - - - + - - -