From b00c0bdcf6e18dd2e2bc6b4711fa0e5f65e8a2c8 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 3 Sep 2024 15:48:38 -0400 Subject: [PATCH 1/9] CSR-2182: add new base mixin --- src/mixins/base-mixin.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index 109f90d04..c86cdacb5 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -102,6 +102,12 @@ export default { }); return filteredLineItems; }, + filterOutRecalibration(lineItems) { + const filteredLineItems = lineItems.filter((item) => { + return item.partType != partTypeStrings.RECALIBRATION; + }); + return filteredLineItems; + }, getTotalPriceOfAllLineItemsAndChildParts(lineItems, includeTax) { let totalPrice = 0; lineItems.forEach((lineItem) => { From 01d0c809fa25300346ec8cc7e103886cdd186fe8 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 3 Sep 2024 15:49:55 -0400 Subject: [PATCH 2/9] CSR-2182: add boolean prop for insurance or not for cart --- src/layouts/payment-method/payment-method.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index f012f7874..e634cecfc 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -30,6 +30,7 @@ pageName="payment-method" servicePackageOptionsCmsName="ServicePackageTitle" recyclingModalCmsWidgetName="RecycleModal" + :isInsurance="isInsurance" :insuranceDeductible="currentDeductible" :insuranceCompanyName="insuranceCompanyName" :showInsuranceCoverageAs="showInsuranceCoverageAs" /> From 785c9fd1bf1052dca3bc8764368bef2ff200cf65 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 3 Sep 2024 15:59:02 -0400 Subject: [PATCH 3/9] CSR-2182: remove recal prices from cash carts --- src/fmg-components/cart/cart.vue | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 495973144..c042b3ca8 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -184,6 +184,7 @@ export default { allowItemRemoval: Boolean, recyclingModalCmsWidgetName: String, showAsPaid: Boolean, + isInsurance: Boolean, insuranceDeductible: Number, insuranceCompanyName: String, showInsuranceCoverageAs: String, @@ -299,6 +300,12 @@ export default { this.$emit("update:modelValue", newValue); }, }, + lineItemsWithoutRecal() { + if (!this.lineItems || this.lineItems.length < 1) return; + const lineItemsCopy = this.lineItems; + lineItemsCopy.supportingItems = baseMixin.methods.filterOutRecalibration(this.lineItems.supportingItems); + return lineItemsCopy; + }, showCoverageAsPending() { return this.showInsuranceCoverageAs === coverageStatus.PENDING; }, @@ -983,16 +990,23 @@ export default { return this.getCmsContent("SubtotalTextWidget", "Text"); }, subTotal() { - return baseMixin.methods.getSubTotal(this.lineItems); + if (!this.lineItems || this.lineItems.length < 1) return; + return this.isInsurance + ? baseMixin.methods.getSubTotal(this.lineItems) + : baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal); }, salesTax() { - return baseMixin.methods.getSalesTax(this.lineItems); + if (!this.lineItems || this.lineItems.length < 1) return; + return this.isInsurance + ? baseMixin.methods.getSalesTax(this.lineItems) + : baseMixin.methods.getSalesTax(this.lineItemsWithoutRecal); }, amountDue() { - if (this.showAsPaid) { - return 0; - } - return baseMixin.methods.getAmountDue(this.lineItems); + if (!this.lineItems || this.lineItems.length < 1) return; + if (this.showAsPaid) return 0; + return this.isInsurance + ? baseMixin.methods.getAmountDue(this.lineItems) + : baseMixin.methods.getAmountDue(this.lineItemsWithoutRecal); }, amountPaid() { if (!this.showAsPaid) { From f0dd92e29f7eac20e6aa56204529f5673748156d Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 3 Sep 2024 15:59:51 -0400 Subject: [PATCH 4/9] CSR-2182: remove unused clone --- src/fmg-components/cart/cart.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index c042b3ca8..db61508b8 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -923,8 +923,6 @@ export default { promoCartItems() { const promoCartItems = []; - // clone the promos array - const promosClone = deepClone(this.promo); // get unique promo codes const uniquePromoCodes = [ ...new Set( From 1fbaccc4228a4c730e38632a0c573dcb55fe63a0 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 3 Sep 2024 17:23:41 -0400 Subject: [PATCH 5/9] CSR-2182: prettier formatting --- src/fmg-components/cart/cart.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index db61508b8..4d5f19f76 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -303,7 +303,9 @@ export default { lineItemsWithoutRecal() { if (!this.lineItems || this.lineItems.length < 1) return; const lineItemsCopy = this.lineItems; - lineItemsCopy.supportingItems = baseMixin.methods.filterOutRecalibration(this.lineItems.supportingItems); + lineItemsCopy.supportingItems = baseMixin.methods.filterOutRecalibration( + this.lineItems.supportingItems + ); return lineItemsCopy; }, showCoverageAsPending() { From 71fbc6a5954a245e9115cf7c374c584877b7a0e3 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Wed, 4 Sep 2024 14:42:48 +0530 Subject: [PATCH 6/9] CSR-1629 creating non-CJ and CJE cookie for Nextgen --- src/constants/application-config.js | 1 + src/constants/cookie-names.js | 5 + src/constants/query-strings.js | 7 + .../heritage-integration/cookie-helper.js | 121 +++++++++++++++++- src/router/index.js | 7 +- 5 files changed, 136 insertions(+), 5 deletions(-) diff --git a/src/constants/application-config.js b/src/constants/application-config.js index a72b306d3..6a747617f 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -31,6 +31,7 @@ const applicationConfig = { "https://outlook.office.com/calendar/deeplink/compose?path=/calendar/action/compose&rru=addevent", FRONTEND_LOGGER_PATH: "/analytics/api/v1/logging", AFFILIATE_COOKIE_CONTAINING_NAME: "_Track", + COOKIE_NAME_LENGTH_MAX_LIMIT: 44, }; export { applicationConfig }; diff --git a/src/constants/cookie-names.js b/src/constants/cookie-names.js index d62934cf5..72e6168fb 100644 --- a/src/constants/cookie-names.js +++ b/src/constants/cookie-names.js @@ -10,6 +10,9 @@ const cookieNames = { DXDEV: "dxdev", SESSION_ID: "sid", SESSION_KEY: "skey", + + //Commission Junction Cookie + CJE: "cje", }; const cookieExpirations = { @@ -17,6 +20,8 @@ const cookieExpirations = { DXDEV: convertToSeconds({ years: 1 }), FUNNEL_USER_ID: convertToSeconds({ weeks: 1 }), FUNNEL_SESSION_KEY: convertToSeconds({ minutes: 30 }), + CJE: convertToSeconds({ days: 395 }), + NON_CJ: convertToSeconds({ days: 100000 }), }; export { cookieNames, cookieExpirations }; diff --git a/src/constants/query-strings.js b/src/constants/query-strings.js index a21d93200..4a5c47943 100644 --- a/src/constants/query-strings.js +++ b/src/constants/query-strings.js @@ -36,6 +36,13 @@ const queryStrings = { VIN_SELECTION: "vinselection", SERVICE_PACKAGE: "servicepackage", NUMBER_OF_CHIPS: "numberofchips", + UTM_SOURCE: "_source", + UTM_MEDIUM: "_medium", + UTM_CAMPAIGN: "_campaign", + CJ_EVENT: "cjevent", + CJUNCTION: "cjunction", + ORGANIC: "organic", + ORGANIC_SOCIAL: "organic_social", }; export { queryStrings }; diff --git a/src/helpers/heritage-integration/cookie-helper.js b/src/helpers/heritage-integration/cookie-helper.js index 1b7b551ca..0bd4ae563 100644 --- a/src/helpers/heritage-integration/cookie-helper.js +++ b/src/helpers/heritage-integration/cookie-helper.js @@ -1,7 +1,9 @@ import { cookieNames, cookieExpirations } from "@/constants/cookie-names"; import store from "@/store"; import { applicationConfig } from "@/constants/application-config"; - +import { getQuerystringParameter } from "@/helpers/querystring-helper"; +import { queryStrings } from "@/constants/query-strings"; +//import { cookieParameters } from "@/constants/cookie-parameters"; /* Will update the cookie if present, or create a new one if not. */ @@ -221,6 +223,79 @@ export function getAffiliateCookies() { return affiliateCookies; } +export function setupAdvertiserTracking() { + var utmSource = getQuerystringParameter(queryStrings.UTM_SOURCE); + var utmMedium = getQuerystringParameter(queryStrings.UTM_MEDIUM); + var utmCampaign = getQuerystringParameter(queryStrings.UTM_CAMPAIGN); + const cjEvent = getQuerystringParameter(queryStrings.CJ_EVENT); + // helper check for if an object is defined (but maybe falsey) + const isDefined = (x) => x !== null && x !== undefined; + if (isDefined(cjEvent) != "") { + const cjeCookieName = cookieNames.CJE; + if (!isCookieSet(cjeCookieName)) { + createCJEventCookie(cjEvent, cjeCookieName); + } + } + //Firstly, Can't continue without utm-source or utm-medium. + //Secondly, Ignore the advertiser for CJ-affiliate-click and Email-click. + if ( + !isDefined(utmSource) || + isDefined(utmSource) == "" || + !isDefined(utmMedium) || + isDefined(utmMedium) == "" || + utmSource?.toLowerCase() == queryStrings.CJUNCTION || + utmMedium?.toLowerCase() == queryStrings.EMAIL || + utmMedium?.toLowerCase() == queryStrings.ORGANIC || + utmMedium?.toLowerCase() == queryStrings.ORGANIC_SOCIAL + ) { + return; + } + //UTC date time format yyyy-MM-dd/HH:mm:ss + const currentDateTime = new Date().toISOString().replace(/T/, "/").replace(/\..+/, ""); + + //Format cookie, by removing spaces and special characters. + utmSource = FormatCookieElementName(utmSource); + utmMedium = FormatCookieElementName(utmMedium); + utmCampaign = FormatCookieElementName(utmCampaign); + + var cookieNameBuilder = utmSource + "_" + utmMedium; + //Since utmCampaign is optional, ignore the rest. + if (isDefined(utmCampaign) && utmCampaign != "") { + cookieNameBuilder = cookieNameBuilder + "_" + utmCampaign; + } + const cookieName = + (cookieNameBuilder.length > applicationConfig.COOKIE_NAME_LENGTH_MAX_LIMIT + ? cookieNameBuilder.substring(0, applicationConfig.COOKIE_NAME_LENGTH_MAX_LIMIT) + : cookieNameBuilder) + applicationConfig.AFFILIATE_COOKIE_CONTAINING_NAME; + + if (!isCookieSet(cookieName)) { + const values = [ + `utm_source= ${utmSource}`, + `utm_medium= ${utmMedium}`, + `utm_campaign= ${utmCampaign}`, + `timestamp= ${currentDateTime}`, + `tagEvent= ${cjEvent}`, + ]; + let valueString = values.join("&"); + createOrUpdateCookie(cookieName, valueString, { + useDefaultFunnelCookieAttributes: true, + maxAge: cookieExpirations.NON_CJ, + }); + } else { + const cookieValue = getCookieValueByName(cookieName); + if (cookieValue) { + let cookieValueObj = convertStringToObject(cookieValue); + cookieValueObj.timestamp = currentDateTime; // Update the property + // Set the updated cookie + const cookieValueString = objectToString(cookieValueObj); + createOrUpdateCookie(cookieName, cookieValueString, { + useDefaultFunnelCookieAttributes: true, + maxAge: cookieExpirations.NON_CJ, + }); + } + } +} + /* =========================== = PRIVATE FUNCTIONS = @@ -253,7 +328,7 @@ function setFunnelCookieProperties(properties) { function createOrUpdateCookie( key, value = "", - { useDefaultFunnelCookieAttributes = true, maxAge, isSecure = true } + { useDefaultFunnelCookieAttributes = true, maxAge, isSecure = true, crossSiteAccess = false } ) { let cookieToAdd = `${key}=${value}; `; @@ -266,6 +341,9 @@ function createOrUpdateCookie( if (!isNaN(maxAge)) { cookieToAdd += `max-age=${maxAge};`; } + if (crossSiteAccess && isSecure) { + cookieToAdd += `sameSite=None;`; + } document.cookie = cookieToAdd; } @@ -315,3 +393,42 @@ function getCookiesContainingName(name) { } return matchingCookies; } +function createCJEventCookie(cjEvent, cookieName) { + createOrUpdateCookie(cookieName, cjEvent, { + useDefaultFunnelCookieAttributes: true, + maxAge: cookieExpirations.CJE, + isSecure: true, + crossSiteAccess: true, + }); +} + +function FormatCookieElementName(cookie) { + // Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie + const problemSymbols = '\\s\\(\\)<>@,;:\\\\/\\[\\]\\?=\\{}"'; + const otherSymbols = "!#$%^&+\\-*|~`"; + const symbolsToIgnore = new RegExp("[" + problemSymbols + otherSymbols + "]+", "g"); + + return (cookie || "").replace(symbolsToIgnore, "."); +} + +function convertStringToObject(str) { + let obj = {}; + let pairs = str.split("&"); + + pairs.forEach((pair) => { + let [key, value] = pair.split("="); + obj[key] = value; + }); + + return obj; +} +function objectToString(obj) { + let str = ""; + for (let key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + str += key + "=" + obj[key] + "&"; + } + } + // Remove the trailing '&' + return str.slice(0, -1); +} diff --git a/src/router/index.js b/src/router/index.js index f3583e312..893178b12 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -19,6 +19,7 @@ import { updateSessionIdCookie, deleteFunnelCookie, getAffiliateCookies, + setupAdvertiserTracking, } from "@/helpers/heritage-integration/cookie-helper"; import { loadSessionIfPresent, saveSession } from "@/helpers/heritage-integration/order-helper"; import { @@ -103,7 +104,7 @@ const routes = [ if (affiliateCookies != null && affiliateCookies.length > 0) { store.commit(storeMutations.UPDATE_AFFILIATE_COOKIES, affiliateCookies); } - + setupAdvertiserTracking(); const loadSessionResponse = await loadSessionIfPresent( to.query.isInsurance != null ? to.query.isInsurance == "true" @@ -429,8 +430,8 @@ async function navigate( name: "root", query: Object.assign(optionalQuery, queryStringsObject), state: { - isSavingNavigation: isSavingNavigation - } + isSavingNavigation: isSavingNavigation, + }, }); } else if (matchingScenarioMap.destinationUrl !== undefined) { navigateToUrl(matchingScenarioMap.destinationUrl, optionalQuery); From a6c92b62550f91f878b56d56af46e11df9015fd5 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Wed, 4 Sep 2024 05:17:31 -0400 Subject: [PATCH 7/9] CSR-2185 CSR-2185 vue-router no longer supports properties via params without it showing in the url. https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 --- src/layouts/payment-method/payment-method.vue | 16 +++++++---- src/layouts/payment/payment.vue | 2 +- .../vehicle-damage/vehicle-damage.spec.js | 12 +++++---- src/layouts/vehicle-damage/vehicle-damage.vue | 27 ++++++++++++++----- src/router/index.js | 6 ++--- 5 files changed, 42 insertions(+), 21 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index a5a778cc8..332936ba6 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -525,14 +525,18 @@ export default { await submitWorkOrder({ pageNameToLog: "payment-method", submitAfterSave: true }); this.$router.navigateWithoutSaving( this.navigationScenarios.CLICKED_FORWARD, - this.$route + this.$route, + {}, + { [routerParams.DISPLAY_PIA_ALERT]: false } ); } else { if (this.paymentMethod == paymentMethods.INSURANCE) { this.dispatchStoreAction(this.storeActions.SAVE_PAYMENT_TYPE, true, false); this.$router.navigateWithoutSaving( this.navigationScenarios.CLICKED_INSURANCE, - this.$route + this.$route, + {}, + { [routerParams.DISPLAY_PIA_ALERT]: false } ); } else { this.setupPia(); @@ -554,14 +558,16 @@ export default { } catch (error) { console.log("error: response from pia submit work order:" + error.message); this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); - this.$route.params[routerParams.DISPLAY_PIA_ALERT] = true; + this.$route.query[queryStrings.DISPLAY_PIA_ALERT] = true; return; } } this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); this.$router.navigateWithoutSaving( this.navigationScenarios.CLICKED_PAY_NOW, - this.$route + this.$route, + {}, + { [routerParams.DISPLAY_PIA_ALERT]: false } ); }, hasSubmittedOrder() { @@ -682,7 +688,7 @@ export default { shouldDisplayPiaAlert() { return ( this.$route.query[queryStrings.DISPLAY_PIA_ALERT] || - this.$route.params[routerParams.DISPLAY_PIA_ALERT] + eval(window.history.state.displayPiaAlert) ); }, // Necessary to make the watcher of lineItems work diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index 987caf56d..5dc103c68 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -747,7 +747,7 @@ export default { shouldDisplayPiaAlert(payMethod) { return ( this.$route.query[queryStrings.DISPLAY_PIA_ALERT] === payMethod || - this.$route.params[routerParams.DISPLAY_PIA_ALERT] === payMethod + eval(window.history.state.displayPiaAlert) ); }, }, diff --git a/src/layouts/vehicle-damage/vehicle-damage.spec.js b/src/layouts/vehicle-damage/vehicle-damage.spec.js index b490114da..bc4ab9356 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.spec.js +++ b/src/layouts/vehicle-damage/vehicle-damage.spec.js @@ -310,12 +310,11 @@ describe("vehicle-damage.vue", () => { describe("alert", () => { test("when displayVehicleChangeAlert router params is true, the alert: 'vehicleChangeAlert' should be rendered", () => { // Arrange & Act + window.history.pushState({ displayVehicleChangeAlert: "true" }, "", ""); const { wrapper } = setupMocks({ mountOptionsMockData: { route: { - params: { - [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true, - }, + state: { displayVehicleChangeAlert: true }, }, }, }); @@ -325,21 +324,24 @@ describe("vehicle-damage.vue", () => { test("when displayVehicleChangeAlert router params is false, the alert: 'vehicleChangeAlert' should not be rendered", () => { // Arrange & Act + window.history.pushState({ displayVehicleChangeAlert: "false" }, "", ""); const { wrapper } = setupMocks({ mountOptionsMockData: { route: { - params: { + state: { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: false, }, }, }, }); + // Assert expect(wrapper.findComponent({ ref: "vehicleChangeAlert" }).exists()).toBe(false); }); test("when displayVehicleChangeAlert router params is undefined, the alert: 'vehicleChangeAlert' should not be rendered", () => { // Arrange & Act + window.history.pushState({ displayVehicleChangeAlert: "false" }, "", ""); const { wrapper } = setupMocks({ mountOptionsMockData: { route: { @@ -850,7 +852,7 @@ function setupMocks({ pageHeaderWidgetHeaderText, mountOptionsMockData, funnelCo navigateWithSaving: jest.fn(), }, route: { - params: { + state: { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: false, }, }, diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 5744597e4..d22bb9c81 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -103,6 +103,7 @@ import { errorMessages } from "@/constants/error-messages"; import { damageLocationsCms } from "@/constants/damage-locations-cms.js"; import { damageLocationsSelected } from "@/constants/damage-locations-selected.js"; import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper"; +import { routerParams } from "@/router/router-constants/router-params"; import store from "@/store"; import baseMixin from "@/mixins/base-mixin"; @@ -405,20 +406,26 @@ export default { if (skipVin) { this.$router.navigateWithSaving( this.navigationScenarios.CLICKED_FORWARD_WITH_SKIP_VIN, - this.$route + this.$route, + {}, + { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: false } ); } else { if (store.getters.damage.isRepair) { this.$router.navigateWithSaving( this.navigationScenarios .CLICKED_FORWARD_WITH_REPAIR_AND_VERIFIED_INSURANCE, - this.$route + this.$route, + {}, + { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: false } ); } else { this.$router.navigateWithSaving( this.navigationScenarios .CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE, - this.$route + this.$route, + {}, + { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: false } ); } } @@ -427,17 +434,23 @@ export default { else if (store.getters.vehicle.vin) { this.$router.navigateWithSaving( this.navigationScenarios.CLICKED_FORWARD_WITH_VIN, - this.$route + this.$route, + {}, + { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: false } ); } else if (skipVin) { this.$router.navigateWithSaving( this.navigationScenarios.CLICKED_FORWARD_WITH_SKIP_VIN, - this.$route + this.$route, + {}, + { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: false } ); } else { this.$router.navigateWithSaving( this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, - this.$route + this.$route, + {}, + { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: false } ); } }, @@ -566,7 +579,7 @@ export default { ); }, shouldDisplayVehicleChangeAlert() { - return this.$route.params[this.routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]; + return eval(window.history.state.displayVehicleChangeAlert); }, shouldHideBackButton() { return this.$store.getters.requiresVerifiedRedirecting; diff --git a/src/router/index.js b/src/router/index.js index f3583e312..4ee7dd0c6 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -397,6 +397,8 @@ async function navigate( : (existingPageDataForPage ?? {}) ); + optionalParams.isSavingNavigation = isSavingNavigation; + // add querystring params to the route. if they are already in the store then no need to add them var queryStringsObject = { fmgPage: destinationFmgPageValue, @@ -428,9 +430,7 @@ async function navigate( router.push({ name: "root", query: Object.assign(optionalQuery, queryStringsObject), - state: { - isSavingNavigation: isSavingNavigation - } + state: optionalParams, }); } else if (matchingScenarioMap.destinationUrl !== undefined) { navigateToUrl(matchingScenarioMap.destinationUrl, optionalQuery); From 52c9bfecf7483c160366026e81690188f089b9b0 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 5 Sep 2024 20:42:03 -0400 Subject: [PATCH 8/9] CSR-2182: fix recursive error --- 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 4d5f19f76..06fa922ef 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -302,9 +302,9 @@ export default { }, lineItemsWithoutRecal() { if (!this.lineItems || this.lineItems.length < 1) return; - const lineItemsCopy = this.lineItems; + const lineItemsCopy = deepClone(this.lineItems); lineItemsCopy.supportingItems = baseMixin.methods.filterOutRecalibration( - this.lineItems.supportingItems + lineItemsCopy.supportingItems ); return lineItemsCopy; }, From 16538fff6f964f9f30368f3686f312ecef0f71b6 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 6 Sep 2024 07:18:00 -0400 Subject: [PATCH 9/9] CSR-2182: fix package price to remove recal --- src/fmg-components/cart/cart.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 06fa922ef..9e5a43bd6 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -140,7 +140,7 @@
Promo code {{ promoCode }} applied @@ -284,6 +284,7 @@ export default { (lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType ); }, + getPromoCodeList() { if (this.$refs["promoModalQuestion"]) { return this.$refs["promoModalQuestion"].getPromoCodeList(); @@ -436,7 +437,14 @@ export default { packagePrice() { let packagePrice = 0; - if (!this.showCoverageAsVerified && !this.showCoverageAsPending) { + if (!this.isInsurance) { + // CASH ONLY + packagePrice = baseMixin.methods.getTierOnePackagePrice( + baseMixin.methods.filterOutFees( + baseMixin.methods.filterOutRecalibration(this.availableLineItems) + ) + ); + } else if (!this.showCoverageAsVerified && !this.showCoverageAsPending) { packagePrice = baseMixin.methods.getTierOnePackagePrice( baseMixin.methods.filterOutFees(this.availableLineItems) );