feat: add enrollment action slots for mitxonline instructor dashboard MFE#119
Open
Anas12091101 wants to merge 2 commits into
Open
feat: add enrollment action slots for mitxonline instructor dashboard MFE#119Anas12091101 wants to merge 2 commits into
Anas12091101 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds MITx Online-specific permission gating for instructor-dashboard enrollment actions.
Changes:
- Replaces default enrollment buttons with permission-gated variants.
- Registers the override in development and production configs.
- Upgrades the instructor-dashboard dependency.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
EnrollmentActions.tsx |
Implements gated enrollment buttons. |
instructor-dashboard/index.tsx |
Registers the replacement slot widget. |
site.config.dev.tsx |
Enables the override in development. |
site.config.build.tsx |
Enables the override in production. |
package.json |
Updates the dashboard dependency. |
package-lock.json |
Locks updated dependencies. |
Files not reviewed (1)
- deployments/mit-ol/mfe_slot_config/frontend/mitxonline/package-lock.json: Generated file
Comment on lines
+51
to
+54
| 'Add Beta Testers', | ||
| onAddBetaTesters, | ||
| 'mitxonline-add-beta-testers-disabled', | ||
| 'You do not have permission to add beta testers to this course.', |
Comment on lines
+59
to
+62
| 'Enroll Learners', | ||
| onEnrollLearners, | ||
| 'mitxonline-enroll-learners-disabled', | ||
| 'You do not have permission to enroll learners in this course.', |
| }, | ||
| "dependencies": { | ||
| "@openedx/frontend-app-instructor-dashboard": "^1.0.0-alpha", | ||
| "@openedx/frontend-app-instructor-dashboard": "^1.1.0-alpha", |
| // factory's ungated default. | ||
| // --------------------------------------------------------------------------- | ||
|
|
||
| export function createMitxOnlineInstructorDashboardApp(): App { |
|
|
||
| return ( | ||
| <OverlayTrigger placement="top" overlay={<Tooltip id={tooltipId}>{tooltip}</Tooltip>}> | ||
| <span className="d-inline-block" tabIndex={0}>{button}</span> |
asadali145
reviewed
Jul 22, 2026
asadali145
left a comment
Contributor
There was a problem hiding this comment.
I have noticed that the instructor can unenroll learner using the enrollments table. Do we want to allow instructor to unenroll learners?
Enrollments tab displays the list of enrolled learners. We have 2 options:L
- Disable enrollments tab completely for non-admin. This should be simpler.
- R&D and modify the table to disable the unenroll button. Or maybe an event listener or do it via styles maybe?
CC: @pdpinch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
https://github.com/mitodl/hq/issues/11861
Description (What does it do?)
Adds a MITx Online–only override of the instructor dashboard's enrollment actions slot.
The upstream
@openedx/frontend-app-instructor-dashboardMFE now ships an overridable slot aroundthe Enroll Learners and Add Beta Testers buttons. This PR registers a MITx Online widget
into that slot (via
WidgetOperationTypes.REPLACE) that gates each button by permission,reproducing the legacy MITx Online instructor dashboard:
permissions.admin/is_staff)permissions.instructor)A button the user cannot use stays visible but disabled, with an explanatory tooltip. The modals
stay owned by the MFE's Enrollments page — the widget only renders the buttons and calls the
handlers the slot passes in.
Scope & dependency:
mitxonline/src/instructor-dashboard/); xpro and mitx keep the MFE's ungated default.@openedx/frontend-app-instructor-dashboardfor mitxonline to^1.1.0-alpha(1.1.0-alpha.1is the first release exposing the slot exports).Screenshots (if appropriate):
Default

Custom

How can this be tested?
frontend-app-instructor-dashboard@1.1.0-alpha.1).Additional Context
enrollmentActionsSlotId,enrollmentActionsWidgetId, andEnrollmentActionsSlotProps— available from1.1.0-alpha.1.admin/instructorpermission flags already come from the instructor course-info API, so no backend change is required for this behavior.