-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ [open-formulieren/open-forms#5073] Option to transform Selectboxes …
…data to a list of values instead of an object that maps values to true/false
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {FormattedMessage, useIntl} from 'react-intl'; | ||
|
||
import {Checkbox} from '@/components/formio'; | ||
|
||
const TransformData = () => { | ||
const intl = useIntl(); | ||
const tooltip = intl.formatMessage( | ||
{ | ||
description: "Tooltip for selectboxes 'Transform data' builder field", | ||
defaultMessage: `Transform the submitted data to a list with the selected choices, instead of an | ||
object that maps choices to <code>true</code> or <code>false</code> (dependent on whether they are selected).`, | ||
}, | ||
{ | ||
code: chunks => <code>{chunks}</code>, | ||
} | ||
) as string; // library doesn't narrow the type when using template fns :( | ||
|
||
return ( | ||
<Checkbox | ||
name="openForms.transformData" | ||
label={ | ||
<FormattedMessage | ||
description="Label for selectboxes 'Transform data' builder field" | ||
defaultMessage="Transform submitted data to list of values" | ||
/> | ||
} | ||
tooltip={tooltip} | ||
/> | ||
); | ||
}; | ||
|
||
export default TransformData; |