From 23abea77edb4a80dda10fe59d649edb5229e5fbf Mon Sep 17 00:00:00 2001 From: salman2013 Date: Mon, 15 Dec 2025 11:31:57 +0500 Subject: [PATCH 1/6] chore: separate htmlblockmixin base --- xblocks_contrib/html/html.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/xblocks_contrib/html/html.py b/xblocks_contrib/html/html.py index ab1d9fa3..64f2807f 100644 --- a/xblocks_contrib/html/html.py +++ b/xblocks_contrib/html/html.py @@ -143,13 +143,12 @@ def stringify_children(node): # This makes our block more resilient. It won't crash in test environments # where the user service might not be available. @XBlock.wants("user") -class HtmlBlock(LegacyXmlMixin, XBlock): +class HtmlBlockMixin(LegacyXmlMixin, XBlock): """ - The HTML XBlock. + The HTML XBlock mixin. + This provides the base class for all Html-ish blocks (including the HTML XBlock). """ - - # Indicates that this XBlock has been extracted from edx-platform. - is_extracted = True + display_name = String( display_name=_("Display Name"), help=_("The display name for this component."), @@ -565,3 +564,12 @@ def definition_to_xml(self, resource_fs): def non_editable_metadata_fields(self): """`use_latex_compiler` should not be editable in the Studio settings editor.""" return super().non_editable_metadata_fields + [HtmlBlock.xml_attributes, HtmlBlock.use_latex_compiler] + + +class HtmlBlock(HtmlBlockMixin): + """ + The HTML XBlock. + """ + + # Indicates that this XBlock has been extracted from edx-platform. + is_extracted = True \ No newline at end of file From a620dd0a9b67eb104440053d46b84d81ab53cc1e Mon Sep 17 00:00:00 2001 From: salman2013 Date: Mon, 15 Dec 2025 14:19:58 +0500 Subject: [PATCH 2/6] fix: fix quality issues --- xblocks_contrib/html/html.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xblocks_contrib/html/html.py b/xblocks_contrib/html/html.py index 64f2807f..0ab11f8a 100644 --- a/xblocks_contrib/html/html.py +++ b/xblocks_contrib/html/html.py @@ -148,7 +148,7 @@ class HtmlBlockMixin(LegacyXmlMixin, XBlock): The HTML XBlock mixin. This provides the base class for all Html-ish blocks (including the HTML XBlock). """ - + display_name = String( display_name=_("Display Name"), help=_("The display name for this component."), @@ -572,4 +572,4 @@ class HtmlBlock(HtmlBlockMixin): """ # Indicates that this XBlock has been extracted from edx-platform. - is_extracted = True \ No newline at end of file + is_extracted = True From 50c1d82d7cc021846414758f4e912e25a3cf9e0b Mon Sep 17 00:00:00 2001 From: salman2013 Date: Mon, 15 Dec 2025 14:30:26 +0500 Subject: [PATCH 3/6] fix: fix quality issues --- xblocks_contrib/html/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xblocks_contrib/html/html.py b/xblocks_contrib/html/html.py index 0ab11f8a..5c28397c 100644 --- a/xblocks_contrib/html/html.py +++ b/xblocks_contrib/html/html.py @@ -566,7 +566,7 @@ def non_editable_metadata_fields(self): return super().non_editable_metadata_fields + [HtmlBlock.xml_attributes, HtmlBlock.use_latex_compiler] -class HtmlBlock(HtmlBlockMixin): +class HtmlBlock(HtmlBlockMixin): # pylint: disable=abstract-method """ The HTML XBlock. """ From 3ea0136031fcb85973786fa3ec497fe1c331b189 Mon Sep 17 00:00:00 2001 From: salman2013 Date: Mon, 15 Dec 2025 14:53:31 +0500 Subject: [PATCH 4/6] fix: fix import --- xblocks_contrib/html/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xblocks_contrib/html/__init__.py b/xblocks_contrib/html/__init__.py index 5b8118f9..0fe36653 100644 --- a/xblocks_contrib/html/__init__.py +++ b/xblocks_contrib/html/__init__.py @@ -2,4 +2,4 @@ Init for the HtmlBlock. """ -from .html import HtmlBlock +from .html import HtmlBlock, HtmlBlockMixin From c2a6482a42682c9cbb2b241dc4d9ef65952cec21 Mon Sep 17 00:00:00 2001 From: salman2013 Date: Tue, 30 Dec 2025 13:02:28 +0500 Subject: [PATCH 5/6] fix: remove unused pylint warning --- xblocks_contrib/html/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xblocks_contrib/html/html.py b/xblocks_contrib/html/html.py index 5c28397c..0ab11f8a 100644 --- a/xblocks_contrib/html/html.py +++ b/xblocks_contrib/html/html.py @@ -566,7 +566,7 @@ def non_editable_metadata_fields(self): return super().non_editable_metadata_fields + [HtmlBlock.xml_attributes, HtmlBlock.use_latex_compiler] -class HtmlBlock(HtmlBlockMixin): # pylint: disable=abstract-method +class HtmlBlock(HtmlBlockMixin): """ The HTML XBlock. """ From a06972ca6358da3cab27fe3e1c7254fcfdaf0113 Mon Sep 17 00:00:00 2001 From: salman2013 Date: Tue, 30 Dec 2025 13:16:20 +0500 Subject: [PATCH 6/6] fix: quality issue --- xblocks_contrib/html/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xblocks_contrib/html/html.py b/xblocks_contrib/html/html.py index 0ab11f8a..282e6292 100644 --- a/xblocks_contrib/html/html.py +++ b/xblocks_contrib/html/html.py @@ -566,7 +566,7 @@ def non_editable_metadata_fields(self): return super().non_editable_metadata_fields + [HtmlBlock.xml_attributes, HtmlBlock.use_latex_compiler] -class HtmlBlock(HtmlBlockMixin): +class HtmlBlock(HtmlBlockMixin): # pylint: disable=abstract-method """ The HTML XBlock. """