-
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.
- Loading branch information
1 parent
713dfe2
commit 1bab25e
Showing
14 changed files
with
387 additions
and
56 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
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
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
48 changes: 48 additions & 0 deletions
48
...forms/js/components/admin/form_design/registrations/json_dump/fields/MetadataVariables.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,48 @@ | ||
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'; | ||
|
||
|
||
// TODO-5012: rename to additionalMetadataVariables? | ||
const MetadataVariables = () => { | ||
const [fieldProps] = useField('additionalMetadataVariables'); | ||
const [, {value}] = useField('requiredMetadataVariables'); | ||
|
||
return ( | ||
<FormRow> | ||
<Field | ||
name="additionalMetadataVariables" | ||
label={ | ||
<FormattedMessage | ||
description="JSON registration options 'additionalMetadataVariables' label" | ||
defaultMessage="Additional metadata variables" | ||
/> | ||
} | ||
helpText={ | ||
<FormattedMessage | ||
description="JSON registration options 'additionalMetadataVariables' helpText" | ||
defaultMessage="Which additional variables to include in the metadata (the following are already included by default: {alreadyIncluded})" | ||
values={{alreadyIncluded: value.join(", ")}} | ||
/> | ||
} | ||
noManageChildProps | ||
> | ||
<VariableSelection | ||
{...fieldProps} | ||
isMulti | ||
closeMenuOnSelect={false} | ||
includeStaticVariables | ||
filter={variable => variable.source === "" && !value.includes(variable.key)} // Only show static variables and variables which are not already required | ||
/> | ||
</Field> | ||
</FormRow> | ||
); | ||
}; | ||
|
||
export default MetadataVariables; |
3 changes: 2 additions & 1 deletion
3
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,6 @@ | ||
import MetadataVariables from './MetadataVariables'; | ||
import Path from './Path'; | ||
import ServiceSelect from './ServiceSelect'; | ||
import Variables from './Variables'; | ||
|
||
export {Path, ServiceSelect, Variables}; | ||
export {MetadataVariables, Path, ServiceSelect, Variables}; |
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
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
Oops, something went wrong.