Merge branch 'release/2024.01.19' into rlsmerge/2024.01.19-to-2024.02.08

This commit is contained in:
CarlNation 2024-01-18 15:45:00 -05:00
commit f5380e5f5a
2 changed files with 12 additions and 6 deletions

View file

@ -9,7 +9,7 @@ import { queryStrings } from "@/constants/query-strings";
import { getQuerystringParameter } from "@/helpers/querystring-helper"; import { getQuerystringParameter } from "@/helpers/querystring-helper";
import { getDeviceIdValue } from "@/helpers/heritage-integration/cookie-helper"; import { getDeviceIdValue } from "@/helpers/heritage-integration/cookie-helper";
import { showFmgLoadingModal } from "@/helpers/loading-modal-helper"; import { showFmgLoadingModal } from "@/helpers/loading-modal-helper";
import { fmgPageValues, homepageName } from "@/router/router-constants/fmgPage-values"; import { fmgPageValues, funnelStartPageName } from "@/router/router-constants/fmgPage-values";
// Heritage integration // Heritage integration
import { isSavedSessionStillActive } from "@/helpers/heritage-integration/session-helper"; import { isSavedSessionStillActive } from "@/helpers/heritage-integration/session-helper";
@ -17,6 +17,7 @@ import {
updateOrCreateFunnelCookie, updateOrCreateFunnelCookie,
getFunnelCookie, getFunnelCookie,
updateSessionIdCookie, updateSessionIdCookie,
deleteFunnelCookie,
} from "@/helpers/heritage-integration/cookie-helper"; } from "@/helpers/heritage-integration/cookie-helper";
import { loadSessionIfPresent, saveSession } from "@/helpers/heritage-integration/order-helper"; import { loadSessionIfPresent, saveSession } from "@/helpers/heritage-integration/order-helper";
import { import {
@ -54,7 +55,7 @@ const routes = [
// Intercept all navigation if a submitted order exists in storage // Intercept all navigation if a submitted order exists in storage
if (store.getters.hasSubmittedOrder) { if (store.getters.hasSubmittedOrder) {
if (to.query.fmgPage !== homepageName) { if (to.query.fmgPage !== funnelStartPageName) {
to.query.fmgPage = fmgPageValues.CONFIRMATION; to.query.fmgPage = fmgPageValues.CONFIRMATION;
} }
} }
@ -141,6 +142,11 @@ const routes = [
} catch (error) { } catch (error) {
console.log(error); console.log(error);
if (to.query?.fmgPage === funnelStartPageName) {
deleteFunnelCookie();
await baseMixin.methods.dispatchStoreAction(storeActions.RESET_STATE);
}
// If we don't have a route, go to our 404 page. // If we don't have a route, go to our 404 page.
GoToFunnelStartOn404(next); GoToFunnelStartOn404(next);
} }
@ -185,7 +191,7 @@ router.beforeEach(async (to, from, next) => {
// Refresh page if navigating to self to prevent locking. // Refresh page if navigating to self to prevent locking.
// For now only carved out for vehicle; all modals are opened through anchor tags at the moment, // For now only carved out for vehicle; all modals are opened through anchor tags at the moment,
// which also self navigate, but relied on the page remaining the same on self-navigation. // which also self navigate, but relied on the page remaining the same on self-navigation.
} else if (toQueryPage === fromQueryPage && toQueryPage === homepageName) { } else if (toQueryPage === fromQueryPage && toQueryPage === funnelStartPageName) {
router.go(0); router.go(0);
} else { } else {
next(); next();
@ -403,7 +409,7 @@ function GoToFunnelStartOn404(next) {
next({ next({
path: "/", path: "/",
query: { fmgPage: homepageName }, query: { fmgPage: funnelStartPageName },
}); });
} }

View file

@ -21,6 +21,6 @@ const fmgPageValues = {
CONFIRMATION: "confirmation", CONFIRMATION: "confirmation",
}; };
const homepageName = fmgPageValues.VEHICLE; const funnelStartPageName = fmgPageValues.VEHICLE;
export { fmgPageValues, homepageName }; export { fmgPageValues, funnelStartPageName };