Display error when VIN scan fails.

This commit is contained in:
Chloe Herd 2023-03-08 15:54:03 -05:00
parent b5fbdfec93
commit 0a317093b5
2 changed files with 24 additions and 3 deletions

View file

@ -132,7 +132,7 @@ export default {
document.getElementById(this.inputId).dispatchEvent(new Event("change")); document.getElementById(this.inputId).dispatchEvent(new Event("change"));
}) })
.catch((error) => { .catch((error) => {
console.log(error); this.$emit("imageLookupError");
}); });
e.target.value = null; e.target.value = null;
}, },

View file

@ -8,7 +8,16 @@
:displayGenericVehicleImage="false" /> :displayGenericVehicleImage="false" />
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" /> <funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" />
<div class="fade-on-route-transition sub-container make-tall"> <div class="fade-on-route-transition sub-container make-tall">
<div class="row mt-2"> <div class="row mb-2">
<div class="col">
<alert
:manualHeadline="AlertVinScanFailedHeader"
:manualCopy="AlertVinScanFailedBody"
v-if="displayVinScanFailedAlert"
alertClass="alert-danger" />
</div>
</div>
<div class="row my-2">
<div class="col"> <div class="col">
<textboxQuestion <textboxQuestion
cmsWidgetName="VinNumberQuestionWidget" cmsWidgetName="VinNumberQuestionWidget"
@ -20,7 +29,8 @@
:isDisabled="vinPopulatedOnPageLoad" :isDisabled="vinPopulatedOnPageLoad"
maxLength="17" maxLength="17"
includeCameraIcon includeCameraIcon
:mask="vinMask" /> :mask="vinMask"
@image-lookup-error="displayVinScanAlert" />
</div> </div>
</div> </div>
<div class="row mb-2"> <div class="row mb-2">
@ -188,6 +198,7 @@ export default {
displayNonServiceableZipAlert: false, displayNonServiceableZipAlert: false,
displayVinNotFoundAlert: false, displayVinNotFoundAlert: false,
displayMatchedDifferentVehicleAlert: false, displayMatchedDifferentVehicleAlert: false,
displayVinScanFailedAlert: false,
}; };
}, },
methods: { methods: {
@ -381,11 +392,15 @@ export default {
await this.navigateForwardWithSingleCarMatch(); await this.navigateForwardWithSingleCarMatch();
} }
}, },
displayVinScanAlert() {
this.displayVinScanFailedAlert = true;
},
resetAlerts() { resetAlerts() {
this.displayMatchedDifferentVehicleAlert = false; this.displayMatchedDifferentVehicleAlert = false;
this.displayNonServiceableZipAlert = false; this.displayNonServiceableZipAlert = false;
this.displayInvalidZipAlert = false; this.displayInvalidZipAlert = false;
this.displayVinNotFoundAlert = false; this.displayVinNotFoundAlert = false;
this.displayVinScanFailedAlert = false;
}, },
}, },
mounted() { mounted() {
@ -432,6 +447,12 @@ export default {
getIsWindshieldOnly() getIsWindshieldOnly()
); );
}, },
AlertVinScanFailedHeader() {
return "VIN scan failed.";
},
AlertVinScanFailedBody() {
return "Please try again or enter your VIN manually.";
},
isInsuranceVerified() { isInsuranceVerified() {
return ( return (
store.getters.payment.insuranceCoverage.isVerified || store.getters.payment.insuranceCoverage.isVerified ||