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

[Workspace] Enable direct query connections to support in workspace #7839

Merged
merged 36 commits into from
Sep 2, 2024

Conversation

yubonluo
Copy link
Contributor

@yubonluo yubonluo commented Aug 26, 2024

Description

Enable direct query connections to support in workspace

  • Users can switch between the OpenSearch connectionsand Direct query connections buttons to display different types of data sources
  • Users(dashboard admin) can assign/unassign OpenSearch connections/Direct query connections data source
  • When user unassign OpenSearch connections , all the related Direct query connections will be unassigned.
  • No dashboard admin can not assign/unassign datasource

Issues Resolved

#7939

Screenshot

2024-08-29.00.08.43.mp4

Testing the changes

Changelog

  • fix: Enable direct query connections to support in workspace

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

Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
ruanyl
ruanyl previously approved these changes Aug 30, 2024
@@ -239,6 +246,46 @@ export const getDataSourcesList = (
});
};

export const getDirectQueryConnections = async (dataSourceId: string, http: HttpSetup) => {
Copy link
Member

Choose a reason for hiding this comment

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

Can we just reuse the function from DQC plugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The logic in DQC is coupled within the component(src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/manage_direct_query_data_connections_table.tsx

Copy link
Member

Choose a reason for hiding this comment

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

Nit: The best practice would be extract the logic to a util function, but I am OK that we leave it.

SuZhou-Joe
SuZhou-Joe previously approved these changes Aug 30, 2024
@yubonluo yubonluo dismissed stale reviews from SuZhou-Joe and ruanyl via c160ba2 August 30, 2024 09:42
wanglam and others added 4 commits August 30, 2024 17:48
Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
Add nested support in associate data source modal
Signed-off-by: yubonluo <[email protected]>
@yubonluo
Copy link
Contributor Author

HI @ruanyl @SuZhou-Joe, @wanglam has made a modification to the association modal. You can take a look when you have time. Thanks~

@ruanyl ruanyl merged commit 0798865 into opensearch-project:main Sep 2, 2024
67 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-7839-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 07988656279b7f696a2e008001300ca3c5c9ef2f
# Push it to GitHub
git push --set-upstream origin backport/backport-7839-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-7839-to-2.x.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 5, 2024
…7839)

* add dqc

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

* add dircet query connections on the detail page

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

* Changeset file for PR #7839 created/updated

* delete useless code

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

* optimize the code

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

* optimize the code

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

* Refactor association modal

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

* Integrate modal with workspace detail page

Signed-off-by: Lin Wang <[email protected]>

* Fix parent data source unchecked

Signed-off-by: Lin Wang <[email protected]>

* Remove all tab and sort connections by name alphabetical

Signed-off-by: Lin Wang <[email protected]>

* optimzie

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

* Fix checked status disappear after modal tab change

Signed-off-by: Lin Wang <[email protected]>

* optimize the dqc table

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

* optimize the code

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

* update the table css

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

* Simplify options update logic

Signed-off-by: Lin Wang <[email protected]>

* Add unit tests for AssociationDataSourceModal

Signed-off-by: Lin Wang <[email protected]>

* add unit test

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

* optimize the code

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

* Add nested support in associate data source modal

Signed-off-by: Lin Wang <[email protected]>

* delete useless code

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

* Change back type

Signed-off-by: Lin Wang <[email protected]>

* Update type in modal UT

Signed-off-by: Lin Wang <[email protected]>

* optimize the code

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

---------

Signed-off-by: yubonluo <[email protected]>
Signed-off-by: Kapian1234 <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Kapian1234 <[email protected]>
Co-authored-by: Lin Wang <[email protected]>
Co-authored-by: Yulong Ruan <[email protected]>
(cherry picked from commit 0798865)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit that referenced this pull request Sep 5, 2024
…7839)

* add dqc

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

* add dircet query connections on the detail page

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

* Changeset file for PR #7839 created/updated

* delete useless code

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

* optimize the code

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

* optimize the code

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

* Refactor association modal

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

* Integrate modal with workspace detail page

Signed-off-by: Lin Wang <[email protected]>

* Fix parent data source unchecked

Signed-off-by: Lin Wang <[email protected]>

* Remove all tab and sort connections by name alphabetical

Signed-off-by: Lin Wang <[email protected]>

