Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4061] Use the right attribute for components array #4077

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions src/openforms/forms/tests/e2e_tests/test_form_designer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion src/openforms/js/components/formio_builder/WebformBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ class WebformBuilder extends WebformBuilderFormio {
// hand contents of modal over to React
(async () => {
const intlProviderProps = await getIntlProviderProps();

root.render(
<IntlProvider {...intlProviderProps}>
<ComponentConfiguration
// Context binding
uniquifyKey={uniquifyKey}
supportedLanguageCodes={LANGUAGES}
richTextColors={RICH_TEXT_COLORS}
getFormComponents={() => this.webform.components}
getFormComponents={() => this.webform.form.components}
getValidatorPlugins={getValidatorPlugins}
getRegistrationAttributes={getRegistrationAttributes}
getPrefillPlugins={getPrefillPlugins}
Expand Down
Loading