fix(users): default user detail to Security tab via index redirect - #1755
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe admin user route now redirects bare user detail URLs to the security view. The user details navbar also links its Security breadcrumb and chip directly to the user security path. ChangesUser security routing
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
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 |
Coverage Report for CI Build 29319728310Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage remained the same at 44.876%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Summary
The user detail page always renders the Security tab, but landing on the bare
/users/:userId(e.g. via the detail breadcrumb or a direct link) left the URL without the/securitysuffix, so the Security chip didn't appear selected. This PR makes/users/:userId/securitythe canonical default route via a route-level redirect, so the tab is always selected and the URL is consistent.Changes
/users/:userIdto/users/:userId/security, mirroring the existing org-detail default-tab pattern (members).Technical Details
The
:userIdroute is now an element-less path group with two children: anindexroute that renders<Navigate to="security" replace />and asecurityroute that rendersUsersPage. Because the parent has noelement, there's no<Outlet />requirement — the matched child's element (UsersPage) renders directly. The redirect handles every entry into the bare user URL (breadcrumb, direct link), and the Security chip's existing active check (currentPath.startsWith(link.path)) then matches — no navbar change or component-leveluseEffectneeded.Test Plan
/users/:userIdredirects to/users/:userId/securitywith the Security tab selected./securityURL via the redirect./security) still work as before./users/:userId/foo) no longer render the detail view (fall through to the app catch-all redirect).SQL Safety (if your PR touches
*_repository.goorgoqu.*)N/A