kopia lustrzana https://github.com/wagtail/wagtail
Add Block.get_description() to be used in block preview
rodzic
3bad585b74
commit
adf52d85c7
|
@ -293,6 +293,9 @@ class Block(metaclass=BaseBlock):
|
||||||
return self.normalize(self.meta.preview_value)
|
return self.normalize(self.meta.preview_value)
|
||||||
return self.get_default()
|
return self.get_default()
|
||||||
|
|
||||||
|
def get_description(self):
|
||||||
|
return getattr(self.meta, "description", "")
|
||||||
|
|
||||||
def get_api_representation(self, value, context=None):
|
def get_api_representation(self, value, context=None):
|
||||||
"""
|
"""
|
||||||
Can be used to customise the API response and defaults to the value returned by get_prep_value.
|
Can be used to customise the API response and defaults to the value returned by get_prep_value.
|
||||||
|
|
|
@ -81,6 +81,9 @@ class FieldBlock(Block):
|
||||||
self.field.prepare_value(self.value_for_form(value))
|
self.field.prepare_value(self.value_for_form(value))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_description(self):
|
||||||
|
return super().get_description() or self.field.help_text or ""
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
# No icon specified here, because that depends on the purpose that the
|
# No icon specified here, because that depends on the purpose that the
|
||||||
# block is being used for. Feel encouraged to specify an icon in your
|
# block is being used for. Feel encouraged to specify an icon in your
|
||||||
|
@ -110,6 +113,7 @@ class FieldBlockAdapter(Adapter):
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
"label": block.label,
|
"label": block.label,
|
||||||
|
"description": block.get_description(),
|
||||||
"required": block.required,
|
"required": block.required,
|
||||||
"icon": block.meta.icon,
|
"icon": block.meta.icon,
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
|
|
@ -449,6 +449,7 @@ class ListBlockAdapter(Adapter):
|
||||||
def js_args(self, block):
|
def js_args(self, block):
|
||||||
meta = {
|
meta = {
|
||||||
"label": block.label,
|
"label": block.label,
|
||||||
|
"description": block.get_description(),
|
||||||
"icon": block.meta.icon,
|
"icon": block.meta.icon,
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"classname": block.meta.form_classname,
|
"classname": block.meta.form_classname,
|
||||||
|
|
|
@ -58,6 +58,7 @@ class StaticBlockAdapter(Adapter):
|
||||||
text_or_html: admin_text,
|
text_or_html: admin_text,
|
||||||
"icon": block.meta.icon,
|
"icon": block.meta.icon,
|
||||||
"label": block.label,
|
"label": block.label,
|
||||||
|
"description": block.get_description(),
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
|
@ -826,6 +826,7 @@ class StreamBlockAdapter(Adapter):
|
||||||
def js_args(self, block):
|
def js_args(self, block):
|
||||||
meta = {
|
meta = {
|
||||||
"label": block.label,
|
"label": block.label,
|
||||||
|
"description": block.get_description(),
|
||||||
"required": block.required,
|
"required": block.required,
|
||||||
"icon": block.meta.icon,
|
"icon": block.meta.icon,
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
|
|
@ -360,6 +360,9 @@ class BaseStructBlock(Block):
|
||||||
)
|
)
|
||||||
return mark_safe(render_to_string(self.meta.form_template, context))
|
return mark_safe(render_to_string(self.meta.form_template, context))
|
||||||
|
|
||||||
|
def get_description(self):
|
||||||
|
return super().get_description() or getattr(self.meta, "help_text", "")
|
||||||
|
|
||||||
def get_form_context(self, value, prefix="", errors=None):
|
def get_form_context(self, value, prefix="", errors=None):
|
||||||
return {
|
return {
|
||||||
"children": collections.OrderedDict(
|
"children": collections.OrderedDict(
|
||||||
|
@ -401,6 +404,7 @@ class StructBlockAdapter(Adapter):
|
||||||
def js_args(self, block):
|
def js_args(self, block):
|
||||||
meta = {
|
meta = {
|
||||||
"label": block.label,
|
"label": block.label,
|
||||||
|
"description": block.get_description(),
|
||||||
"required": block.required,
|
"required": block.required,
|
||||||
"icon": block.meta.icon,
|
"icon": block.meta.icon,
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
|
|
@ -558,7 +558,7 @@ class TestTableBlockForm(WagtailTestUtils, SimpleTestCase):
|
||||||
self.assertIs(block_3_opts["allowEmpty"], False)
|
self.assertIs(block_3_opts["allowEmpty"], False)
|
||||||
|
|
||||||
def test_adapt(self):
|
def test_adapt(self):
|
||||||
block = TableBlock()
|
block = TableBlock(description="A table to display data.")
|
||||||
|
|
||||||
block.set_name("test_tableblock")
|
block.set_name("test_tableblock")
|
||||||
js_args = FieldBlockAdapter().js_args(block)
|
js_args = FieldBlockAdapter().js_args(block)
|
||||||
|
@ -569,6 +569,7 @@ class TestTableBlockForm(WagtailTestUtils, SimpleTestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test tableblock",
|
"label": "Test tableblock",
|
||||||
|
"description": "A table to display data.",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "table",
|
"icon": "table",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
|
|
@ -332,6 +332,7 @@ class TypedTableBlockAdapter(Adapter):
|
||||||
def js_args(self, block):
|
def js_args(self, block):
|
||||||
meta = {
|
meta = {
|
||||||
"label": block.label,
|
"label": block.label,
|
||||||
|
"description": block.get_description(),
|
||||||
"required": block.required,
|
"required": block.required,
|
||||||
"icon": block.meta.icon,
|
"icon": block.meta.icon,
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
|
|
@ -225,7 +225,7 @@ class TestTableBlock(TestCase):
|
||||||
self.assertIn("<td>FR</td>", html)
|
self.assertIn("<td>FR</td>", html)
|
||||||
|
|
||||||
def test_adapt(self):
|
def test_adapt(self):
|
||||||
block = TypedTableBlock()
|
block = TypedTableBlock(description="A table of countries and their food")
|
||||||
|
|
||||||
block.set_name("test_typedtableblock")
|
block.set_name("test_typedtableblock")
|
||||||
js_args = TypedTableBlockAdapter().js_args(block)
|
js_args = TypedTableBlockAdapter().js_args(block)
|
||||||
|
@ -235,6 +235,7 @@ class TestTableBlock(TestCase):
|
||||||
js_args[-1],
|
js_args[-1],
|
||||||
{
|
{
|
||||||
"label": "Test typedtableblock",
|
"label": "Test typedtableblock",
|
||||||
|
"description": "A table of countries and their food",
|
||||||
"required": False,
|
"required": False,
|
||||||
"icon": "table",
|
"icon": "table",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
|
|
@ -5524,7 +5524,11 @@ class TestSnippetChooserBlock(TestCase):
|
||||||
self.assertEqual(block.to_python(test_advert.id), test_advert)
|
self.assertEqual(block.to_python(test_advert.id), test_advert)
|
||||||
|
|
||||||
def test_adapt(self):
|
def test_adapt(self):
|
||||||
block = SnippetChooserBlock(Advert, help_text="pick an advert, any advert")
|
block = SnippetChooserBlock(
|
||||||
|
Advert,
|
||||||
|
help_text="pick an advert, any advert",
|
||||||
|
description="An advert to be displayed on the sidebar.",
|
||||||
|
)
|
||||||
|
|
||||||
block.set_name("test_snippetchooserblock")
|
block.set_name("test_snippetchooserblock")
|
||||||
js_args = FieldBlockAdapter().js_args(block)
|
js_args = FieldBlockAdapter().js_args(block)
|
||||||
|
@ -5536,6 +5540,7 @@ class TestSnippetChooserBlock(TestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test snippetchooserblock",
|
"label": "Test snippetchooserblock",
|
||||||
|
"description": "An advert to be displayed on the sidebar.",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "snippet",
|
"icon": "snippet",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -5832,7 +5837,9 @@ class TestSnippetChooserBlockWithCustomPrimaryKey(TestCase):
|
||||||
|
|
||||||
def test_adapt(self):
|
def test_adapt(self):
|
||||||
block = SnippetChooserBlock(
|
block = SnippetChooserBlock(
|
||||||
AdvertWithCustomPrimaryKey, help_text="pick an advert, any advert"
|
AdvertWithCustomPrimaryKey,
|
||||||
|
help_text="pick an advert, any advert",
|
||||||
|
description="An advert to be displayed on the footer.",
|
||||||
)
|
)
|
||||||
|
|
||||||
block.set_name("test_snippetchooserblock")
|
block.set_name("test_snippetchooserblock")
|
||||||
|
@ -5845,6 +5852,7 @@ class TestSnippetChooserBlockWithCustomPrimaryKey(TestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test snippetchooserblock",
|
"label": "Test snippetchooserblock",
|
||||||
|
"description": "An advert to be displayed on the footer.",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "snippet",
|
"icon": "snippet",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
|
|
@ -95,6 +95,7 @@ class TestFieldBlock(WagtailTestUtils, SimpleTestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test block",
|
"label": "Test block",
|
||||||
|
"description": "Some helpful text",
|
||||||
"helpText": "Some helpful text",
|
"helpText": "Some helpful text",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
|
@ -185,7 +186,7 @@ class TestFieldBlock(WagtailTestUtils, SimpleTestCase):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
block = ChoiceBlock()
|
block = ChoiceBlock(description="A selection of two choices")
|
||||||
|
|
||||||
block.set_name("test_choiceblock")
|
block.set_name("test_choiceblock")
|
||||||
js_args = FieldBlockAdapter().js_args(block)
|
js_args = FieldBlockAdapter().js_args(block)
|
||||||
|
@ -203,6 +204,7 @@ class TestFieldBlock(WagtailTestUtils, SimpleTestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test choiceblock",
|
"label": "Test choiceblock",
|
||||||
|
"description": "A selection of two choices",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -615,6 +617,7 @@ class TestRichTextBlock(TestCase):
|
||||||
"classname": "w-field w-field--char_field w-field--custom_rich_text_area",
|
"classname": "w-field w-field--char_field w-field--custom_rich_text_area",
|
||||||
"icon": "pilcrow",
|
"icon": "pilcrow",
|
||||||
"label": "Test richtextblock",
|
"label": "Test richtextblock",
|
||||||
|
"description": "",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"required": True,
|
"required": True,
|
||||||
"showAddCommentButton": True,
|
"showAddCommentButton": True,
|
||||||
|
@ -636,6 +639,7 @@ class TestRichTextBlock(TestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test richtextblock",
|
"label": "Test richtextblock",
|
||||||
|
"description": "",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "pilcrow",
|
"icon": "pilcrow",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -659,6 +663,7 @@ class TestRichTextBlock(TestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test richtextblock",
|
"label": "Test richtextblock",
|
||||||
|
"description": "",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "pilcrow",
|
"icon": "pilcrow",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -775,6 +780,7 @@ class TestChoiceBlock(WagtailTestUtils, SimpleTestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test choiceblock",
|
"label": "Test choiceblock",
|
||||||
|
"description": "",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -1177,6 +1183,7 @@ class TestMultipleChoiceBlock(WagtailTestUtils, SimpleTestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test choiceblock",
|
"label": "Test choiceblock",
|
||||||
|
"description": "",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -1614,6 +1621,7 @@ class TestRawHTMLBlock(unittest.TestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test rawhtmlblock",
|
"label": "Test rawhtmlblock",
|
||||||
|
"description": "",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "code",
|
"icon": "code",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -1957,6 +1965,7 @@ class TestStructBlock(SimpleTestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test structblock",
|
"label": "Test structblock",
|
||||||
|
"description": "",
|
||||||
"required": False,
|
"required": False,
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -1987,6 +1996,7 @@ class TestStructBlock(SimpleTestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test structblock",
|
"label": "Test structblock",
|
||||||
|
"description": "",
|
||||||
"required": False,
|
"required": False,
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -2012,6 +2022,7 @@ class TestStructBlock(SimpleTestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test structblock",
|
"label": "Test structblock",
|
||||||
|
"description": "",
|
||||||
"required": False,
|
"required": False,
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -2046,6 +2057,7 @@ class TestStructBlock(SimpleTestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test structblock",
|
"label": "Test structblock",
|
||||||
|
"description": "Self-promotion is encouraged",
|
||||||
"required": False,
|
"required": False,
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -2072,6 +2084,7 @@ class TestStructBlock(SimpleTestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test structblock",
|
"label": "Test structblock",
|
||||||
|
"description": "Self-promotion is encouraged",
|
||||||
"required": False,
|
"required": False,
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -2702,6 +2715,7 @@ class TestListBlock(WagtailTestUtils, SimpleTestCase):
|
||||||
js_args[3],
|
js_args[3],
|
||||||
{
|
{
|
||||||
"label": "Test listblock",
|
"label": "Test listblock",
|
||||||
|
"description": "",
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"classname": None,
|
"classname": None,
|
||||||
|
@ -2733,6 +2747,7 @@ class TestListBlock(WagtailTestUtils, SimpleTestCase):
|
||||||
js_args[3],
|
js_args[3],
|
||||||
{
|
{
|
||||||
"label": "Test listblock",
|
"label": "Test listblock",
|
||||||
|
"description": "",
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"classname": None,
|
"classname": None,
|
||||||
|
@ -2908,6 +2923,7 @@ class TestListBlock(WagtailTestUtils, SimpleTestCase):
|
||||||
js_args[3],
|
js_args[3],
|
||||||
{
|
{
|
||||||
"label": "Test listblock",
|
"label": "Test listblock",
|
||||||
|
"description": "",
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"classname": "special-list-class",
|
"classname": "special-list-class",
|
||||||
|
@ -2942,6 +2958,7 @@ class TestListBlock(WagtailTestUtils, SimpleTestCase):
|
||||||
js_args[3],
|
js_args[3],
|
||||||
{
|
{
|
||||||
"label": "Test listblock",
|
"label": "Test listblock",
|
||||||
|
"description": "",
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"classname": "custom-list-class",
|
"classname": "custom-list-class",
|
||||||
|
@ -3580,6 +3597,7 @@ class TestStreamBlock(WagtailTestUtils, SimpleTestCase):
|
||||||
js_args[3],
|
js_args[3],
|
||||||
{
|
{
|
||||||
"label": "Test streamblock",
|
"label": "Test streamblock",
|
||||||
|
"description": "",
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"classname": None,
|
"classname": None,
|
||||||
|
@ -4307,6 +4325,7 @@ class TestStreamBlock(WagtailTestUtils, SimpleTestCase):
|
||||||
js_args[3],
|
js_args[3],
|
||||||
{
|
{
|
||||||
"label": "Test streamblock",
|
"label": "Test streamblock",
|
||||||
|
"description": "",
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"minNum": None,
|
"minNum": None,
|
||||||
|
@ -4410,6 +4429,7 @@ class TestStreamBlock(WagtailTestUtils, SimpleTestCase):
|
||||||
js_args[3],
|
js_args[3],
|
||||||
{
|
{
|
||||||
"label": "Test streamblock",
|
"label": "Test streamblock",
|
||||||
|
"description": "",
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"minNum": None,
|
"minNum": None,
|
||||||
|
@ -4742,7 +4762,9 @@ class TestPageChooserBlock(TestCase):
|
||||||
def test_adapt(self):
|
def test_adapt(self):
|
||||||
from wagtail.admin.widgets.chooser import AdminPageChooser
|
from wagtail.admin.widgets.chooser import AdminPageChooser
|
||||||
|
|
||||||
block = blocks.PageChooserBlock(help_text="pick a page, any page")
|
block = blocks.PageChooserBlock(
|
||||||
|
help_text="pick a page, any page", description="A featured page"
|
||||||
|
)
|
||||||
|
|
||||||
block.set_name("test_pagechooserblock")
|
block.set_name("test_pagechooserblock")
|
||||||
js_args = FieldBlockAdapter().js_args(block)
|
js_args = FieldBlockAdapter().js_args(block)
|
||||||
|
@ -4755,6 +4777,7 @@ class TestPageChooserBlock(TestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test pagechooserblock",
|
"label": "Test pagechooserblock",
|
||||||
|
"description": "A featured page",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "doc-empty-inverse",
|
"icon": "doc-empty-inverse",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -4963,6 +4986,7 @@ class TestStaticBlock(unittest.TestCase):
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"label": "Posts static block",
|
"label": "Posts static block",
|
||||||
|
"description": "",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4985,6 +5009,7 @@ class TestStaticBlock(unittest.TestCase):
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"label": "Posts static block",
|
"label": "Posts static block",
|
||||||
|
"description": "",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5006,6 +5031,7 @@ class TestStaticBlock(unittest.TestCase):
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"label": "Latest posts",
|
"label": "Latest posts",
|
||||||
|
"description": "",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5028,6 +5054,7 @@ class TestStaticBlock(unittest.TestCase):
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"label": "Posts static block",
|
"label": "Posts static block",
|
||||||
|
"description": "",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5050,6 +5077,7 @@ class TestStaticBlock(unittest.TestCase):
|
||||||
"icon": "placeholder",
|
"icon": "placeholder",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
"label": "Posts static block",
|
"label": "Posts static block",
|
||||||
|
"description": "",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5101,6 +5129,7 @@ class TestDateBlock(TestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test dateblock",
|
"label": "Test dateblock",
|
||||||
|
"description": "",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "date",
|
"icon": "date",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -5135,6 +5164,7 @@ class TestTimeBlock(TestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test timeblock",
|
"label": "Test timeblock",
|
||||||
|
"description": "",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "time",
|
"icon": "time",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
@ -5169,6 +5199,7 @@ class TestDateTimeBlock(TestCase):
|
||||||
js_args[2],
|
js_args[2],
|
||||||
{
|
{
|
||||||
"label": "Test datetimeblock",
|
"label": "Test datetimeblock",
|
||||||
|
"description": "",
|
||||||
"required": True,
|
"required": True,
|
||||||
"icon": "date",
|
"icon": "date",
|
||||||
"blockDefId": block.definition_prefix,
|
"blockDefId": block.definition_prefix,
|
||||||
|
|
Ładowanie…
Reference in New Issue