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

Refactor saved object management plugin to use datasourceManagement ui API to get DataSourceSelector #6544

Merged

Conversation

zhongnansu
Copy link
Member

@zhongnansu zhongnansu commented Apr 18, 2024

Description

  • Add dataSourceManagement as an optional plugin of saved obeect manamgent plugin
  • get picker compoenent by const DataSourceSelector = dataSourceManagement.ui , instead of direct inport
  • Make Datasource selector non-clearable
  • remove the usage of hideLocalCluster, and no need pass to DataSourceSelector as props
  • this change will also let the default label to be rendered successfully

Issues Resolved

#6369
fix #6546

Screenshot

Testing the changes

  • With datasource enabled and localCluster hidden and no avaliable data sources. It should disable the import button

image

  • With datasource enabled, and localCluster shown, no other avaliable data sources.
    image

  • With datasource enabled, and LocalCluster shown, with other data sources
    image

  • With data source disabled
    image

Changelog

  • refactor: refactor saved object management plugin to use datasourceManagement ui API to get DataSourceSelector

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
Contributor

❌ Empty Changelog Section

The Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section.

Copy link
Contributor

❌ Invalid Prefix

Invalid description prefix. Found "refactor saved object management plugin to use datasourceManagement ui API to get DataSourceSelector". Expected "breaking", "deprecate", "feat", "fix", "infra", "doc", "chore", "refactor", "security", "skip", or "test".

1 similar comment
Copy link
Contributor

❌ Invalid Prefix

Invalid description prefix. Found "refactor saved object management plugin to use datasourceManagement ui API to get DataSourceSelector". Expected "breaking", "deprecate", "feat", "fix", "infra", "doc", "chore", "refactor", "security", "skip", or "test".

Copy link
Contributor

❌ Invalid Prefix

Invalid description prefix. Found "refactor saved object management plugin to use datasourceManagement ui API to get DataSourceSelector". Expected "breaking", "deprecate", "feat", "fix", "infra", "doc", "chore", "refactor", "security", "skip", or "test".

1 similar comment
Copy link
Contributor

❌ Invalid Prefix

Invalid description prefix. Found "refactor saved object management plugin to use datasourceManagement ui API to get DataSourceSelector". Expected "breaking", "deprecate", "feat", "fix", "infra", "doc", "chore", "refactor", "security", "skip", or "test".

fullWidth={true}
isClearable={false}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

it was a new prop added by this PR https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6298/files, it's being passed to EuiComboBox
basically it make sure you can't clear the input, but you can switch to other option.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it.

@BionIT
Copy link
Collaborator

BionIT commented Apr 19, 2024

Can we add test details? Data source turn on and off, hide local cluster on and off, etc

@zhongnansu
Copy link
Member Author

zhongnansu commented Apr 19, 2024

Can we add test details? Data source turn on and off, hide local cluster on and off, etc

sure, updated PR description with more test details and screenshots

@zhongnansu zhongnansu force-pushed the md-refactor-saved-obejct-management branch from be613c3 to da174e4 Compare April 19, 2024 08:49
@ZilongX ZilongX merged commit 36a91dd into opensearch-project:main Apr 19, 2024
65 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 19, 2024
…i API to get DataSourceSelector (#6544)

* Refactor saved object management plugin to use datasourceManagement ui API get DataSourceSelector

Signed-off-by: Zhongnan Su <szhongna@amazon.com>

* Changeset file for PR #6544 created/updated

---------

Signed-off-by: Zhongnan Su <szhongna@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 36a91dd)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
BionIT pushed a commit that referenced this pull request Apr 19, 2024
…i API to get DataSourceSelector (#6544) (#6556)

* Refactor saved object management plugin to use datasourceManagement ui API get DataSourceSelector



* Changeset file for PR #6544 created/updated

---------



(cherry picked from commit 36a91dd)

Signed-off-by: Zhongnan Su <szhongna@amazon.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: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
LDrago27 pushed a commit to LDrago27/OpenSearch-Dashboards that referenced this pull request Jun 3, 2024
…i API to get DataSourceSelector (opensearch-project#6544)

* Refactor saved object management plugin to use datasourceManagement ui API get DataSourceSelector

Signed-off-by: Zhongnan Su <szhongna@amazon.com>

* Changeset file for PR opensearch-project#6544 created/updated

---------

Signed-off-by: Zhongnan Su <szhongna@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[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.

[BUG] import button should be disabled if no data source is selected
4 participants