From 7e05d20d5398edd9288ec480179aa0492d063935 Mon Sep 17 00:00:00 2001 From: Josh Seltzer Date: Thu, 25 Jul 2024 13:52:35 -0400 Subject: [PATCH 1/7] Correct All Day appointment duration --- src/layouts/confirmation/confirmation.spec.js | 14 ++++++++++++++ src/layouts/confirmation/confirmation.vue | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/layouts/confirmation/confirmation.spec.js b/src/layouts/confirmation/confirmation.spec.js index 39e5d8b49..19f3e1f22 100644 --- a/src/layouts/confirmation/confirmation.spec.js +++ b/src/layouts/confirmation/confirmation.spec.js @@ -397,6 +397,20 @@ describe("computed properties...", () => { // Assert 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.serviceLocation.appointmentType = AppointmentTypeStrings.DROP_OFF; + const { wrapper } = setupMocks({}); + + // Act + const testValue = wrapper.vm.AppointmentDuration; + + // Assert + expect(testValue).toEqual("Duration: All Day"); + }); }); function setupMocks({ customMountOptions }) { diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index efbc2e15f..5cac637e5 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -326,7 +326,12 @@ export default { AppointmentDuration() { const durationMaximum = store.getters.submittedOrder?.schedule?.jobMaxMinutes; const durationMinimum = store.getters.submittedOrder?.schedule?.jobMinMinutes; - return "Duration: " + getDisplayTextForDurationLength(durationMinimum, durationMaximum); + const durationLengthString = "Duration: "; + if (store.getters.submittedOrder?.serviceLocation?.appointmentType === AppointmentTypeStrings.DROP_OFF) { + return durationLengthString.concat("All Day") + } else { + return durationLengthString.concat(getDisplayTextForDurationLength(durationMinimum, durationMaximum)); + } }, }, methods: { From 15368e3255338220c2b01697c5632dd5c2c2cd36 Mon Sep 17 00:00:00 2001 From: Josh Seltzer Date: Thu, 25 Jul 2024 14:09:07 -0400 Subject: [PATCH 2/7] Prettier --- src/layouts/confirmation/confirmation.spec.js | 3 ++- src/layouts/confirmation/confirmation.vue | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/layouts/confirmation/confirmation.spec.js b/src/layouts/confirmation/confirmation.spec.js index 19f3e1f22..47b650a14 100644 --- a/src/layouts/confirmation/confirmation.spec.js +++ b/src/layouts/confirmation/confirmation.spec.js @@ -402,7 +402,8 @@ describe("computed properties...", () => { //Arrange store.getters.submittedOrder.schedule.jobMaxMinutes = 45; store.getters.submittedOrder.schedule.jobMinMinutes = 30; - store.getters.submittedOrder.serviceLocation.appointmentType = AppointmentTypeStrings.DROP_OFF; + store.getters.submittedOrder.serviceLocation.appointmentType = + AppointmentTypeStrings.DROP_OFF; const { wrapper } = setupMocks({}); // Act diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index 5cac637e5..695482119 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -327,10 +327,15 @@ export default { const durationMaximum = store.getters.submittedOrder?.schedule?.jobMaxMinutes; const durationMinimum = store.getters.submittedOrder?.schedule?.jobMinMinutes; const durationLengthString = "Duration: "; - if (store.getters.submittedOrder?.serviceLocation?.appointmentType === AppointmentTypeStrings.DROP_OFF) { - return durationLengthString.concat("All Day") + if ( + store.getters.submittedOrder?.serviceLocation?.appointmentType === + AppointmentTypeStrings.DROP_OFF + ) { + return durationLengthString.concat("All Day"); } else { - return durationLengthString.concat(getDisplayTextForDurationLength(durationMinimum, durationMaximum)); + return durationLengthString.concat( + getDisplayTextForDurationLength(durationMinimum, durationMaximum) + ); } }, }, From d14823acc12b0627b4f8dcc70b3ec92b1fba60db Mon Sep 17 00:00:00 2001 From: Josh Seltzer Date: Thu, 25 Jul 2024 15:24:06 -0400 Subject: [PATCH 3/7] Corrected Overnight scheduling --- src/layouts/confirmation/confirmation.spec.js | 19 ++++++++++++++++--- src/layouts/confirmation/confirmation.vue | 13 ++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/layouts/confirmation/confirmation.spec.js b/src/layouts/confirmation/confirmation.spec.js index 47b650a14..a079fab83 100644 --- a/src/layouts/confirmation/confirmation.spec.js +++ b/src/layouts/confirmation/confirmation.spec.js @@ -1,6 +1,6 @@ // Components 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"; // Supporting Files @@ -402,8 +402,7 @@ describe("computed properties...", () => { //Arrange store.getters.submittedOrder.schedule.jobMaxMinutes = 45; store.getters.submittedOrder.schedule.jobMinMinutes = 30; - store.getters.submittedOrder.serviceLocation.appointmentType = - AppointmentTypeStrings.DROP_OFF; + store.getters.submittedOrder.schedule.routeCode = RouteCodeFlags.ALL_DAY_DROP_OFF; const { wrapper } = setupMocks({}); // Act @@ -412,6 +411,20 @@ describe("computed properties...", () => { // 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 }) { diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index 695482119..b46154756 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -96,7 +96,7 @@ import analyticsMixin from "@/mixins/analytics-mixin"; import store from "@/store"; import { storeActions } from "@/constants/store-actions"; 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 { applicationConfig } from "@/constants/application-config.js"; import { convertDateStringToDate } from "@/layouts/schedule/helpers/schedule-helper"; @@ -328,10 +328,17 @@ export default { const durationMinimum = store.getters.submittedOrder?.schedule?.jobMinMinutes; const durationLengthString = "Duration: "; if ( - store.getters.submittedOrder?.serviceLocation?.appointmentType === - AppointmentTypeStrings.DROP_OFF + 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) From 5b79d9ed282ced7f25bb165ad193743901f8a705 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Mon, 29 Jul 2024 16:39:17 +0530 Subject: [PATCH 4/7] CSR-2087 Leadgen widget have different case style value so need to parse with NextGen --- src/constants/store-actions.js | 1 + src/layouts/vehicle/vehicle.vue | 30 ++++++++++++++++++++++++++++++ src/store/index.js | 5 +++++ 3 files changed, 36 insertions(+) diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index acb06c41d..6249db5e7 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -98,6 +98,7 @@ const storeActions = { RESET_SUBMITTED_ORDER: "resetSubmittedOrder", RESET_LEADGEN_STATE: "resetLeadGenState", CREATE_LEADGEN_STATE: "createLeadGenState", + UPDATE_LEADGEN_MMS: "updateLeadGenMMS", }; export { storeActions }; diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index f88caad42..b61aff026 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -217,6 +217,36 @@ export default { 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. next(async (vm) => { vm.setCmsContent(resultMap.cmsContent); diff --git a/src/store/index.js b/src/store/index.js index 486140a84..510d27146 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2812,6 +2812,11 @@ export const actions = { createLeadGenState(context) { 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({ From 459682d8a091cf25a02d4574d1d0056ab604e36d Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Mon, 29 Jul 2024 16:55:47 +0530 Subject: [PATCH 5/7] CSR-2087 remove condition store.getters.applicationUser.triggeredSiteEntry not required --- src/router/index.js | 65 +++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 38 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 94c3dbe9b..f93b08ee6 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -128,50 +128,39 @@ const routes = [ (leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR" || leadGenNumberOfChips?.length > 0) ) { - if (!store.getters.applicationUser.triggeredSiteEntry) { - store.commit(storeMutations.UPDATE_IS_LEAD_GEN, true); - store.commit(storeMutations.UPDATE_LEAD_GEN_YEAR, leadGenYear); - store.commit(storeMutations.UPDATE_LEAD_GEN_MAKE, leadGenMake); - store.commit(storeMutations.UPDATE_LEAD_GEN_MODEL, leadGenModel); - store.commit(storeMutations.UPDATE_LEAD_GEN_STYLE, leadGenStyle); + store.commit(storeMutations.UPDATE_IS_LEAD_GEN, true); + store.commit(storeMutations.UPDATE_LEAD_GEN_YEAR, leadGenYear); + store.commit(storeMutations.UPDATE_LEAD_GEN_MAKE, leadGenMake); + store.commit(storeMutations.UPDATE_LEAD_GEN_MODEL, leadGenModel); + 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( - storeMutations.UPDATE_LEAD_GEN_DAMAGE_TYPE, - leadGenDamage + storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS, + leadGenNumberOfChips ); - 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( - storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS, - leadGenNumberOfChips - ); - } + } + store.commit(storeMutations.UPDATE_LEAD_GEN_ZIP_CODE, leadGenZipCode); + store.commit( + storeMutations.UPDATE_LEAD_GEN_EMAIL_ADDRESS, + leadGenEmail + ); + if (leadGenIsInsurance == "true") { + store.commit(storeMutations.UPDATE_LEAD_GEN_IS_INSURANCE, true); store.commit( - storeMutations.UPDATE_LEAD_GEN_ZIP_CODE, - leadGenZipCode + storeMutations.UPDATE_LEAD_GEN_SERVICE_PACKAGE, + leadGenServicePackage ); + } + if (leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR") { store.commit( - storeMutations.UPDATE_LEAD_GEN_EMAIL_ADDRESS, - leadGenEmail + storeMutations.UPDATE_LEAD_GEN_VIN_SELECTION, + 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 - ); - } } } From ea16e6da30f8fd1040cf8997c983284f7691fb2a Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Mon, 29 Jul 2024 18:00:04 +0530 Subject: [PATCH 6/7] CSR-2087 updating IsInsurance parameter --- src/router/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index f93b08ee6..d86c84353 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -124,7 +124,8 @@ const routes = [ leadGenIsInsurance && (leadGenDamage.toUpperCase() == "WINDSHIELDREPAIR" || leadGenVinSelection?.length > 0) && - (leadGenIsInsurance == "false" || leadGenServicePackage?.length > 0) && + (leadGenIsInsurance?.toUpperCase() == "FALSE" || + leadGenServicePackage?.length > 0) && (leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR" || leadGenNumberOfChips?.length > 0) ) { @@ -149,7 +150,7 @@ const routes = [ storeMutations.UPDATE_LEAD_GEN_EMAIL_ADDRESS, leadGenEmail ); - if (leadGenIsInsurance == "true") { + if (leadGenIsInsurance?.toUpperCase() == "TRUE") { store.commit(storeMutations.UPDATE_LEAD_GEN_IS_INSURANCE, true); store.commit( storeMutations.UPDATE_LEAD_GEN_SERVICE_PACKAGE, From c197093632e6049563e064f453df54681057c500 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Mon, 29 Jul 2024 18:55:28 +0530 Subject: [PATCH 7/7] CSR-2087 Service package --- src/router/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index d86c84353..9508a0eba 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -154,7 +154,7 @@ const routes = [ store.commit(storeMutations.UPDATE_LEAD_GEN_IS_INSURANCE, true); store.commit( storeMutations.UPDATE_LEAD_GEN_SERVICE_PACKAGE, - leadGenServicePackage + leadGenServicePackage?.toLowerCase() ); } if (leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR") {