Merge pull request #1918 from Safelite/feature/Digital/CSR-2087

CSR-2087
This commit is contained in:
hiteshkumar87 2024-07-23 18:09:33 +05:30 committed by GitHub
commit f0a3d3579c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 31 additions and 26 deletions

View file

@ -34,7 +34,7 @@ const queryStrings = {
EMAIL: "email", EMAIL: "email",
IS_INSURANCE: "isinsurance", IS_INSURANCE: "isinsurance",
VIN_SELECTION: "vinselection", VIN_SELECTION: "vinselection",
PACKAGE_SELECTION: "packageselection", SERVICE_PACKAGE: "servicepackage",
NUMBER_OF_CHIPS: "numberofchips", NUMBER_OF_CHIPS: "numberofchips",
}; };

View file

@ -101,7 +101,7 @@ const storeMutations = {
UPDATE_LEAD_GEN_EMAIL_ADDRESS: "updateLeadGenEmailAddress", UPDATE_LEAD_GEN_EMAIL_ADDRESS: "updateLeadGenEmailAddress",
UPDATE_LEAD_GEN_IS_INSURANCE: "updateLeadGenIsInsurance", UPDATE_LEAD_GEN_IS_INSURANCE: "updateLeadGenIsInsurance",
UPDATE_LEAD_GEN_VIN_SELECTION: "updateLeadGenVinSelection", UPDATE_LEAD_GEN_VIN_SELECTION: "updateLeadGenVinSelection",
UPDATE_LEAD_GEN_PACKAGE_SELECTION: "updateLeadGenPackageSelection", UPDATE_LEAD_GEN_SERVICE_PACKAGE: "updateLeadGenServicePackage",
//RESET LEADGEN MUTATIONS //RESET LEADGEN MUTATIONS
RESET_LEADGEN_VEHICLE_STATE: "resetLeadGenVehicleState", RESET_LEADGEN_VEHICLE_STATE: "resetLeadGenVehicleState",

View file

@ -674,7 +674,7 @@ describe("quote.vue", () => {
isLeadGen: true, isLeadGen: true,
leadGenQuote: { leadGenQuote: {
isInsurance: true, isInsurance: true,
packageSelection: "glassonly", servicePackage: "glassonly",
}, },
payment: { payment: {
isInsurance: true, isInsurance: true,

View file

@ -33,7 +33,7 @@
:isInsuranceSelected="isInsuranceSelected" :isInsuranceSelected="isInsuranceSelected"
@vapsItemsSelected="vapsItemsSelectedAction" @vapsItemsSelected="vapsItemsSelectedAction"
@servicePackageDiscountSelected="servicePackageDiscountSelectedAction" @servicePackageDiscountSelected="servicePackageDiscountSelectedAction"
:packageSelection="packageSelection" :servicePackage="servicePackage"
:activePromos="lineItems.promos" :activePromos="lineItems.promos"
v-on="{ 'buttonEvent.openModal': openModalAction }" v-on="{ 'buttonEvent.openModal': openModalAction }"
validationRules="option-required" validationRules="option-required"
@ -275,7 +275,7 @@ export default {
if (store.getters.isLeadGen) { if (store.getters.isLeadGen) {
if (store.getters.leadGenQuote.isInsurance == true) { if (store.getters.leadGenQuote.isInsurance == true) {
vm.isInsuranceSelected = true; vm.isInsuranceSelected = true;
vm.packageSelection = store.getters.leadGenQuote.packageSelection; vm.servicePackage = store.getters.leadGenQuote.servicePackage;
await nextTick(); await nextTick();
const isValid = await baseMixin.methods.isFormValid(vm.$refs.theForm); const isValid = await baseMixin.methods.isFormValid(vm.$refs.theForm);
if (isValid) { if (isValid) {
@ -300,7 +300,7 @@ export default {
availableLineItems: null, availableLineItems: null,
lineItems: [], lineItems: [],
addableVaps: [], addableVaps: [],
packageSelection: null, servicePackage: null,
}; };
}, },
computed: { computed: {

View file

@ -48,7 +48,7 @@ export default {
isInsuranceSelected: Boolean, isInsuranceSelected: Boolean,
availableLineItems: null, availableLineItems: null,
activePromos: null, activePromos: null,
packageSelection: null, servicePackage: null,
}, },
data() { data() {
return { return {
@ -61,7 +61,7 @@ export default {
if ( if (
this.$store.getters.payment.isInsurance != null || this.$store.getters.payment.isInsurance != null ||
getPromosWithAddableVaps(this.activePromos).length || getPromosWithAddableVaps(this.activePromos).length ||
this.packageSelection != null this.servicePackage != null
) { ) {
this.selectDefaultPackage(); this.selectDefaultPackage();
} }
@ -296,8 +296,8 @@ export default {
return price; return price;
}, },
selectDefaultPackage() { selectDefaultPackage() {
if (this.packageSelection != null) { if (this.servicePackage != null) {
return (this.selectedPackageName = getPackageNameByType(this.packageSelection)); return (this.selectedPackageName = getPackageNameByType(this.servicePackage));
} }
const promosWithAddableVaps = getPromosWithAddableVaps(this.activePromos); const promosWithAddableVaps = getPromosWithAddableVaps(this.activePromos);
const vapsThatMatchPromos = getLineItemsThatMatchPromos( const vapsThatMatchPromos = getLineItemsThatMatchPromos(

View file

@ -98,8 +98,8 @@ const routes = [
const leadGenVinSelection = getQuerystringParameter( const leadGenVinSelection = getQuerystringParameter(
queryStrings.VIN_SELECTION queryStrings.VIN_SELECTION
); );
const leadGenPackageSelection = getQuerystringParameter( const leadGenServicePackage = getQuerystringParameter(
queryStrings.PACKAGE_SELECTION queryStrings.SERVICE_PACKAGE
); );
const leadGenNumberOfChips = getQuerystringParameter( const leadGenNumberOfChips = getQuerystringParameter(
queryStrings.NUMBER_OF_CHIPS queryStrings.NUMBER_OF_CHIPS
@ -122,9 +122,11 @@ const routes = [
leadGenZipCode && leadGenZipCode &&
leadGenEmail && leadGenEmail &&
leadGenIsInsurance && leadGenIsInsurance &&
leadGenVinSelection && (leadGenDamage.toUpperCase() == "WINDSHIELDREPAIR" ||
leadGenPackageSelection && leadGenVinSelection?.length > 0) &&
leadGenNumberOfChips (leadGenIsInsurance == "false" || leadGenServicePackage?.length > 0) &&
(leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR" ||
leadGenNumberOfChips?.length > 0)
) { ) {
if (!store.getters.applicationUser.triggeredSiteEntry) { if (!store.getters.applicationUser.triggeredSiteEntry) {
store.commit(storeMutations.UPDATE_IS_LEAD_GEN, true); store.commit(storeMutations.UPDATE_IS_LEAD_GEN, true);
@ -136,13 +138,13 @@ const routes = [
storeMutations.UPDATE_LEAD_GEN_DAMAGE_TYPE, storeMutations.UPDATE_LEAD_GEN_DAMAGE_TYPE,
leadGenDamage leadGenDamage
); );
if (leadGenDamage?.toUpperCase() == "WINDSHIELDREPLACE") { if (leadGenDamage.toUpperCase() == "WINDSHIELDREPLACE") {
store.commit(storeMutations.UPDATE_LEAD_GEN_IS_REPAIR, false); store.commit(storeMutations.UPDATE_LEAD_GEN_IS_REPAIR, false);
store.commit( store.commit(
storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS, storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS,
null 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_IS_REPAIR, true);
store.commit( store.commit(
storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS, storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS,
@ -160,14 +162,16 @@ const routes = [
if (leadGenIsInsurance == "true") { if (leadGenIsInsurance == "true") {
store.commit(storeMutations.UPDATE_LEAD_GEN_IS_INSURANCE, true); store.commit(storeMutations.UPDATE_LEAD_GEN_IS_INSURANCE, true);
store.commit( store.commit(
storeMutations.UPDATE_LEAD_GEN_PACKAGE_SELECTION, storeMutations.UPDATE_LEAD_GEN_SERVICE_PACKAGE,
leadGenPackageSelection leadGenServicePackage
);
}
if (leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR") {
store.commit(
storeMutations.UPDATE_LEAD_GEN_VIN_SELECTION,
leadGenVinSelection
); );
} }
store.commit(
storeMutations.UPDATE_LEAD_GEN_VIN_SELECTION,
leadGenVinSelection
);
} }
} }

View file

@ -463,8 +463,8 @@ export const mutations = {
leadGenState.estimate.vinSelection = vinSelection; leadGenState.estimate.vinSelection = vinSelection;
setLeadGenState(leadGenState); setLeadGenState(leadGenState);
}, },
updateLeadGenPackageSelection(state, packageSelection) { updateLeadGenServicePackage(state, servicePackage) {
leadGenState.quote.packageSelection = packageSelection; leadGenState.quote.servicePackage = servicePackage;
setLeadGenState(leadGenState); setLeadGenState(leadGenState);
}, },
//RESET LEADGEN MUTATIONS //RESET LEADGEN MUTATIONS
@ -493,6 +493,7 @@ export const mutations = {
}, },
resetLeadGenQuoteState(state) { resetLeadGenQuoteState(state) {
leadGenState.quote.isInsurance = null; leadGenState.quote.isInsurance = null;
leadGenState.quote.servicePackage = null;
setLeadGenState(leadGenState); setLeadGenState(leadGenState);
}, },
resetIsLeadGen(state) { resetIsLeadGen(state) {
@ -3322,7 +3323,7 @@ function createLeadGenDefaultState() {
}, },
quote: { quote: {
isInsurance: null, isInsurance: null,
packageSelection: null, servicePackage: null,
}, },
}; };
// set to session storage // set to session storage