From 42ab5a7354028254241ff401a3ddb8da0d4a77a1 Mon Sep 17 00:00:00 2001 From: robinvandermolen Date: Wed, 8 Jan 2025 16:14:02 +0100 Subject: [PATCH] :truck: [open-formulieren/open-forms#2177] Moving map settings to separate tab --- src/registry/map/edit.tsx | 31 +++++++++++++------ src/registry/map/map-configuration.stories.ts | 2 ++ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/registry/map/edit.tsx b/src/registry/map/edit.tsx index b3c1d1cb..4068af7f 100644 --- a/src/registry/map/edit.tsx +++ b/src/registry/map/edit.tsx @@ -21,7 +21,7 @@ import { useDeriveComponentKey, } from '@/components/builder'; import {LABELS} from '@/components/builder/messages'; -import {Checkbox, Select, TabList, TabPanel, Tabs} from '@/components/formio'; +import {Checkbox, Select, Tab, TabList, TabPanel, Tabs} from '@/components/formio'; import {BuilderContext} from '@/context'; import InteractionConfiguration from '@/registry/map/interaction-configuration'; import {useErrorChecker} from '@/utils/errors'; @@ -62,16 +62,25 @@ const EditForm: EditFormDefinition = () => { 'showInPDF', 'hidden', 'clearOnHide', - 'isSensitiveData', + 'isSensitiveData' + )} + /> + + + - - + > + + @@ -86,10 +95,6 @@ const EditForm: EditFormDefinition = () => { - - {!values.useConfigDefaultMapSettings && } - - {/* Advanced tab */} @@ -104,6 +109,14 @@ const EditForm: EditFormDefinition = () => { + {/* Map settings tab */} + + + + + {!values.useConfigDefaultMapSettings && } + + {/* Registration tab */} diff --git a/src/registry/map/map-configuration.stories.ts b/src/registry/map/map-configuration.stories.ts index addc53fd..666e7b01 100644 --- a/src/registry/map/map-configuration.stories.ts +++ b/src/registry/map/map-configuration.stories.ts @@ -45,6 +45,7 @@ export const NotUsingGlobalConfig: Story = { const canvas = within(canvasElement); await step('Initial state', async () => { + await userEvent.click(canvas.getByRole('link', {name: 'Map settings'})); expect( canvas.getByLabelText('Use globally configured map component settings') ).not.toBeChecked(); @@ -81,6 +82,7 @@ export const UsingGlobalConfig: Story = { const canvas = within(canvasElement); await step('Initial state', async () => { + await userEvent.click(canvas.getByRole('link', {name: 'Map settings'})); expect( canvas.getByLabelText('Use globally configured map component settings') ).not.toBeChecked();