Skip to content

feat: roles and permissions tab added#107

Open
jesusbalderramawgu wants to merge 16 commits intoopenedx:masterfrom
WGU-Open-edX:feature/roles-permissions-tab
Open

feat: roles and permissions tab added#107
jesusbalderramawgu wants to merge 16 commits intoopenedx:masterfrom
WGU-Open-edX:feature/roles-permissions-tab

Conversation

@jesusbalderramawgu
Copy link

@jesusbalderramawgu jesusbalderramawgu commented Mar 23, 2026

Description

PR to replace old Roles and permissions Tab for a new one, completely merged. It closes the task

  • Courses
Screenshot 2026-03-24 at 9 41 49 a m Screenshot 2026-03-24 at 9 42 02 a m Screenshot 2026-03-24 at 9 42 29 a m
  • Libraries
Screenshot 2026-03-24 at 9 42 55 a m Screenshot 2026-03-24 at 9 43 05 a m
  • Roles and permissions Tabs merged
  • ButtonGroup added inside tab to select courses or libraries
  • messages fixed
  • hardcoded permissions added
  • component anchor to go to the top of the page when courses is selected
  • new path added to use this new tabs

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Mar 23, 2026
@openedx-webhooks
Copy link

openedx-webhooks commented Mar 23, 2026

Thanks for the pull request, @jesusbalderramawgu!

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 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
@jesusbalderramawgu jesusbalderramawgu marked this pull request as draft March 23, 2026 18:09
@codecov
Copy link

codecov bot commented Mar 23, 2026

Codecov Report

❌ Patch coverage is 97.61905% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.37%. Comparing base (74ee431) to head (d4cb09d).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/authz-module/index.tsx 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #107      +/-   ##
==========================================
+ Coverage   95.18%   95.37%   +0.19%     
==========================================
  Files          45       49       +4     
  Lines         913      994      +81     
  Branches      181      193      +12     
==========================================
+ Hits          869      948      +79     
- Misses         42       44       +2     
  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.

defaultMessage: 'Course Roles',
description: 'Libraries AuthZ title for the course roles alert',
},
'library.authz.tabs.permissionsRoles.courses.alert.description': {
Copy link
Author

Choose a reason for hiding this comment

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

this description is gonna change, waiting for the final text

defaultMessage: 'This list shows the permissions currently available in Authoring Studio. Some roles may grant additional permissions manages outside this interface.',
description: 'Libraries AuthZ description for the course roles alert',
},
'library.authz.tabs.permissionsRoles.courses.alert.link': {
Copy link
Author

Choose a reason for hiding this comment

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

this link is gonna change, waiting for the final text

@jesusbalderramawgu jesusbalderramawgu marked this pull request as ready for review March 24, 2026 15:44
Copy link

@arbrandes arbrandes 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 purely a code review: I did not test it.

Comment on lines +307 to +308
CONTENT_COURSE_PERMISSIONS.VIEW_COURSE_FILES,
CONTENT_COURSE_PERMISSIONS.VIEW_COURSE_FILES,

Choose a reason for hiding this comment

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

Duplicated.

const [active, setActive] = useState('courses');

const [libraryPermissionsByResource] = useMemo(() => {
if (!rolesLibraryObject && !libraryPermissions && !libraryResourceTypes) { return [null, null]; }

Choose a reason for hiding this comment

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

First: these are constants. Why are we guarding against their non-existence?

Second: If they're dynamic, the checks should be ||, not &&.

Copy link
Author

Choose a reason for hiding this comment

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

I copied this function form another file and at first I thought it was going to be dynamic, I forgot to delete it.
it is fixed now!

onClick={() => setActive('courses')}
variant={`${active === 'courses' ? 'primary' : 'outline-primary'}`}
>
Courses
Copy link

@arbrandes arbrandes Mar 25, 2026

Choose a reason for hiding this comment

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

Needs internationalization.

Copy link
Author

Choose a reason for hiding this comment

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

done, thanks!

onClick={() => setActive('libraries')}
variant={`${active === 'libraries' ? 'primary' : 'outline-primary'}`}
>
Libraries

Choose a reason for hiding this comment

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

Needs internationalization.

Copy link
Author

Choose a reason for hiding this comment

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

done, thanks!

<span><span className="font-weight-bold">Note:</span>{intl.formatMessage(messages['library.authz.tabs.permissionsRoles.courses.alert.description'])}</span>
</div>
<div className="col col-5">
<Hyperlink className="d-block text-right h5 font-weight-normal" destination="." target="_blank" showLaunchIcon={false} isInline>

Choose a reason for hiding this comment

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

Is destination="." intentional?

Copy link
Author

Choose a reason for hiding this comment

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

yes, well I'm still waiting for the final texts here, maybe we don't need a Hyperink either but I don't know yet

Copy link
Contributor

Choose a reason for hiding this comment

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


useEffect(() => {
const handleScroll = () => {
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;

Choose a reason for hiding this comment

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

pageYOffset is deprecated. We should be using scrollY as the first option.

Regarding the fallback documentElement.scrollTop, there's no need for it. We don't support IE. (See the browsers we support here.

Copy link
Author

Choose a reason for hiding this comment

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

thank you, this was fixed!

<div className="row align-items-center">
<div className="col col-7">
<p className="text-primary font-weight-bold h4">{intl.formatMessage(messages['library.authz.tabs.permissionsRoles.courses.alert.title'])}</p>
<span><span className="font-weight-bold">Note:</span>{intl.formatMessage(messages['library.authz.tabs.permissionsRoles.courses.alert.description'])}</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

"Note:" needs i18n

Copy link
Author

Choose a reason for hiding this comment

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

done, thanks!

@@ -0,0 +1,59 @@
import { renderWrapper } from '@src/setupTest';
import { fireEvent, waitFor } from '@testing-library/react';
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not use fireEvent, use userEvent instead

Copy link
Author

Choose a reason for hiding this comment

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

updated, thanks!

<PermissionTable
permissionsTable={CoursePermissionsByResource}
roles={rolesObject}
title="Course Roles"
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs i18n

Copy link
Author

Choose a reason for hiding this comment

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

updated, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: Waiting on Author

Development

Successfully merging this pull request may close these issues.

5 participants