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

Adding map interaction config #198

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions bundle-scss.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ await esbuild.build({
entryPoints: ['src/index.ts'],
outdir: 'lib/css',
bundle: true,
loader: {
".png": "dataurl",
".svg": "dataurl",
},
minify: false,
sourcemap: true,
plugins: [sassPlugin()],
Expand Down
45 changes: 45 additions & 0 deletions i18n/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@
"description": "Label for 'customClass' builder field",
"originalDefault": "CSS class"
},
"3xnsUT": {
"defaultMessage": "Line interactions",
"description": "Label for 'interactions.polyline' builder field",
"originalDefault": "Line interactions"
},
"4/cCvG": {
"defaultMessage": "Location",
"description": "Component edit form tab title for 'Location' tab",
Expand Down Expand Up @@ -564,6 +569,11 @@
"description": "Label for 'disableAddingRemovingRows' builder field",
"originalDefault": "Disable adding or removing groups"
},
"NbDr3m": {
"defaultMessage": "Allowing users to draw a line when using the map component",
"description": "Tooltip for 'interactions.polyline' builder field",
"originalDefault": "Allowing users to draw a line when using the map component"
},
"NdaqDN": {
"defaultMessage": "Option description (<option></option>)",
"description": "Label for option description location",
Expand All @@ -589,6 +599,16 @@
"description": "Component property 'Label' label",
"originalDefault": "Label"
},
"P84Gif": {
"defaultMessage": "Allowing users to draw a circle when using the map component",
"description": "Tooltip for 'interactions.circle' builder field",
"originalDefault": "Allowing users to draw a circle when using the map component"
},
"POkaFQ": {
"defaultMessage": "Polygon interactions",
"description": "Label for 'interactions.polygon' builder field",
"originalDefault": "Polygon interactions"
},
"PhXIai": {
"defaultMessage": "Number of years. Empty values are ignored.",
"description": "Tooltip for 'delta.years' in relative delta date constraint validation",
Expand Down Expand Up @@ -874,6 +894,16 @@
"description": "Tooltip for 'includePartners' builder field",
"originalDefault": "Whether to add partners information to the component."
},
"ZRM6J8": {
"defaultMessage": "Available map interactions",
"description": "Interaction configuration panel title",
"originalDefault": "Available map interactions"
},
"ZXsJ9p": {
"defaultMessage": "Circle interactions",
"description": "Label for 'interactions.circle' builder field",
"originalDefault": "Circle interactions"
},
"aBADYT": {
"defaultMessage": "Maximum number of files",
"description": "Label for 'maxNumberOfFiles' builder field",
Expand Down Expand Up @@ -1144,6 +1174,11 @@
"description": "Label for 'ClearOnHide' builder field",
"originalDefault": "Clear on hide"
},
"iyWQAt": {
"defaultMessage": "Allowing users to draw a polygon when using the map component",
"description": "Tooltip for 'interactions.polygon' builder field",
"originalDefault": "Allowing users to draw a polygon when using the map component"
},
"j2vQH3": {
"defaultMessage": "Values",
"description": "Label for the 'values' builder field",
Expand Down Expand Up @@ -1184,6 +1219,11 @@
"description": "Label for translation message for validation error code",
"originalDefault": "Error message"
},
"kIX7bm": {
"defaultMessage": "Marker interactions",
"description": "Label for 'interactions.marker' builder field",
"originalDefault": "Marker interactions"
},
"kg/eh1": {
"defaultMessage": "Choice/option translations",
"description": "Values/options translations table header",
Expand Down Expand Up @@ -1444,6 +1484,11 @@
"description": "Tooltip for 'hideHeader' builder field",
"originalDefault": "Do not display the configured label and top line as the header in the fieldset."
},
"vFydxX": {
"defaultMessage": "Allowing users to set a marker when using the map component",
"description": "Tooltip for 'interactions.marker' builder field",
"originalDefault": "Allowing users to set a marker when using the map component"
},
"vRVMpe": {
"defaultMessage": "Value",
"description": "Translations: property column header",
Expand Down
45 changes: 45 additions & 0 deletions i18n/messages/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@
"isTranslated": true,
"originalDefault": "CSS class"
},
"3xnsUT": {
"defaultMessage": "Lijn interacties",
"description": "Label for 'interactions.polyline' builder field",
"originalDefault": "Line interactions"
},
"4/cCvG": {
"defaultMessage": "Locatie",
"description": "Component edit form tab title for 'Location' tab",
Expand Down Expand Up @@ -572,6 +577,11 @@
"description": "Label for 'disableAddingRemovingRows' builder field",
"originalDefault": "Disable adding or removing groups"
},
"NbDr3m": {
"defaultMessage": "Geeft gebruikers de mogelijkheid een lijn te tekenen, wanneer ze met het kaartmateriaal werken",
"description": "Tooltip for 'interactions.polyline' builder field",
"originalDefault": "Allowing users to draw a line when using the map component"
},
"NdaqDN": {
"defaultMessage": "Waarde-omschrijving (<option></option>)",
"description": "Label for option description location",
Expand All @@ -598,6 +608,16 @@
"isTranslated": true,
"originalDefault": "Label"
},
"P84Gif": {
"defaultMessage": "Geeft gebruikers de mogelijkheid een cirkel te tekenen, wanneer ze met het kaartmateriaal werken",
"description": "Tooltip for 'interactions.circle' builder field",
"originalDefault": "Allowing users to draw a circle when using the map component"
},
"POkaFQ": {
"defaultMessage": "Polygoon interacties",
"description": "Label for 'interactions.polygon' builder field",
"originalDefault": "Polygon interactions"
},
"PhXIai": {
"defaultMessage": "Aantal jaren. Lege waarden worden genegeerd.",
"description": "Tooltip for 'delta.years' in relative delta date constraint validation",
Expand Down Expand Up @@ -885,6 +905,16 @@
"description": "Tooltip for 'includePartners' builder field",
"originalDefault": "Whether to add partners information to the component."
},
"ZRM6J8": {
"defaultMessage": "Mogelijke kaartmateriaal interacties",
"description": "Interaction configuration panel title",
"originalDefault": "Available map interactions"
},
"ZXsJ9p": {
"defaultMessage": "Cirkel interacties",
"description": "Label for 'interactions.circle' builder field",
"originalDefault": "Circle interactions"
},
"aBADYT": {
"defaultMessage": "Maximum aantal bestanden",
"description": "Label for 'maxNumberOfFiles' builder field",
Expand Down Expand Up @@ -1158,6 +1188,11 @@
"description": "Label for 'ClearOnHide' builder field",
"originalDefault": "Clear on hide"
},
"iyWQAt": {
"defaultMessage": "Geeft gebruikers de mogelijkheid een polygoon te tekenen, wanneer ze met het kaartmateriaal werken",
"description": "Tooltip for 'interactions.polygon' builder field",
"originalDefault": "Allowing users to draw a polygon when using the map component"
},
"j2vQH3": {
"defaultMessage": "Waarden",
"description": "Label for the 'values' builder field",
Expand Down Expand Up @@ -1199,6 +1234,11 @@
"description": "Label for translation message for validation error code",
"originalDefault": "Error message"
},
"kIX7bm": {
"defaultMessage": "Pin interacties",
"description": "Label for 'interactions.marker' builder field",
"originalDefault": "Marker interactions"
},
"kg/eh1": {
"defaultMessage": "Waardenvertalingen",
"description": "Values/options translations table header",
Expand Down Expand Up @@ -1464,6 +1504,11 @@
"description": "Tooltip for 'hideHeader' builder field",
"originalDefault": "Do not display the configured label and top line as the header in the fieldset."
},
"vFydxX": {
"defaultMessage": "Geeft gebruikers de mogelijkheid een pin te plaatsen, wanneer ze met het kaartmateriaal werken",
"description": "Tooltip for 'interactions.marker' builder field",
"originalDefault": "Allowing users to set a marker when using the map component"
},
"vRVMpe": {
"defaultMessage": "(Standaard)tekst",
"description": "Translations: property column header",
Expand Down
53 changes: 46 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@formatjs/cli": "^6.1.1",
"@formatjs/ts-transformer": "^3.12.0",
"@fortawesome/fontawesome-free": "^6.4.0",
"@open-formulieren/types": "^0.37.0",
"@open-formulieren/types": "^0.38.0",
"@storybook/addon-actions": "^8.3.5",
"@storybook/addon-essentials": "^8.3.5",
"@storybook/addon-interactions": "^8.3.5",
Expand Down Expand Up @@ -124,9 +124,11 @@
"clsx": "^1.2.1",
"formik": "^2.4.5",
"leaflet": "^1.9.4",
"leaflet-draw": "^1.0.4",
"lodash": "^4.17.21",
"react-intl": "^6.3.2",
"react-leaflet": "^4.2.1",
"react-leaflet-draw": "^0.20.4",
"react-modal": "^3.16.1",
"react-select": "^5.8.0",
"react-signature-canvas": "^1.0.6",
Expand Down
3 changes: 3 additions & 0 deletions src/jsonEditor.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@import 'leaflet-draw/dist/leaflet.draw.css';
@import 'leaflet/dist/leaflet.css';

.json-editor {
min-block-size: 45vh;

Expand Down
11 changes: 10 additions & 1 deletion src/registry/map/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
import {LABELS} from '@/components/builder/messages';
import {Checkbox, Select, TabList, TabPanel, Tabs} from '@/components/formio';
import {BuilderContext} from '@/context';
import InteractionConfiguration from '@/registry/map/interaction-configuration';
import {useErrorChecker} from '@/utils/errors';

import {EditFormDefinition} from '../types';
Expand Down Expand Up @@ -65,7 +66,8 @@ const EditForm: EditFormDefinition<MapComponentSchema> = () => {
'useConfigDefaultMapSettings',
'defaultZoom',
'initialCenter',
'tileLayerIdentifier'
'tileLayerIdentifier',
'interactions'
)}
/>
<BuilderTabs.Advanced hasErrors={hasAnyError('conditional')} />
Expand All @@ -87,6 +89,7 @@ const EditForm: EditFormDefinition<MapComponentSchema> = () => {
<UseConfigDefaultMapSettings />
{!values.useConfigDefaultMapSettings && <MapConfiguration />}
<TileLayer />
<InteractionConfiguration />
</TabPanel>

{/* Advanced tab */}
Expand Down Expand Up @@ -139,6 +142,12 @@ EditForm.defaultValues = {
lng: undefined,
},
tileLayerIdentifier: undefined,
interactions: {
circle: false,
polygon: false,
polyline: false,
marker: true,
},
defaultValue: null,
// Advanced tab
conditional: {
Expand Down
Loading
Loading