* feat!: Remove all trivial mentions of PREVIEW_LMS_BASE
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 https://github.com/openedx/frontend-app-learning/issues/1455 for
more details.
* feat: Drop the `in_preview_mode` function.
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.
* feat: Drop courseware_mfe_is_active function.
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.
* feat!: Drop redirect to preview from the legacy courseware index.
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.
* test: Drop the set_preview_mode test helper.
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.
* test: Drop the `_get_urls_function`
With the other recent cleanup, this function is no longer being
referenced by anything so we can just drop it.
* test: Test student access to unpublihsed content.
Ensure that students can't get access to unpublished content.
* feat: library unit sync
* feat: create component link only for component xblocks
* feat: container link model
* feat: update downstream api views
* feat: delete extra components in container on sync (not working)
* fix: duplicate definitions of LibraryXBlockMetadata
* test: add a new integration test suite for syncing
* feat: partially implement container+child syncing
* fix: blockserializer wasn't always serializing all HTML block fields
* feat: handle reorder, addition and deletion of components in sync
Updates children components of unit in course based on upstream unit,
deletes removed component, adds new ones and updates order as per
upstream.
* feat: return unit upstreamInfo and disallow edits to units in courses that are sourced from a library (#773)
* feat: Add upstream_info to unit
* feat: disallow edits to units in courses that are sourced from a library (#774)
---------
Co-authored-by: Jillian Vogel <jill@opencraft.com>
Co-authored-by: Rômulo Penido <romulo.penido@gmail.com>
* docs: capitalization of XBlock
Co-authored-by: David Ormsbee <dave@axim.org>
* refactor: (minor) change python property name to reflect type better
* fix: lots of "Tried to inspect a missing...upstream link" warnings
when viewing a unit in Studio
* docs: mention potential REST API for future refactor
* fix: check if upstream actually exists before making unit read-only
* chore: fix camel-case var
* fix: test failure when mocked XBlock doesn't have UpstreamSyncMixin
---------
Co-authored-by: Braden MacDonald <braden@opencraft.com>
Co-authored-by: Chris Chávez <xnpiochv@gmail.com>
Co-authored-by: Jillian Vogel <jill@opencraft.com>
Co-authored-by: Rômulo Penido <romulo.penido@gmail.com>
Co-authored-by: Braden MacDonald <mail@bradenm.com>
Co-authored-by: David Ormsbee <dave@axim.org>
This flag was introduced to gate the rollout of moving the UI component for proctoring settings into the pages and resources view and was never cleaned up. At this point we should always be linking the the new page for proctoring settings.
* feat: Implement paste button
* chore: improve docs and add tests for python API
* fix: drive-by fix to use a better API for comparing XML
* feat: track which XBlock something was copied from
* feat: add tests
* feat: enable import linter so content_staging's public API is respected
* fix: error seen when trying to paste drag-and-drop-v2 blocks
* fix: use strip_text=True consistently for XML comparisons
* refactor: rename get_user_clipboard_status to get_user_clipboard
* feat: Better error reporting when pasting in Studio
* chore: convert new test suite to pytest assertions
* refactor: push READY status check into the API per review suggestion
* fix: use strip_text=True consistently for XML comparisons
* fix: store "copied_from_block" as a string to avoid Reference field issues
* fix: minor lint error
* refactor: move data types to data.py per OEP-49
* test: warn about dependencies from cms->openedx->lms and vice versa
* test: warn about importing from package's internal implementation code
* chore: Update some imports to use public APIs only
* chore: Update 'bookmarks' app to have stricter public API
* fix: we are sharing 'adapters' from olx_rest_api to content_staging
It took a while for me to understand why my setup.cfg setting was only
applying to some tests. Hopefully these comments will save someone else
some confusion.
Suppress them both in tests (via setup.py and pytest.ini)
and in management command & application runs
(via logsettings.py).
Developers aren't looking at these warnings; they'll be dealt with in a
formal process for upgrading Django. Suppress them for now so that
important information isn't lost in the noise.
I don't understand why this file needs to be ASCII, or why it was only a
problem recently for one installer, since this has been in this file
since 2014. But CRI-169 has a stack trace, and it's easy enough to make
the file ASCII.
* Added pytest-json-report plugin
- modifying app-opts in setup.cfg
- adding hook to all conftest.py files in repo
- setting report to be saved to test_root/log/warnings.json
- Writing custom logic to save json report to avoid overwrite if pytest called twice
This was created to allow us to easily parse through test warnings in jenkins