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
feat(connect): Save & Connect button COMPASS-5776 #3163
Conversation
packages/connection-form/src/components/connect-form-actions.tsx
Outdated
Show resolved
Hide resolved
@@ -296,6 +310,10 @@ function ConnectForm({ | |||
...favoriteInfo, | |||
}, | |||
}); | |||
|
|||
if (saveConnectionModal === 'saveAndConnect') { | |||
onSubmitForm(); |
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 think the connection options in the form don't have the recently set favorite settings on the first connection.
After save and connect with a new connection:
(Lack of connection name)
After reloading the favorites list and connecting to the favorite:
(has connection name)
Not sure this is a blocker, but I could see it tripping up some folks.
Due to the nature of how the useConnectForm
is setup it may take some extra work to have it update the current connection options and then connect from there. Maybe we could add an optional argument overload to the onSubmitForm
function to explicitly connect to the passed options? Totally up to you implementation wise, just suggesting a thought.
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.
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 think this is an existing problem. ie if you hit save via the favorite modal and then connect on main now it also happens.
Due to that I'm not sure what's best practise - make this PR larger and fix it now or fix it in a followup?
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.
Looks like it's the same, yes. When saving happens we don't update the current connection settings. As for best practice, it's up to you, since it won't change this code much I think it would be nice to have it in another pr. It could be a separate fix
then.
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.
Co-authored-by: Rhys <Anemy@users.noreply.github.com>
In the New Connection dialog (ie. when there's no existing favorite connection involved), display a
Save & Connect
button in addition to the existingSave
andConnect
buttons. This will pop up theSave connection to favorites
dialog and replace the dialog'sSave
button with aSave & Connect
button. Clicking that button saves the connection as a favorite and connects.