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

fix(connection-form): vscode support & cleanup COMPASS-8098 #6225

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

paula-stacho
Copy link
Contributor

@paula-stacho paula-stacho commented Sep 11, 2024

Description

Preparing the new connection form for VSCode.
New preferences to be set in VSCode:

saveAndConnectLabel: 'Save & Connect', 
showHelpCardsInForm: false,
showPersonalisationForm: false,

I also used this opportunity to do a bit of cleanup of the pre-MC code (tbh tiptoing around the legacy parts of connection form has been something that bugged me for a while).

Left out (changes that will be visible in VSCode - let me know if you think these should also be customizable so that we avoid them in VSCode):

  • the new subtitle 'Manage your connection settings'
  • horizontal line above the buttons

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@github-actions github-actions bot added the fix label Sep 11, 2024
@paula-stacho paula-stacho changed the title fix(connection-form): cleanup & vscode support fix(connection-form): vscode support & cleanup Sep 12, 2024
@paula-stacho paula-stacho changed the title fix(connection-form): vscode support & cleanup fix(connection-form): vscode support & cleanup COMPASS-8098 Sep 12, 2024
@paula-stacho paula-stacho added the no release notes Fix or feature not for release notes label Sep 12, 2024
@paula-stacho paula-stacho force-pushed the COMPASS-8098 branch 2 times, most recently from 731f6b1 to fa57be6 Compare September 13, 2024 08:39
@paula-stacho paula-stacho marked this pull request as ready for review September 13, 2024 09:16
@@ -125,8 +83,7 @@ function Home({
hideCollectionSubMenu,
showSettings,
}: Omit<HomeProps, 'connectionStorage'>): React.ReactElement | null {
const appRegistry = useLocalAppRegistry();
const { connectionInfo, isConnected, disconnect } =
const { isConnected, disconnect } =
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're making it impossible to use single connection mode by removing the form, why are we keeping this code here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have reverted this bit and will be only removing the tests here. as much as I'd love to follow this rabbit hole, I don't have time to do that, so I'll leave it for the scheduled MC cleanup. I hope the partial cleanup I've done in the connection-form is okay. This is why I was asking in the channel if it's safe to say we won't be reverting the MC flag.

@@ -29,6 +34,7 @@ const defaultPreferences = {
showKerberosAuth: true,
showCSFLE: true,
showProxySettings: true,
saveAndConnectLabel: 'Connect',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the intention for these preferences was only to map compass preferences to connection form without the need to have a dependency on the preferences model (although @mcasimir might correct me on that), this is just something that you'd usually pass as a component property, doesn't feel like it belongs here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm.. I put it there because 'showFavoriteActions' was already there. There is a note above that says '// Not all of these preference map to Compass preferences.', which suggests that what you say used to be true, but at this point maybe we can keep the form preferences together?

Copy link
Contributor

@gribnoysup gribnoysup Sep 16, 2024

Choose a reason for hiding this comment

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

If we're already diverging from React patterns in an unconventional ways here and don't want to touch this particular part, I guess it's okay to keep it for now like that for consistency, but just want to make sure we all understand that we are leaving more clean up to do after a "clean up" PR here.

My main concern here is that we are copying patterns in compass codebase often from one place to another (which is totally normal), so leaving code like that is always a risk that antipatterns will start spreading through other parts of the codebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix no release notes Fix or feature not for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants