From b42e436288bf863a1c4d2b781363b2bc2d16e8dd Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Fri, 1 Mar 2024 15:21:38 -0500 Subject: [PATCH] CSR-1971 | Continue to clean up code --- src/fmg-components/cart/cart.vue | 12 ++---------- src/layouts/quote/quote.vue | 12 ++---------- src/store/index.js | 2 -- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index f273b724c..0ab26e9e5 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -236,6 +236,8 @@ export default { this.lineItems[category] = this.lineItems[category].filter( (lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType ); + + this.$emit("update:modelValue", this.lineItems); }, getPromoCodeList() { if (this.$refs["promoModalQuestion"]) { @@ -243,10 +245,6 @@ export default { } return []; }, - handleAddedPromo(lineItems) { - // NOTE: these lineItems are passed from promo-modal-question - //this.$emit("update:modelValue", lineItems); - }, }, computed: { screenReaderTotalAmountDueText() { @@ -847,12 +845,6 @@ export default { this.lineItems = deepClone(newValue); }, deep: true, - }, - lineItems: { - handler(newValue) { - console.log('cart emitted a modelValue update'); - this.$emit("update:modelValue", newValue); - } } }, components: { diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 35ec0451b..94cafb0a4 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -149,10 +149,6 @@ export default { }, ]; - // -Check PRs to make sure you've looked at all newly added code - // -Briefly investigate new issue, then ask Sneha to look at it via email - // -Undo the package selection fix sneha did and see if my changes fix that - const resultMap = await settleAllPromises(promiseResultMap); const lineItems = deepClone(store.getters.order.lineItems); lineItems.promos = lineItems.promos ?? []; @@ -180,23 +176,20 @@ export default { false ); lineItems.supportingItems = resultMap.supportingItems; + const addableVaps = [...resultMap.wipers, resultMap.rainDefense]; // Promo logic // Populate the previous state of promos for toast message usage in "next()" - const addableVaps = [...resultMap.wipers, resultMap.rainDefense]; const oldActivePromos = store.getters.lineItems.promos?.slice(0); 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, pricingResults, "quote" ); - 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. @@ -326,8 +319,7 @@ export default { this.dispatchStoreAction( storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS, { - activePromos: this.lineItems.promos, - inactivePromos: this.$store.getters.order.payment.inactivePromos, // I don't think we need this here + activePromos: this.lineItems.promos }, false ); diff --git a/src/store/index.js b/src/store/index.js index ec3426bd5..06a5631d3 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2176,7 +2176,6 @@ 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); }, @@ -2427,7 +2426,6 @@ 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(