From 2205b7104dce02a5b5e8c34f9cba4f215ab5869d Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Wed, 28 Feb 2024 19:14:29 +0530 Subject: [PATCH 01/19] CSR-1993 Green tint privacy --- src/assets/img/tints/Glass-NoShade-GreenTint-Privacy.svg | 1 + src/constants/tint-mapper.js | 1 + 2 files changed, 2 insertions(+) create mode 100644 src/assets/img/tints/Glass-NoShade-GreenTint-Privacy.svg diff --git a/src/assets/img/tints/Glass-NoShade-GreenTint-Privacy.svg b/src/assets/img/tints/Glass-NoShade-GreenTint-Privacy.svg new file mode 100644 index 000000000..fecc16e63 --- /dev/null +++ b/src/assets/img/tints/Glass-NoShade-GreenTint-Privacy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/constants/tint-mapper.js b/src/constants/tint-mapper.js index 519de0855..e5d1a3b30 100644 --- a/src/constants/tint-mapper.js +++ b/src/constants/tint-mapper.js @@ -33,6 +33,7 @@ const tintMap = { { name: "green tint", src: "Glass-NoShade-GreenTint.svg" }, { name: "gray tint privacy", src: "Glass-NoShade-GrayTint.svg" }, { name: "blue tint", src: "Glass-NoShade-BlueTint.svg" }, + { name: "green tint privacy", src: "Glass-NoShade-GreenTint-Privacy.svg" }, // No shade or tint { name: "clear", src: "Glass-NoShade-NoTint.svg" }, From ad4c113c2681410fa77cc4c33db5e30f9544ea11 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 28 Feb 2024 09:38:26 -0500 Subject: [PATCH 02/19] Fix svg image. --- src/assets/img/tints/Glass-NoShade-GreenTint.svg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/assets/img/tints/Glass-NoShade-GreenTint.svg b/src/assets/img/tints/Glass-NoShade-GreenTint.svg index 5f5b99de0..cdf96aa3d 100644 --- a/src/assets/img/tints/Glass-NoShade-GreenTint.svg +++ b/src/assets/img/tints/Glass-NoShade-GreenTint.svg @@ -1,3 +1 @@ - - - + \ No newline at end of file From 9838b231d3bd9f36cb90d1f263fa1f5c5ac594a1 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Thu, 29 Feb 2024 08:14:01 -0500 Subject: [PATCH 03/19] CSR-1072 incorrect name CSR-1072 incorrect name --- src/store/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index 4db6b9fc2..06a5631d3 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -514,7 +514,7 @@ export const mutations = { state.order.damage.glassToReplace = sessionInformation.order.damage.glassToReplace; state.order.damage.isRepair = sessionInformation.order.damage.isRepair; state.order.damage.numberOfChips = sessionInformation.order.damage.numberOfChips; - state.order.damage.dateOfLoss = sessionInformation.order.damage?.lossDate; + state.order.damage.dateOfLoss = sessionInformation.order.damage?.dateOfLoss; state.order.damage.damageCause = sessionInformation.order.damage?.damageCause; state.order.damage.partQuestionAnswers = From 4a03629754057547fa4b13f431dee9f68755fdba Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:55:49 -0500 Subject: [PATCH 04/19] CSR-1072 CSR-1072 send verified insurance to vehicle-damage on page error --- src/router/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 1b4166922..f8a8dd785 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -451,6 +451,11 @@ async function DisplayPageError() { // we use the pageError querystring as a counter to how many times a user has experienced an error and been routed here. // once they receive more than 1 pageerrors, we'll reset their state to hopefully correct any issues they may be having. + var navPage = fmgPageValues.VEHICLE; + if (store.getters.payment.insuranceCoverage.isVerified) { + navPage = fmgPageValues.VEHICLE_DAMAGE; + } + if (pageError) { var errorCount = Number(pageError); if (errorCount > 1) { @@ -459,19 +464,19 @@ async function DisplayPageError() { router.push({ path: "/", - query: { fmgPage: "vehicle" }, + query: { fmgPage: navPage }, }); } else { errorCount++; router.push({ path: "/", - query: { fmgPage: "vehicle", pageError: errorCount }, + query: { fmgPage: navPage, pageError: errorCount }, }); } } else { router.push({ path: "/", - query: { fmgPage: "vehicle", pageError: "1" }, + query: { fmgPage: navPage, pageError: "1" }, }); } } From 43fbdb7c2ef50571ab26db8794863a755633f77a Mon Sep 17 00:00:00 2001 From: Sneha Date: Fri, 1 Mar 2024 11:57:31 +0530 Subject: [PATCH 05/19] CSR-1992 --- src/fmg-components/cart/cart.vue | 4 ++-- .../promo-modal-question/promo-modal-question.vue | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 76847f3e9..577ec5516 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -103,7 +103,7 @@ ref="promoModalQuestion" class="small mt-4" v-model="lineItems" - @addedPromo="handleAddedPromo" + @changePromo="handlePromoChange" :availableVaps="availableVaps" modalWidgetName="PromoModalWidget" /> @@ -245,7 +245,7 @@ export default { } return []; }, - handleAddedPromo(lineItems) { + handlePromoChange(lineItems) { // NOTE: these lineItems are passed from promo-modal-question this.$emit("update:modelValue", lineItems); }, diff --git a/src/fmg-components/promo-modal-question/promo-modal-question.vue b/src/fmg-components/promo-modal-question/promo-modal-question.vue index 59c1523b2..f8c8f5f16 100644 --- a/src/fmg-components/promo-modal-question/promo-modal-question.vue +++ b/src/fmg-components/promo-modal-question/promo-modal-question.vue @@ -213,6 +213,7 @@ export default { (lineItemsToKeep) => getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo ); + this.$emit("change-promo", this.lineItems); }, getErrorMessage(error, additionalInfo) { switch (error) { @@ -304,7 +305,7 @@ export default { this.lineItems.vaps?.push(...getVaps); } this.lineItems?.promos.push(...promoCodeData.promoCode); - this.$emit("added-promo", this.lineItems); + this.$emit("change-promo", this.lineItems); this.closeModal(); } else { this.getErrorMessage(promoCodeData.errorCode, promoCodeData.additionalInfo); From b0c931d6fc57f0a860bccebf26177f9198c1c108 Mon Sep 17 00:00:00 2001 From: Sneha Date: Fri, 1 Mar 2024 17:13:07 +0530 Subject: [PATCH 06/19] CSR-1992 --- src/fmg-components/cart/cart.vue | 6 +----- .../promo-modal-question/promo-modal-question.vue | 8 ++++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 577ec5516..8a7714410 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -103,7 +103,7 @@ ref="promoModalQuestion" class="small mt-4" v-model="lineItems" - @changePromo="handlePromoChange" + emitToGrandparent="true" :availableVaps="availableVaps" modalWidgetName="PromoModalWidget" /> @@ -245,10 +245,6 @@ export default { } return []; }, - handlePromoChange(lineItems) { - // NOTE: these lineItems are passed from promo-modal-question - this.$emit("update:modelValue", lineItems); - }, }, computed: { screenReaderTotalAmountDueText() { diff --git a/src/fmg-components/promo-modal-question/promo-modal-question.vue b/src/fmg-components/promo-modal-question/promo-modal-question.vue index f8c8f5f16..56d235afc 100644 --- a/src/fmg-components/promo-modal-question/promo-modal-question.vue +++ b/src/fmg-components/promo-modal-question/promo-modal-question.vue @@ -106,6 +106,11 @@ export default { required: false, default: true, }, + emitToGrandparent: { + type: Boolean, + required: false, + default: false, + }, }, computed: { promoLinkText() { @@ -175,6 +180,7 @@ export default { }, onModalClosed() { this.resetAlerts(); + if (this.emitToGrandparent) this.$parent.$emit("update:modelValue", this.lineItems); this.$emit("update:modelValue", this.lineItems); this.promoCode = ""; this.modal.resetForm(); @@ -213,7 +219,6 @@ export default { (lineItemsToKeep) => getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo ); - this.$emit("change-promo", this.lineItems); }, getErrorMessage(error, additionalInfo) { switch (error) { @@ -305,7 +310,6 @@ export default { this.lineItems.vaps?.push(...getVaps); } this.lineItems?.promos.push(...promoCodeData.promoCode); - this.$emit("change-promo", this.lineItems); this.closeModal(); } else { this.getErrorMessage(promoCodeData.errorCode, promoCodeData.additionalInfo); From 3ebffb11289eadb6acd2074a77529df068f328c0 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Fri, 1 Mar 2024 18:48:04 +0530 Subject: [PATCH 07/19] tint image optional tint image optional --- .../img/tints/Glass-NoShade-GreenTint-Privacy.svg | 1 - src/assets/img/tints/Glass-NoShade-GreenTint.svg | 4 +++- src/constants/tint-mapper.js | 1 - .../glass-part-question/glass-part-question.vue | 15 +++++---------- src/ux-components/list-card/list-card.vue | 1 + 5 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 src/assets/img/tints/Glass-NoShade-GreenTint-Privacy.svg diff --git a/src/assets/img/tints/Glass-NoShade-GreenTint-Privacy.svg b/src/assets/img/tints/Glass-NoShade-GreenTint-Privacy.svg deleted file mode 100644 index fecc16e63..000000000 --- a/src/assets/img/tints/Glass-NoShade-GreenTint-Privacy.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/img/tints/Glass-NoShade-GreenTint.svg b/src/assets/img/tints/Glass-NoShade-GreenTint.svg index cdf96aa3d..5f5b99de0 100644 --- a/src/assets/img/tints/Glass-NoShade-GreenTint.svg +++ b/src/assets/img/tints/Glass-NoShade-GreenTint.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/src/constants/tint-mapper.js b/src/constants/tint-mapper.js index e5d1a3b30..519de0855 100644 --- a/src/constants/tint-mapper.js +++ b/src/constants/tint-mapper.js @@ -33,7 +33,6 @@ const tintMap = { { name: "green tint", src: "Glass-NoShade-GreenTint.svg" }, { name: "gray tint privacy", src: "Glass-NoShade-GrayTint.svg" }, { name: "blue tint", src: "Glass-NoShade-BlueTint.svg" }, - { name: "green tint privacy", src: "Glass-NoShade-GreenTint-Privacy.svg" }, // No shade or tint { name: "clear", src: "Glass-NoShade-NoTint.svg" }, diff --git a/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue b/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue index 25a73e112..280edfc6c 100644 --- a/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue +++ b/src/layouts/vehicle-parts/glass-part-question/glass-part-question.vue @@ -95,19 +95,14 @@ export default { }, tintSelectionOptions() { - let tintOptions = []; - - Object.keys(this.featureListData).forEach((tintOption) => { - tintOptions.push({ + const tintOptions = Object.keys(this.featureListData).map((tintOption) => { + const buttonImage = this.getTintSourceImage(this.glassLocation, tintOption); + return { value: tintOption, buttonLabel: tintOption, - buttonImage: require(`@/assets/img/tints/${this.getTintSourceImage( - this.glassLocation, - tintOption - )}`), - }); + buttonImage: buttonImage ? require(`@/assets/img/tints/${buttonImage}`) : null, + }; }); - return tintOptions; }, diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index 902baa1e1..ffdf4efc0 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -10,6 +10,7 @@ class="d-flex w-100 align-items-center px-2 h-100 list-card-content button-content rounded-3" :class="labelClasses"> Date: Fri, 1 Mar 2024 10:59:10 -0500 Subject: [PATCH 08/19] Auto stash before merge of "feature/CSR-1971" and "origin/develop" --- src/fmg-components/cart/cart.vue | 12 ++++++++++-- src/layouts/quote/quote.vue | 7 +++++-- src/store/index.js | 2 ++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 8a7714410..f273b724c 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -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, diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index c1dd44145..82c3ad6d3 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -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. diff --git a/src/store/index.js b/src/store/index.js index 06a5631d3..ec3426bd5 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -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( From 900f79027193d74756c68be71c814a3a49ff0827 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 1 Mar 2024 14:49:46 -0500 Subject: [PATCH 09/19] CSR-1977: update copy in promotions-helper --- src/helpers/promotions-helper.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/helpers/promotions-helper.js b/src/helpers/promotions-helper.js index c9b305f99..e8d5f4e8f 100644 --- a/src/helpers/promotions-helper.js +++ b/src/helpers/promotions-helper.js @@ -331,10 +331,10 @@ export function getNewlyInactivatedPromos(oldInactivePromos, newInactivePromos) export function createPromoSuccessAlert(promoCode) { return { - messageHeadline: "Promo applied!", - messageCopy: `Promo "${getPromoCodeWithoutBundleIdentifier( + messageHeadline: "Promo code applied!", + messageCopy: `Promo code ${getPromoCodeWithoutBundleIdentifier( promoCode.toUpperCase() - )}" was successfully applied to your cart.`, + )} was successfully applied to your cart.`, type: "alert-success", isDismissible: true, shouldAutoFade: true, @@ -343,19 +343,19 @@ export function createPromoSuccessAlert(promoCode) { export function createPromoErrorAlert(promoCode, errorCode = null, additionalInfo) { const alert = { - messageHeadline: "Promo error", + messageHeadline: "Promo code error", type: "alert-danger", shouldAutoFade: false, isDismissible: true, }; if (stackingPromoErrorCodes.includes(errorCode)) { - alert.messageCopy = `Sorry, promo code "${getPromoCodeWithoutBundleIdentifier( + alert.messageCopy = `Sorry, promo code ${getPromoCodeWithoutBundleIdentifier( promoCode.toUpperCase() - )}" cannot be combined with "${additionalInfo[0].toUpperCase()}"`; + )} cannot be combined with ${additionalInfo[0].toUpperCase()}`; } else { - alert.messageCopy = `Sorry, promo code "${getPromoCodeWithoutBundleIdentifier( + alert.messageCopy = `Sorry, promo code ${getPromoCodeWithoutBundleIdentifier( promoCode.toUpperCase() - )}" is not valid`; + )} is not valid`; } return alert; } From e67b661279b1f84670ce48c99cbf6bbbed20444b Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Fri, 1 Mar 2024 15:16:13 -0500 Subject: [PATCH 10/19] CSR-1971 | Reworking quote page --- .../promo-modal-question.vue | 10 ++++----- src/layouts/quote/quote.vue | 22 +++++++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/fmg-components/promo-modal-question/promo-modal-question.vue b/src/fmg-components/promo-modal-question/promo-modal-question.vue index 56d235afc..51eff182c 100644 --- a/src/fmg-components/promo-modal-question/promo-modal-question.vue +++ b/src/fmg-components/promo-modal-question/promo-modal-question.vue @@ -99,7 +99,7 @@ export default { props: { modelValue: Object, modalWidgetName: String, - availableVaps: Object, + addableVaps: Object, pageName: String, taxPromos: { type: Boolean, @@ -192,14 +192,14 @@ export default { resetModalButtonStyle() { this.modal.resetButtonStyle(); }, - async getPromoCodeData(promoCode, lineItems, availableVaps, pageNameToLog = null) { + async getPromoCodeData(promoCode, lineItems, addableVaps, pageNameToLog = null) { const pageName = pageNameToLog ?? this.$options?.name; const promoValidationResponse = await baseMixin.methods.dispatchStoreActionWithLogging( storeActions.VALIDATE_ORDER_PROMO_AND_SAVE_SERVER_DATA, { promoCode: promoCode, lineItemsToUse: lineItems, - addableVaps: availableVaps, + addableVaps: addableVaps, }, pageName, false @@ -264,7 +264,7 @@ export default { const promoCodeData = await this.getPromoCodeData( this.promoCode, this.lineItems, - this.availableVaps, + this.addableVaps, this.pageName ); if (promoCodeData.isValid) { @@ -298,7 +298,7 @@ export default { ); const taxedVaps = mapTaxedLineItemsToStoreFormat( taxedLineItems, - this.availableVaps + this.addableVaps ); const getVaps = getVapsThatNeedToBeAddedToSatisfyPromos( diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 82c3ad6d3..35ec0451b 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -42,7 +42,7 @@ @@ -149,8 +149,14 @@ 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 ?? []; + lineItems.vaps = lineItems.vaps ?? []; const nullSafeGlassParts = lineItems.glassParts ?? []; const availableLineItems = [ resultMap.rainDefense, @@ -173,10 +179,11 @@ export default { resultMap.supportingItems, false ); + lineItems.supportingItems = resultMap.supportingItems; // Promo logic // Populate the previous state of promos for toast message usage in "next()" - const availableVaps = [...resultMap.wipers, resultMap.rainDefense]; + const addableVaps = [...resultMap.wipers, resultMap.rainDefense]; const oldActivePromos = store.getters.lineItems.promos?.slice(0); const oldInactivePromos = store.getters.order.payment.inactivePromos?.slice(0); @@ -189,16 +196,13 @@ export default { pricingResults, "quote" ); - 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. next((vm) => { vm.setCmsContent(resultMap.cmsContent); - vm.availableVaps = availableVaps; + vm.addableVaps = addableVaps; vm.lineItems = lineItems; vm.availableLineItems = pricingResults; vm.isInsuranceSelected = vm.getDefaultIsInsuranceSelectedValue(vm.availableLineItems); @@ -228,7 +232,7 @@ export default { isInsuranceSelected: null, availableLineItems: null, lineItems: [], - availableVaps: [], + addableVaps: [], }; }, computed: { @@ -307,7 +311,7 @@ export default { this.$store.getters.order.payment.parentAccountNumber != applicationConfig.CASH_PARENT_ACCOUNT_NUMBER ) { - this.supportingItems = this.filterOutFees(this.supportingItems); + this.lineItems.supportingItems = this.filterOutFees(this.lineItems.supportingItems); } if (this.lineItems.glassParts?.length > 0) { @@ -323,7 +327,7 @@ export default { storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS, { activePromos: this.lineItems.promos, - inactivePromos: this.$store.getters.order.payment.inactivePromos, + inactivePromos: this.$store.getters.order.payment.inactivePromos, // I don't think we need this here }, false ); From b42e436288bf863a1c4d2b781363b2bc2d16e8dd Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Fri, 1 Mar 2024 15:21:38 -0500 Subject: [PATCH 11/19] 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( From dc4e2c6aad44f8185fbf9d08f6a76c885e0a2d84 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 1 Mar 2024 15:36:36 -0500 Subject: [PATCH 12/19] CSR-1977: remove brackets around promo code message --- src/fmg-components/cart/cart.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 8a7714410..1434cc58a 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -112,7 +112,7 @@ class="my-2 lh-1 applied-promo" v-for="(promoCode, i) in this.getPromoCodeList()" :key="i"> - Promo code <{{ promoCode }}> applied + Promo code {{ promoCode }} applied From dd9b6f2c204b45222925ad731a0973547affa607 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 1 Mar 2024 15:39:32 -0500 Subject: [PATCH 13/19] CSR-1977: remove brackets around promo code message another --- src/fmg-components/cart/cart.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 1434cc58a..bf2c76b1e 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -33,9 +33,9 @@ :key="i" class="packaged-cart-item"> <{{ cartItem.name - }}> Date: Fri, 1 Mar 2024 15:39:39 -0500 Subject: [PATCH 14/19] CSR-1072 CSR-1072 do not run analytics calls without page name --- src/router/index.js | 2 +- src/store/index.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index f8a8dd785..3214e1111 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -72,7 +72,7 @@ const routes = [ // the saveSessionPromise will no longer point to a valid promise baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); - if (!to.query.fmgPage.startsWith("payment")) { + if (!to.query.fmgPage?.startsWith("payment")) { //payment pages used to return from safelitehop so exclude here // Remove the parameter after quote release const loadSessionResponse = await loadSessionIfPresent( diff --git a/src/store/index.js b/src/store/index.js index 06a5631d3..7118e8be6 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1101,6 +1101,10 @@ export const actions = { parentAccountNumber, } ) { + if (!pageName) { + return; + } + var payload = { userId: userId, sessionKey: sessionKey, @@ -1149,6 +1153,10 @@ export const actions = { parentAccountNumber, } ) { + if (!pageName) { + return; + } + var payload = { userId: userId, sessionKey: sessionKey, From 01f35a37aeac8bfe5fb6fdf1f79fe4c8b907d8fc Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Fri, 1 Mar 2024 15:46:50 -0500 Subject: [PATCH 15/19] CSR-1072 prettier --- src/store/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 7118e8be6..242ee9fc1 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1104,7 +1104,7 @@ export const actions = { if (!pageName) { return; } - + var payload = { userId: userId, sessionKey: sessionKey, @@ -1156,7 +1156,7 @@ export const actions = { if (!pageName) { return; } - + var payload = { userId: userId, sessionKey: sessionKey, From 8a56f326b0422d8a339e790b8c4fbe7fba36eb01 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 1 Mar 2024 15:47:09 -0500 Subject: [PATCH 16/19] CSR-1977 format change --- src/fmg-components/cart/cart.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index bf2c76b1e..6dcf0a69b 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -33,10 +33,9 @@ :key="i" class="packaged-cart-item"> {{ cartItem.name - }} + >{{ cartItem.name + }} Date: Mon, 4 Mar 2024 17:11:59 +0530 Subject: [PATCH 17/19] CSR-1992 --- src/fmg-components/cart/cart.vue | 20 ++++++++----------- .../promo-modal-question.vue | 6 ------ 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 8a7714410..6f82cee6b 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -103,7 +103,6 @@ ref="promoModalQuestion" class="small mt-4" v-model="lineItems" - emitToGrandparent="true" :availableVaps="availableVaps" modalWidgetName="PromoModalWidget" /> @@ -158,7 +157,6 @@ export default { style: "currency", currency: "USD", }), - lineItems: deepClone(this.modelValue), }; }, methods: { @@ -236,8 +234,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"]) { @@ -247,6 +243,14 @@ export default { }, }, computed: { + lineItems: { + get: function () { + return this.modelValue; + }, + set: function (newValue) { + this.$emit("update:modelValue", newValue); + }, + }, screenReaderTotalAmountDueText() { return this.getCmsContent("ScreenReaderTotalAmountDueWidget", "Text"); }, @@ -839,14 +843,6 @@ export default { return this.subTotal + this.salesTax; }, }, - watch: { - modelValue: { - handler(newValue) { - this.lineItems = deepClone(newValue); - }, - deep: true, - }, - }, components: { textBlock, textLink, diff --git a/src/fmg-components/promo-modal-question/promo-modal-question.vue b/src/fmg-components/promo-modal-question/promo-modal-question.vue index 56d235afc..e0b1a8884 100644 --- a/src/fmg-components/promo-modal-question/promo-modal-question.vue +++ b/src/fmg-components/promo-modal-question/promo-modal-question.vue @@ -106,11 +106,6 @@ export default { required: false, default: true, }, - emitToGrandparent: { - type: Boolean, - required: false, - default: false, - }, }, computed: { promoLinkText() { @@ -180,7 +175,6 @@ export default { }, onModalClosed() { this.resetAlerts(); - if (this.emitToGrandparent) this.$parent.$emit("update:modelValue", this.lineItems); this.$emit("update:modelValue", this.lineItems); this.promoCode = ""; this.modal.resetForm(); From a45702a560801afc3cf83593e8a6d2c1ef68f0a0 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Mon, 4 Mar 2024 07:58:22 -0500 Subject: [PATCH 18/19] CSR-1971 | sync local and store promos --- src/fmg-components/cart/cart.vue | 4 ++-- src/layouts/quote/quote.vue | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 0ab26e9e5..8a7714410 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -236,7 +236,7 @@ export default { this.lineItems[category] = this.lineItems[category].filter( (lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType ); - + this.$emit("update:modelValue", this.lineItems); }, getPromoCodeList() { @@ -845,7 +845,7 @@ export default { this.lineItems = deepClone(newValue); }, deep: true, - } + }, }, components: { textBlock, diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 94cafb0a4..27093cfdf 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -29,7 +29,7 @@ :availableLineItems="availableLineItems" :isInsuranceSelected="isInsuranceSelected" @vapsItemsSelected="vapsItemsSelectedAction" - :activePromos="allActivePromos" + :activePromos="lineItems.promos" v-on="{ 'buttonEvent.openModal': openModalAction }" validationRules="option-required" isRequired /> @@ -151,7 +151,6 @@ export default { const resultMap = await settleAllPromises(promiseResultMap); const lineItems = deepClone(store.getters.order.lineItems); - lineItems.promos = lineItems.promos ?? []; lineItems.vaps = lineItems.vaps ?? []; const nullSafeGlassParts = lineItems.glassParts ?? []; const availableLineItems = [ @@ -190,6 +189,8 @@ export default { pricingResults, "quote" ); + // Sync local promos with any new promos added by validate/revalidate + lineItems.promos = store.getters.lineItems.promos ?? []; // End of promo logic // Call the "next" function to complete the transition to this page. @@ -229,9 +230,6 @@ export default { }; }, computed: { - allActivePromos() { - return this.lineItems.promos ?? []; - }, lineItemsCloneForWatcher() { return Object.assign({}, this.lineItems); }, @@ -319,7 +317,7 @@ export default { this.dispatchStoreAction( storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS, { - activePromos: this.lineItems.promos + activePromos: this.lineItems.promos, }, false ); From bf105542a1f36f089f92c422cce0e91045d25f5f Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Mon, 4 Mar 2024 15:26:40 -0500 Subject: [PATCH 19/19] CSR-1072 CSR-1072 allow end to end insurance local development without having to run heritage locally --- src/helpers/heritage-integration/navigation-helper.js | 7 +++++++ vue.config.js | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index feba06ae3..da21df752 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -73,6 +73,13 @@ export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLo heritageParms["promo"] = promo; } + if ( + process.env.VUE_APP_HERITAGE_FUNNEL.includes("fixmyglassdev") && + process.env.VUE_APP_CURRENT_ENVIRONMENT === "Localhost" + ) { + heritageParms["forceEndToEndInsurance"] = true; + } + router.navigateToExternalUrl(externalUrls.HERITAGE_FUNNEL, heritageParms); } diff --git a/vue.config.js b/vue.config.js index a8c6ee8f8..fec376da7 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,5 +1,6 @@ process.env.VUE_APP_CONSUMER_CF_DISTRO = "https://digitalapi.dev.safelite.io"; -process.env.VUE_APP_HERITAGE_FUNNEL = "http://localhost:38000/default.aspx"; +//process.env.VUE_APP_HERITAGE_FUNNEL = "http://localhost:38000/default.aspx"; +process.env.VUE_APP_HERITAGE_FUNNEL = "https://fixmyglassdev.safelite.com/default.aspx"; process.env.VUE_APP_GOOGLE_PLACES_API_KEY = "AIzaSyDptGCkOPgN2uWJOy4ou4M33phRD4MAoJo"; process.env.VUE_APP_CURRENT_ENVIRONMENT = "Localhost"; process.env.VUE_APP_MY_ACCOUNT = "https://myaccountdev.safelite.com/";