Skip to content

Commit

Permalink
Merge pull request #48 from open-formulieren/of-3993/city-and-streetn…
Browse files Browse the repository at this point in the history
…ame-properties-in-addressnl

[OF#3993] Add city and streetName to addressnl component
  • Loading branch information
sergei-maertens authored Jun 12, 2024
2 parents 8374ff3 + 2cbb2ac commit 1c592b6
Show file tree
Hide file tree
Showing 2 changed files with 11 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;
}
7 changes: 7 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 Expand Up @@ -75,4 +81,5 @@ expectNotAssignable<AddressNLComponentSchema>({
disabled: true,
placeholder: '',
hideLabel: true,
deriveAddress: false,
} as const);

0 comments on commit 1c592b6

Please sign in to comment.