feat(FR-2525): add project-admin tier to admin menu and project selector#6653
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 9.01% (-0% 🔻) |
1771/19647 |
| 🔴 | Branches | 8.13% (-0.01% 🔻) |
1115/13708 |
| 🔴 | Functions | 5.38% (+0.02% 🔼) |
287/5337 |
| 🔴 | Lines | 8.71% (-0% 🔻) |
1661/19076 |
Test suite run success
859 tests passing in 39 suites.
Report generated by 🧪jest coverage report action from 8f0d619
There was a problem hiding this comment.
Pull request overview
Adds UI support for a new “project-admin” tier by (1) adjusting Admin menu visibility/gating and (2) showing a “Project Admin” badge in the project selector, backed by a new i18n string.
Changes:
- Added
projectSelect.ProjectAdminBadgetranslation key (en/ko). - Introduced
useEffectiveAdminRole()-based gating for the Admin category/menu inuseWebUIMenuItemsandWebUISider. - Updated
ProjectSelectoption rendering to display a per-project “Project Admin” badge.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/i18n/en.json | Adds English translation for the Project Admin badge label. |
| resources/i18n/ko.json | Adds Korean translation for the Project Admin badge label. |
| react/src/hooks/useWebUIMenuItems.tsx | Adds project-admin tier menu filtering and exports project-admin page key list. |
| react/src/components/ProjectSelect.tsx | Displays a “Project Admin” badge next to projects where the user has project-admin scope. |
| react/src/components/MainLayout/WebUISider.tsx | Shows Admin Settings entry for any effective admin role (including project admin). |
Review Summary — PR #6653 (FR-2209 PR-1a)Verification: Spec compliance (FR-2314 / FR-2209 PR-1a)
Findings🟠 HIGH — Route-guard mismatch for project admins (spec-deferred)File: The unauthorized check still uses legacy This creates a menu-vs-page inconsistency: the item is visible (PR-1a) but the page refuses to render. Likely intended to be resolved together with the project-scoping work in PR-2a/2c (and the new PR-2d for members), but not called out in
Given spec scope is honored strictly, flagging as HIGH but not auto-fixing in this PR. 🟡 MEDIUM —
|
004bb4d to
d6757a2
Compare
d6757a2 to
db18202
Compare
4181d2d to
e0a3057
Compare
e0a3057 to
5ac5f01
Compare
db18202 to
ac39da7
Compare
Merge activity
|
…tor (#6653) Resolves #6644 (FR-2552) Part of FR-2209 Project Admin Management stack (PR-1a). Stacks on #6651. ## Summary - `useWebUIMenuItems` now gates admin-category keys by `useEffectiveAdminRole()`; project admins see only Session/Serving/Data/Members - `WebUISider` uses 3-tier `hasAdminCategoryRole = useEffectiveAdminRole() !== 'none'` - `ProjectSelect` renders a "Project Admin" badge on admin-scoped projects for project-admin-only users ## Verification - `bash scripts/verify.sh` -> `=== ALL PASS ===`
5ac5f01 to
9dc530a
Compare
ac39da7 to
8f0d619
Compare
…itch, and fix sider go-back on admin pages (#6656) Resolves #6645 (FR-2553) Part of FR-2209 Project Admin Management stack (PR-1b). Stacks on #6653. ## Summary - In admin mode, when a project-admin user selects a project they are not an admin of in the header `ProjectSelect`, a confirm modal asks before exiting admin mode - Confirm modal content includes the target project name (new `{{projectName}}` placeholder in `header.SwitchOutOfAdminConfirmContent`) - While the modal is open, the selector optimistically shows the target project with a loading state; cancel reverts to the current project, confirm commits and navigates back to the last-visited general page - Fix sider "go back" button silently doing nothing on admin category pages (e.g. `/project-admin-users`) for users whose effective admin role filters the page out of their admin menu — superadmin visiting via URL, or a project-admin whose current project lacks admin rights. Added a role-independent `isCurrentPathAdminCategory` flag (derived from `ALL_ADMIN_PAGE_KEYS` + `PROJECT_ADMIN_PAGE_KEY_SET` + `storage-settings`) and used it to guard `goBackPath` writes, so an admin path is never stored as the "last visited general page" - Simplify `useCurrentUserProjectRoles`: drop `isProjectAdminForId`/`deriveProjectAdminIds` helpers, `MyRolesAssignmentNode` shape, and `rawAssignments`. `projectAdminIds` now contains full project UUIDs sourced from `role.scopes` (new backend schema), so call sites use plain `Array.includes` against `useCurrentProject().id`. `useEffectiveAdminRole` correctly compares `currentProjectId` against this simplified list. - Translate the two new `header.*` keys into all 19 target languages - Regenerate `data/schema.graphql` against core 26.4.1 (adds `AddRevisionOptions` and updates version annotations) ## Verification - `bash scripts/verify.sh` → `=== ALL PASS ===` ## Test plan - [ ] As a project-admin user, enter admin mode and switch the header project selector to a project where you are not an admin → confirm modal appears with the target project name - [ ] Cancel the modal → selector reverts to the previously selected project, no navigation occurs - [ ] Confirm the modal → project switches, admin mode exits, UI navigates to the last-visited general page - [ ] Repeat for superadmin and domain admin: the selector remains visible and switching does not trigger the modal (no regression) - [ ] On `/project-admin-users` as a project admin, click the sider "go back" button → navigates to the previously visited general page (not the same admin page) - [ ] Visit `/project-admin-users` as a superadmin via URL, navigate to `/session`, then enter admin mode and use "go back" → returns to `/session` (not `/project-admin-users`)

Resolves #6644 (FR-2552)
Part of FR-2209 Project Admin Management stack (PR-1a).
Stacks on #6651.
Summary
useWebUIMenuItemsnow gates admin-category keys byuseEffectiveAdminRole(); project admins see only Session/Serving/Data/MembersWebUISideruses 3-tierhasAdminCategoryRole = useEffectiveAdminRole() !== 'none'ProjectSelectrenders a "Project Admin" badge on admin-scoped projects for project-admin-only usersVerification
bash scripts/verify.sh->=== ALL PASS ===