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

[MD] Expose a few properties for customize the appearance of the data source selector component #6057

Merged
merged 4 commits into from
Mar 7, 2024

Conversation

BionIT
Copy link
Collaborator

@BionIT BionIT commented Mar 6, 2024

Description

This change exposes a few properties like

  • defaultOption: the defaulted selected option when the component renders
  • placeholderText: the place holder text when the selected option is cleared, default is Select a data source
  • removePrepend: whether there will be a prepend
  • filterFn: the function that will be used to filter the data source options
  • compressed

Issues Resolved

Fixes #5992

Screenshot

customizepicker.mp4

Testing the changes

The following steps are performed in the recording above:

  1. enable data source plugin
  2. go to add sample data and data source picker should render correctly and import sample data from a data source should be successful, going to the dashboard, it should render correctly
  3. go to dev tools and data source picker should render correctly and query against a data source should return results
  4. go to add sample data to check the options without filtering, it should show the data source named noauth2
  5. go to query workbench plugin to check the options with filter to remove noauth2, and it should not show data source named noauth2, query using the selected data source is successful
  6. go to search relevance plugin to check the removePrepend which is true and means no prepend should show, and defaultOption which is empty thus placeholder text should show

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

BionIT added 2 commits March 6, 2024 21:51
@BionIT BionIT changed the title Expose a few properties for customize the appearance of the data source selector component [MD] Expose a few properties for customize the appearance of the data source selector component Mar 6, 2024
Signed-off-by: Lu Yu <[email protected]>
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

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

Project coverage is 67.13%. Comparing base (8839256) to head (e96af18).
Report is 1 commits behind head on main.

Files Patch % Lines
...ents/data_source_selector/data_source_selector.tsx 70.58% 0 Missing and 5 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6057   +/-   ##
=======================================
  Coverage   67.13%   67.13%           
=======================================
  Files        3318     3318           
  Lines       64021    64037   +16     
  Branches    10256    10266   +10     
=======================================
+ Hits        42981    42992   +11     
  Misses      18548    18548           
- Partials     2492     2497    +5     
Flag Coverage Δ
Linux_1 31.63% <ø> (ø)
Linux_2 55.20% <ø> (ø)
Linux_3 44.60% <75.00%> (+0.01%) ⬆️
Linux_4 35.14% <0.00%> (-0.02%) ⬇️
Windows_1 31.65% <ø> (ø)
Windows_2 55.17% <ø> (ø)
Windows_3 44.61% <75.00%> (+0.01%) ⬆️
Windows_4 35.14% <0.00%> (-0.02%) ⬇️

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 v2.13.0 backport 2.x multiple datasource multiple datasource project labels Mar 7, 2024
@BionIT BionIT merged commit 144c022 into opensearch-project:main Mar 7, 2024
76 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 7, 2024
… source selector component (#6057)

* allow customize picker

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

* fix placeholder

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

* add changelog

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

---------

Signed-off-by: Lu Yu <[email protected]>
(cherry picked from commit 144c022)
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 Mar 8, 2024
… source selector component (#6057) (#6063)

* allow customize picker

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

* fix placeholder

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

* add changelog

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

---------

Signed-off-by: Lu Yu <[email protected]>
(cherry picked from commit 144c022)
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.

[MD] Expose properties to allow customization for picker provided by data source plugin
4 participants