From 0a7938ccffe119143783028fbe4389d72146f574 Mon Sep 17 00:00:00 2001
From: CameronEYDS <53542131+cameron-eyds@users.noreply.github.com>
Date: Fri, 25 Oct 2024 10:13:29 -0700
Subject: [PATCH] Optional International Address (#2049)
---
ppr-ui/package-lock.json | 4 ++--
ppr-ui/package.json | 2 +-
.../src/composables/address/BaseAddress.vue | 7 +++++-
.../views/newRegistration/AddCollateral.vue | 23 +++++++------------
ppr-ui/tests/unit/ContactInformation.spec.ts | 4 ++--
.../tests/unit/SecuredPartyValidation.spec.ts | 6 +++--
6 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/ppr-ui/package-lock.json b/ppr-ui/package-lock.json
index 8eb76d9a2..c64d741e0 100644
--- a/ppr-ui/package-lock.json
+++ b/ppr-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "ppr-ui",
- "version": "3.2.69",
+ "version": "3.2.70",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ppr-ui",
- "version": "3.2.69",
+ "version": "3.2.70",
"dependencies": {
"@bcrs-shared-components/input-field-date-picker": "^1.0.0",
"@lemoncode/fonk": "^1.5.1",
diff --git a/ppr-ui/package.json b/ppr-ui/package.json
index bac3d90d3..a3e3501be 100644
--- a/ppr-ui/package.json
+++ b/ppr-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "ppr-ui",
- "version": "3.2.69",
+ "version": "3.2.70",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
diff --git a/ppr-ui/src/composables/address/BaseAddress.vue b/ppr-ui/src/composables/address/BaseAddress.vue
index 928a25ff1..c3b498cd3 100644
--- a/ppr-ui/src/composables/address/BaseAddress.vue
+++ b/ppr-ui/src/composables/address/BaseAddress.vue
@@ -242,6 +242,7 @@ export default defineComponent({
} = useAddress(toRef(addressProp), localSchema)
const origPostalCodeRules = localSchema.postalCode
const origRegionRules = localSchema.region
+ const origCityRules = localSchema.city
const { addressForm, validate } = useBaseValidations()
@@ -256,12 +257,16 @@ export default defineComponent({
if (val === 'CA') {
localSchema.postalCode = origPostalCodeRules.concat([baseRules.postalCode])
localSchema.region = origRegionRules
+ localSchema.city = origCityRules
} else if (val === 'US') {
localSchema.postalCode = origPostalCodeRules.concat([baseRules.zipCode])
localSchema.region = origRegionRules
+ localSchema.city = origCityRules
} else {
- localSchema.postalCode = origPostalCodeRules.concat([baseRules.maxLength(15)])
+ // Convert to optional rules for non-CA/US countries
+ localSchema.postalCode = [baseRules.maxLength(15), ...spaceRules]
localSchema.region = [baseRules.maxLength(2), ...spaceRules]
+ localSchema.city = [baseRules.maxLength(40), ...spaceRules]
}
// reset other address fields (check is for loading an existing address)
if (oldVal) {
diff --git a/ppr-ui/src/views/newRegistration/AddCollateral.vue b/ppr-ui/src/views/newRegistration/AddCollateral.vue
index 9048bd1e4..63f81761c 100644
--- a/ppr-ui/src/views/newRegistration/AddCollateral.vue
+++ b/ppr-ui/src/views/newRegistration/AddCollateral.vue
@@ -1,7 +1,7 @@
-
+
+