INSR-8879: Various fixes

- Fixed some cases for events for specific parts
- Fixed error handling/detection in license plate lookup and vin lookup
This commit is contained in:
Alex Humphries 2026-04-01 13:43:30 -04:00
parent 1d931707b1
commit 19c7d41b62
4 changed files with 9 additions and 16 deletions

View file

@ -326,14 +326,8 @@ export default {
this.displayMatchedDifferentVehicleAlert = false;
},
customInvalidSubmit({ errors }) {
if (errors.length > 0) {
const licensePlateError = errors.find(
(error) => error.field === 'license-plate-question'
);
if (licensePlateError) {
this.pushEventToGA("VehicleDamage", "LicensePlate_NoMatch", "Plate_Required", true, null, '0');
}
if (errors['license-plate-question']) {
this.pushEventToGA("VehicleDamage", "LicensePlate_NoMatch", "Plate_Required", true, null, '0');
}
this.onInvalidSubmit({ errors });
}

View file

@ -505,10 +505,10 @@ export default {
case damageLocationsSelected.WINDSHIELD:
eventGlassLocation = 'Windshield Replace';
break;
case damageLocationsSelected.DRIVERSIDE:
case damageLocationsSelected.DRIVER:
eventGlassLocation = "Driver's Side";
break;
case damageLocationsSelected.PASSENGERSIDE:
case damageLocationsSelected.PASSENGER:
eventGlassLocation = "Passenger's Side";
break;
case damageLocationsSelected.REAR:

View file

@ -291,12 +291,7 @@ export default {
this.vehicleFromLookup = null;
},
checkVinForErrors() {
const vinQuestionComponent = this.$refs['vin-question'];
if (vinQuestionComponent) {
const errorElement = vinQuestionComponent.$el.querySelector('.form-test-error');
return errorElement && errorElement.checkVisibility();
}
return false;
return this.$refs['vin-question'].hasErrors;
},
resetDependentState() {}
}

View file

@ -1,6 +1,7 @@
<template>
<textboxQuestion
id="vin-question-wrapper"
ref="vin-question-wrapper"
v-model="vin"
cmsWidgetName="VinNumberQuestionWidget"
disableAutoFill
@ -38,6 +39,9 @@ export default {
set(newValue) {
this.$emit('update:modelValue', newValue);
}
},
hasErrors() {
return this.$refs['vin-question-wrapper']?.meta?.valid === false;
}
}
};