diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 194ae34fc..849d99ab5 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -3,7 +3,7 @@
- {{ errorMessage }} + {{ errorMessage }}
@@ -71,7 +71,7 @@ export default { const fieldOptions = { type: "text", value: modelValue, - initialValue: initialValue + initialValue: initialValue, }; const { 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; }, 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: { 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 @@