fix: Render Word cloud block editor in libraries [FC-0076] (#36199)

* fix: Render Word cloud and conditional block editor

- The xmodule-type to render is MetadataOnlyEditingDescriptor
- The xmodule type `MetadataOnlyEditingDescriptor` renders a `<div>` with the block metadata in the `data-metadata` attribute. But is necessary to call `XBlockEditorView.xblockReady()` to run the scripts to build the editor using the metadata.
- To call XBlockEditorView.xblockReady() we need a specific require.config

* fix: Adding save and cancel button

* fix: save with studio_submit of conditional_block and word_cloud_block

* test: Tests for studio_submit of conditional and word cloud

* revert: Delete studio_submit of conditional block. It is not supported

* style: Fix lint

---------

Co-authored-by: Navin Karkera <navin@opencraft.com>
This commit is contained in:
Chris Chávez
2025-02-19 07:35:55 -05:00
committed by GitHub
parent b7a2ffaab8
commit d29ff63e2c
4 changed files with 156 additions and 13 deletions

View File

@@ -78,7 +78,7 @@ function($, _, gettext, BaseView, XBlockView, MetadataView, MetadataCollection)
el: metadataEditor,
collection: new MetadataCollection(models)
});
if (xblock.setMetadataEditor) {
if (xblock && xblock.setMetadataEditor) {
xblock.setMetadataEditor(metadataView);
}
}