feat: sort/inspect users across permissions tables#7611
Conversation
Adds the standard PanelSearch sort dropdown to the users permissions table.
Name sorts on a composite first/last name; Role sorts on the derived role
label (Organisation/{Level} Administrator, Regular User) so the order matches
what is displayed. Shared by the project and environment Permissions tabs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request updates the EditPermissions.tsx component to make the users list sortable by name and role. However, the implementation introduces a performance bottleneck by performing an O(N) lookup (permissions.find) inside a map over users, resulting in quadratic complexity on every render. It is recommended to optimize this by converting the permissions array into a Map beforehand to achieve linear complexity.
Docker builds report
|
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
Build a Map of permissions by user id once per render instead of calling Array.find per user, avoiding O(N*M) work on the users permissions table. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a per-user inspect action to the permissions table that opens the existing Permissions view scoped to the current project or environment (no org-wide project picker). RBAC-gated, reuses the user-detailed-permissions endpoint. Widens levelId to accept an environment api_key. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds Name/Role sorting to the organisation members table to match the project and environment permissions tables. Extracts the shared decoration (composite sort name + derived role label) and sort options into sortUsers.ts so all three tables reuse it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ions Replaces the inline setting/inspect icons in the project and environment permissions table with the shared UserAction kebab menu (Manage user / Inspect permissions), matching the organisation members table. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The single-button shortcuts ignored canInspectPermissions, so an edit+inspect (no remove) configuration rendered a plain edit button and dropped the inspect option. Fall through to the dropdown whenever inspect is available. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Sorting — added to all three user tables (organisation members, project Permissions, environment Permissions):
Inspect permissions (scoped) - Adds inspect permissions functionality to both environment and project settings
How did you test this code?