Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [Unreleased]

- Added: prefill form fields with BRP data of the second applicant (co-applicant) logged in with DigiD on the second login slot
- Added: age check, municipality check and personal data block support the second applicant
- Added: public helper `Helpers::secondApplicantBSN()`
- Changed: require owc/idp-userdata ^1.2
- Fix: personal data block now passes its 'processing' (verwerking) setting to the request

## [v2.1.3] - 2026-11-23

- Fix: disabled form fields
Expand Down
4 changes: 4 additions & 0 deletions build/personal-data-table/personal-data-row/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"label": ""
}
},
"secondApplicant": {
"type": "boolean",
"default": false
},
"isChildOfTable": {
"type": "boolean",
"default": false
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return ['dependencies' => ['react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'], 'version' => 'df0a722bfd18e3eb3f64'];
<?php return ['dependencies' => ['react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'], 'version' => '4cc7c7cffea09a3dc96e'];
2 changes: 1 addition & 1 deletion build/personal-data-table/personal-data-row/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion build/personal-data-table/personal-data-row/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

use OWC\PrefillGravityForms\Services\PersonalDataService;

$retrievedValue = (new PersonalDataService($attributes['selectedSupplier']['value'] ?? ''))->get($attributes['selectedOption']['value'] ?? '', $attributes['goalBinding'] ?? '');
$retrievedValue = (new PersonalDataService($attributes['selectedSupplier']['value'] ?? ''))->get(
$attributes['selectedOption']['value'] ?? '',
$attributes['goalBinding'] ?? '',
$attributes['processing'] ?? '',
(bool) ($attributes['secondApplicant'] ?? false)
);
$label = preg_replace('/\s*\(V\d+\)$/', '', $attributes['selectedOption']['label'] ?? '');

if ($attributes['isChildOfTable'] && ! empty($retrievedValue)) : ?>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"monolog/monolog": "^3.0",
"php": "^8.1",
"php-di/php-di": "^7.0",
"owc/idp-userdata": "^1.0"
"owc/idp-userdata": "^1.2"
},
"require-dev": {
"10up/wp_mock": "^0.5.0",
Expand Down
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"label": ""
}
},
"secondApplicant": {
"type": "boolean",
"default": false
},
"isChildOfTable": {
"type": "boolean",
"default": false
Expand Down
24 changes: 22 additions & 2 deletions resources/js/blocks/personal-data-table/personal-data-row/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
TabPanel,
TextControl,
SelectControl,
ToggleControl,
} from '@wordpress/components';
import { useSelect } from '@wordpress/data';
import { useEffect } from '@wordpress/element';
Expand All @@ -19,8 +20,15 @@ import personalDataOptions from './config/personalDataOptions';
import supplierOptions from './config/supplierOptions';

export default function Edit( { attributes, setAttributes, clientId } ) {
const { selectedSupplier, goalBinding, processing, selectedOption, htmlElement, isChildOfTable } =
attributes;
const {
selectedSupplier,
goalBinding,
processing,
selectedOption,
secondApplicant,
htmlElement,
isChildOfTable,
} = attributes;

const { blockParents } = useSelect( ( select ) => ( {
blockParents: select( 'core/block-editor' ).getBlockNamesByClientId(
Expand Down Expand Up @@ -107,6 +115,17 @@ export default function Edit( { attributes, setAttributes, clientId } ) {
/>
);

const secondApplicantControl = (
<ToggleControl
label="Tweede aanvrager (mede-aanvrager)"
help="Toon de gegevens van de tweede aanvrager die via de tweede login met DigiD is ingelogd."
checked={ !! secondApplicant }
onChange={ ( value ) => {
setAttributes( { secondApplicant: value } );
} }
/>
);

const selectHtmlElementControl = (
<SelectControl
label="HTML Element"
Expand Down Expand Up @@ -149,6 +168,7 @@ export default function Edit( { attributes, setAttributes, clientId } ) {
{ goalBindingControl }
{ processingControl }
{ selectPersonalDataControl }
{ secondApplicantControl }
{ ! isChildOfTable &&
selectHtmlElementControl }
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

use OWC\PrefillGravityForms\Services\PersonalDataService;

$retrievedValue = (new PersonalDataService($attributes['selectedSupplier']['value'] ?? ''))->get($attributes['selectedOption']['value'] ?? '', $attributes['goalBinding'] ?? '');
$retrievedValue = (new PersonalDataService($attributes['selectedSupplier']['value'] ?? ''))->get(
$attributes['selectedOption']['value'] ?? '',
$attributes['goalBinding'] ?? '',
$attributes['processing'] ?? '',
(bool) ($attributes['secondApplicant'] ?? false)
);
$label = preg_replace('/\s*\(V\d+\)$/', '', $attributes['selectedOption']['label'] ?? '');

if ($attributes['isChildOfTable'] && ! empty($retrievedValue)) : ?>
Expand Down
1 change: 1 addition & 0 deletions resources/views/gf-script-custom-field-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function addAgeCheckSettingToFields() {
*/
function populateCustomSettings(field) {
jQuery("#linkedField").val(field["linkedFieldValue"]);
jQuery("#linkedFieldSecondApplicant").prop('checked', field["linkedFieldSecondApplicant"] === true);

if (field.type === 'owc_pg_age_check') {
jQuery('#pgAgeCheckMinimumAge').val(field['pgAgeCheckMinimumAgeValue'] || '');
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<li class="owc_pg_prefill_setting field_setting">
<input type="checkbox" id="linkedFieldSecondApplicant" onchange="SetFieldProperty('linkedFieldSecondApplicant', this.checked);">
<label for="linkedFieldSecondApplicant" class="inline">
<?php _e('Automatisch invullen met gegevens van de tweede aanvrager (mede-aanvrager)', 'prefill-gravity-forms'); ?>
</label>
</li>
Loading
Loading