Skip to content

Commit

Permalink
Merge pull request #3786 from open-formulieren/fix/3778-label-content…
Browse files Browse the repository at this point in the history
…-component

[#3778] Render empty label for content component
  • Loading branch information
SilviaAmAm authored Jan 19, 2024
2 parents eb19082 + 0659610 commit b6ef8f5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/openforms/formio/rendering/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ class WYSIWYGNode(ComponentNode):
def spans_full_width(self) -> bool:
return self.mode != RenderModes.cli

@property
def label(self) -> str:
return ""

@property
def is_visible(self) -> bool:
if self.mode in (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_render_submission_in_cli_no_html(self):
Currency 1.234,56
A container with visible children
Input 4 fourth input
WYSIWYG Content WYSIWYG with markup
WYSIWYG with markup
--------------------------------- -------------------
Variabelen
------------------ -----------
Expand Down Expand Up @@ -186,7 +186,7 @@ def test_render_submission_in_cli_with_html(self):
Currency 1.234,56
A container with visible children
Input 4 fourth input
WYSIWYG Content <p>WYSIWYG with <strong>markup</strong></p>
<p>WYSIWYG with <strong>markup</strong></p>
--------------------------------- -------------------------------------------
Variabelen
------------------ -----------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.test import TestCase
from django.test import TestCase, tag
from django.urls import reverse

from rest_framework import status
Expand Down Expand Up @@ -328,6 +328,32 @@ def test_namespaced_editgrid_summary_with_conditions_in_iteration(self):

self.assertEqual(conditional_textfield["value"], "Some data")

@tag("gh-3778")
def test_content_component_summary_has_empty_label(self):
form_step = FormStepFactory.create(
form_definition__configuration={
"components": [
{
"key": "content",
"type": "content",
"label": "Content",
"html": "<p>Some data</p>",
}
]
},
form_definition__slug="fd-0",
form_definition__name="Form Definition 0",
)

submission = SubmissionFactory.create(form=form_step.form)

data = submission.render_summary_page()
step_data = data[0]["data"]

# 1 node for the content component
self.assertEqual(1, len(step_data))
self.assertEqual(step_data[0]["name"], "")


class SubmissionCompletionTests(SubmissionsMixin, APITestCase):
def test_summary_page_endpoint(self):
Expand Down

0 comments on commit b6ef8f5

Please sign in to comment.