[BD-04] Create CustomTagTemplateBlock, convert TranslateCustomTagDescriptor to XBlock and remove RawDescriptor#26973
Conversation
|
Thanks for the pull request, @symbolist! I've created BLENDED-791 to keep track of it in Jira. More details are on the BD-04 project page. When this pull request is ready, tag your edX technical lead. |
bf4f6a3 to
beb7b92
Compare
In https://github.com/edx/edx-platform/pull/25955 `HiddenDescriptor` (which was a subclass of `RawDescriptor` with a custom `student_view()`) was converted to an XBlock. It is used as the `default_class` by the `CachingDescriptorSystem` classes. However `RawDescriptor` is still being used by `XMLModuleStore`. This has been replaced by `HiddenDescriptor` as well.
beb7b92 to
23d1e5b
Compare
| return system.process_xml(etree.tostring(xml_object)) | ||
|
|
||
|
|
||
| class TranslateCustomTagDescriptor(XModuleDescriptor): # lint-amnesty, pylint: disable=abstract-method, missing-class-docstring |
There was a problem hiding this comment.
Moved it to template_module.py.
|
|
||
| class CustomTagBlock( | ||
|
|
||
| class CustomTagTemplateBlock( # pylint: disable=abstract-method |
There was a problem hiding this comment.
CustomTagDescriptor inherited from RawDescriptor and custom_tag_template pointed to RawDescriptor as well. So I have made this the base class and CustomTagBlock inherited from it.
|
|
||
| # support for legacy OLX format - consumed by XmlParserMixin.load_metadata | ||
| metadata_translations = dict(RawDescriptor.metadata_translations) | ||
| metadata_translations = dict(XmlParserMixin.metadata_translations) |
There was a problem hiding this comment.
metadata_translations is specified in only two places: XModuleDescriptorToXBlockMixin and XmlParserMixin. Both have the same values.
|
@ormsbee @kdmccormick Hopefully this is going to be the last one! It is ready for review. 🙂 |
|
Wohoo! We'll take a look soon 😄 |
|
So way back when the behavior when you tried to import something that was completely unrecognized (like a |
|
Your PR has finished running tests. There were no failures. |
|
There are two cases of that and I am afraid both are kind of broken:
This behavior hasn't changed in this PR and was the same before https://github.com/edx/edx-platform/pull/25955 (multiple people tested the behavior as part of the testing instructions). |
|
Ugh. Okay. Well, as long as this isn't a regression, I'm definitely not going to hold it up over that. There's so much we need to fix in the whole import/export stack of things... 🔧 |
|
I'll merge this in the morning. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
Description
CustomTagTemplateBlockfor use withCustomTagBlockinstead ofRawDescriptor.TranslateCustomTagDescriptortoTranslateCustomTagBlock.HiddenDescriptor(which was a subclass ofRawDescriptorwith a customstudent_view()) was converted to an XBlock. It is used as thedefault_classby theCachingDescriptorSystemclasses. HoweverRawDescriptoris still being used byXMLModuleStore. This has been replaced byHiddenDescriptoras well.RawDescriptorsince it is no longer used.Part of XModule to XBlock Conversion work.
Testing Instructions
masterbranch.Custom Tag Unitwithhtml,custom_tag,imageandbookXBlocks and thePoll Unitwith apoll_questionXBlock.http://localhost:18010/admin/xblock_django/xblockconfiguration/add/and add an entry forpoll_questionwith it set to NOT enabled.Poll Unitand verify that the following message is shown instead of the XBlock: "ERROR: "poll_question" is an unknown component type. This component will be hidden in LMS."pip -e common/lib/xmoduleinmake studio-shelland then domake lms-restartandmake-studio-restart.poll_questionXBlock should have been imported in but the error message should show in its place: "ERROR: "poll_question" is an unknown component type. This component will be hidden in LMS."Poll Unitthepoll_questionXBlock will be hidden.verticalandcustom_tagsdir content is the same as before. However thepoll_questiondir should NOT be present (because that XBlock could not be exported).Screenshots
Custom Tag Unit in Studio
Custom Tag Unit in LMS
Poll Unit in Studio after Poll XBlock has been disabled
Poll Unit in LMS after Poll XBlock has been disabled
MRO Analysis