-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
XBlock asset support for new libraries experience (WIP) #35557
Conversation
@ormsbee I don't think we need to be using the LMS to render the previews today. I think it would actually make more sense to change to use Studio. The Authoring MFE really shouldn't be using the LMS APIs at all. In fact, I'd even like to find a way for the "preview published version" functionality (that we don't have yet) to use some CMS URL. |
TODO: Like get_block, we currently assume that we're using the Draft | ||
version. This should be a runtime parameter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably know this, but here in apps.py
is where we can set runtime parameters like "studio should default to DRAFT" and "LMS should default to PUBLISHED".
It would be very cool if we could later override this default using a context manager when needed, but I don't know if that's a safe way to implement such an override.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it sufficient to do Draft vs. Published, or should we be able to do any stored version (for the sake of seeing what changed)? (I was assuming we'd eventually need the latter.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being able to see any stored version would be great, so I think we should do that. But more often I'll just want to specify "latest draft" or "latest published" so I hope we can have both options.
My test instructions:
It works!! |
This PR now also relies on openedx/frontend-app-authoring#1349 (disables static asset substitution in the editor, and switches the preview embed window to point to Studio instead of LMS). |
Closing in favor of smaller PRs: |
A very hacky pass at getting Learning Core backed static assets to show up for libraries.
Things I need to look into:
static/
piece, but that might be useful.This depends on:
Also, in order for this to work at all, I had to comment out:
https://github.com/openedx/frontend-app-authoring/blob/c80483c0533a10e46c59e9bd28e02a7650720a61/src/editors/sharedComponents/TinyMceWidget/hooks.js#L103-L116
That frontend code was auto-replacing static asset references with links that would show up in the WYSIWG editor (by casting them to asset keys), and then changing them back into the original static references when saving. Unfortunately, the code doesn't understand v2 libraries and generates broken keys.