[US-14.4 / OBT-249] Manage a user's role and status from the user detail page - #35
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: QUIET Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
[US-14.4 / OBT-249] Manage a user's role and status from the user detail page
Summary
Lets a platform admin set a user's role (Member / Manager / Platform Admin) directly from the user detail page, replacing the old boolean "Platform Admin — Make Admin/Remove Admin" toggle with a role badge plus a role selector wired to the new
PUT /api/users/{user_id}/roleendpoint (US-14.2). The activate/deactivate status flow stays as-is viausersAPI.update.Changes
src/types/user.ts— addedUserRoletype ("member" | "manager" | "platform_admin"), optionalrolefield onUserListResponse(identical snippets to US-14.3 for a clean merge), and newUserRoleUpdateinterface (role, optionalproject_ids).src/types/index.ts— barrel now exportsUserRoleandUserRoleUpdatefrom./user.src/components/ui/badge.tsx— addedmanager(bg-azul/25 text-verde border-azul/60) andmember(bg-areia/30 text-verde border-areia) badge variants (identical to US-14.3).src/services/api.ts— addedusersAPI.updateRole(userId, data)→PUT /users/{userId}/role, returning the updatedUserListResponse.src/components/pages/UserDetailPage.tsx—UserInfoCardnow shows a "Role:" row with the current role badge (Shield/UserCog/User icons, admin/manager/member variants; role derived asuser.role ?? (is_platform_admin ? "platform_admin" : "member")) and a Select with the three role options:updateRole({ role: "platform_admin" })directly.projectsAPI.list(); confirm is disabled until at least one project is selected; confirms withupdateRole({ role: "manager", project_ids }).updateRole({ role: "member" }).useAuthuser id === pageuserId) with an InfoTooltip "You cannot change your own role".detailmessage when available.Type of Change
Testing
npm run typecheck,npm run lint(0 errors; pre-existing warning in ProjectsPage.tsx only) andnpm run buildall pass.is_activevia the existing flow with the same badges and toasts.detailmessage in an error toast and the role stays unchanged.