* optimzie

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

* Fix checked status disappear after modal tab change

Signed-off-by: Lin Wang <[email protected]>

* optimize the dqc table

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

* optimize the code

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

* update the table css

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

* Simplify options update logic

Signed-off-by: Lin Wang <[email protected]>

* Add unit tests for AssociationDataSourceModal

Signed-off-by: Lin Wang <[email protected]>

* add unit test

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

* optimize the code

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

* Add nested support in associate data source modal

Signed-off-by: Lin Wang <[email protected]>

* delete useless code

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

* Change back type

Signed-off-by: Lin Wang <[email protected]>

* Update type in modal UT

Signed-off-by: Lin Wang <[email protected]>

* optimize the code

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

---------

Signed-off-by: yubonluo <[email protected]>
Signed-off-by: Kapian1234 <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Kapian1234 <[email protected]>
Co-authored-by: Lin Wang <[email protected]>
Co-authored-by: Yulong Ruan <[email protected]>
(cherry picked from commit 0798865)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit that referenced this pull request Sep 5, 2024
…7839) (#8010)

* add dqc



* add dircet query connections on the detail page



* Changeset file for PR #7839 created/updated

* delete useless code



* optimize the code



* optimize the code



* Refactor association modal



* Integrate modal with workspace detail page



* Fix parent data source unchecked



* Remove all tab and sort connections by name alphabetical



* optimzie



* Fix checked status disappear after modal tab change



* optimize the dqc table



* optimize the code



* update the table css



* Simplify options update logic



* Add unit tests for AssociationDataSourceModal



* add unit test



* optimize the code



* Add nested support in associate data source modal



* delete useless code



* Change back type



* Update type in modal UT



* optimize the code



---------








(cherry picked from commit 0798865)

Signed-off-by: yubonluo <[email protected]>
Signed-off-by: Kapian1234 <[email protected]>
Signed-off-by: Lin Wang <[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: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Kapian1234 <[email protected]>
Co-authored-by: Lin Wang <[email protected]>
Co-authored-by: Yulong Ruan <[email protected]>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 6, 2024
…7839) (#8010)

* add dqc

* add dircet query connections on the detail page

* Changeset file for PR #7839 created/updated

* delete useless code

* optimize the code

* optimize the code

* Refactor association modal

* Integrate modal with workspace detail page

* Fix parent data source unchecked

* Remove all tab and sort connections by name alphabetical

* optimzie

* Fix checked status disappear after modal tab change

* optimize the dqc table

* optimize the code

* update the table css

* Simplify options update logic

* Add unit tests for AssociationDataSourceModal

* add unit test

* optimize the code

* Add nested support in associate data source modal

* delete useless code

* Change back type

* Update type in modal UT

* optimize the code

---------

(cherry picked from commit 0798865)

Signed-off-by: yubonluo <[email protected]>
Signed-off-by: Kapian1234 <[email protected]>
Signed-off-by: Lin Wang <[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: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Kapian1234 <[email protected]>
Co-authored-by: Lin Wang <[email protected]>
Co-authored-by: Yulong Ruan <[email protected]>
(cherry picked from commit d88e3b0)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit that referenced this pull request Sep 6, 2024
…7839) (#8010) (#8048)

* add dqc

* add dircet query connections on the detail page

* Changeset file for PR #7839 created/updated

* delete useless code

* optimize the code

* optimize the code

* Refactor association modal

* Integrate modal with workspace detail page

* Fix parent data source unchecked

* Remove all tab and sort connections by name alphabetical

* optimzie

* Fix checked status disappear after modal tab change

* optimize the dqc table

* optimize the code

* update the table css

* Simplify options update logic

* Add unit tests for AssociationDataSourceModal

* add unit test

* optimize the code

* Add nested support in associate data source modal

* delete useless code

* Change back type

* Update type in modal UT

* optimize the code

---------

(cherry picked from commit 0798865)










(cherry picked from commit d88e3b0)

Signed-off-by: yubonluo <[email protected]>
Signed-off-by: Kapian1234 <[email protected]>
Signed-off-by: Lin Wang <[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: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Kapian1234 <[email protected]>
Co-authored-by: Lin Wang <[email protected]>
Co-authored-by: Yulong Ruan <[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.

6 participants