Skip to content

feat: Add Track Selection API for Learning MFE - #404

Open
viv-helix wants to merge 9 commits into
release-ulmofrom
feat/LP-837
Open

feat: Add Track Selection API for Learning MFE#404
viv-helix wants to merge 9 commits into
release-ulmofrom
feat/LP-837

Conversation

@viv-helix

@viv-helix viv-helix commented Jul 27, 2026

Copy link
Copy Markdown
Member

Description

Adds API endpoint for the track selection (upgrade) page so it can be rendered in the Learning MFE via a plugin slot, replacing the legacy server-rendered Django template.

What it does

  1. New API endpointGET api/course_home/track_selection/{course_key} returns JSON payload with course modes, pricing, and verified track links needed by the MFE to render the track selection UI.

  2. Waffle flag gating — Introduces course_home.course_home_mfe_track_selection (CourseWaffleFlag, default off). When enabled for a course:

    • ChooseModeView.get() redirects to the Learning MFE's #track-selection route instead of rendering the Django template.
    • The new API endpoint becomes active (returns 404 otherwise).
  3. Shared data layer — Extracts track selection logic into track_selection_data.py so the same redirect/gating decisions used by the legacy view are available to the API without duplication.

Changes

File Change
track_selection_data.py New module — builds MFE-ready track selection payload
views.py Redirect to MFE when flag is active
toggles.py New waffle flag + helper
views.py New DRF view
urls.py Wire up URL pattern

Testing

  • Flag off (default): zero behavior change — existing ChooseModeView renders as before, API returns 404.
  • Flag on: legacy GET redirects to Learning MFE; MFE fetches data from new endpoint.

Rollout

Enable course_home.course_home_mfe_track_selection per-course or globally once the corresponding frontend plugin is deployed.

Ticket

@viv-helix viv-helix changed the title feat: Add Track Selection BFF API for Learning MFE feat: Add Track Selection API for Learning MFE Jul 27, 2026
…rors

- Added `submit_track_selection_choice` function to process track selection submissions.
- Introduced `TrackSelectionSubmissionError` dataclass for error handling.
- Updated `TrackSelectionView` to support POST requests for track selection.
- Modified tests to cover new POST functionality and error scenarios.
Remove unused RetrieveAPIView import and add post() docstring so pylint common passes in CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant