From 30349fa0c6ca9b34b77c0abba050c37588d55f3a Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Mon, 31 Mar 2025 10:12:38 -0400 Subject: [PATCH 01/14] CASH-442 add cookie link. --- src/fmg-components/funnel-header/menu-modal/menu-modal.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue index 825e5e0fb..ef749a55d 100644 --- a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue +++ b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue @@ -57,6 +57,11 @@ alt="Your privacy choices" /> + Date: Mon, 31 Mar 2025 10:23:54 -0400 Subject: [PATCH 02/14] minor change to reopen PR. --- src/fmg-components/funnel-header/menu-modal/menu-modal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue index ef749a55d..73cb18257 100644 --- a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue +++ b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue @@ -227,7 +227,7 @@ export default { } } } - //.modal-backdrop styles are in common-styles.scss + //.modal-backdrop styles are in common-styles.scss. } } From 1580120f5e030fbbeadfee908fd4185c6c3dfbde Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Mon, 31 Mar 2025 10:25:34 -0400 Subject: [PATCH 03/14] Force update. --- src/fmg-components/funnel-header/menu-modal/menu-modal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue index 73cb18257..ef749a55d 100644 --- a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue +++ b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue @@ -227,7 +227,7 @@ export default { } } } - //.modal-backdrop styles are in common-styles.scss. + //.modal-backdrop styles are in common-styles.scss } } From 3802650e2e56cdecf136e1c28438b4c115cab412 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Mon, 31 Mar 2025 12:13:17 -0400 Subject: [PATCH 04/14] Clean up foster love mock --- src/constants/store-actions.js | 1 + src/experiment-components/donation-block.vue | 5 +- src/layouts/confirmation/confirmation.vue | 60 +++---------- src/store/index.js | 93 ++++++++++++++++++++ 4 files changed, 111 insertions(+), 48 deletions(-) diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index baa219aa1..e7cb38953 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -27,6 +27,7 @@ const storeActions = { GET_RAIN_DEFENSE: "getRainDefense", GET_SUPPORTING_ITEMS: "getSupportingItems", GET_CAPABILITY_QUESTIONS: "getCapabilityQuestions", + SUBMIT_DONATION_PART_TO_SV2: "submitDonationPartToSV2", GET_PART_FROM_CAPABILITY_QUESTION_ANSWER: "getPartFromCapabilityQuestionAnswer", GET_MOLDING_QUESTIONS: "getMoldingQuestions", GET_MOBILE_FEE_PART: "getMobileFeePart", diff --git a/src/experiment-components/donation-block.vue b/src/experiment-components/donation-block.vue index 30fca4fd1..c90e6af14 100644 --- a/src/experiment-components/donation-block.vue +++ b/src/experiment-components/donation-block.vue @@ -54,7 +54,7 @@
+ v-html="DonationAddButtonCopy">
@@ -108,7 +108,7 @@ export default { DonationBodySubText() { return this.getCmsContent(this.cmsWidgetName, "BodyText2"); }, - DonationAddButtonWidget() { + DonationAddButtonCopy() { return this.getCmsContent("DonationAddButtonWidget", "Text"); }, DonationThanksAlertWidget() { @@ -126,6 +126,7 @@ export default { }, set: function (newValue) { this.$emit("update:modelValue", newValue); + this.$emit("DonationAddedEvent"); }, }, }, diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index 1a6a4d99e..f6810f726 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -71,7 +71,8 @@ v-model="donationAmount" :donationValues="donationValues" :showDonationSuccess="showDonationSuccess" - :showDonationError="showDonationError" /> + :showDonationError="showDonationError" + @DonationAddedEvent="addDonationToOrder" />
@@ -522,61 +523,28 @@ export default { forwardButtonAction() { window.location.assign(location.protocol + "//" + location.host); }, - async addDonation(amount, plateTemp) { - // try to call API to add donation to order - - // TEMP DUMMY CALL TO SIMULATE SUCCESS OR ERROR FROM API CALL - const donationResponse = this.createMockedResponse(amount); + async addDonationToOrder() { + const donationResponse = await baseMixin.methods.dispatchStoreActionWithLogging( + storeActions.SUBMIT_DONATION_PART_TO_SV2, + { + donationAmount: parseInt(this.donationAmount), + submittedOrder: this.submittedOrder, + }, + false + ); + console.log(donationResponse); if (donationResponse?.wasSuccessful) { this.showDonationSuccess = true; this.showDonationError = false; - const donationResponse = await baseMixin.methods.dispatchStoreAction( + await baseMixin.methods.dispatchStoreAction( storeActions.ADD_DONATION_TO_SUBMITTED_ORDER, - amount, + parseInt(this.donationAmount), false ); } else { this.showDonationError = true; this.showDonationSuccess = false; - const donationResponse = await baseMixin.methods.dispatchStoreAction( - storeActions.ADD_DONATION_TO_SUBMITTED_ORDER, - 0, - false - ); - } - }, - //mocked response. should be removed once integrate with actual api call. - createMockedResponse(amount) { - let result; - - switch (amount) { - case 1: - result = { wasSuccessful: true, wasLocked: false }; - break; - case 3: - result = { wasSuccessful: false, wasLocked: true }; - break; - case 5: - result = { wasSuccessful: false, wasLocked: false }; - break; - default: - result = { wasSuccessful: null, wasLocked: null }; // Default case if amount doesn't match - } - - return result; - }, - }, - watch: { - donationAmount(newValue) { - newValue = parseInt(newValue); - - // this.addDonation(newValue); - // TODO - when backend code is final, then remove the below and restore the line above - if (newValue === 5) { - this.addDonation(newValue, "FAILING_PLATE"); // throws error - } else { - this.addDonation(newValue, "2fast"); // should give successful response } }, }, diff --git a/src/store/index.js b/src/store/index.js index bdf6c48a7..13c12cd94 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1892,6 +1892,99 @@ export const actions = { pageNameToLog: pageNameToLog, }); }, + submitDonationPartToSV2( + context, + { payload: { donationAmount, submittedOrder }, pageNameToLog } + ) { + donationAmount = parseInt(donationAmount); + /* Request contract + { + "donationAmount": 5, + "savedSessionId": "96b1a16e-410a-4d08-8421-fe36e82b2275", + "paymentInfo": { + "parentAccountNumber": 167132, + "billToAccountNumber": 87291, + "providerNumber": "005819", + "carId": "CR00069266", + "make": "Acura", + "model": "MDX", + "year": 2020, + "eon": "S1820397", + "zipCode": "43015", + "state": "OH", + "referralNumber": "1821895", + "referralDate": "2025-03-20T16:27:38.93", + "referralSequenceNumber": "1821895", + "serviceZipCode": "43015", + "isReplacement": true, + "deductible": 0, + "coverageStatus": null, + "coverageSubStatus": null, + "serverData": "ZtCNOF1tCLQBAx2NRKHE/n/fqD8zUxRfYtDuTu7uUiPpeg7i6TmwXwggssX5KsXVQbeft+PN+vXYfBFJytLVYgbafNDR0JH3izVTIOh7KGTeB6YaPuCJmodF4SfgVVDHD9LEmEH9wNzM9j3pFjgfXehOFH11SH9dNwTkXIbsGzAeu64DRyJsDdpamM/BPOxlJj60S/R8vnUM8mjyM7B9a63NskFI6BCVIh5mxDE4cSMUgb4zFtwvDgTPxJSwXqKShtoY6ryB8n5UPNkG/Z5tjVuJ7/8RV7WrURM7PN7xLfp6pVEeipWyeFnVEK33G9JOuB6yH75jPO6vMCYRNi0p0pg6laasFDy3hmfuy2W/N0qtcJLVa5N0bUMFFuPQusyEeqsEZ/zx1Srlvsk7i0DF8pTyBcm3JTF5BOWm60wg3ntEOqfRuQqzFc5updILwLAIp39CwJG/fs5Mj3HCDcUKwYlK70fAARtJwFu7wI0vqW5bUSUvJkvm1JRPlyWJ8JNY4Oq1apYqhZS9bps5ofgiOYJbBhPEboEnVukoTkQiYjgbMtBwVGKGL2nNEd77osoEg1KXhEQS+0KD3PoUu/bZkGub6FNGE6iKeFPt9gDSs+S21s22rVSaZkgaoC6SkufPpN6aV78Jx69nMIDd4go4pj2IJX4kS1pD1NEOSWjN4bgVKAtV6/bxBvhNJwnqUE+mE8eAmULsezub4LMhPqA58y/ZlO44jt/qkAw9nuVDRPBve+TdJTotID5dIqJJd6/vkDoHTVaSrbkCBbdG6d9By8AEbKuVrQS/+VurUnYEd2TGahPbOyRdNlud8RB4+4af0ZRFmiKkr6ppa5IbHbTIZ2qtyeOSbIOkv8O7xK/GL6e6Iaaz0wDHaQZC4Ea8FczjpFOlQgixfYcYJBb/W2db+uRvZ3lftVyJ/d082CGbYplOa+aTxymVcQSjBRbXzs6GZ2ytDqRYcRe94F9x/XSVj7g+mih7VS+YH0eOEp0ViTuWP8B1dVnOV5yTkdMbr8n9Q82G4v5brtQdiMDMY3HS6mxPb1IiKiqFX6Jgju8sIMxkJFZQ3iIkAJuOqUYkG1ZW7s4uI6hT46bRqzYaQA18CFu56qaMblOBFuxlJIsYsnMePh2xAH89oay5Kc88xwT2T/4+dzYQ0CqhQ4MTBB7nXelav2rMCjaLQ/V/a5r1TnLr2n0GbvODQeNl97qzi5lDYKlnuF8nOfOqZNOsPSsrsk3UZJJYZwNxDZaweHIeeg5P2ZW5agswPx/U5DkU1MzE1VAQ+DQAenaE2SLo4dSPBHMmt2gLpgu0LaCuzTR2IL/EM+Tpdn/Pcv1E7lPJIycIIwO7QGJcVkwCx8CJ/WCo6xDMq+9zjSVbqAaL5MzySZCeFCMyZxvEk7qXig6rflB3K3Jay4qSFjBxBXhOEuT6zKXyhR41IXRtZRmtPkscypFEUXvR5nJV7AQUIbljGEcikOLmSiCEnl8dI2Ny9xCHLOro8UXqVUy8dHGmTRGTE/mS1JNZ3y4XaZSyHcABVWbZcR3KIXVxd6rtUA/pBvWpbq8nH3WWlJGqkoxUVEridtXqcBuzTKg3/i6vLs0/pHGwdM38XizKcIxykvJrur3vEQ==" + } + } + */ + + /* Uncomment and use when endpoint integration is finalized + return globalMethods.callHttpClient({ + method: endpoints.AddDonationPart.method, + endpoint: endpoints.AddDonationPart.url, + payload: { + donationAmount: donationAmount, + savedSessionId: "96b1a16e-410a-4d08-8421-fe36e82b2275", + paymentInfo: { + parentAccountNumber: submittedSessionData.parentAccountNumber, + billToAccountNumber: submittedSessionData.billToAccountNumber, + providerNumber: submittedSessionData.providerNumber, + carId: "CR00069266", + make: "Acura", + model: "MDX", + year: 2020, + eon: "S1820397", + zipCode: "43015", + state: "OH", + referralNumber: "1821895", + referralDate: "2025-03-20T16:27:38.93", + referralSequenceNumber: "1821895", + serviceZipCode: "43015", + isReplacement: true, + deductible: 0, + coverageStatus: null, + coverageSubStatus: null, + serverData: "ZtCNOF1tCLQBAx2NRKHE/n/fqD8zUxRfYtDuTu7uUiPpeg7i6TmwXwggssX5KsXVQbeft+PN+vXYfBFJytLVYgbafNDR0JH3izVTIOh7KGTeB6YaPuCJmodF4SfgVVDHD9LEmEH9wNzM9j3pFjgfXehOFH11SH9dNwTkXIbsGzAeu64DRyJsDdpamM/BPOxlJj60S/R8vnUM8mjyM7B9a63NskFI6BCVIh5mxDE4cSMUgb4zFtwvDgTPxJSwXqKShtoY6ryB8n5UPNkG/Z5tjVuJ7/8RV7WrURM7PN7xLfp6pVEeipWyeFnVEK33G9JOuB6yH75jPO6vMCYRNi0p0pg6laasFDy3hmfuy2W/N0qtcJLVa5N0bUMFFuPQusyEeqsEZ/zx1Srlvsk7i0DF8pTyBcm3JTF5BOWm60wg3ntEOqfRuQqzFc5updILwLAIp39CwJG/fs5Mj3HCDcUKwYlK70fAARtJwFu7wI0vqW5bUSUvJkvm1JRPlyWJ8JNY4Oq1apYqhZS9bps5ofgiOYJbBhPEboEnVukoTkQiYjgbMtBwVGKGL2nNEd77osoEg1KXhEQS+0KD3PoUu/bZkGub6FNGE6iKeFPt9gDSs+S21s22rVSaZkgaoC6SkufPpN6aV78Jx69nMIDd4go4pj2IJX4kS1pD1NEOSWjN4bgVKAtV6/bxBvhNJwnqUE+mE8eAmULsezub4LMhPqA58y/ZlO44jt/qkAw9nuVDRPBve+TdJTotID5dIqJJd6/vkDoHTVaSrbkCBbdG6d9By8AEbKuVrQS/+VurUnYEd2TGahPbOyRdNlud8RB4+4af0ZRFmiKkr6ppa5IbHbTIZ2qtyeOSbIOkv8O7xK/GL6e6Iaaz0wDHaQZC4Ea8FczjpFOlQgixfYcYJBb/W2db+uRvZ3lftVyJ/d082CGbYplOa+aTxymVcQSjBRbXzs6GZ2ytDqRYcRe94F9x/XSVj7g+mih7VS+YH0eOEp0ViTuWP8B1dVnOV5yTkdMbr8n9Q82G4v5brtQdiMDMY3HS6mxPb1IiKiqFX6Jgju8sIMxkJFZQ3iIkAJuOqUYkG1ZW7s4uI6hT46bRqzYaQA18CFu56qaMblOBFuxlJIsYsnMePh2xAH89oay5Kc88xwT2T/4+dzYQ0CqhQ4MTBB7nXelav2rMCjaLQ/V/a5r1TnLr2n0GbvODQeNl97qzi5lDYKlnuF8nOfOqZNOsPSsrsk3UZJJYZwNxDZaweHIeeg5P2ZW5agswPx/U5DkU1MzE1VAQ+DQAenaE2SLo4dSPBHMmt2gLpgu0LaCuzTR2IL/EM+Tpdn/Pcv1E7lPJIycIIwO7QGJcVkwCx8CJ/WCo6xDMq+9zjSVbqAaL5MzySZCeFCMyZxvEk7qXig6rflB3K3Jay4qSFjBxBXhOEuT6zKXyhR41IXRtZRmtPkscypFEUXvR5nJV7AQUIbljGEcikOLmSiCEnl8dI2Ny9xCHLOro8UXqVUy8dHGmTRGTE/mS1JNZ3y4XaZSyHcABVWbZcR3KIXVxd6rtUA/pBvWpbq8nH3WWlJGqkoxUVEridtXqcBuzTKg3/i6vLs0/pHGwdM38XizKcIxykvJrur3vEQ==" + } + }, + logApiCall: true, + pageNameToLog: pageNameToLog, + }); + */ + + /* Response contract + { + "wasSuccessful": true, + "wasLocked": true + } + */ + let result; + + + + switch (donationAmount) { + case 1: + result = { wasSuccessful: true, wasLocked: false }; + break; + case 3: + result = { wasSuccessful: false, wasLocked: true }; + break; + case 5: + result = { wasSuccessful: false, wasLocked: false }; + break; + default: + result = { wasSuccessful: null, wasLocked: null }; // Default case if amount doesn't match + } + + return result; + }, getPartFromCapabilityQuestionAnswer(context, { payload, pageNameToLog }) { const glassLocation = payload; From 35c67cb0871905a9173a01509c28b433c4b05bb8 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Mon, 31 Mar 2025 13:26:23 -0400 Subject: [PATCH 05/14] CASH-442 test --- src/fmg-components/funnel-header/menu-modal/menu-modal.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue index ef749a55d..8e5c21708 100644 --- a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue +++ b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue @@ -57,6 +57,7 @@ alt="Your privacy choices" />
+ Cookie preferences Date: Mon, 31 Mar 2025 13:36:24 -0400 Subject: [PATCH 06/14] Formatting --- src/store/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 13c12cd94..317eab88c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1967,8 +1967,6 @@ export const actions = { */ let result; - - switch (donationAmount) { case 1: result = { wasSuccessful: true, wasLocked: false }; From 1f1890566ac0df11127e1dd64d8d88983caeb6d9 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Mon, 31 Mar 2025 14:08:01 -0400 Subject: [PATCH 07/14] Format code. --- src/fmg-components/funnel-header/menu-modal/menu-modal.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue index 8e5c21708..9b5ebb536 100644 --- a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue +++ b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue @@ -57,7 +57,9 @@ alt="Your privacy choices" /> - Cookie preferences + + Cookie preferences + Date: Mon, 31 Mar 2025 14:50:53 -0400 Subject: [PATCH 08/14] CASH-442 update cookie link. Test. --- .../funnel-header/menu-modal/menu-modal.vue | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue index 9b5ebb536..9c77cec35 100644 --- a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue +++ b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue @@ -56,26 +56,22 @@ src="~@/assets/img/icons/ccpa-icon.svg" alt="Your privacy choices" /> - - - Cookie preferences - - - - - + + + + + @@ -181,6 +177,9 @@ export default { height: 1rem; margin-left: 0.5rem; } + :deep(.navigation-link) { + margin-bottom: 1.5rem; + } } .modal-fullscreen { width: 100vw; From ed00b2fc60e1f503f127752133698943462f8bf3 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Mon, 31 Mar 2025 14:52:23 -0400 Subject: [PATCH 09/14] Format code. --- .../funnel-header/menu-modal/menu-modal.vue | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue index 9c77cec35..4dc07f3a5 100644 --- a/src/fmg-components/funnel-header/menu-modal/menu-modal.vue +++ b/src/fmg-components/funnel-header/menu-modal/menu-modal.vue @@ -56,22 +56,22 @@ src="~@/assets/img/icons/ccpa-icon.svg" alt="Your privacy choices" /> - - - - - + + + + + From 2e3af146e6506bad8fd55327eb079ec89d69eb60 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Mon, 31 Mar 2025 15:32:02 -0400 Subject: [PATCH 10/14] Add page-skipping logic to quote --- src/constants/experiments.js | 2 + src/constants/package-names.js | 6 ++ src/helpers/service-package-helper.js | 8 +- src/layouts/quote/quote.vue | 84 ++++++++++++++++--- .../service-package-question.vue | 5 ++ 5 files changed, 88 insertions(+), 17 deletions(-) diff --git a/src/constants/experiments.js b/src/constants/experiments.js index 09dfc4140..d64849466 100644 --- a/src/constants/experiments.js +++ b/src/constants/experiments.js @@ -2,6 +2,7 @@ const experimentUniverses = { CONCEPT_FUNNEL: "ConceptFunnel", RECAL_PRICE_REMOVAL: "NextGen_RecalPriceRemoval", MSR: "MSR", + IGQ_SkipQuote: "NextGen_IGQSkipToInsurance", }; const experimentSettings = { @@ -22,6 +23,7 @@ const experimentSettings = { WAITLIST_THRESHOLD_DAYS: "Waitlist_Threshold_Days", PRICING_BY_DAY: "DisplayPricingByDay", FOSTER_LOVE: "DisplayFosterLove", + SKIP_TO_INSURANCE: "SkipToInsurance", }; const experimentTriggers = { diff --git a/src/constants/package-names.js b/src/constants/package-names.js index 221a75a49..0115daa61 100644 --- a/src/constants/package-names.js +++ b/src/constants/package-names.js @@ -3,3 +3,9 @@ export const packageNames = { TIER_TWO: "TierTwo", TIER_THREE: "TierThree", }; + +export const externalParamPackageLabels = { + GLASS_ONLY: "glassonly", + STANDARD: "standard", + PREMIUM: "premium", +}; diff --git a/src/helpers/service-package-helper.js b/src/helpers/service-package-helper.js index fcbe4aee3..6e0a6743a 100644 --- a/src/helpers/service-package-helper.js +++ b/src/helpers/service-package-helper.js @@ -1,6 +1,6 @@ import { partTypeStrings } from "@/constants/part-type-strings"; import { damageLocationsSelected as glassLocations } from "@/constants/damage-locations-selected"; -import { packageNames } from "@/constants/package-names"; +import { packageNames, externalParamPackageLabels } from "@/constants/package-names"; import baseMixin from "@/mixins/base-mixin.js"; import { getItemsWithoutRecalParts } from "@/helpers/recal-helper"; import { @@ -238,9 +238,9 @@ export function getHighestFullySatisfiedTier(glassToReplace, availableLineItems, export function getPackageNameByType(packageType) { const package_names = { - glassonly: packageNames.TIER_ONE, - standard: packageNames.TIER_TWO, - premium: packageNames.TIER_THREE, + [externalParamPackageLabels.GLASS_ONLY]: packageNames.TIER_ONE, + [externalParamPackageLabels.STANDARD]: packageNames.TIER_TWO, + [externalParamPackageLabels.PREMIUM]: packageNames.TIER_THREE, }; return package_names[packageType] || null; } diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 615662013..0ff86494d 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -134,7 +134,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 { experimentSettings } from "@/constants/experiments"; +import { experimentSettings, experimentUniverses } from "@/constants/experiments"; import { required } from "@/helpers/validation-rules"; import { errorMessages } from "@/constants/error-messages"; import { Form, defineRule } from "vee-validate"; @@ -154,12 +154,18 @@ import { findLineItemsWithPartType, } from "@/helpers/service-package-helper"; import { nextTick } from "vue"; -import { packageNames } from "@/constants/package-names"; +import { packageNames, externalParamPackageLabels } from "@/constants/package-names"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import { containsRecalParts } from "@/helpers/recal-helper"; import { externalParameterStatus } from "@/constants/external-parameters"; import { saveQuote } from "@/helpers/heritage-integration/order-helper.js"; import { getBoolFromString } from "@/helpers/boolean-helper"; +import { + getSessionKeyValue, + getUserIdValue, + getDeviceIdValue, +} from "@/helpers/heritage-integration/cookie-helper"; +import { showFmgLoadingModal } from "@/helpers/loading-modal-helper"; defineRule("option-required", required(errorMessages.OPTION_REQUIRED)); @@ -189,6 +195,31 @@ export default { "quote" ); + const shouldExposeSkipQuote = store.getters.isRecalibrationOnOrder; + const skipQuoteExperiment = store.getters.applicationUser.experiments.find( + (e) => e.universeName === experimentUniverses.IGQ_SkipQuote + ); + const hasExposedSkipQuote = skipQuoteExperiment?.isExposed; + + const shouldSendExposeRequest = + shouldExposeSkipQuote && !hasExposedSkipQuote && skipQuoteExperiment; + + if (shouldSendExposeRequest) { + // Don't await -- response is not needed so can fire fully asynchronously. + baseMixin.methods.dispatchStoreActionWithLogging( + storeActions.LOG_EXPERIMENT_EXPOSURE_AND_UPDATE_STORE, + { + userId: getUserIdValue(), + deviceId: getDeviceIdValue(), + sessionKey: getSessionKeyValue(), + pageName: to.query.fmgPage, + experiment: skipQuoteExperiment, + }, + "quote", + false + ); + } + const promiseResultMap = [ { resultKey: "cmsContent", @@ -213,6 +244,12 @@ export default { const isEmailInStoreOnPageLoad = emailFromStore?.length > 0; const showSaveProgressPopup = isEmailInStoreOnPageLoad ? false : true; const showSaveProgressModal = isEmailInStoreOnPageLoad ? false : true; + const shouldSkipToInsurance = + getBoolFromString( + experimentMixin.methods.getSettingValue(experimentSettings.SKIP_TO_INSURANCE) + ) && + shouldExposeSkipQuote && + !hasExposedSkipQuote; const lineItems = deepClone(store.getters.order.lineItems); lineItems.vaps = lineItems.vaps ?? []; @@ -302,6 +339,7 @@ export default { vm.availableLineItems = pricingResults; vm.holdParentAccountNumber = holdParentAccountNumber; vm.holdBillToAccountNumber = holdBillToAccountNumber; + vm.skipToInsurance = shouldSkipToInsurance; if (revalidatePromoResponse) { const revalidateAlerts = buildToastMessagesFromRevalidateOrValidatePromoResponse( @@ -434,21 +472,16 @@ export default { } } - // did user intentionally select insurance? - vm.isInsuranceSelected = true; - vm.servicePackage = store.getters.externalParameterQuote.servicePackage; - await nextTick(); + const insuranceSelection = true; + const servicePackage = store.getters.externalParameterQuote.servicePackage; if ( - vm.servicePackage != null && + servicePackage != null && isExternalParameter === externalParameterStatus.ACTIVE ) { - const isValid = await baseMixin.methods.isFormValid(vm.$refs.theForm); - if (isValid) { - baseMixin.methods.ResetExternalParamsAndHideModal(); - vm.forwardButtonAction(); - } + await vm.skip(insuranceSelection, servicePackage); } + baseMixin.methods.ResetExternalParamsAndHideModal(); } else { if (externalThreshold) thresholdToUse = externalThreshold; @@ -467,6 +500,11 @@ export default { baseMixin.methods.ResetExternalParamsAndHideModal(); } } + + if (vm.skipToInsurance && !vm.showSaveProgressPopup) { + // skip ahead only if no email popup. + await vm.skip(true, externalParamPackageLabels.GLASS_ONLY); + } }); }, data() { @@ -482,6 +520,7 @@ export default { showSaveProgressModal: null, isSaveProgressComplete: null, packageNumber: null, + skipToInsurance: null, }; }, mounted() { @@ -584,8 +623,13 @@ export default { updateSaveProgressAsSaved() { this.showSaveProgressModal = false; }, - closeSaveProgressPopup() { + async closeSaveProgressPopup() { this.showSaveProgressPopup = false; + + if (this.skipToInsurance) { + // skip ahead now if in IGQ skip experiment + await this.skip(true, externalParamPackageLabels.GLASS_ONLY); + } }, forwardButtonAction() { this.dispatchStoreAction( @@ -729,6 +773,20 @@ export default { this.pushEventToGA("quote", this.GaActions.SERVICE_PACKAGE_PRICE, eventLabel, true); }); }, + async skip(insuranceSelection, packageSelection) { + this.isInsuranceSelected = insuranceSelection; + this.servicePackage = packageSelection; + + // Allow selections to filter through sub-logic + await nextTick(); + await nextTick(); + + const isValid = await baseMixin.methods.isFormValid(this.$refs.theForm); + if (isValid) { + showFmgLoadingModal(true); + await this.forwardButtonAction(); + } + }, }, watch: { lineItemsCloneForWatcher: { diff --git a/src/layouts/quote/service-package-question/service-package-question.vue b/src/layouts/quote/service-package-question/service-package-question.vue index ab4772107..68f031768 100644 --- a/src/layouts/quote/service-package-question/service-package-question.vue +++ b/src/layouts/quote/service-package-question/service-package-question.vue @@ -102,6 +102,11 @@ export default { this.$emit("servicePackageDiscountSelected", supportingItems); }, + servicePackage(newValue) { + if (newValue !== null) { + this.selectDefaultPackage(); + } + }, }, computed: { nullSafeAvailableLineItems() { From 8f0c5ada0433551924006466ab407ffa1f49aeab Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Mon, 31 Mar 2025 15:32:24 -0400 Subject: [PATCH 11/14] Loading modal refactor --- src/mixins/base-mixin.js | 6 ++++++ src/router/index.js | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index 6fd6075ab..151d17dd9 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -230,6 +230,12 @@ export default { return "widget-name-" + this.cmsWidgetName; }, }, + + mounted() { + if (!store.getters.externalParameterState?.isExternalParameter) { + showFmgLoadingModal(false); + } + }, }; function encodeUriData(payload) { diff --git a/src/router/index.js b/src/router/index.js index 2230a652d..345790734 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -433,9 +433,6 @@ router.afterEach(async (to, from) => { await saveSession({ pageNameToLog: to.query.fmgPage }); } } - if (!store.getters.externalParameterState?.isExternalParameter) { - showFmgLoadingModal(false); - } // Push page view to GA analyticsMixin.methods.pushPageViewToGA(); From 6e0f9d8a20b986a94f4d84b9799dc53ea83b0615 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Mon, 31 Mar 2025 15:38:03 -0400 Subject: [PATCH 12/14] Unit test quirk --- src/layouts/quote/quote.spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layouts/quote/quote.spec.js b/src/layouts/quote/quote.spec.js index a87d6b0a6..49b90cfb3 100644 --- a/src/layouts/quote/quote.spec.js +++ b/src/layouts/quote/quote.spec.js @@ -836,6 +836,7 @@ describe("quote.vue", () => { nextFunction ); await nextTick(); + await nextTick(); expect(nextFunction).toHaveBeenCalled(); expect(baseMixin.methods.isFormValid).toHaveBeenCalled(); expect(baseMixin.methods.isFormValid()).toBe(true); From 383eb001df9dc30bdf8de9f365b2e2ea6795c7c0 Mon Sep 17 00:00:00 2001 From: Johnny shultz Date: Tue, 1 Apr 2025 10:21:21 -0400 Subject: [PATCH 13/14] CASH-133 CASH-133 successfully added a donation to cart on confirmation using mock api call --- src/constants/cart-item-types.js | 1 + src/constants/part-type-strings.js | 1 + src/fmg-components/cart/cart.vue | 46 ++++++++++++++++++++++- src/layouts/confirmation/confirmation.vue | 7 +++- src/store/index.js | 10 ++--- 5 files changed, 57 insertions(+), 8 deletions(-) diff --git a/src/constants/cart-item-types.js b/src/constants/cart-item-types.js index d8ab9f66f..2f84d22c2 100644 --- a/src/constants/cart-item-types.js +++ b/src/constants/cart-item-types.js @@ -11,6 +11,7 @@ const cartItemTypes = { EARLY_BIRD: "EARLY BIRD", SUPPLIES_REPAIR: "SUPPLIES-REPAIR", SERVICE_PACKAGE_DISCOUNT: "SERVICE PACKAGE DISCOUNT", + DONATION: "DONATION", }; export { cartItemTypes }; diff --git a/src/constants/part-type-strings.js b/src/constants/part-type-strings.js index 4681e2776..94e8598bd 100644 --- a/src/constants/part-type-strings.js +++ b/src/constants/part-type-strings.js @@ -10,6 +10,7 @@ const partTypeStrings = { REPAIR_FEE: "REPAIR FEE", EARLY_BIRD: "EARLY BIRD", SERVICE_PACKAGE_DISCOUNT: "SERVICE PACKAGE DISCOUNT", + DONATION: "DONATION", }; export { partTypeStrings }; diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index f569c11d4..e5d0a8645 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -207,6 +207,7 @@ export default { isNoComp: Boolean, isExpandedOnLoad: Boolean, isMSRFeeApplicable: Boolean, + donationAmount: Number, }, data() { return { @@ -403,7 +404,9 @@ export default { } return [ ...(this.lineItems.glassParts ?? []), - ...(this.lineItems.supportingItems ?? []), + ...(this.lineItems.supportingItems.filter( + (item) => item.partType !== partTypeStrings.DONATION + ) ?? []), ...(this.availableVaps ?? []), ]; }, @@ -466,6 +469,10 @@ export default { }); } + if (this.donationCartItem) { + cartItems.push(this.donationCartItem); + } + return cartItems; }, }, @@ -1064,6 +1071,43 @@ export default { return promoCartItems; }, + showDonationCartItem() { + if (this.donationAmount !== 0) { + return true; + } else { + return false; + } + }, + donationCartItemName() { + return this.getCmsContent("DonationCartTextWidget", "Text"); + }, + donationCartItem() { + if (!this.lineItems || !this.lineItems.supportingItems) { + return null; + } + + const donationLineItem = this.lineItems.supportingItems.find( + (item) => item.partType === partTypeStrings.DONATION + ); + + if (donationLineItem && donationLineItem.sellingPrice > 0) { + return { + name: this.donationCartItemName, + category: cartItemCategories.SUPPORTING_ITEMS, + cartItemType: cartItemTypes.DONATION, + isDisplayed: true, + isRemovable: false, + subTotal: donationLineItem.sellingPrice, + salesTax: 0, + lineItems: [], + isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( + cartItemTypes.DONATION + ), + }; + } + + return null; + }, removeLinkText() { return this.getCmsContent("RemoveCartItemTextWidget", "Text"); }, diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index f6810f726..12415226b 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -63,7 +63,9 @@ :isExpandedOnLoad="false" :isItac="isItac" :isNoComp="isNoComp" - :isMSRFeeApplicable="isMSRFeeApplicable" /> + :isMSRFeeApplicable="isMSRFeeApplicable" + :donationAmount="donationAmount" + @update-donation-amount="updateDonationAmount" />
Date: Tue, 1 Apr 2025 11:39:18 -0400 Subject: [PATCH 14/14] CASH-133 CASH-133 cart cleanup --- src/fmg-components/cart/cart.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index e5d0a8645..1cc1bb484 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -207,7 +207,6 @@ export default { isNoComp: Boolean, isExpandedOnLoad: Boolean, isMSRFeeApplicable: Boolean, - donationAmount: Number, }, data() { return { @@ -1072,7 +1071,10 @@ export default { return promoCartItems; }, showDonationCartItem() { - if (this.donationAmount !== 0) { + const donationLineItem = this.lineItems.supportingItems.find( + (item) => item.partType === partTypeStrings.DONATION + ); + if (donationLineItem?.sellingPrice !== 0) { return true; } else { return false; @@ -1090,7 +1092,7 @@ export default { (item) => item.partType === partTypeStrings.DONATION ); - if (donationLineItem && donationLineItem.sellingPrice > 0) { + if (donationLineItem?.sellingPrice > 0) { return { name: this.donationCartItemName, category: cartItemCategories.SUPPORTING_ITEMS,