Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Greptile SummaryThis PR adds sub-organization support to the login flow, allowing users to select and log into sub-organizations or their root organizations. The implementation includes a new backend endpoint that returns organization hierarchies with proper authorization checks, and a redesigned frontend UI with drill-down navigation and search functionality. Key changes:
Security: Authorization is properly enforced - users can only see sub-orgs they have explicit membership in (direct or via groups). The existing Confidence Score: 4/5
Important Files Changed
Last reviewed commit: bd524e6 |
Adds sub-organization navigation and enhances the organization selection interface. Improves the visual hierarchy and provides a smoother user experience.
Calculates and stores total organization count in a variable which is used to determine whether the search input should be displayed or not.
varonix0
left a comment
There was a problem hiding this comment.
This arrow is pretty invisible, maybe we should make it more clear? @scott-ray-wilson might be good to loop in on this
varonix0
left a comment
There was a problem hiding this comment.
Sent a video to you privately showing a UI discrepancy with selecting root organizations
…specific-sub-organizations
This adds tracking of when a user joined an organization by retrieving the createdAt timestamp from the Membership table. The schema now includes userJoinedAt to expose this information in API responses. This enables the frontend to display "Member since" information on the organization selection screen. The actor type check in listOrganizationsWithSubOrgs has been removed to support future use cases beyond just user actors.
Updates the organization selection screen to display "Member since" information for both root and sub-organizations. The frontend type has been updated to include the userJoinedAt field, and the UI now renders the formatted join date for each organization using date-fns. This provides users with context about when they joined each organization, enhancing transparency in multi-organization environments.
Consolidate the two separate queries (root orgs and sub-orgs) into a single efficient query with proper left joins to resolve userJoinedAt for both direct membership and group-based access. Remove the unused actorType parameter from the function signature.
Extend the sub-organization schema to include the userJoinedAt field, which tracks when a user joined a specific sub-organization through direct membership or group membership.
Update the org service to pass only actorId when calling listOrganizationsWithSubOrgs, matching the simplified function signature in the DAL.
Extend the sub-organization schema to include the userJoinedAt field, which tracks when a user joined a specific sub-organization through direct membership or group membership.
Update the org service to pass only actorId when calling listOrganizationsWithSubOrgs, matching the simplified function signature in the DAL.
Extend the frontend type definition to include userJoinedAt on sub-organization objects, enabling the UI to display when users joined sub-organizations.
Refactor the organization selection UI to: - Make root org login section a semantic button element instead of div - Display user join dates in both root org and sub-org sections - Show join dates in the format 'Member since MMM d yyyy' - Improve accessibility with proper button semantics and ARIA labels - Update styling to work with the new button structure
2df1b4b to
102b185
Compare

Context
Adds support for sub-organizations in the login flow. Previously, users could only select a root organization at login. This PR introduces a new select-organization page that displays the org hierarchy and allows users to log directly into a sub-organization or its root org.
Closes ENG-4584
Key changes:
GET /api/v1/organization/accessible-with-sub-orgsreturns orgs with their accessible sub-orgsuseGetOrganizationsWithSubOrgshook to consume the endpoint›on a root org shows its sub-orgs with a breadcrumb to navigate backScreenshots
Screenshare.-.2026-02-20.12_21_09.PM.mp4
Steps to verify the change
›on an org with sub-orgs — verify breadcrumb appears and sub-orgs are listedType
Checklist
type(scope): short description