-
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
fix: integrate connections into the sidebar navigation tree COMPASS-7773 #5615
Conversation
packages/compass-connections-navigation/src/connection-item.tsx
Outdated
Show resolved
Hide resolved
Note: I made the namespace parameter for databases workspace required, forcing a bunch of |
// TODO: Currently we show placeholder for every collection/database item in the list, but | ||
// do we want to / need to? |
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 was a deliberate design decision to prevent collection list and the content below it from "jumping" when collections finished loading. Why we'd want to remove that?
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.
Not sure, I believe the current behaviour is the correct one. I'll revert this change so we keep the placeholder.
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.
sorry, what did we want to revert here? or is it reverted already? @gribnoysup @kmruiz
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.
note: this file is moved from compass-databases-navigation
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 nothing needs to be reverted, looking at what the code does, it still keeps the placeholders as expected.
databasesLegacy?: Database[]; | ||
expanded?: Record<string, false | Record<string, boolean>>; | ||
expandedLegacy?: Record<string, boolean>; |
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 feels like an unnecessary fork in logic here. We will need to support single connection in compass-web with the new sidebar: the logic is pretty straightforward, if there is only one connection and only one collection is allowed, this tree should render as before, can we just incorporate this logic into the component and not have a hard fork on this logic based on props? It's low effort and less cleaning-up afterwards when the multiple connections are enabled in Compass
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 agree, I'll do the change when I take this ticket.
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.
@gribnoysup not sure if I follow here.. is the idea just to keep the databases
name and expanded
type will depend on whether connections
or databases
are set? we can do that for sure, it just doesn't seem like a "fork in logic" for me, it's really just the props layer. that's why I'm not sure if I understand correctly.
when I started on this I wasn't aware of the compass-web single connection scenario, so I thought the cleanup would be easiest if we clearly mark the legacy bits.
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.
also relevant note - the compass-web will likely keep using a separate sidebar because the new sidebar structure doesn't make sense for single connection. whether we call it legacy or single-connection (likely the latter, but I'm afraid to rename the sidebar folder at this moment, there are too many conflicts with the main branch already and at least one rebase last week apparently went wrong 🙈 )
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.
update: I've changed the props and also internally removed the "legacy" notation in favour of "single connection (SC)"
09c575b
to
803fadb
Compare
packages/compass-connections-navigation/src/connection-item.tsx
Outdated
Show resolved
Hide resolved
packages/compass-connections-navigation/src/connections-navigation-tree.tsx
Outdated
Show resolved
Hide resolved
packages/compass-connections-navigation/src/connections-navigation-tree.tsx
Outdated
Show resolved
Hide resolved
packages/compass-connections-navigation/src/connections-navigation-tree.tsx
Outdated
Show resolved
Hide resolved
packages/compass-connections-navigation/src/connections-navigation-tree.tsx
Outdated
Show resolved
Hide resolved
packages/compass-connections-navigation/src/connections-navigation-tree.tsx
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,32 @@ | |||
/* eslint-disable react/prop-types */ |
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've seen this disable directive in a couple of files here, it doesn't seem to trigger anything locally though?
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.
yup, might not be needed anymore. I'll try removing it and see if it triggers anything in the CI
…tion-tree.tsx Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
…tion-tree.tsx Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
…tion-tree.tsx Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
bd617a2
to
459b95e
Compare
TODO:
Description
=== READ FIRST ===
The focus of this piece is purely on the presentation.
That means
compass-sidebar
are mainly preparation. what really matters at this point is that we're not breaking the legacy sidebarThe actual state management will be implemented in https://jira.mongodb.org/browse/COMPASS-7775
Changes:
compass-databases-navigation
changes tocompass-connections-navigation
databasesLegacy
andexpandedLegacy
parameters. This is also covered by the original set of tests, nowlegacy-connections-navigation-tree.spec.tsx
openDatabasesWorkspace
). focusing on the tab later activates the connection itemconnections-navigation-tree.tsx
is an updated copy ofdatabases-navigation-tree.tsx
. I can only recommend viewing the diff between the two files, unfortunately github doesn't do this (same for the.spec
file)connection-item.tsx
, which is based ondatabase-item.tsx
Missing: In the new designs, the icons are lighter and the highlighting has a different color. I ran out of time (and the PR is already very big), so looks like this will be a follow up.
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes