[CSM][BE][Web] Add SCIM external-account status to user profile; fix sidebar active tab on reload - #1421
Conversation
… on reload
GET /users/{id} now appends externalAccount (exists/locked, from SCIM's
"external" org search) for external contacts, mirroring how
infra-operations/operations/asgardeo-user-check checks Asgardeo account
state. Rendered on UserProfilePage as chips in the Overview card plus a
locked-account alert; best-effort like the existing teams enrichment, so a
SCIM failure never fails the request.
Also fixes the sidebar highlighting "Dashboard" after a hard refresh on a
route with no owning nav section (e.g. a user profile at /people/:id): the
last-resolved section is now persisted to sessionStorage instead of only
living in a useRef that resets on every fresh mount.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
📝 WalkthroughWalkthroughThe backend adds best-effort external SCIM account enrichment to user details. The web app displays account existence and lock status. The sidebar persists its last active section in session storage. ChangesExternal account status
Sidebar section persistence
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant UserProfilePage
participant GetUser
participant SCIMClient
participant ExternalOrganization
UserProfilePage->>GetUser: Request user details
GetUser->>SCIMClient: SearchExternalUser(email)
SCIMClient->>ExternalOrganization: Search external organization
ExternalOrganization-->>SCIMClient: User result and lock state
SCIMClient-->>GetUser: ExternalUserInfo
GetUser-->>UserProfilePage: User detail with externalAccount
UserProfilePage-->>UserProfilePage: Render existence and lock status
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
GET /users/{id}now appendsexternalAccount(exists/locked) for external contacts, sourced from SCIM's "external" org search — same call pattern asinfra-operations/operations/asgardeo-user-check. Best-effort: a SCIM failure logs a warning and leaves the rest of the response untouched, never failing the request.UserProfilePagerenders this as exists/locked chips in the Overview card (skipped for internal/WSO2 users, who live in the SCIM "internal" org instead) plus a locked-account alert on the Accessible projects card — the alert is informational only and does not hide the project-access table below it./people/:id, reachable from anywhere in the app and not owned by any section). The last-resolved section is now persisted tosessionStorage(mirroring the existingSIDEBAR_COLLAPSED_KEYpattern) instead of only living in auseRefthat resets to a hardcoded default on every fresh mount.Test plan
go build ./... && go vet ./... && go test ./...— all passgosec -fmt=text ./...— 0 issues in changed files (2 pre-existing, unrelated findings remain ininternal/dashboard/registry.go)tsc -b— cleaneslinton changed files — cleanvitest run—UserProfilePage.test.tsx(18 tests) andCsmSideBar.test.tsx(3 tests, including a direct regression test for the reload bug) all pass🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Documentation