diff --git a/src/fmg-components/nav-bar/nav-bar.vue b/src/fmg-components/nav-bar/nav-bar.vue index 6f981f9e0..f23ecd244 100644 --- a/src/fmg-components/nav-bar/nav-bar.vue +++ b/src/fmg-components/nav-bar/nav-bar.vue @@ -97,16 +97,16 @@ export default { document.onkeydown = function (e) { return false; }; - // check session expired and initSession to recreate cookies - if (analyticsMixin.methods.sessionExpired()) { + // check session expired and initSession to recreate cookies + if (analyticsMixin.methods.sessionExpired()) { this.routeReturnUser(); } else { this.$emit("ForwardClicked"); } }, linkClick() { - // check session expired and initSession to recreate cookies - if (analyticsMixin.methods.sessionExpired()) { + // check session expired and initSession to recreate cookies + if (analyticsMixin.methods.sessionExpired()) { this.routeReturnUser(); } else { this.$emit("BackClicked"); diff --git a/src/helpers/querystring-helper.js b/src/helpers/querystring-helper.js index 38583b1ae..8c40c91b7 100644 --- a/src/helpers/querystring-helper.js +++ b/src/helpers/querystring-helper.js @@ -8,3 +8,17 @@ export function getQuerystringParameter(key) { return lowerCaseParams.get(key) ? lowerCaseParams.get(key) : null; } + +// if you add the fmgPage to the querystringobject before calling, then pass true for skipFmgPageName +export function buildQuerystringObject(qso, skipFmgPageName=false) { + const queryString = window.location.search; + const urlParams = new URLSearchParams(queryString); + + for (const [name, value] of urlParams) { + if (name.toLowerCase() === "fmgpage" && skipFmgPageName) { + continue; + } + qso[name] = value; + } + return qso; +} \ No newline at end of file diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index 84087cb6e..d88bd53e2 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -241,57 +241,46 @@ export default { this.displayMismatchStateAndZipAlert = false; }, async setMobileLocation() { - if ( - this.internalModel.addressQuestions.zipCode !== - this.modelValue.addressQuestions.zipCode - ) { - this.resetAlerts(); - // Validate the Zip Code - const zipCodeData = await this.getZipCodeData( - this.internalModel.addressQuestions.zipCode, + this.resetAlerts(); + // Validate the Zip Code + const zipCodeData = await this.getZipCodeData( + this.internalModel.addressQuestions.zipCode, + "service-location" + ); + + if (!zipCodeData.isValid) { + this.displayInvalidZipAlert = true; + this.resetModalButtonStyle(); + } else if (zipCodeData.state != this.internalModel.addressQuestions.state) { + this.displayMismatchStateAndZipAlert = true; + this.resetModalButtonStyle(); + } else { + // retrieve mobile fee part + const serviceZipCode = this.internalModel.addressQuestions.zipCode; + const mobileFeePart = await getPricedMobileFeePart( + serviceZipCode, "service-location" ); - if (!zipCodeData.isValid) { - this.displayInvalidZipAlert = true; - this.resetModalButtonStyle(); - } else if (zipCodeData.state != this.internalModel.addressQuestions.state) { - this.displayMismatchStateAndZipAlert = true; - this.resetModalButtonStyle(); - } else { - // retrieve mobile fee part - const serviceZipCode = this.internalModel.addressQuestions.zipCode; - const mobileFeePart = await getPricedMobileFeePart( - serviceZipCode, - "service-location" - ); + // retrieve serviceability details + const serviceabilityDetails = await getServiceabilityDetails( + serviceZipCode, + null, + "service-location" + ); - // retrieve serviceability details - const serviceabilityDetails = await getServiceabilityDetails( - serviceZipCode, - null, - "service-location" - ); + const billToAccountNumber = await getBillToAccountNumber( + this.internalModel.zipCodeCtu + ); - const billToAccountNumber = await getBillToAccountNumber( - this.internalModel.zipCodeCtu - ); + // update content related to service zip code + this.$emit("updated-mobile-fee-part", mobileFeePart); + this.$emit("updated-serviceability", serviceabilityDetails.data); + this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); + this.$emit("updated-mobile-ctu", zipCodeData.zipCodeCtu); + this.$emit("updated-bill-to-account-number", billToAccountNumber); - // update content related to service zip code - this.$emit("updated-mobile-fee-part", mobileFeePart); - this.$emit("updated-serviceability", serviceabilityDetails.data); - this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); - this.$emit("updated-mobile-ctu", zipCodeData.zipCodeCtu); - this.$emit("updated-bill-to-account-number", billToAccountNumber); - - // update the page level model - this.$emit("update:modelValue", this.internalModel); - - //Page advance to Schedule page - this.$emit("mobileLocationSelected"); - } - } else { - // Update the page level model + // update the page level model this.$emit("update:modelValue", this.internalModel); //Page advance to Schedule page diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index 43f66c376..832589043 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -97,7 +97,7 @@ export default { // turned off Save Your Progress for 1/23/25 release // to restore, uncomment line below // vm.showSaveProgressModal = !(emailFromStore?.length > 0); - + // Glass Part Question dynamic component Object.keys(vm.$refs) .filter((r) => r.includes(vm.RefPrefix) && vm.$refs[r][0] !== undefined) diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index 1c70722a1..9bb8f0cda 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -712,16 +712,10 @@ export default { return !areAllSessionCookiesSet(); }, - // sessionExpired is true when one of the analytics cookies(sid, dxdev) has expired but we still have the funnelSessionInfo cookie + // sessionExpired is true when one of the analytics cookies(sid, dxdev) has expired but we still have the vehicle year in vuex sessionExpired() { const fromHeritage = getQuerystringParameter(queryStrings.FROM_HERITAGE) === "true"; - const funnelCookieLastTouched = getFunnelCookie()?.LastTouched; - if ( - this.noSession() && - !fromHeritage && - funnelCookieLastTouched !== null && - funnelCookieLastTouched !== undefined - ) { + if (this.noSession() && !fromHeritage && store.getters.order.vehicle?.year > 0) { return true; } else { return false; diff --git a/src/router/index.js b/src/router/index.js index 52b9023b9..f1bca935d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -6,7 +6,7 @@ import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js" import { routingTable } from "@/router/router-constants/routing-table.js"; import { globalEvents, globalEventTypes } from "@/constants/events"; import { queryStrings } from "@/constants/query-strings"; -import { getQuerystringParameter } from "@/helpers/querystring-helper"; +import { getQuerystringParameter, buildQuerystringObject } from "@/helpers/querystring-helper"; import { getDeviceIdValue } from "@/helpers/heritage-integration/cookie-helper"; import { showFmgLoadingModal } from "@/helpers/loading-modal-helper"; import { fmgPageValues, funnelStartPageName } from "@/router/router-constants/fmgPage-values"; @@ -101,27 +101,24 @@ 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 the content site, check and see if there is already a funnel cookie. + // if entering the funnel from the content site, check and see if there is already a vehicle year in vuex. // if so, send them to return-user page. - const funnelCookieLastTouched = getFunnelCookie()?.LastTouched; if ( fromContentSite && - funnelCookieLastTouched !== null && - funnelCookieLastTouched !== undefined && - !toReturnUserPage + !toReturnUserPage && + store.getters.order.vehicle?.year > 0 ) { log(" --from content site navigate to return user"); var qso = { fmgPage: fmgPageValues.RETURN_USER, }; - const lg = getQuerystringParameter(queryStrings.LOG); - if (lg) { - qso[queryStrings.LOG] = true; - } + + const newQueryString = buildQuerystringObject(qso, true); + log(" -- returnUser add querystring: " + JSON.stringify(newQueryString)); router.push({ path: "/", - query: Object.assign({}, qso), + query: Object.assign({}, newQueryString), }); return; }