diff --git a/src/helpers/recal-helper.js b/src/helpers/recal-helper.js
index 5ad9c390..f364bf68 100644
--- a/src/helpers/recal-helper.js
+++ b/src/helpers/recal-helper.js
@@ -78,5 +78,17 @@ export function anyPartWithRequiresRecalFlag(lineItems) {
return false;
}
- return lineItems.some((li) => li.requiresRecalibration === true);
+ if (Array.isArray(lineItems)) {
+ return lineItems.some((li) => li.requiresRecalibration === true);
+ }
+
+ const flattened = [
+ ...(lineItems.glassParts ?? []),
+ ...(lineItems.supportingItems ?? []),
+ ...(lineItems.otherParts ?? []),
+ ...(lineItems.feeItems ?? []),
+ ...(lineItems.vaps ?? []),
+ ];
+
+ return flattened.some((li) => li.requiresRecalibration === true);
}
diff --git a/src/layouts/coverage-statement/coverage-statement.vue b/src/layouts/coverage-statement/coverage-statement.vue
index 70415327..0e2dadc4 100644
--- a/src/layouts/coverage-statement/coverage-statement.vue
+++ b/src/layouts/coverage-statement/coverage-statement.vue
@@ -413,7 +413,8 @@ export default {
}
},
async navigateForward() {
- if (this.isUnverifiedVisible || this.isDeductibleVisible) {
+ showIssLoadingModal(true);
+ if (this.isUnverifiedVisible || this.isDeductibleVisible) {
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD);
} else if (this.isITACQuoteVisible || this.isNoCompQuoteVisible) {
this.mainStore.updateIsSafeliteProvider(true);
diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue
index 32203b5c..aeb58dcb 100644
--- a/src/layouts/license-plate-lookup/license-plate-lookup.vue
+++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue
@@ -3,7 +3,7 @@
ref="theForm"
v-slot="{ meta }"
@submit="onSubmit"
- @invalidSubmit="onInvalidSubmit">
+ @invalidSubmit="customInvalidSubmit">
@@ -251,12 +251,15 @@ export default {
if (vinLookupResponse.error) {
this.displayVinNotFoundAlert = true;
this.previouslyEnteredCarId = null;
+ this.pushEventToGA("VehicleDamage", "LicensePlate_NoMatch", "Trouble_Finding", true, null, '0');
showIssLoadingModal(false);
return this.$refs.siteFooter.disableForwardButton();
}
// Vehicle found from VIN lookup
const vehicleFromLookup = vinLookupResponse.data.vehicle;
+ const vehicleString = vehicleFromLookup.year + '_' + vehicleFromLookup.make + '_' + vehicleFromLookup.model + '_' + vehicleFromLookup.style;
+ this.pushEventToGA("VehicleDamage", "LicensePlate_Vin_Match", vehicleString, true, null, '1');
if (!vehicleFromLookup.canSafeliteService) {
this.mainStore.setBailout({
type: 'HeavyTruckVehicle',
@@ -321,6 +324,12 @@ export default {
resetWarningsAndErrors() {
this.displayVinNotFoundAlert = false;
this.displayMatchedDifferentVehicleAlert = false;
+ },
+ customInvalidSubmit({ errors }) {
+ 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.spec.js b/src/layouts/vehicle-damage/vehicle-damage.spec.js
index 8bc26edb..e4911f36 100644
--- a/src/layouts/vehicle-damage/vehicle-damage.spec.js
+++ b/src/layouts/vehicle-damage/vehicle-damage.spec.js
@@ -41,7 +41,8 @@ const mountOptions = {
methods: {
getCmsContent: jest.fn(),
getFooterInfoBoxHeight: jest.fn(() => 80),
- getPageNameByQueryString: jest.fn(() => '')
+ getPageNameByQueryString: jest.fn(() => ''),
+ pushEventToGA: jest.fn()
}
}
],
diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue
index 47f7463d..9833cdcd 100644
--- a/src/layouts/vehicle-damage/vehicle-damage.vue
+++ b/src/layouts/vehicle-damage/vehicle-damage.vue
@@ -412,6 +412,8 @@ export default {
this.selectedWindshieldOptions.selectedWindshieldChipCount
);
+ this.logEvents();
+
if (this.isWindshieldRepair) {
const results = await Promise.allSettled([useMainStore().getSupportingItems(), useMainStore().getRecalParts()]);
const supportingItems = results[0].value;
@@ -481,6 +483,76 @@ export default {
}
return selectedGlassToReplace;
+ },
+ logEvents() {
+ const vehicleString = this.mainStore.order.vehicle.make + '_' + this.mainStore.order.vehicle.model + '_' + this.mainStore.order.vehicle.style;
+ this.pushEventToGA("CAR SUBMISSION", this.mainStore.order.vehicle.year?.toString(), vehicleString, true, null, 0);
+
+ if (this.isWindshieldRepair) {
+ this.pushEventToGA("damage", "selected", "repair", true, null, null);
+ this.pushEventToGA("VehicleDamage", "Repair", this.mainStore.damage.numberOfChips?.toString(), true, null, this.mainStore.damage.numberOfChips);
+ } else {
+ this.pushEventToGA("damage", "selected", "replace", true, null, null);
+ this.selectedGlassToReplace().forEach((glass) => {
+ this.logEventForPart(glass);
+ });
+ }
+ },
+ logEventForPart(glass) {
+ let eventGlassLocation = '';
+ let eventGlassName = '';
+ switch (glass.glassLocation) {
+ case damageLocationsSelected.WINDSHIELD:
+ eventGlassLocation = 'Windshield Replace';
+ break;
+ case damageLocationsSelected.DRIVER:
+ eventGlassLocation = "Driver's Side";
+ break;
+ case damageLocationsSelected.PASSENGER:
+ eventGlassLocation = "Passenger's Side";
+ break;
+ case damageLocationsSelected.REAR:
+ eventGlassLocation = 'Back Glass';
+ break;
+ default:
+ eventGlassLocation = glass.glassLocation;
+ }
+
+ switch (glass.glassName) {
+ // Windshield options
+ case damageLocationsSelected.DRIVER:
+ eventGlassName = "Left piece";
+ break;
+ case damageLocationsSelected.PASSENGER:
+ eventGlassName = "Right piece";
+ break;
+ // Bottom two cases here are for rear options, but they are handled the same as single windshield
+ case damageLocationsSelected.SINGLE:
+ case damageLocationsSelected.STATIONARY:
+ case damageLocationsSelected.SLIDER:
+ eventGlassName = '';
+ break;
+ // Side door options
+ case damageLocationsSelected.FRONT:
+ eventGlassName = "Front door";
+ break;
+ case damageLocationsSelected.BACK:
+ eventGlassName = "Rear door";
+ break;
+ case damageLocationsSelected.QUARTER:
+ eventGlassName = "Quarter";
+ break;
+ case damageLocationsSelected.VENT:
+ eventGlassName = "Vent";
+ break;
+ case damageLocationsSelected.SIDEDOOR:
+ eventGlassName = "Sliding door";
+ break;
+ default:
+ eventGlassName = glass.glassName;
+ }
+ const label = eventGlassName ? `${eventGlassLocation} - ${eventGlassName}` : eventGlassLocation;
+ this.pushEventToGA("VehicleDamage", "Replacement", label, true, null, 1);
}
}
};
diff --git a/src/layouts/vin-lookup/vin-location-information/vin-location-information.vue b/src/layouts/vin-lookup/vin-location-information/vin-location-information.vue
index 7bc12729..b462e860 100644
--- a/src/layouts/vin-lookup/vin-location-information/vin-location-information.vue
+++ b/src/layouts/vin-lookup/vin-location-information/vin-location-information.vue
@@ -38,6 +38,7 @@ export default {
isVinLocationDetailVisible: false
};
},
+ emits: ['vin-location-detail-shown'],
computed: {
textForToggle() {
return this.getCmsContent('WhereCanIFindMyVINToggle', 'HeaderText');
@@ -52,6 +53,9 @@ export default {
methods: {
handleClickToggle() {
this.isVinLocationDetailVisible = !this.isVinLocationDetailVisible;
+ if (this.isVinLocationDetailVisible) {
+ this.$emit('vin-location-detail-shown');
+ }
}
}
};
diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue
index a2efafc8..af598359 100644
--- a/src/layouts/vin-lookup/vin-lookup.vue
+++ b/src/layouts/vin-lookup/vin-lookup.vue
@@ -16,11 +16,12 @@
class="mt-4" />
-
+