feat!: drop legacy course home view and related code

This was the "outline tab" view of the course. Preceded by the
course info view, succeeded by the MFE outline tab.

In addition to the course home view itself, this drops related
features:
- Legacy version of Course Goals (MFE has a newer implementation)
- Course home in-course search (MFE has no search)

The old course info view and course about views survive for now.

This also drops a few now-unused feature toggles:
- course_experience.latest_update
- course_experience.show_upgrade_msg_on_course_home
- course_experience.upgrade_deadline_message
- course_home.course_home_use_legacy_frontend

With this change, just the progress and courseware tabs are still
supported in legacy form, if you opt-in with waffle flags. The
outline and dates tabs are offered only by the MFE.

AA-798
This commit is contained in:
Michael Terry
2022-03-15 09:32:14 -04:00
parent 0be6d3c8ab
commit be5c1a64d5
86 changed files with 194 additions and 5747 deletions

View File

@@ -9,14 +9,12 @@ from config_models.models import cache as config_cache
from django.conf import settings
from django.core.cache import cache as django_cache
from django.urls import reverse
from edx_toggles.toggles.testutils import override_waffle_flag
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
from common.djangoapps.student.tests.factories import UserFactory
from common.djangoapps.util.testing import UrlResetMixin
from lms.djangoapps.course_home_api.toggles import COURSE_HOME_USE_LEGACY_FRONTEND
from ..models import IPFilter, RestrictedCourse
from ..test_utils import restrict_course
@@ -24,7 +22,6 @@ from ..test_utils import restrict_course
@ddt.ddt
@skip_unless_lms
@override_waffle_flag(COURSE_HOME_USE_LEGACY_FRONTEND, active=True)
class EmbargoMiddlewareAccessTests(UrlResetMixin, ModuleStoreTestCase):
"""Tests of embargo middleware country access rules.
@@ -45,10 +42,7 @@ class EmbargoMiddlewareAccessTests(UrlResetMixin, ModuleStoreTestCase):
self.course = CourseFactory.create()
self.client.login(username=self.USERNAME, password=self.PASSWORD)
self.courseware_url = reverse(
'openedx.course_experience.course_home',
kwargs={'course_id': str(self.course.id)}
)
self.courseware_url = reverse('about_course', kwargs={'course_id': str(self.course.id)})
self.non_courseware_url = reverse('dashboard')
# Clear the cache to avoid interference between tests

View File

@@ -28,7 +28,7 @@ from openedx.core.djangoapps.schedules.models import Schedule, ScheduleExperienc
from openedx.core.djangoapps.schedules.utils import PrefixedDebugLoggerMixin
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
from openedx.core.djangolib.translation_utils import translate_date
from openedx.features.course_experience import course_home_url_name
from openedx.features.course_experience import course_home_url
LOG = logging.getLogger(__name__)
@@ -542,9 +542,8 @@ def _get_trackable_course_home_url(course_id):
Args:
course_id (CourseKey): The course to get the home page URL for.
U
Returns:
A relative path to the course home page.
A URL to the course home page.
"""
course_url_name = course_home_url_name(course_id)
return reverse(course_url_name, args=[str(course_id)])
return course_home_url(course_id)

View File

@@ -167,7 +167,7 @@ class TestCourseUpdateResolver(SchedulesResolverTestMixin, ModuleStoreTestCase):
'contact_mailing_address': '123 Sesame Street',
'course_ids': [str(self.course.id)],
'course_name': self.course.display_name,
'course_url': f'/courses/{self.course.id}/course/',
'course_url': f'http://learning-mfe/course/{self.course.id}/home',
'dashboard_url': '/dashboard',
'homepage_url': '/',
'mobile_store_urls': {},
@@ -258,7 +258,7 @@ class TestCourseNextSectionUpdateResolver(SchedulesResolverTestMixin, ModuleStor
'contact_mailing_address': '123 Sesame Street',
'course_ids': [str(self.course.id)],
'course_name': self.course.display_name,
'course_url': f'/courses/{self.course.id}/course/',
'course_url': f'http://learning-mfe/course/{self.course.id}/home',
'dashboard_url': '/dashboard',
'homepage_url': '/',
'mobile_store_urls': {},

View File

@@ -19,7 +19,7 @@ from opaque_keys.edx.locator import CourseLocator
from lms.djangoapps.verify_student.models import ManualVerification
from openedx.core.djangoapps.django_comment_common.models import assign_role
from openedx.core.djangoapps.user_authn.views.registration_form import AccountCreationForm
from openedx.features.course_experience import course_home_url_name
from openedx.features.course_experience import course_home_url
from common.djangoapps.student.helpers import (
AccountValidationError,
authenticate_new_user,
@@ -170,9 +170,9 @@ def auto_auth(request): # pylint: disable=too-many-statements
elif course_id:
# Redirect to the course homepage (in LMS) or outline page (in Studio)
try:
redirect_url = reverse(course_home_url_name(course_key), kwargs={'course_id': course_id})
redirect_url = reverse('course_handler', kwargs={'course_key_string': course_id}) # Studio
except NoReverseMatch:
redirect_url = reverse('course_handler', kwargs={'course_key_string': course_id})
redirect_url = course_home_url(course_key) # LMS
else:
# Redirect to the learner dashboard (in LMS) or homepage (in Studio)
try:

View File

@@ -206,13 +206,13 @@ class AutoAuthEnabledTestCase(AutoAuthTestCase, ModuleStoreTestCase):
enrollment = CourseEnrollment.objects.get(course_id=course_key)
assert enrollment.user.username == 'test'
# Check that the redirect was to the course info/outline page
# Check that the redirect was to the correct outline page for either lms or studio
if settings.ROOT_URLCONF == 'lms.urls':
url_pattern = '/course/'
expected_redirect_url = f'http://learning-mfe/course/{course_id}/home'
else:
url_pattern = f'/course/{str(course_key)}'
expected_redirect_url = f'/course/{course_id}'
assert response.url.endswith(url_pattern)
assert response.url == expected_redirect_url
def test_redirect_to_main(self):
# Create user and redirect to 'home' (cms) or 'dashboard' (lms)