- Refactor of `test_containers.py` 8b9731dfa1
- Updates the `content_libraries/api/containers` and `content_libraries/rest_api` to support:
- Basic CRUD for sections and subsections as containers
- Basic CRUD support for section and subsection children
- Updates the `content/search` to support:
- Basic CRUD for sections and subsections as containers in the search index
- Basic CRUD support for section and subsection children in the search index
- Updates the `content_libraries/tests/test_containers.py` to test the new support
- Updates the `content/search/tests` to test the new support.
- I verified that the add/remove to collection works without major changes. Tests updated
Fixes an error that is triggered when trying to copy/pasting Drag-and-drop block into Courses.
When a block is pasted into a Course or Library, we perform a search/replace on block's data to replace any old static URLs with their new path. Ordinary blocks like HTML and Video have a simple string of data where static URLs may live, but DnDv2 blocks have a dict of data which can contain other dicts and lists of strings that need to be modified. Other XBlocks may have similarly complex structures, and so this fix will resolve them as well.
This fixes the issue by recursing into the data structure to locate all the strings where replacements may need to be made.
This fix helps Course Authors use content staging in their Courses.
* fix: TinyMCE editors in advanced block editors
* Sets baseUrl to avoid an error in: 86eee4b05d/xblock/utils/public/studio_edit.js (L52)
* Uncouple the listener func of the cancel button (see the comment)
* chore: Add `edx_sga` in `LIBRARY_ENABLED_BLOCKS`
* 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.
* fix: "[created] received a naive datetime"
* fix: leaky "isolation" of events was causing test failures
* fix: make lib events more specific, emit them async, handle hierarchy correctly
* chore: bump openedx-events to 10.2.0 for new library PUBLISHED events
- Clarify effects of enabling each policy.
- Document the thresholds and what policies they relate to.
- Express thresholds as floating point numbers to better hint at them not
being intended as integer values.
- Change toggle use case from temporary to open_edx for login policies (as
we're expecting to keep those toggles long term, as an optional feature).
- Remove links to private Jira tickets. (openedx Jira is now gone, and
these tickets are only present in 2U's private Atlassian instance.)
- Import LMS HIBP settings into CMS (rather than duplicating them) but
mark as unused.
* feat: store content.child_usage_keys in Container search document
Stores the draft children + published children (if applicable)
Related fixes:
* fix: lib_api.get_container does not take a "user" arg
* refactor: fetch_customizable_fields_from_container does not need a "user" arg
* refactor: moves tags_count into LibraryItem
because anything that appears in a library may be tagged.
* refactor: remove get_container_from_key from public API
API users must use get_container and ContainerMetadata.
* refactor: made set_library_item_collections take an entity_key string instead of
a PublishableEntity instance, so we don't need to fetch a Container object to call it.
* refactor: changed ContainerLink.update_or_create to take the container PK
instead of a Container object, since this is enough.
Added container_pk to ContainerMetadata to support this.
* refactor: update sync model helper function docs
Adds some comments to explain certain confusing sections
* refactor: sync library content method
* feat: use edited_on block field
* test: modified field in course block index
* fix: extract uncommon methods to child class from base
* 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>
We add a a new Waffle toggle:
* legacy_studio.logged_out_home
Unless enabled, unauthenticated users accessing Studio will now be sent
to the login page, and then redirected to the logged-in Studio home (the
course listing). By the Ulmo release, the Waffle will be removed along
with the howitworks page, and the new redirect-to-login behavior will
become the only available behavior.
The howitworks page is implemented as a legacy frontend, and we are not
seeing enough value in it to justify a rewrite in React. Via the DEPR
process we confirmed that the new behavior is acceptable, or even
preferable, as it removes edX.org-oriented language from the community
release and reduces the number of clicks needed for Studio users to log
in. We add an a new Waffle toggles
Part of: https://github.com/openedx/edx-platform/issues/36269
which is part of: https://github.com/openedx/edx-platform/issues/36275
* It was this error 'Uncaught TypeError: el.timepicker is not a function' while rendering the editor. It's fixed adding the timepicker pluging in xblock_v2/xblock_iframe.html
* Added '.openassessment_cancel_button' and '.openassessment_save_button' as action buttons.
* Use openassessment manifest.json to load css from dist
A new application has been created, described in this ADR:
https://github.com/openedx/edx-platform/pull/36545
have been created, as well as related models for mapping original content and
new content created during the import process. Python and Django APIs, as well
as a Django admin interface, will soon follow.
* fix: don't allow pasting xblocks with children into libraries
* fix: IntegrityError: "Column 'md5_hash' cannot be null"
* feat: allow pasting a unit from a course into a library
* feat: auto-generate a nice block_id when pasting into a library
* test: add test for pasting unit from course into library
* fix: better handle potentially missing display_names during paste
* chore: clarifications and import cleanups
This commit adds a new message handler to the XBlockContainerPage
CMS view, that allows the MFE to send a signal to the IFrame
and scroll to a specific XBlock.
This PR adds contentstore.use_react_markdown_editor course waffle flag in cms.
This flag helps in enabling the markdown editor in the authoring mfe.
This PR also adds the markdown_edited field in the Problem Xblock to persist the
user's choice of switching to the markdown editor on the authoring MFE.
More details in the authoring MFE PR: openedx/frontend-app-authoring#1805
There was a waffle flag `contentstore.enable_studio_content_api`,
intended to gate the "experimental" REST APIs at
`<CMS_ROOT>/api/contentstore/v{0,1,2}/*`. In practice, these APIs are no
longer experimental: for the past few named releases, they have been
enabled in Tutor and used to power the Authoring MFE.
We are making the Authoring MFE default-on in all Open edX sites
starting in Teak, with the legacy authoring frontend slated for removal
by Ulmo. Therefore, we need to remove flag which is gating the REST API.
We are _not_ introducing a temporary opt-out toggle, as we do need feel
it is necessary.
Part of: https://github.com/openedx/edx-platform/issues/36275