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

chore(web, sidebar): disable creating, deleting, and modifying atlas connections; provide callback prop for connection info modal COMPASS-7883 COMPASS-8229 COMPASS-8230 #6175

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

gribnoysup
Copy link
Collaborator

This patch changes some misc stuff related to the compass-web sidebar when atlas connections are shown, in particular:

  • When in Atlas, do not show any "Create connection" buttons
  • Connections that have atlasMetadata will not show any editing actions
  • Instead of connection info, there is a different connection info related action in the sidebar that will trigger a callback prop (will be used to show this special connection info modal in mms)

Example of some of those changes visible:

image

…connections; provide callback prop for connection info modal
@@ -221,7 +221,7 @@ export function createInstancesStore(
const db =
instance.databases.get(database) ??
// We might be adding collection to a new db namespace
instance.databases.add({ _id: database });
instance.databases.add({ _id: database, name: database });
Copy link
Collaborator Author

@gribnoysup gribnoysup Aug 30, 2024

Choose a reason for hiding this comment

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

Drive-by: small bug here with not passing the name, it's the same value as _id, but compared to collection model is not a derived value on database model, so will be missing until we fetch the db below. Never popped up in compass as an issue, it would just load a milisecond later and show in the UI, but in compass-web we're using this value to render the CTA for adding data to the cluster and passing it to toNS and this breaks if name is missing

@@ -490,19 +515,22 @@ const ConnectionsNavigation: React.FC<ConnectionsNavigationProps> = ({
expanded={expanded}
/>
</>
) : (
)}
{connections.length === 0 && (
<div className={noDeploymentStyles}>
<Body data-testid="no-deployments-text">
You have not connected to any deployments.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe worth noting that in mms if there are no clusters in the project, we will redirect to the clusters overview page before you even see compass-web rendering, so even though the text here is maybe a bit ill-fitting, real users will never see it anyway

@gribnoysup gribnoysup merged commit f2b1f30 into main Sep 2, 2024
27 checks passed
@gribnoysup gribnoysup deleted the compass-7883-compass-web-sidebar branch September 2, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants