Repository navigation
feat(ui): smart OrgSwitcher that filters by permission key - #21366
banana-three-join merged 3 commits into
Conversation
On the 403 page, the org switcher now only shows organizations where the user holds the required permission. Uses the shared useAccessibleOrgs hook from @sistent/sistent with a thin wrapper wiring meshery's data sources. - Loading state while checking per-org permissions - Empty state when no accessible orgs found - Current org shown as disabled (current) label in dropdown Relates to layer5io/meshery-cloud#5885 Signed-off-by: Rishi Raj <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesPermission-aware organization switching
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to The organization switcher now shows only organizations matching the required permission; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant DefaultError
participant OrgSwitcher
participant useAccessibleOrgs
participant Sistent
participant OrganizationMutation
DefaultError->>OrgSwitcher: pass permissionKey
OrgSwitcher->>useAccessibleOrgs: request accessible organizations
useAccessibleOrgs->>Sistent: evaluate organization permissions
Sistent-->>useAccessibleOrgs: return accessible organizations and readiness state
useAccessibleOrgs-->>OrgSwitcher: provide filtered organizations
OrgSwitcher->>OrganizationMutation: select organization
OrganizationMutation-->>OrgSwitcher: return selection result
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
|
Commit SHA: END-TO-END TESTS
📦 Test Result Summary
⌛ Duration: 5 minutes and 22 seconds Overall Result: 👎 Some tests failed. [Show/Hide] Test Result Details
❌ Failed Test Details The following tests failed. Click on each to see the failure reason: ❌ Return a field to Inherit and it leaves the stored document (Local - chromium-local-provider)File Location: Error Message: Code Snippet: 🔗 Relationship Tests [Show/Hide] Relationship Test Details (18 tests)
|
Description
When a user hits a 403 page, they currently see a generic error with no way to recover. This PR adds a smart OrgSwitcher that checks which of the user's other organizations have the required permission and offers a one-click switch.
The permission check uses
useLazyGetUserKeysQueryfrom@meshery/schemas/mesheryApi(meshery routes all API calls through meshery server, not directly to cloud). The core filtering logic lives in sistent'suseAccessibleOrgshook — the meshery wrapper just passes the right trigger and org data.Changes:
Related: layer5io/meshery-cloud#5971
Sistent PR: layer5io/sistent#1796
Screen.Recording.2026-08-13.at.3.03.52.PM.mov
Signed commits
Summary by CodeRabbit