Merge remote-tracking branch 'origin/develop' into feature/CSR-621

This commit is contained in:
Mark Harris 2022-05-20 09:32:38 -04:00
commit c7bd5f701c
6 changed files with 61 additions and 49 deletions

View file

@ -192,6 +192,7 @@ export default ({
this.addressModel.zipCode !== null) { this.addressModel.zipCode !== null) {
this.showAddressFields = true; this.showAddressFields = true;
return;
} }
const addressField1 = document.getElementById("autocomplete"); const addressField1 = document.getElementById("autocomplete");
@ -230,34 +231,34 @@ export default ({
}) })
addressField1.onchange = function() { addressField1.onchange = function() {
const hover = document.querySelector(".pac-container .pac-item:hover"); 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 an item has been clicked, do nothing, otherwise get first solution and use Geocoder to get the place
if (hover === null) { if (hover === null) {
const item = document.querySelector(".pac-container .pac-item"); const item = document.querySelector(".pac-container .pac-item");
if (item != null) { if (item != null) {
const firstResult = item.textContent; const firstResult = item.textContent;
const geocoder = new window.google.maps.Geocoder(); const geocoder = new window.google.maps.Geocoder();
geocoder.geocode({ geocoder.geocode({
address: firstResult address: firstResult
}, function (results, status) { }, function (results, status) {
if (status === window.google.maps.GeocoderStatus.OK) { if (status === window.google.maps.GeocoderStatus.OK) {
fillInAddress(results[0]); fillInAddress(results[0]);
self.displayVerificationWarning = true; self.displayVerificationWarning = true;
self.displayNoMatchWarning = false; self.displayNoMatchWarning = false;
} }
}); });
}
else {
self.addressModel.city = "";
self.addressModel.state = "";
self.addressModel.zipCode = "";
self.showAddressFields = true;
self.displayVerificationWarning = false;
self.displayNoMatchWarning = true;
}
} }
}; else {
self.addressModel.city = "";
self.addressModel.state = "";
self.addressModel.zipCode = "";
self.showAddressFields = true;
self.displayVerificationWarning = false;
self.displayNoMatchWarning = true;
}
}
};
function fillInAddress(place) { function fillInAddress(place) {
if (!place) { if (!place) {
@ -265,6 +266,7 @@ export default ({
} }
if (place && place.address_components) { if (place && place.address_components) {
self.addressModel.streetAddress= "";
self.showAddressFields = true; self.showAddressFields = true;
for (const component of place.address_components) { for (const component of place.address_components) {
@ -276,8 +278,7 @@ export default ({
break; break;
} }
case "route": { case "route": {
self.addressModel.streetAddress += self.addressModel.streetAddress += " " + component.short_name;
" " + component.short_name;
break; break;
} }
case "locality": { case "locality": {
@ -286,7 +287,6 @@ export default ({
} }
case "administrative_area_level_1": { case "administrative_area_level_1": {
self.addressModel.state = component.short_name; self.addressModel.state = component.short_name;
// self.addressModel.state = "";
break; break;
} }
case "postal_code": { case "postal_code": {
@ -311,12 +311,12 @@ export default ({
const pacContainer = document.querySelector(".pac-container"); const pacContainer = document.querySelector(".pac-container");
pacContainer.remove(); pacContainer.remove();
} }
}) })
.catch(() => { .catch(() => {
// Failed to fetch script // Failed to fetch script
console.log("Unable to load Google Places API script"); console.log("Unable to load Google Places API script");
}); });
} }
}, },
mounted() { mounted() {

View file

@ -32,7 +32,7 @@
:selectedDamageLocations="selectedDamageLocations" :selectedDamageLocations="selectedDamageLocations"
/> />
<alert <alert
class="my-3" class="my-5"
cmsWidgetName="HasReplacementConflict" cmsWidgetName="HasReplacementConflict"
v-show="hasRepairReplaceConflict" v-show="hasRepairReplaceConflict"
alertClass="alert-danger" alertClass="alert-danger"
@ -296,12 +296,12 @@ export default {
this.navigateForward(); this.navigateForward();
}, },
navigateForward(){ navigateForward(){
// If vin already exists, navigate directly to vin-lookup // If vin already exists, navigate directly to vin-lookup
if(store.getters.vehicle.vin) { if(store.getters.vehicle.vin) {
this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITH_VIN, this.$route); this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITH_VIN, this.$route);
return; return;
} }
else { else {
this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, this.$route); this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, this.$route);

View file

@ -14,7 +14,7 @@
alertClass="alert-danger" alertClass="alert-danger"
:isDismissible="false" :isDismissible="false"
/> />
<windshieldChipCountQuestion cmsWidgetName="WindshieldChipCountQuestion" <windshieldChipCountQuestion cmsWidgetName="WindshieldChipCountQuestion"
:isAvailable="isRepairOptionSelected && !hasRepairReplaceConflict" :isAvailable="isRepairOptionSelected && !hasRepairReplaceConflict"
groupName="WindshieldChipCountQuestion" groupName="WindshieldChipCountQuestion"
v-model="selectedWindshieldChipCountValues" v-model="selectedWindshieldChipCountValues"
@ -30,7 +30,7 @@
isRequired isRequired
/> />
<alert <alert
class="my-3" class="mt-5"
cmsWidgetName="SplitSingleConflict" cmsWidgetName="SplitSingleConflict"
v-if="hasSplitSingleConflict" v-if="hasSplitSingleConflict"
alertClass="alert-danger" alertClass="alert-danger"
@ -56,10 +56,10 @@ defineRule("windshield-chip-count-required", required(errorMessages.WINDSHIELD_C
defineRule("windshield-replace-options-required", required(errorMessages.WINSHIELD_REPLACE_OPTIONS_REQUIRED)); defineRule("windshield-replace-options-required", required(errorMessages.WINSHIELD_REPLACE_OPTIONS_REQUIRED));
defineRule("check-for-repair-and-replace", (value, [otherFieldValue]) => { defineRule("check-for-repair-and-replace", (value, [otherFieldValue]) => {
if (value.toString().toUpperCase().includes(damageLocationsSelected.REPAIR.toUpperCase()) && if (value.toString().toUpperCase().includes(damageLocationsSelected.REPAIR.toUpperCase()) &&
otherFieldValue.toString().toUpperCase().includes(damageLocationsSelected.WINDSHIELD.toUpperCase()) && otherFieldValue.toString().toUpperCase().includes(damageLocationsSelected.WINDSHIELD.toUpperCase()) &&
Array.isArray(otherFieldValue) && Array.isArray(otherFieldValue) &&
otherFieldValue.length > 1) otherFieldValue.length > 1)
{ {
return false; return false;
} }
@ -72,8 +72,8 @@ defineRule("repair-only", (value) => {
return false; return false;
}); });
defineRule("prevent-split-and-single-together", (value) => { defineRule("prevent-split-and-single-together", (value) => {
if (value.toString().toUpperCase().includes(damageLocationsSelected.SINGLE.toUpperCase()) && if (value.toString().toUpperCase().includes(damageLocationsSelected.SINGLE.toUpperCase()) &&
(value.toString().toUpperCase().includes(damageLocationsSelected.DRIVER.toUpperCase()) || (value.toString().toUpperCase().includes(damageLocationsSelected.DRIVER.toUpperCase()) ||
value.toString().toUpperCase().includes(damageLocationsSelected.PASSENGER.toUpperCase()))) value.toString().toUpperCase().includes(damageLocationsSelected.PASSENGER.toUpperCase())))
{ {
return false; return false;
@ -145,7 +145,7 @@ export default ({
} }
}, },
isWindshieldDamageLocation() { isWindshieldDamageLocation() {
return this.selectedDamageLocations.some(selectedDamages => return this.selectedDamageLocations.some(selectedDamages =>
{ {
return Boolean(selectedDamages.toUpperCase() === "WINDSHIELD"); return Boolean(selectedDamages.toUpperCase() === "WINDSHIELD");
}); });
@ -193,4 +193,4 @@ export default ({
alert, alert,
}, },
}) })
</script> </script>

View file

@ -91,6 +91,10 @@ export default {
: this.selectedValues[0]; : this.selectedValues[0];
} }
}, },
unmounted() { // needed to clear this button's selectedValues if it is removed
this.checkValue = false;
this.handleCheckChange();
},
methods: { methods: {
displayLoader() { displayLoader() {
this.isLoaderDisplayed = true; this.isLoaderDisplayed = true;

View file

@ -91,6 +91,10 @@ export default {
: this.selectedValues[0]; : this.selectedValues[0];
} }
}, },
unmounted() { // needed to clear this button's selectedValues if it is removed
this.checkValue = false;
this.handleCheckChange();
},
methods: { methods: {
displayLoader() { displayLoader() {
this.isLoaderDisplayed = true; this.isLoaderDisplayed = true;

View file

@ -98,6 +98,10 @@ export default {
: this.selectedValues[0]; : this.selectedValues[0];
} }
}, },
unmounted() { // needed to clear this button's selectedValues if it is removed
this.checkValue = false;
this.handleCheckChange();
},
computed: { computed: {
getLabelClasses() { getLabelClasses() {
if (this.isWide) { if (this.isWide) {