Merge pull request #3131 from Safelite/feature/CASH-2380
Feature/CASH 2380
This commit is contained in:
commit
b56f427feb
8 changed files with 54 additions and 18916 deletions
|
|
@ -18,6 +18,7 @@ const GaCategories = {
|
||||||
INSHOP_CONFIRMATION_CLICKED: "inshop confirmation clicked",
|
INSHOP_CONFIRMATION_CLICKED: "inshop confirmation clicked",
|
||||||
MOBILE_CONFIRMATION_CLICKED: "mobile confirmation clicked",
|
MOBILE_CONFIRMATION_CLICKED: "mobile confirmation clicked",
|
||||||
RECAL_DISCLAIMER: "Recalibration disclaimer",
|
RECAL_DISCLAIMER: "Recalibration disclaimer",
|
||||||
|
VIN_ELIGIBLE: "VIN eligible",
|
||||||
};
|
};
|
||||||
|
|
||||||
const GaActions = {
|
const GaActions = {
|
||||||
|
|
@ -32,6 +33,8 @@ const GaActions = {
|
||||||
MORE_LOCATIONS_CLICKED: "more_locations_clicked",
|
MORE_LOCATIONS_CLICKED: "more_locations_clicked",
|
||||||
YES: "yes",
|
YES: "yes",
|
||||||
NO: "no",
|
NO: "no",
|
||||||
|
TRUE: "true",
|
||||||
|
FALSE: "false",
|
||||||
ACKNOWLEDGED: "Acknowledged",
|
ACKNOWLEDGED: "Acknowledged",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -20,6 +20,8 @@ const storeMutations = {
|
||||||
UPDATE_VEHICLE_VIN: "updateVehicleVin",
|
UPDATE_VEHICLE_VIN: "updateVehicleVin",
|
||||||
UPDATE_VEHICLE: "updateVehicle",
|
UPDATE_VEHICLE: "updateVehicle",
|
||||||
UPDATE_VEHICLE_CAN_SAFELITE_SERVICE: "updateVehicleCanSafeliteService",
|
UPDATE_VEHICLE_CAN_SAFELITE_SERVICE: "updateVehicleCanSafeliteService",
|
||||||
|
UPDATE_SKIP_VIN_LOOKUP: "updateSkipVINLookup",
|
||||||
|
UPDATE_SKIP_PART_QUESTIONS: "updateSkipPartQuestions",
|
||||||
|
|
||||||
UPDATE_IS_REPAIR: "updateIsRepair",
|
UPDATE_IS_REPAIR: "updateIsRepair",
|
||||||
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",
|
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",
|
||||||
|
|
|
||||||
|
|
@ -499,6 +499,14 @@ export default {
|
||||||
policy.policyNumber !== "";
|
policy.policyNumber !== "";
|
||||||
|
|
||||||
const skipVin = await skipVinLookup();
|
const skipVin = await skipVinLookup();
|
||||||
|
|
||||||
|
this.pushEventToGA(
|
||||||
|
this.GaCategories.VIN_ELIGIBLE,
|
||||||
|
skipVin ? this.GaActions.FALSE : this.GaActions.TRUE,
|
||||||
|
this.$store.getters.vehicle.carId,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
if (vehicleChangedDuringPolicyLookupInHeritage) {
|
if (vehicleChangedDuringPolicyLookupInHeritage) {
|
||||||
if (skipVin) {
|
if (skipVin) {
|
||||||
this.$router.navigateWithSaving(
|
this.$router.navigateWithSaving(
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,8 @@ export default {
|
||||||
styleOptions: [],
|
styleOptions: [],
|
||||||
displayNoServiceAlert: false,
|
displayNoServiceAlert: false,
|
||||||
canSafeliteService: this.canSafeliteServiceFromStore(),
|
canSafeliteService: this.canSafeliteServiceFromStore(),
|
||||||
|
skipVINLookup: this.getSkipVINLookupfromStore(),
|
||||||
|
skipPartQuestions: this.getSkipPartQuestionsfromStore(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -486,6 +488,8 @@ export default {
|
||||||
this.vehicleSubType = result?.data.vehicleSubType;
|
this.vehicleSubType = result?.data.vehicleSubType;
|
||||||
this.vehicleSpecialClass = result?.data.vehicleSpecialClass;
|
this.vehicleSpecialClass = result?.data.vehicleSpecialClass;
|
||||||
this.isBigTruck = result?.data.isBigTruck;
|
this.isBigTruck = result?.data.isBigTruck;
|
||||||
|
this.skipVINLookup = result?.data.skipVINLookup;
|
||||||
|
this.skipPartQuestions = result?.data.skipPartQuestions;
|
||||||
},
|
},
|
||||||
resetAlert() {
|
resetAlert() {
|
||||||
this.displayNoServiceAlert = false;
|
this.displayNoServiceAlert = false;
|
||||||
|
|
@ -542,6 +546,8 @@ export default {
|
||||||
imageUrl: this.imageUrl,
|
imageUrl: this.imageUrl,
|
||||||
imageVifNumber: this.imageVifNumber,
|
imageVifNumber: this.imageVifNumber,
|
||||||
imageVifColor: this.imageVifColor,
|
imageVifColor: this.imageVifColor,
|
||||||
|
skipVINLookup: this.skipVINLookup,
|
||||||
|
skipPartQuestions: this.skipPartQuestions,
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
@ -627,6 +633,12 @@ export default {
|
||||||
getIsBigTruckfromStore() {
|
getIsBigTruckfromStore() {
|
||||||
return store.getters.vehicle.isBigTruck;
|
return store.getters.vehicle.isBigTruck;
|
||||||
},
|
},
|
||||||
|
getSkipVINLookupfromStore() {
|
||||||
|
return store.getters.vehicle.skipVINLookup;
|
||||||
|
},
|
||||||
|
getSkipPartQuestionsfromStore() {
|
||||||
|
return store.getters.vehicle.skipPartQuestions;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import { storeActions } from "@/constants/store-actions";
|
||||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
import { getIsWindshieldOnly } from "@/helpers/damage-helper";
|
||||||
|
import { partTypeStrings } from "@/constants/part-type-strings";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -367,8 +369,13 @@ export default {
|
||||||
const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions);
|
const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions);
|
||||||
const hasCapabilityQuestions = this.hasCapabilityQuestions(partsOrQuestions);
|
const hasCapabilityQuestions = this.hasCapabilityQuestions(partsOrQuestions);
|
||||||
|
|
||||||
|
const isWindshieldOnly =
|
||||||
|
getIsWindshieldOnly().toUpperCase() === partTypeStrings.WINDSHIELD;
|
||||||
|
const skipPartQuestions = store.getters.vehicle?.skipPartQuestions && isWindshieldOnly;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
hasPartQuestions &&
|
hasPartQuestions &&
|
||||||
|
!skipPartQuestions &&
|
||||||
this.currentPageComesBeforePage(currentPage, routeData.PART_QUESTIONS.name)
|
this.currentPageComesBeforePage(currentPage, routeData.PART_QUESTIONS.name)
|
||||||
) {
|
) {
|
||||||
self.$router.navigateWithPageData(
|
self.$router.navigateWithPageData(
|
||||||
|
|
@ -378,6 +385,7 @@ export default {
|
||||||
);
|
);
|
||||||
} else if (
|
} else if (
|
||||||
hasGlassLocationWithMultipleParts &&
|
hasGlassLocationWithMultipleParts &&
|
||||||
|
!skipPartQuestions &&
|
||||||
this.currentPageComesBeforePage(currentPage, routeData.VEHICLE_PARTS.name)
|
this.currentPageComesBeforePage(currentPage, routeData.VEHICLE_PARTS.name)
|
||||||
) {
|
) {
|
||||||
// if multiple parts on any glass
|
// if multiple parts on any glass
|
||||||
|
|
@ -389,6 +397,7 @@ export default {
|
||||||
);
|
);
|
||||||
} else if (
|
} else if (
|
||||||
hasChildPartQuestions &&
|
hasChildPartQuestions &&
|
||||||
|
!skipPartQuestions &&
|
||||||
this.currentPageComesBeforePage(currentPage, routeData.MOLDING_QUESTIONS.name)
|
this.currentPageComesBeforePage(currentPage, routeData.MOLDING_QUESTIONS.name)
|
||||||
) {
|
) {
|
||||||
// if any childpart questions
|
// if any childpart questions
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import { storeActions } from "@/constants/store-actions";
|
||||||
import { applicationConfig } from "@/constants/application-config";
|
import { applicationConfig } from "@/constants/application-config";
|
||||||
import { experimentTriggers } from "@/constants/experiments";
|
import { experimentTriggers } from "@/constants/experiments";
|
||||||
import { damageLocationsSelected } from "@/constants/damage-locations-selected";
|
import { damageLocationsSelected } from "@/constants/damage-locations-selected";
|
||||||
import { singleWindshieldCarIds } from "@/constants/single-windshield-carids";
|
|
||||||
import { routeData } from "@/router/constants/routes";
|
import { routeData } from "@/router/constants/routes";
|
||||||
import {
|
import {
|
||||||
deleteFunnelCookie,
|
deleteFunnelCookie,
|
||||||
|
|
@ -83,6 +82,8 @@ const getDefaultState = () => {
|
||||||
registration: {
|
registration: {
|
||||||
licensePlate: null,
|
licensePlate: null,
|
||||||
},
|
},
|
||||||
|
skipVINLookup: false,
|
||||||
|
skipPartQuestions: false,
|
||||||
},
|
},
|
||||||
serviceLocation: {
|
serviceLocation: {
|
||||||
address: null,
|
address: null,
|
||||||
|
|
@ -252,6 +253,15 @@ export const mutations = {
|
||||||
updateVehicleCanSafeliteService(state, canSafeliteService) {
|
updateVehicleCanSafeliteService(state, canSafeliteService) {
|
||||||
state.order.vehicle.canSafeliteService = canSafeliteService;
|
state.order.vehicle.canSafeliteService = canSafeliteService;
|
||||||
},
|
},
|
||||||
|
updateSkipVINLookup(state, skipVINLookup) {
|
||||||
|
state.order.vehicle.skipVINLookup = skipVINLookup;
|
||||||
|
},
|
||||||
|
updateSkipPartQuestions(state, skipPartQuestions) {
|
||||||
|
state.order.vehicle.skipPartQuestions = skipPartQuestions;
|
||||||
|
},
|
||||||
|
updateSkipCapabilitiesQuestions(state, skipCapabilitiesQuestions) {
|
||||||
|
state.order.vehicle.skipCapabilitiesQuestions = skipCapabilitiesQuestions;
|
||||||
|
},
|
||||||
updateVehicleImageUrl(state, imageUrl) {
|
updateVehicleImageUrl(state, imageUrl) {
|
||||||
state.order.vehicle.imageUrl = imageUrl;
|
state.order.vehicle.imageUrl = imageUrl;
|
||||||
},
|
},
|
||||||
|
|
@ -2698,6 +2708,8 @@ export const actions = {
|
||||||
imageUrl,
|
imageUrl,
|
||||||
imageVifNumber,
|
imageVifNumber,
|
||||||
imageVifColor,
|
imageVifColor,
|
||||||
|
skipVINLookup,
|
||||||
|
skipPartQuestions,
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
|
|
@ -2723,6 +2735,8 @@ export const actions = {
|
||||||
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, imageUrl);
|
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, imageUrl);
|
||||||
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, imageVifNumber);
|
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, imageVifNumber);
|
||||||
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor);
|
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor);
|
||||||
|
context.commit(storeMutations.UPDATE_SKIP_VIN_LOOKUP, skipVINLookup);
|
||||||
|
context.commit(storeMutations.UPDATE_SKIP_PART_QUESTIONS, skipPartQuestions);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -3517,25 +3531,7 @@ export const actions = {
|
||||||
},
|
},
|
||||||
|
|
||||||
isVinOptionalVehicle(context) {
|
isVinOptionalVehicle(context) {
|
||||||
//Optional for carIds with only a single windshield
|
if (context.state.order.vehicle.skipVINLookup) return true;
|
||||||
if (singleWindshieldCarIds.find((item) => item === context.state.order.vehicle.carId)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
//Optional for specific YMMSs
|
|
||||||
switch (context.state.order.vehicle.make.toLowerCase()) {
|
|
||||||
case "porsche":
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
(context.state.order.vehicle.make.toLowerCase() === "bmw" &&
|
|
||||||
context.state.order.vehicle.year < 2010) ||
|
|
||||||
(context.state.order.vehicle.make.toLowerCase() === "volkswagen" &&
|
|
||||||
context.state.order.vehicle.year < 2010) ||
|
|
||||||
(context.state.order.vehicle.make.toLowerCase() === "audi" &&
|
|
||||||
context.state.order.vehicle.year < 2010)
|
|
||||||
)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -4261,6 +4261,8 @@ describe("isVinOptionalVehicle", () => {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mutations.updateSkipVINLookup(context.state, expectedVinSkip);
|
||||||
|
|
||||||
var vinOptionalResult = actions.isVinOptionalVehicle(context);
|
var vinOptionalResult = actions.isVinOptionalVehicle(context);
|
||||||
expect(vinOptionalResult).toEqual(expectedVinSkip);
|
expect(vinOptionalResult).toEqual(expectedVinSkip);
|
||||||
}
|
}
|
||||||
|
|
@ -4291,6 +4293,8 @@ describe("isVinOptionalVehicle", () => {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mutations.updateSkipVINLookup(context.state, expectedVinSkip);
|
||||||
|
|
||||||
var vinOptionalResult = actions.isVinOptionalVehicle(context);
|
var vinOptionalResult = actions.isVinOptionalVehicle(context);
|
||||||
expect(vinOptionalResult).toEqual(expectedVinSkip);
|
expect(vinOptionalResult).toEqual(expectedVinSkip);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue