From 863edfdeb9c1f46fab33868306ad62ac65ca292c Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Fri, 15 Sep 2023 19:43:18 +0530 Subject: [PATCH 01/78] Update index.js --- src/store/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index 5ab4f971a..f685e15ba 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -614,7 +614,7 @@ function getTimeSlotsAdditionalEventData( ) { var numberOfDays = null; if (firstAvailableAppointmentDateString) - numberOfDays = getDateDifferenceInDays(new Date(), firstAvailableAppointmentDateString); + numberOfDays = getDateDifferenceInDays(new Date().toISOString().split("T")[0], firstAvailableAppointmentDateString); if (shopAppointmentType) return `FirstAvailableAppointment:${numberOfDays},Zip:${zipCode},ShopAppointmentType:${shopAppointmentType},ProvisionalTriggers:${provisionalTriggers.join( From deebd15e1ab41a79b50c8e64193428e41dea8ccd Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Fri, 15 Sep 2023 19:50:55 +0530 Subject: [PATCH 02/78] Update index.js --- src/store/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index f685e15ba..40b58b856 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -614,7 +614,10 @@ function getTimeSlotsAdditionalEventData( ) { var numberOfDays = null; if (firstAvailableAppointmentDateString) - numberOfDays = getDateDifferenceInDays(new Date().toISOString().split("T")[0], firstAvailableAppointmentDateString); + numberOfDays = getDateDifferenceInDays( + new Date().toISOString().split("T")[0], + firstAvailableAppointmentDateString + ); if (shopAppointmentType) return `FirstAvailableAppointment:${numberOfDays},Zip:${zipCode},ShopAppointmentType:${shopAppointmentType},ProvisionalTriggers:${provisionalTriggers.join( From 6dec3371c2a7508965cfa6fa5ee46306fa62b28a Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 11 Oct 2023 14:06:21 -0400 Subject: [PATCH 03/78] Add pia to store --- src/constants/store-actions.js | 2 +- src/constants/store-mutations.js | 3 ++- src/layouts/payment-method/payment-method.vue | 16 +++++++++++++++- src/store/index.js | 19 ++++++++++++++----- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 288ceb67b..b37f0c249 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -77,7 +77,7 @@ const storeActions = { SAVE_MOLDING_QUESTION_ANSWERS: "saveMoldingQuestionAnswers", SAVE_CAPABILITY_QUESTION_ANSWERS: "saveCapabilityQuestionAnswers", SAVE_PAYMENT_TYPE: "savePaymentType", - SAVE_PAY_NOW_TYPE: "savePayNowType", + SAVE_PAYMENT_METHOD_CHOICE: "savePaymentMethodChoice", SAVE_PARENT_ACCOUNT_NUMBER: "saveParentAccountNumber", SAVE_SUPPORTING_ITEMS: "saveSupportingItems", SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING: diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 632379de3..0ace57a7e 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -48,7 +48,8 @@ const storeMutations = { UPDATE_IS_INSURANCE: "updateIsInsurance", UPDATE_SAVED_SESSION_ID: "updateSavedSessionId", UPDATE_CRM_CUSTOMER_ID: "updateCrmCustomerId", - UPDATE_PAY_NOW_TYPE: "updatePayNowType", + UPDATE_IS_PIA: "updateIsPia", + UPDATE_PIA_TYPE: "updatePiaType", WORK_ORDER_NUMBER: "updateWorkOrderNumber", // EVENT BUS MUTATIONS diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index eac00fe15..26e8c52a5 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -161,7 +161,7 @@ export default { supportingItems: null, pricedGlassParts: null, displayPaypalAlert: this.getPaypalAlert(), - paymentMethodInternalModel: null, + paymentMethodInternalModel: this.getPaymentMethodFromStore(), }; }, methods: { @@ -220,6 +220,15 @@ export default { getPaypalAlert() { return store.getters.order.payment.piaErrorCode ? true : false; }, + getPaymentMethodFromStore() { + const isPia = store.getters.order.payment.isPia; + + if (isPia) { + return store.getters.order.payment.piaType; + } else { + return paymentMethods.LATER; + } + }, vapsItemsSelectedAction(vapsItemsSelected) { this.cartItems = vapsItemsSelected; }, @@ -246,6 +255,11 @@ export default { async forwardButtonAction() { this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, null, false); this.dispatchStoreAction(this.storeActions.SAVE_WORK_ORDER_FLAG, true, false); + this.dispatchStoreAction( + this.storeActions.SAVE_PAYMENT_METHODS_CHOICE, + this.paymentMethod, + false + ); await submitWorkOrder({ pageNameToLog: "payment-method" }); this.$router.navigateWithoutSaving( this.navigationScenarios.CLICKED_FORWARD, diff --git a/src/store/index.js b/src/store/index.js index 2c2eb8492..d15c89209 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -21,6 +21,7 @@ import { militaryToTwelveHourTime, getDisplayTextForDurationLength, } from "@/layouts/schedule/helpers/schedule-helper"; +import { paymentMethods } from "@/constants/payment-method-constants"; import { getDateDifferenceInDays } from "@/helpers/date-helper"; // Export State @@ -92,7 +93,8 @@ const getDefaultState = () => { coverageStatus: null, }, parentAccountNumber: 0, - payNowType: "cc", + isPia: null, + piaType: null, piaErrorCode: null, }, schedule: { @@ -218,8 +220,11 @@ export const mutations = { updateIsInsurance(state, isInsurance) { state.order.payment.isInsurance = isInsurance; }, - updatePayNowType(state, payNowType) { - state.order.payment.payNowType = payNowType; + updateIsPia(state, isPia) { + state.order.payment.isPia = isPia; + }, + updatePiaType(state, piaType) { + state.order.payment.piaType = piaType; }, updatePiaErrorCode(state, piaErrorCode) { state.order.payment.piaErrorCode = piaErrorCode; @@ -1994,8 +1999,12 @@ export const actions = { context.commit(storeMutations.UPDATE_IS_INSURANCE, isInsurance); }, - savePayNowType(context, payNowType) { - context.commit(storeMutations.UPDATE_PAY_NOW_TYPE, payNowType); + savePaymentMethodChoice(context, paymentMethod) { + const isPia = paymentMethod !== paymentMethods.LATER; + + context.commit(storeMutations.UPDATE_IS_PIA, isPia); + + context.commit(storeMutations.UPDATE_PIA_TYPE, isPia ? paymentMethod : null); }, saveParentAccountNumber(context, parentAccountNumber) { From 6d670e43c8d9b2c4c234a7c35ee708c8e7dcc43d Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Fri, 13 Oct 2023 14:20:53 -0400 Subject: [PATCH 04/78] CSR-1679 pass useragent to determine sourceDnis --- src/store/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/store/index.js b/src/store/index.js index 094421f0d..b5ae2e911 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1550,6 +1550,7 @@ export const actions = { endpoint: endpoints.SaveSession.url, payload: { submitAfterSave: context.state.submitAfterSave, + userAgent: navigator.userAgent, applicationUser: { crmCustomerId: applicationUser.crmCustomerId, experiments: applicationUser.experiments, From 16c359ac186badfe9774bcbd6d1f821eef433c69 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Fri, 13 Oct 2023 14:30:00 -0400 Subject: [PATCH 05/78] Fix alert width for questions component. --- .../questions-page-layout.vue | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/src/fmg-components/layouts/questions-page-layout/questions-page-layout.vue b/src/fmg-components/layouts/questions-page-layout/questions-page-layout.vue index 638094e05..94456233d 100644 --- a/src/fmg-components/layouts/questions-page-layout/questions-page-layout.vue +++ b/src/fmg-components/layouts/questions-page-layout/questions-page-layout.vue @@ -10,40 +10,43 @@
+ cmsWidgetName="VehicleBannerWidget" + :displayGenericVehicleImage="false" /> - +
+
+
+
+ ref="alertFewMoreQuestions" + cmsWidgetName="alertWidget" + class="my-5" + alertClass="alert-warning" + :manualHeadline="alertFewMoreQuestionsHeader" + :manualCopy="alertFewMoreQuestionsCopy" + v-bind:isDismissible="false" />
+ ref="questionChain" + v-model="selectedAnswers[questionsDatum.answerKey]" + :questionData="questionsDatum.questions" + :index="i" + v-if="showThisQuestionChain(questionsDatum, i)" + :answerKey="questionsDatum.answerKey" + :validationRules="validationRules" />
+ ref="navbar" + cmsWidgetName="FunnelFooterWidget" + :isForwardActionDisabled="!isMetaValid" + @back-clicked="handleBackButtonAction" + @ForwardClicked="handleForwardButtonAction" />
From 0293664c5392bd3dc6fc611af1a9e6501b644ed3 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Fri, 13 Oct 2023 14:31:02 -0400 Subject: [PATCH 06/78] Format code. --- .../questions-page-layout.vue | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/fmg-components/layouts/questions-page-layout/questions-page-layout.vue b/src/fmg-components/layouts/questions-page-layout/questions-page-layout.vue index 94456233d..73d810cc7 100644 --- a/src/fmg-components/layouts/questions-page-layout/questions-page-layout.vue +++ b/src/fmg-components/layouts/questions-page-layout/questions-page-layout.vue @@ -10,8 +10,8 @@
+ cmsWidgetName="VehicleBannerWidget" + :displayGenericVehicleImage="false" />
@@ -19,34 +19,34 @@
+ ref="alertFewMoreQuestions" + cmsWidgetName="alertWidget" + class="my-5" + alertClass="alert-warning" + :manualHeadline="alertFewMoreQuestionsHeader" + :manualCopy="alertFewMoreQuestionsCopy" + v-bind:isDismissible="false" />
+ ref="questionChain" + v-model="selectedAnswers[questionsDatum.answerKey]" + :questionData="questionsDatum.questions" + :index="i" + v-if="showThisQuestionChain(questionsDatum, i)" + :answerKey="questionsDatum.answerKey" + :validationRules="validationRules" />
+ ref="navbar" + cmsWidgetName="FunnelFooterWidget" + :isForwardActionDisabled="!isMetaValid" + @back-clicked="handleBackButtonAction" + @ForwardClicked="handleForwardButtonAction" />
From bf167c17be604a86b22dc2cd34ff00551d7967e2 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Fri, 13 Oct 2023 16:00:07 -0400 Subject: [PATCH 07/78] Patch to new store value --- src/layouts/payment-method/payment-method.vue | 3 ++- src/layouts/payment/payment.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 2a0fe3c93..612d27cb6 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -271,6 +271,7 @@ export default { default: this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, null, false); this.dispatchStoreAction(this.storeActions.SAVE_WORK_ORDER_FLAG, true, false); + this.dispatchStoreAction(storeActions.SAVE_PAYMENT_METHOD_CHOICE, this.paymentMethod, false); await submitWorkOrder({ pageNameToLog: "payment-method" }); this.$router.navigateWithoutSaving( this.navigationScenarios.CLICKED_FORWARD, @@ -292,7 +293,7 @@ export default { // since we're leaving the site for pia, clear any save session promises that we will not be able to resolve when we return await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); - await this.dispatchStoreAction(storeActions.SAVE_PAY_NOW_TYPE, payNowType, false); + await this.dispatchStoreAction(storeActions.SAVE_PAYMENT_METHOD_CHOICE, this.paymentMethod, false); // make sure pia error codes are reset this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, null, false); diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index 914a51df2..2349ff5cf 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -294,7 +294,7 @@ export default { : store.getters.order.serviceLocation.provider.address.zipCode; }, getPaymentType() { - return store.getters.order.payment.payNowType; + return store.getters.order.payment.piaType; }, getHeaderLine1() { if (!this.isPaypal()) { From 0bc79148f58b6d77c88a5c7cd0f0dc094568c517 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Fri, 13 Oct 2023 16:02:18 -0400 Subject: [PATCH 08/78] CSR-1700 fix recal modal not opening. --- src/layouts/service-location/service-location.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 674c47409..eca5f5550 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -494,6 +494,9 @@ export default { this.updateAndSaveSupportingItems(); this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route); }, + openModalAction(modalName) { + this.$refs[modalName].openModal(); + }, }, watch: { selectedAppointmentType: { From 19dd003f8b835f756784df39e33390ea364cc973 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Fri, 13 Oct 2023 16:25:25 -0400 Subject: [PATCH 09/78] Don't autofill payment-method field if not defined in store --- src/layouts/payment-method/payment-method.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 612d27cb6..7123a9267 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -228,6 +228,10 @@ export default { getPaymentMethodFromStore() { const isPia = store.getters.order.payment.isPia; + if (isPia === null || isPia === undefined) { + return null; + } + if (isPia) { return store.getters.order.payment.piaType; } else { @@ -271,7 +275,11 @@ export default { default: this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, null, false); this.dispatchStoreAction(this.storeActions.SAVE_WORK_ORDER_FLAG, true, false); - this.dispatchStoreAction(storeActions.SAVE_PAYMENT_METHOD_CHOICE, this.paymentMethod, false); + this.dispatchStoreAction( + storeActions.SAVE_PAYMENT_METHOD_CHOICE, + this.paymentMethod, + false + ); await submitWorkOrder({ pageNameToLog: "payment-method" }); this.$router.navigateWithoutSaving( this.navigationScenarios.CLICKED_FORWARD, @@ -293,7 +301,11 @@ export default { // since we're leaving the site for pia, clear any save session promises that we will not be able to resolve when we return await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); - await this.dispatchStoreAction(storeActions.SAVE_PAYMENT_METHOD_CHOICE, this.paymentMethod, false); + await this.dispatchStoreAction( + storeActions.SAVE_PAYMENT_METHOD_CHOICE, + this.paymentMethod, + false + ); // make sure pia error codes are reset this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, null, false); From 119db4ade7e335be73953b37329ff281e8011782 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Fri, 13 Oct 2023 16:26:14 -0400 Subject: [PATCH 10/78] Remove unused constants --- src/constants/payment-method-constants.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/constants/payment-method-constants.js b/src/constants/payment-method-constants.js index 807e44c0e..e76724297 100644 --- a/src/constants/payment-method-constants.js +++ b/src/constants/payment-method-constants.js @@ -4,10 +4,4 @@ export const paymentMethods = { CREDIT_CARD: "CreditCard", PAYPAL: "Paypal", AFTERPAY: "Afterpay", -}; - -export const paymentTimes = { - NONE: null, - ADVANCE: "Advance", - LATER: "Later", -}; +}; \ No newline at end of file From 5e5a1ff58a98a051982947a5bd5481f1423dcfc3 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Fri, 13 Oct 2023 16:55:18 -0400 Subject: [PATCH 11/78] Make field required --- .../payment-method-question/payment-method-question.vue | 2 ++ src/layouts/payment-method/payment-method.vue | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/layouts/payment-method/payment-method-question/payment-method-question.vue b/src/layouts/payment-method/payment-method-question/payment-method-question.vue index 473e36114..1544cede7 100644 --- a/src/layouts/payment-method/payment-method-question/payment-method-question.vue +++ b/src/layouts/payment-method/payment-method-question/payment-method-question.vue @@ -8,6 +8,7 @@ :questionText="paymentMethodQuestionText" :answers="paymentMethodAnswerData" isRequired + :validationRules="validationRules" v-model="selectedMethod" textPosition="text-start" /> @@ -27,6 +28,7 @@ export default { }, props: { modelValue: String, + validationRules: String, }, methods: { getAnswersNullSafe(widgetName) { diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 7123a9267..071af5138 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -42,7 +42,8 @@ + v-model="paymentMethodInternalModel" + validationRules="option-required" /> Date: Fri, 13 Oct 2023 16:55:26 -0400 Subject: [PATCH 12/78] Formatting --- src/constants/payment-method-constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants/payment-method-constants.js b/src/constants/payment-method-constants.js index e76724297..0799f2b2a 100644 --- a/src/constants/payment-method-constants.js +++ b/src/constants/payment-method-constants.js @@ -4,4 +4,4 @@ export const paymentMethods = { CREDIT_CARD: "CreditCard", PAYPAL: "Paypal", AFTERPAY: "Afterpay", -}; \ No newline at end of file +}; From bd7be85511a465028694557dba95e1710959db3c Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Mon, 16 Oct 2023 17:03:57 +0530 Subject: [PATCH 13/78] CSR-1417 remove getFullDayName and getFullMonthName from date-helper and use from schedule helper --- src/helpers/date-helper.js | 16 --------------- src/helpers/date-helper.spec.js | 19 +----------------- .../add-to-calendar/add-to-calendar.vue | 2 +- src/layouts/confirmation/confirmation.vue | 20 +++++++++---------- 4 files changed, 12 insertions(+), 45 deletions(-) diff --git a/src/helpers/date-helper.js b/src/helpers/date-helper.js index d42ad326f..7a8c3e71d 100644 --- a/src/helpers/date-helper.js +++ b/src/helpers/date-helper.js @@ -7,22 +7,6 @@ export function getDateDifferenceInDays(startDate, endDate) { // Convert milliseconds to days and return the result return difference / (1000 * 3600 * 24); } -export function getFullDayName(date) { - // Use a ternary operator to check if the input is a valid date object - return date instanceof Date - ? // Use the built-in method toLocaleDateString() to get the full day name in the current locale - date.toLocaleDateString(undefined, { weekday: "long" }) - : // Return undefined if the input is not a valid date object - undefined; -} -export function getFullMonthName(date) { - // Use a ternary operator to check if the input is a valid date object - return date instanceof Date - ? // Use the built-in method toLocaleDateString() to get the full month name in the current locale - date.toLocaleDateString(undefined, { month: "long" }) - : // Return undefined if the input is not a valid date object - undefined; -} export function get12HourTimeFormat(time) { // Check correct time format and split into components time = time.toString().match(/^([01]\d|2[0-3])(:)([0-5]\d)?$/) || [time]; diff --git a/src/helpers/date-helper.spec.js b/src/helpers/date-helper.spec.js index 4ea2157f5..b78397e0f 100644 --- a/src/helpers/date-helper.spec.js +++ b/src/helpers/date-helper.spec.js @@ -1,6 +1,4 @@ import { - getFullDayName, - getFullMonthName, get12HourTimeFormat, get12HourTimeMobileFormat, getDateFormat, @@ -49,22 +47,6 @@ describe("date-helper.js", () => { expect(result).toEqual(testCase.expected); } }); - it("getFullMonthName should return full month format.", () => { - // Arrange / Act - const date = new Date("2023-10-01"); - const monthName = getFullMonthName(date); - - // Assert - expect(monthName).toEqual("October"); - }); - it("getFullDayName should return full Day Name format.", () => { - // Arrange / Act - const date = new Date("2023-10-01"); - const dayName = getFullDayName(date); - - // Assert - expect(dayName).toEqual("Sunday"); - }); it("getDateFormat should return date in the given format.", () => { // Arrange / Act const date = new Date("2023-10-01"); @@ -74,6 +56,7 @@ describe("date-helper.js", () => { // Assert expect(formattedDate).toEqual("2023-10-01"); }); + it("should return the correct difference in days", function () { // Define some sample dates and their expected differences const testCases = [ diff --git a/src/layouts/add-to-calendar/add-to-calendar.vue b/src/layouts/add-to-calendar/add-to-calendar.vue index b0306b5d0..0b856e72d 100644 --- a/src/layouts/add-to-calendar/add-to-calendar.vue +++ b/src/layouts/add-to-calendar/add-to-calendar.vue @@ -127,7 +127,7 @@ export default { serviceType() { const isRepair = store.getters.order.damage.isRepair; const funnelHasRecalibrationPart = store.getters.funnelHasRecalibrationPart; - if (isRepair) { + if (!isRepair) { if (funnelHasRecalibrationPart) { return "replacement and recalibration"; } else { diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index cb7ca43c1..5fa24856d 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -55,15 +55,11 @@ import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { AppointmentTypeStrings } 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"; import { Form } from "vee-validate"; import store from "@/store"; -import { - getFullDayName, - getFullMonthName, - get12HourTimeFormat, - get12HourTimeMobileFormat, -} from "@/helpers/date-helper"; +import { get12HourTimeFormat, get12HourTimeMobileFormat } from "@/helpers/date-helper"; export default { name: "confirmation", async beforeRouteEnter(to, from, next) { @@ -174,10 +170,14 @@ export default { return `${this.ProviderAddress},
${this.ProviderCity}, ${this.ProviderState} ${this.ProviderZipCode}`; }, ScheduleDateFormatted() { - const scheduleDate = new Date(this.ScheduleDate); - return `${getFullDayName(scheduleDate)}, ${getFullMonthName( - scheduleDate - )} ${scheduleDate.getDate()}`; + // This conversion ensures we don't get get GMT induced date changes + const dateObject = convertDateStringToDate(this.ScheduleDate); + // Ex: Tuesday, April 22 + return dateObject.toLocaleDateString("en-us", { + weekday: "long", + month: "long", + day: "numeric", + }); }, ScheduleTimeFormatted() { if (this.AppointmentType == AppointmentTypeStrings.MOBILE) { From 1c48dc856a678108b17ca8b9c6fe0a92066131e4 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Mon, 16 Oct 2023 17:54:54 +0530 Subject: [PATCH 14/78] service-type constant file service-type constant file added --- src/constants/service-type.js | 6 +++++ .../add-to-calendar/add-to-calendar.spec.js | 24 +++++++------------ .../add-to-calendar/add-to-calendar.vue | 7 +++--- 3 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 src/constants/service-type.js diff --git a/src/constants/service-type.js b/src/constants/service-type.js new file mode 100644 index 000000000..5cb6a277a --- /dev/null +++ b/src/constants/service-type.js @@ -0,0 +1,6 @@ +const serviceType = { + REPLACEMENT: "replacement", + REPAIR: "repair", + REPLACEMENT_AND_RECALIBRATION: "replacement and recalibration", +}; +export { serviceType }; diff --git a/src/layouts/add-to-calendar/add-to-calendar.spec.js b/src/layouts/add-to-calendar/add-to-calendar.spec.js index 1e3e5ae4e..645e3b12f 100644 --- a/src/layouts/add-to-calendar/add-to-calendar.spec.js +++ b/src/layouts/add-to-calendar/add-to-calendar.spec.js @@ -77,9 +77,9 @@ describe("Add-to-calendar methods...", () => { //Assert expect(wrapper.vm.$refs.calendarModalQuestion.openModal).toBeCalled(); }); - test("serviceType should return 'replacement and recalibration' when isRepair and funnelHasRecalibrationPart true.", () => { + test("serviceType should return 'replacement and recalibration' when isRepair is false and funnelHasRecalibrationPart true.", () => { //Arrange - store.getters.order.damage.isRepair = true; + store.getters.order.damage.isRepair = false; store.getters.funnelHasRecalibrationPart = true; const { wrapper } = setupMocks({}); @@ -89,9 +89,9 @@ describe("Add-to-calendar methods...", () => { //Assert expect(testValue).toEqual("replacement and recalibration"); }); - test("serviceType should return 'replacement' when isRepair is true and funnelHasRecalibrationPart is false.", () => { + test("serviceType should return 'replacement' when isRepair is false and funnelHasRecalibrationPart is false.", () => { //Arrange - store.getters.order.damage.isRepair = true; + store.getters.order.damage.isRepair = false; store.getters.funnelHasRecalibrationPart = false; const { wrapper } = setupMocks({}); @@ -101,9 +101,9 @@ describe("Add-to-calendar methods...", () => { //Assert expect(testValue).toEqual("replacement"); }); - test("serviceType should return 'repair' when isRepair is false.", () => { + test("serviceType should return 'repair' when isRepair is true.", () => { //Arrange - store.getters.order.damage.isRepair = false; + store.getters.order.damage.isRepair = true; const { wrapper } = setupMocks({}); //Act @@ -126,7 +126,7 @@ describe("Add-to-calendar methods...", () => { test("getappointmentData should return expected model value for appointmentType mobile.", () => { //Arrange store.getters.order.serviceLocation.appointmentType = AppointmentTypeStrings.MOBILE; - store.getters.order.damage.isRepair = true; + store.getters.order.damage.isRepair = false; store.getters.funnelHasRecalibrationPart = true; const { wrapper } = setupMocks({}); @@ -176,7 +176,7 @@ describe("Add-to-calendar methods...", () => { test("getappointmentData should return expected model value for appointmentType DROP_OFF.", () => { //Arrange store.getters.order.serviceLocation.appointmentType = AppointmentTypeStrings.DROP_OFF; - store.getters.order.damage.isRepair = false; + store.getters.order.damage.isRepair = true; const { wrapper } = setupMocks({}); //Act @@ -188,7 +188,7 @@ describe("Add-to-calendar methods...", () => { test("getappointmentData should return expected model value for appointmentType IN_SHOP.", () => { //Arrange store.getters.order.serviceLocation.appointmentType = AppointmentTypeStrings.IN_SHOP; - store.getters.order.damage.isRepair = false; + store.getters.order.damage.isRepair = true; const { wrapper } = setupMocks({}); //Act @@ -239,12 +239,6 @@ function setupMocks({ customMountOptions }) { }); const wrapper = shallowMount(addToCalendar, mountOptions); - - //wrapper.vm.setCmsContent = jest.fn(); - //wrapper.vm.$refs.datePicker.initializeComponent = jest.fn(); - //wrapper.vm.$refs.locationAlerts.initializeComponent = jest.fn(); - //wrapper.vm.$refs.funnelFooter.updateButtonText = jest.fn(); wrapper.vm.$refs.calendarModalQuestion.openModal = jest.fn(); - return { wrapper }; } diff --git a/src/layouts/add-to-calendar/add-to-calendar.vue b/src/layouts/add-to-calendar/add-to-calendar.vue index 0b856e72d..3f32a525b 100644 --- a/src/layouts/add-to-calendar/add-to-calendar.vue +++ b/src/layouts/add-to-calendar/add-to-calendar.vue @@ -32,6 +32,7 @@ import { import { getCalendarFile, download } from "@/helpers/add-to-calendar-helper"; import { AppointmentTypeStrings, RouteCodeFlags } from "@/constants/schedule-constants"; import store from "@/store"; +import { serviceType } from "@/constants/service-type"; export default { name: "add-to-calendar", @@ -129,12 +130,12 @@ export default { const funnelHasRecalibrationPart = store.getters.funnelHasRecalibrationPart; if (!isRepair) { if (funnelHasRecalibrationPart) { - return "replacement and recalibration"; + return serviceType.REPLACEMENT_AND_RECALIBRATION; } else { - return "replacement"; + return serviceType.REPLACEMENT; } } - return "repair"; + return serviceType.REPAIR; }, routeCode() { return store.getters.order.schedule.routeCode; From f0d7926b1007287bd5ba9ca659a35b720156c93d Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 16 Oct 2023 08:31:16 -0400 Subject: [PATCH 15/78] Additional refactoring per tech review --- .../service-location-helper.js | 12 +++ .../mobile-location-modal-questions.vue | 8 +- .../service-location/service-location.vue | 90 +++++++++---------- .../service-zip-modal-question.vue | 9 +- .../shop-question/shop-question.vue | 68 +++++++------- 5 files changed, 86 insertions(+), 101 deletions(-) diff --git a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js index cb4c06100..26f2e6962 100644 --- a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js +++ b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js @@ -46,6 +46,18 @@ export async function getServiceabilityDetails(serviceZipCode, lineItems, pageNa return Promise.resolve(serviceabilityDetails); } +export async function getShopProviderData(serviceZipCode) { + const shopProviderData = await baseMixin.methods.dispatchStoreActionWithLogging( + storeActions.GET_PROVIDERS, + { + serviceZipCode: serviceZipCode, + }, + "service-location" + ); + + return Promise.resolve(shopProviderData); +} + export async function getAvailabilityRating( startDate, endDate, diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index 58420ce3a..8bac8dbb4 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -145,9 +145,6 @@ export default { alertInvalidZipWidgetName: String, customComponentId: String, validationRules: String, - onZipUpdateCallback: { - type: Function, - }, }, computed: { mobileLocationLinkPromptText() { @@ -256,10 +253,7 @@ export default { this.$emit("updated-serviceability", serviceabilityDetails.data); this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); - if (this.onZipUpdateCallback) { - await this.onZipUpdateCallback(serviceZipCode); - } - // Update the page level model + // update the page level model this.$emit("update:modelValue", this.internalModel); this.closeModal(); diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 674c47409..b1f296a60 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -20,7 +20,7 @@ @updated-contains-military-base="setContainsMilitaryBase" linkWidgetName="ServiceZipLinkWidget" modalWidgetName="ServiceZipModalWidget" - :onZipUpdateCallback="reloadShopData" /> + /> + /> @@ -135,6 +135,7 @@ import { settleAllPromises } from "@/helpers/layout-helper"; import { getPricedMobileFeePart, getServiceabilityDetails, + getShopProviderData, } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper"; import { Provider } from "@/layouts/service-location/classes/provider"; @@ -180,7 +181,7 @@ export default { mobileFeePart: null, zipContainsMilitaryBase: false, zipCodeCtu: null, - providerData: null, + shopProviderData: null, }; }, async beforeRouteEnter(to, from, next) { @@ -188,7 +189,7 @@ export default { const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); const serviceZipCode = store.getters.order.serviceLocation.zipCode; - const getZipCodeData = baseMixin.methods.getZipCodeData(serviceZipCode, "service-location"); + const zipCodeDataPromise = baseMixin.methods.getZipCodeData(serviceZipCode, "service-location"); const serviceabilityDetailsPromise = getServiceabilityDetails( serviceZipCode, @@ -198,7 +199,7 @@ export default { const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, "service-location"); - const shopQuestionInitialDataPromise = shopQuestion.methods.loadInitialData(serviceZipCode); + const shopProviderDataPromise = getShopProviderData(serviceZipCode); // shopQuestion.methods.loadInitialData(serviceZipCode); // Settle promises and get results const promiseResultMap = [ @@ -206,6 +207,10 @@ export default { resultKey: "cmsContent", promise: cmsContentPromise, }, + { + resultKey: "zipCodeData", + promise: zipCodeDataPromise, + }, { resultKey: "mobileFeePart", promise: mobileFeePartPromise, @@ -215,12 +220,8 @@ export default { promise: serviceabilityDetailsPromise, }, { - resultKey: "zipCodeData", - promise: getZipCodeData, - }, - { - resultKey: "shopQuestionInitialData", - promise: shopQuestionInitialDataPromise, + resultKey: "shopProviderData", + promise: shopProviderDataPromise, }, ]; @@ -232,14 +233,9 @@ export default { vm.setData( resultMap.zipCodeData, resultMap.serviceabilityDetails, - resultMap.mobileFeePart + resultMap.mobileFeePart, + resultMap.shopProviderData ); - - // Initialize the Shop Question component - vm.$refs.shopQuestion.initializeComponent(resultMap.shopQuestionInitialData); - - // Initialize the page level shop data - vm.providerData = resultMap.shopQuestionInitialData; }); }, computed: { @@ -254,7 +250,7 @@ export default { if (newValue.zipCode !== this.zipCode) { this.resetMobileLocation(); this.selectedAppointmentType = null; - this.selectedProvider = null; + this.selectedProvider = new Provider(); } this.state = newValue.state; @@ -277,20 +273,14 @@ export default { }; }, set: function (newValue) { - this.streetAddress = newValue.addressQuestions.streetAddress; - this.apartmentNumberOrBusinessName = - newValue.addressQuestions.apartmentNumberOrBusinessName; - this.city = newValue.addressQuestions.city; - this.state = newValue.addressQuestions.state; - this.zipCode = newValue.addressQuestions.zipCode; - this.isVehicleProtected = newValue.isVehicleProtected; - - if (newValue.zipCode !== this.zipCode) { - if (!this.selectedAppointmentType == "Mobile") { - this.selectedAppointmentType = null; - } - this.selectedProvider = null; + if (newValue.addressQuestions.zipCode !== this.zipCode) { + getShopProviderData(newValue.addressQuestions.zipCode).then((result) => { + this.shopProviderData = result.data; + this.selectedProvider = new Provider(this.shopProviderData.mobileProviderNumber); + }); } + + this.setMobileLocation(newValue); }, }, isServiceableMobile() { @@ -355,7 +345,7 @@ export default { store.getters.payment.isInsurance !== null ); }, - setData(zipCodeData, serviceabilityDetails, mobileFeePart) { + setData(zipCodeData, serviceabilityDetails, mobileFeePart, shopProviderData) { if (zipCodeData) { this.zipContainsMilitaryBase = zipCodeData.containsMilitaryBase; this.zipCodeCtu = zipCodeData.zipCodeCtu; @@ -368,6 +358,10 @@ export default { if (mobileFeePart) { this.mobileFeePart = mobileFeePart; } + + if (shopProviderData) { + this.shopProviderData = shopProviderData; + } }, setContainsMilitaryBase(val) { if (this.zipContainsMilitaryBase !== val) { @@ -416,12 +410,18 @@ export default { this.isRecalibrationServiceableMobile = serviceabilityDetails.isRecalibrationServiceableMobile; }, + setMobileLocation(mobileLocation) { + this.streetAddress = mobileLocation.addressQuestions.streetAddress; + this.apartmentNumberOrBusinessName = + mobileLocation.addressQuestions.apartmentNumberOrBusinessName; + this.city = mobileLocation.addressQuestions.city; + this.state = mobileLocation.addressQuestions.state; + this.zipCode = mobileLocation.addressQuestions.zipCode; + this.isVehicleProtected = mobileLocation.isVehicleProtected; + }, async reloadShopData(zipCode) { await this.$refs.shopQuestion.reloadShopData(zipCode); }, - setUpdatedShopList(providerData) { - this.providerData = providerData; - }, openRecalibrationInformationModal() { this.recalibrationInformationModal.openModal(); }, @@ -497,18 +497,12 @@ export default { }, watch: { selectedAppointmentType: { - handler(newValue) { + async handler(newValue) { if (newValue === "Mobile") { - this.selectedProvider = new Provider(this.providerData.mobileProviderNumber); - } else { - this.selectedProvider = new Provider(); - } - }, - }, - providerData: { - handler(newValue) { - if (newValue === "Mobile") { - this.selectedProvider = new Provider(this.providerData.mobileProviderNumber); + getShopProviderData(this.zipCode).then(async (result) => { + this.shopProviderData = result.data; + this.selectedProvider = new Provider(this.shopProviderData.mobileProviderNumber); + }); } else { this.selectedProvider = new Provider(); } diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue index 34a3d23c1..35276228d 100644 --- a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue +++ b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue @@ -68,9 +68,6 @@ export default { }, linkWidgetName: String, modalWidgetName: String, - onZipUpdateCallback: { - type: Function, - }, }, computed: { serviceZipLinkText() { @@ -164,13 +161,9 @@ export default { this.$emit("updated-serviceability", serviceabilityDetails.data); this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); - // Update the page level model + // update the page level model this.$emit("update:modelValue", this.internalModel); - if (this.onZipUpdateCallback) { - await this.onZipUpdateCallback(serviceZipCode); - } - this.closeModal(); } } else { diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index c3f31c68d..30b39f1b0 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -63,7 +63,6 @@ export default { mixins: [baseMixin], data() { return { - shopProviders: [], shopListButton: shopListButton, answers: [], shopIndex: 0, @@ -76,6 +75,7 @@ export default { default: () => null, }, selectedAppointmentType: String, + shopProviderData: Array, cmsWidgetName: String, validationRules: String, isDisplayed: Boolean, @@ -84,6 +84,9 @@ export default { questionText() { return this.getCmsContent(this.cmsWidgetName, "QuestionText"); }, + shopProviders() { + return this.shopProviderData?.shopProviders ?? []; + }, selectedValue: { get: function () { return this.modelValue; @@ -124,22 +127,23 @@ export default { }, }, methods: { - loadInitialData(serviceZipCode) { - return this.loadData(serviceZipCode); - }, - loadData(serviceZipCode) { - return baseMixin.methods.dispatchStoreActionWithLogging( - storeActions.GET_PROVIDERS, - { - serviceZipCode: serviceZipCode, - }, - "service-location" - ); - }, - initializeComponent(shopQuestionInitialData) { - this.shopProviders = shopQuestionInitialData.shopProviders; - this.$emit("updated-shop-list", shopQuestionInitialData); - }, + // loadInitialData(serviceZipCode) { + // return this.loadData(serviceZipCode); + // }, + // loadData(serviceZipCode) { + // return getShopProviders(serviceZipCode); + // // return baseMixin.methods.dispatchStoreActionWithLogging( + // // storeActions.GET_PROVIDERS, + // // { + // // serviceZipCode: serviceZipCode, + // // }, + // // "service-location" + // // ); + // }, + // initializeComponent(shopQuestionInitialData) { + // this.shopProviders = shopQuestionInitialData.shopProviders; + // this.$emit("updated-shop-list", shopQuestionInitialData); + // }, async getNextShopsFromList(numberToGet = 3) { const shopIterator = (array, n) => { const l = array.length; @@ -199,15 +203,6 @@ export default { this.answers = []; this.shopIndex = 0; }, - async reloadShopData(serviceZipCode) { - const result = await this.loadData(serviceZipCode); - this.initializeComponent(result.data); - - this.resetAnswers(); - - await nextTick(); - await this.getNextShopsFromList(); - }, getSelectedProviderObject(providerNumber) { const provider = this.shopProviders?.find((provider) => provider.providerNumber == providerNumber) ?? @@ -239,19 +234,16 @@ export default { shopProviders: { async handler(newValue) { await nextTick(); + const selectedShopIndex = this.getSelectedProviderIndex( + newValue, + this.selectedProviderNumber + ); - if (this.selectedAppointmentType) { - const selectedShopIndex = this.getSelectedProviderIndex( - newValue, - this.selectedProviderNumber - ); - - if (selectedShopIndex >= 3) { - await this.getNextShopsFromList(selectedShopIndex + 1); - } else { - await this.getNextShopsFromList(); - await nextTick(); - } + if (selectedShopIndex >= 3) { + await this.getNextShopsFromList(selectedShopIndex + 1); + } else { + await this.getNextShopsFromList(); + await nextTick(); } }, }, From 3d23bdbabcb1ed2e71b6ec8be3a24c6aaf2a2fb6 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Mon, 16 Oct 2023 08:38:23 -0400 Subject: [PATCH 16/78] CSR-1593 set column width to control overly-wide components on larger screens. Change scroll to auto for modals to avoid ghost scrollbars when not needed. Center content on all screen sizes. --- src/digital-components/modal/modal.vue | 2 +- .../questions-page-layout.vue | 6 +++--- src/layouts/address-lookup/address-lookup.vue | 2 +- .../address-vehicles/address-vehicles.vue | 2 +- src/layouts/confirmation/confirmation.vue | 2 +- .../customer-details/customer-details.vue | 2 +- src/layouts/estimate/estimate.vue | 2 +- .../license-plate-lookup.vue | 2 +- src/layouts/payment-method/payment-method.vue | 2 +- src/layouts/quote/quote.vue | 2 +- src/layouts/schedule/schedule.vue | 2 +- .../service-location/service-location.vue | 8 ++++---- src/layouts/vehicle-damage/vehicle-damage.vue | 8 ++++---- src/layouts/vehicle-parts/vehicle-parts.vue | 4 ++-- src/layouts/vin-lookup/vin-lookup.vue | 2 +- src/styles/common-styles.scss | 18 ++++++++++++++++++ 16 files changed, 42 insertions(+), 24 deletions(-) diff --git a/src/digital-components/modal/modal.vue b/src/digital-components/modal/modal.vue index e0353829c..413ca0369 100644 --- a/src/digital-components/modal/modal.vue +++ b/src/digital-components/modal/modal.vue @@ -179,7 +179,7 @@ export default { } } @include media-breakpoint-up(md) { - overflow: scroll; + overflow: auto; flex: none; } } diff --git a/src/fmg-components/layouts/questions-page-layout/questions-page-layout.vue b/src/fmg-components/layouts/questions-page-layout/questions-page-layout.vue index 73d810cc7..8fc382bf0 100644 --- a/src/fmg-components/layouts/questions-page-layout/questions-page-layout.vue +++ b/src/fmg-components/layouts/questions-page-layout/questions-page-layout.vue @@ -7,7 +7,7 @@ -
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index 9568b2a13..6e5fc0f09 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -6,7 +6,7 @@
-
+
-
+
diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index ac167cae9..fc3756b6d 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -6,7 +6,7 @@
-
+
-
+
-
+
-
+
@@ -22,6 +23,10 @@ export default { name: "content-group-modal", props: { cmsWidgetName: String, + footerButtonActionName: { + type: String, + default: null, + }, }, computed: { ModalName() { @@ -50,10 +55,16 @@ export default { openModal() { this.$refs[this.ModalName].openModal(); }, - - footerButtonClick() { + closeModal() { this.$refs[this.ModalName].closeModal(); }, + footerButtonClick() { + if (this.footerButtonActionName) { + this.$emit(this.footerButtonActionName, this.ModalName); + } else { + this.closeModal(); + } + }, }, components: { modal, diff --git a/src/fmg-components/add-vaps-modal-buttons/add-vaps-button/add-vaps-button.vue b/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-button/add-vaps-button.vue similarity index 100% rename from src/fmg-components/add-vaps-modal-buttons/add-vaps-button/add-vaps-button.vue rename to src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-button/add-vaps-button.vue diff --git a/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue b/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue new file mode 100644 index 000000000..a01d2d39f --- /dev/null +++ b/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue @@ -0,0 +1,177 @@ + + + diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 45565d536..e0bf475ac 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -42,12 +42,10 @@
+ vapsTilesCmsName="VapsProductTiles" /> - { @@ -320,7 +308,6 @@ export default { ); } }, - async piaSetup(payNowType) { this.$refs.loadingModal.showModal(); @@ -398,7 +385,6 @@ export default { cart, alert, addVapsModalButtons, - contentGroupModal, paymentMethodQuestion, }, }; From 8c7e1953a96f5911fa91a46b37eee2cf49415566 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Fri, 20 Oct 2023 10:11:15 -0400 Subject: [PATCH 65/78] Update unit test. --- src/layouts/vehicle/vehicle.spec.js | 38 ++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/src/layouts/vehicle/vehicle.spec.js b/src/layouts/vehicle/vehicle.spec.js index 56b46292d..e8671b7a8 100644 --- a/src/layouts/vehicle/vehicle.spec.js +++ b/src/layouts/vehicle/vehicle.spec.js @@ -5,17 +5,25 @@ import vehicle from "@/layouts/vehicle/vehicle.vue"; import { shallowMount } from "@vue/test-utils"; import { nextTick } from "vue"; import { getMountOptions } from "@/helpers/unit-test-helper.js"; +import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; +import baseMixin from "../../mixins/base-mixin"; // Mock our module for promises. jest.mock("@/helpers/layout-helper.js", () => ({ settleAllPromises: jest.fn(), })); +// Mock fetchCmsContentForPage +jest.mock("@/helpers/cms-content-helper", () => ({ + fetchCmsContentForPage: jest.fn(), +})); + describe("vehicle.vue", () => { test("arePagePrerequisitesValid should be true ", async () => { //Arrange const { wrapper } = setupMocks(); + //Act let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid(); await nextTick(); @@ -40,17 +48,25 @@ describe("vehicle.vue", () => { }); function setupMocks() { - const wrapper = shallowMount( - vehicle, - getMountOptions({ - router: { - navigate: jest.fn(), - navigate: jest.fn(), - navigateWithSaving: jest.fn(), - navigateWithoutSaving: jest.fn(), - }, - }) - ); + + const mountOptions = getMountOptions({ + router: { + navigate: jest.fn(), + navigate: jest.fn(), + navigateWithSaving: jest.fn(), + navigateWithoutSaving: jest.fn(), + }, + }); + + //Mock props + const mockMixin = { + methods: { + getCmsContent: jest.fn(), + }, + }; + + mountOptions.mixins = [mockMixin]; + const wrapper = shallowMount(vehicle, mountOptions); return { wrapper }; } From b16c36d2cf33b4ae8065c024cb7f6d78117367a3 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Fri, 20 Oct 2023 10:17:25 -0400 Subject: [PATCH 66/78] format code. --- src/layouts/vehicle/vehicle.spec.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/layouts/vehicle/vehicle.spec.js b/src/layouts/vehicle/vehicle.spec.js index e8671b7a8..74d29071a 100644 --- a/src/layouts/vehicle/vehicle.spec.js +++ b/src/layouts/vehicle/vehicle.spec.js @@ -23,7 +23,6 @@ describe("vehicle.vue", () => { //Arrange const { wrapper } = setupMocks(); - //Act let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid(); await nextTick(); @@ -48,7 +47,6 @@ describe("vehicle.vue", () => { }); function setupMocks() { - const mountOptions = getMountOptions({ router: { navigate: jest.fn(), From 047ed9855054b44f639820e1757da615b1d411f4 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Fri, 20 Oct 2023 19:51:09 +0530 Subject: [PATCH 67/78] remove calendar url from vue config remove calendar url from vue config --- src/constants/application-config.js | 7 ++++--- vue.config.js | 3 --- vue.release.config.js | 3 --- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/constants/application-config.js b/src/constants/application-config.js index 438cc9885..7105e63bd 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -21,9 +21,10 @@ const applicationConfig = { "//" + location.host + "/fmg/?fmgPage=payment-method&src=concept-funnel", - GOOGLE_CALENDAR: process.env.VUE_APP_GOOGLE_CALENDAR, - YAHOO_CALENDAR: process.env.VUE_APP_YAHOO_CALENDAR, - OUTLOOK_CALENDAR: process.env.VUE_APP_OUTLOOK_CALENDAR, + GOOGLE_CALENDAR: "https://www.google.com/calendar/render?action=TEMPLATE", + YAHOO_CALENDAR: "https://calendar.yahoo.com/?v=60", + OUTLOOK_CALENDAR: + "https://outlook.office.com/calendar/deeplink/compose?path=/calendar/action/compose&rru=addevent", }; export { applicationConfig }; diff --git a/vue.config.js b/vue.config.js index f105d8e30..a8c6ee8f8 100644 --- a/vue.config.js +++ b/vue.config.js @@ -6,9 +6,6 @@ process.env.VUE_APP_MY_ACCOUNT = "https://myaccountdev.safelite.com/"; //process.env.VUE_APP_SAFELITE_HOP = "http://localhost:60966/fmgCheckoutEmbedded.aspx"; process.env.VUE_APP_SAFELITE_HOP = "https://sv2-safelitehop-sys.safelite.com/fmgCheckoutEmbedded.aspx"; -process.env.VUE_APP_GOOGLE_CALENDAR = "https://www.google.com/calendar/render?action=TEMPLATE"; -process.env.VUE_APP_YAHOO_CALENDAR = "https://calendar.yahoo.com/?v=60"; -process.env.VUE_APP_OUTLOOK_CALENDAR = "https://outlook.office.com/calendar/deeplink/compose?path=/calendar/action/compose&rru=addevent"; // GA & GTM process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = diff --git a/vue.release.config.js b/vue.release.config.js index d3a16cc35..ec84c2d2a 100644 --- a/vue.release.config.js +++ b/vue.release.config.js @@ -5,9 +5,6 @@ process.env.VUE_APP_CURRENT_ENVIRONMENT = "__VUE_APP_CURRENT_ENVIRONMENT__"; process.env.VUE_APP_MY_ACCOUNT = "__VUE_APP_MY_ACCOUNT__"; process.env.VUE_APP_SAFELITE_HOP = "__VUE_APP_SAFELITE_HOP__"; -process.env.VUE_APP_GOOGLE_CALENDAR = "__VUE_APP_GOOGLE_CALENDAR__"; -process.env.VUE_APP_YAHOO_CALENDAR = "__VUE_APP_YAHOO_CALENDAR__"; -process.env.VUE_APP_OUTLOOK_CALENDAR = "__VUE_APP_OUTLOOK_CALENDAR__"; // GA & GTM process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = "__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__"; From 2be4b378c136af2874297d20a162260e49df9f08 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 20 Oct 2023 10:38:13 -0400 Subject: [PATCH 68/78] CSR-1384: remove outdated code --- .../add-vaps-modal-buttons.vue | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue b/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue index a01d2d39f..3fc426d63 100644 --- a/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue +++ b/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue @@ -73,21 +73,8 @@ export default { }, }, computed: { - currentCartItems: { - get: function () { - return this.modelValue; - }, - set: function (newValue) { - // does this.modelValue.vaps have this vap in it already? - const inCart = this.currentCartItems.vaps?.some((vap) => { - return vap.partType === "RAIN DEFENSE"; - }); - const newCartItems = this.currentCartItems; - if (!inCart) { - newCartItems.vaps.push(newValue); - } - this.$emit("update:modelValue", newCartItems); - }, + currentCartItems() { + return this.modelValue; }, showAddRainDefense() { // show if not in cart From 7c60a4c0698fbc9d2ea7021682dff2d4e20d8506 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Fri, 20 Oct 2023 11:20:03 -0400 Subject: [PATCH 69/78] Fixed the NaN issue that was introduced with Tax stuff --- src/store/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 852bb1570..9a2e8054d 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2516,8 +2516,7 @@ function convertGlassPieceNamingFromApi(glassArray) { } function addPricesToLineItems(lineItems, pricingLineItems) { - const pricedLineItems = deepClone(lineItems); - pricedLineItems.forEach((lineItem) => { + lineItems.forEach((lineItem) => { let lineItemIndex = pricingLineItems.findIndex( (pricingLineItem) => pricingLineItem.partNumber === lineItem.partNumber ); @@ -2533,7 +2532,7 @@ function addPricesToLineItems(lineItems, pricingLineItems) { lineItem.salesTax = pricedLineItem.salesTax; }); - return pricedLineItems; + return lineItems; } function addTaxesToPricedLineItems(lineItems, taxingLineItems) { From dee4e36ba75113d1c070127e6a8a0b460a5630fc Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Fri, 20 Oct 2023 13:18:54 -0400 Subject: [PATCH 70/78] CSR-1715 fix spacing. --- src/layouts/schedule/schedule.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 704ad007d..ff1961465 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -9,7 +9,7 @@
- +