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

[Feature] Datasource selector of multiple datasources #5167

Merged

Conversation

mengweieric
Copy link
Collaborator

@mengweieric mengweieric commented Oct 2, 2023

Description

Datasource selector support in OpenSearch Dashboard Discover

Issues Resolved

fixes #4482, #4991

Screenshot

Screenshot 2023-10-01 at 8 13 59 PM

Testing the changes

Check List

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

Copy link
Member

@ashwin-pc ashwin-pc left a comment

Choose a reason for hiding this comment

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

Just one last experimental label was missed, the rest look good.

Comment on lines 51 to 56
const ip = dataSet as IndexPatternOption;
return {
...optionContent,
label: ip.title,
value: ip.id,
};
Copy link
Member

Choose a reason for hiding this comment

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

Nit:

Suggested change
const ip = dataSet as IndexPatternOption;
return {
...optionContent,
label: ip.title,
value: ip.id,
};
return {
...optionContent,
label: dataSet.title,
value: dataSet.id,
};

onDataSourceSelect,
setDataSourceOptionList,
onGetDataSetError, // onGetDataSetError, Callback for handling get data set errors. Ensure it's memoized.
singleSelection = true,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
singleSelection = true,
singleSelection = { asPlainText: true },

ashwin-pc
ashwin-pc previously approved these changes Oct 5, 2023
ashwin-pc
ashwin-pc previously approved these changes Oct 6, 2023
@ashwin-pc ashwin-pc merged commit 1e980fa into opensearch-project:main Oct 6, 2023
54 of 55 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 6, 2023
* initial commit for datasource

Signed-off-by: Eric <[email protected]>

* initial commit for datasource service

Signed-off-by: Eric <[email protected]>

* [Data Sources] Move datasource codebase from datasource plugin to data plugin

Signed-off-by: Eric <[email protected]>

* [Data Sources] Add datasource factory

Signed-off-by: Eric <[email protected]>

* datasource service

Signed-off-by: Eric <[email protected]>

* datasource with factory

Signed-off-by: Eric <[email protected]>

* datasource selector

Signed-off-by: Eric <[email protected]>

* exposes datasources from data plugin

Signed-off-by: Eric <[email protected]>

* index pattern datasource registration

Signed-off-by: Eric <[email protected]>

* add datasource selector to discover

Signed-off-by: Eric <[email protected]>

* remove unused files

Signed-off-by: Eric <[email protected]>

* add/exposes types for datasources as a set of services

Signed-off-by: Eric <[email protected]>

* add datasource selector unit tests

Signed-off-by: Eric <[email protected]>

* add metadata to selectable

Signed-off-by: Eric <[email protected]>

* redirection to observability for non-index-pattern datasource

Signed-off-by: Eric <[email protected]>

* add datasource factory tests

Signed-off-by: Eric <[email protected]>

* add datasource service test

Signed-off-by: Eric <[email protected]>

* datasources related fixes

Signed-off-by: Eric <[email protected]>

* add tests for datasource selectable

Signed-off-by: Eric <[email protected]>

* added types/interfaces for sidebar selector, and add a couple of enhancements

Signed-off-by: Eric <[email protected]>

* remove pill effect

Signed-off-by: Eric <[email protected]>

* change type for name display in selector for index patterns

Signed-off-by: Eric <[email protected]>

* remove legacy index selector

Signed-off-by: Eric <[email protected]>

* rename datasource change handler

Signed-off-by: Eric <[email protected]>

* remove unused constants

Signed-off-by: Eric <[email protected]>

* fix a redirection bug

Signed-off-by: Eric <[email protected]>

* add to change log

Signed-off-by: Eric <[email protected]>

* fix bg color issue in source selector

Signed-off-by: Eric <[email protected]>

* address oui and missing guard

Signed-off-by: Eric <[email protected]>

* add test subj

Signed-off-by: Eric <[email protected]>

* i18 and datasource interface default return

Signed-off-by: Eric <[email protected]>

