Skip to content

feat(authz): implement filters and sorting on audit user page#110

Merged
jacobo-dominguez-wgu merged 28 commits intoopenedx:masterfrom
WGU-Open-edX:audit-page-filtering
Apr 21, 2026
Merged

feat(authz): implement filters and sorting on audit user page#110
jacobo-dominguez-wgu merged 28 commits intoopenedx:masterfrom
WGU-Open-edX:audit-page-filtering

Conversation

@jacobo-dominguez-wgu
Copy link
Copy Markdown
Contributor

@jacobo-dominguez-wgu jacobo-dominguez-wgu commented Mar 26, 2026

Description

Adding filtering and sorting to the roles table on audit user page.
Adds the functionality to filter by Organization and Role and sorting by Role, Organization, and Scope A to Z and Z to A.

It closes #88.

Unit tests are pending and also some TODOs to be solved when the API is integrated.

Warning

Will be on draft status until the required endpoints are completed.
This PR requires the endpoints proposed in the section "Proposed Endpoint for M2"

image image image

How to test it

Pre - requisites

1 - Go to the new audit user page -> http://apps.local.openedx.io:2025/admin-console/authz/user/:username (select a user with many roles assigned to get a more populated table) or go to http://apps.local.openedx.io:2025/admin-console/authz/ and click on the Eye Icon button on one of the rows of the team members table.
2 - Verify filters for orgs and roles and sorting works properly.
3 - Validate all the data loads properly, the UI matches the design and acceptance criteria is fulfilled.

