-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from open-formulieren/rename-address-component
Rename `address` to `addressNL`
- Loading branch information
Showing
5 changed files
with
86 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import {expectAssignable, expectNotAssignable} from 'tsd'; | ||
|
||
import {AddressNLComponentSchema} from '../../../lib'; | ||
|
||
// minimal Address (NL) component schema | ||
expectAssignable<AddressNLComponentSchema>({ | ||
id: 'yejak', | ||
type: 'addressNL', | ||
key: 'someAddressNL', | ||
label: 'Some AddressNL', | ||
}); | ||
|
||
// appropriate default value type | ||
expectAssignable<AddressNLComponentSchema>({ | ||
id: 'yejak', | ||
type: 'addressNL', | ||
key: 'someAddressNL', | ||
label: 'Some AddressNL', | ||
defaultValue: { | ||
postcode: '', | ||
houseNumber: '', | ||
houseLetter: '', | ||
houseNumberAddition: '', | ||
}, | ||
}); | ||
|
||
// full, correct schema | ||
expectAssignable<AddressNLComponentSchema>({ | ||
id: 'yejak', | ||
type: 'addressNL', | ||
// basic tab | ||
label: 'Some AddressNL', | ||
key: 'someAddressNL', | ||
description: '', | ||
tooltip: 'A tooltip', | ||
showInSummary: true, | ||
showInEmail: false, | ||
showInPDF: true, | ||
hidden: false, | ||
clearOnHide: true, | ||
isSensitiveData: true, | ||
// Advanced tab | ||
conditional: { | ||
show: undefined, | ||
when: '', | ||
eq: '', | ||
}, | ||
// Validation tab | ||
validate: { | ||
required: false, | ||
plugins: [], | ||
}, | ||
translatedErrors: {nl: {required: 'Geef email.'}}, | ||
errors: {required: 'Geef email.'}, | ||
// registration tab | ||
registration: { | ||
attribute: '', | ||
}, | ||
// translations tab in builder form | ||
openForms: { | ||
translations: { | ||
nl: {label: 'foo'}, | ||
}, | ||
}, | ||
// fixed but not editable | ||
}); | ||
|
||
// Non supported keys | ||
expectNotAssignable<AddressNLComponentSchema>({ | ||
id: 'yejak', | ||
type: 'addressNL', | ||
key: 'someAddressNL', | ||
label: 'Some AddressNL', | ||
validateOn: 'change', | ||
disabled: true, | ||
placeholder: '', | ||
hideLabel: true, | ||
} as const); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters