-
Notifications
You must be signed in to change notification settings - Fork 171
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
chore(my-queries): support for multiple connections for my-queries COMPASS-7904, COMPASS-7915 #5841
chore(my-queries): support for multiple connections for my-queries COMPASS-7904, COMPASS-7915 #5841
Conversation
@@ -0,0 +1,52 @@ | |||
import React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This modal is for a case that was not discussed when planning for this and hence I would say not final but I am hoping to keep this until Ben is back and we have a chance to discuss this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file appears deleted but I actually renamed it to select-connection-and-namespace-modal.tsx. Most of the original content of the file is preserved and I have mostly modified the component props and its mapState
One question would be why you're using radio buttons rather than the selectbox in the "Select a Connection" modal. |
No specific reason other than that it was in the design. But IIRC Ben was also re-contemplating the idea of using select box for this. I can check in with him once he's back and if it needs changing then I can quickly iterate over that? |
1b4b57b
to
257c5e0
Compare
I've seen this |
I noticed some inconsistencies in the reducer like accessing non-existent parameters on passed actions. This isAction helps to get around that as it validates wether a received action is of the expected type. |
I'm thinking the rules are too complicated and would propose:
If we're going to make an exception where we prefer the "active" connection I think there will be trouble because as we've seen even in the single connection world the sidebar easily scrolls and I don't think there's anything we can do that will make it super obvious enough which connection will be used. At most I'd pre-select the current selection but still show the modal and make the user chooses so that they confirm. ie. we'd only have the two modals: Select a namespace (like we do today) and Select a Connection and Namespace. I don't know how/where we'd display to the user that you have to connect to something first. But I think we should try and avoid having another way of kicking off a new connection. |
So for the points that you mentioned Le Roux, we do follow the first and the second, and only for the third point we try to detect if namespace is available in only one or multiple of the active connections. But that is also only to keep the user experience consistent for the simplest of the use-case which is - when we try to open the query and the namespace for the query exists only in one connection we simply open the query in that connection. |
since we have the |
packages/compass-saved-aggregations-queries/src/stores/open-item.ts
Outdated
Show resolved
Hide resolved
Yea I think we can do this - I will push a commit for that. |
.../compass-saved-aggregations-queries/src/components/select-connection-and-namespace-modal.tsx
Outdated
Show resolved
Hide resolved
packages/compass-saved-aggregations-queries/src/components/select-connection-modal.tsx
Outdated
Show resolved
Hide resolved
e96fca4
to
3acbbec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 🎉
… and Workspace and instead rely on getting the activeConnection from useActiveConnections
…and select-connection-modal
…ection select action
8f26ca6
to
58fad7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have some concerns about the design, but I suppose we can deal with those during the feedback phase.
@lerouxb yea - it would be amazing if you could add those to the findings doc so that we don't loose the thought of it. |
Description
This PR introduces following changes:
singleConnectionConnectionInfo
that we introduced at some point to render "My Queries" plugin. Instead, we have taken a more optimistic route which is to use useActiveConnections hook to get a hold of current active connections and work with the very first connection that we find, to render "CompassSidebar", "CompassShell" and interaction in "My Queries" plugin for single connection modeFor the saved aggregations and queries these are the changes to be expected:
There is additionally a new context menu item called "Open in" added when in multiple connections mode to explicitly open a query in a different connection / namespace.
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes