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

✨ [open-formulieren/open-forms#5073] transformData attribute for selectboxes #68

Closed
wants to merge 1 commit into from

Conversation

stevenbal
Copy link
Contributor

@@ -21,6 +21,7 @@ export type SelectboxesUnsupported = 'hideLabel' | 'disabled';
interface BaseSelectboxesSchema {
type: 'selectboxes';
defaultValue: Record<string, boolean>;
openForms: {transformData: boolean};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this has to be optional or required, do types like these affect existing configurations or is this just about the Formio builder knowing these attributes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

above all they should reflect the reality.

The types in this repo mostly help us developers to reason about which features we support (or don't support) and what is available. Typescript in general however is about properly using types to catch bugs at compile time rather than at runtime (and this can effectively eliminate the need for some types of tests). If your types are wrong to begin with, everything crumbles.

So, if we define this property to be required (openForms, but also transformData), that means that they must exist in the existing definitions in the backend, and implies that a data migration is necessary. Otoh, if you define them as optional, we don't need to touch existing components, but runtime code needs to take into account that the properties may be absent (undefined).

Now, for our behaviour, I think this means effectively the same - going with openForms?: {transformData?: boolean} would probably work because undefined is also falsy, which would leave the formio-builder unchecked, and this behaviour is not relevant for the formio-renderer (yet?).

@stevenbal stevenbal force-pushed the feature/5073-selectboxes-transformdata branch from a3c7034 to 5285047 Compare February 6, 2025 08:54
@vaszig
Copy link
Contributor

vaszig commented Feb 25, 2025

Discussed this with Steven and Sergei and this won't be the case. We are not going to implement this on the component level but in the variables tab and in the registration. See open-formulieren/open-forms#5074

@vaszig vaszig closed this Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a checkbox option to selectboxes to transform the format
3 participants