CASH-845 router change refactor

This commit is contained in:
AdamCaouetteSafelite 2025-07-03 14:44:39 -04:00
parent 825e27413d
commit 76d67981f6
4 changed files with 14 additions and 16 deletions

View file

@ -55,11 +55,10 @@ export const routeData = {
name: "insurance-company", name: "insurance-company",
path: "/insurance-company", path: "/insurance-company",
}, },
// TODO: REMOVE THIS COMMENT AND BELOW, ONCE CASH-803 (SERVICE-LOCATION AND SCHEDULE PAGE COMBINATION) HAS BEEN VETTED SERVICE_LOCATION: { // keep even though this page has been removed from the regular flow bc Heritage still points to it
// SERVICE_LOCATION: { name: "service-location",
// name: "service-location", path: "/service-location",
// path: "/service-location", },
// },
HERITAGE: { HERITAGE: {
name: "heritage", name: "heritage",
path: "/virtual/heritage", path: "/virtual/heritage",

View file

@ -1,7 +1,6 @@
import { queryStrings } from "@/constants/query-strings"; import { queryStrings } from "@/constants/query-strings";
import { consumeReferralQuerystrings } from "@/router/methods/helpers/consume-referral-info"; import { consumeReferralQuerystrings } from "@/router/methods/helpers/consume-referral-info";
import { loadSessionIfPresent } from "@/helpers/heritage-integration/order-helper"; import { loadSessionIfPresent } from "@/helpers/heritage-integration/order-helper";
import router from "@/router";
import { routeData } from "@/router/constants/routes"; import { routeData } from "@/router/constants/routes";
export async function handleHeritageReturn(to, from) { export async function handleHeritageReturn(to, from) {
@ -13,13 +12,5 @@ export async function handleHeritageReturn(to, from) {
// load session with new cookie // load session with new cookie
await loadSessionIfPresent(true, routeData.SCHEDULE.name); await loadSessionIfPresent(true, routeData.SCHEDULE.name);
// Temporary redirect until URLs to old service-location page can be updated in Heritage
if (to.fullPath.includes("fmgPage=service-location")) {
// Redirect to Schedule page
router.push({
name: routeData.SCHEDULE.name,
});
}
} }
} }

View file

@ -0,0 +1,8 @@
import { routeData } from "@/router/constants/routes";
export async function serviceLocationBeforeEnter(to, from) {
return {
name: routeData.SCHEDULE.name,
replace: true,
};
}

View file

@ -12,6 +12,7 @@ import { errorBeforeEnter } from "@/router/methods/route-logic/error";
import { restartBeforeEnter } from "@/router/methods/route-logic/restart"; import { restartBeforeEnter } from "@/router/methods/route-logic/restart";
import { paymentMethodBeforeEnter } from "@/router/methods/route-logic/payment-method"; import { paymentMethodBeforeEnter } from "@/router/methods/route-logic/payment-method";
import { paymentBeforeEnter } from "@/router/methods/route-logic/payment"; import { paymentBeforeEnter } from "@/router/methods/route-logic/payment";
import { serviceLocationBeforeEnter } from "@/router/methods/route-logic/service-location";
export const routes = [ export const routes = [
// Non-virtual pages. // Non-virtual pages.
@ -29,8 +30,7 @@ export const routes = [
createRoute(routeData.CAPABILITY_QUESTIONS), createRoute(routeData.CAPABILITY_QUESTIONS),
createRoute(routeData.QUOTE, quoteBeforeEnter), createRoute(routeData.QUOTE, quoteBeforeEnter),
createRoute(routeData.INSURANCE_COMPANY, insuranceCompanyBeforeEnter), createRoute(routeData.INSURANCE_COMPANY, insuranceCompanyBeforeEnter),
// TODO: REMOVE THIS COMMENT AND BELOW, ONCE CASH-803 (SERVICE-LOCATION AND SCHEDULE PAGE COMBINATION) HAS BEEN VETTED createRoute(routeData.SERVICE_LOCATION, serviceLocationBeforeEnter),
// createRoute(routeData.SERVICE_LOCATION),
createRoute(routeData.SCHEDULE), createRoute(routeData.SCHEDULE),
createRoute(routeData.CUSTOMER_DETAILS), createRoute(routeData.CUSTOMER_DETAILS),
createRoute(routeData.PAYMENT_METHOD, paymentMethodBeforeEnter), createRoute(routeData.PAYMENT_METHOD, paymentMethodBeforeEnter),