From e9d0939e0110d207c1faaec3f7f9c186a19e1bc1 Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Thu, 28 Mar 2024 12:28:25 +0100 Subject: [PATCH 1/2] [#3061] Add regression test --- .../tests/e2e_tests/test_form_designer.py | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/src/openforms/forms/tests/e2e_tests/test_form_designer.py b/src/openforms/forms/tests/e2e_tests/test_form_designer.py index 49278a7471..1cbed85d3c 100644 --- a/src/openforms/forms/tests/e2e_tests/test_form_designer.py +++ b/src/openforms/forms/tests/e2e_tests/test_form_designer.py @@ -1135,6 +1135,70 @@ def setUpTestData(): await page.keyboard.press("ArrowDown") await expect(page.get_by_text("Field 1 (field1)")).to_be_visible() + @tag("gh-4061") + async def test_column_components_are_visible_in_component_select_dropdown(self): + @sync_to_async + def setUpTestData(): + # set up a form + form = FormFactory.create( + name="Playwright test", + generate_minimal_setup=True, + formstep__form_definition__name_nl="Playwright test", + formstep__form_definition__configuration={ + "components": [ + { + "type": "textfield", + "key": "field1", + "label": "Field 1", + }, + { + "type": "columns", + "key": "columns", + "columns": [ + { + "size": 6, + "sizeMobile": 4, + "width": 6, + "offset": 0, + "push": 0, + "pull": 0, + "currentWidth": 6, + "components": [ + { + "type": "textfield", + "key": "field2", + "label": "Field 2", + }, + ], + } + ], + }, + ], + }, + ) + return form + + await create_superuser() + form = await setUpTestData() + + admin_url = str( + furl(self.live_server_url) + / reverse("admin:forms_form_change", args=(form.pk,)) + ) + + async with browser_page() as page: + await self._admin_login(page) + await page.goto(str(admin_url)) + + await page.get_by_role("tab", name="Steps and fields").click() + await open_component_options_modal(page, "Field 1") + await page.get_by_role("tab", name="Location").click() + + dropdown = page.get_by_role("combobox", name="Postcode component") + await dropdown.focus() + await page.keyboard.press("ArrowDown") + await expect(page.get_by_text("Field 2 (field2)")).to_be_visible() + class FormDesignerTooltipTests(E2ETestCase): async def test_tooltip_fields_are_present(self): From a3b5ab11bbfb28e2a08132ebf0ebcedb8a150fb1 Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Thu, 28 Mar 2024 12:28:47 +0100 Subject: [PATCH 2/2] [#4061] Use the right attribute for components array --- src/openforms/js/components/formio_builder/WebformBuilder.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openforms/js/components/formio_builder/WebformBuilder.js b/src/openforms/js/components/formio_builder/WebformBuilder.js index 06c3d6884b..a8c18f8b29 100644 --- a/src/openforms/js/components/formio_builder/WebformBuilder.js +++ b/src/openforms/js/components/formio_builder/WebformBuilder.js @@ -145,6 +145,7 @@ class WebformBuilder extends WebformBuilderFormio { // hand contents of modal over to React (async () => { const intlProviderProps = await getIntlProviderProps(); + root.render( this.webform.components} + getFormComponents={() => this.webform.form.components} getValidatorPlugins={getValidatorPlugins} getRegistrationAttributes={getRegistrationAttributes} getPrefillPlugins={getPrefillPlugins}