CSR-710 WIP

This commit is contained in:
Katie 2022-07-11 09:09:53 -04:00
parent c5426c5e04
commit d4fd61c74f
6 changed files with 24 additions and 5 deletions

View file

@ -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: {} })

View file

@ -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
});
}

View file

@ -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,

View file

@ -15,6 +15,7 @@
cmsWidgetName="AlertVinLookupQuestion"
alertClass=""
/>
E: {{ selectedValues }}
<buttonQuestion
cmsWidgetName="VinLookupMethod"
:answers="answersFromCms"

View file

@ -181,6 +181,7 @@ export default {
previouslyEnteredCarId: '',
invalidZip: '',
vinPopulatedOnPageLoad: this.getVinFromStore()?.length > 0,
isSelectedGlassAvailableForVehicle: true
};
},
mounted() {

View file

@ -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);
}