Skip to content

Commit

Permalink
Merge pull request #4480 from open-formulieren/feature/4267-popup
Browse files Browse the repository at this point in the history
[#4267] Clear variables mapping when changing Objects API configuration
  • Loading branch information
sergei-maertens authored Jul 2, 2024
2 parents 58449f8 + c1b0d57 commit 980272b
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 50 deletions.
36 changes: 24 additions & 12 deletions src/openforms/js/compiled-lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,6 @@
"value": "Number of months. Empty values are ignored."
}
],
"5ZI59Y": [
{
"type": 0,
"value": "Main"
}
],
"5dp5j+": [
{
"type": 1,
Expand Down Expand Up @@ -847,6 +841,12 @@
"value": "(missing label)"
}
],
"8/Nzyy": [
{
"type": 0,
"value": "Changing the Objects API group will remove the existing variables mapping. Are you sure you want to continue?"
}
],
"833GAg": [
{
"type": 0,
Expand Down Expand Up @@ -2455,12 +2455,6 @@
"value": " must be a valid email."
}
],
"Q7oBP/": [
{
"type": 0,
"value": "Authorised person"
}
],
"Q8WgtE": [
{
"type": 0,
Expand Down Expand Up @@ -2527,6 +2521,12 @@
"value": "Confidentiality"
}
],
"R7XVbR": [
{
"type": 0,
"value": "Main/representee"
}
],
"R8/zGm": [
{
"type": 0,
Expand Down Expand Up @@ -2813,6 +2813,12 @@
"value": "All Submissions Removal Limit"
}
],
"UjvOBe": [
{
"type": 0,
"value": "Changing the objecttype will remove the existing variables mapping. Are you sure you want to continue?"
}
],
"UlVtQd": [
{
"type": 0,
Expand Down Expand Up @@ -5405,6 +5411,12 @@
"value": "Maximum length"
}
],
"yIPUtA": [
{
"type": 0,
"value": "Authorizee"
}
],
"yL9Ql7": [
{
"type": 0,
Expand Down
36 changes: 24 additions & 12 deletions src/openforms/js/compiled-lang/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,6 @@
"value": "Aantal maanden. Lege waarden worden genegeerd."
}
],
"5ZI59Y": [
{
"type": 0,
"value": "Main/machtiger"
}
],
"5dp5j+": [
{
"type": 1,
Expand Down Expand Up @@ -851,6 +845,12 @@
"value": "(label ontbreekt)"
}
],
"8/Nzyy": [
{
"type": 0,
"value": "Changing the Objects API group will remove the existing variables mapping. Are you sure you want to continue?"
}
],
"833GAg": [
{
"type": 0,
Expand Down Expand Up @@ -2455,12 +2455,6 @@
"value": "Ongeldig e-mailadres."
}
],
"Q7oBP/": [
{
"type": 0,
"value": "Gemachtigde"
}
],
"Q8WgtE": [
{
"type": 0,
Expand Down Expand Up @@ -2527,6 +2521,12 @@
"value": "Vertrouwelijkheidaanduiding"
}
],
"R7XVbR": [
{
"type": 0,
"value": "Main/representee"
}
],
"R8/zGm": [
{
"type": 0,
Expand Down Expand Up @@ -2813,6 +2813,12 @@
"value": "Bewaartermijn van inzendingen"
}
],
"UjvOBe": [
{
"type": 0,
"value": "Changing the objecttype will remove the existing variables mapping. Are you sure you want to continue?"
}
],
"UlVtQd": [
{
"type": 0,
Expand Down Expand Up @@ -5410,6 +5416,12 @@
"value": "Maximale lengte"
}
],
"yIPUtA": [
{
"type": 0,
"value": "Authorizee"
}
],
"yL9Ql7": [
{
"type": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {ValidationErrorContext} from 'components/admin/forms/ValidationErrors';

import {getChoicesFromSchema, getErrorMarkup, getFieldErrors} from './utils';

const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {
const LegacyConfigFields = ({index, name, schema, formData, onFieldChange}) => {
const intl = useIntl();
const validationErrors = useContext(ValidationErrorContext);

Expand All @@ -34,7 +34,7 @@ const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {

useEffect(() => {
if (schema.properties.objectsApiGroup.enum.length === 1 && objectsApiGroup === '') {
onChange({
onFieldChange({
target: {name: 'objectsApiGroup', value: schema.properties.objectsApiGroup.enum[0]},
});
}
Expand Down Expand Up @@ -65,7 +65,7 @@ const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {
schema.properties.objectsApiGroup.enumNames
)}
value={objectsApiGroup}
onChange={onChange}
onChange={onFieldChange}
allowBlank
/>
</CustomFieldTemplate>
Expand All @@ -85,7 +85,12 @@ const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {
displayLabel
required
>
<TextInput id="root_objecttype" name="objecttype" value={objecttype} onChange={onChange} />
<TextInput
id="root_objecttype"
name="objecttype"
value={objecttype}
onChange={onFieldChange}
/>
</CustomFieldTemplate>
<CustomFieldTemplate
id="root_objecttypeVersion"
Expand All @@ -106,7 +111,7 @@ const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {
id="root_objecttypeVersion"
name="objecttypeVersion"
value={objecttypeVersion}
onChange={onChange}
onChange={onFieldChange}
/>
</CustomFieldTemplate>
<CustomFieldTemplate
Expand All @@ -127,7 +132,7 @@ const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {
id="root_productaanvraagType"
name="productaanvraagType"
value={productaanvraagType}
onChange={onChange}
onChange={onFieldChange}
/>
</CustomFieldTemplate>
<CustomFieldTemplate
Expand Down Expand Up @@ -156,7 +161,7 @@ const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {
id="root_informatieobjecttypeSubmissionReport"
name="informatieobjecttypeSubmissionReport"
value={informatieobjecttypeSubmissionReport}
onChange={onChange}
onChange={onFieldChange}
/>
</CustomFieldTemplate>
<CustomFieldTemplate
Expand All @@ -178,7 +183,7 @@ const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {
id="root_uploadSubmissionCsv"
name="uploadSubmissionCsv"
value={uploadSubmissionCsv}
onChange={onChange}
onChange={onFieldChange}
/>
</CustomFieldTemplate>
<CustomFieldTemplate
Expand Down Expand Up @@ -207,7 +212,7 @@ const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {
id="root_informatieobjecttypeSubmissionCsv"
name="informatieobjecttypeSubmissionCsv"
value={informatieobjecttypeSubmissionCsv}
onChange={onChange}
onChange={onFieldChange}
/>
</CustomFieldTemplate>
<CustomFieldTemplate
Expand All @@ -230,7 +235,7 @@ const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {
id="root_informatieobjecttypeAttachment"
name="informatieobjecttypeAttachment"
value={informatieobjecttypeAttachment}
onChange={onChange}
onChange={onFieldChange}
/>
</CustomFieldTemplate>
<CustomFieldTemplate
Expand All @@ -251,7 +256,7 @@ const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {
id="root_organisatieRsin"
name="organisatieRsin"
value={organisatieRsin}
onChange={onChange}
onChange={onFieldChange}
/>
</CustomFieldTemplate>
<CustomFieldTemplate
Expand All @@ -272,7 +277,7 @@ const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {
id="root_contentJson"
name="contentJson"
value={contentJson}
onChange={onChange}
onChange={onFieldChange}
/>
</CustomFieldTemplate>
<CustomFieldTemplate
Expand All @@ -296,7 +301,7 @@ const LegacyConfigFields = ({index, name, schema, formData, onChange}) => {
id="root_paymentStatusUpdateJson"
name="paymentStatusUpdateJson"
value={paymentStatusUpdateJson}
onChange={onChange}
onChange={onFieldChange}
/>
</CustomFieldTemplate>
</>
Expand All @@ -321,7 +326,7 @@ LegacyConfigFields.propTypes = {
contentJson: PropTypes.string,
paymentStatusUpdateJson: PropTypes.string,
}),
onChange: PropTypes.func.isRequired,
onFieldChange: PropTypes.func.isRequired,
};

export default LegacyConfigFields;
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const ObjectsApiOptionsFormFields = ({index, name, schema, formData, onChange})
name={name}
schema={schema}
formData={formData}
onChange={onFieldChange}
onFieldChange={onFieldChange}
/>
</Wrapper>
</TabPanel>
Expand All @@ -114,7 +114,8 @@ const ObjectsApiOptionsFormFields = ({index, name, schema, formData, onChange})
name={name}
schema={schema}
formData={formData}
onChange={onFieldChange}
onFieldChange={onFieldChange}
onChange={onChange}
/>
</Wrapper>
</TabPanel>
Expand Down
Loading

0 comments on commit 980272b

Please sign in to comment.