Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Multiple Datasource] Add multi selectable data source component #6211

Merged
merged 15 commits into from
Mar 26, 2024

Conversation

BionIT
Copy link
Collaborator

@BionIT BionIT commented Mar 19, 2024

Description

This change adds a new data source component which allows multi selections of data sources.

Issues Resolved

Fixes #6210

Screenshot

multiselect.mp4

Testing the changes

The following steps were performed in the recording above:

  1. enable data source plugin
  2. go to query workbench plugin page, should see the multi selectable component rendered correctly with all options selected by default, with the badge icon show the total number of data sources
  3. click on deselect all will deselect all options and the badge icon should show 0
  4. select a few data sources, the badge icon should update with number of selected data sources

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 73.58491% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 67.43%. Comparing base (74e0df3) to head (bc37f97).

Files Patch % Lines
...urce_multi_selectable/data_source_filter_group.tsx 80.00% 3 Missing and 3 partials ⚠️
...c/components/data_source_menu/data_source_menu.tsx 0.00% 4 Missing ⚠️
..._multi_selectable/data_source_multi_selectable.tsx 78.94% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6211   +/-   ##
=======================================
  Coverage   67.42%   67.43%           
=======================================
  Files        3362     3364    +2     
  Lines       65258    65311   +53     
  Branches    10524    10534   +10     
=======================================
+ Hits        43999    44041   +42     
- Misses      18701    18705    +4     
- Partials     2558     2565    +7     
Flag Coverage Δ
Linux_1 32.06% <ø> (ø)
Linux_2 55.57% <ø> (ø)
Linux_3 44.89% <73.58%> (+0.05%) ⬆️
Linux_4 34.98% <3.77%> (-0.05%) ⬇️
Windows_1 32.08% <ø> (ø)
Windows_2 55.53% <ø> (ø)
Windows_3 44.89% <73.58%> (+0.04%) ⬆️
Windows_4 34.98% <3.77%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BionIT BionIT added the v2.14.0 label Mar 20, 2024
Signed-off-by: Lu Yu <[email protected]>
@BionIT BionIT requested a review from xinruiba as a code owner March 21, 2024 05:18
]);

const input = screen.getByTestId('dataSourceMultiSelectFieldSearch');
fireEvent.change(input, { target: { value: 'randome input' } });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

random? not randome

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Flyingliuhub! Good catch! Fixed typo in new commit!

Flyingliuhub
Flyingliuhub previously approved these changes Mar 26, 2024
Signed-off-by: Lu Yu <[email protected]>
@BionIT BionIT merged commit 6aa59b2 into opensearch-project:main Mar 26, 2024
68 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-6211-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6aa59b246a9b835387eba7a3895b58b9fc7ac74e
# Push it to GitHub
git push --set-upstream origin backport/backport-6211-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-6211-to-2.x.

BionIT added a commit to BionIT/OpenSearch-Dashboards that referenced this pull request Apr 2, 2024
…nsearch-project#6211)

* add multi selectable data source component

Signed-off-by: Lu Yu <[email protected]>

* update change log

Signed-off-by: Lu Yu <[email protected]>

* add tests

Signed-off-by: Lu Yu <[email protected]>

* add more test

Signed-off-by: Lu Yu <[email protected]>

* refactor to add config

Signed-off-by: Lu Yu <[email protected]>

* fix typo

Signed-off-by: Lu Yu <[email protected]>

* update snapshot

Signed-off-by: Lu Yu <[email protected]>

* add missing interface

Signed-off-by: Lu Yu <[email protected]>

---------

Signed-off-by: Lu Yu <[email protected]>
BionIT added a commit that referenced this pull request Apr 3, 2024
…) (#6318)

* add multi selectable data source component



* update change log



* add tests



* add more test



* refactor to add config



* fix typo



* update snapshot



* add missing interface



---------

Signed-off-by: Lu Yu <[email protected]>
@huyaboo huyaboo added multiple datasource multiple datasource project and removed failed backport labels Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants