-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add constant for address type codes and & update strings with constan…
…ts (#1160)
- Loading branch information
1 parent
7bc6fda
commit 51cc7db
Showing
4 changed files
with
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
import { t } from '@lingui/macro'; | ||
|
||
// Use address type where users will be instructed to select a type (ie. address form component). | ||
export const addressType = { | ||
ADDRESS_TYPE_CODE_MISC: t`Unspecified`, | ||
ADDRESS_TYPE_CODE_HOME: t`Residential`, | ||
ADDRESS_TYPE_CODE_BIZZ: t`Business`, | ||
ADDRESS_TYPE_CODE_GEOG: t`Geographic` | ||
}; | ||
|
||
// Use addressTypeEnum when the address type code is required when sending data to the backend. | ||
export const addressTypeEnum = { | ||
ADDRESS_TYPE_MISC: 'ADDRESS_TYPE_CODE_MISC', | ||
ADDRESS_TYPE_HOME: 'ADDRESS_TYPE_CODE_HOME', | ||
ADDRESS_TYPE_BIZZ: 'ADDRESS_TYPE_CODE_BIZZ', | ||
ADDRESS_TYPE_GEOG: 'ADDRESS_TYPE_CODE_GEOG' | ||
}; | ||
|
||
// The addressTypeOptions is used to generate the options for the address type select form control. | ||
export const addressTypeOptions = () => { | ||
return Object.entries(addressType).map(([k, v]) => ({ value: k, label: v })); | ||
}; |
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