Repository navigation
Conversation
… Access tab does Admin is the isAdmin flag, not a role entity. The Access tab added it as a synthetic chip, but the user tables only read user.roles, so admins showed no role. One helper, getUserRoleRefs, now builds the list for the Access tab and every user table, with Admin first and rendered as text, not a link.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
The hover card hid its Roles section when an admin had no role entities, and the bulk-edit user picker described admins by their first role or team. Both now read the role list from getUserRoleRefs, and formatUsersResponse keeps isAdmin from the search document.
UsersPureUtils imports moment and the API helpers, so importing the role helper from it put them on every route that renders the user hover card, taking ServiceDetailsPage over its bundle budget. UserRoleUtils imports only TERM_ADMIN and types.
Code Review ✅ Approved 🟢 Low riskAdding a synthetic Admin label across user tables, hover cards, and the picker changes display only; it does not alter access checks or role assignments. Adds VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
…oes (#39767) (#39802) * Fixes #39766: Show the Admin role in user tables, as the Access tab does Admin is the isAdmin flag, not a role entity. The Access tab added it as a synthetic chip, but the user tables only read user.roles, so admins showed no role. One helper, getUserRoleRefs, now builds the list for the Access tab and every user table, with Admin first and rendered as text, not a link. * Show Admin in the user hover card and the CSV bulk-edit user picker The hover card hid its Roles section when an admin had no role entities, and the bulk-edit user picker described admins by their first role or team. Both now read the role list from getUserRoleRefs, and formatUsersResponse keeps isAdmin from the search document. * Move getUserRoleRefs into its own module to keep routes under budget UsersPureUtils imports moment and the API helpers, so importing the role helper from it put them on every route that renders the user hover card, taking ServiceDetailsPage over its bundle budget. UserRoleUtils imports only TERM_ADMIN and types. (cherry picked from commit 377ba23) Co-authored-by: Rohit Jain <[email protected]>
Describe your changes:
Fixes #39766
Admin is stored on the user as the
isAdminflag, not as a role entity. The Access tab (RolesRow) added it as a synthetic "Admin (superuser)" chip. Every user table read onlyuser.roles, so an admin with no other role showed "No role", and an admin with other roles was missing Admin.getUserRoleRefs(user, adminLabel)inutils/UsersPureUtils.ts. It returns the user's roles, with Admin first whenisAdmin. Putting Admin first keeps it out of the "+N more" overflow.RolesRow(Access tab) and all user tables now build their role list from this helper:EntityLinksCelland the classic roles column render it as text, not a link.user.rolesand are fixed the same way:UserRoles): an admin with no other role showed no Roles section at all.formatUsersResponsenow keepsisAdminfrom the search document, so the picker can use it.Type of change:
Tests:
Which test layer and why
Jest. The helper is pure logic, and the table change is a leaf-cell render.
Use cases covered
Unit tests
utils/Users.util.test.tsx:getUserRoleRefswith roles only, no roles, admin only, and admin plus roles.MembersUsersPanel.test.tsx: an admin with no roles shows Admin, not "No role".UserRoles.test.tsx: an admin with no role entities still shows the Roles section with Admin.Settings/Users,Settings/Team,OnlineUsersPageandUserListPagesuites: all pass.Backend integration tests
Playwright (UI) tests
Manual testing performed
localhost:8585).RoleDemoTeam,RoleDemoPersona, and three users: admin only, admin plus DataSteward, and DataSteward plus DataConsumer.Screenshots (after the fix)
Users in the screenshots: Demo Admin Only (admin, no roles), Demo Admin Steward (admin + DataSteward), Demo Steward (DataSteward + DataConsumer, not admin).
Screenshots: hover card and bulk-edit user picker
Hovering Demo Admin Only (admin, no other roles) on the classic team page. Before: no Roles section. After: Roles shows Admin (superuser).
Metrics bulk edit, Owners picker, searching "demo". Before: the admins show no role, or show their other role. After: both admins show Admin (superuser).
🤖 Generated with Claude Code