* add default datasource tests

Signed-off-by: Eric <[email protected]>

* fix typo

Signed-off-by: Eric <[email protected]>

* modify wording

Signed-off-by: Eric <[email protected]>

* add experimental annotation to datasource

Signed-off-by: Eric <[email protected]>

* add type datasource filtering to remove type error hint

Signed-off-by: Eric <[email protected]>

* remove unused type

Signed-off-by: Eric <[email protected]>

* add 'type' to option type

Signed-off-by: Eric <[email protected]>

* Type fixes

Signed-off-by: Ashwin P Chandran <[email protected]>

* cherry-pick type changes from remote and add partial fixes

Signed-off-by: Eric <[email protected]>

* add one type exports

Signed-off-by: Eric <[email protected]>

* remaining type errors fixed

Signed-off-by: Ashwin P Chandran <[email protected]>

* addressing comments

Signed-off-by: Eric <[email protected]>

* address dedup

Signed-off-by: Eric <[email protected]>

* refactor datasource_selectable to address comments

Signed-off-by: Joshua Li <[email protected]>

* remove unnecessary optional chaining

Signed-off-by: Joshua Li <[email protected]>

* refactor variable names

Signed-off-by: Joshua Li <[email protected]>

* move functnions out of selectable component

Signed-off-by: Eric <[email protected]>

* add comments for dedup/options list updates

Signed-off-by: Eric <[email protected]>

* add experimental annotation

Signed-off-by: Eric <[email protected]>

* callback and experimental annotation on types

Signed-off-by: Eric <[email protected]>

* handleSourceSelection callback

Signed-off-by: Eric <[email protected]>

* datasource annotation and import adjustment

Signed-off-by: Eric <[email protected]>

* remove pill effect

Signed-off-by: Eric <[email protected]>

* minor changes addressing latest comments

Signed-off-by: Eric <[email protected]>

* remove unused tests

Signed-off-by: Eric <[email protected]>

---------

Signed-off-by: Eric <[email protected]>
Signed-off-by: Ashwin P Chandran <[email protected]>
Signed-off-by: Joshua Li <[email protected]>
Co-authored-by: Josh Romero <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
Co-authored-by: Joshua Li <[email protected]>
(cherry picked from commit 1e980fa)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@mengweieric mengweieric deleted the feature/mul-data-source branch October 6, 2023 02:53
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 6, 2023
* initial commit for datasource

Signed-off-by: Eric <[email protected]>

* initial commit for datasource service

Signed-off-by: Eric <[email protected]>

* [Data Sources] Move datasource codebase from datasource plugin to data plugin

Signed-off-by: Eric <[email protected]>

* [Data Sources] Add datasource factory

Signed-off-by: Eric <[email protected]>

* datasource service

Signed-off-by: Eric <[email protected]>

* datasource with factory

Signed-off-by: Eric <[email protected]>

* datasource selector

Signed-off-by: Eric <[email protected]>

* exposes datasources from data plugin

Signed-off-by: Eric <[email protected]>

* index pattern datasource registration

Signed-off-by: Eric <[email protected]>

* add datasource selector to discover

Signed-off-by: Eric <[email protected]>

* remove unused files

Signed-off-by: Eric <[email protected]>

* add/exposes types for datasources as a set of services

Signed-off-by: Eric <[email protected]>

* add datasource selector unit tests

Signed-off-by: Eric <[email protected]>

* add metadata to selectable

Signed-off-by: Eric <[email protected]>

* redirection to observability for non-index-pattern datasource

Signed-off-by: Eric <[email protected]>

* add datasource factory tests

Signed-off-by: Eric <[email protected]>

* add datasource service test

Signed-off-by: Eric <[email protected]>

* datasources related fixes

Signed-off-by: Eric <[email protected]>

* add tests for datasource selectable

Signed-off-by: Eric <[email protected]>

* added types/interfaces for sidebar selector, and add a couple of enhancements

