You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"As a content author, when I copy an xblock, I expect the tags to be included in the staged data (clipboard) in the agreed up serialized format in the OLX"
Following the discovery performed in #165, this is the implementation of the Copy XBlocks step. See here for more information about the OLX tags format. This also depends on #183 for the "Export ID".
This step implements the changes needed to store the tags in the clipboard when an XBlock is copied:
The POST request handler in the content_staging view handles the request to copy content to the user’s clipboard. Within that handler, the serialize_xblock_to_olx method is called to serialize the block data utilizing the XBlockSerializer.
We need to modify the XBlockSerializer to account for serializing the xblock’s tags so they can also be stored in the user’s clipboard.
Since XBlocks could have children, we need to take in account the tags of the children as well.
To fetch the tags, we call the get_content_tags API method for the XBlock (and each child). (We only want to include the values of the tags along with the ID and name of the taxonomy they belong to, rather than the full ContentObjectTag instances. Values are guaranteed to be unique by the DB)
We need to make changes to _serialize_normal_block and _serialize_html_block since they are handled as separate cases:
_serialize_normal_block: Internally calls the add_xml_to_node, we can override this method by creating a new CMS XBlock mixin (TaggedBlockMixin) to include the serialized tags/taxonomies by calling the method defined in the previous step. We’d then need to add the newly created mixin to XBLOCK_MIXINS (likely at the top since the order of inheritance matters).
_serialize_html_block: Call the method defined in the previous step to serialize the tags/taxonomies
Implement tests to verify this was implemented correctly
The text was updated successfully, but these errors were encountered:
"As a content author, when I copy an xblock, I expect the tags to be included in the staged data (clipboard) in the agreed up serialized format in the OLX"
Following the discovery performed in #165, this is the implementation of the Copy XBlocks step. See here for more information about the OLX tags format. This also depends on #183 for the "Export ID".
Link to discovery.
Acceptance Criteria:
This step implements the changes needed to store the tags in the clipboard when an XBlock is copied:
serialize_xblock_to_olx
method is called to serialize the block data utilizing the XBlockSerializer._serialize_normal_block: Internally calls the add_xml_to_node, we can override this method by creating a new CMS XBlock mixin (TaggedBlockMixin) to include the serialized tags/taxonomies by calling the method defined in the previous step. We’d then need to add the newly created mixin to XBLOCK_MIXINS (likely at the top since the order of inheritance matters).
_serialize_html_block: Call the method defined in the previous step to serialize the tags/taxonomies
The text was updated successfully, but these errors were encountered: