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

Support static asset display in the Learning Core XBlock runtime #35659

Closed
ormsbee opened this issue Oct 16, 2024 · 0 comments
Closed

Support static asset display in the Learning Core XBlock runtime #35659

ormsbee opened this issue Oct 16, 2024 · 0 comments
Assignees

Comments

@ormsbee
Copy link
Contributor

ormsbee commented Oct 16, 2024

Background

After the merge of #35639, we have the ability to serve static assets from Learning Core, but we haven't hooked it into the Learning Core XBlock runtime so that we can display it properly. A draft of this functionality is available in _lookup_asset_url from this older, abandoned static asset PR, but that pre-dates the version-awareness that was added in #35626.

Acceptance Criteria

Implement _lookup_asset_url borrowing from the original draft implementation of this functionality, but checking for the block. _runtime_requested_version in order to figure out which version we should be pulling it from. Add tests.

This can be tested manually by using the add_assets_to_component management command to add/replace/delete images.

So the steps would be:

  1. Create an HTML component in a Library, and specify a /static/test.jpeg image inside of it using the raw HTML editor.
  2. Use the add_assets_to_component management command to manually add the test.jpeg asset.
  3. Verify it shows up in the library preview.
  4. Use the add_assets_to_component management command to change the test.jpeg asset.
  5. Verify the new asset shows up in the library preview.
  6. Verify the old asset shows up when referencing the embed URL with the old version of the component.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants