Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Remove Legacy Preview Functionality #36460

Open
wants to merge 6 commits into
base: feanil/remove_courseware_sock
Choose a base branch
from

Conversation

feanil
Copy link
Contributor

@feanil feanil commented Mar 28, 2025

BREAKING CHANGE: The learning MFE now supports preview functionality natively and it is no longer necessary to use a different domain on the LMS to render a preview of course content. Visiting the preview domain will no longer give you a different view of the course content.

See openedx/frontend-app-learning#1455 for more details.

This PR removes the legacy functionality, a side-effect of this is that saved links (including bookmarks) to the legacy preview URLs will not redirect to the MFE preview URLs as mentions of that domain have been removed.

This PR depends on #36436 and #36430 to merge first.

There are a few more mentions but these are all the ones that don't need
major further followup.

BREAKING CHANGE: The learning MFE now supports preview functionality
natively and it is no longer necessary to use a different domain on the
LMS to render a preview of course content.

See openedx/frontend-app-learning#1455 for
more details.
@feanil feanil changed the base branch from master to feanil/remove_courseware_sock March 28, 2025 21:45
@feanil feanil force-pushed the feanil/drop_legacy_preview branch from 3eed306 to 4f9b60b Compare March 31, 2025 12:28
feanil added 5 commits March 31, 2025 11:38
Since we're no longer using a separate domain, that check always
returned false.  Remove it and update any places/tests where it is used.
With the removal of the preview check this function is also a no-op now
so drop calls to it and update the places where it is called to not
change other behavior.
The CoursewareIndex view is going to be removed eventually but for now
we're focusing on removing the PREVIEW_LMS_BASE setting.  With this
change, if someone tries to load the legacy courseware URL from the
preview domain it will no longer redirect them to the MFE preview.

This is not a problem that will occur for users coming from existing
studio links because those links have already been updated to go
directly to the new urls.

The only way this path could execute is if someone goes directly to the
old Preview URL that they saved off platform somewhere.  eg. If they
bookmarked it for some reason.

BREAKING CHANGE: Saved links (including bookmarks) to the legacy preview
URLs will no longer redirect to the MFE preview URLs.
This test helper was setting the preview mode for tests by changing the
hostname that was set while tests were running.  This was mostly not
being used to test preview but to run a bunch of legacy courseware tests
while defaulting to the new learning MFE for the courseware.

This commit updates various tests in the `courseware` app to not rely on
the fact that we're in preview to test legacy courseware behavior and
instead directly patches either the `_redirect_to_learning_mfe` function
or uses the `_get_legacy_courseware_url` or both to be able to have the
tests continue to test the legacy coursewary.

This will hopefully make the tests more accuarte even though hopefully
we'll just be removing many of them soon as a part of the legacy
courseware cleanup.

We're just doing the preview removal separately to reduce the number of
things that are changing at once.
With the other recent cleanup, this function is no longer being
referenced by anything so we can just drop it.
@feanil feanil force-pushed the feanil/drop_legacy_preview branch from 4f9b60b to 5ee3ecd Compare March 31, 2025 15:38
@feanil feanil changed the title feanil/drop legacy preview feat!: Remove Legacy Preview Functionality Mar 31, 2025
@feanil feanil marked this pull request as ready for review March 31, 2025 16:41
@feanil feanil requested a review from kdmccormick as a code owner March 31, 2025 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant