feat: support unit preview in learning MFE (#35747)
* feat: update preview url to direct to mfe * fix: use url builder instead of string formatter * fix: url redirect for never published units * fix: remove 404 error when not a preview or staff * feat: update sequence metadata to allow draft branch
This commit is contained in:
@@ -117,7 +117,7 @@ class HomePageCoursesViewTest(CourseTestCase):
|
||||
"courses": [{
|
||||
"course_key": course_id,
|
||||
"display_name": self.course.display_name,
|
||||
"lms_link": f'//{settings.LMS_BASE}/courses/{course_id}/jump_to/{self.course.location}',
|
||||
"lms_link": f'{settings.LMS_ROOT_URL}/courses/{course_id}/jump_to/{self.course.location}',
|
||||
"number": self.course.number,
|
||||
"org": self.course.org,
|
||||
"rerun_link": f'/course_rerun/{course_id}',
|
||||
@@ -144,7 +144,7 @@ class HomePageCoursesViewTest(CourseTestCase):
|
||||
OrderedDict([
|
||||
("course_key", course_id),
|
||||
("display_name", self.course.display_name),
|
||||
("lms_link", f'//{settings.LMS_BASE}/courses/{course_id}/jump_to/{self.course.location}'),
|
||||
("lms_link", f'{settings.LMS_ROOT_URL}/courses/{course_id}/jump_to/{self.course.location}'),
|
||||
("number", self.course.number),
|
||||
("org", self.course.org),
|
||||
("rerun_link", f'/course_rerun/{course_id}'),
|
||||
|
||||
@@ -62,7 +62,7 @@ class HomePageCoursesViewV2Test(CourseTestCase):
|
||||
OrderedDict([
|
||||
("course_key", course_id),
|
||||
("display_name", self.course.display_name),
|
||||
("lms_link", f'//{settings.LMS_BASE}/courses/{course_id}/jump_to/{self.course.location}'),
|
||||
("lms_link", f'{settings.LMS_ROOT_URL}/courses/{course_id}/jump_to/{self.course.location}'),
|
||||
("cms_link", f'//{settings.CMS_BASE}{reverse_course_url("course_handler", self.course.id)}'),
|
||||
("number", self.course.number),
|
||||
("org", self.course.org),
|
||||
@@ -76,7 +76,7 @@ class HomePageCoursesViewV2Test(CourseTestCase):
|
||||
("display_name", self.archived_course.display_name),
|
||||
(
|
||||
"lms_link",
|
||||
f'//{settings.LMS_BASE}/courses/{archived_course_id}/jump_to/{self.archived_course.location}'
|
||||
f'{settings.LMS_ROOT_URL}/courses/{archived_course_id}/jump_to/{self.archived_course.location}'
|
||||
),
|
||||
(
|
||||
"cms_link",
|
||||
@@ -139,7 +139,7 @@ class HomePageCoursesViewV2Test(CourseTestCase):
|
||||
self.assertEqual(response.data["results"]["courses"], [OrderedDict([
|
||||
("course_key", str(self.course.id)),
|
||||
("display_name", self.course.display_name),
|
||||
("lms_link", f'//{settings.LMS_BASE}/courses/{str(self.course.id)}/jump_to/{self.course.location}'),
|
||||
("lms_link", f'{settings.LMS_ROOT_URL}/courses/{str(self.course.id)}/jump_to/{self.course.location}'),
|
||||
("cms_link", f'//{settings.CMS_BASE}{reverse_course_url("course_handler", self.course.id)}'),
|
||||
("number", self.course.number),
|
||||
("org", self.course.org),
|
||||
@@ -164,7 +164,11 @@ class HomePageCoursesViewV2Test(CourseTestCase):
|
||||
("display_name", self.archived_course.display_name),
|
||||
(
|
||||
"lms_link",
|
||||
f'//{settings.LMS_BASE}/courses/{str(self.archived_course.id)}/jump_to/{self.archived_course.location}',
|
||||
'{url_root}/courses/{course_id}/jump_to/{location}'.format(
|
||||
url_root=settings.LMS_ROOT_URL,
|
||||
course_id=str(self.archived_course.id),
|
||||
location=self.archived_course.location
|
||||
),
|
||||
),
|
||||
("cms_link", f'//{settings.CMS_BASE}{reverse_course_url("course_handler", self.archived_course.id)}'),
|
||||
("number", self.archived_course.number),
|
||||
@@ -190,7 +194,11 @@ class HomePageCoursesViewV2Test(CourseTestCase):
|
||||
("display_name", self.archived_course.display_name),
|
||||
(
|
||||
"lms_link",
|
||||
f'//{settings.LMS_BASE}/courses/{str(self.archived_course.id)}/jump_to/{self.archived_course.location}',
|
||||
'{url_root}/courses/{course_id}/jump_to/{location}'.format(
|
||||
url_root=settings.LMS_ROOT_URL,
|
||||
course_id=str(self.archived_course.id),
|
||||
location=self.archived_course.location
|
||||
),
|
||||
),
|
||||
("cms_link", f'//{settings.CMS_BASE}{reverse_course_url("course_handler", self.archived_course.id)}'),
|
||||
("number", self.archived_course.number),
|
||||
|
||||
Reference in New Issue
Block a user