Skip to content

feat: add step 2 for the role assignment wizard #111

Draft
bra-i-am wants to merge 9 commits intoopenedx:masterfrom
eduNEXT:bc/add-role-assignment-wizard-2
Draft

feat: add step 2 for the role assignment wizard #111
bra-i-am wants to merge 9 commits intoopenedx:masterfrom
eduNEXT:bc/add-role-assignment-wizard-2

Conversation

@bra-i-am
Copy link
Copy Markdown
Contributor

@bra-i-am bra-i-am commented Mar 27, 2026

Caution

This PR is blocked by #109. Once that PR is closed, only the changes related to this PR will be shown

This PR implements the Define Application Scope step of the Assign Role Wizard, completing the scope-selection UI

What's included:

API layer (data/api.ts)

  • Added getScopes() — paginated endpoint with search, org, context_type,
    and management_permission_only filters.
  • Added getOrganizations() — fetches available organizations for the filter dropdown.

Hooks (data/hooks.ts)

  • useScopes — infinite-query hook with cursor-based pagination (parses page
    from the next URL).
  • useOrganizations — standard query with 30-min stale time.
  • useManagedScopeOrgs — derives the set of orgs the current user can manage,
    used to gate aggregate scope items.

DefineApplicationScopeStep (wizard/DefineApplicationScopeStep.tsx)

  • Debounced search input (300 ms).
  • Organization filter dropdown; active filter shown as a Paragon Badge chip.
  • Scopes rendered grouped by organization via OrgSection (collapsible).
  • Aggregate scope items gated by management permissions:
    • org:<slug> — "All courses/libraries in this organization" (per-org managers).
    • * — "All courses/libraries in Platform" (platform managers only).
  • Infinite scroll via IntersectionObserver; loading spinners for initial load
    and paginated fetch.

LibrariesUserManager

  • Replaced the now-redundant AssignNewRoleTrigger component with a direct
    navigation button (/authz/assign-role?scope=<libraryId>&users=<username>).

Additional Information

Resolves #92

Screenshot

image

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

Thanks for the pull request, @bra-i-am!

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.

🔘 Update the status of your PR

Your PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate.


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 27, 2026
@bra-i-am bra-i-am changed the title Bc/add role assignment wizard 2 feat: implement DefineApplicationScopeStep with scope/org filtering and aggregate permissions Mar 27, 2026
@bra-i-am bra-i-am changed the title feat: implement DefineApplicationScopeStep with scope/org filtering and aggregate permissions feat: add step 2 for the role assignment wizard Mar 27, 2026
@bra-i-am bra-i-am force-pushed the bc/add-role-assignment-wizard-2 branch from 9ff96b8 to b193f35 Compare March 27, 2026 19:43
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 98.94459% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.79%. Comparing base (62ca5d2) to head (b193f35).

Files with missing lines Patch % Lines
...authz-module/wizard/DefineApplicationScopeStep.tsx 97.52% 3 Missing ⚠️
src/authz-module/wizard/AssignRoleWizard.tsx 98.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
+ Coverage   95.18%   96.79%   +1.61%     
==========================================
  Files          45       51       +6     
  Lines         913     1281     +368     
  Branches      181      302     +121     
==========================================
+ Hits          869     1240     +371     
+ Misses         42       39       -3     
  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.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Task - RBAC AuthZ - US: M2.8 Assign role wizard - Step 2 scope selection

3 participants