From 76b26e2991597aefaa61dd03664fff3ff8f009a5 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Thu, 3 Apr 2025 10:57:06 -0400 Subject: [PATCH] CASH-417 CASH-417 use the isBigTruck property returned from the service instead of computing it based on subType and special class --- src/constants/store-mutations.js | 2 ++ src/constants/vehicle-categories.js | 8 +----- .../service-location/service-location.vue | 2 +- .../shop-question/shop-question.vue | 7 +++++- src/layouts/vehicle/vehicle.vue | 25 +++++++++++-------- src/store/index.js | 24 +++++++++++++----- 6 files changed, 42 insertions(+), 26 deletions(-) diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 509988c6e..2f53d8133 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -10,6 +10,8 @@ const storeMutations = { UPDATE_MODEL: "updateModel", UPDATE_STYLE: "updateStyle", UPDATE_VEHICLE_SUBTYPE: "updateVehicleSubType", + UPDATE_VEHICLE_SPECIAL_CLASS: "updateVehicleSpecialClass", + UPDATE_IS_BIGTRUCK: "updateIsBigTruck", UPDATE_CAR_ID: "updateCarId", UPDATE_VEHICLE_CATEGORY: "updateVehicleCategory", UPDATE_VEHICLE_IMAGE_URL: "updateVehicleImageUrl", diff --git a/src/constants/vehicle-categories.js b/src/constants/vehicle-categories.js index 9300f47e2..8ef3e0134 100644 --- a/src/constants/vehicle-categories.js +++ b/src/constants/vehicle-categories.js @@ -8,10 +8,4 @@ const vehicleCategories = { SEMI: "SEMI", }; -export { vehicleCategories }; - -const vehicleSubTypes = { - HEAVY_TRUCK: "HEAVY TRUCK", -}; - -export { vehicleSubTypes }; +export { vehicleCategories }; \ No newline at end of file diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 142c3468b..758dc88e9 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -537,7 +537,7 @@ export default { return store.getters.order.serviceLocation.zipCode; }, getIsVehicleHeavyTruckFromStore() { - return store.getters.isHeavyTruckVehicle; + return store.getters.order.vehicle.isBigTruck; }, getIsVehicleProtectedFromStore() { return store.getters.order.serviceLocation.isVehicleProtected; diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index a15d8bb0b..c0e2bffe0 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -179,10 +179,15 @@ export default { } }); + var joinedShops = shops.join(","); + if (!joinedShops) { + joinedShops = "no-shops"; + } + this.pushEventToGA( this.GaCategories.SERVICE_LOCATION, gaAction, - shops.join(","), + joinedShops, true ); } diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index da4ee6689..257de9bf6 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -49,7 +49,7 @@ placeHolderText="Select style" customDropdownId="styleQuestionField" /> -
+
{ @@ -63,6 +62,8 @@ const getDefaultState = () => { model: null, style: null, vehicleSubType: null, + vehicleSpecialClass: null, + isBigTruck: false, carId: null, category: null, vin: null, @@ -217,6 +218,12 @@ export const mutations = { updateVehicleSubType(state, vehicleSubType) { state.order.vehicle.vehicleSubType = vehicleSubType; }, + updateVehicleSpecialClass(state, vehicleSpecialClass) { + state.order.vehicle.vehicleSpecialClass = vehicleSpecialClass; + }, + updateIsBigTruck(state, isBigTruck) { + state.order.vehicle.isBigTruck = isBigTruck; + }, updateCarId(state, carId) { state.order.vehicle.carId = carId; }, @@ -847,9 +854,6 @@ export const getters = { return false; }, - isHeavyTruckVehicle: (state) => { - return state.order.vehicle.vehicleSubType === vehicleSubTypes.HEAVY_TRUCK; - }, isMobileAppointment: (state) => { return state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE; }, @@ -1849,7 +1853,7 @@ export const actions = { endPoint += `&${glassPieces}`; } - endPoint += `&isHeavyTruckVehicle=${context.getters.isHeavyTruckVehicle}`; + endPoint += `&isHeavyTruckVehicle=${context.getters.order.vehicle.isBigTruck}`; return globalMethods.callHttpClient({ method: endpoints.GetServiceabilityDetails.method, @@ -1878,7 +1882,7 @@ export const actions = { url += `/${windshieldPartWithRecal.partNumber}`; } //heavy truck vehicle - url += `/${context.getters.isHeavyTruckVehicle}`; + url += `/${context.getters.order.vehicle.isBigTruck}`; return globalMethods.callHttpClient({ method: endpoints.GetProviders.method, @@ -2111,6 +2115,8 @@ export const actions = { make: vehicle.make, model: vehicle.model, subType: vehicle.vehicleSubType, + specialClass: vehicle.vehicleSpecialClass, + isBigTruck: vehicle.isBigTruck, isInsurance: order.payment.isInsurance ?? false, isVerified: order.payment.insuranceCoverage.isVerified ?? false, lineItems: { @@ -2165,6 +2171,8 @@ export const actions = { style: vehicle.style, vin: vehicle.vin, vehicleSubType: vehicle.vehicleSubType, + vehicleSpecialClass: vehicle.vehicleSpecialClass, + isBigTruck: vehicle.isBigTruck, registration: { firstName: vehicle.registration.firstName, lastName: vehicle.registration.lastName, @@ -2381,6 +2389,8 @@ export const actions = { model, style, vehicleSubType, + vehicleSpecialClass, + isBigTruck, carId, category, canSafeliteService, @@ -2404,6 +2414,8 @@ export const actions = { context.commit(storeMutations.UPDATE_MODEL, model); context.commit(storeMutations.UPDATE_STYLE, style); context.commit(storeMutations.UPDATE_VEHICLE_SUBTYPE, vehicleSubType); + context.commit(storeMutations.UPDATE_VEHICLE_SPECIAL_CLASS, vehicleSpecialClass); + context.commit(storeMutations.UPDATE_IS_BIGTRUCK, isBigTruck); context.commit(storeMutations.UPDATE_CAR_ID, carId); context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, category); context.commit(storeMutations.UPDATE_VEHICLE_CAN_SAFELITE_SERVICE, canSafeliteService);