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 d10c18b386..d2044f64ca 100644 --- a/src/openforms/forms/tests/e2e_tests/test_form_designer.py +++ b/src/openforms/forms/tests/e2e_tests/test_form_designer.py @@ -1428,6 +1428,123 @@ def setUpTestData(): ) await expect(warning).to_be_visible() + @tag("gh-3921") + async def test_all_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": "fieldset", + "key": "fieldset", + "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 2") + 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 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): diff --git a/src/openforms/js/components/formio_builder/WebformBuilder.js b/src/openforms/js/components/formio_builder/WebformBuilder.js index d5bfa4b48e..4107313f19 100644 --- a/src/openforms/js/components/formio_builder/WebformBuilder.js +++ b/src/openforms/js/components/formio_builder/WebformBuilder.js @@ -378,6 +378,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}