Signed-off-by: Eric <[email protected]>

* remove pill effect

Signed-off-by: Eric <[email protected]>

* change type for name display in selector for index patterns

Signed-off-by: Eric <[email protected]>

* remove legacy index selector

Signed-off-by: Eric <[email protected]>

* rename datasource change handler

Signed-off-by: Eric <[email protected]>

* remove unused constants

Signed-off-by: Eric <[email protected]>

* fix a redirection bug

Signed-off-by: Eric <[email protected]>

* add to change log

Signed-off-by: Eric <[email protected]>

* fix bg color issue in source selector

Signed-off-by: Eric <[email protected]>

* address oui and missing guard

Signed-off-by: Eric <[email protected]>

* add test subj

Signed-off-by: Eric <[email protected]>

* i18 and datasource interface default return

Signed-off-by: Eric <[email protected]>

* add default datasource tests

Signed-off-by: Eric <[email protected]>

* fix typo

Signed-off-by: Eric <[email protected]>

* modify wording

Signed-off-by: Eric <[email protected]>

* add experimental annotation to datasource

Signed-off-by: Eric <[email protected]>

* add type datasource filtering to remove type error hint

Signed-off-by: Eric <[email protected]>

* remove unused type

Signed-off-by: Eric <[email protected]>

* add 'type' to option type

Signed-off-by: Eric <[email protected]>

* Type fixes

Signed-off-by: Ashwin P Chandran <[email protected]>

* cherry-pick type changes from remote and add partial fixes

Signed-off-by: Eric <[email protected]>

* add one type exports

Signed-off-by: Eric <[email protected]>

* remaining type errors fixed

Signed-off-by: Ashwin P Chandran <[email protected]>

* addressing comments

Signed-off-by: Eric <[email protected]>

* address dedup

Signed-off-by: Eric <[email protected]>

* refactor datasource_selectable to address comments

Signed-off-by: Joshua Li <[email protected]>

* remove unnecessary optional chaining

Signed-off-by: Joshua Li <[email protected]>

* refactor variable names

Signed-off-by: Joshua Li <[email protected]>

* move functnions out of selectable component

Signed-off-by: Eric <[email protected]>

* add comments for dedup/options list updates

Signed-off-by: Eric <[email protected]>

* add experimental annotation

Signed-off-by: Eric <[email protected]>

* callback and experimental annotation on types

Signed-off-by: Eric <[email protected]>

* handleSourceSelection callback

Signed-off-by: Eric <[email protected]>

* datasource annotation and import adjustment

Signed-off-by: Eric <[email protected]>

* remove pill effect

Signed-off-by: Eric <[email protected]>

* minor changes addressing latest comments

Signed-off-by: Eric <[email protected]>

* remove unused tests

Signed-off-by: Eric <[email protected]>

---------

Signed-off-by: Eric <[email protected]>
Signed-off-by: Ashwin P Chandran <[email protected]>
Signed-off-by: Joshua Li <[email protected]>
Co-authored-by: Josh Romero <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
Co-authored-by: Joshua Li <[email protected]>
(cherry picked from commit 1e980fa)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
joshuarrrr added a commit that referenced this pull request Oct 6, 2023
* initial commit for datasource



* initial commit for datasource service



* [Data Sources] Move datasource codebase from datasource plugin to data plugin



* [Data Sources] Add datasource factory



* datasource service



* datasource with factory



* datasource selector



* exposes datasources from data plugin



* index pattern datasource registration



* add datasource selector to discover



* remove unused files



* add/exposes types for datasources as a set of services



* add datasource selector unit tests



* add metadata to selectable



* redirection to observability for non-index-pattern datasource



* add datasource factory tests



* add datasource service test



* datasources related fixes



* add tests for datasource selectable



* added types/interfaces for sidebar selector, and add a couple of enhancements



* remove pill effect



* change type for name display in selector for index patterns



* remove legacy index selector



* rename datasource change handler



* remove unused constants



