From 19c7d41b6273132fb2d04e7b4cde4cfafb4cad6c Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Wed, 1 Apr 2026 13:43:30 -0400 Subject: [PATCH] INSR-8879: Various fixes - Fixed some cases for events for specific parts - Fixed error handling/detection in license plate lookup and vin lookup --- .../license-plate-lookup/license-plate-lookup.vue | 10 ++-------- src/layouts/vehicle-damage/vehicle-damage.vue | 4 ++-- src/layouts/vin-lookup/vin-lookup.vue | 7 +------ src/layouts/vin-lookup/vin-question/vin-question.vue | 4 ++++ 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index 86796e10..aeb58dcb 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -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 }); } diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 82adfde4..08e41a09 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -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: diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 493683df..af598359 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -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() {} } diff --git a/src/layouts/vin-lookup/vin-question/vin-question.vue b/src/layouts/vin-lookup/vin-question/vin-question.vue index e3553229..8b7c730e 100644 --- a/src/layouts/vin-lookup/vin-question/vin-question.vue +++ b/src/layouts/vin-lookup/vin-question/vin-question.vue @@ -1,6 +1,7 @@