Skip to content

feat: sort/inspect users across permissions tables#7611

Open
kyle-ssg wants to merge 6 commits into
mainfrom
feat/permissions-table-sorting
Open

feat: sort/inspect users across permissions tables#7611
kyle-ssg wants to merge 6 commits into
mainfrom
feat/permissions-table-sorting

Conversation

@kyle-ssg
Copy link
Copy Markdown
Member

@kyle-ssg kyle-ssg commented May 27, 2026

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

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

image image

How did you test this code?

  1. Sort users in environment, project and organisation settings
  2. As a user with just Environment|Project admin permissions I can inspect a user's permissions (attached image)

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>
@kyle-ssg kyle-ssg requested a review from a team as a code owner May 27, 2026 10:57
@kyle-ssg kyle-ssg requested review from talissoncosta and removed request for a team May 27, 2026 10:57
@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment May 27, 2026 12:49pm
flagsmith-frontend-staging Ready Ready Preview, Comment May 27, 2026 12:49pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview May 27, 2026 12:49pm

Request Review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread frontend/web/components/EditPermissions.tsx Outdated
@github-actions github-actions Bot added the feature New feature or request label May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-7611 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-7611 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-7611 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7611 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-7611 Finished ✅ Results

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  39 seconds
commit  bc96cc4
info  🔄 Run: #17025 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.7 seconds
commit  bc96cc4
info  🔄 Run: #17025 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  31.7 seconds
commit  bc96cc4
info  🔄 Run: #17025 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  56.8 seconds
commit  bc96cc4
info  🔄 Run: #17025 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.6 seconds
commit  4f71144
info  🔄 Run: #17026 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.9 seconds
commit  4f71144
info  🔄 Run: #17026 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  39.6 seconds
commit  4f71144
info  🔄 Run: #17026 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  1 minute, 1 second
commit  4f71144
info  🔄 Run: #17026 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  35.3 seconds
commit  0059e76
info  🔄 Run: #17032 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  42.3 seconds
commit  0059e76
info  🔄 Run: #17032 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  31.2 seconds
commit  0059e76
info  🔄 Run: #17032 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 7 seconds
commit  0059e76
info  🔄 Run: #17032 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Visual Regression

19 screenshots compared. See report for details.
View full report

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>
@kyle-ssg kyle-ssg changed the title feat: sort users permissions table by name and role feat: sort and inspect users in the permissions table May 27, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels May 27, 2026
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>
@kyle-ssg kyle-ssg changed the title feat: sort and inspect users in the permissions table feat: sort and inspect users across permissions tables May 27, 2026
@github-actions github-actions Bot removed the feature New feature or request label May 27, 2026
@github-actions github-actions Bot added the feature New feature or request label May 27, 2026
…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>
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels May 27, 2026
@kyle-ssg kyle-ssg marked this pull request as ready for review May 27, 2026 13:16
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels May 27, 2026
@kyle-ssg kyle-ssg changed the title feat: sort and inspect users across permissions tables feat: sort/inspect users across permissions tables May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant