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

Add datasource picker component and use it in devtools and tutorial page when multiple datasource is enabled #5756

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

BionIT
Copy link
Collaborator

@BionIT BionIT commented Jan 30, 2024

Description

This resolves #5717.
The datasource picker has different behavior in devtools and tutorial page when multiple datasource is enabled, it should be one component to ensure the behavior is the same.

This change adds datasource picker component and use it in devtools and tutorial page when multiple datasource is enabled to unify the behavior: the default option for the picker when first opening the page with the picker should be Local cluster. After removing the option, it should display Select a data source. Also, the prepend should be Data source instead of DataSource

Issues Resolved

fixes #5717

Screenshot

feat.mp4

Testing the changes

  1. If data_source.enabled is false, then data source picker doesn't show up in devtools nor add sample data page.
  2. Change data_source.enabled to true will turn on multiple datasource
  3. Go to devtools page, the datasource picker should appear on top right, with Local cluster chosen as the default option. Choose the local data source, query data should be successful, choose remote data source, query data should be successful
  4. Go to add sample data page, the datasource picker should appear, with Local cluster chosen as the default option. Choose the local data source, add sample data should be successful, choose remote data source, add sample data should be successful

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 Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f8ee03a) 67.03% compared to head (4e83603) 67.03%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5756   +/-   ##
=======================================
  Coverage   67.03%   67.03%           
=======================================
  Files        3296     3296           
  Lines       63343    63343           
  Branches    10087    10087           
=======================================
  Hits        42463    42463           
  Misses      18430    18430           
  Partials     2450     2450           
Flag Coverage Δ
Linux_1 35.23% <ø> (ø)
Linux_2 55.18% <ø> (ø)
Linux_3 43.92% <ø> (ø)
Linux_4 35.33% <ø> (ø)
Windows_1 35.26% <ø> (ø)
Windows_2 55.15% <ø> (ø)
Windows_3 43.93% <ø> (ø)
Windows_4 35.33% <ø> (ø)

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.

@ZilongX ZilongX added the multiple datasource multiple datasource project label Jan 30, 2024
ZilongX
ZilongX previously approved these changes Jan 30, 2024
@bandinib-amzn
Copy link
Member

Thanks @BionIT for making this change. I really appreciate your efforts to unify the data source picker component and remove repetitive code. I can see the great value of this change from maintenance, consistent experience and reusability perspective.

@Flyingliuhub Flyingliuhub merged commit b2d2b26 into opensearch-project:main Jan 31, 2024
67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 31, 2024
…age when multiple datasource is enabled (#5756)

* add datasource picker as a component and use it in devtools and add sample data page

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

* add changelog for 5756

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

* wraps prepend with i18n and fix typo

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

---------

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

# Conflicts:
#	CHANGELOG.md
ananzh pushed a commit that referenced this pull request Jan 31, 2024
…age when multiple datasource is enabled (#5756) (#5759)

* add datasource picker as a component and use it in devtools and add sample data page
* wraps prepend with i18n and fix typo

---------

Signed-off-by: Lu Yu <[email protected]>
(cherry picked from commit b2d2b26)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
yujin-emma pushed a commit to yujin-emma/OpenSearch-Dashboards that referenced this pull request Feb 5, 2024
…age when multiple datasource is enabled (opensearch-project#5756)

* add datasource picker as a component and use it in devtools and add sample data page

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

* add changelog for 5756

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

* wraps prepend with i18n and fix typo

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

---------

Signed-off-by: Lu Yu <[email protected]>
Signed-off-by: yujin-emma <[email protected]>
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.

[MD] Data source picker should have same behavior in devtool, tutorial, etc where it is used
4 participants