Auto stash before merge of "feature/CSR-1971" and "origin/develop"

This commit is contained in:
Scott Kiener 2024-03-01 10:59:10 -05:00
parent 8f2fda3995
commit 37b876f72c
3 changed files with 17 additions and 4 deletions

View file

@ -236,8 +236,6 @@ export default {
this.lineItems[category] = this.lineItems[category].filter(
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
);
this.$emit("update:modelValue", this.lineItems);
},
getPromoCodeList() {
if (this.$refs["promoModalQuestion"]) {
@ -245,6 +243,10 @@ export default {
}
return [];
},
handleAddedPromo(lineItems) {
// NOTE: these lineItems are passed from promo-modal-question
//this.$emit("update:modelValue", lineItems);
},
},
computed: {
screenReaderTotalAmountDueText() {
@ -846,6 +848,12 @@ export default {
},
deep: true,
},
lineItems: {
handler(newValue) {
console.log('cart emitted a modelValue update');
this.$emit("update:modelValue", newValue);
}
}
},
components: {
textBlock,

View file

@ -86,6 +86,7 @@ import baseMixin from "@/mixins/base-mixin.js";
import vehicleQuestionsMixin from "../../mixins/vehicle-questions-mixin";
import { settleAllPromises } from "@/helpers/layout-helper";
import { storeActions } from "@/constants/store-actions";
import { deepClone } from "@/helpers/object-helper";
import store from "@/store";
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { required } from "@/helpers/validation-rules";
@ -149,7 +150,7 @@ export default {
];
const resultMap = await settleAllPromises(promiseResultMap);
const lineItems = store.getters.order.lineItems;
const lineItems = deepClone(store.getters.order.lineItems);
const nullSafeGlassParts = lineItems.glassParts ?? [];
const availableLineItems = [
resultMap.rainDefense,
@ -180,7 +181,8 @@ export default {
const oldInactivePromos = store.getters.order.payment.inactivePromos?.slice(0);
const promoCodeFromQueryString = getQuerystringParameter(queryStrings.PROMO);
console.log("lineItems before sending off for promo");
console.log(JSON.parse(JSON.stringify(lineItems)));
const { validatePromoResponse, revalidatePromoResponse } =
await revalidatePromosAndValidateQueryStringPromo(
promoCodeFromQueryString,
@ -190,6 +192,7 @@ export default {
lineItems.glassParts = nullSafeGlassParts;
lineItems.promos = lineItems.promos ?? [];
lineItems.vaps = lineItems.vaps ?? [];
console.log("lineItems.vaps", JSON.parse(JSON.stringify(lineItems.vaps)));
// End of promo logic
// Call the "next" function to complete the transition to this page.

View file

@ -2176,6 +2176,7 @@ export const actions = {
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, supportingItems);
},
saveVaps(context, vaps) {
console.log("saving vaps");
addGuidToLineItemsIfNotAlreadyThere(vaps);
context.commit(storeMutations.UPDATE_VAPS, vaps);
},
@ -2426,6 +2427,7 @@ export const actions = {
lineItemsToUse = lineItemsToUse ? deepClone(lineItemsToUse) : deepClone(order.lineItems);
addGuidToLineItemsIfNotAlreadyThere(lineItemsToUse.vaps);
lineItemsToUse.promos = activePromosToUse;
console.log("lineItemsToUse:", lineItemsToUse);
inactivePromosToUse = inactivePromosToUse ?? order.payment.inactivePromos;
inactivePromosToUse = removeCurrentlyActivePromoCodesFromInactivePromos(