Merge branch 'develop' into feature/CSR-1392
This commit is contained in:
commit
b8bd1e4b0b
17 changed files with 368 additions and 107 deletions
|
|
@ -87,6 +87,20 @@
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.buy-backdrop {
|
||||||
|
background-color: rgba(0, 0, 0, 0.3) !important;
|
||||||
|
}
|
||||||
|
.buy-backdrop #afterpay__iframe-checkout-container {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.buy-backdrop #afterpay__iframe-checkout-container .style_closeWrapper__lIHJe {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buy-container-closer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes rotate {
|
@keyframes rotate {
|
||||||
0% {
|
0% {
|
||||||
transform: rotate(0);
|
transform: rotate(0);
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,24 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AfterPay Styles
|
||||||
|
|
||||||
|
.buy-backdrop {
|
||||||
|
background-color: rgba(0,0,0,.3)!important;
|
||||||
|
#afterpay__iframe-checkout-container {
|
||||||
|
width: 100%;
|
||||||
|
.style_closeWrapper__lIHJe {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.buy-container-closer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Modal Spinner
|
||||||
|
|
||||||
@keyframes rotate {
|
@keyframes rotate {
|
||||||
0% { transform: rotate(0)}
|
0% { transform: rotate(0)}
|
||||||
100% { transform: rotate(360deg)}
|
100% { transform: rotate(360deg)}
|
||||||
|
|
|
||||||
|
|
@ -37,13 +37,13 @@ describe("cart.vue", () => {
|
||||||
promos: [],
|
promos: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const availableLineItems = [];
|
const availableVaps = [];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
props: {
|
props: {
|
||||||
modelValue: lineItems,
|
modelValue: lineItems,
|
||||||
availableLineItems: availableLineItems,
|
availableVaps: availableVaps,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -89,13 +89,13 @@ describe("cart.vue", () => {
|
||||||
promos: [],
|
promos: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const availableLineItems = [];
|
const availableVaps = [];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
props: {
|
props: {
|
||||||
modelValue: lineItems,
|
modelValue: lineItems,
|
||||||
availableLineItems: availableLineItems,
|
availableVaps: availableVaps,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -132,13 +132,13 @@ describe("cart.vue", () => {
|
||||||
promos: [],
|
promos: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const availableLineItems = [];
|
const availableVaps = [];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
props: {
|
props: {
|
||||||
modelValue: lineItems,
|
modelValue: lineItems,
|
||||||
availableLineItems: availableLineItems,
|
availableVaps: availableVaps,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -189,13 +189,13 @@ describe("cart.vue", () => {
|
||||||
// promos: [],
|
// promos: [],
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// const availableLineItems = [];
|
// const availableVaps = [];
|
||||||
|
|
||||||
// // Act
|
// // Act
|
||||||
// const { wrapper } = setupMocks({
|
// const { wrapper } = setupMocks({
|
||||||
// props: {
|
// props: {
|
||||||
// modelValue: lineItems,
|
// modelValue: lineItems,
|
||||||
// availableLineItems: availableLineItems,
|
// availableVaps: availableVaps,
|
||||||
// },
|
// },
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
@ -234,13 +234,13 @@ describe("cart.vue", () => {
|
||||||
promos: [],
|
promos: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const availableLineItems = [];
|
const availableVaps = [];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
props: {
|
props: {
|
||||||
modelValue: lineItems,
|
modelValue: lineItems,
|
||||||
availableLineItems: availableLineItems,
|
availableVaps: availableVaps,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -277,13 +277,13 @@ describe("cart.vue", () => {
|
||||||
promos: [],
|
promos: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const availableLineItems = [];
|
const availableVaps = [];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
props: {
|
props: {
|
||||||
modelValue: lineItems,
|
modelValue: lineItems,
|
||||||
availableLineItems: availableLineItems,
|
availableVaps: availableVaps,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -321,13 +321,13 @@ describe("cart.vue", () => {
|
||||||
promos: [],
|
promos: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const availableLineItems = [];
|
const availableVaps = [];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
props: {
|
props: {
|
||||||
modelValue: lineItems,
|
modelValue: lineItems,
|
||||||
availableLineItems: availableLineItems,
|
availableVaps: availableVaps,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="cart mb-4">
|
<div class="cart mb-5">
|
||||||
<div class="px-0">
|
<div class="px-0">
|
||||||
<div
|
<div
|
||||||
class="row vin-toggle flex align-items-center"
|
class="row vin-toggle flex align-items-center"
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Nonpackaged Cart Items -->
|
<!-- Nonpackaged Cart Items -->
|
||||||
<hr style="background: red" />
|
|
||||||
<div
|
<div
|
||||||
class="premium-appt-cart-item"
|
class="premium-appt-cart-item"
|
||||||
v-for="(cartItem, i) in nonpackageCartItems"
|
v-for="(cartItem, i) in nonpackageCartItems"
|
||||||
|
|
@ -128,7 +127,7 @@ export default {
|
||||||
modelValue: Object,
|
modelValue: Object,
|
||||||
damage: Object,
|
damage: Object,
|
||||||
servicePackageOptionsCmsName: String,
|
servicePackageOptionsCmsName: String,
|
||||||
availableLineItems: Object,
|
availableVaps: Object,
|
||||||
allowItemRemoval: Boolean,
|
allowItemRemoval: Boolean,
|
||||||
recyclingModalCmsWidgetName: String,
|
recyclingModalCmsWidgetName: String,
|
||||||
},
|
},
|
||||||
|
|
@ -201,6 +200,16 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
availableLineItems() {
|
||||||
|
if (!this.lineItems || this.lineItems.length < 1) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
...this.lineItems.glassParts,
|
||||||
|
...this.lineItems.supportingItems,
|
||||||
|
...this.availableVaps,
|
||||||
|
];
|
||||||
|
},
|
||||||
cartItems: {
|
cartItems: {
|
||||||
get: function () {
|
get: function () {
|
||||||
let cartItems = [];
|
let cartItems = [];
|
||||||
|
|
@ -802,4 +811,12 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.payment-method-question {
|
||||||
|
.question-text {
|
||||||
|
margin: 1rem 0 0.5rem 0;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
import { partTypeStrings } from "@/constants/part-type-strings";
|
import { partTypeStrings } from "@/constants/part-type-strings";
|
||||||
|
import { deepClone } from "@/helpers/object-helper";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
|
||||||
export const promoPartNumberStrings = {
|
export const promoPartNumberStrings = {
|
||||||
|
|
@ -126,6 +127,31 @@ export function getPromosThatMatchLineItemsOnOrder(promos, lineItemsOnOrder) {
|
||||||
return matchingPromos;
|
return matchingPromos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns the vaps that the provided <promos> requires to be on the order to satisfy
|
||||||
|
// Items that are already in <lineItemsOnOrder> will not be returned
|
||||||
|
export function getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||||
|
promos,
|
||||||
|
availableLineItems,
|
||||||
|
lineItemsOnOrder
|
||||||
|
) {
|
||||||
|
const clonedVaps = deepClone(lineItemsOnOrder.vaps ?? []);
|
||||||
|
const promosWithAddableVaps = getPromosWithAddableVaps(promos);
|
||||||
|
if (promosWithAddableVaps.length) {
|
||||||
|
const matchingLineItems = getLineItemsThatMatchPromos(
|
||||||
|
promosWithAddableVaps,
|
||||||
|
availableLineItems
|
||||||
|
);
|
||||||
|
// Check if matching items are already in the order
|
||||||
|
const idsOfVapsAlreadyInOrder = clonedVaps.map((lineItem) => lineItem.id);
|
||||||
|
const vapsToAddToCart = matchingLineItems.filter(
|
||||||
|
(lineItem) => !idsOfVapsAlreadyInOrder.includes(lineItem.id)
|
||||||
|
);
|
||||||
|
return vapsToAddToCart;
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function shouldStripPromoQueryString(fmgPageQueryValue) {
|
export function shouldStripPromoQueryString(fmgPageQueryValue) {
|
||||||
return pagesToStripPromoQueryStringFrom.includes(fmgPageQueryValue);
|
return pagesToStripPromoQueryStringFrom.includes(fmgPageQueryValue);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
<div>
|
<div>
|
||||||
<vehicleBanner
|
<vehicleBanner
|
||||||
cmsWidgetName="VehicleBannerWidget"
|
cmsWidgetName="VehicleBannerWidget"
|
||||||
|
:displayVehicleImage="vehicleBannerImageUrl"
|
||||||
:displayGenericVehicleImage="false" />
|
:displayGenericVehicleImage="false" />
|
||||||
</div>
|
</div>
|
||||||
<div class="scheduleText">
|
<div class="scheduleText">
|
||||||
|
|
@ -205,6 +206,9 @@ export default {
|
||||||
return `at ${get12HourTimeFormat(this.ScheduleStartTime)}`;
|
return `at ${get12HourTimeFormat(this.ScheduleStartTime)}`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
vehicleBannerImageUrl() {
|
||||||
|
return store.getters.submittedOrder?.vehicle.imageUrl;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
|
|
@ -238,7 +242,11 @@ export default {
|
||||||
const schedule = store.getters.order.schedule;
|
const schedule = store.getters.order.schedule;
|
||||||
const scheduleReqs = !!(schedule.date && schedule.startTime && schedule.endTime);
|
const scheduleReqs = !!(schedule.date && schedule.startTime && schedule.endTime);
|
||||||
|
|
||||||
return serviceLocationReqs && scheduleReqs;
|
// Customer
|
||||||
|
const customer = store.getters.order.customer;
|
||||||
|
const customerReqs = !!customer.emailAddress;
|
||||||
|
|
||||||
|
return serviceLocationReqs && scheduleReqs && customerReqs;
|
||||||
},
|
},
|
||||||
forwardButtonAction() {
|
forwardButtonAction() {
|
||||||
window.location.assign("//www.safelite.com/");
|
window.location.assign("//www.safelite.com/");
|
||||||
|
|
|
||||||
|
|
@ -76,13 +76,12 @@ export default {
|
||||||
name: "add-vaps-modal-buttons",
|
name: "add-vaps-modal-buttons",
|
||||||
props: {
|
props: {
|
||||||
vapsTilesCmsName: String,
|
vapsTilesCmsName: String,
|
||||||
availableLineItems: Object,
|
availableVaps: Object,
|
||||||
modelValue: Object,
|
modelValue: Object,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
addVapsButton: addVapsButton,
|
addVapsButton: addVapsButton,
|
||||||
wipersOffered: null,
|
|
||||||
isModalOpened: false,
|
isModalOpened: false,
|
||||||
selectedWipers: this.getSelectedWipers(),
|
selectedWipers: this.getSelectedWipers(),
|
||||||
};
|
};
|
||||||
|
|
@ -97,7 +96,11 @@ export default {
|
||||||
this.$refs[modalName].closeModal();
|
this.$refs[modalName].closeModal();
|
||||||
},
|
},
|
||||||
addRainDefenseToCart(modalName, part) {
|
addRainDefenseToCart(modalName, part) {
|
||||||
this.currentCartItems.vaps.push(part);
|
// Clone vaps array, then replace this.currentCartItems.vaps with it at the end
|
||||||
|
// in order to successfully trigger parent's watcher
|
||||||
|
const clonedVaps = this.currentCartItems.vaps.slice(0);
|
||||||
|
clonedVaps.push(part);
|
||||||
|
this.currentCartItems.vaps = clonedVaps;
|
||||||
this.closeModal(modalName);
|
this.closeModal(modalName);
|
||||||
const message = this.getRainDefenseAddedMessage();
|
const message = this.getRainDefenseAddedMessage();
|
||||||
this.$emit("added-to-cart", {
|
this.$emit("added-to-cart", {
|
||||||
|
|
@ -133,19 +136,23 @@ export default {
|
||||||
this.selectedWipers = ["REAR"];
|
this.selectedWipers = ["REAR"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Clone vaps array, then replace this.currentCartItems.vaps with it at the end
|
||||||
|
// in order to successfully trigger parent's watcher
|
||||||
|
const clonedVaps = this.currentCartItems.vaps.slice(0);
|
||||||
|
|
||||||
itemsForCart.forEach((type) => {
|
itemsForCart.forEach((type) => {
|
||||||
if (type === wipersOfferedStrings.FRONT) {
|
if (type === wipersOfferedStrings.FRONT) {
|
||||||
part.frontWiperLineItems.forEach((part) => {
|
part.frontWiperLineItems.forEach((part) => {
|
||||||
this.currentCartItems.vaps.push(part);
|
clonedVaps.push(part);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (type === wipersOfferedStrings.REAR) {
|
if (type === wipersOfferedStrings.REAR) {
|
||||||
part.rearWiperLineItems.forEach((part) => {
|
part.rearWiperLineItems.forEach((part) => {
|
||||||
this.currentCartItems.vaps.push(part);
|
clonedVaps.push(part);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.currentCartItems.vaps = clonedVaps;
|
||||||
|
|
||||||
this.closeModal(modalName);
|
this.closeModal(modalName);
|
||||||
|
|
||||||
|
|
@ -198,7 +205,7 @@ export default {
|
||||||
return modelValue;
|
return modelValue;
|
||||||
},
|
},
|
||||||
rainDefenseModal() {
|
rainDefenseModal() {
|
||||||
const lineItem = this.availableLineItems.find((item) => {
|
const lineItem = this.availableVaps.find((item) => {
|
||||||
return item.partType === partTypeStrings.RAIN_DEFENSE;
|
return item.partType === partTypeStrings.RAIN_DEFENSE;
|
||||||
});
|
});
|
||||||
if (lineItem)
|
if (lineItem)
|
||||||
|
|
@ -209,10 +216,10 @@ export default {
|
||||||
},
|
},
|
||||||
wipersModal() {
|
wipersModal() {
|
||||||
// create a single wiper item for modal
|
// create a single wiper item for modal
|
||||||
const frontWiperLineItems = this.availableLineItems.filter((item) => {
|
const frontWiperLineItems = this.availableVaps.filter((item) => {
|
||||||
return item.partType.includes(partTypeStrings.FRONT_WIPER);
|
return item.partType.includes(partTypeStrings.FRONT_WIPER);
|
||||||
});
|
});
|
||||||
const rearWiperLineItems = this.availableLineItems.filter((item) => {
|
const rearWiperLineItems = this.availableVaps.filter((item) => {
|
||||||
return item.partType.includes(partTypeStrings.REAR_WIPER);
|
return item.partType.includes(partTypeStrings.REAR_WIPER);
|
||||||
});
|
});
|
||||||
let wipersModal;
|
let wipersModal;
|
||||||
|
|
@ -241,20 +248,38 @@ export default {
|
||||||
answersCmsData() {
|
answersCmsData() {
|
||||||
return this.getCmsContent(this.vapsTilesCmsName, "Answers");
|
return this.getCmsContent(this.vapsTilesCmsName, "Answers");
|
||||||
},
|
},
|
||||||
|
rainDefenseInCart() {
|
||||||
|
return this.currentCartItems.vaps?.some((vap) => {
|
||||||
|
return vap?.partType === partTypeStrings.RAIN_DEFENSE;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
frontWipersInCart() {
|
||||||
|
return this.currentCartItems.vaps?.some((vap) => {
|
||||||
|
return vap?.partType?.includes(partTypeStrings.FRONT_WIPER);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
rearWipersInCart() {
|
||||||
|
return this.currentCartItems.vaps?.some((vap) => {
|
||||||
|
return vap?.partType?.includes(partTypeStrings.REAR_WIPER);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
wipersOffered() {
|
||||||
|
let result;
|
||||||
|
if (!this.frontWipersInCart) {
|
||||||
|
if (!this.rearWipersInCart && this.wipersModal?.rearWiperLineItems.length > 0) {
|
||||||
|
result = wipersOfferedStrings.BOTH;
|
||||||
|
} else {
|
||||||
|
result = wipersOfferedStrings.FRONT;
|
||||||
|
}
|
||||||
|
} else if (!this.rearWipersInCart && this.wipersModal?.rearWiperLineItems.length > 0) {
|
||||||
|
result = wipersOfferedStrings.REAR;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
},
|
||||||
buttonsToDisplay() {
|
buttonsToDisplay() {
|
||||||
const buttons = [];
|
const buttons = [];
|
||||||
if (!this.answersCmsData) return buttons;
|
if (!this.answersCmsData) return buttons;
|
||||||
|
|
||||||
const rainDefenseInCart = this.currentCartItems.vaps?.some((vap) => {
|
|
||||||
return vap?.partType === partTypeStrings.RAIN_DEFENSE;
|
|
||||||
});
|
|
||||||
const frontWipersInCart = this.currentCartItems.vaps?.some((vap) => {
|
|
||||||
return vap?.partType?.includes(partTypeStrings.FRONT_WIPER);
|
|
||||||
});
|
|
||||||
const rearWipersInCart = this.currentCartItems.vaps?.some((vap) => {
|
|
||||||
return vap?.partType?.includes(partTypeStrings.REAR_WIPER);
|
|
||||||
});
|
|
||||||
|
|
||||||
const getAnswer = (name, answers) => {
|
const getAnswer = (name, answers) => {
|
||||||
const answerIndex = answers.findIndex((answer) => {
|
const answerIndex = answers.findIndex((answer) => {
|
||||||
return answer.Name === name;
|
return answer.Name === name;
|
||||||
|
|
@ -262,7 +287,7 @@ export default {
|
||||||
return answers[answerIndex];
|
return answers[answerIndex];
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!rainDefenseInCart) {
|
if (!this.rainDefenseInCart) {
|
||||||
// NO RAIN DEFENSE IN CART; SHOW RAIN DEFENSE BUTTON
|
// NO RAIN DEFENSE IN CART; SHOW RAIN DEFENSE BUTTON
|
||||||
const modalData = getAnswer("RainDefenseModal", this.answersCmsData);
|
const modalData = getAnswer("RainDefenseModal", this.answersCmsData);
|
||||||
modalData.SubText = "+$" + this.rainDefenseModal?.listPrice;
|
modalData.SubText = "+$" + this.rainDefenseModal?.listPrice;
|
||||||
|
|
@ -270,27 +295,26 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const modalData = getAnswer("WipersModal", this.answersCmsData);
|
const modalData = getAnswer("WipersModal", this.answersCmsData);
|
||||||
if (!frontWipersInCart) {
|
if (this.wipersOffered === wipersOfferedStrings.BOTH) {
|
||||||
if (!rearWipersInCart && this.wipersModal?.rearWiperLineItems.length > 0) {
|
// NO REAR WIPERS or FRONT WIPERS IN CART; SHOW COMBO BUTTON
|
||||||
// NO REAR WIPERS or FRONT WIPERS IN CART; SHOW COMBO BUTTON
|
const prices = [
|
||||||
const prices = [
|
this.wipersModal?.totalFrontPrice,
|
||||||
this.wipersModal?.totalFrontPrice,
|
this.wipersModal?.totalRearPrice,
|
||||||
this.wipersModal?.totalRearPrice,
|
];
|
||||||
];
|
prices.sort((a, b) => a - b);
|
||||||
prices.sort((a, b) => a - b);
|
modalData.SubText = "+$" + prices[0] + " - $" + prices[prices.length - 1];
|
||||||
modalData.SubText = "+$" + prices[0] + " - $" + prices[prices.length - 1];
|
buttons.push(modalData);
|
||||||
this.updateWipersOffered(wipersOfferedStrings.BOTH);
|
}
|
||||||
buttons.push(modalData);
|
|
||||||
} else {
|
if (this.wipersOffered === wipersOfferedStrings.FRONT) {
|
||||||
// NO FRONT WIPERS IN CART; SHOW ONLY FRONT WIPERS BUTTON
|
// NO FRONT WIPERS IN CART; SHOW ONLY FRONT WIPERS BUTTON
|
||||||
modalData.SubText = "+$" + this.wipersModal?.totalFrontPrice;
|
modalData.SubText = "+$" + this.wipersModal?.totalFrontPrice;
|
||||||
this.updateWipersOffered(wipersOfferedStrings.FRONT);
|
buttons.push(modalData);
|
||||||
buttons.push(modalData);
|
}
|
||||||
}
|
|
||||||
} else if (!rearWipersInCart && this.wipersModal?.rearWiperLineItems.length > 0) {
|
if (this.wipersOffered === wipersOfferedStrings.REAR) {
|
||||||
// NO REAR WIPERS IN CART; SHOW ONLY REAR WIPERS BUTTON
|
// NO REAR WIPERS IN CART; SHOW ONLY REAR WIPERS BUTTON
|
||||||
modalData.SubText = "+$" + this.wipersModal?.totalRearPrice;
|
modalData.SubText = "+$" + this.wipersModal?.totalRearPrice;
|
||||||
this.updateWipersOffered(wipersOfferedStrings.REAR);
|
|
||||||
buttons.push(modalData);
|
buttons.push(modalData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ export default {
|
||||||
.payment-method-question {
|
.payment-method-question {
|
||||||
.question-text span {
|
.question-text span {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
line-height: 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,14 @@
|
||||||
|
|
||||||
<cart
|
<cart
|
||||||
:damage="damageInfo"
|
:damage="damageInfo"
|
||||||
:availableLineItems="availableLineItems"
|
:availableVaps="availableVaps"
|
||||||
:allowItemRemoval="true"
|
:allowItemRemoval="true"
|
||||||
v-model="lineItems"
|
v-model="lineItems"
|
||||||
servicePackageOptionsCmsName="ServicePackageTitle"
|
servicePackageOptionsCmsName="ServicePackageTitle"
|
||||||
@cart-remove="cartRemove"
|
@cart-remove="cartRemove"
|
||||||
recyclingModalCmsWidgetName="RecycleModal" />
|
recyclingModalCmsWidgetName="RecycleModal" />
|
||||||
|
|
||||||
<hr />
|
<hr class="my-5" />
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<alert
|
<alert
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
<add-vaps-modal-buttons
|
<add-vaps-modal-buttons
|
||||||
v-model="lineItems"
|
v-model="lineItems"
|
||||||
:availableLineItems="availableLineItems"
|
:availableVaps="availableVaps"
|
||||||
vapsTilesCmsName="VapsProductTiles"
|
vapsTilesCmsName="VapsProductTiles"
|
||||||
@added-to-cart="showAlert" />
|
@added-to-cart="showAlert" />
|
||||||
|
|
||||||
|
|
@ -88,17 +88,19 @@ import { paymentMethods } from "@/constants/payment-method-constants";
|
||||||
import { experimentSettings } from "@/constants/experiments";
|
import { experimentSettings } from "@/constants/experiments";
|
||||||
import {
|
import {
|
||||||
revalidatePromosAndValidateNewPromo,
|
revalidatePromosAndValidateNewPromo,
|
||||||
getAddableVapsFromAvailableLineItems,
|
getPromosWithAddableVaps,
|
||||||
|
getVapsThatNeedToBeAddedToSatisfyPromos,
|
||||||
} from "@/helpers/promotions-helper";
|
} from "@/helpers/promotions-helper";
|
||||||
import { queryStrings } from "@/constants/query-strings";
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
import { getQuerystringParameter } from "@/helpers/querystring-helper";
|
import { getQuerystringParameter } from "@/helpers/querystring-helper";
|
||||||
|
import { deepClone } from "@/helpers/object-helper";
|
||||||
|
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
import { defineRule } from "vee-validate";
|
import { defineRule } from "vee-validate";
|
||||||
import { required } from "@/helpers/validation-rules";
|
import { required } from "@/helpers/validation-rules";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
||||||
import { mapTaxedAvailableLineItemsToStoreFormat } from "../../store";
|
import { mapTaxedLineItemsToStoreFormat } from "../../store";
|
||||||
|
|
||||||
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
|
|
||||||
|
|
@ -120,12 +122,6 @@ export default {
|
||||||
"payment-method"
|
"payment-method"
|
||||||
);
|
);
|
||||||
|
|
||||||
const supportingItemsPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
|
||||||
storeActions.GET_SUPPORTING_ITEMS,
|
|
||||||
null,
|
|
||||||
"payment-method"
|
|
||||||
);
|
|
||||||
|
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
{
|
{
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
|
|
@ -139,29 +135,25 @@ export default {
|
||||||
resultKey: "rainDefense",
|
resultKey: "rainDefense",
|
||||||
promise: rainDefensePromise,
|
promise: rainDefensePromise,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
resultKey: "supportingItems",
|
|
||||||
promise: supportingItemsPromise,
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
|
const lineItemsFromStore = deepClone(store.getters.order.lineItems);
|
||||||
|
const glassParts = lineItemsFromStore.glassParts ?? [];
|
||||||
|
const supportingItems = lineItemsFromStore.supportingItems ?? [];
|
||||||
|
|
||||||
const glassParts = store.getters.order.lineItems.glassParts ?? [];
|
const lineItemsToTax = [
|
||||||
|
|
||||||
let availableLineItems = [
|
|
||||||
resultMap.rainDefense,
|
resultMap.rainDefense,
|
||||||
...resultMap.supportingItems,
|
...supportingItems,
|
||||||
...resultMap.wipers,
|
...resultMap.wipers,
|
||||||
...glassParts,
|
...glassParts,
|
||||||
];
|
];
|
||||||
|
const availableVaps = [resultMap.rainDefense, ...resultMap.wipers];
|
||||||
|
|
||||||
const lineItemsFromStore = store.getters.order.lineItems;
|
const pricedLineItemsToTax = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
|
|
||||||
await baseMixin.methods.dispatchStoreActionWithLogging(
|
|
||||||
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
||||||
{
|
{
|
||||||
availableLineItems: availableLineItems,
|
availableLineItems: lineItemsToTax,
|
||||||
},
|
},
|
||||||
"payment-method",
|
"payment-method",
|
||||||
false
|
false
|
||||||
|
|
@ -173,14 +165,16 @@ export default {
|
||||||
const { validatePromoResponse, revalidatePromoResponse } =
|
const { validatePromoResponse, revalidatePromoResponse } =
|
||||||
await revalidatePromosAndValidateNewPromo(
|
await revalidatePromosAndValidateNewPromo(
|
||||||
promoCodeFromQueryString,
|
promoCodeFromQueryString,
|
||||||
availableLineItems,
|
pricedLineItemsToTax,
|
||||||
"payment-method"
|
"payment-method"
|
||||||
);
|
);
|
||||||
|
|
||||||
availableLineItems.push(...(validatePromoResponse?.orderPromos ?? []));
|
const newValidatedPromos = validatePromoResponse?.orderPromos ?? [];
|
||||||
|
|
||||||
|
pricedLineItemsToTax.push(...newValidatedPromos);
|
||||||
// End of promo logic
|
// End of promo logic
|
||||||
|
|
||||||
const taxedAvailableLineItems = await baseMixin.methods.dispatchStoreActionWithLogging(
|
const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
||||||
{
|
{
|
||||||
billToAccountNumber: "87291",
|
billToAccountNumber: "87291",
|
||||||
|
|
@ -189,32 +183,39 @@ export default {
|
||||||
serviceLocationCity: store.getters.order.serviceLocation.city,
|
serviceLocationCity: store.getters.order.serviceLocation.city,
|
||||||
serviceLocationState: store.getters.order.serviceLocation.state,
|
serviceLocationState: store.getters.order.serviceLocation.state,
|
||||||
serviceLocationZipCode: store.getters.order.serviceLocation.zipCode,
|
serviceLocationZipCode: store.getters.order.serviceLocation.zipCode,
|
||||||
pricedAvailableLineItems: availableLineItems,
|
pricedLineItems: pricedLineItemsToTax,
|
||||||
},
|
},
|
||||||
"payment-method",
|
"payment-method",
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
// Match all available line items to the line items as they are in the store
|
// Match all line items to the line items as they are in the store
|
||||||
// and rebuild the original structure.
|
// and rebuild the original structure.
|
||||||
const lineItems = mapTaxedAvailableLineItemsToStoreFormat(
|
const lineItems = mapTaxedLineItemsToStoreFormat(taxedLineItems, lineItemsFromStore);
|
||||||
availableLineItems,
|
const taxedVaps = mapTaxedLineItemsToStoreFormat(taxedLineItems, availableVaps);
|
||||||
lineItemsFromStore
|
|
||||||
|
// Add items that were not in the store yet but added via query string promo validation
|
||||||
|
lineItems.promos = lineItems.promos ?? [];
|
||||||
|
lineItems.promos.push(...newValidatedPromos);
|
||||||
|
const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||||
|
newValidatedPromos,
|
||||||
|
taxedVaps,
|
||||||
|
lineItems
|
||||||
);
|
);
|
||||||
|
lineItems.vaps.push(...vapsToAddToCart);
|
||||||
|
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.availableLineItems = taxedAvailableLineItems;
|
vm.availableVaps = taxedVaps;
|
||||||
vm.lineItems = lineItems;
|
vm.lineItems = lineItems;
|
||||||
|
|
||||||
vm.updateFooterButtonText(vm.customCtaCopy);
|
vm.updateFooterButtonText(vm.customCtaCopy);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
availableLineItems: [],
|
availableVaps: [],
|
||||||
paymentMethodInternalModel: this.getPaymentMethodFromStore(),
|
paymentMethodInternalModel: this.getPaymentMethodFromStore(),
|
||||||
inactivePromos: this.getInactivePromosFromStore(),
|
inactivePromos: this.getInactivePromosFromStore(),
|
||||||
};
|
};
|
||||||
|
|
@ -254,7 +255,7 @@ export default {
|
||||||
const scheduleReqs = !!(
|
const scheduleReqs = !!(
|
||||||
schedule.date &&
|
schedule.date &&
|
||||||
schedule.startTime &&
|
schedule.startTime &&
|
||||||
(!isMobile || schedule.endTime) &&
|
schedule.endTime &&
|
||||||
schedule.jobMaxMinutes &&
|
schedule.jobMaxMinutes &&
|
||||||
schedule.jobMinMinutes
|
schedule.jobMinMinutes
|
||||||
);
|
);
|
||||||
|
|
@ -397,10 +398,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isPiaDisabled() {
|
isPiaDisabled() {
|
||||||
const piaExperience =
|
const piaExperience = this.getSettingValue(experimentSettings.PIA_EXPERIENCE);
|
||||||
this.getSettingValue(experimentSettings.PIA_EXPERIENCE) === "PIA Optional";
|
|
||||||
|
|
||||||
return !piaExperience;
|
const isEnabled = piaExperience === "PIA Optional" || piaExperience === "PIA Required";
|
||||||
|
|
||||||
|
return !isEnabled;
|
||||||
},
|
},
|
||||||
paymentMethod() {
|
paymentMethod() {
|
||||||
if (this.isPiaDisabled) {
|
if (this.isPiaDisabled) {
|
||||||
|
|
@ -412,11 +414,35 @@ export default {
|
||||||
shouldDisplayPiaAlert() {
|
shouldDisplayPiaAlert() {
|
||||||
return this.$route.params[this.routerParams.DISPLAY_PIA_ALERT];
|
return this.$route.params[this.routerParams.DISPLAY_PIA_ALERT];
|
||||||
},
|
},
|
||||||
|
// Necessary to make the watcher of lineItems work
|
||||||
|
// JavaScript does not keep a record of the old value, only a reference to it's location in the memory.
|
||||||
|
// This creates a separate location for oldValue/newValue so they can be compared
|
||||||
|
// See Vue github issue #2164
|
||||||
|
lineItemsCloneForWatcher() {
|
||||||
|
return Object.assign({}, this.lineItems);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
customCtaCopy(newValue) {
|
customCtaCopy(newValue) {
|
||||||
this.updateFooterButtonText(newValue);
|
this.updateFooterButtonText(newValue);
|
||||||
},
|
},
|
||||||
|
lineItemsCloneForWatcher: {
|
||||||
|
handler(newValue, oldValue) {
|
||||||
|
if (
|
||||||
|
!oldValue ||
|
||||||
|
oldValue.length == 0 ||
|
||||||
|
!oldValue.vaps ||
|
||||||
|
!newValue ||
|
||||||
|
newValue.length == 0
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (oldValue.vaps.length != newValue.vaps.length) {
|
||||||
|
this.revalidatePromos();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,19 @@
|
||||||
scrolling="no">
|
scrolling="no">
|
||||||
</iframe>
|
</iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<cart
|
||||||
|
:damage="damageInfo"
|
||||||
|
:availableLineItems="availableLineItems"
|
||||||
|
:allowItemRemoval="false"
|
||||||
|
v-model="lineItems"
|
||||||
|
servicePackageOptionsCmsName="ServicePackageTitle"
|
||||||
|
recyclingModalCmsWidgetName="RecycleModal" />
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
<paymentSwitch
|
<paymentSwitch
|
||||||
cmsWidgetName="PaymentMethodWidget"
|
cmsWidgetName="PaymentMethodWidget"
|
||||||
:paymentType="paymentType"
|
:paymentType="paymentType"
|
||||||
|
|
@ -163,7 +176,7 @@
|
||||||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||||
import navbar from "@/fmg-components/nav-bar/nav-bar";
|
import navbar from "@/fmg-components/nav-bar/nav-bar";
|
||||||
import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue";
|
import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue";
|
||||||
|
import cart from "@/fmg-components/cart/cart";
|
||||||
import paymentSwitch from "./payment-switch/payment-switch.vue";
|
import paymentSwitch from "./payment-switch/payment-switch.vue";
|
||||||
|
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
|
|
@ -175,6 +188,13 @@ import { applicationConfig } from "@/constants/application-config";
|
||||||
import { paymentMethods } from "@/constants/payment-method-constants";
|
import { paymentMethods } from "@/constants/payment-method-constants";
|
||||||
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
import { mapTaxedLineItemsToStoreFormat } from "../../store";
|
||||||
|
import {
|
||||||
|
revalidatePromosAndValidateNewPromo,
|
||||||
|
getAddableVapsFromAvailableLineItems,
|
||||||
|
} from "@/helpers/promotions-helper";
|
||||||
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
|
import { getQuerystringParameter } from "@/helpers/querystring-helper";
|
||||||
|
|
||||||
import iframeResize from "../../../node_modules/iframe-resizer/js/iframeResizer.js";
|
import iframeResize from "../../../node_modules/iframe-resizer/js/iframeResizer.js";
|
||||||
|
|
||||||
|
|
@ -207,6 +227,8 @@ export default {
|
||||||
displayAmount: this.getDisplayAmountDue(),
|
displayAmount: this.getDisplayAmountDue(),
|
||||||
piaLineItems: this.getPiaLineItems(),
|
piaLineItems: this.getPiaLineItems(),
|
||||||
paypalPayment: this.isPaypal(),
|
paypalPayment: this.isPaypal(),
|
||||||
|
lineItems: [],
|
||||||
|
availableLineItems: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
|
|
@ -231,6 +253,24 @@ export default {
|
||||||
"payment"
|
"payment"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const wipersPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
|
storeActions.GET_WIPERS,
|
||||||
|
null,
|
||||||
|
"payment"
|
||||||
|
);
|
||||||
|
|
||||||
|
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
|
storeActions.GET_RAIN_DEFENSE,
|
||||||
|
null,
|
||||||
|
"payment"
|
||||||
|
);
|
||||||
|
|
||||||
|
const supportingItemsPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
|
storeActions.GET_SUPPORTING_ITEMS,
|
||||||
|
null,
|
||||||
|
"payment"
|
||||||
|
);
|
||||||
|
|
||||||
// TODO: Data fetching Promise declarations
|
// TODO: Data fetching Promise declarations
|
||||||
|
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
|
|
@ -242,14 +282,81 @@ export default {
|
||||||
resultKey: "signature",
|
resultKey: "signature",
|
||||||
promise: signaturePromise,
|
promise: signaturePromise,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resultKey: "wipers",
|
||||||
|
promise: wipersPromise,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
resultKey: "rainDefense",
|
||||||
|
promise: rainDefensePromise,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
resultKey: "supportingItems",
|
||||||
|
promise: supportingItemsPromise,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
|
|
||||||
|
const glassParts = store.getters.order.lineItems.glassParts ?? [];
|
||||||
|
|
||||||
|
let availableLineItems = [
|
||||||
|
resultMap.rainDefense,
|
||||||
|
...resultMap.supportingItems,
|
||||||
|
...resultMap.wipers,
|
||||||
|
...glassParts,
|
||||||
|
];
|
||||||
|
|
||||||
|
const lineItemsFromStore = store.getters.order.lineItems;
|
||||||
|
|
||||||
|
await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
|
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
||||||
|
{
|
||||||
|
availableLineItems: availableLineItems,
|
||||||
|
},
|
||||||
|
"payment",
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
// Promo logic
|
||||||
|
const promoCodeFromQueryString = getQuerystringParameter(queryStrings.PROMO);
|
||||||
|
|
||||||
|
const { validatePromoResponse, revalidatePromoResponse } =
|
||||||
|
await revalidatePromosAndValidateNewPromo(
|
||||||
|
promoCodeFromQueryString,
|
||||||
|
availableLineItems,
|
||||||
|
"payment-method"
|
||||||
|
);
|
||||||
|
|
||||||
|
availableLineItems.push(...(validatePromoResponse?.orderPromos ?? []));
|
||||||
|
// End of promo logic
|
||||||
|
|
||||||
|
const taxedAvailableLineItems = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
|
storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
||||||
|
{
|
||||||
|
billToAccountNumber: "87291",
|
||||||
|
providerNumber: store.getters.order.serviceLocation.provider.providerNumber,
|
||||||
|
appointmentType: store.getters.order.serviceLocation.appointmentType,
|
||||||
|
serviceLocationCity: store.getters.order.serviceLocation.city,
|
||||||
|
serviceLocationState: store.getters.order.serviceLocation.state,
|
||||||
|
serviceLocationZipCode: store.getters.order.serviceLocation.zipCode,
|
||||||
|
pricedAvailableLineItems: availableLineItems,
|
||||||
|
},
|
||||||
|
"payment-method",
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
// Match all available line items to the line items as they are in the store
|
||||||
|
// and rebuild the original structure.
|
||||||
|
const lineItems = mapTaxedLineItemsToStoreFormat(availableLineItems, lineItemsFromStore);
|
||||||
|
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next(async (vm) => {
|
next(async (vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.fetchSignatureInfo(resultMap.signature);
|
vm.fetchSignatureInfo(resultMap.signature);
|
||||||
|
|
||||||
|
vm.availableLineItems = taxedAvailableLineItems;
|
||||||
|
vm.lineItems = lineItems;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -276,6 +383,9 @@ export default {
|
||||||
switchPaymentText() {
|
switchPaymentText() {
|
||||||
return this.getCmsContent("PaymentMethodWidget", "QuestionText");
|
return this.getCmsContent("PaymentMethodWidget", "QuestionText");
|
||||||
},
|
},
|
||||||
|
damageInfo() {
|
||||||
|
return this.$store.getters.damage;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
|
|
@ -312,7 +422,7 @@ export default {
|
||||||
const scheduleReqs = !!(
|
const scheduleReqs = !!(
|
||||||
schedule.date &&
|
schedule.date &&
|
||||||
schedule.startTime &&
|
schedule.startTime &&
|
||||||
(!isMobile || schedule.endTime) &&
|
schedule.endTime &&
|
||||||
schedule.jobMaxMinutes &&
|
schedule.jobMaxMinutes &&
|
||||||
schedule.jobMinMinutes
|
schedule.jobMinMinutes
|
||||||
);
|
);
|
||||||
|
|
@ -466,6 +576,7 @@ export default {
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
navbar,
|
navbar,
|
||||||
loadingModal,
|
loadingModal,
|
||||||
|
cart,
|
||||||
paymentSwitch,
|
paymentSwitch,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -474,7 +585,7 @@ export default {
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.hop-iframe {
|
.hop-iframe {
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: 1120px;
|
min-height: 650px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: 0 none;
|
border: 0 none;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,4 +55,7 @@ export default {
|
||||||
:deep(.review-block-content > ul) {
|
:deep(.review-block-content > ul) {
|
||||||
margin-bottom: 0rem;
|
margin-bottom: 0rem;
|
||||||
}
|
}
|
||||||
|
.review-block-content {
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ export default {
|
||||||
const scheduleReqs = !!(
|
const scheduleReqs = !!(
|
||||||
schedule.date &&
|
schedule.date &&
|
||||||
schedule.startTime &&
|
schedule.startTime &&
|
||||||
(!isMobile || schedule.endTime) &&
|
schedule.endTime &&
|
||||||
schedule.jobMaxMinutes &&
|
schedule.jobMaxMinutes &&
|
||||||
schedule.jobMinMinutes
|
schedule.jobMinMinutes
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -286,6 +286,7 @@ describe("service-location.vue", () => {
|
||||||
const newServiceZipCodeQuestion = {
|
const newServiceZipCodeQuestion = {
|
||||||
zipCode: "61606",
|
zipCode: "61606",
|
||||||
state: "IL",
|
state: "IL",
|
||||||
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
const serviceZipCodeComponent = wrapper.findComponent({
|
const serviceZipCodeComponent = wrapper.findComponent({
|
||||||
|
|
@ -316,6 +317,7 @@ describe("service-location.vue", () => {
|
||||||
const newServiceZipCodeQuestion = {
|
const newServiceZipCodeQuestion = {
|
||||||
zipCode: "61606",
|
zipCode: "61606",
|
||||||
state: "IL",
|
state: "IL",
|
||||||
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
const mobileLocationQuestions = {
|
const mobileLocationQuestions = {
|
||||||
|
|
@ -365,6 +367,7 @@ describe("service-location.vue", () => {
|
||||||
const newServiceZipCodeQuestion = {
|
const newServiceZipCodeQuestion = {
|
||||||
zipCode: "61606",
|
zipCode: "61606",
|
||||||
state: "IL",
|
state: "IL",
|
||||||
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
wrapper.vm.selectedAppointmentType = "Inshop";
|
wrapper.vm.selectedAppointmentType = "Inshop";
|
||||||
|
|
@ -395,6 +398,7 @@ describe("service-location.vue", () => {
|
||||||
const newServiceZipCodeQuestion = {
|
const newServiceZipCodeQuestion = {
|
||||||
zipCode: "45433",
|
zipCode: "45433",
|
||||||
state: "OH",
|
state: "OH",
|
||||||
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -511,11 +515,13 @@ describe("service-location.vue", () => {
|
||||||
wrapper.vm.serviceZipCodeQuestion = {
|
wrapper.vm.serviceZipCodeQuestion = {
|
||||||
zipCode: "61606",
|
zipCode: "61606",
|
||||||
state: "IL",
|
state: "IL",
|
||||||
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
const newServiceZipCodeInfo = {
|
const newServiceZipCodeInfo = {
|
||||||
state: "OH",
|
state: "OH",
|
||||||
zipCode: "43081",
|
zipCode: "43081",
|
||||||
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
|
||||||
|
|
@ -245,6 +245,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
state: this.state,
|
state: this.state,
|
||||||
zipCode: this.zipCode,
|
zipCode: this.zipCode,
|
||||||
|
zipCodeCtu: this.zipCodeCtu,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
set: function (newValue) {
|
set: function (newValue) {
|
||||||
|
|
@ -256,6 +257,7 @@ export default {
|
||||||
|
|
||||||
this.state = newValue.state;
|
this.state = newValue.state;
|
||||||
this.zipCode = newValue.zipCode;
|
this.zipCode = newValue.zipCode;
|
||||||
|
this.zipCodeCtu = newValue.zipCodeCtu;
|
||||||
|
|
||||||
this.$nextTick();
|
this.$nextTick();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ describe("service-zip-modal-question.vue", () => {
|
||||||
let serviceZipCodeQuestion = {
|
let serviceZipCodeQuestion = {
|
||||||
state: "",
|
state: "",
|
||||||
zipCode: "",
|
zipCode: "",
|
||||||
|
zipCodeCtu: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
@ -135,6 +136,7 @@ describe("service-zip-modal-question.vue", () => {
|
||||||
let serviceZipCodeQuestion = {
|
let serviceZipCodeQuestion = {
|
||||||
state: "OH",
|
state: "OH",
|
||||||
zipCode: "43235",
|
zipCode: "43235",
|
||||||
|
zipCodeCtu: "01820",
|
||||||
};
|
};
|
||||||
|
|
||||||
const wrapper = mount(serviceZipModalQuestion, {
|
const wrapper = mount(serviceZipModalQuestion, {
|
||||||
|
|
@ -156,6 +158,7 @@ describe("service-zip-modal-question.vue", () => {
|
||||||
let serviceZipCodeQuestion = {
|
let serviceZipCodeQuestion = {
|
||||||
state: "IL",
|
state: "IL",
|
||||||
zipCode: "61606",
|
zipCode: "61606",
|
||||||
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
const zip = "43235";
|
const zip = "43235";
|
||||||
|
|
@ -176,7 +179,7 @@ describe("service-zip-modal-question.vue", () => {
|
||||||
|
|
||||||
await wrapper.vm.setZipCode();
|
await wrapper.vm.setZipCode();
|
||||||
|
|
||||||
let expectedEmit = [[{ state: "OH", zipCode: "43235" }]];
|
let expectedEmit = [[{ state: "OH", zipCode: "43235", zipCodeCtu: "01820" }]];
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.emitted("update:modelValue")).toEqual(expectedEmit);
|
expect(wrapper.emitted("update:modelValue")).toEqual(expectedEmit);
|
||||||
|
|
@ -187,6 +190,7 @@ describe("service-zip-modal-question.vue", () => {
|
||||||
let serviceZipCodeQuestion = {
|
let serviceZipCodeQuestion = {
|
||||||
state: "IL",
|
state: "IL",
|
||||||
zipCode: "61606",
|
zipCode: "61606",
|
||||||
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
const zip = "";
|
const zip = "";
|
||||||
|
|
@ -214,6 +218,7 @@ describe("service-zip-modal-question.vue", () => {
|
||||||
let serviceZipCodeQuestion = {
|
let serviceZipCodeQuestion = {
|
||||||
state: "IL",
|
state: "IL",
|
||||||
zipCode: "61606",
|
zipCode: "61606",
|
||||||
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
const zip = "11111";
|
const zip = "11111";
|
||||||
|
|
@ -241,6 +246,7 @@ describe("service-zip-modal-question.vue", () => {
|
||||||
let serviceZipCodeQuestion = {
|
let serviceZipCodeQuestion = {
|
||||||
state: "IL",
|
state: "IL",
|
||||||
zipCode: "61606",
|
zipCode: "61606",
|
||||||
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
const zip = "";
|
const zip = "";
|
||||||
|
|
@ -269,6 +275,7 @@ describe("service-zip-modal-question.vue", () => {
|
||||||
let serviceZipCodeQuestion = {
|
let serviceZipCodeQuestion = {
|
||||||
state: "IL",
|
state: "IL",
|
||||||
zipCode: "61606",
|
zipCode: "61606",
|
||||||
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
const zip = "123";
|
const zip = "123";
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,7 @@ export default {
|
||||||
this.resetModalButtonStyle();
|
this.resetModalButtonStyle();
|
||||||
} else {
|
} else {
|
||||||
this.internalModel.state = zipCodeData.state;
|
this.internalModel.state = zipCodeData.state;
|
||||||
|
this.internalModel.zipCodeCtu = zipCodeData.zipCodeCtu;
|
||||||
|
|
||||||
// retrieve mobile fee part
|
// retrieve mobile fee part
|
||||||
const serviceZipCode = this.internalModel.zipCode;
|
const serviceZipCode = this.internalModel.zipCode;
|
||||||
|
|
|
||||||
|
|
@ -2191,13 +2191,13 @@ export const actions = {
|
||||||
serviceLocationCity,
|
serviceLocationCity,
|
||||||
serviceLocationState,
|
serviceLocationState,
|
||||||
serviceLocationZipCode,
|
serviceLocationZipCode,
|
||||||
pricedAvailableLineItems,
|
pricedLineItems,
|
||||||
},
|
},
|
||||||
pageNameToLog,
|
pageNameToLog,
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
const flattenedLineItemsWithChildParts =
|
const flattenedLineItemsWithChildParts =
|
||||||
getFlattenedArrayOfLineItemsWithChildParts(pricedAvailableLineItems);
|
getFlattenedArrayOfLineItemsWithChildParts(pricedLineItems);
|
||||||
|
|
||||||
const lineItemsWithOnlyPriceInfo = flattenedLineItemsWithChildParts.map((lineItem) => ({
|
const lineItemsWithOnlyPriceInfo = flattenedLineItemsWithChildParts.map((lineItem) => ({
|
||||||
partNumber: lineItem.partNumber,
|
partNumber: lineItem.partNumber,
|
||||||
|
|
@ -2246,12 +2246,9 @@ export const actions = {
|
||||||
|
|
||||||
context.commit(storeMutations.UPDATE_LINE_ITEMS_SERVER_DATA, response.data.serverData);
|
context.commit(storeMutations.UPDATE_LINE_ITEMS_SERVER_DATA, response.data.serverData);
|
||||||
|
|
||||||
pricedAvailableLineItems = addTaxesToPricedLineItems(
|
pricedLineItems = addTaxesToPricedLineItems(pricedLineItems, response.data.taxedLineItems);
|
||||||
pricedAvailableLineItems,
|
|
||||||
response.data.taxedLineItems
|
|
||||||
);
|
|
||||||
|
|
||||||
return pricedAvailableLineItems;
|
return pricedLineItems;
|
||||||
},
|
},
|
||||||
|
|
||||||
// The <addableVaps> parameter is an array of ALL available front wipers and rain defense
|
// The <addableVaps> parameter is an array of ALL available front wipers and rain defense
|
||||||
|
|
@ -2621,7 +2618,7 @@ function addTaxesToPricedLineItems(pricedLineItems, taxingLineItems = []) {
|
||||||
return pricedLineItems;
|
return pricedLineItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mapTaxedAvailableLineItemsToStoreFormat(availableLineItems, storeLineItems) {
|
export function mapTaxedLineItemsToStoreFormat(availableLineItems, storeLineItems) {
|
||||||
// clone the lineItems array because what we're passing in is referencing the store directly
|
// clone the lineItems array because what we're passing in is referencing the store directly
|
||||||
const lineItems = deepClone(storeLineItems);
|
const lineItems = deepClone(storeLineItems);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue