Skip to content

Commit

Permalink
[open-formulieren/open-forms#3993] Added necessary properties for der…
Browse files Browse the repository at this point in the history
…iveAdress to addressnl component

We want to have a flag in the formio builder (deriveAddress) in order to
fetch or not the city and streetname. So, city,streetName,secretStreetCity properties
were added to the addressNL component.
  • Loading branch information
vaszig committed May 31, 2024
1 parent 8374ff3 commit 445d1cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/formio/components/addressNL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export interface AddressData {
houseNumber: string;
houseLetter: string;
houseNumberAddition: string;
city: string;
streetName: string;
secretStreetCity: string;
}

export type AddressNLInputSchema = InputComponentSchema<AddressData, Validator, TranslatableKeys>;
Expand All @@ -19,4 +22,5 @@ export type AddressNLInputSchema = InputComponentSchema<AddressData, Validator,
export interface AddressNLComponentSchema
extends Omit<AddressNLInputSchema, 'hideLabel' | 'placeholder' | 'disabled' | 'validateOn'> {
type: 'addressNL';
deriveAddress: boolean;
}
6 changes: 6 additions & 0 deletions test-d/formio/components/addressNL.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ expectAssignable<AddressNLComponentSchema>({
type: 'addressNL',
key: 'someAddressNL',
label: 'Some AddressNL',
deriveAddress: false,
});

// appropriate default value type
Expand All @@ -16,11 +17,15 @@ expectAssignable<AddressNLComponentSchema>({
type: 'addressNL',
key: 'someAddressNL',
label: 'Some AddressNL',
deriveAddress: false,
defaultValue: {
postcode: '',
houseNumber: '',
houseLetter: '',
houseNumberAddition: '',
city: '',
streetName: '',
secretStreetCity:'',
},
});

Expand All @@ -39,6 +44,7 @@ expectAssignable<AddressNLComponentSchema>({
hidden: false,
clearOnHide: true,
isSensitiveData: true,
deriveAddress: false,
// Advanced tab
conditional: {
show: undefined,
Expand Down

0 comments on commit 445d1cc

Please sign in to comment.