NOTE: Expand all permissions and delete functionality are on different prs.
NOTE 2: The "Assign Role" button redirects to the new role assignation wizard (in development here #109 and #111).

@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 Mar 26, 2026
@openedx-webhooks
Copy link
Copy Markdown

openedx-webhooks commented Mar 26, 2026

Thanks for the pull request, @jacobo-dominguez-wgu!

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.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Mar 26, 2026
@mphilbrick211 mphilbrick211 added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Mar 27, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Mar 27, 2026
@jesusbalderramawgu jesusbalderramawgu force-pushed the audit-page-filtering branch 2 times, most recently from 92a07c5 to 3ba621c Compare April 15, 2026 21:08
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.70%. Comparing base (0d4f93e) to head (eabb149).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #110      +/-   ##
==========================================
+ Coverage   96.20%   96.70%   +0.50%     
==========================================
  Files          81       81              
  Lines        1869     1880      +11     
  Branches      413      418       +5     
==========================================
+ Hits         1798     1818      +20     
+ Misses         68       59       -9     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 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.

@jesusbalderramawgu
Copy link
Copy Markdown
Contributor

I have updated this PR, @jacobo-dominguez-wgu could you please remove the draft status on this PR so Diana can review it?

@jacobo-dominguez-wgu jacobo-dominguez-wgu marked this pull request as ready for review April 20, 2026 01:28
@jacobo-dominguez-wgu jacobo-dominguez-wgu moved this from Waiting on Author to Ready for Review in Contributions Apr 20, 2026
Copy link
Copy Markdown
Contributor

@dcoa dcoa left a comment

Choose a reason for hiding this comment

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

This is a very light review, as you already know I'm not available at the beginning of the week.

So I cannot approve without a proper test of the feature.

path={ROUTES.AUDIT_USER_PATH}
element={<AuditUserPage />}
/>
<Route path="*" element={<NotFoundError />} />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a duplication, is'n it?
I see the same at line 37

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a duplication, is'n it? I see the same at line 37

ay yeah you are right, I've updated this already. Thanks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment as previous PRs about

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment as previous PRs about

you mean, this one. right?

I'm not against introducing this test but I don't think it will introduce much value either.
I explain better, the functions usually call getAuthenticatedHttpClient and return a camel cased value, the logic is simple.
In addition, the hooks test follows the same pattern as here, mocking getAuthenticatedHttpClient, with the idea to cover the api during the test coverage. because of that, I prefer modify them if we find improvements than creating a solo api test suite.

Copy link
Copy Markdown

@rodmgwgu rodmgwgu left a comment

Choose a reason for hiding this comment

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

Did a high level test on my local and functionality looks good, there is just one wrong filter in the Roles filters, that also appears in the Team Members page:

The "Library Collaborator" should be "Library Contributor" (also the filter sent to the query is wrong for this one)

@jesusbalderramawgu
Copy link
Copy Markdown
Contributor

Did a high level test on my local and functionality looks good, there is just one wrong filter in the Roles filters, that also appears in the Team Members page:

The "Library Collaborator" should be "Library Contributor" (also the filter sent to the query is wrong for this one)

Thank you Rodrigo, for your feedback. this has been fixed!

@rodmgwgu
Copy link
Copy Markdown

Did a high level test on my local and functionality looks good, there is just one wrong filter in the Roles filters, that also appears in the Team Members page:
The "Library Collaborator" should be "Library Contributor" (also the filter sent to the query is wrong for this one)

Thank you Rodrigo, for your feedback. this has been fixed!

Thanks!, that works fine now, however I'm now seeing a different issue I didn't see before:

The scroll area doesn't reach the full height of the page, and when a filter dropdown is open, it get's partially hidden, I can scroll, but it doesn't use the whole page height.
Screenshot 2026-04-20 at 2 54 44 p m

Copy link
Copy Markdown

@rodmgwgu rodmgwgu left a comment

Choose a reason for hiding this comment

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

Thanks for this work, just found some things that need changes.

Comment thread src/authz-module/audit-user/utils.tsx Outdated
Comment thread src/authz-module/audit-user/utils.tsx Outdated
const roleData = permissionsList.find(item => item.role === role);
return roleData ? roleData.permissions.length : 0;
*/
const count = Math.floor(Math.random() * 50);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actually I see that this is a placeholder, can we remove it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed.

variant="reduced"
currentPage={pageIndex + 1}
pageCount={pageCount}
paginationLabel="Table pagination"
Copy link
Copy Markdown

@rodmgwgu rodmgwgu Apr 20, 2026

Choose a reason for hiding this comment

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

Should we use formatMessage here for i18n?

@dcoa dcoa changed the title Implementing filters and sorting on audit user page feat(authz): implement filters and sorting on audit user page Apr 21, 2026
@rodmgwgu
Copy link
Copy Markdown

Did a high level test on my local and functionality looks good, there is just one wrong filter in the Roles filters, that also appears in the Team Members page:
The "Library Collaborator" should be "Library Contributor" (also the filter sent to the query is wrong for this one)

Thank you Rodrigo, for your feedback. this has been fixed!

Thanks!, that works fine now, however I'm now seeing a different issue I didn't see before:

The scroll area doesn't reach the full height of the page, and when a filter dropdown is open, it get's partially hidden, I can scroll, but it doesn't use the whole page height. Screenshot 2026-04-20 at 2 54 44 p m

@jacobo-dominguez-wgu @jesusbalderramawgu This issue seems to be related to breakpoints, I only see it on smaller screens:

Screenshot 2026-04-21 at 10 39 54 a m Screenshot 2026-04-21 at 10 39 46 a m

@jesusbalderramawgu
Copy link
Copy Markdown
Contributor

I have solved the conflicts, made the rebase and fix a minor things.

Copy link
Copy Markdown

@rodmgwgu rodmgwgu left a comment

Choose a reason for hiding this comment

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

Thanks! I verified and the filter menu overflow issue is fixed

@jacobo-dominguez-wgu jacobo-dominguez-wgu merged commit e592eca into openedx:master Apr 21, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in Contributions Apr 21, 2026
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). mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Task - RBAC AuthZ - M2.6 View the audit detail for a specific user - Roles table filtering and sorting

6 participants