From e7957f5a611160e72bcc580c95e4bcaaaa206c4b Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:50:17 +0200 Subject: [PATCH] [#4031] Update frontend --- .../objectsapi/ObjectsApiOptionsFormFields.js | 1 - .../objectsapi/ObjectsApiSummaryHandler.js | 13 ------- .../ObjectsApiVariableConfigurationEditor.js | 35 +------------------ 3 files changed, 1 insertion(+), 48 deletions(-) diff --git a/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiOptionsFormFields.js b/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiOptionsFormFields.js index e0f52518ad..54636e880a 100644 --- a/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiOptionsFormFields.js +++ b/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiOptionsFormFields.js @@ -56,7 +56,6 @@ const ObjectsApiOptionsFormFields = ({index, name, schema, formData, onChange}) draft.version = realVersion; if (realVersion === 2) { draft.variablesMapping = []; - draft.geometryVariableKey = ''; } else { delete draft.variablesMapping; } diff --git a/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiSummaryHandler.js b/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiSummaryHandler.js index a132077f71..27ba4d2708 100644 --- a/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiSummaryHandler.js +++ b/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiSummaryHandler.js @@ -6,7 +6,6 @@ import {FormattedMessage} from 'react-intl'; * * @typedef {{ * variablesMapping: {variableKey: string, targetPath: string[]}[], - * geometryVariableKey: string, * }} ObjectsAPIV2Options * * @param {Object} p @@ -15,18 +14,6 @@ import {FormattedMessage} from 'react-intl'; * @returns {JSX.Element} - The summary, represented as the parts of the target path separated by '>' */ const ObjectsApiSummaryHandler = ({variable, backendOptions}) => { - const geometryVariableKey = backendOptions.geometryVariableKey; - - if (geometryVariableKey === variable.key) { - return ( - record.geometry}} - /> - ); - } - const variableMapping = backendOptions.variablesMapping.find( mapping => mapping.variableKey === variable.key ); diff --git a/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiVariableConfigurationEditor.js b/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiVariableConfigurationEditor.js index 1a9dee2dc5..edff94bfa3 100644 --- a/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiVariableConfigurationEditor.js +++ b/src/openforms/js/components/admin/form_design/registrations/objectsapi/ObjectsApiVariableConfigurationEditor.js @@ -25,7 +25,6 @@ import {asJsonSchema} from './utils'; * objecttype: string; * objecttypeVersion: number; * variablesMapping: {variableKey: string, targetPath: string[]}[]; - * geometryVariableKey: string; * }} ObjectsAPIRegistrationBackendOptions * * @param {Object} p @@ -39,13 +38,10 @@ const ObjectsApiVariableConfigurationEditor = ({variable}) => { const {values: backendOptions, getFieldProps, setFieldValue} = useFormikContext(); /** @type {ObjectsAPIRegistrationBackendOptions} */ - const {objecttype, objecttypeVersion, geometryVariableKey, variablesMapping, version} = - backendOptions; + const {objecttype, objecttypeVersion, variablesMapping, version} = backendOptions; if (version !== 2) throw new Error('Not supported, must be config version 2.'); - const isGeometry = geometryVariableKey === variable.key; - // get the index of our variable in the mapping, if it exists let index = variablesMapping.findIndex( mappedVariable => mappedVariable.variableKey === variable.key @@ -115,33 +111,6 @@ const ObjectsApiVariableConfigurationEditor = ({variable}) => { /> - - - } - helpText={ - record.geometry}} - /> - } - name="geometryVariableKey" - disabled={!!mappedVariable.targetPath} - > - { - const newValue = event.target.checked ? variable.key : undefined; - setFieldValue('geometryVariableKey', newValue); - }} - /> - - { description="'JSON Schema target' label" /> } - disabled={isGeometry} >