* fix a redirection bug



* add to change log



* fix bg color issue in source selector



* address oui and missing guard



* add test subj



* i18 and datasource interface default return



* add default datasource tests



* fix typo



* modify wording



* add experimental annotation to datasource



* add type datasource filtering to remove type error hint



* remove unused type



* add 'type' to option type



* Type fixes



* cherry-pick type changes from remote and add partial fixes



* add one type exports



* remaining type errors fixed



* addressing comments



* address dedup



* refactor datasource_selectable to address comments



* remove unnecessary optional chaining



* refactor variable names



* move functnions out of selectable component



* add comments for dedup/options list updates



* add experimental annotation



* callback and experimental annotation on types



* handleSourceSelection callback



* datasource annotation and import adjustment



* remove pill effect



* minor changes addressing latest comments



* remove unused tests



---------







(cherry picked from commit 1e980fa)

Signed-off-by: Eric <[email protected]>
Signed-off-by: Ashwin P Chandran <[email protected]>
Signed-off-by: Joshua Li <[email protected]>
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>
Co-authored-by: Josh Romero <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
Co-authored-by: Joshua Li <[email protected]>
joshuarrrr added a commit that referenced this pull request Oct 6, 2023
* initial commit for datasource



* initial commit for datasource service



* [Data Sources] Move datasource codebase from datasource plugin to data plugin



* [Data Sources] Add datasource factory



* datasource service



* datasource with factory



* datasource selector



* exposes datasources from data plugin



* index pattern datasource registration



* add datasource selector to discover



* remove unused files



* add/exposes types for datasources as a set of services



* add datasource selector unit tests



* add metadata to selectable



* redirection to observability for non-index-pattern datasource



* add datasource factory tests



* add datasource service test



* datasources related fixes



* add tests for datasource selectable



* added types/interfaces for sidebar selector, and add a couple of enhancements



* remove pill effect



* change type for name display in selector for index patterns



* remove legacy index selector



* rename datasource change handler



* remove unused constants



* fix a redirection bug



* add to change log



* fix bg color issue in source selector



* address oui and missing guard



* add test subj



* i18 and datasource interface default return



* add default datasource tests



* fix typo



* modify wording



* add experimental annotation to datasource



* add type datasource filtering to remove type error hint



* remove unused type



* add 'type' to option type



* Type fixes



* cherry-pick type changes from remote and add partial fixes



* add one type exports



* remaining type errors fixed



* addressing comments



* address dedup



* refactor datasource_selectable to address comments



* remove unnecessary optional chaining



* refactor variable names



* move functnions out of selectable component



* add comments for dedup/options list updates



* add experimental annotation



* callback and experimental annotation on types



* handleSourceSelection callback



* datasource annotation and import adjustment



* remove pill effect



* minor changes addressing latest comments



* remove unused tests



---------







(cherry picked from commit 1e980fa)

Signed-off-by: Eric <[email protected]>
Signed-off-by: Ashwin P Chandran <[email protected]>
Signed-off-by: Joshua Li <[email protected]>
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>
Co-authored-by: Josh Romero <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
Co-authored-by: Joshua Li <[email protected]>
SuZhou-Joe pushed a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this pull request Oct 7, 2023
…ject#5167)

* initial commit for datasource

Signed-off-by: Eric <[email protected]>

* initial commit for datasource service

Signed-off-by: Eric <[email protected]>

* [Data Sources] Move datasource codebase from datasource plugin to data plugin

Signed-off-by: Eric <[email protected]>

* [Data Sources] Add datasource factory

Signed-off-by: Eric <[email protected]>

* datasource service

Signed-off-by: Eric <[email protected]>

* datasource with factory

Signed-off-by: Eric <[email protected]>

* datasource selector

Signed-off-by: Eric <[email protected]>

* exposes datasources from data plugin

Signed-off-by: Eric <[email protected]>

* index pattern datasource registration

Signed-off-by: Eric <[email protected]>

