Merge branch 'develop' into CSR-2383-fix-collapsed-cart-on-confirm
This commit is contained in:
commit
14b371a262
8 changed files with 76 additions and 23 deletions
|
|
@ -307,7 +307,7 @@ describe("cart.vue", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Service package discount Fee Cart Item
|
// Service package discount Fee Cart Item
|
||||||
test("if there is service package discount fee on the order, a service package discount cart item should be added to the cart", () => {
|
test("only if there is service package discount fee for the package, a service package discount cart item should be added to the cart", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const lineItems = {
|
const lineItems = {
|
||||||
glassParts: [],
|
glassParts: [],
|
||||||
|
|
@ -336,17 +336,8 @@ describe("cart.vue", () => {
|
||||||
availableVaps: availableVaps,
|
availableVaps: availableVaps,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.servicePackageDiscountCartItem).not.toBeNull();
|
expect(wrapper.vm.servicePackageDiscountCartItem).toBeNull();
|
||||||
expect(wrapper.vm.servicePackageDiscountCartItem.subTotal).toEqual(-70);
|
|
||||||
expect(wrapper.vm.servicePackageDiscountCartItem.salesTax).toEqual(0);
|
|
||||||
|
|
||||||
const found =
|
|
||||||
wrapper.vm.cartItems.findIndex(
|
|
||||||
(cartItem) => cartItem == wrapper.vm.servicePackageDiscountCartItem
|
|
||||||
) >= 0;
|
|
||||||
expect(found).toBe(true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Other Supporting Items Cart Item
|
// Other Supporting Items Cart Item
|
||||||
|
|
|
||||||
|
|
@ -163,10 +163,15 @@ import promoModalQuestion from "@/fmg-components/promo-modal-question/promo-moda
|
||||||
|
|
||||||
// Mixins
|
// Mixins
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
import experimentMixin from "@/mixins/experiment-mixin.js";
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
import { deepClone } from "@/helpers/object-helper";
|
import { deepClone } from "@/helpers/object-helper";
|
||||||
import { getHighestFullySatisfiedTier, getPackageContents } from "@/helpers/service-package-helper";
|
import {
|
||||||
|
getHighestFullySatisfiedTier,
|
||||||
|
getPackageContents,
|
||||||
|
getDiscountPackageName,
|
||||||
|
} from "@/helpers/service-package-helper";
|
||||||
import { getPromoCodeWithoutBundleIdentifier } from "@/helpers/promotions-helper";
|
import { getPromoCodeWithoutBundleIdentifier } from "@/helpers/promotions-helper";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
|
|
||||||
|
|
@ -175,6 +180,7 @@ import { partTypeStrings } from "@/constants/part-type-strings";
|
||||||
import { cartItemCategories } from "@/constants/cart-item-categories";
|
import { cartItemCategories } from "@/constants/cart-item-categories";
|
||||||
import { cartItemTypes } from "@/constants/cart-item-types";
|
import { cartItemTypes } from "@/constants/cart-item-types";
|
||||||
import { coverageStatus, cartItemTypesCoveredByInsurance } from "@/constants/insurance";
|
import { coverageStatus, cartItemTypesCoveredByInsurance } from "@/constants/insurance";
|
||||||
|
import { experimentSettings } from "@/constants/experiments";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "cart",
|
name: "cart",
|
||||||
|
|
@ -292,8 +298,16 @@ export default {
|
||||||
this.lineItems[category] = this.lineItems[category].filter(
|
this.lineItems[category] = this.lineItems[category].filter(
|
||||||
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
||||||
);
|
);
|
||||||
|
if (category == cartItemCategories.VAPS) {
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
||||||
|
}
|
||||||
|
if (category == cartItemCategories.SUPPORTING_ITEMS) {
|
||||||
|
await this.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
|
||||||
|
this.lineItems.supportingItems,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async saveVaps(lineItems) {
|
async saveVaps(lineItems) {
|
||||||
|
|
@ -426,7 +440,14 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.servicePackageDiscountCartItem) {
|
if (this.servicePackageDiscountCartItem) {
|
||||||
cartItems.push(this.servicePackageDiscountCartItem);
|
if (this.discountPackageNames != this.packageLevel) {
|
||||||
|
this.removeItem(
|
||||||
|
this.servicePackageDiscountCartItem.cartItemType,
|
||||||
|
cartItemCategories.SUPPORTING_ITEMS
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
cartItems.push(this.servicePackageDiscountCartItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.premiumAppointmentDiscountCartItem) {
|
if (this.premiumAppointmentDiscountCartItem) {
|
||||||
|
|
@ -442,6 +463,12 @@ export default {
|
||||||
return cartItems;
|
return cartItems;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
discountPackageNames() {
|
||||||
|
const discountServicePackage = experimentMixin.methods.getSettingValue(
|
||||||
|
experimentSettings.PROMO_ON_PACKAGE
|
||||||
|
);
|
||||||
|
return getDiscountPackageName(discountServicePackage);
|
||||||
|
},
|
||||||
servicePackageTitleWidget() {
|
servicePackageTitleWidget() {
|
||||||
const servicePackageNames = this.getCmsContent(
|
const servicePackageNames = this.getCmsContent(
|
||||||
this.servicePackageOptionsCmsName,
|
this.servicePackageOptionsCmsName,
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ export async function getImplicitNavigation(toRoute) {
|
||||||
Used to navigate to the heritage funnel with the correct query string and url.
|
Used to navigate to the heritage funnel with the correct query string and url.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLog }) {
|
export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLog, navType }) {
|
||||||
const log = getQuerystringParameter(queryStrings.LOG);
|
const log = getQuerystringParameter(queryStrings.LOG);
|
||||||
if (log === "true") {
|
if (log === "true") {
|
||||||
console.log("------------- Navigate to heritage start -----------------");
|
console.log("------------- Navigate to heritage start -----------------");
|
||||||
|
|
@ -136,6 +136,10 @@ export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLo
|
||||||
heritageParms["promo"] = promo;
|
heritageParms["promo"] = promo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (navType) {
|
||||||
|
heritageParms["navType"] = navType;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(process.env.VUE_APP_HERITAGE_FUNNEL.includes("fixmyglasstest") &&
|
(process.env.VUE_APP_HERITAGE_FUNNEL.includes("fixmyglasstest") &&
|
||||||
process.env.VUE_APP_CURRENT_ENVIRONMENT === "Localhost") ||
|
process.env.VUE_APP_CURRENT_ENVIRONMENT === "Localhost") ||
|
||||||
|
|
|
||||||
|
|
@ -428,7 +428,8 @@ export default {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
shouldHideRecalibration() {
|
shouldHideRecalibration() {
|
||||||
return store.getters.shouldHideRecalibration;
|
if (this.isInsuranceSelected) return false;
|
||||||
|
return (experimentMixin.methods.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() === "true" && this.isRecalibrationOnOrder);
|
||||||
},
|
},
|
||||||
showAfterpayBanner() {
|
showAfterpayBanner() {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -276,11 +276,16 @@ export default {
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.row {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
white-space: nowrap;
|
||||||
span {
|
span {
|
||||||
&.pricing-info {
|
&.pricing-info {
|
||||||
color: $green;
|
color: $green;
|
||||||
|
|
@ -315,11 +320,12 @@ export default {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
div.strikethrough-discount-price {
|
div.strikethrough-discount-price {
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
margin-right: 0.5rem;
|
margin-right: 0.5rem;
|
||||||
font-weight: 600;
|
font-weight: 400;
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
color: $gray-550;
|
color: $gray-550;
|
||||||
|
|
@ -393,7 +399,7 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
margin-left: -2rem;
|
margin-left: -1.25rem;
|
||||||
padding: 0.5rem 1rem;
|
padding: 0.5rem 1rem;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
|
|
|
||||||
|
|
@ -520,7 +520,11 @@ export default {
|
||||||
(payment?.insuranceCoverage?.isVerified ||
|
(payment?.insuranceCoverage?.isVerified ||
|
||||||
store.getters.order.referralNumber.length === 6)
|
store.getters.order.referralNumber.length === 6)
|
||||||
) {
|
) {
|
||||||
navigateToHeritageFunnel({ shouldSaveSession: false });
|
navigateToHeritageFunnel({
|
||||||
|
shouldSaveSession: false,
|
||||||
|
pageNameToLog: "service-location",
|
||||||
|
navType: "back",
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$router.navigateWithoutSaving(
|
this.$router.navigateWithoutSaving(
|
||||||
this.navigationScenarios.CLICKED_BACK,
|
this.navigationScenarios.CLICKED_BACK,
|
||||||
|
|
|
||||||
|
|
@ -939,7 +939,7 @@ export const getters = {
|
||||||
.reduce((r, c) => Object.assign(r, c), {}) ?? {},
|
.reduce((r, c) => Object.assign(r, c), {}) ?? {},
|
||||||
|
|
||||||
isVerifiedAndDeductibleZeroConfirmed: (state) => {
|
isVerifiedAndDeductibleZeroConfirmed: (state) => {
|
||||||
// used as a CMS variable on /payment-method, needed for FunnelSubHeaderWidget on cart pages
|
// used in CMS on /payment-method in Header Sub Text, for FunnelSubHeaderWidget on cart pages
|
||||||
if (
|
if (
|
||||||
state.order.policy.currentDeductible === 0 &&
|
state.order.policy.currentDeductible === 0 &&
|
||||||
getters.coverageIsVerified(state) &&
|
getters.coverageIsVerified(state) &&
|
||||||
|
|
@ -949,6 +949,14 @@ export const getters = {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
isItacOrNoComp: (state) => {
|
||||||
|
// used in CMS on /payment-method in Header Sub Text, for FunnelSubHeaderWidget on cart pages
|
||||||
|
if (state.order.policy.isNoComp || state.order.policy.isItac) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
requiresVerifiedRedirecting: (state) => {
|
requiresVerifiedRedirecting: (state) => {
|
||||||
return state.order?.referralNumber?.length === 6;
|
return state.order?.referralNumber?.length === 6;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ body {
|
||||||
overflow-x: unset;
|
overflow-x: unset;
|
||||||
}
|
}
|
||||||
&.page-container-grouped-styles {
|
&.page-container-grouped-styles {
|
||||||
height: 100vh;
|
height: 100dvh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
@ -68,6 +68,18 @@ body {
|
||||||
height: 1px;
|
height: 1px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fix "iOS viewport scroll bug" issue on iPhone
|
||||||
|
// where bottom of page is covered by address bar
|
||||||
|
@media only screen
|
||||||
|
and (min-device-width: 375px)
|
||||||
|
and (max-device-width: 812px)
|
||||||
|
and (-webkit-min-device-pixel-ratio: 3)
|
||||||
|
and (orientation: portrait) {
|
||||||
|
.page-container-grouped-styles {
|
||||||
|
padding-bottom: 3rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.modal-open {
|
.modal-open {
|
||||||
.container-fluid {
|
.container-fluid {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue