feat: multi-org UX improvements#31
Conversation
…g filtering - Append organization name to user DisplayName (e.g., "Alice Smith (Org A)") to disambiguate users across multiple Retool orgs in the C1 UI - Add org-match validation in Grant/Revoke to return a descriptive error when a user's org doesn't match the target group's org, preventing silent failures - Add --organization-id config flag to restrict sync to a single Retool org, enabling one connector instance per org for clean isolation - Add GetOrganization and GetUser client methods to support the above changes
|
Claude finished @c1-dev-bot[bot]'s task in 1m 36s —— View job PR Review: Multi-Org UX Improvements
Overall this is a well-structured PR. The three features are logically separated and the implementation follows existing patterns in the codebase. I found a couple of issues worth addressing: Issue 1:
|
Summary
Addresses three multi-org UX issues reported by a user running a self-hosted Retool instance with multiple Organization Spaces:
User DisplayName now includes org name — Users synced from different orgs are now distinguishable in the C1 UI. DisplayName is formatted as
"FirstName LastName (OrgName)"instead of just"FirstName LastName". Theorganization_nameis also added as a user profile attribute.Org-match validation in Grant/Revoke — Before adding/removing a user from a group, the connector now validates that the user's organization matches the group's organization. If they don't match, a descriptive error is returned instead of silently proceeding with a no-op grant.
--organization-idconfig flag — A new optional flag restricts the connector to syncing a single Retool org. This enables running one connector instance per org for clean isolation in C1's UI. Downstream resource queries (users, groups, pages, resources) are already scoped by org, so the filter only needs to be applied at theListOrganizationslevel.Changes
pkg/client/organization.go— AddedGetOrganization()method; updatedListOrganizations()to accept optional org ID filter withWHERE "id"=$Nclausepkg/client/user.go— AddedGetUser()method for org-match validationpkg/connector/users.go— Fetch org name and append to user DisplayName; addorganization_nameprofile attributepkg/connector/groups.go— AddedvalidateOrgMatch()helper; called from bothGrant()andRevoke()pkg/connector/organizations.go— PassorganizationIDfilter through toListOrganizationspkg/connector/connector.go— Accept and parseorganizationIDstring config; store as*int64cmd/baton-retool/config.go— AddedOrganizationIDstring fieldcmd/baton-retool/main.go— Read and passorganization-idconfig to connectorTest Plan
go build ./cmd/baton-retool/--organization-idflag: confirm only the specified org is syncedFixes: CXH-1212
Automated PR Notice
This PR was automatically created by c1-dev-bot as a potential implementation.
This code requires: