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

Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
…a plugin

Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
…ncements

Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
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 },

Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
ashwin-pc
ashwin-pc previously approved these changes Oct 5, 2023
Signed-off-by: Eric <menwe@amazon.com>
ashwin-pc
ashwin-pc previously approved these changes Oct 6, 2023
Signed-off-by: Eric <menwe@amazon.com>
@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 <menwe@amazon.com>

* initial commit for datasource service

Signed-off-by: Eric <menwe@amazon.com>

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

Signed-off-by: Eric <menwe@amazon.com>

* [Data Sources] Add datasource factory

Signed-off-by: Eric <menwe@amazon.com>

* datasource service

Signed-off-by: Eric <menwe@amazon.com>

* datasource with factory

Signed-off-by: Eric <menwe@amazon.com>

* datasource selector

Signed-off-by: Eric <menwe@amazon.com>

* exposes datasources from data plugin

Signed-off-by: Eric <menwe@amazon.com>

* index pattern datasource registration

Signed-off-by: Eric <menwe@amazon.com>

* add datasource selector to discover

Signed-off-by: Eric <menwe@amazon.com>

* remove unused files

Signed-off-by: Eric <menwe@amazon.com>

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

Signed-off-by: Eric <menwe@amazon.com>

* add datasource selector unit tests

Signed-off-by: Eric <menwe@amazon.com>

* add metadata to selectable

Signed-off-by: Eric <menwe@amazon.com>

* redirection to observability for non-index-pattern datasource

Signed-off-by: Eric <menwe@amazon.com>

* add datasource factory tests

Signed-off-by: Eric <menwe@amazon.com>

* add datasource service test

Signed-off-by: Eric <menwe@amazon.com>

* datasources related fixes

Signed-off-by: Eric <menwe@amazon.com>

* add tests for datasource selectable

Signed-off-by: Eric <menwe@amazon.com>

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

Signed-off-by: Eric <menwe@amazon.com>

* remove pill effect

Signed-off-by: Eric <menwe@amazon.com>

* change type for name display in selector for index patterns

Signed-off-by: Eric <menwe@amazon.com>

* remove legacy index selector

Signed-off-by: Eric <menwe@amazon.com>

* rename datasource change handler

Signed-off-by: Eric <menwe@amazon.com>

* remove unused constants

Signed-off-by: Eric <menwe@amazon.com>

* fix a redirection bug

Signed-off-by: Eric <menwe@amazon.com>

* add to change log

Signed-off-by: Eric <menwe@amazon.com>

* fix bg color issue in source selector

Signed-off-by: Eric <menwe@amazon.com>

* address oui and missing guard

Signed-off-by: Eric <menwe@amazon.com>

* add test subj

Signed-off-by: Eric <menwe@amazon.com>

* i18 and datasource interface default return

Signed-off-by: Eric <menwe@amazon.com>

* add default datasource tests

Signed-off-by: Eric <menwe@amazon.com>

* fix typo

Signed-off-by: Eric <menwe@amazon.com>

* modify wording

Signed-off-by: Eric <menwe@amazon.com>

* add experimental annotation to datasource

Signed-off-by: Eric <menwe@amazon.com>

* add type datasource filtering to remove type error hint

Signed-off-by: Eric <menwe@amazon.com>

* remove unused type

Signed-off-by: Eric <menwe@amazon.com>

* add 'type' to option type

Signed-off-by: Eric <menwe@amazon.com>

* Type fixes

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

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

Signed-off-by: Eric <menwe@amazon.com>

* add one type exports

Signed-off-by: Eric <menwe@amazon.com>

* remaining type errors fixed

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* addressing comments

Signed-off-by: Eric <menwe@amazon.com>

* address dedup

Signed-off-by: Eric <menwe@amazon.com>

* refactor datasource_selectable to address comments

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* remove unnecessary optional chaining

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* refactor variable names

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* move functnions out of selectable component

Signed-off-by: Eric <menwe@amazon.com>

* add comments for dedup/options list updates

Signed-off-by: Eric <menwe@amazon.com>

* add experimental annotation

Signed-off-by: Eric <menwe@amazon.com>

* callback and experimental annotation on types

Signed-off-by: Eric <menwe@amazon.com>

* handleSourceSelection callback

Signed-off-by: Eric <menwe@amazon.com>

* datasource annotation and import adjustment

Signed-off-by: Eric <menwe@amazon.com>

* remove pill effect

Signed-off-by: Eric <menwe@amazon.com>

* minor changes addressing latest comments

Signed-off-by: Eric <menwe@amazon.com>

* remove unused tests

Signed-off-by: Eric <menwe@amazon.com>

