CSR-2087
Leadgen widget have different case style value so need to parse with NextGen
This commit is contained in:
parent
5cc484bacd
commit
5b79d9ed28
3 changed files with 36 additions and 0 deletions
|
|
@ -98,6 +98,7 @@ const storeActions = {
|
||||||
RESET_SUBMITTED_ORDER: "resetSubmittedOrder",
|
RESET_SUBMITTED_ORDER: "resetSubmittedOrder",
|
||||||
RESET_LEADGEN_STATE: "resetLeadGenState",
|
RESET_LEADGEN_STATE: "resetLeadGenState",
|
||||||
CREATE_LEADGEN_STATE: "createLeadGenState",
|
CREATE_LEADGEN_STATE: "createLeadGenState",
|
||||||
|
UPDATE_LEADGEN_MMS: "updateLeadGenMMS",
|
||||||
};
|
};
|
||||||
|
|
||||||
export { storeActions };
|
export { storeActions };
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,36 @@ export default {
|
||||||
|
|
||||||
let resultMap = await settleAllPromises(promiseResultMap);
|
let resultMap = await settleAllPromises(promiseResultMap);
|
||||||
|
|
||||||
|
//Leadgen widget have different case style value so need to parse with NextGen
|
||||||
|
if (store.getters.isLeadGen) {
|
||||||
|
if (
|
||||||
|
makeQuestionInitialDataPromise &&
|
||||||
|
modelQuestionInitialDataPromise &&
|
||||||
|
styleQuestionInitialDataPromise
|
||||||
|
) {
|
||||||
|
const matchingMake = resultMap.makeQuestionInitialData?.filter(
|
||||||
|
(item) => item.toLowerCase() === store.getters.leadGenVehicle.make.toLowerCase()
|
||||||
|
);
|
||||||
|
const matchingModel = resultMap.modelQuestionInitialData?.filter(
|
||||||
|
(item) =>
|
||||||
|
item.toLowerCase() === store.getters.leadGenVehicle.model.toLowerCase()
|
||||||
|
);
|
||||||
|
const matchingStyle = resultMap.styleQuestionInitialData?.filter(
|
||||||
|
(item) =>
|
||||||
|
item.toLowerCase() === store.getters.leadGenVehicle.style.toLowerCase()
|
||||||
|
);
|
||||||
|
baseMixin.methods.dispatchStoreAction(
|
||||||
|
storeActions.UPDATE_LEADGEN_MMS,
|
||||||
|
{
|
||||||
|
leadGenMake: matchingMake[0],
|
||||||
|
leadGenModel: matchingModel[0],
|
||||||
|
leadGenStyle: matchingStyle[0],
|
||||||
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next(async (vm) => {
|
next(async (vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
|
|
||||||
|
|
@ -2812,6 +2812,11 @@ export const actions = {
|
||||||
createLeadGenState(context) {
|
createLeadGenState(context) {
|
||||||
createLeadGenDefaultState();
|
createLeadGenDefaultState();
|
||||||
},
|
},
|
||||||
|
updateLeadGenMMS(context, leadGenMMS) {
|
||||||
|
context.commit(storeMutations.UPDATE_LEAD_GEN_MAKE, leadGenMMS.leadGenMake);
|
||||||
|
context.commit(storeMutations.UPDATE_LEAD_GEN_MODEL, leadGenMMS.leadGenModel);
|
||||||
|
context.commit(storeMutations.UPDATE_LEAD_GEN_STYLE, leadGenMMS.leadGenStyle);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default createStore({
|
export default createStore({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue