feat: Add Track Selection API for Learning MFE - #404
Open
viv-helix wants to merge 9 commits into
Open
Conversation
…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.
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.
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
New API endpoint —
GET 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.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-selectionroute instead of rendering the Django template.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
Testing
ChooseModeViewrenders as before, API returns 404.Rollout
Enable
course_home.course_home_mfe_track_selectionper-course or globally once the corresponding frontend plugin is deployed.Ticket