Merge branch 'develop' into feature/CSR-2130
This commit is contained in:
commit
ac2adcd641
6 changed files with 113 additions and 42 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 };
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Components
|
// Components
|
||||||
import confirmation from "@/layouts/confirmation/confirmation.vue";
|
import confirmation from "@/layouts/confirmation/confirmation.vue";
|
||||||
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
import { AppointmentTypeStrings, RouteCodeFlags } from "@/constants/schedule-constants";
|
||||||
import { applicationConfig } from "@/constants/application-config.js";
|
import { applicationConfig } from "@/constants/application-config.js";
|
||||||
|
|
||||||
// Supporting Files
|
// Supporting Files
|
||||||
|
|
@ -397,6 +397,34 @@ describe("computed properties...", () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(testValue).toEqual("Duration: 30 - 45 minutes");
|
expect(testValue).toEqual("Duration: 30 - 45 minutes");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("Appointment Duration should return with All Day.", () => {
|
||||||
|
//Arrange
|
||||||
|
store.getters.submittedOrder.schedule.jobMaxMinutes = 45;
|
||||||
|
store.getters.submittedOrder.schedule.jobMinMinutes = 30;
|
||||||
|
store.getters.submittedOrder.schedule.routeCode = RouteCodeFlags.ALL_DAY_DROP_OFF;
|
||||||
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const testValue = wrapper.vm.AppointmentDuration;
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(testValue).toEqual("Duration: All Day");
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Appointment Duration should return with Overnight.", () => {
|
||||||
|
//Arrange
|
||||||
|
store.getters.submittedOrder.schedule.jobMaxMinutes = 45;
|
||||||
|
store.getters.submittedOrder.schedule.jobMinMinutes = 30;
|
||||||
|
store.getters.submittedOrder.schedule.routeCode = RouteCodeFlags.OVERNIGHT_DROP_OFF;
|
||||||
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const testValue = wrapper.vm.AppointmentDuration;
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(testValue).toEqual("Duration: Overnight");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function setupMocks({ customMountOptions }) {
|
function setupMocks({ customMountOptions }) {
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ import analyticsMixin from "@/mixins/analytics-mixin";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
import { AppointmentTypeStrings, RouteCodeFlags } from "@/constants/schedule-constants";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
import { applicationConfig } from "@/constants/application-config.js";
|
import { applicationConfig } from "@/constants/application-config.js";
|
||||||
import { convertDateStringToDate } from "@/layouts/schedule/helpers/schedule-helper";
|
import { convertDateStringToDate } from "@/layouts/schedule/helpers/schedule-helper";
|
||||||
|
|
@ -326,7 +326,24 @@ export default {
|
||||||
AppointmentDuration() {
|
AppointmentDuration() {
|
||||||
const durationMaximum = store.getters.submittedOrder?.schedule?.jobMaxMinutes;
|
const durationMaximum = store.getters.submittedOrder?.schedule?.jobMaxMinutes;
|
||||||
const durationMinimum = store.getters.submittedOrder?.schedule?.jobMinMinutes;
|
const durationMinimum = store.getters.submittedOrder?.schedule?.jobMinMinutes;
|
||||||
return "Duration: " + getDisplayTextForDurationLength(durationMinimum, durationMaximum);
|
const durationLengthString = "Duration: ";
|
||||||
|
if (
|
||||||
|
store.getters.submittedOrder?.schedule?.routeCode.includes(
|
||||||
|
RouteCodeFlags.ALL_DAY_DROP_OFF
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return durationLengthString.concat("All Day");
|
||||||
|
} else if (
|
||||||
|
store.getters.submittedOrder?.schedule?.routeCode.includes(
|
||||||
|
RouteCodeFlags.OVERNIGHT_DROP_OFF
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return durationLengthString.concat("Overnight");
|
||||||
|
} else {
|
||||||
|
return durationLengthString.concat(
|
||||||
|
getDisplayTextForDurationLength(durationMinimum, durationMaximum)
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -124,54 +124,44 @@ const routes = [
|
||||||
leadGenIsInsurance &&
|
leadGenIsInsurance &&
|
||||||
(leadGenDamage.toUpperCase() == "WINDSHIELDREPAIR" ||
|
(leadGenDamage.toUpperCase() == "WINDSHIELDREPAIR" ||
|
||||||
leadGenVinSelection?.length > 0) &&
|
leadGenVinSelection?.length > 0) &&
|
||||||
(leadGenIsInsurance == "false" || leadGenServicePackage?.length > 0) &&
|
(leadGenIsInsurance?.toUpperCase() == "FALSE" ||
|
||||||
|
leadGenServicePackage?.length > 0) &&
|
||||||
(leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR" ||
|
(leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR" ||
|
||||||
leadGenNumberOfChips?.length > 0)
|
leadGenNumberOfChips?.length > 0)
|
||||||
) {
|
) {
|
||||||
if (!store.getters.applicationUser.triggeredSiteEntry) {
|
store.commit(storeMutations.UPDATE_IS_LEAD_GEN, true);
|
||||||
store.commit(storeMutations.UPDATE_IS_LEAD_GEN, true);
|
store.commit(storeMutations.UPDATE_LEAD_GEN_YEAR, leadGenYear);
|
||||||
store.commit(storeMutations.UPDATE_LEAD_GEN_YEAR, leadGenYear);
|
store.commit(storeMutations.UPDATE_LEAD_GEN_MAKE, leadGenMake);
|
||||||
store.commit(storeMutations.UPDATE_LEAD_GEN_MAKE, leadGenMake);
|
store.commit(storeMutations.UPDATE_LEAD_GEN_MODEL, leadGenModel);
|
||||||
store.commit(storeMutations.UPDATE_LEAD_GEN_MODEL, leadGenModel);
|
store.commit(storeMutations.UPDATE_LEAD_GEN_STYLE, leadGenStyle);
|
||||||
store.commit(storeMutations.UPDATE_LEAD_GEN_STYLE, leadGenStyle);
|
store.commit(storeMutations.UPDATE_LEAD_GEN_DAMAGE_TYPE, leadGenDamage);
|
||||||
|
if (leadGenDamage.toUpperCase() == "WINDSHIELDREPLACE") {
|
||||||
|
store.commit(storeMutations.UPDATE_LEAD_GEN_IS_REPAIR, false);
|
||||||
|
store.commit(storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS, null);
|
||||||
|
} else if (leadGenDamage.toUpperCase() == "WINDSHIELDREPAIR") {
|
||||||
|
store.commit(storeMutations.UPDATE_LEAD_GEN_IS_REPAIR, true);
|
||||||
store.commit(
|
store.commit(
|
||||||
storeMutations.UPDATE_LEAD_GEN_DAMAGE_TYPE,
|
storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS,
|
||||||
leadGenDamage
|
leadGenNumberOfChips
|
||||||
);
|
);
|
||||||
if (leadGenDamage.toUpperCase() == "WINDSHIELDREPLACE") {
|
}
|
||||||
store.commit(storeMutations.UPDATE_LEAD_GEN_IS_REPAIR, false);
|
store.commit(storeMutations.UPDATE_LEAD_GEN_ZIP_CODE, leadGenZipCode);
|
||||||
store.commit(
|
store.commit(
|
||||||
storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS,
|
storeMutations.UPDATE_LEAD_GEN_EMAIL_ADDRESS,
|
||||||
null
|
leadGenEmail
|
||||||
);
|
);
|
||||||
} else if (leadGenDamage.toUpperCase() == "WINDSHIELDREPAIR") {
|
if (leadGenIsInsurance?.toUpperCase() == "TRUE") {
|
||||||
store.commit(storeMutations.UPDATE_LEAD_GEN_IS_REPAIR, true);
|
store.commit(storeMutations.UPDATE_LEAD_GEN_IS_INSURANCE, true);
|
||||||
store.commit(
|
|
||||||
storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS,
|
|
||||||
leadGenNumberOfChips
|
|
||||||
);
|
|
||||||
}
|
|
||||||
store.commit(
|
store.commit(
|
||||||
storeMutations.UPDATE_LEAD_GEN_ZIP_CODE,
|
storeMutations.UPDATE_LEAD_GEN_SERVICE_PACKAGE,
|
||||||
leadGenZipCode
|
leadGenServicePackage?.toLowerCase()
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
if (leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR") {
|
||||||
store.commit(
|
store.commit(
|
||||||
storeMutations.UPDATE_LEAD_GEN_EMAIL_ADDRESS,
|
storeMutations.UPDATE_LEAD_GEN_VIN_SELECTION,
|
||||||
leadGenEmail
|
leadGenVinSelection
|
||||||
);
|
);
|
||||||
if (leadGenIsInsurance == "true") {
|
|
||||||
store.commit(storeMutations.UPDATE_LEAD_GEN_IS_INSURANCE, true);
|
|
||||||
store.commit(
|
|
||||||
storeMutations.UPDATE_LEAD_GEN_SERVICE_PACKAGE,
|
|
||||||
leadGenServicePackage
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR") {
|
|
||||||
store.commit(
|
|
||||||
storeMutations.UPDATE_LEAD_GEN_VIN_SELECTION,
|
|
||||||
leadGenVinSelection
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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