Skip to content

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

@ormsbee

Description

@ormsbee

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions