fix: remove support for the legacy courseware pages
Access to learners for these pages has been removed, so we don't need to keep any support for it around. Simplifies some code paths.
This commit is contained in:
committed by
Michael Terry
parent
5461c08169
commit
bbff8e719e
@@ -4,7 +4,7 @@ import { getLocale } from '@edx/frontend-platform/i18n';
|
||||
// This function inspects an access denied error and provides a redirect url (looks like a /redirect/... path),
|
||||
// which then renders a nice little message while the browser loads the next page.
|
||||
// This is basically a frontend version of check_course_access_with_redirect in the backend.
|
||||
export function getAccessDeniedRedirectUrl(courseId, activeTabSlug, canLoadCourseware, courseAccess, start, unitId) {
|
||||
export function getAccessDeniedRedirectUrl(courseId, activeTabSlug, courseAccess, start) {
|
||||
let url = null;
|
||||
switch (courseAccess.errorCode) {
|
||||
case 'audit_expired':
|
||||
@@ -24,11 +24,7 @@ export function getAccessDeniedRedirectUrl(courseId, activeTabSlug, canLoadCours
|
||||
case 'authentication_required':
|
||||
case 'enrollment_required':
|
||||
default:
|
||||
// if the learner has access to the course, but it is not enabled in the mfe, there is no
|
||||
// error message, canLoadCourseware will be false.
|
||||
if (activeTabSlug === 'courseware' && canLoadCourseware === false && unitId) {
|
||||
url = `/redirect/courseware/${courseId}/unit/${unitId}`;
|
||||
} else if (activeTabSlug !== 'outline') {
|
||||
if (activeTabSlug !== 'outline') {
|
||||
url = `/course/${courseId}/home`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,13 +47,13 @@ Factory.define('block')
|
||||
},
|
||||
)
|
||||
.attr(
|
||||
'legacy_web_url',
|
||||
['legacy_web_url', 'host', 'courseId', 'id'],
|
||||
'lms_web_url',
|
||||
['lms_web_url', 'host', 'courseId', 'id'],
|
||||
(url, host, courseId, id) => {
|
||||
if (url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
return `${host}/courses/${courseId}/jump_to/${id}?experience=legacy`;
|
||||
return `${host}/courses/${courseId}/jump_to/${id}`;
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user