Merge pull request #1918 from Safelite/feature/Digital/CSR-2087
CSR-2087
This commit is contained in:
commit
f0a3d3579c
7 changed files with 31 additions and 26 deletions
|
|
@ -34,7 +34,7 @@ const queryStrings = {
|
|||
EMAIL: "email",
|
||||
IS_INSURANCE: "isinsurance",
|
||||
VIN_SELECTION: "vinselection",
|
||||
PACKAGE_SELECTION: "packageselection",
|
||||
SERVICE_PACKAGE: "servicepackage",
|
||||
NUMBER_OF_CHIPS: "numberofchips",
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ const storeMutations = {
|
|||
UPDATE_LEAD_GEN_EMAIL_ADDRESS: "updateLeadGenEmailAddress",
|
||||
UPDATE_LEAD_GEN_IS_INSURANCE: "updateLeadGenIsInsurance",
|
||||
UPDATE_LEAD_GEN_VIN_SELECTION: "updateLeadGenVinSelection",
|
||||
UPDATE_LEAD_GEN_PACKAGE_SELECTION: "updateLeadGenPackageSelection",
|
||||
UPDATE_LEAD_GEN_SERVICE_PACKAGE: "updateLeadGenServicePackage",
|
||||
|
||||
//RESET LEADGEN MUTATIONS
|
||||
RESET_LEADGEN_VEHICLE_STATE: "resetLeadGenVehicleState",
|
||||
|
|
|
|||
|
|
@ -674,7 +674,7 @@ describe("quote.vue", () => {
|
|||
isLeadGen: true,
|
||||
leadGenQuote: {
|
||||
isInsurance: true,
|
||||
packageSelection: "glassonly",
|
||||
servicePackage: "glassonly",
|
||||
},
|
||||
payment: {
|
||||
isInsurance: true,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
:isInsuranceSelected="isInsuranceSelected"
|
||||
@vapsItemsSelected="vapsItemsSelectedAction"
|
||||
@servicePackageDiscountSelected="servicePackageDiscountSelectedAction"
|
||||
:packageSelection="packageSelection"
|
||||
:servicePackage="servicePackage"
|
||||
:activePromos="lineItems.promos"
|
||||
v-on="{ 'buttonEvent.openModal': openModalAction }"
|
||||
validationRules="option-required"
|
||||
|
|
@ -275,7 +275,7 @@ export default {
|
|||
if (store.getters.isLeadGen) {
|
||||
if (store.getters.leadGenQuote.isInsurance == true) {
|
||||
vm.isInsuranceSelected = true;
|
||||
vm.packageSelection = store.getters.leadGenQuote.packageSelection;
|
||||
vm.servicePackage = store.getters.leadGenQuote.servicePackage;
|
||||
await nextTick();
|
||||
const isValid = await baseMixin.methods.isFormValid(vm.$refs.theForm);
|
||||
if (isValid) {
|
||||
|
|
@ -300,7 +300,7 @@ export default {
|
|||
availableLineItems: null,
|
||||
lineItems: [],
|
||||
addableVaps: [],
|
||||
packageSelection: null,
|
||||
servicePackage: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ export default {
|
|||
isInsuranceSelected: Boolean,
|
||||
availableLineItems: null,
|
||||
activePromos: null,
|
||||
packageSelection: null,
|
||||
servicePackage: null,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -61,7 +61,7 @@ export default {
|
|||
if (
|
||||
this.$store.getters.payment.isInsurance != null ||
|
||||
getPromosWithAddableVaps(this.activePromos).length ||
|
||||
this.packageSelection != null
|
||||
this.servicePackage != null
|
||||
) {
|
||||
this.selectDefaultPackage();
|
||||
}
|
||||
|
|
@ -296,8 +296,8 @@ export default {
|
|||
return price;
|
||||
},
|
||||
selectDefaultPackage() {
|
||||
if (this.packageSelection != null) {
|
||||
return (this.selectedPackageName = getPackageNameByType(this.packageSelection));
|
||||
if (this.servicePackage != null) {
|
||||
return (this.selectedPackageName = getPackageNameByType(this.servicePackage));
|
||||
}
|
||||
const promosWithAddableVaps = getPromosWithAddableVaps(this.activePromos);
|
||||
const vapsThatMatchPromos = getLineItemsThatMatchPromos(
|
||||
|
|
|
|||
|
|
@ -98,8 +98,8 @@ const routes = [
|
|||
const leadGenVinSelection = getQuerystringParameter(
|
||||
queryStrings.VIN_SELECTION
|
||||
);
|
||||
const leadGenPackageSelection = getQuerystringParameter(
|
||||
queryStrings.PACKAGE_SELECTION
|
||||
const leadGenServicePackage = getQuerystringParameter(
|
||||
queryStrings.SERVICE_PACKAGE
|
||||
);
|
||||
const leadGenNumberOfChips = getQuerystringParameter(
|
||||
queryStrings.NUMBER_OF_CHIPS
|
||||
|
|
@ -122,9 +122,11 @@ const routes = [
|
|||
leadGenZipCode &&
|
||||
leadGenEmail &&
|
||||
leadGenIsInsurance &&
|
||||
leadGenVinSelection &&
|
||||
leadGenPackageSelection &&
|
||||
leadGenNumberOfChips
|
||||
(leadGenDamage.toUpperCase() == "WINDSHIELDREPAIR" ||
|
||||
leadGenVinSelection?.length > 0) &&
|
||||
(leadGenIsInsurance == "false" || leadGenServicePackage?.length > 0) &&
|
||||
(leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR" ||
|
||||
leadGenNumberOfChips?.length > 0)
|
||||
) {
|
||||
if (!store.getters.applicationUser.triggeredSiteEntry) {
|
||||
store.commit(storeMutations.UPDATE_IS_LEAD_GEN, true);
|
||||
|
|
@ -136,13 +138,13 @@ const routes = [
|
|||
storeMutations.UPDATE_LEAD_GEN_DAMAGE_TYPE,
|
||||
leadGenDamage
|
||||
);
|
||||
if (leadGenDamage?.toUpperCase() == "WINDSHIELDREPLACE") {
|
||||
if (leadGenDamage.toUpperCase() == "WINDSHIELDREPLACE") {
|
||||
store.commit(storeMutations.UPDATE_LEAD_GEN_IS_REPAIR, false);
|
||||
store.commit(
|
||||
storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS,
|
||||
null
|
||||
);
|
||||
} else if (leadGenDamage?.toUpperCase() == "WINDSHIELDREPAIR") {
|
||||
} else if (leadGenDamage.toUpperCase() == "WINDSHIELDREPAIR") {
|
||||
store.commit(storeMutations.UPDATE_LEAD_GEN_IS_REPAIR, true);
|
||||
store.commit(
|
||||
storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS,
|
||||
|
|
@ -160,14 +162,16 @@ const routes = [
|
|||
if (leadGenIsInsurance == "true") {
|
||||
store.commit(storeMutations.UPDATE_LEAD_GEN_IS_INSURANCE, true);
|
||||
store.commit(
|
||||
storeMutations.UPDATE_LEAD_GEN_PACKAGE_SELECTION,
|
||||
leadGenPackageSelection
|
||||
storeMutations.UPDATE_LEAD_GEN_SERVICE_PACKAGE,
|
||||
leadGenServicePackage
|
||||
);
|
||||
}
|
||||
if (leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR") {
|
||||
store.commit(
|
||||
storeMutations.UPDATE_LEAD_GEN_VIN_SELECTION,
|
||||
leadGenVinSelection
|
||||
);
|
||||
}
|
||||
store.commit(
|
||||
storeMutations.UPDATE_LEAD_GEN_VIN_SELECTION,
|
||||
leadGenVinSelection
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -463,8 +463,8 @@ export const mutations = {
|
|||
leadGenState.estimate.vinSelection = vinSelection;
|
||||
setLeadGenState(leadGenState);
|
||||
},
|
||||
updateLeadGenPackageSelection(state, packageSelection) {
|
||||
leadGenState.quote.packageSelection = packageSelection;
|
||||
updateLeadGenServicePackage(state, servicePackage) {
|
||||
leadGenState.quote.servicePackage = servicePackage;
|
||||
setLeadGenState(leadGenState);
|
||||
},
|
||||
//RESET LEADGEN MUTATIONS
|
||||
|
|
@ -493,6 +493,7 @@ export const mutations = {
|
|||
},
|
||||
resetLeadGenQuoteState(state) {
|
||||
leadGenState.quote.isInsurance = null;
|
||||
leadGenState.quote.servicePackage = null;
|
||||
setLeadGenState(leadGenState);
|
||||
},
|
||||
resetIsLeadGen(state) {
|
||||
|
|
@ -3322,7 +3323,7 @@ function createLeadGenDefaultState() {
|
|||
},
|
||||
quote: {
|
||||
isInsurance: null,
|
||||
packageSelection: null,
|
||||
servicePackage: null,
|
||||
},
|
||||
};
|
||||
// set to session storage
|
||||
|
|
|
|||
Loading…
Reference in a new issue