refactor: centralize checks for canonical courseware experience & URL (#26815)
Centralize the logic for choosing between MFE and Legacy-frontend courseware within three new functions: * courseware_mfe_is_active * courseware_mfe_is_visible * courseware_legacy_is_visible This allows us to create another new function: * get_courseware_url which can be called anywhere in LMS/Studio to get the canonical URL to courseware content (whether it be MFE or Legacy). In future commits we we begin using get_courseware_url throughout the platform. TNL-7796
Showing
- common/djangoapps/student/tests/test_models.py 2 additions, 1 deletioncommon/djangoapps/student/tests/test_models.py
- lms/djangoapps/courseware/tests/test_views.py 9 additions, 7 deletionslms/djangoapps/courseware/tests/test_views.py
- lms/djangoapps/courseware/testutils.py 1 addition, 1 deletionlms/djangoapps/courseware/testutils.py
- lms/djangoapps/courseware/toggles.py 63 additions, 3 deletionslms/djangoapps/courseware/toggles.py
- lms/djangoapps/courseware/views/index.py 20 additions, 33 deletionslms/djangoapps/courseware/views/index.py
- lms/djangoapps/courseware/views/views.py 1 addition, 1 deletionlms/djangoapps/courseware/views/views.py
- openedx/core/djangoapps/courseware_api/views.py 9 additions, 20 deletionsopenedx/core/djangoapps/courseware_api/views.py
- openedx/features/course_experience/tests/test_url_helpers.py 257 additions, 0 deletionsopenedx/features/course_experience/tests/test_url_helpers.py
- openedx/features/course_experience/url_helpers.py 102 additions, 13 deletionsopenedx/features/course_experience/url_helpers.py
Loading
Please register or sign in to comment