-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support static assets when copy/pasting between courses and libraries (…
…#35668) The biggest challenge is dealing with the mismatch between how Libraries store assets (per-Component) and how Courses store assets (global Files and Uploads space). To bridge this, we're going to kludge a component-local namespace in Files and Uploads by making use of the obscure feature that you can create folders there at an API level, even if no such UI exists. In this commit: * Assets work when copy-pasting between library components. * Assets work when copy-pasting from a library to a course, with the convention being to put that file in a subdirectory of the form: components/{block_type}/{block_id}/file. Note that the Studio course Files page still just shows the filename. * Assets work when copy-pasting from a course to a library. Top level assets are put into a static folder in the Component, per Learning Core conventions. Limitations: * Roundtrips don't work properly. * There's no normalized form, so directories will start nesting if you copy from library and paste into course, then copy the pasted thing and paste back into library, etc. This was deemed acceptable for Sumac. Low level stuff: * XBlockSerializerForLearningCore has been removed, with the url_name stripping functionality added as an optional param to XBlockSerializer (the other stuff was for children and "vertical" -> "unit" conversion, neither of which are relevant now). * url_name is now stripped out of anything added to the clipboard, so that we don't end up writing it in block.xml when it is redundant (and would be stripped out with the next write anyway). For the Libraries Relaunch Beta. This should not affect any site which has kept New Libraries disabled. Issue: openedx/frontend-app-authoring#1170
- Loading branch information
Showing
11 changed files
with
311 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.