From 87e0426258a510d68517c9cc67145ea865e522d6 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 6 Sep 2024 14:48:22 -0400 Subject: [PATCH 01/13] CSR-2179: add experiment logging for nextGen_RecalPriceRemoval on quote page --- src/constants/experiments.js | 1 + src/layouts/quote/quote.vue | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/constants/experiments.js b/src/constants/experiments.js index eb7fed508..bc2eea9af 100644 --- a/src/constants/experiments.js +++ b/src/constants/experiments.js @@ -1,5 +1,6 @@ const experimentUniverses = { CONCEPT_FUNNEL: "ConceptFunnel", + RECAL_PRICE_REMOVAL: "NextGen_RecalPriceRemoval", }; const experimentSettings = { diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 0d0e30128..2ddcc755f 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -99,6 +99,8 @@ import contentGroupModal from "@/fmg-components/content-group-modal/content-grou import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue"; import afterpayModalBanner from "@/layouts/quote/afterpay-modal-banner/afterpay-modal-banner"; import recalDisclaimer from "@/layouts/quote/recal-disclaimer/recal-disclaimer.vue"; + +// Supporting files import baseMixin from "@/mixins/base-mixin.js"; import experimentMixin from "@/mixins/experiment-mixin.js"; import vehicleQuestionsMixin from "../../mixins/vehicle-questions-mixin"; @@ -107,6 +109,8 @@ import { storeActions } from "@/constants/store-actions"; import { deepClone } from "@/helpers/object-helper"; import store from "@/store"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; +import { experimentUniverses } from "@/constants/experiments"; +import { getSessionKeyValue, getUserIdValue } from "@/helpers/heritage-integration/cookie-helper"; import { required } from "@/helpers/validation-rules"; import { errorMessages } from "@/constants/error-messages"; import { Form, defineRule } from "vee-validate"; @@ -133,6 +137,9 @@ export default { async beforeRouteEnter(to, from, next) { // Call APIs const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); + const experimentForLogging = store.getters.applicationUser.experiments.find( + (e) => e.universeName === experimentUniverses.RECAL_PRICE_REMOVAL + ); const wipersPromise = baseMixin.methods.dispatchStoreActionWithLogging( storeActions.GET_WIPERS, { @@ -200,6 +207,33 @@ export default { ...servicePackageDiscountPart, ]; + // If the recal experiment is found then log the experiment exposure. + const isRecalibrationOnOrder = containsLineItemWithPartType( + partTypeStrings.RECALIBRATION, + availableLineItems + ); + const canSafeliteRecalibrate = nullSafeGlassParts.some((glassPart) => { + return glassPart.partType === "WINDSHIELD" && glassPart.canSafeliteRecalibrate; + }); + if ( + experimentForLogging !== undefined && + isRecalibrationOnOrder && + canSafeliteRecalibrate + ) { + // Log experiment exposure + baseMixin.methods.dispatchStoreActionWithLogging( + storeActions.LOG_EXPERIMENT_EXPOSURE, + { + userId: getUserIdValue(), + sessionKey: getSessionKeyValue(), + pageName: to.query.fmgPage, + experiment: experimentForLogging, + }, + "vehicle", + false + ); + } + // When calling pricing from the quote page, always use the cash parent account baseMixin.methods.dispatchStoreAction( storeActions.SAVE_PARENT_ACCOUNT_NUMBER, From d6f812a571307f577668b9ff516f250c3d022a57 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 6 Sep 2024 14:48:44 -0400 Subject: [PATCH 02/13] CSR-2179: fix related unit tests --- src/layouts/quote/quote.spec.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/layouts/quote/quote.spec.js b/src/layouts/quote/quote.spec.js index 34041d3c4..aa7de2cae 100644 --- a/src/layouts/quote/quote.spec.js +++ b/src/layouts/quote/quote.spec.js @@ -238,6 +238,9 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + applicationUser: { + experiments: [] + }, order: { lineItems: { glassParts: ["item", "item2"], @@ -281,6 +284,9 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + applicationUser: { + experiments: [] + }, order: { lineItems: { glassParts: ["item", "item2"], @@ -322,6 +328,9 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + applicationUser: { + experiments: [] + }, order: { lineItems: { glassParts: ["item", "item2"], @@ -360,6 +369,9 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + applicationUser: { + experiments: [] + }, order: { lineItems: { glassParts: ["item", "item2"], @@ -399,6 +411,9 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + applicationUser: { + experiments: [] + }, order: { lineItems: { glassParts: ["item", "item2"], @@ -438,6 +453,9 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + applicationUser: { + experiments: [] + }, order: { lineItems: { glassParts: ["item", "item2"], @@ -478,6 +496,9 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + applicationUser: { + experiments: [] + }, order: { lineItems: { glassParts: ["item", "item2"], @@ -520,6 +541,9 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + applicationUser: { + experiments: [] + }, order: { lineItems: { glassParts: ["item", "item2"], @@ -561,6 +585,9 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + applicationUser: { + experiments: [] + }, order: { lineItems: { glassParts: ["item", "item2"], @@ -654,6 +681,9 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + applicationUser: { + experiments: [] + }, order: { lineItems: { glassParts: ["item", "item2"], From 5bf32fd4876ca8f0cb831a6a9b691bb5e17a5291 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 10 Sep 2024 10:08:18 -0400 Subject: [PATCH 03/13] Wrapped Remove Recal Experiment conditions around previous quote changes from CSR-2113 --- src/constants/experiments.js | 1 + src/layouts/quote/quote.vue | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/constants/experiments.js b/src/constants/experiments.js index bc2eea9af..52017ce47 100644 --- a/src/constants/experiments.js +++ b/src/constants/experiments.js @@ -12,6 +12,7 @@ const experimentSettings = { SUBMIT_ORDER_ENABLE_PIA: "SubmitOrder_Enable_PIA", IS_EMAIL_OPTIONAL: "isEmailOptional", SERVICE_PACKAGE_DISCOUNT: "OfferServicePackageDiscount", + RECAL_PRICE_REMOVE: "RecalPriceRemove", }; const experimentTriggers = { diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 2ddcc755f..4a0c2c72e 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -42,15 +42,19 @@
+ + @@ -109,7 +113,7 @@ import { storeActions } from "@/constants/store-actions"; import { deepClone } from "@/helpers/object-helper"; import store from "@/store"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; -import { experimentUniverses } from "@/constants/experiments"; +import { experimentUniverses, experimentSettings } from "@/constants/experiments"; import { getSessionKeyValue, getUserIdValue } from "@/helpers/heritage-integration/cookie-helper"; import { required } from "@/helpers/validation-rules"; import { errorMessages } from "@/constants/error-messages"; @@ -124,7 +128,6 @@ import { import { queryStrings } from "@/constants/query-strings"; import { getQuerystringParameter } from "@/helpers/querystring-helper"; import promoModalQuestion from "@/fmg-components/promo-modal-question/promo-modal-question"; -import { experimentSettings } from "@/constants/experiments"; import { partTypeStrings } from "@/constants/part-type-strings"; import { containsLineItemWithPartType } from "@/helpers/service-package-helper"; import { nextTick } from "vue"; @@ -358,6 +361,12 @@ export default { this?.availableLineItems ); }, + hideRecalibration() { + const recalSettingValue = experimentMixin.methods.getSettingValue( + experimentSettings.RECAL_PRICE_REMOVE + ); + return recalSettingValue; + }, }, methods: { openModalAction(modalName) { From bf66112963934ab6a124c0acfca7caf52692ff39 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 10 Sep 2024 10:09:23 -0400 Subject: [PATCH 04/13] CSR-2179: minor format updates to unit test file --- src/layouts/quote/quote.spec.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/layouts/quote/quote.spec.js b/src/layouts/quote/quote.spec.js index aa7de2cae..3780faf32 100644 --- a/src/layouts/quote/quote.spec.js +++ b/src/layouts/quote/quote.spec.js @@ -239,7 +239,7 @@ describe("quote.vue", () => { glassParts: ["item", "item2"], }, applicationUser: { - experiments: [] + experiments: [], }, order: { lineItems: { @@ -285,7 +285,7 @@ describe("quote.vue", () => { glassParts: ["item", "item2"], }, applicationUser: { - experiments: [] + experiments: [], }, order: { lineItems: { @@ -329,7 +329,7 @@ describe("quote.vue", () => { glassParts: ["item", "item2"], }, applicationUser: { - experiments: [] + experiments: [], }, order: { lineItems: { @@ -370,7 +370,7 @@ describe("quote.vue", () => { glassParts: ["item", "item2"], }, applicationUser: { - experiments: [] + experiments: [], }, order: { lineItems: { @@ -412,7 +412,7 @@ describe("quote.vue", () => { glassParts: ["item", "item2"], }, applicationUser: { - experiments: [] + experiments: [], }, order: { lineItems: { @@ -454,7 +454,7 @@ describe("quote.vue", () => { glassParts: ["item", "item2"], }, applicationUser: { - experiments: [] + experiments: [], }, order: { lineItems: { @@ -497,7 +497,7 @@ describe("quote.vue", () => { glassParts: ["item", "item2"], }, applicationUser: { - experiments: [] + experiments: [], }, order: { lineItems: { @@ -542,7 +542,7 @@ describe("quote.vue", () => { glassParts: ["item", "item2"], }, applicationUser: { - experiments: [] + experiments: [], }, order: { lineItems: { @@ -586,7 +586,7 @@ describe("quote.vue", () => { glassParts: ["item", "item2"], }, applicationUser: { - experiments: [] + experiments: [], }, order: { lineItems: { @@ -682,7 +682,7 @@ describe("quote.vue", () => { glassParts: ["item", "item2"], }, applicationUser: { - experiments: [] + experiments: [], }, order: { lineItems: { From b2a2184200dbde4b2d23e4d2eee87e8fb90b8e0b Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 10 Sep 2024 14:31:24 -0400 Subject: [PATCH 05/13] CSR-2179: update var name for consistency --- src/layouts/quote/quote.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 4a0c2c72e..8f2ef4fe9 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -45,7 +45,7 @@ @@ -54,7 +54,7 @@ @@ -361,7 +361,7 @@ export default { this?.availableLineItems ); }, - hideRecalibration() { + shouldHideRecalibration() { const recalSettingValue = experimentMixin.methods.getSettingValue( experimentSettings.RECAL_PRICE_REMOVE ); From beef51aa7c6c98f92bb52c0931334c97e9fd20d1 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 10 Sep 2024 14:33:13 -0400 Subject: [PATCH 06/13] CSR-2179: Wrapped Remove Recal Experiment conditions around previous payment-method changes from CSR-2115 --- src/layouts/payment-method/payment-method.vue | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 332936ba6..cc720cffc 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -46,14 +46,14 @@ v-bind:isDismissible="false" />
-
+

-
+
lineItem.partType.indexOf(partTypeStrings.RECALIBRATION) !== -1 + isRecalibrationOnOrder() { + return containsLineItemWithPartType( + partTypeStrings.RECALIBRATION, + this.$store.getters.order.lineItems?.supportingItems ); - - if (recalLineItem) { - return true; - } - return false; + }, + shouldHideRecalibration() { + const recalSettingValue = experimentMixin.methods.getSettingValue( + experimentSettings.RECAL_PRICE_REMOVE + ); + return recalSettingValue; }, showApplePay() { return baseMixin.methods.showApplePay(); @@ -658,7 +662,7 @@ export default { return true; } } else { - if (this.isPiaEnabled && this.totalAmountDue > 0 && !this.hasRecal) { + if (this.isPiaEnabled && this.totalAmountDue > 0 && !this.isRecalibrationOnOrder) { return true; } } From 7671d8d410e89cb7b9444e393e9701369910fb8c Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 10 Sep 2024 14:36:03 -0400 Subject: [PATCH 07/13] CSR-2179: correct wrong font weight --- src/layouts/payment-method/payment-method.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index cc720cffc..7c9e96650 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -768,7 +768,7 @@ export default { } .questions-about-service { .service-questions { - font-weight: $font-weight-bold; + font-weight: 600; } } .cart { From e919e3ba5e8cbd3c9260c5e5ed17a80c1deffa72 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 10 Sep 2024 14:41:32 -0400 Subject: [PATCH 08/13] CSR-2179: change method of setting expanded cart default --- src/fmg-components/cart/cart.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 495973144..f352ce2c7 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -1,10 +1,9 @@