* add datasource selector to discover

Signed-off-by: Eric <[email protected]>

* remove unused files

Signed-off-by: Eric <[email protected]>

* add/exposes types for datasources as a set of services

Signed-off-by: Eric <[email protected]>

* add datasource selector unit tests

Signed-off-by: Eric <[email protected]>

* add metadata to selectable

Signed-off-by: Eric <[email protected]>

* redirection to observability for non-index-pattern datasource

Signed-off-by: Eric <[email protected]>

* add datasource factory tests

Signed-off-by: Eric <[email protected]>

* add datasource service test

Signed-off-by: Eric <[email protected]>

* datasources related fixes

Signed-off-by: Eric <[email protected]>

* add tests for datasource selectable

Signed-off-by: Eric <[email protected]>

* added types/interfaces for sidebar selector, and add a couple of enhancements

Signed-off-by: Eric <[email protected]>

* remove pill effect

Signed-off-by: Eric <[email protected]>

* change type for name display in selector for index patterns

Signed-off-by: Eric <[email protected]>

* remove legacy index selector

Signed-off-by: Eric <[email protected]>

* rename datasource change handler

Signed-off-by: Eric <[email protected]>

* remove unused constants

Signed-off-by: Eric <[email protected]>

* fix a redirection bug

Signed-off-by: Eric <[email protected]>

* add to change log

Signed-off-by: Eric <[email protected]>

* fix bg color issue in source selector

Signed-off-by: Eric <[email protected]>

* address oui and missing guard

Signed-off-by: Eric <[email protected]>

* add test subj

Signed-off-by: Eric <[email protected]>

* i18 and datasource interface default return

Signed-off-by: Eric <[email protected]>

* add default datasource tests

Signed-off-by: Eric <[email protected]>

* fix typo

Signed-off-by: Eric <[email protected]>

* modify wording

Signed-off-by: Eric <[email protected]>

* add experimental annotation to datasource

Signed-off-by: Eric <[email protected]>

* add type datasource filtering to remove type error hint

Signed-off-by: Eric <[email protected]>

* remove unused type

Signed-off-by: Eric <[email protected]>

* add 'type' to option type

Signed-off-by: Eric <[email protected]>

* Type fixes

Signed-off-by: Ashwin P Chandran <[email protected]>

* cherry-pick type changes from remote and add partial fixes

Signed-off-by: Eric <[email protected]>

* add one type exports

Signed-off-by: Eric <[email protected]>

* remaining type errors fixed

Signed-off-by: Ashwin P Chandran <[email protected]>

* addressing comments

Signed-off-by: Eric <[email protected]>

* address dedup

Signed-off-by: Eric <[email protected]>

* refactor datasource_selectable to address comments

Signed-off-by: Joshua Li <[email protected]>

* remove unnecessary optional chaining

Signed-off-by: Joshua Li <[email protected]>

* refactor variable names

Signed-off-by: Joshua Li <[email protected]>

* move functnions out of selectable component

Signed-off-by: Eric <[email protected]>

* add comments for dedup/options list updates

Signed-off-by: Eric <[email protected]>

* add experimental annotation

Signed-off-by: Eric <[email protected]>

* callback and experimental annotation on types

Signed-off-by: Eric <[email protected]>

* handleSourceSelection callback

Signed-off-by: Eric <[email protected]>

* datasource annotation and import adjustment

Signed-off-by: Eric <[email protected]>

* remove pill effect

Signed-off-by: Eric <[email protected]>

* minor changes addressing latest comments

Signed-off-by: Eric <[email protected]>

* remove unused tests

Signed-off-by: Eric <[email protected]>

---------

Signed-off-by: Eric <[email protected]>
Signed-off-by: Ashwin P Chandran <[email protected]>
Signed-off-by: Joshua Li <[email protected]>
Co-authored-by: Josh Romero <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
Co-authored-by: Joshua Li <[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.

UX proposal for an improved data source picker (v1)
6 participants