Skip to content

Commit

Permalink
💬 Tailor field help texts to registration/prefill context
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Jan 2, 2025
1 parent f22ab32 commit 61d59d3
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 69 deletions.
30 changes: 18 additions & 12 deletions src/openforms/js/compiled-lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -3725,6 +3719,12 @@
"value": "Active"
}
],
"X18/UP": [
{
"type": 0,
"value": "Owner identifier"
}
],
"XAKzo5": [
{
"type": 0,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -5511,12 +5523,6 @@
"value": "Partner 1"
}
],
"lu7yMK": [
{
"type": 0,
"value": "Path to auth attribute (e.g. BSN/KVK) in objects"
}
],
"m20av3": [
{
"type": 0,
Expand Down
30 changes: 18 additions & 12 deletions src/openforms/js/compiled-lang/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -3738,6 +3732,12 @@
"value": "Actief"
}
],
"X18/UP": [
{
"type": 0,
"value": "Identificatie-attribuut"
}
],
"XAKzo5": [
{
"type": 0,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -5529,12 +5541,6 @@
"value": "Partner 1"
}
],
"lu7yMK": [
{
"type": 0,
"value": "Bronpad van het autorisatiekenmerk (bijv. BSN/KVK)"
}
],
"m20av3": [
{
"type": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ 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,
} from 'components/admin/forms/objects_api';
import ErrorBoundary from 'components/errors/ErrorBoundary';

import {
AuthAttributePath,
DocumentTypesFieldet,
LegacyDocumentTypesFieldet,
OrganisationRSIN,
Expand Down Expand Up @@ -129,14 +129,7 @@ const LegacyConfigFields = ({apiGroupChoices}) => {
fieldNames={['updateExistingObject', 'authAttributePath']}
>
<UpdateExistingObject />
<AuthAttributePath
name="authAttributePath"
objectsApiGroup={objectsApiGroup}
objecttypeUuid={objecttype}
objecttypeVersion={objecttypeVersion}
disabled={!updateExistingObject}
required={updateExistingObject}
/>
<AuthAttributePath />
</Fieldset>

<Fieldset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import {FormattedMessage} from 'react-intl';
import useConfirm from 'components/admin/form_design/useConfirm';
import Fieldset from 'components/admin/forms/Fieldset';
import {
AuthAttributePath,
ObjectTypeSelect,
ObjectTypeVersionSelect,
ObjectsAPIGroup,
} from 'components/admin/forms/objects_api';
import ErrorBoundary from 'components/errors/ErrorBoundary';

import {
AuthAttributePath,
DocumentTypesFieldet,
LegacyDocumentTypesFieldet,
OrganisationRSIN,
Expand Down Expand Up @@ -152,14 +152,7 @@ const V2ConfigFields = ({apiGroupChoices}) => {
fieldNames={['updateExistingObject', 'authAttributePath']}
>
<UpdateExistingObject />
<AuthAttributePath
name={'authAttributePath'}
objectsApiGroup={objectsApiGroup}
objecttypeUuid={objecttype}
objecttypeVersion={objecttypeVersion}
disabled={!updateExistingObject}
required={updateExistingObject}
/>
<AuthAttributePath />
</Fieldset>

<Fieldset
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {useFormikContext} from 'formik';
import {FormattedMessage} from 'react-intl';

import {AuthAttributePath as SharedAuthAttributePath} from 'components/admin/forms/objects_api';

const AuthAttributePath = () => {
const {
values: {
objectsApiGroup = null,
objecttype = '',
objecttypeVersion = null,
updateExistingObject = false,
},
} = useFormikContext();
return (
<SharedAuthAttributePath
name={'authAttributePath'}
objectsApiGroup={objectsApiGroup}
objecttypeUuid={objecttype}
objecttypeVersion={objecttypeVersion}
disabled={!updateExistingObject}
required={updateExistingObject}
helpText={
<FormattedMessage
description="Objects API registration: authAttributePath helpText"
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.`}
/>
}
/>
);
};

export default AuthAttributePath;
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ const ObjectsAPIFields = () => {
objecttypeUuid={objecttypeUuid}
objecttypeVersion={objecttypeVersion}
required
helpText={
<FormattedMessage
description="Objects API prefill: authAttributePath helpText"
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.`}
/>
}
/>
)}
</Fieldset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const AuthAttributePath = ({
objecttypeVersion,
disabled = false,
required = false,
helpText = undefined,
}) => {
const intl = useIntl();
const {csrftoken} = useContext(APIContext);
Expand Down Expand Up @@ -57,15 +58,10 @@ const AuthAttributePath = ({
label={
<FormattedMessage
description="Objects API registration: authAttributePath label"
defaultMessage="Path to auth attribute (e.g. BSN/KVK) in objects"
/>
}
helpText={
<FormattedMessage
description="Objects API registration: authAttributePath helpText"
defaultMessage="This is used to perform validation to verify that the authenticated user is the owner of the object."
defaultMessage="Owner identifier"
/>
}
helpText={helpText}
disabled={disabled}
required={required}
>
Expand All @@ -89,6 +85,7 @@ AuthAttributePath.propTypes = {
objecttypeVersion: PropTypes.number,
disabled: PropTypes.bool,
required: PropTypes.bool,
helpText: PropTypes.node,
};

export default AuthAttributePath;
25 changes: 15 additions & 10 deletions src/openforms/js/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Loading

0 comments on commit 61d59d3

Please sign in to comment.