Skip to content

refactor(authz): display team members information agregated in the table - #222

Open
dcoa wants to merge 20 commits into
openedx:masterfrom
eduNEXT:dcoa/table-members-refactor
Open

dcoa wants to merge 20 commits into
openedx:masterfrom
eduNEXT:dcoa/table-members-refactor

Conversation

@dcoa

@dcoa dcoa commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Context

The Team Members tab renders one row per role assignment. The new design regroups it into one row per user, with that user's assignments nested underneath an expandable row.

Important

It follows the API contract defined in openedx-authz. It needs the backend implementation here openedx/openedx-authz#451

Changes summary

Data

  • The Team Members table now uses the user-grouped endpoint GET /api/authz/v1/users/ instead of /assignments/.
  • Added TeamMember and TeamMemberAssignment types that match the API.

Team Members table

  • One row per user: username (with "(Me)" for the current user), email, their first role shown as "Role in Scope", a "+N more roles" toggle, and the View action.
  • The toggle opens a breakdown card: Role / Scope / Organization, "Showing X of Y", and "View all roles".
  • Only one row can be expanded at a time, via the new shared useExclusiveRowExpansion hook.
  • Styling: more row spacing, fixed column widths only from md up (the table scrolls on small screens), the breakdown header matches the Roles & Permissions category rows, and icons use the primary color.

Shared

  • The user page (audit table) shows "All courses" / "All libraries" and "All platform" for org-wide and platform-wide roles.
  • The "All Organizations" label now says "All platform" to match the Team Members table.
  • ViewMoreLink is now a button instead of a link. Making the action accessible.
  • The scope icon now comes from the scope key instead of the role. New helpers getAggregateScopeType and getScopeContextType detect org-wide and platform-wide scopes.

Errors & permissions

  • The home page waits for the permission check, then shows 403 Access Denied if the user can't view course or library teams.
  • The table shows one toast per failed request, instead of two.
  • The loading spinner now announces itself to screen readers (role="status" and a label).

Testing instructions

  1. Make sure to use the backend implementation specified above.
  2. Add uses with different roles and add different roles to a user. Make sure you have users with:
    • a single role
    • more than 3 roles
    • an org-wide role (e.g. course-v1:MyOrg+*)
    • a platform-wide role (e.g. course-v1:* or lib:*)

In Team Members tab

  1. There is one row per user, showing username, email and their first assigned role.
  2. Users with more than one role show "+N more roles". Clicking it opens the role breakdown, and only one breakdown can be open at a time.
  3. The breakdown footer shows "Showing X of Y". "View all roles" appears when not all roles are listed, and opens the user's page.
  4. An org-wide role shows the org name in the row, and "All courses" / "All libraries" in the breakdown.
  5. A platform-wide role shows "All platform" with a globe icon in the row and in the breakdown's Organization column.
  6. The Organization, Role, Scope and search filters narrow the list, and the "Showing N users of M." count updates.
image

In User audit page
7. Org-wide and platform-wide roles show "All courses" / "All libraries" and "All platform".

image

Edge cases
8. A user with no team view permission sees the 403 Access Denied page.

Additional information

Closes openedx/openedx-authz#407
Closes #174
Address #156

Supported by claude

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Sep 9, 2026
@openedx-webhooks

openedx-webhooks commented Sep 9, 2026

Copy link
Copy Markdown

Thanks for the pull request, @dcoa!

This repository is currently maintained by @openedx/committers-frontend.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.55947% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.91%. Comparing base (36cc825) to head (339d753).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/authz-module/data/hooks.ts 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #222      +/-   ##
==========================================
+ Coverage   97.65%   97.91%   +0.25%     
==========================================
  Files          68       76       +8     
  Lines        1665     1819     +154     
  Branches      443      451       +8     
==========================================
+ Hits         1626     1781     +155     
+ Misses         39       38       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Sep 9, 2026
@dcoa
dcoa force-pushed the dcoa/table-members-refactor branch 2 times, most recently from 03e2292 to 9d50e98 Compare September 10, 2026 05:35
@dcoa
dcoa force-pushed the dcoa/table-members-refactor branch from 9d50e98 to 1b5c875 Compare September 10, 2026 06:05
@dcoa
dcoa force-pushed the dcoa/table-members-refactor branch from bfe5bb6 to d95ff48 Compare September 10, 2026 08:09
@dcoa
dcoa force-pushed the dcoa/table-members-refactor branch from 7bd0f3f to 3a36374 Compare September 10, 2026 08:31
@dcoa
dcoa marked this pull request as ready for review September 17, 2026 23:52
@dcoa
dcoa force-pushed the dcoa/table-members-refactor branch from 2d4a009 to 339d753 Compare September 18, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Waiting on Author

Development

Successfully merging this pull request may close these issues.

Frontend: Implement grouped roles & permissions view in Admin Console Review Error handling after refactoring

3 participants