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] Move data source selectable to its own folder, fix test and a few type errors for data source selectable component #6287

Merged
merged 4 commits into from
Apr 2, 2024

Conversation

BionIT
Copy link
Collaborator

@BionIT BionIT commented Mar 28, 2024

Description

This change moves data source selectable to its own folder, fix test and a few type errors for data source selectable component

Issues Resolved

Screenshot

dsselectable.mp4

Testing the changes

The following were performed in the video:

  1. enable data source
  2. go to search relevance which mounted data source selectable component, select a data source from the menu, and it should show the option as selected and also reflect in the button text

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 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.47%. Comparing base (8810f08) to head (ae6afb6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6287   +/-   ##
=======================================
  Coverage   67.47%   67.47%           
=======================================
  Files        3368     3368           
  Lines       65431    65433    +2     
  Branches    10560    10561    +1     
=======================================
+ Hits        44147    44152    +5     
+ Misses      18713    18709    -4     
- Partials     2571     2572    +1     
Flag Coverage Δ
Linux_1 32.14% <ø> (ø)
Linux_2 55.58% <ø> (ø)
Linux_3 44.93% <100.00%> (+0.02%) ⬆️
Linux_4 35.07% <0.00%> (-0.01%) ⬇️
Windows_1 32.16% <ø> (ø)
Windows_2 55.55% <ø> (ø)
Windows_3 44.93% <100.00%> (+0.01%) ⬆️
Windows_4 35.07% <0.00%> (-0.01%) ⬇️

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.

CHANGELOG.md Outdated
@@ -91,6 +91,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [BUG][MD]Expose picker using function in data source management plugin setup([#6030](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6030))
- [BUG][Multiple Datasource] Fix data source filter bug and add tests ([#6152](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6152))
- [BUG][Multiple Datasource] Fix obsolete snapshots for test within data source management plugin ([#6185](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6185))
- [Multiple Datasource] Move data source selectable to its own folder, fix test and a few type errors for data source selectable component ([#6287](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6287))
Copy link
Member

Choose a reason for hiding this comment

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

should we move this changelog to Refactoring section?

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 for pointing out @bandinib-amzn! Right! will change in new commit

@bandinib-amzn
Copy link
Member

Looks like codecov check is failing. Can you add/modify UT for uncovered lines? Thanks!

selectedOption?: SelectedDataSourceOption[];
}

interface SelectedDataSourceOption extends DataSourceOption {
Copy link
Member

Choose a reason for hiding this comment

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

nit:
non blocking comment.

Suggested change
interface SelectedDataSourceOption extends DataSourceOption {
interface SelectableDataSourceOption extends DataSourceOption {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it makes more sense to call it SelectedDataSourceOption


this.props.onSelectedDataSources([selectedDataSource]);
this.props.onSelectedDataSources([
Copy link
Member

Choose a reason for hiding this comment

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

nit:
non blocking comment~

Suggested change
this.props.onSelectedDataSources([
this.props.onSelectDataSources([

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It will be disruptive to change the props, plus I think onSelectedDataSources makes more sense

@bandinib-amzn
Copy link
Member

All checks were passing before rebase.

Signed-off-by: Lu Yu <nluyu@amazon.com>
Signed-off-by: Lu Yu <nluyu@amazon.com>
Signed-off-by: Lu Yu <nluyu@amazon.com>
Signed-off-by: Lu Yu <nluyu@amazon.com>
@BionIT BionIT merged commit e355297 into opensearch-project:main Apr 2, 2024
68 checks passed
@BionIT BionIT added backport 2.x multiple datasource multiple datasource project labels Apr 2, 2024
@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-6287-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e35529778c271616aa96356b6d8a240ad2cbce75
# Push it to GitHub
git push --set-upstream origin backport/backport-6287-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-6287-to-2.x.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 3, 2024
…fix test and a few type errors for data source selectable component (#6287)

* Move data source selectable to its own folder and fix test

Signed-off-by: Lu Yu <nluyu@amazon.com>

* add change log

Signed-off-by: Lu Yu <nluyu@amazon.com>

* add tests and relocate change log

Signed-off-by: Lu Yu <nluyu@amazon.com>

* fix snapshots

Signed-off-by: Lu Yu <nluyu@amazon.com>

---------

Signed-off-by: Lu Yu <nluyu@amazon.com>
(cherry picked from commit e355297)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
BionIT pushed a commit that referenced this pull request Apr 3, 2024
…fix test and a few type errors for data source selectable component (#6287) (#6322)

* Move data source selectable to its own folder and fix test

Signed-off-by: Lu Yu <nluyu@amazon.com>

* add change log

Signed-off-by: Lu Yu <nluyu@amazon.com>

* add tests and relocate change log

Signed-off-by: Lu Yu <nluyu@amazon.com>

* fix snapshots

Signed-off-by: Lu Yu <nluyu@amazon.com>

---------

Signed-off-by: Lu Yu <nluyu@amazon.com>
(cherry picked from commit e355297)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants