From 655d62418b92e9d7431778913ee0cf10083cc105 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 18 May 2022 08:25:25 -0400 Subject: [PATCH 1/4] Tacking on fix for email address not validating when a space is present. We now trim the modelValue automatically --- src/common-components/textbox-question/textbox-question.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 194ae34fc..4d1fac173 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -3,7 +3,7 @@ Date: Wed, 18 May 2022 09:53:05 -0400 Subject: [PATCH 2/4] small refactor + defect fix --- src/helpers/damage-helper.js | 7 +++++++ src/layouts/address-lookup/address-lookup.vue | 13 +++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/helpers/damage-helper.js b/src/helpers/damage-helper.js index a3b9a2878..0928a2656 100644 --- a/src/helpers/damage-helper.js +++ b/src/helpers/damage-helper.js @@ -4,10 +4,17 @@ import { storeActions } from "@/constants/store-actions"; export function getDamageString() { const damageLocations = store.getters.damage.glassToReplace; + const isRepair = store.getters.damage.isRepair; + let returnString; if (!damageLocations) { return; } + // If it's a repair it's always a windshield. + if(isRepair){ + return "windshield" + } + if (damageLocations.length > 1) { returnString = "match" } else { diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index b3ef4c6ae..454a17b83 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -372,13 +372,14 @@ export default { return text; }, AlertMatchedDifferentVehicleBody(){ - let content = this.getCmsContent("AlertMatchedDifferentVehicleWidget", "BodyText"); - content = content.replaceAll("{custom:glassText}", getDamageString()); - const vinYmmFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`; - const vinYmmExpected = `${store.getters.vehicle.year} ${store.getters.vehicle.make} ${store.getters.vehicle.model}`; - content = content.replaceAll("{custom:vinYmmFound}", vinYmmFound); - content = content.replaceAll("{custom:vinYmmExpected}", vinYmmExpected); + const vinYmmFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`; + const vinYmmExpected = `${store.getters.vehicle.year} ${store.getters.vehicle.make} ${store.getters.vehicle.model}`; + + const content = this.getCmsContent("AlertMatchedDifferentVehicleWidget", "BodyText") + .replaceAll("{custom:glassText}", getDamageString()) + .replaceAll("{custom:vinYmmFound}", vinYmmFound) + .replaceAll("{custom:vinYmmExpected}", vinYmmExpected); return content; }, From f74b5100ae6124b5005aa731212c972b444c400a Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 18 May 2022 10:10:37 -0400 Subject: [PATCH 3/4] Changed original code to disable address autocomplete after showing city, state, and zip. The original method introduced a bug when a completely un matchable address was entered --- .../textbox-question/textbox-question.vue | 2 +- .../address-questions/address-questions.vue | 30 ++++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 4d1fac173..2417f3da8 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -71,7 +71,7 @@ export default { const fieldOptions = { type: "text", value: modelValue, - initialValue: initialValue + initialValue: initialValue, }; const { diff --git a/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue b/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue index 59e4d26ab..c310fbd10 100644 --- a/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue +++ b/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue @@ -77,6 +77,8 @@ export default ({ alertCopyVerificationWarning: "", alertHeadlineNoMatchWarning: "", alertCopyNoMatchWarning: "", + autocomplete: {}, + autocompleteListener: {} } }, computed: { @@ -165,7 +167,7 @@ export default ({ this.$loadScript(`https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=places`) .then(() => { // Script is loaded, initialize the autocomplete textbox - const autocomplete = new window.google.maps.places.Autocomplete( + self.autocomplete = new window.google.maps.places.Autocomplete( addressField1, { componentRestrictions: { country: ["us"] }, @@ -175,7 +177,7 @@ export default ({ ); // Standard place_changed event handling - const autocompleteListener = window.google.maps.event.addListener(autocomplete, 'place_changed', fillInAddress); + self.autocompleteListener = window.google.maps.event.addListener(this.autocomplete, 'place_changed', fillInAddress); // Wrapping the addressField1 element in the Google Address Autocomplete object // will cause "autocomplete='off'" which Chrome completely ignores. This event @@ -221,12 +223,10 @@ export default ({ function fillInAddress(place) { if (!place) { - place = autocomplete.getPlace(); + place = self.autocomplete.getPlace(); } if (place && place.address_components) { - self.showAddressFields = true; - for (const component of place.address_components) { const componentType = component.types[0]; @@ -257,18 +257,15 @@ export default ({ self.displayVerificationWarning = false; self.displayNoMatchWarning = false; + + self.showAddressFields = true; } else { self.displayVerificationWarning = true; self.displayNoMatchWarning = false; } - // after showing the address fields, disable the address autocomplete - window.google.maps.event.removeListener(autocompleteListener); - window.google.maps.event.clearInstanceListeners(autocomplete); - addressField1.onchange = null; - const pacContainer = document.querySelector(".pac-container"); - pacContainer.remove(); + } }) @@ -296,6 +293,17 @@ export default ({ } }, deep: true + }, + showAddressFields: { + handler(newValue) { + // after showing the address fields, disable the address autocomplete + window.google.maps.event.removeListener(this.autocompleteListener); + window.google.maps.event.clearInstanceListeners(this.autocomplete); + const addressField1 = document.getElementById("autocomplete"); + addressField1.onchange = null; + const pacContainer = document.querySelector(".pac-container"); + pacContainer.remove(); + } } }, components: { From 5cbf3d632c640da6b403e3b8b18c4258e0166118 Mon Sep 17 00:00:00 2001 From: bmauger Date: Wed, 18 May 2022 10:32:35 -0400 Subject: [PATCH 4/4] CSR-571 fix spacing for multi-vehicle alert. Required adjustment to vin information spacing. --- .../textbox-question/textbox-question.vue | 2 +- src/layouts/address-vehicles/address-vehicles.vue | 8 ++++---- .../vin-lookup/vin-information/vin-information.vue | 2 +- src/styles/common-error-styles.scss | 4 ---- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 194ae34fc..3a9d92abf 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -19,7 +19,7 @@ :validationRules="validationRules" />
- {{ errorMessage }} + {{ errorMessage }}
diff --git a/src/layouts/address-vehicles/address-vehicles.vue b/src/layouts/address-vehicles/address-vehicles.vue index f21015061..34937bfb7 100644 --- a/src/layouts/address-vehicles/address-vehicles.vue +++ b/src/layouts/address-vehicles/address-vehicles.vue @@ -10,7 +10,7 @@ - -
+
{{ copy.split(':')[1].split(',')[1] }} @@ -240,4 +240,4 @@ export default { line-height: inherit; } } - \ No newline at end of file + diff --git a/src/layouts/vin-lookup/vin-information/vin-information.vue b/src/layouts/vin-lookup/vin-information/vin-information.vue index e6fa5c8fb..91cee616f 100644 --- a/src/layouts/vin-lookup/vin-information/vin-information.vue +++ b/src/layouts/vin-lookup/vin-information/vin-information.vue @@ -1,5 +1,5 @@