CSR-98 Fix merge conflicts
This commit is contained in:
commit
de187c927e
8 changed files with 156 additions and 105 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
const applicationConfig = {
|
const applicationConfig = {
|
||||||
CONSUMER_APIGATEWAY_URL: process.env.VUE_APP_CONSUMER_API_GATEWAY,
|
CONSUMER_APIGATEWAY_URL: process.env.VUE_APP_CONSUMER_API_GATEWAY,
|
||||||
HERITAGE_FUNNEL: process.env.VUE_APP_HERITAGE_FUNNEL,
|
HERITAGE_FUNNEL: process.env.VUE_APP_HERITAGE_FUNNEL,
|
||||||
|
SESSION_TIMEOUT_CONFIG: 30
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
const cookieNames = {
|
const cookieNames = {
|
||||||
ORDER_INFO: "OrderInfo"
|
CONCEPT_SESSION_INFO: "ConceptSessionInfo",
|
||||||
};
|
};
|
||||||
|
|
||||||
export { cookieNames };
|
export { cookieNames };
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ const storeMutations = {
|
||||||
|
|
||||||
// OTHER MUTATIONS
|
// OTHER MUTATIONS
|
||||||
UPDATE_PAGE_DATA: "updatePageData",
|
UPDATE_PAGE_DATA: "updatePageData",
|
||||||
SET_LOAD_ORDER_INFO: "setLoadOrderInformation"
|
SET_LOAD_CONCEPT_SESSION_INFO: "setLoadOrderInformation"
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,111 +1,157 @@
|
||||||
import { storeActions } from "@/constants/store-actions.js";
|
import { storeActions } from "@/constants/store-actions.js";
|
||||||
import { cookieNames } from "@/constants/cookie-names";
|
import { cookieNames } from "@/constants/cookie-names";
|
||||||
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";
|
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";
|
||||||
|
import { applicationConfig } from "@/constants/application-config";
|
||||||
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
import baseMixin from "../mixins/base-mixin";
|
import baseMixin from "../mixins/base-mixin";
|
||||||
|
|
||||||
// Read info from heritage funnel and reset state or load referral?
|
|
||||||
export async function loadReferralFromHeritageFunnelIfPresent() {
|
|
||||||
const orderInfo = this.getHeritageCookieValue();
|
|
||||||
|
|
||||||
// Do nothing if there is no cookie.
|
// Saves Referral if one is available and commits referral details to state.
|
||||||
if(orderInfo === null){
|
export async function saveOrder() {
|
||||||
|
console.log("saving order...");
|
||||||
|
const savedOrderInfo = await baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.SAVE_ORDER);
|
||||||
|
|
||||||
|
// Save the referral information back from the store.
|
||||||
|
await baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.SET_REFERRAL_INFORMATION, {
|
||||||
|
referralNumber: savedOrderInfo.data.referralNumber,
|
||||||
|
correlationId: savedOrderInfo.data.referralCorrelationId,
|
||||||
|
referralDate: savedOrderInfo.data.referralDate,
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
// Update the cookie with the referral information when saved.
|
||||||
|
updateOrCreateConceptCookie();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Loads order based on referral data in cookie, also loads the referral information into state.
|
||||||
|
export async function loadOrder(referralNumber, referralDate, correlationId) {
|
||||||
|
console.log("loading order...", referralNumber, referralDate, correlationId);
|
||||||
|
await baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.LOAD_ORDER,
|
||||||
|
{ referralNumber: referralNumber.toString(), referralDate: referralDate, correlationId: correlationId }
|
||||||
|
, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read info from heritage funnel and reset state or load referral
|
||||||
|
export async function loadReferralIfPresent() {
|
||||||
|
console.log("attempting to load referral....");
|
||||||
|
const conceptCookie = getConceptCookie();
|
||||||
|
|
||||||
|
// Do nothing if there is no cookie or no correlation id.
|
||||||
|
if (conceptCookie === null || conceptCookie.ReferralCorrelationId === null) {
|
||||||
|
console.log("No referral found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset state if cookie says to.
|
// Reset state if cookie says to.
|
||||||
if (orderInfo?.ShouldResetState) {
|
if (conceptCookie.ShouldResetState) {
|
||||||
|
console.log("Resetting state...");
|
||||||
baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.RESET_STATE);
|
baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.RESET_STATE);
|
||||||
deleteHeritageCookie();
|
deleteConceptCookie();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("calling load order from loadReferralIfPresent()...");
|
||||||
// Load referral if there is a cookie, and it doesn't indicate it needs a state reset.
|
// Load referral if there is a cookie, and it doesn't indicate it needs a state reset.
|
||||||
await loadOrder();
|
await loadOrder(conceptCookie.ReferralNumber, conceptCookie.ReferralDate, conceptCookie.ReferralCorrelationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function updateOrCreateConceptCookie() {
|
||||||
|
console.log("Updating cookie...", {
|
||||||
|
LastTouched: new Date().toUTCString(),
|
||||||
|
DidHeritageFunnelUpdateLast: false,
|
||||||
|
ShouldResetState: false,
|
||||||
|
ReferralNumber: store.state.order.referralNumber,
|
||||||
|
ReferralDate: store.state.order.referralDate,
|
||||||
|
ReferralCorrelationId: store.state.order.referralCorrelationId,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create the cookie
|
||||||
|
document.cookie = `${cookieNames.CONCEPT_SESSION_INFO}={}; path=/`;
|
||||||
|
|
||||||
|
// Set up cookie with all the props.
|
||||||
|
setConceptCookieProperties({
|
||||||
|
LastTouched: new Date().toUTCString(),
|
||||||
|
DidHeritageFunnelUpdateLast: false,
|
||||||
|
ShouldResetState: false,
|
||||||
|
ReferralNumber: store.state.order.referralNumber,
|
||||||
|
ReferralDate: store.state.order.referralDate,
|
||||||
|
ReferralCorrelationId: store.state.order.referralCorrelationId,
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isConceptSessionStillActive() {
|
||||||
|
if (getConceptCookie() !== null) {
|
||||||
|
const lastTouchedValue = getConceptCookie().LastTouched;
|
||||||
|
const timeoutAmount = applicationConfig.SESSION_TIMEOUT_CONFIG;
|
||||||
|
const isMoreThanHalfHourAgo = ((new Date() - new Date(lastTouchedValue)) / 60000) > timeoutAmount;
|
||||||
|
console.log("has session expired -->", isMoreThanHalfHourAgo);
|
||||||
|
|
||||||
|
if (isMoreThanHalfHourAgo) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Navigate to Heritage Funnel with the proper URL format.
|
||||||
|
// Will Save the referral if there is one in state, or create a new one if one is not in state.
|
||||||
export async function navigateToHeritageFunnel() {
|
export async function navigateToHeritageFunnel() {
|
||||||
await this.saveOrder();
|
|
||||||
const referralCorrelationId = store.getters.referralCorrelationId;
|
// Create the order (or save existing order) when navigating to Heritage Funnel.
|
||||||
|
await saveOrder();
|
||||||
|
|
||||||
router.navigate(
|
router.navigate(
|
||||||
navigationScenarios.MOVE_TO_HERITAGE_FUNNEL,
|
navigationScenarios.MOVE_TO_HERITAGE_FUNNEL,
|
||||||
router.currentRoute.value,
|
router.currentRoute.value,
|
||||||
{
|
{
|
||||||
corid: referralCorrelationId,
|
corid: store.state.order.referralCorrelationId,
|
||||||
src: "concept-funnel",
|
src: "concept-funnel",
|
||||||
// TODO CSR-98 REMOVE THIS
|
|
||||||
cns: "all",
|
cns: "all",
|
||||||
experiments: "RemoveServiceAreaPage=ServAreaRemoval_V7=ServAreaNoRemove_V7_TEST=true,ConceptFunnel=ConceptFunnel_V1=ConceptFunnel_TEST=true"
|
experiments: "RemoveServiceAreaPage=ServAreaRemoval_V7=ServAreaNoRemove_V7_TEST=true,ConceptFunnel=ConceptFunnel_V1=ConceptFunnel_TEST=true"
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function saveOrder() {
|
|
||||||
const savedOrderInfo = (await baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.SAVE_ORDER)).data;
|
|
||||||
|
|
||||||
// Save the referral information back from the store.
|
|
||||||
await baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.SET_REFERRAL_INFORMATION, {
|
|
||||||
referralNumber: savedOrderInfo.referralNumber,
|
|
||||||
correlationId: savedOrderInfo.referralCorrelationId,
|
|
||||||
referralDate: savedOrderInfo.referralDate,
|
|
||||||
})
|
|
||||||
|
|
||||||
// Set cookie properties.
|
|
||||||
setHeritageCookieProperties({
|
|
||||||
DidHeritageFunnelUpdateLast: false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function loadOrder() {
|
|
||||||
const loadOrderInfo = (await baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.LOAD_ORDER)).data;
|
|
||||||
|
|
||||||
// Save the data from the loaded order to state.
|
|
||||||
await baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.SET_LOAD_ORDER_DATA, { loadOrderInfo });
|
|
||||||
}
|
|
||||||
|
|
||||||
// --------- PRIVATE FUNCTIONS ---------
|
|
||||||
|
|
||||||
/* Start cookie related functions */
|
/* Start cookie related functions */
|
||||||
export function getHeritageCookieValue() {
|
export function getConceptCookie() {
|
||||||
const cookieJson = document.cookie
|
const cookieJson = document.cookie
|
||||||
?.split("; ")
|
?.split("; ")
|
||||||
?.find(row => row.startsWith(`${cookieNames.ORDER_INFO}=`))
|
?.find(row => row.startsWith(`${cookieNames.CONCEPT_SESSION_INFO}=`))
|
||||||
?.split("=")[1];
|
?.split("=")[1];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return JSON.parse(cookieJson);
|
return JSON.parse(cookieJson);
|
||||||
} catch(error) {
|
} catch (error) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteHeritageCookie() {
|
// --------- PRIVATE FUNCTIONS ---------
|
||||||
// If this cookie is ever created from the concept funnel, will need to add another
|
|
||||||
// line with the path=/fmg/
|
|
||||||
document.cookie = `${cookieNames.ORDER_INFO}=; Max-Age=0; path=/; domain=${location.hostname}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setHeritageCookieValue(cookieValue) {
|
function setConceptCookieProperties(properties) {
|
||||||
let cookieValueJson = cookieValue;
|
|
||||||
if (typeof cookieValue == "object")
|
|
||||||
cookieValueJson = JSON.stringify(cookieValue);
|
|
||||||
|
|
||||||
document.cookie = `${cookieNames.ORDER_INFO}=${cookieValueJson}; path=/`;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setHeritageCookieProperties(properties) {
|
|
||||||
if (typeof properties == "object") {
|
if (typeof properties == "object") {
|
||||||
let cookie = getHeritageCookieValue();
|
let cookie = getConceptCookie();
|
||||||
|
|
||||||
if (cookie !== null) {
|
if (cookie !== null) {
|
||||||
Object.keys(properties).forEach(key => {
|
Object.keys(properties).forEach(key => {
|
||||||
cookie[key] = properties[key];
|
cookie[key] = properties[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
setHeritageCookieValue(cookie);
|
const cookieValueJson = JSON.stringify(cookie);
|
||||||
|
|
||||||
|
document.cookie = `${cookieNames.CONCEPT_SESSION_INFO}=${cookieValueJson}; path=/`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deleteConceptCookie() {
|
||||||
|
// If this cookie is ever created from the concept funnel, will need to add another
|
||||||
|
// line with the path=/fmg/
|
||||||
|
document.cookie = `${cookieNames.CONCEPT_SESSION_INFO}=; Max-Age=0; path=/; domain=${location.hostname}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* End cookie related functions */
|
/* End cookie related functions */
|
||||||
|
|
|
||||||
|
|
@ -323,7 +323,7 @@ describe("cookies", () => {
|
||||||
const cookies = {
|
const cookies = {
|
||||||
"orderconfirmation": 1565980,
|
"orderconfirmation": 1565980,
|
||||||
"optimizelyEndUserId": "oeu1610051865958r0.07937134272718804",
|
"optimizelyEndUserId": "oeu1610051865958r0.07937134272718804",
|
||||||
[cookieNames.ORDER_INFO]: `{"ReferralNumber":"1566818","ReferralDate":"2022-03-15T10:56:24.597","ReferralCorrelationId":"404d2b04-f86e-45c3-b373-127b6217b060","ShouldResetState":false,"DidHeritageFunnelUpdateLast":true}`,
|
[cookieNames.CONCEPT_SESSION_INFO]: `{"ReferralNumber":"1566818","ReferralDate":"2022-03-15T10:56:24.597","ReferralCorrelationId":"404d2b04-f86e-45c3-b373-127b6217b060","ShouldResetState":false,"DidHeritageFunnelUpdateLast":true}`,
|
||||||
"UNIQUE_SESSION_ID": "33756020-b58e-4ec7-b8b8-3f1576719c40",
|
"UNIQUE_SESSION_ID": "33756020-b58e-4ec7-b8b8-3f1576719c40",
|
||||||
"_ga": "GA1.1.1631274579.1622658999",
|
"_ga": "GA1.1.1631274579.1622658999",
|
||||||
"da_lid": "B10847599A73EA95861EBB99009A283E27|0|0|0 clientTag=null",
|
"da_lid": "B10847599A73EA95861EBB99009A283E27|0|0|0 clientTag=null",
|
||||||
|
|
@ -332,9 +332,9 @@ const cookies = {
|
||||||
|
|
||||||
function setupCookies({ heritageCookieValue = "", includeHeritageCookie = true }) {
|
function setupCookies({ heritageCookieValue = "", includeHeritageCookie = true }) {
|
||||||
Object.keys(cookies).forEach(key => {
|
Object.keys(cookies).forEach(key => {
|
||||||
const cookieValue = key == cookieNames.ORDER_INFO ? heritageCookieValue : cookies[key];
|
const cookieValue = key == cookieNames.CONCEPT_SESSION_INFO ? heritageCookieValue : cookies[key];
|
||||||
|
|
||||||
if (includeHeritageCookie || key != cookieNames.ORDER_INFO)
|
if (includeHeritageCookie || key != cookieNames.CONCEPT_SESSION_INFO)
|
||||||
document.cookie = `${key}=${cookieValue}; path=/;`;
|
document.cookie = `${key}=${cookieValue}; path=/;`;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,7 @@ import { storeActions } from "@/constants/store-actions";
|
||||||
import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js";
|
import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js";
|
||||||
import { routingTable } from "@/router/router-constants/routing-table.js";
|
import { routingTable } from "@/router/router-constants/routing-table.js";
|
||||||
import { globalEvents, globalEventTypes } from "@/constants/events";
|
import { globalEvents, globalEventTypes } from "@/constants/events";
|
||||||
import { routerParameterKeys } from '@/router/router-constants/router-parameter-keys'
|
import * as integrationHelper from "@/helpers/heritage-integration-helper";
|
||||||
import { loadReferralFromHeritageFunnelIfPresent, saveOrder, getHeritageCookieValue } from "@/helpers/heritage-integration-helper";
|
|
||||||
|
|
||||||
import baseMixin from "@/mixins/base-mixin";
|
import baseMixin from "@/mixins/base-mixin";
|
||||||
import eventBus from "@/helpers/event-bus/event-bus";
|
import eventBus from "@/helpers/event-bus/event-bus";
|
||||||
|
|
@ -30,17 +29,27 @@ const routes = [
|
||||||
path: "/",
|
path: "/",
|
||||||
name: "root",
|
name: "root",
|
||||||
async beforeEnter(to, from, next) {
|
async beforeEnter(to, from, next) {
|
||||||
// On entering the concept funnel
|
|
||||||
if (from.redirectedFrom === undefined) {
|
|
||||||
// Read cookie information, decide what to do next
|
|
||||||
loadReferralFromHeritageFunnelIfPresent();
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we have no query string, or we don't have the FmgPage query string.
|
// If we have no query string, or we don't have the FmgPage query string.
|
||||||
if (to.query.fmgPage === undefined) {
|
if (to.query.fmgPage === undefined) {
|
||||||
await GoToFunnelStartOn404(next);
|
await GoToFunnelStartOn404(next);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
// Check our 'Session' is still good.
|
||||||
|
// If not, reset state and go back to the start.
|
||||||
|
if (!integrationHelper.isConceptSessionStillActive()) {
|
||||||
|
baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.RESET_STATE);
|
||||||
|
await GoToFunnelStartOn404(next);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create funnel cookie, or update it if it already exists.
|
||||||
|
integrationHelper.updateOrCreateConceptCookie();
|
||||||
|
|
||||||
|
// On entering the concept funnel "fresh", read cookie information, decide what to do next.
|
||||||
|
if (from.redirectedFrom === undefined) {
|
||||||
|
await integrationHelper.loadReferralIfPresent();
|
||||||
|
}
|
||||||
|
|
||||||
// If we already have our route, go to it.
|
// If we already have our route, go to it.
|
||||||
if (router.hasRoute(to.query.fmgPage)) {
|
if (router.hasRoute(to.query.fmgPage)) {
|
||||||
// Since our route is already in scope, we can grab the component from it and call the arePagePrerequisitesValid function.
|
// Since our route is already in scope, we can grab the component from it and call the arePagePrerequisitesValid function.
|
||||||
|
|
@ -134,16 +143,17 @@ async function navigate(scenario, currentRoute, invalidateOnSave, optionalQuery
|
||||||
// Append page data to the store for the NEXT page, if any. It will be an empty object if none is provided.
|
// Append page data to the store for the NEXT page, if any. It will be an empty object if none is provided.
|
||||||
baseMixin.methods.savePageDataToStore(destinationFmgPageValue, optionalPageData);
|
baseMixin.methods.savePageDataToStore(destinationFmgPageValue, optionalPageData);
|
||||||
|
|
||||||
// if cookie and referral exists
|
// if cookie and referralNumber/Date exists
|
||||||
if (getHeritageCookieValue()?.ReferralNumber)
|
if (integrationHelper.getConceptCookie()?.ReferralNumber && integrationHelper.getConceptCookie()?.ReferralDate) {
|
||||||
saveOrder();
|
await integrationHelper.saveOrder();
|
||||||
|
}
|
||||||
|
|
||||||
router.push({
|
router.push({
|
||||||
name: "root",
|
name: "root",
|
||||||
query: Object.assign(optionalQuery, {
|
query: Object.assign(optionalQuery, {
|
||||||
fmgPage: destinationFmgPageValue,
|
fmgPage: destinationFmgPageValue,
|
||||||
}),
|
}),
|
||||||
params: Object.assign(optionalParams, {[routerParameterKeys.FROM_ROUTER_NAVIGATE]: true})
|
params: optionalParams
|
||||||
});
|
});
|
||||||
} else if (matchingScenarioMap.destinationUrl !== undefined) {
|
} else if (matchingScenarioMap.destinationUrl !== undefined) {
|
||||||
navigateToUrl(matchingScenarioMap.destinationUrl, optionalQuery);
|
navigateToUrl(matchingScenarioMap.destinationUrl, optionalQuery);
|
||||||
|
|
@ -152,7 +162,6 @@ async function navigate(scenario, currentRoute, invalidateOnSave, optionalQuery
|
||||||
|
|
||||||
// Get navigation map depending on the scenario and the current 'page' you're on.
|
// Get navigation map depending on the scenario and the current 'page' you're on.
|
||||||
function getNavigationMap(scenario, currentRoute) {
|
function getNavigationMap(scenario, currentRoute) {
|
||||||
console.log("A")
|
|
||||||
const fmgPageValue = currentRoute.query.fmgPage;
|
const fmgPageValue = currentRoute.query.fmgPage;
|
||||||
const matchedQueryValue = routingTable
|
const matchedQueryValue = routingTable
|
||||||
.filter(
|
.filter(
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
const routerParameterKeys = {
|
const routerParameterKeys = { };
|
||||||
FROM_ROUTER_NAVIGATE: 'fromRouterNavigate',
|
|
||||||
};
|
|
||||||
|
|
||||||
export { routerParameterKeys };
|
export { routerParameterKeys };
|
||||||
|
|
@ -148,25 +148,25 @@ export const mutations = {
|
||||||
|
|
||||||
// Misc Mutations
|
// Misc Mutations
|
||||||
setLoadOrderInformation(state, orderInformation) {
|
setLoadOrderInformation(state, orderInformation) {
|
||||||
state.order.referralNumber = orderInformation.ReferralNumber;
|
state.order.referralNumber = orderInformation.referralNumber;
|
||||||
state.order.referralDate = orderInformation.ReferralDate;
|
state.order.referralDate = orderInformation.referralDate;
|
||||||
state.order.referralCorrelationId = orderInformation.CorrelationId;
|
state.order.referralCorrelationId = orderInformation.correlationId;
|
||||||
state.order.vehicle = {
|
state.order.vehicle = {
|
||||||
year: orderInformation.Year,
|
year: orderInformation.vehicle.year,
|
||||||
make: orderInformation.Make,
|
make: orderInformation.vehicle.make,
|
||||||
model: orderInformation.Model,
|
model: orderInformation.vehicle.model,
|
||||||
style: orderInformation.Style,
|
style: orderInformation.vehicle.style,
|
||||||
carId: orderInformation.CarId,
|
carId: orderInformation.vehicle.carId,
|
||||||
category: orderInformation.Category,
|
category: orderInformation.vehicle.category,
|
||||||
imageUrl: orderInformation.ImageUrl,
|
imageUrl: orderInformation.vehicle.imageUrl,
|
||||||
imageVifNumber: orderInformation.ImageVifNumber,
|
imageVifNumber: orderInformation.vehicle.imageVifNumber,
|
||||||
imageColor: orderInformation.ImageColor
|
imageColor: orderInformation.vehicle.imageVifColor
|
||||||
};
|
};
|
||||||
state.order.damage.glassToReplace = orderInformation.GlassToReplace;
|
state.order.damage.glassToReplace = orderInformation.glassToReplace;
|
||||||
state.order.damage.isRepair = orderInformation.IsRepair;
|
state.order.damage.isRepair = orderInformation.isRepair;
|
||||||
state.order.damage.numberOfChips = orderInformation.NumberOfChips;
|
state.order.damage.numberOfChips = orderInformation.numberOfChips;
|
||||||
state.order.lineItems.glassParts = orderInformation.Parts;
|
state.order.lineItems.glassParts = orderInformation.parts;
|
||||||
state.order.parentAccountNumber = orderInformation.ParentAccountNumber;
|
state.order.parentAccountNumber = orderInformation.parentAccountNumber;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -184,9 +184,6 @@ export const getters = {
|
||||||
eventBus: (state) => state.applicationUser.eventBus,
|
eventBus: (state) => state.applicationUser.eventBus,
|
||||||
damage: (state) => state.order.damage,
|
damage: (state) => state.order.damage,
|
||||||
lineItems: (state) => state.order.lineItems,
|
lineItems: (state) => state.order.lineItems,
|
||||||
referralNumber: (state) => state.order.referralNumber,
|
|
||||||
referralDate: (state) => state.order.referralDate,
|
|
||||||
referralCorrelationId: (state) => state.order.referralCorrelationId,
|
|
||||||
pageData: (state) => (page) => {
|
pageData: (state) => (page) => {
|
||||||
return state.applicationUser.pageData[page];
|
return state.applicationUser.pageData[page];
|
||||||
}
|
}
|
||||||
|
|
@ -321,9 +318,6 @@ export const actions = {
|
||||||
context.commit(storeMutations.UPDATE_REFERRAL_DATE, referralDate);
|
context.commit(storeMutations.UPDATE_REFERRAL_DATE, referralDate);
|
||||||
context.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, referralCorrelationId);
|
context.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, referralCorrelationId);
|
||||||
},
|
},
|
||||||
setLoadOrderData(context, { loadOrderData }) {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
// Parts API Actions
|
// Parts API Actions
|
||||||
getPartsOrQuestions(context, { carId, glassArray, zipCode, vin = '' }) {
|
getPartsOrQuestions(context, { carId, glassArray, zipCode, vin = '' }) {
|
||||||
|
|
@ -357,8 +351,8 @@ export const actions = {
|
||||||
},
|
},
|
||||||
numberOfChips: damage.numberOfChips,
|
numberOfChips: damage.numberOfChips,
|
||||||
glassToReplace: damage.glassToReplace,
|
glassToReplace: damage.glassToReplace,
|
||||||
referralNumber: context.getters.referralNumber,
|
referralNumber: context.state.order.referralNumber,
|
||||||
referralDate: context.getters.referralDate
|
referralDate: context.state.order.referralDate
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
@ -372,6 +366,9 @@ export const actions = {
|
||||||
referralDate: referralDate,
|
referralDate: referralDate,
|
||||||
correlationId: correlationId
|
correlationId: correlationId
|
||||||
},
|
},
|
||||||
|
}).then( (response) => {
|
||||||
|
context.commit(storeMutations.SET_LOAD_CONCEPT_SESSION_INFO, response.data);
|
||||||
|
return response;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue