From f0cfe5c0de373d6703043da9a77d4634f7410e7f Mon Sep 17 00:00:00 2001 From: Johnny shultz Date: Thu, 10 Apr 2025 10:18:52 -0400 Subject: [PATCH 1/2] CASH-489 CASH-489 fixed email modal popping up when user has clicked skip and navigates back to quote page --- src/layouts/quote/quote.vue | 14 +++++++++++++- src/store/index.js | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 0ff86494d..6d4d07e46 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -166,6 +166,7 @@ import { getDeviceIdValue, } from "@/helpers/heritage-integration/cookie-helper"; import { showFmgLoadingModal } from "@/helpers/loading-modal-helper"; +import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; defineRule("option-required", required(errorMessages.OPTION_REQUIRED)); @@ -242,7 +243,9 @@ export default { const resultMap = await settleAllPromises(promiseResultMap); const emailFromStore = store.getters.order.customer.emailAddress; const isEmailInStoreOnPageLoad = emailFromStore?.length > 0; - const showSaveProgressPopup = isEmailInStoreOnPageLoad ? false : true; + const isPopupSkipped = + store.getters.pageData(fmgPageValues.QUOTE).saveProgressPopupSkipped === true; + const showSaveProgressPopup = isEmailInStoreOnPageLoad || isPopupSkipped ? false : true; const showSaveProgressModal = isEmailInStoreOnPageLoad ? false : true; const shouldSkipToInsurance = getBoolFromString( @@ -626,6 +629,15 @@ export default { async closeSaveProgressPopup() { this.showSaveProgressPopup = false; + await this.dispatchStoreAction( + storeActions.SAVE_PAGE_DATA, + { + page: fmgPageValues.QUOTE, + data: { saveProgressPopupSkipped: true }, + }, + false + ); + if (this.skipToInsurance) { // skip ahead now if in IGQ skip experiment await this.skip(true, externalParamPackageLabels.GLASS_ONLY); diff --git a/src/store/index.js b/src/store/index.js index 032660c6f..e67db8f1e 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -3202,8 +3202,8 @@ export const actions = { context.commit(storeMutations.UPDATE_CUSTOMER_WAITLIST_REQUESTED, waitListRequested); }, - savePageData(context, emailOrSms) { - context.commit(storeMutations.UPDATE_PAGE_DATA, emailOrSms); + savePageData(context, pageData) { + context.commit(storeMutations.UPDATE_PAGE_DATA, pageData); }, saveVin(context, { isSelectedGlassAvailableForVehicle, vehicleInfo }) { From d1c8232b8958ec2568baac8d7b686ed8915fa4cd Mon Sep 17 00:00:00 2001 From: Johnny shultz Date: Thu, 10 Apr 2025 13:12:24 -0400 Subject: [PATCH 2/2] CASH-489 CASH-489 fixed unit tests --- src/layouts/quote/quote.spec.js | 66 +++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/layouts/quote/quote.spec.js b/src/layouts/quote/quote.spec.js index 49b90cfb3..9602780db 100644 --- a/src/layouts/quote/quote.spec.js +++ b/src/layouts/quote/quote.spec.js @@ -264,6 +264,12 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + pageData: jest.fn((page) => { + if (page === "quote") { + return { saveProgressPopupSkipped: true }; + } + return {}; + }), applicationUser: { experiments: [], }, @@ -313,6 +319,12 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + pageData: jest.fn((page) => { + if (page === "quote") { + return { saveProgressPopupSkipped: true }; + } + return {}; + }), applicationUser: { experiments: [], }, @@ -360,6 +372,12 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + pageData: jest.fn((page) => { + if (page === "quote") { + return { saveProgressPopupSkipped: true }; + } + return {}; + }), applicationUser: { experiments: [], }, @@ -404,6 +422,12 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + pageData: jest.fn((page) => { + if (page === "quote") { + return { saveProgressPopupSkipped: true }; + } + return {}; + }), applicationUser: { experiments: [], }, @@ -449,6 +473,12 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + pageData: jest.fn((page) => { + if (page === "quote") { + return { saveProgressPopupSkipped: true }; + } + return {}; + }), applicationUser: { experiments: [], }, @@ -494,6 +524,12 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + pageData: jest.fn((page) => { + if (page === "quote") { + return { saveProgressPopupSkipped: true }; + } + return {}; + }), applicationUser: { experiments: [], }, @@ -540,6 +576,12 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + pageData: jest.fn((page) => { + if (page === "quote") { + return { saveProgressPopupSkipped: true }; + } + return {}; + }), applicationUser: { experiments: [], }, @@ -588,6 +630,12 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + pageData: jest.fn((page) => { + if (page === "quote") { + return { saveProgressPopupSkipped: true }; + } + return {}; + }), applicationUser: { experiments: [], }, @@ -634,6 +682,12 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + pageData: jest.fn((page) => { + if (page === "quote") { + return { saveProgressPopupSkipped: true }; + } + return {}; + }), applicationUser: { experiments: [], }, @@ -681,6 +735,12 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + pageData: jest.fn((page) => { + if (page === "quote") { + return { saveProgressPopupSkipped: true }; + } + return {}; + }), applicationUser: { experiments: [], }, @@ -780,6 +840,12 @@ describe("quote.vue", () => { lineItems: { glassParts: ["item", "item2"], }, + pageData: jest.fn((page) => { + if (page === "quote") { + return { saveProgressPopupSkipped: true }; + } + return {}; + }), applicationUser: { experiments: [], },