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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user