-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
1644d74
to
e7254fd
Compare
Because this feature will be added after 3.0, this PR is moved to draft. This PR is still ready to be reviewed, it just shouldn't be merged just yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can say, it seems good to me. I would add though some stories for the interactions (not necessarily tests, but just to have the appearance).
The map component stories do show the configuration, but the choice doesn't have a visual representation. |
56ca3aa
to
72b3cc2
Compare
This PR can be reviewed (this includes some chromatic changes that also have to be reviewed) In the formio-builder a new map component configuration option was added: In the form builder map component preview you can test/use the active interactions. |
72b3cc2
to
ff16d26
Compare
ff16d26
to
d6949a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move all of the map settings to a separate tab? Tab title can be "Map settings" or just "Settings", and would come after the "Validation" tab. I think the "Basic" tab is getting too clutter.
Specifically, this means the fields:
- Use globally configured map component settings
- Map configuration (and re-label this to "Initial focus" or something like that)
- Tile layer
- Available interactions
i18n/messages/nl.json
Outdated
@@ -151,6 +151,11 @@ | |||
"isTranslated": true, | |||
"originalDefault": "CSS class" | |||
}, | |||
"3xnsUT": { | |||
"defaultMessage": "Lijn interacties", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"defaultMessage": "Lijn interacties", | |
"defaultMessage": "Lijn", |
I feel like "interactions" is repeated way too much. I'm also inclined to rephrase this as "available drawing shapes" to make it simpler?
i18n/messages/nl.json
Outdated
@@ -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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"defaultMessage": "Geeft gebruikers de mogelijkheid een lijn te tekenen, wanneer ze met het kaartmateriaal werken", | |
"defaultMessage": "Gebruikers kunnen rechte lijnen tekenen op de kaart.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it one or more lines, or just one? Probably good to clarify that in the tooltip.
i18n/messages/nl.json
Outdated
@@ -598,6 +608,11 @@ | |||
"isTranslated": true, | |||
"originalDefault": "Label" | |||
}, | |||
"POkaFQ": { | |||
"defaultMessage": "Polygoon interacties", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"defaultMessage": "Polygoon interacties", | |
"defaultMessage": "Veelhoek (polygoon)", |
i18n/messages/nl.json
Outdated
@@ -885,6 +900,11 @@ | |||
"description": "Tooltip for 'includePartners' builder field", | |||
"originalDefault": "Whether to add partners information to the component." | |||
}, | |||
"ZRM6J8": { | |||
"defaultMessage": "Mogelijke kaartmateriaal interacties", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"defaultMessage": "Mogelijke kaartmateriaal interacties", | |
"defaultMessage": "Mogelijke kaartmateriaalinteracties", |
single samengesteld woord
i18n/messages/nl.json
Outdated
@@ -1158,6 +1178,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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"defaultMessage": "Geeft gebruikers de mogelijkheid een polygoon te tekenen, wanneer ze met het kaartmateriaal werken", | |
"defaultMessage": "Gebruikers kunnen een veelhoek (gesloten vorm die uit rechte lijnen bestaat) tekenen.", |
i18n/messages/nl.json
Outdated
@@ -1199,6 +1224,11 @@ | |||
"description": "Label for translation message for validation error code", | |||
"originalDefault": "Error message" | |||
}, | |||
"kIX7bm": { | |||
"defaultMessage": "Pin interacties", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"defaultMessage": "Pin interacties", | |
"defaultMessage": "Pin/punt", |
i18n/messages/nl.json
Outdated
@@ -1464,6 +1494,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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"defaultMessage": "Geeft gebruikers de mogelijkheid een pin te plaatsen, wanneer ze met het kaartmateriaal werken", | |
"defaultMessage": "Gebruikers kunnen een punt aanduiden op de kaart.", |
src/jsonEditor.scss
Outdated
@import 'leaflet-draw/dist/leaflet.draw.css'; | ||
@import 'leaflet/dist/leaflet.css'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these imports in an unrelated scss file? Can't you just import them close to where they're used (https://github.com/open-formulieren/formio-builder/blob/main/src/registry/map/index.ts)? And preferably a preview.scss
file that loads these libraries, so we have a consistent pattern of loading stylesheets for a given context:
import './previews.scss'; |
src/registry/map/preview.tsx
Outdated
edit={{ | ||
edit: false, | ||
remove: false, | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do these control? Does it mean once I've drawn something, I can't remove it anymore from the map?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah they add delete and edit buttons to the map. They are a bit cumbersome when using, so i opted to remove them..
At the moment only 1 shape is allowed. So when you create a new one, the old shape is removed. This does mean that once you have added a shape, you cannot clear it..
Im taking a look if we can change the behavior of these buttons (i.e. remove all shapes when you click the button, instead of having to click to shape and then save the deletion). For reference, this is how it normally looks https://leaflet.github.io/Leaflet.draw/docs/examples/full.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah not being able to make corrections is a problem. I think it's probably best to enable the delete, but leave the edit disabled and I'm sure there will be accessibility feedback about this in the future.
@@ -18,6 +18,7 @@ | |||
"strictNullChecks": true, | |||
"allowSyntheticDefaultImports": true, | |||
"noErrorTruncation": true, | |||
"skipLibCheck": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the impact of this? I don't like this part from the documentation:
...at the expense of type-system accuracy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This skips type checking of *.d.ts files. With this, only the *.d.ts files that we directly use are type checked.
This is a 'solution' for a typescript error originating from node_modules/react-leaflet-draw/src/index.d.ts
.
As we discussed in the office, maybe better to isolate this, or to solve this another way. I've gone trough the repo/issues of react-leaflet-draw, but i haven't found anything related to this.. So i created a ticket, asking their advice about using typescript alex3165/react-leaflet-draw#188
Both changes are needed for the leaflet-draw and react-leaflet-draw dependencies. leaflet-draw uses images for the different markers, which are included in the css. For this to work with the scss build, .png and .svg files use the dataurl loader https://esbuild.github.io/content-types/#data-url Typescript errors in the react-leaflet-draw dependency caused a typescript validation/error, which shouldn't happen. Using `skipLibCheck` in the tsconfig.json type issues in the node_modules folder are ignored
d6949a6
to
d27c01b
Compare
d27c01b
to
faf26ff
Compare
Part of open-formulieren/open-forms#2177
This relies on a update to the types repo: open-formulieren/types#62