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 98c0ca927..f188cf214 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 @@ -192,6 +192,7 @@ export default ({ this.addressModel.zipCode !== null) { this.showAddressFields = true; + return; } const addressField1 = document.getElementById("autocomplete"); @@ -230,34 +231,34 @@ export default ({ }) - addressField1.onchange = function() { - const hover = document.querySelector(".pac-container .pac-item:hover"); - // if an item has been clicked, do nothing, otherwise get first solution and use Geocoder to get the place - if (hover === null) { - const item = document.querySelector(".pac-container .pac-item"); - if (item != null) { - const firstResult = item.textContent; - const geocoder = new window.google.maps.Geocoder(); - geocoder.geocode({ - address: firstResult - }, function (results, status) { - if (status === window.google.maps.GeocoderStatus.OK) { - fillInAddress(results[0]); - self.displayVerificationWarning = true; - self.displayNoMatchWarning = false; - } - }); - } - else { - self.addressModel.city = ""; - self.addressModel.state = ""; - self.addressModel.zipCode = ""; - self.showAddressFields = true; - self.displayVerificationWarning = false; - self.displayNoMatchWarning = true; - } + addressField1.onchange = function() { + const hover = document.querySelector(".pac-container .pac-item:hover"); + // if an item has been clicked, do nothing, otherwise get first solution and use Geocoder to get the place + if (hover === null) { + const item = document.querySelector(".pac-container .pac-item"); + if (item != null) { + const firstResult = item.textContent; + const geocoder = new window.google.maps.Geocoder(); + geocoder.geocode({ + address: firstResult + }, function (results, status) { + if (status === window.google.maps.GeocoderStatus.OK) { + fillInAddress(results[0]); + self.displayVerificationWarning = true; + self.displayNoMatchWarning = false; + } + }); } - }; + else { + self.addressModel.city = ""; + self.addressModel.state = ""; + self.addressModel.zipCode = ""; + self.showAddressFields = true; + self.displayVerificationWarning = false; + self.displayNoMatchWarning = true; + } + } + }; function fillInAddress(place) { if (!place) { @@ -265,6 +266,7 @@ export default ({ } if (place && place.address_components) { + self.addressModel.streetAddress= ""; self.showAddressFields = true; for (const component of place.address_components) { @@ -276,8 +278,7 @@ export default ({ break; } case "route": { - self.addressModel.streetAddress += - " " + component.short_name; + self.addressModel.streetAddress += " " + component.short_name; break; } case "locality": { @@ -286,7 +287,6 @@ export default ({ } case "administrative_area_level_1": { self.addressModel.state = component.short_name; - // self.addressModel.state = ""; break; } case "postal_code": { @@ -311,12 +311,12 @@ export default ({ const pacContainer = document.querySelector(".pac-container"); pacContainer.remove(); - } - }) - .catch(() => { - // Failed to fetch script - console.log("Unable to load Google Places API script"); - }); + } + }) + .catch(() => { + // Failed to fetch script + console.log("Unable to load Google Places API script"); + }); } }, mounted() { diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index ddeae5bec..88c8973fd 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -32,7 +32,7 @@ :selectedDamageLocations="selectedDamageLocations" /> - { - if (value.toString().toUpperCase().includes(damageLocationsSelected.REPAIR.toUpperCase()) && - otherFieldValue.toString().toUpperCase().includes(damageLocationsSelected.WINDSHIELD.toUpperCase()) && - Array.isArray(otherFieldValue) && - otherFieldValue.length > 1) + if (value.toString().toUpperCase().includes(damageLocationsSelected.REPAIR.toUpperCase()) && + otherFieldValue.toString().toUpperCase().includes(damageLocationsSelected.WINDSHIELD.toUpperCase()) && + Array.isArray(otherFieldValue) && + otherFieldValue.length > 1) { return false; } @@ -72,8 +72,8 @@ defineRule("repair-only", (value) => { return false; }); defineRule("prevent-split-and-single-together", (value) => { - if (value.toString().toUpperCase().includes(damageLocationsSelected.SINGLE.toUpperCase()) && - (value.toString().toUpperCase().includes(damageLocationsSelected.DRIVER.toUpperCase()) || + if (value.toString().toUpperCase().includes(damageLocationsSelected.SINGLE.toUpperCase()) && + (value.toString().toUpperCase().includes(damageLocationsSelected.DRIVER.toUpperCase()) || value.toString().toUpperCase().includes(damageLocationsSelected.PASSENGER.toUpperCase()))) { return false; @@ -145,7 +145,7 @@ export default ({ } }, isWindshieldDamageLocation() { - return this.selectedDamageLocations.some(selectedDamages => + return this.selectedDamageLocations.some(selectedDamages => { return Boolean(selectedDamages.toUpperCase() === "WINDSHIELD"); }); @@ -193,4 +193,4 @@ export default ({ alert, }, }) - \ No newline at end of file + diff --git a/src/ux-components/list-button-horizontal/list-button-horizontal.vue b/src/ux-components/list-button-horizontal/list-button-horizontal.vue index ccb995f77..974a965b8 100644 --- a/src/ux-components/list-button-horizontal/list-button-horizontal.vue +++ b/src/ux-components/list-button-horizontal/list-button-horizontal.vue @@ -91,6 +91,10 @@ export default { : this.selectedValues[0]; } }, + unmounted() { // needed to clear this button's selectedValues if it is removed + this.checkValue = false; + this.handleCheckChange(); + }, methods: { displayLoader() { this.isLoaderDisplayed = true; diff --git a/src/ux-components/list-button/list-button.vue b/src/ux-components/list-button/list-button.vue index 1f1a5046b..e567ebaa6 100644 --- a/src/ux-components/list-button/list-button.vue +++ b/src/ux-components/list-button/list-button.vue @@ -91,6 +91,10 @@ export default { : this.selectedValues[0]; } }, + unmounted() { // needed to clear this button's selectedValues if it is removed + this.checkValue = false; + this.handleCheckChange(); + }, methods: { displayLoader() { this.isLoaderDisplayed = true; diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index 742ec4584..c5ed398f3 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -98,6 +98,10 @@ export default { : this.selectedValues[0]; } }, + unmounted() { // needed to clear this button's selectedValues if it is removed + this.checkValue = false; + this.handleCheckChange(); + }, computed: { getLabelClasses() { if (this.isWide) {