From 290a77860f29debd01fd76ff8a82a775a981188e Mon Sep 17 00:00:00 2001 From: Lu Yu Date: Tue, 26 Mar 2024 09:43:08 -0700 Subject: [PATCH] [Multiple Datasource] Add multi selectable data source component (#6211) * add multi selectable data source component Signed-off-by: Lu Yu * update change log Signed-off-by: Lu Yu * add tests Signed-off-by: Lu Yu * add more test Signed-off-by: Lu Yu * refactor to add config Signed-off-by: Lu Yu * fix typo Signed-off-by: Lu Yu * update snapshot Signed-off-by: Lu Yu * add missing interface Signed-off-by: Lu Yu --------- Signed-off-by: Lu Yu --- .../data_source_menu.test.tsx.snap | 61 ++ .../data_source_selectable.test.tsx.snap | 232 ++++++ .../data_source_menu.test.tsx | 14 + .../data_source_menu/data_source_menu.tsx | 25 + .../data_source_selectable.test.tsx | 19 + .../data_source_selectable.tsx | 2 + .../components/data_source_menu/index.ts | 1 + .../components/data_source_menu/types.ts | 8 + .../data_source_filter_group.test.tsx.snap | 664 ++++++++++++++++++ ...data_source_multi_selectable.test.tsx.snap | 15 + .../data_source_filter_group.test.tsx | 75 ++ .../data_source_filter_group.tsx | 166 +++++ .../data_source_multi_selectable.test.tsx | 105 +++ .../data_source_multi_selectable.tsx | 100 +++ .../data_source_multi_selectable/index.ts | 6 + .../data_source_management/public/index.ts | 1 + 16 files changed, 1494 insertions(+) create mode 100644 src/plugins/data_source_management/public/components/data_source_multi_selectable/__snapshots__/data_source_filter_group.test.tsx.snap create mode 100644 src/plugins/data_source_management/public/components/data_source_multi_selectable/__snapshots__/data_source_multi_selectable.test.tsx.snap create mode 100644 src/plugins/data_source_management/public/components/data_source_multi_selectable/data_source_filter_group.test.tsx create mode 100644 src/plugins/data_source_management/public/components/data_source_multi_selectable/data_source_filter_group.tsx create mode 100644 src/plugins/data_source_management/public/components/data_source_multi_selectable/data_source_multi_selectable.test.tsx create mode 100644 src/plugins/data_source_management/public/components/data_source_multi_selectable/data_source_multi_selectable.tsx create mode 100644 src/plugins/data_source_management/public/components/data_source_multi_selectable/index.ts diff --git a/src/plugins/data_source_management/public/components/data_source_menu/__snapshots__/data_source_menu.test.tsx.snap b/src/plugins/data_source_management/public/components/data_source_menu/__snapshots__/data_source_menu.test.tsx.snap index 6fa9b51ce3e7..9db092a1b61c 100644 --- a/src/plugins/data_source_management/public/components/data_source_menu/__snapshots__/data_source_menu.test.tsx.snap +++ b/src/plugins/data_source_management/public/components/data_source_menu/__snapshots__/data_source_menu.test.tsx.snap @@ -161,6 +161,67 @@ Object { } `; +exports[`DataSourceMenu should render data source multi select component 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+ , + "container":
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + exports[`DataSourceMenu should render data source selectable only with local cluster is hidden 1`] = ` `; + +exports[`DataSourceSelectable should show popover when click on button 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+
+
+ +
+
+
+
+
+