-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ [#4908] Use VariableSelection component
Now supports multi selection, so we can use it here
- Loading branch information
1 parent
076f906
commit 5369dc0
Showing
5 changed files
with
49 additions
and
84 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
66 changes: 0 additions & 66 deletions
66
...rms/js/components/admin/form_design/registrations/json_dump/fields/FormVariablesSelect.js
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
src/openforms/js/components/admin/form_design/registrations/json_dump/fields/Variables.js
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,43 @@ | ||
import {useField} from 'formik'; | ||
import React from 'react'; | ||
import {FormattedMessage} from 'react-intl'; | ||
|
||
import Field from 'components/admin/forms/Field'; | ||
import FormRow from 'components/admin/forms/FormRow'; | ||
import VariableSelection from 'components/admin/forms/VariableSelection'; | ||
|
||
const Variables = () => { | ||
const [fieldProps] = useField('variables'); | ||
|
||
return ( | ||
<FormRow> | ||
<Field | ||
name="variables" | ||
label={ | ||
<FormattedMessage | ||
description="JSON registration options 'variables' label" | ||
defaultMessage="Variables" | ||
/> | ||
} | ||
helpText={ | ||
<FormattedMessage | ||
description="JSON registration options 'variables' helpText" | ||
defaultMessage="Which variables to include in the data to be sent" | ||
/> | ||
} | ||
required | ||
noManageChildProps | ||
> | ||
<VariableSelection | ||
{...fieldProps} | ||
isMulti | ||
required | ||
closeMenuOnSelect={false} | ||
includeStaticVariables={true} | ||
/> | ||
</Field> | ||
</FormRow> | ||
); | ||
}; | ||
|
||
export default Variables; |
4 changes: 2 additions & 2 deletions
4
src/openforms/js/components/admin/form_design/registrations/json_dump/fields/index.js
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import FormVariablesSelect from './FormVariablesSelect'; | ||
import Path from './Path'; | ||
import ServiceSelect from './ServiceSelect'; | ||
import Variables from './Variables'; | ||
|
||
export {FormVariablesSelect, Path, ServiceSelect}; | ||
export {Path, ServiceSelect, Variables}; |