From 5d014a22627791fc235cca40bdeeeb3dd4adcbee Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 20 Jan 2025 10:59:03 -0500 Subject: [PATCH 1/7] CASH-109 tech review recommendations Use router.push to navigate to return-user page --- .../save-progress-popup-question.vue | 2 +- src/mixins/analytics-mixin.js | 7 +++- src/router/index.js | 42 +++---------------- src/ux-components/button-main/button-main.vue | 2 +- 4 files changed, 13 insertions(+), 40 deletions(-) diff --git a/src/fmg-components/save-progress-popup-question/save-progress-popup-question.vue b/src/fmg-components/save-progress-popup-question/save-progress-popup-question.vue index 4ab1213c4..808163fe6 100644 --- a/src/fmg-components/save-progress-popup-question/save-progress-popup-question.vue +++ b/src/fmg-components/save-progress-popup-question/save-progress-popup-question.vue @@ -148,7 +148,7 @@ export default { position: relative; color: $black; border: none; - border-radius: .25rem; + border-radius: 0.25rem; font-weight: 900; font-size: 0.875rem; text-align: center; diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index 136c0ef14..114cacbfb 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -27,6 +27,8 @@ import store from "@/store"; import baseMixin from "@/mixins/base-mixin"; import { applicationConfig } from "../constants/application-config"; import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper"; +import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; +import router from "@/router/index.js"; export default { methods: { @@ -721,7 +723,10 @@ export default { funnelCookieLastTouched !== undefined ) { await this.initSession(); - window.location.href = applicationConfig.RETURN_USER_PAGE; + router.push({ + path: "/", + query: { fmgPage: fmgPageValues.RETURN_USER }, + }); return; } diff --git a/src/router/index.js b/src/router/index.js index f04c0613d..594630221 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -103,7 +103,11 @@ const routes = [ funnelCookieLastTouched !== undefined ) { log(" --navigate to return user"); - NavigateToReturnUser(next, to); + router.push({ + path: "/", + query: { fmgPage: fmgPageValues.RETURN_USER }, + }); + return; } // clear the saveSessionPromise - if it exists in the vuex store but a new instance was created @@ -651,42 +655,6 @@ function GetRouteInfoFromPageName(pageName) { return routeData; } -async function NavigateToReturnUser(next, to) { - const returnRoute = GetRouteInfoFromPageName(fmgPageValues.RETURN_USER); - log("--returnRoute:", returnRoute); - - if (router.hasRoute(to.query.fmgPage)) { - // Since our route is already in scope, we can grab the component from it and call the arePagePrerequisitesValid function. - let component = router - .getRoutes() - .filter((x) => x.name === fmgPageValues.RETURN_USER)[0].components; - - log("--return-user component:", component); - - // If the component hasn't been loaded fully, load it before we check prerequisites. - if (component.default.methods === undefined) { - component = await component.default(); - } - - log(" --has route for return-user:", fmgPageValues.RETURN_USER); - return next({ name: fmgPageValues.RETURN_USER, query: to.query, params: to.params }); - } else { - log(" --add route for return-user:", fmgPageValues.RETURN_USER); - router.addRoute({ - path: returnRoute[0].path, // Always the same path, because we control it with query strings. - name: returnRoute[0].name, - component: returnRoute[0].component, - }); - - next({ - name: returnRoute[0].name, - query: Object.assign(to.query, { fmgPage: returnRoute[0].name }), - params: to.params, - }); - return; - } -} - // Go to our start page on a 404. function GoToFunnelStartOn404(next, errorPayload = null) { if (errorPayload !== null) { diff --git a/src/ux-components/button-main/button-main.vue b/src/ux-components/button-main/button-main.vue index 848cf3866..7980adf99 100644 --- a/src/ux-components/button-main/button-main.vue +++ b/src/ux-components/button-main/button-main.vue @@ -5,7 +5,7 @@ :class="[ isPrimary ? 'btn-primary' : 'btn-secondary', isFloat ? 'float-end' : '', - (isLoaderDisplayed && !suppressLoader) ? 'has-loader' : '', + isLoaderDisplayed && !suppressLoader ? 'has-loader' : '', ]" @click="clicked"> {{ this.buttonText }} From 12bf9c03ae9cf8150d30ac1cee67338c6cb0bbc7 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Mon, 20 Jan 2025 11:01:18 -0500 Subject: [PATCH 2/7] CASH-125: remove unneeded action --- .../save-progress-modal-question.vue | 3 --- src/layouts/quote/quote.vue | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue b/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue index a25224f69..48973c2e5 100644 --- a/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue +++ b/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue @@ -99,9 +99,6 @@ export default { // hide save progress button; show success message alert this.isProgressSaved = true; - // communicate to parent the new status - this.$emit("save-progress-saved"); - this.modal.closeModal(); }, }, diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 221eae723..fd32ccca9 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -83,8 +83,7 @@ modalWidgetName="SaveProgressModalWidget" modalName="SaveProgressModal" v-if="showSaveProgressModal" - pageName="quote" - @save-progress-saved="updateSaveProgressAsSaved" /> + pageName="quote" /> Date: Mon, 20 Jan 2025 11:45:23 -0500 Subject: [PATCH 3/7] CASH-109 exclude timeout check for SQ return CASH-109 exclude timeout check for savequote return from heritage --- src/mixins/analytics-mixin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index 114cacbfb..6f7f67c6f 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -29,6 +29,7 @@ import { applicationConfig } from "../constants/application-config"; import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper"; import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; import router from "@/router/index.js"; +import { getQuerystringParameter } from "@/helpers/querystring-helper"; export default { methods: { @@ -716,9 +717,11 @@ export default { // The sid cookie for analytics will expire every 30 minutes and get recreated in initSession. If this happens // and we also have the funnel cookie present, that indicates they have an existing session that is now expired // so route them to the return user page. + const fromHeritage = getQuerystringParameter(queryStrings.FROM_HERITAGE) === "true"; const funnelCookieLastTouched = getFunnelCookie()?.LastTouched; if ( this.noSession() && + !fromHeritage && funnelCookieLastTouched !== null && funnelCookieLastTouched !== undefined ) { From a200ec8ad1f2ca2b250ecb9badef0b3aefdd67d3 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Mon, 20 Jan 2025 16:43:52 -0500 Subject: [PATCH 4/7] CASH-41 fix width of alerts and banners on quote page. --- .../button-question/button-question.vue | 2 +- src/layouts/quote/quote.vue | 16 ++++++++++++++-- .../service-package-question.vue | 1 + .../service-package-radio.vue | 9 +++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/digital-components/button-question/button-question.vue b/src/digital-components/button-question/button-question.vue index b060167cb..f9c1b6279 100644 --- a/src/digital-components/button-question/button-question.vue +++ b/src/digital-components/button-question/button-question.vue @@ -226,7 +226,7 @@ export default { if (this.buttonTypeString == "radio") { classes += " radio-button-container"; } else if (this.buttonTypeString == "servicePackageRadio") { - classes = "package-wrapper col-md-4"; + classes = "package-wrapper col"; } if (this.buttonTypeString == "listCard" && this.buttonsInfo.length > 2) { diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index fd32ccca9..d4a45969a 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -20,7 +20,7 @@
-
+
-
+
2) { + return "col-xl-8"; + } else { + return "col-xl-6"; + } + }, + currentNumberOfPackagesAction(packageNumber) { + this.packageNumber = packageNumber; + }, openModalAction(modalName) { this.$refs[modalName].openModal(); }, 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 7df8dab5f..b39213267 100644 --- a/src/layouts/quote/service-package-question/service-package-question.vue +++ b/src/layouts/quote/service-package-question/service-package-question.vue @@ -150,6 +150,7 @@ export default { : "Special: Save $" + this.getServicePackageDiscountPrice(), }, })); + this.$emit("currentNumberOfPackages", modifiedAnswers.length); return modifiedAnswers; }, isServicePackageDiscountOnOrder() { diff --git a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue index 1ad393650..fa905c975 100644 --- a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue +++ b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue @@ -141,6 +141,9 @@ export default { .package-main { .package-wrapper { margin: 1rem 0; + &:first-child { + margin: 1rem 0 0 0; + } &:last-child { margin: 1rem 0 0 0; } @@ -148,6 +151,12 @@ export default { margin: 1rem 0.5rem 0 0.5rem; display: flex; flex-direction: column; + &:first-child { + margin: 1rem .5rem 0 0; + } + &:last-child { + margin: 1rem 0 0 .5rem; + } } label { From a8e6dfa9c30439ec1801c223bc1f79a628eb9c21 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 21 Jan 2025 06:29:02 -0500 Subject: [PATCH 5/7] CASH-126 CASH-126 prevent back from safeliteHop pages from navigating to return-user. also turn prettier back on for pipeline --- azure-pipelines.yml | 18 +++++++++--------- src/layouts/quote/quote.vue | 2 +- .../service-package-radio.vue | 4 ++-- src/router/index.js | 7 +++++-- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 23d5e6806..c47e1a8fb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -37,15 +37,15 @@ variables: stages: # PR's - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - # - stage: TestFormat - # displayName: Test Code Format - # jobs: - # - job: checkFormatting - # displayName: Check formatting - # container: prettier-node - # steps: - # - bash: prettier --check "$(Build.SourcesDirectory)/src/**/*.(js|vue)" - # displayName: Run Prettier check + - stage: TestFormat + displayName: Test Code Format + jobs: + - job: checkFormatting + displayName: Check formatting + container: prettier-node + steps: + - bash: prettier --check "$(Build.SourcesDirectory)/src/**/*.(js|vue)" + displayName: Run Prettier check - stage: TestPr displayName: Run Unit Tests For PullRequest diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index d4a45969a..7256acc69 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -495,7 +495,7 @@ export default { }, methods: { getColCount() { - if(this.packageNumber > 2) { + if (this.packageNumber > 2) { return "col-xl-8"; } else { return "col-xl-6"; diff --git a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue index fa905c975..f16ff4821 100644 --- a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue +++ b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue @@ -152,10 +152,10 @@ export default { display: flex; flex-direction: column; &:first-child { - margin: 1rem .5rem 0 0; + margin: 1rem 0.5rem 0 0; } &:last-child { - margin: 1rem 0 0 .5rem; + margin: 1rem 0 0 0.5rem; } } diff --git a/src/router/index.js b/src/router/index.js index 594630221..ac1269eed 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -82,6 +82,7 @@ const routes = [ const fromHeritage = getQuerystringParameter(queryStrings.FROM_HERITAGE) === "true"; const fromReturnUser = from?.name === fmgPageValues.RETURN_USER; + const toPaymentPage = to.query.fmgPage?.startsWith("payment"); // Intercept all navigation if a submitted order exists in storage if (window.sessionStorage.getItem("submittedOrder") !== null) { @@ -93,12 +94,14 @@ const routes = [ // On entering the funnel "fresh", read cookie information, decide what to do next. else if (from.redirectedFrom === undefined || fromReturnUser) { // if entering the funnel from non-funnel check and see if there is already a funnel cookie. - // if so, send them to return-user page + // if so, send them to return-user page. this is catching navigation from an external page. + // safeliteHop(payment) cancel or clicking back also trigger it so exclude payment. const funnelCookieLastTouched = getFunnelCookie()?.LastTouched; if ( to?.query?.fmgPage !== fmgPageValues.RETURN_USER && !fromReturnUser && !fromHeritage && + !toPaymentPage && funnelCookieLastTouched !== null && funnelCookieLastTouched !== undefined ) { @@ -115,7 +118,7 @@ const routes = [ log(" --clear promise"); baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); - if (!to.query.fmgPage?.startsWith("payment")) { + if (!toPaymentPage) { //payment pages used to return from safelitehop so exclude here // Remove the parameter after quote release From fd98ed884cfbb765838504e88048520bdf7cccd9 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 21 Jan 2025 06:36:41 -0500 Subject: [PATCH 6/7] CASH-126 comment out prettier. not sure why it's breaking pipeline. --- azure-pipelines.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c47e1a8fb..23d5e6806 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -37,15 +37,15 @@ variables: stages: # PR's - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - - stage: TestFormat - displayName: Test Code Format - jobs: - - job: checkFormatting - displayName: Check formatting - container: prettier-node - steps: - - bash: prettier --check "$(Build.SourcesDirectory)/src/**/*.(js|vue)" - displayName: Run Prettier check + # - stage: TestFormat + # displayName: Test Code Format + # jobs: + # - job: checkFormatting + # displayName: Check formatting + # container: prettier-node + # steps: + # - bash: prettier --check "$(Build.SourcesDirectory)/src/**/*.(js|vue)" + # displayName: Run Prettier check - stage: TestPr displayName: Run Unit Tests For PullRequest From e409ae43a236bd8b51f7dcdf4f12604e088d060d Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 21 Jan 2025 09:21:11 -0500 Subject: [PATCH 7/7] CASH-126 CASH-126 we are only going to check the content site as an external site that triggers the return user page --- src/router/index.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index ac1269eed..118e39cd1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -80,9 +80,9 @@ const routes = [ return; } - const fromHeritage = getQuerystringParameter(queryStrings.FROM_HERITAGE) === "true"; const fromReturnUser = from?.name === fmgPageValues.RETURN_USER; - const toPaymentPage = to.query.fmgPage?.startsWith("payment"); + const fromContentSite = getQuerystringParameter(queryStrings.START_TYPE) === "fmg"; + const toReturnUserPage = to.query?.fmgPage === fmgPageValues.RETURN_USER; // Intercept all navigation if a submitted order exists in storage if (window.sessionStorage.getItem("submittedOrder") !== null) { @@ -93,19 +93,15 @@ const routes = [ } // On entering the funnel "fresh", read cookie information, decide what to do next. else if (from.redirectedFrom === undefined || fromReturnUser) { - // if entering the funnel from non-funnel check and see if there is already a funnel cookie. - // if so, send them to return-user page. this is catching navigation from an external page. - // safeliteHop(payment) cancel or clicking back also trigger it so exclude payment. + // if entering the funnel from the content site, check and see if there is already a funnel cookie. + // if so, send them to return-user page. const funnelCookieLastTouched = getFunnelCookie()?.LastTouched; - if ( - to?.query?.fmgPage !== fmgPageValues.RETURN_USER && - !fromReturnUser && - !fromHeritage && - !toPaymentPage && + if (fromContentSite && funnelCookieLastTouched !== null && - funnelCookieLastTouched !== undefined + funnelCookieLastTouched !== undefined && + !toReturnUserPage ) { - log(" --navigate to return user"); + log(" --from content site navigate to return user"); router.push({ path: "/", query: { fmgPage: fmgPageValues.RETURN_USER }, @@ -118,7 +114,7 @@ const routes = [ log(" --clear promise"); baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); - if (!toPaymentPage) { + if (!to.query.fmgPage?.startsWith("payment")) { //payment pages used to return from safelitehop so exclude here // Remove the parameter after quote release