---------

Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Co-authored-by: Josh Romero <rmerqg@amazon.com>
Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com>
Co-authored-by: Joshua Li <joshuali925@gmail.com>
(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 <menwe@amazon.com>

* initial commit for datasource service

Signed-off-by: Eric <menwe@amazon.com>

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

Signed-off-by: Eric <menwe@amazon.com>

* [Data Sources] Add datasource factory

Signed-off-by: Eric <menwe@amazon.com>

* datasource service

Signed-off-by: Eric <menwe@amazon.com>

* datasource with factory

Signed-off-by: Eric <menwe@amazon.com>

* datasource selector

Signed-off-by: Eric <menwe@amazon.com>

* exposes datasources from data plugin

Signed-off-by: Eric <menwe@amazon.com>

* index pattern datasource registration

Signed-off-by: Eric <menwe@amazon.com>

* add datasource selector to discover

Signed-off-by: Eric <menwe@amazon.com>

* remove unused files

Signed-off-by: Eric <menwe@amazon.com>

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

Signed-off-by: Eric <menwe@amazon.com>

* add datasource selector unit tests

Signed-off-by: Eric <menwe@amazon.com>

* add metadata to selectable

Signed-off-by: Eric <menwe@amazon.com>

* redirection to observability for non-index-pattern datasource

Signed-off-by: Eric <menwe@amazon.com>

* add datasource factory tests

Signed-off-by: Eric <menwe@amazon.com>

* add datasource service test

Signed-off-by: Eric <menwe@amazon.com>

* datasources related fixes

Signed-off-by: Eric <menwe@amazon.com>

* add tests for datasource selectable

Signed-off-by: Eric <menwe@amazon.com>

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

Signed-off-by: Eric <menwe@amazon.com>

* remove pill effect

Signed-off-by: Eric <menwe@amazon.com>

* change type for name display in selector for index patterns

Signed-off-by: Eric <menwe@amazon.com>

* remove legacy index selector

Signed-off-by: Eric <menwe@amazon.com>

* rename datasource change handler

Signed-off-by: Eric <menwe@amazon.com>

* remove unused constants

Signed-off-by: Eric <menwe@amazon.com>

* fix a redirection bug

Signed-off-by: Eric <menwe@amazon.com>

* add to change log

Signed-off-by: Eric <menwe@amazon.com>

* fix bg color issue in source selector

Signed-off-by: Eric <menwe@amazon.com>

* address oui and missing guard

Signed-off-by: Eric <menwe@amazon.com>

* add test subj

Signed-off-by: Eric <menwe@amazon.com>

* i18 and datasource interface default return

Signed-off-by: Eric <menwe@amazon.com>

* add default datasource tests

Signed-off-by: Eric <menwe@amazon.com>

* fix typo

Signed-off-by: Eric <menwe@amazon.com>

* modify wording

Signed-off-by: Eric <menwe@amazon.com>

* add experimental annotation to datasource

Signed-off-by: Eric <menwe@amazon.com>

* add type datasource filtering to remove type error hint

Signed-off-by: Eric <menwe@amazon.com>

* remove unused type

Signed-off-by: Eric <menwe@amazon.com>

* add 'type' to option type

Signed-off-by: Eric <menwe@amazon.com>

* Type fixes

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

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

Signed-off-by: Eric <menwe@amazon.com>

* add one type exports

Signed-off-by: Eric <menwe@amazon.com>

* remaining type errors fixed

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* addressing comments

Signed-off-by: Eric <menwe@amazon.com>

* address dedup

Signed-off-by: Eric <menwe@amazon.com>

* refactor datasource_selectable to address comments

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* remove unnecessary optional chaining

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* refactor variable names

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* move functnions out of selectable component

Signed-off-by: Eric <menwe@amazon.com>

* add comments for dedup/options list updates

Signed-off-by: Eric <menwe@amazon.com>

* add experimental annotation

Signed-off-by: Eric <menwe@amazon.com>

* callback and experimental annotation on types

Signed-off-by: Eric <menwe@amazon.com>

* handleSourceSelection callback

Signed-off-by: Eric <menwe@amazon.com>

* datasource annotation and import adjustment

Signed-off-by: Eric <menwe@amazon.com>

* remove pill effect

Signed-off-by: Eric <menwe@amazon.com>

* minor changes addressing latest comments

Signed-off-by: Eric <menwe@amazon.com>

* remove unused tests

Signed-off-by: Eric <menwe@amazon.com>

---------

Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Co-authored-by: Josh Romero <rmerqg@amazon.com>
Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com>
Co-authored-by: Joshua Li <joshuali925@gmail.com>
(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 <menwe@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
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 <rmerqg@amazon.com>
Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com>
Co-authored-by: Joshua Li <joshuali925@gmail.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 <menwe@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
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 <rmerqg@amazon.com>
Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com>
Co-authored-by: Joshua Li <joshuali925@gmail.com>
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 <menwe@amazon.com>

* initial commit for datasource service

Signed-off-by: Eric <menwe@amazon.com>

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

Signed-off-by: Eric <menwe@amazon.com>

* [Data Sources] Add datasource factory

Signed-off-by: Eric <menwe@amazon.com>

* datasource service

Signed-off-by: Eric <menwe@amazon.com>

* datasource with factory

Signed-off-by: Eric <menwe@amazon.com>

* datasource selector

Signed-off-by: Eric <menwe@amazon.com>

* exposes datasources from data plugin

Signed-off-by: Eric <menwe@amazon.com>

* index pattern datasource registration

Signed-off-by: Eric <menwe@amazon.com>

* add datasource selector to discover

Signed-off-by: Eric <menwe@amazon.com>

* remove unused files

Signed-off-by: Eric <menwe@amazon.com>

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

Signed-off-by: Eric <menwe@amazon.com>

* add datasource selector unit tests

Signed-off-by: Eric <menwe@amazon.com>

* add metadata to selectable

Signed-off-by: Eric <menwe@amazon.com>

* redirection to observability for non-index-pattern datasource

Signed-off-by: Eric <menwe@amazon.com>

* add datasource factory tests

Signed-off-by: Eric <menwe@amazon.com>

* add datasource service test

Signed-off-by: Eric <menwe@amazon.com>

* datasources related fixes

Signed-off-by: Eric <menwe@amazon.com>

* add tests for datasource selectable

Signed-off-by: Eric <menwe@amazon.com>

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

Signed-off-by: Eric <menwe@amazon.com>

* remove pill effect

Signed-off-by: Eric <menwe@amazon.com>

* change type for name display in selector for index patterns

Signed-off-by: Eric <menwe@amazon.com>

* remove legacy index selector

Signed-off-by: Eric <menwe@amazon.com>

* rename datasource change handler

Signed-off-by: Eric <menwe@amazon.com>

* remove unused constants

Signed-off-by: Eric <menwe@amazon.com>

* fix a redirection bug

Signed-off-by: Eric <menwe@amazon.com>

* add to change log

Signed-off-by: Eric <menwe@amazon.com>

* fix bg color issue in source selector

Signed-off-by: Eric <menwe@amazon.com>

* address oui and missing guard

Signed-off-by: Eric <menwe@amazon.com>

* add test subj

Signed-off-by: Eric <menwe@amazon.com>

* i18 and datasource interface default return

Signed-off-by: Eric <menwe@amazon.com>

* add default datasource tests

Signed-off-by: Eric <menwe@amazon.com>

* fix typo

Signed-off-by: Eric <menwe@amazon.com>

* modify wording

Signed-off-by: Eric <menwe@amazon.com>

* add experimental annotation to datasource

Signed-off-by: Eric <menwe@amazon.com>

* add type datasource filtering to remove type error hint

Signed-off-by: Eric <menwe@amazon.com>

* remove unused type

Signed-off-by: Eric <menwe@amazon.com>

* add 'type' to option type

Signed-off-by: Eric <menwe@amazon.com>

* Type fixes

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

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

Signed-off-by: Eric <menwe@amazon.com>

* add one type exports

Signed-off-by: Eric <menwe@amazon.com>

* remaining type errors fixed

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* addressing comments

Signed-off-by: Eric <menwe@amazon.com>

* address dedup

Signed-off-by: Eric <menwe@amazon.com>

* refactor datasource_selectable to address comments

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* remove unnecessary optional chaining

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* refactor variable names

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* move functnions out of selectable component

Signed-off-by: Eric <menwe@amazon.com>

* add comments for dedup/options list updates

Signed-off-by: Eric <menwe@amazon.com>

* add experimental annotation

Signed-off-by: Eric <menwe@amazon.com>

* callback and experimental annotation on types

Signed-off-by: Eric <menwe@amazon.com>

* handleSourceSelection callback

Signed-off-by: Eric <menwe@amazon.com>

* datasource annotation and import adjustment

Signed-off-by: Eric <menwe@amazon.com>

* remove pill effect

Signed-off-by: Eric <menwe@amazon.com>

* minor changes addressing latest comments

Signed-off-by: Eric <menwe@amazon.com>

* remove unused tests

Signed-off-by: Eric <menwe@amazon.com>

---------

Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Co-authored-by: Josh Romero <rmerqg@amazon.com>
Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com>
Co-authored-by: Joshua Li <joshuali925@gmail.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.

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