From 61d59d381bec586931cf91d2fcd25995a78c3eaa Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Thu, 2 Jan 2025 10:52:08 +0100 Subject: [PATCH] :speech_balloon: Tailor field help texts to registration/prefill context --- src/openforms/js/compiled-lang/en.json | 30 +++++++++------- src/openforms/js/compiled-lang/nl.json | 30 +++++++++------- .../objectsapi/LegacyConfigFields.js | 11 ++---- .../objectsapi/V2ConfigFields.js | 11 ++---- .../objectsapi/fields/AuthAttributePath.js | 36 +++++++++++++++++++ .../registrations/objectsapi/fields/index.js | 1 + .../prefill/objects_api/ObjectsAPIFields.js | 8 +++++ .../forms/objects_api/AuthAttributePath.js | 11 +++--- src/openforms/js/lang/en.json | 25 +++++++------ src/openforms/js/lang/nl.json | 25 +++++++------ 10 files changed, 119 insertions(+), 69 deletions(-) create mode 100644 src/openforms/js/components/admin/form_design/registrations/objectsapi/fields/AuthAttributePath.js diff --git a/src/openforms/js/compiled-lang/en.json b/src/openforms/js/compiled-lang/en.json index 9a63a2ca3e..5fd1d83f4e 100644 --- a/src/openforms/js/compiled-lang/en.json +++ b/src/openforms/js/compiled-lang/en.json @@ -221,12 +221,6 @@ "value": "Confirm" } ], - "1Hb/pK": [ - { - "type": 0, - "value": "This is used to perform validation to verify that the authenticated user is the owner of the object." - } - ], "1HfdUc": [ { "type": 0, @@ -3725,6 +3719,12 @@ "value": "Active" } ], + "X18/UP": [ + { + "type": 0, + "value": "Owner identifier" + } + ], "XAKzo5": [ { "type": 0, @@ -4677,6 +4677,12 @@ "value": "Amount of days incomplete submissions of this form will remain before being removed. Leave blank to use value in General Configuration." } ], + "fB1baI": [ + { + "type": 0, + "value": "The property that gets compared with the identifier (e.g. BSN/KVK) of the authenticated user to verify ownership of the object being updated. This is important to prevent malicious users modifying information of other people than themselves." + } + ], "fGTdJz": [ { "type": 0, @@ -4791,6 +4797,12 @@ "value": "Do nothing" } ], + "g1i5ru": [ + { + "type": 0, + "value": "The property that gets compared with the identifier (e.g. BSN/KVK) of the authenticated user. This is important to prevent malicious users looking up private information of other people." + } + ], "gAf9pR": [ { "type": 0, @@ -5511,12 +5523,6 @@ "value": "Partner 1" } ], - "lu7yMK": [ - { - "type": 0, - "value": "Path to auth attribute (e.g. BSN/KVK) in objects" - } - ], "m20av3": [ { "type": 0, diff --git a/src/openforms/js/compiled-lang/nl.json b/src/openforms/js/compiled-lang/nl.json index acd1837413..2d9af4180a 100644 --- a/src/openforms/js/compiled-lang/nl.json +++ b/src/openforms/js/compiled-lang/nl.json @@ -221,12 +221,6 @@ "value": "Bevestigen" } ], - "1Hb/pK": [ - { - "type": 0, - "value": "Dit attribuut wordt gebruikt om te controleren dat de ingelogde gebruiker bij het object hoort dat bijgewerkt wordt." - } - ], "1HfdUc": [ { "type": 0, @@ -3738,6 +3732,12 @@ "value": "Actief" } ], + "X18/UP": [ + { + "type": 0, + "value": "Identificatie-attribuut" + } + ], "XAKzo5": [ { "type": 0, @@ -4695,6 +4695,12 @@ "value": "Aantal dagen dat een sessie bewaard blijft. Laat leeg om de waarde van de algemene configuratie te gebruiken." } ], + "fB1baI": [ + { + "type": 0, + "value": "Het attribuut dat vergeleken wordt met de identificatiewaarde (bijv. BSN/KVK-nummer) van de ingelogde gebruiker om de eigenaar van het object dat bijgewerkt wordt te controleren. Dit is belangrijk om te voorkomen dat kwaadwillenden gegevens van anderen bijwerken in plaast van zichzelf." + } + ], "fGTdJz": [ { "type": 0, @@ -4809,6 +4815,12 @@ "value": "Negeren" } ], + "g1i5ru": [ + { + "type": 0, + "value": "Het attribuut dat vergeleken wordt met de identificatiewaarde (bijv. BSN/KVK-nummer) van de ingelogde gebruiker. Dit is belangrijk om te voorkomen dat kwaadwillenden gegevens van anderen kunnen opvragen." + } + ], "gAf9pR": [ { "type": 0, @@ -5529,12 +5541,6 @@ "value": "Partner 1" } ], - "lu7yMK": [ - { - "type": 0, - "value": "Bronpad van het autorisatiekenmerk (bijv. BSN/KVK)" - } - ], "m20av3": [ { "type": 0, diff --git a/src/openforms/js/components/admin/form_design/registrations/objectsapi/LegacyConfigFields.js b/src/openforms/js/components/admin/form_design/registrations/objectsapi/LegacyConfigFields.js index f9837753da..6c5233e311 100644 --- a/src/openforms/js/components/admin/form_design/registrations/objectsapi/LegacyConfigFields.js +++ b/src/openforms/js/components/admin/form_design/registrations/objectsapi/LegacyConfigFields.js @@ -7,7 +7,6 @@ import Fieldset from 'components/admin/forms/Fieldset'; import FormRow from 'components/admin/forms/FormRow'; import {TextArea, TextInput} from 'components/admin/forms/Inputs'; import { - AuthAttributePath, ObjectTypeSelect, ObjectTypeVersionSelect, ObjectsAPIGroup, @@ -15,6 +14,7 @@ import { import ErrorBoundary from 'components/errors/ErrorBoundary'; import { + AuthAttributePath, DocumentTypesFieldet, LegacyDocumentTypesFieldet, OrganisationRSIN, @@ -129,14 +129,7 @@ const LegacyConfigFields = ({apiGroupChoices}) => { fieldNames={['updateExistingObject', 'authAttributePath']} > - +
{ fieldNames={['updateExistingObject', 'authAttributePath']} > - +
{ + const { + values: { + objectsApiGroup = null, + objecttype = '', + objecttypeVersion = null, + updateExistingObject = false, + }, + } = useFormikContext(); + return ( + + } + /> + ); +}; + +export default AuthAttributePath; diff --git a/src/openforms/js/components/admin/form_design/registrations/objectsapi/fields/index.js b/src/openforms/js/components/admin/form_design/registrations/objectsapi/fields/index.js index bc81b78752..eb718ea817 100644 --- a/src/openforms/js/components/admin/form_design/registrations/objectsapi/fields/index.js +++ b/src/openforms/js/components/admin/form_design/registrations/objectsapi/fields/index.js @@ -3,3 +3,4 @@ export {DocumentTypesFieldet} from './DocumentTypes'; export {default as UpdateExistingObject} from './UpdateExistingObject'; export {default as UploadSubmissionCsv} from './UploadSubmissionCSV'; export {default as OrganisationRSIN} from './OrganisationRSIN'; +export {default as AuthAttributePath} from './AuthAttributePath'; diff --git a/src/openforms/js/components/admin/form_design/variables/prefill/objects_api/ObjectsAPIFields.js b/src/openforms/js/components/admin/form_design/variables/prefill/objects_api/ObjectsAPIFields.js index bfbfee1101..b5df92bdef 100644 --- a/src/openforms/js/components/admin/form_design/variables/prefill/objects_api/ObjectsAPIFields.js +++ b/src/openforms/js/components/admin/form_design/variables/prefill/objects_api/ObjectsAPIFields.js @@ -255,6 +255,14 @@ const ObjectsAPIFields = () => { objecttypeUuid={objecttypeUuid} objecttypeVersion={objecttypeVersion} required + helpText={ + + } /> )}
diff --git a/src/openforms/js/components/admin/forms/objects_api/AuthAttributePath.js b/src/openforms/js/components/admin/forms/objects_api/AuthAttributePath.js index 9392f4fdb9..23212e0b64 100644 --- a/src/openforms/js/components/admin/forms/objects_api/AuthAttributePath.js +++ b/src/openforms/js/components/admin/forms/objects_api/AuthAttributePath.js @@ -18,6 +18,7 @@ const AuthAttributePath = ({ objecttypeVersion, disabled = false, required = false, + helpText = undefined, }) => { const intl = useIntl(); const {csrftoken} = useContext(APIContext); @@ -57,15 +58,10 @@ const AuthAttributePath = ({ label={ - } - helpText={ - } + helpText={helpText} disabled={disabled} required={required} > @@ -89,6 +85,7 @@ AuthAttributePath.propTypes = { objecttypeVersion: PropTypes.number, disabled: PropTypes.bool, required: PropTypes.bool, + helpText: PropTypes.node, }; export default AuthAttributePath; diff --git a/src/openforms/js/lang/en.json b/src/openforms/js/lang/en.json index 72df2d3874..5320769b35 100644 --- a/src/openforms/js/lang/en.json +++ b/src/openforms/js/lang/en.json @@ -99,11 +99,6 @@ "description": "Camunda complex process variables confirm button", "originalDefault": "Confirm" }, - "1Hb/pK": { - "defaultMessage": "This is used to perform validation to verify that the authenticated user is the owner of the object.", - "description": "Objects API registration: authAttributePath helpText", - "originalDefault": "This is used to perform validation to verify that the authenticated user is the owner of the object." - }, "1HfdUc": { "defaultMessage": "The API group specifies which objects and objecttypes services to use.", "description": "Objects API group field help text", @@ -1769,6 +1764,11 @@ "description": "Form list 'active' column header", "originalDefault": "Active" }, + "X18/UP": { + "defaultMessage": "Owner identifier", + "description": "Objects API registration: authAttributePath label", + "originalDefault": "Owner identifier" + }, "XAKzo5": { "defaultMessage": "Authentication automatic login", "description": "Auto-login field label", @@ -2174,6 +2174,11 @@ "description": "Incomplete Submissions Removal Limit help text", "originalDefault": "Amount of days incomplete submissions of this form will remain before being removed. Leave blank to use value in General Configuration." }, + "fB1baI": { + "defaultMessage": "The property that gets compared with the identifier (e.g. BSN/KVK) of the authenticated user to verify ownership of the object being updated. This is important to prevent malicious users modifying information of other people than themselves.", + "description": "Objects API registration: authAttributePath helpText", + "originalDefault": "The property that gets compared with the identifier (e.g. BSN/KVK) of the authenticated user to verify ownership of the object being updated. This is important to prevent malicious users modifying information of other people than themselves." + }, "fLCWjk": { "defaultMessage": "Name", "description": "Variable table name title", @@ -2229,6 +2234,11 @@ "description": "Session expiry warning \"do nothing\" button", "originalDefault": "Do nothing" }, + "g1i5ru": { + "defaultMessage": "The property that gets compared with the identifier (e.g. BSN/KVK) of the authenticated user. This is important to prevent malicious users looking up private information of other people.", + "description": "Objects API prefill: authAttributePath helpText", + "originalDefault": "The property that gets compared with the identifier (e.g. BSN/KVK) of the authenticated user. This is important to prevent malicious users looking up private information of other people." + }, "gAf9pR": { "defaultMessage": "(not configured yet)", "description": "No service fetch configuration configured yet message", @@ -2554,11 +2564,6 @@ "description": "ZGW APIs registration options 'objecttype' help text", "originalDefault": "URL to the object type in the objecttypes API. If provided, an object will be created and a case object relation will be added to the case." }, - "lu7yMK": { - "defaultMessage": "Path to auth attribute (e.g. BSN/KVK) in objects", - "description": "Objects API registration: authAttributePath label", - "originalDefault": "Path to auth attribute (e.g. BSN/KVK) in objects" - }, "m83ECr": { "defaultMessage": "Copying the configuration from the registration backend will clear the existing configuration. Are you sure you want to continue?", "description": "Objects API prefill configuration: warning message when copying the config from registration backend", diff --git a/src/openforms/js/lang/nl.json b/src/openforms/js/lang/nl.json index ab994dd51c..0eb58fb0ff 100644 --- a/src/openforms/js/lang/nl.json +++ b/src/openforms/js/lang/nl.json @@ -100,11 +100,6 @@ "description": "Camunda complex process variables confirm button", "originalDefault": "Confirm" }, - "1Hb/pK": { - "defaultMessage": "Dit attribuut wordt gebruikt om te controleren dat de ingelogde gebruiker bij het object hoort dat bijgewerkt wordt.", - "description": "Objects API registration: authAttributePath helpText", - "originalDefault": "This is used to perform validation to verify that the authenticated user is the owner of the object." - }, "1HfdUc": { "defaultMessage": "De API-groep bepaalt welke services voor de objecten- en objecttypen-API's gebruikt wordt.", "description": "Objects API group field help text", @@ -1787,6 +1782,11 @@ "description": "Form list 'active' column header", "originalDefault": "Active" }, + "X18/UP": { + "defaultMessage": "Identificatie-attribuut", + "description": "Objects API registration: authAttributePath label", + "originalDefault": "Owner identifier" + }, "XAKzo5": { "defaultMessage": "Authenticatie automatische login", "description": "Auto-login field label", @@ -2194,6 +2194,11 @@ "description": "Incomplete Submissions Removal Limit help text", "originalDefault": "Amount of days incomplete submissions of this form will remain before being removed. Leave blank to use value in General Configuration." }, + "fB1baI": { + "defaultMessage": "Het attribuut dat vergeleken wordt met de identificatiewaarde (bijv. BSN/KVK-nummer) van de ingelogde gebruiker om de eigenaar van het object dat bijgewerkt wordt te controleren. Dit is belangrijk om te voorkomen dat kwaadwillenden gegevens van anderen bijwerken in plaast van zichzelf.", + "description": "Objects API registration: authAttributePath helpText", + "originalDefault": "The property that gets compared with the identifier (e.g. BSN/KVK) of the authenticated user to verify ownership of the object being updated. This is important to prevent malicious users modifying information of other people than themselves." + }, "fLCWjk": { "defaultMessage": "Naam", "description": "Variable table name title", @@ -2249,6 +2254,11 @@ "description": "Session expiry warning \"do nothing\" button", "originalDefault": "Do nothing" }, + "g1i5ru": { + "defaultMessage": "Het attribuut dat vergeleken wordt met de identificatiewaarde (bijv. BSN/KVK-nummer) van de ingelogde gebruiker. Dit is belangrijk om te voorkomen dat kwaadwillenden gegevens van anderen kunnen opvragen.", + "description": "Objects API prefill: authAttributePath helpText", + "originalDefault": "The property that gets compared with the identifier (e.g. BSN/KVK) of the authenticated user. This is important to prevent malicious users looking up private information of other people." + }, "gAf9pR": { "defaultMessage": "(nog niet ingesteld)", "description": "No service fetch configuration configured yet message", @@ -2575,11 +2585,6 @@ "description": "ZGW APIs registration options 'objecttype' help text", "originalDefault": "URL to the object type in the objecttypes API. If provided, an object will be created and a case object relation will be added to the case." }, - "lu7yMK": { - "defaultMessage": "Bronpad van het autorisatiekenmerk (bijv. BSN/KVK)", - "description": "Objects API registration: authAttributePath label", - "originalDefault": "Path to auth attribute (e.g. BSN/KVK) in objects" - }, "m83ECr": { "defaultMessage": "Wanneer je de instellingen van een registratiepluginoptie overneemt, dan worden alle bestaande instellingen overschreven. Ben je zeker dat je door wil gaan?", "description": "Objects API prefill configuration: warning message when copying the config from registration backend",