diff --git a/src/constants.js b/src/constants.js index ac10aa3044..caac22bced 100644 --- a/src/constants.js +++ b/src/constants.js @@ -22,11 +22,13 @@ export const ROUTES = { UNSUBSCRIBE: '/goal-unsubscribe/:token', REDIRECT: '/redirect/*', DASHBOARD: 'dashboard', + ENTERPRISE_LEARNER_DASHBOARD: 'enterprise-learner-dashboard', CONSENT: 'consent', }; export const REDIRECT_MODES = { DASHBOARD_REDIRECT: 'dashboard-redirect', + ENTERPRISE_LEARNER_DASHBOARD_REDIRECT: 'enterprise-learner-dashboard-redirect', CONSENT_REDIRECT: 'consent-redirect', HOME_REDIRECT: 'home-redirect', SURVEY_REDIRECT: 'survey-redirect', diff --git a/src/courseware/CoursewareRedirectLandingPage.jsx b/src/courseware/CoursewareRedirectLandingPage.jsx index 1d90f50b2e..4f90361832 100644 --- a/src/courseware/CoursewareRedirectLandingPage.jsx +++ b/src/courseware/CoursewareRedirectLandingPage.jsx @@ -29,6 +29,17 @@ const CoursewareRedirectLandingPage = () => ( path={ROUTES.DASHBOARD} element={} /> + + + + } + /> } diff --git a/src/courseware/RedirectPage.jsx b/src/courseware/RedirectPage.jsx index f1189a47fe..315d918608 100644 --- a/src/courseware/RedirectPage.jsx +++ b/src/courseware/RedirectPage.jsx @@ -14,20 +14,26 @@ const RedirectPage = ({ const location = useLocation(); const { consentPath } = queryString.parse(location?.search); - const BASE_URL = getConfig().LMS_BASE_URL; + const { + LMS_BASE_URL, + ENTERPRISE_LEARNER_PORTAL_URL, + } = getConfig(); switch (mode) { case REDIRECT_MODES.DASHBOARD_REDIRECT: - global.location.assign(`${BASE_URL}${pattern}${location?.search}`); + global.location.assign(`${LMS_BASE_URL}${pattern}${location?.search}`); + break; + case REDIRECT_MODES.ENTERPRISE_LEARNER_DASHBOARD_REDIRECT: + global.location.assign(ENTERPRISE_LEARNER_PORTAL_URL); break; case REDIRECT_MODES.CONSENT_REDIRECT: - global.location.assign(`${BASE_URL}${consentPath}`); + global.location.assign(`${LMS_BASE_URL}${consentPath}`); break; case REDIRECT_MODES.HOME_REDIRECT: global.location.assign(generatePath(pattern, { courseId })); break; default: - global.location.assign(`${BASE_URL}${generatePath(pattern, { courseId })}`); + global.location.assign(`${LMS_BASE_URL}${generatePath(pattern, { courseId })}`); } return null; diff --git a/src/shared/access.js b/src/shared/access.js index 4937fe7bd5..49cd30e4b4 100644 --- a/src/shared/access.js +++ b/src/shared/access.js @@ -15,6 +15,9 @@ export function getAccessDeniedRedirectUrl(courseId, activeTabSlug, courseAccess const startDate = (new Intl.DateTimeFormat(getLocale())).format(new Date(start)); url = `/redirect/dashboard?notlive=${startDate}`; break; + case 'course_not_started_enterprise_learner': + url = '/redirect/enterprise-learner-dashboard'; + break; case 'survey_required': url = `/redirect/survey/${courseId}`; break;