Skip to content

Removing role functionality on audit user page#108

Merged
jacobo-dominguez-wgu merged 11 commits intoopenedx:masterfrom
WGU-Open-edX:remove-role
Apr 21, 2026
Merged

Removing role functionality on audit user page#108
jacobo-dominguez-wgu merged 11 commits intoopenedx:masterfrom
WGU-Open-edX:remove-role

Conversation

@jacobo-dominguez-wgu
Copy link
Copy Markdown
Contributor

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

Description

Adding the delete role functionality to the roles table on audit user view.
The table shows a different remove button icon depending on:

  • Non clickable info icon for django roles, showing a tooltip when hovered.
  • A disabled trash icon button for admin roles (library_admin or course_admin) in case a user is on his own specific user page (preventing to remove its own admin roles).
  • Regular trash icon for the rest of the scenarios.

It closes #89
Figma design

⚠️ Includes code from #106, needs to be reviewed after it.

Pending things:

  • Unit testing.
  • Integration with API when is ready.
  • A couple of TODOs.

Warning

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

image image image

How to test it

Pre - requisites

A running local tutor instance.
It requires the endpoint created on this PR openedx/openedx-authz#230 to fetch the table data

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) (NOTE: The team members table will redirect to this page, currently in progress #124)
2 - Verify the actions icon button shows according the described scenarios:

  • Non clickable info icon for django roles (superadmin, globalstaff), showing a tooltip when hovered.
  • A disabled trash icon button for admin roles (library_admin or course_admin) in case a user is on his own specific user page (preventing to remove its own admin roles).
  • Regular trash icon for the rest of the scenarios.

3 - Click on the trash icon and must appear a confirmation modal.
4 - Confirm the removal, the modal gets closed, a toast shows success message and the entry row gets removed from the table.

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

openedx-webhooks commented Mar 23, 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.

@jacobo-dominguez-wgu jacobo-dominguez-wgu marked this pull request as draft March 23, 2026 16:53
@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Mar 23, 2026
@mphilbrick211 mphilbrick211 added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Mar 23, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Mar 23, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 98.94737% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.88%. Comparing base (411e3d3) to head (8d11260).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/authz-module/data/api.ts 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #108      +/-   ##
==========================================
+ Coverage   95.70%   95.88%   +0.17%     
==========================================
  Files          69       70       +1     
  Lines        1536     1602      +66     
  Branches      321      341      +20     
==========================================
+ Hits         1470     1536      +66     
  Misses         64       64              
  Partials        2        2              

☔ 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.

@arbrandes
Copy link
Copy Markdown
Contributor

This depends on #106, so I'm converting to draft.

@arbrandes arbrandes marked this pull request as draft April 15, 2026 11:50
@jacobo-dominguez-wgu jacobo-dominguez-wgu marked this pull request as ready for review April 19, 2026 00:45
@jacobo-dominguez-wgu
Copy link
Copy Markdown
Contributor Author

@dcoa This one is now ready for review, could you take a look?

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 so I can not approve

Comment thread src/authz-module/audit-user/index.tsx Outdated
Comment thread src/authz-module/audit-user/index.tsx Outdated
Comment thread src/authz-module/components/messages.ts Outdated
Comment thread src/components/ToastManager/ToastManagerContext.test.tsx
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.

Tested in my local, functionality works fine, just found an issue that may not be directly related to this PR:

After removing a role from a user, and navigating back to the Team Members page using the link in the breadcrumbs, the user still appeared there (did not reload the data on the Team Members page), perhaps we should invalidate that data on role removal.

@jacobo-dominguez-wgu jacobo-dominguez-wgu force-pushed the remove-role branch 2 times, most recently from ab684c8 to ea8d911 Compare April 20, 2026 19:12
@jacobo-dominguez-wgu
Copy link
Copy Markdown
Contributor Author

Tested in my local, functionality works fine, just found an issue that may not be directly related to this PR:

After removing a role from a user, and navigating back to the Team Members page using the link in the breadcrumbs, the user still appeared there (did not reload the data on the Team Members page), perhaps we should invalidate that data on role removal.

Thanks for testing it. I have fixed this issue in the latest commit!

Comment thread src/components/ToastManager/ToastManagerContext.tsx Outdated
Comment thread src/authz-module/libraries-manager/messages.ts Outdated
Comment thread src/authz-module/components/TableCells.tsx Outdated
Comment thread src/authz-module/components/TableCells.tsx Outdated
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.

Tested it again and all is working correctly, just added some nit comments. Thanks!

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.

Looks good, thanks for addressing my comments!

@jacobo-dominguez-wgu
Copy link
Copy Markdown
Contributor Author

Will wait a bit before merging it.

@jacobo-dominguez-wgu jacobo-dominguez-wgu merged commit 7143553 into openedx:master Apr 21, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Waiting on Author 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 - Delete role

6 participants