From d4fd61c74f85c6c10f6104d96f9fc4134e4aec72 Mon Sep 17 00:00:00 2001 From: Katie Date: Mon, 11 Jul 2022 09:09:53 -0400 Subject: [PATCH] CSR-710 WIP --- src/global-methods.js | 10 +++++++++- src/helpers/heritage-integration/cookie-helper.js | 4 +++- src/helpers/heritage-integration/navigation-helper.js | 5 +++-- src/layouts/estimate/estimate.vue | 1 + src/layouts/vin-lookup/vin-lookup.vue | 1 + src/router/index.js | 8 +++++++- 6 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/global-methods.js b/src/global-methods.js index 5e4d04ea3..d5a2eddf9 100644 --- a/src/global-methods.js +++ b/src/global-methods.js @@ -7,7 +7,15 @@ import { GaCategories, GaActions, GaLabels } from "@/constants/analytics"; export default { callHttpClient({ method, endpoint, payload, logApiCall = true }) { return new Promise((resolve, reject) => { - const cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO; + // const cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO; + + let cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO; + + if (endpoint.includes("parts")) + cfDistroUrl = "https://localhost:44335"; + else if (endpoint.includes("order")) + cfDistroUrl = "https://localhost:44346"; + const payloadAndAnalyticsData = Object.assign({}, payload, { AppName: "FixMyGlass" }); axios({ method: method, url: cfDistroUrl + endpoint, data: payloadAndAnalyticsData, crossDomain: true, responseType: {} }) diff --git a/src/helpers/heritage-integration/cookie-helper.js b/src/helpers/heritage-integration/cookie-helper.js index 5d681f17f..3a8614661 100644 --- a/src/helpers/heritage-integration/cookie-helper.js +++ b/src/helpers/heritage-integration/cookie-helper.js @@ -7,6 +7,7 @@ import { applicationConfig } from "@/constants/application-config"; */ export function updateOrCreateFunnelCookie() { const wasClaimRegistrationDelayed = getFunnelCookie()?.HasDelayedClaimRegistration; + const shouldSuppressConceptFunnel = getFunnelCookie()?.SuppressConceptFunnel; // Create the cookie document.cookie = `${cookieNames.FUNNEL_SESSION_INFO}={}; path=${applicationConfig.COOKIE_PATH}; ${getCookieDomainValue()};`; @@ -21,7 +22,8 @@ export function updateOrCreateFunnelCookie() { ReferralDate: store.getters.order.referralDate, ReferralCorrelationId: store.getters.order.referralCorrelationId, ReferralParentAccountNumber: store.getters.order.accountNumber, - HasDelayedClaimRegistration: wasClaimRegistrationDelayed + HasDelayedClaimRegistration: wasClaimRegistrationDelayed, + SuppressConceptFunnel: shouldSuppressConceptFunnel }); } diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index 9bf69ddcf..ee006bc8e 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -41,9 +41,10 @@ export async function getPageToRouteExistingOrderTo(toRoute = {}, existingHerita Used to navigate to the heritage funnel with the correct query string and url. */ -export async function navigateToHeritageFunnel() { +export async function navigateToHeritageFunnel(shouldSaveOrder = true) { // Create the order (or save existing order) when navigating to Heritage Funnel. - await saveOrder(); + if (shouldSaveOrder) + await saveOrder(); router.navigateToExternalUrl( externalUrls.HERITAGE_FUNNEL, diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index a57062593..02451f2a5 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -15,6 +15,7 @@ cmsWidgetName="AlertVinLookupQuestion" alertClass="" /> + E: {{ selectedValues }} 0, + isSelectedGlassAvailableForVehicle: true }; }, mounted() { diff --git a/src/router/index.js b/src/router/index.js index 2b2d09859..f46a4b91c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -22,7 +22,6 @@ import analyticsMixin from "@/mixins/analytics-mixin"; import ComponentTest from "@/layouts/component-test/component-test.vue"; import FormTest from "@/layouts/form-test/form-test.vue"; - const routes = [ { path: "/component-test", // This is a temporary route for testing. @@ -44,6 +43,11 @@ const routes = [ await analyticsMixin.methods.initSession(); } + if (getFunnelCookie()?.SuppressConceptFunnel) { + await navigateToHeritageFunnel(false); + return next(false); + } + // If the saved session has timed out, clear the session, execute 404 logic. if (getFunnelCookie() !== null && !isSavedSessionStillActive()) { await baseMixin.methods.dispatchStoreAction(storeActions.RESET_STATE); @@ -219,6 +223,8 @@ function navigateToUrl(url, optionalQuery = {}) { externalUrl.searchParams.append(queryKey, optionalQuery[queryKey]); } + externalUrl.searchParams.append("experiments", "ConceptFunnel=ConceptFunnel_V1=ConceptFunnel_TEST=true"); + window.location.assign(externalUrl); }