From 6e658992cd027ecf2a661ffce36a6886ebe90625 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 19 Oct 2023 10:21:09 -0400 Subject: [PATCH 01/38] Save & reorganize --- src/layouts/payment-method/payment-method.vue | 35 +++++++------------ 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 731017d18..09463ba85 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -292,24 +292,29 @@ export default { this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); }, async forwardButtonAction() { + await this.dispatchStoreAction( + storeActions.SAVE_PAYMENT_METHOD_CHOICE, + this.paymentMethod, + false + ); + + await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false); + + await this.dispatchStoreAction(storeActions.SAVE_PROMOS, this.lineItems.promos, false); + switch (this.paymentMethod) { case paymentMethods.CREDIT_CARD: - this.piaSetup("cc"); + this.piaSetup(this.paymentMethod); break; case paymentMethods.PAYPAL: - this.piaSetup("pp"); + this.piaSetup(this.paymentMethod); break; case paymentMethods.AFTERPAY: - this.piaSetup("ap"); + this.piaSetup(this.paymentMethod); break; 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, @@ -317,25 +322,11 @@ export default { ); } }, - async ccdPayment() { - this.piaSetup("cc"); - }, - async paypal() { - this.piaSetup("pp"); - }, - async afterpay() { - this.piaSetup("ap"); - }, async piaSetup(payNowType) { this.$refs.loadingModal.showModal(); // 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 - ); // make sure pia error codes are reset this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, null, false); From f90dd07480e725dcb4aac4b7f10300c5f94b3dab Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 19 Oct 2023 14:47:22 -0400 Subject: [PATCH 02/38] Patch for carl's code --- src/layouts/payment/payment.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index d6a6394fe..098f2a521 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -168,6 +168,7 @@ import { externalUrls } from "@/router/router-constants/externalUrl-values"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; import { applicationConfig } from "@/constants/application-config"; +import { paymentMethods } from "@/constants/payment-method-constants"; import baseMixin from "@/mixins/base-mixin.js"; // Validation @@ -286,7 +287,16 @@ export default { : store.getters.order.serviceLocation.provider.address.zipCode; }, getPaymentType() { - return store.getters.order.payment.piaType; + switch (store.getters.order.payment.piaType) { + case paymentMethods.AFTERPAY: + return "ap"; + case paymentMethods.CREDIT_CARD: + return "cc"; + case paymentMethods.PAYPAL: + return "pp"; + default: + return store.getters.payment.piaType; + } }, getHeaderLine1() { if (!this.isPaypal()) { From 3d0bdb734c61262731ad1b8826a299775cc4f1e8 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Thu, 19 Oct 2023 15:00:26 -0400 Subject: [PATCH 03/38] CSR-1712 add copy to vehicle page. --- src/layouts/vehicle/vehicle.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index e064250bd..fe0f86dc5 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -9,6 +9,10 @@
+

From 61c2c039cc76350b2f61a7468a509108e61a748a Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Thu, 19 Oct 2023 17:49:10 -0400 Subject: [PATCH 04/38] Change P to div. --- src/layouts/vehicle/vehicle.vue | 4 ++-- src/ux-components/alert/alert.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index fe0f86dc5..1754a3a91 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -9,10 +9,10 @@
-

+ class="mt-2 mb-4 small">
- - - diff --git a/src/layouts/add-to-calendar/add-to-calendar.spec.js b/src/layouts/confirmation/add-to-calendar/add-to-calendar.spec.js similarity index 94% rename from src/layouts/add-to-calendar/add-to-calendar.spec.js rename to src/layouts/confirmation/add-to-calendar/add-to-calendar.spec.js index 14b6d978b..c55b170cd 100644 --- a/src/layouts/add-to-calendar/add-to-calendar.spec.js +++ b/src/layouts/confirmation/add-to-calendar/add-to-calendar.spec.js @@ -1,5 +1,5 @@ // Components -import addToCalendar from "@/layouts/add-to-calendar/add-to-calendar.vue"; +import addToCalendar from "@/layouts/confirmation/add-to-calendar/add-to-calendar.vue"; import { calendarOptions } from "@/constants/calendar-options"; import { AppointmentTypeStrings, RouteCodeFlags } from "@/constants/schedule-constants"; @@ -176,11 +176,20 @@ describe("Add-to-calendar methods...", () => { }); }); +var appointmentText = "Appointment content"; function setupMocks({ customMountOptions }) { const mountOptions = getMountOptions({ ...customMountOptions, }); - + mountOptions.mixins = [ + { + methods: { + getCmsContent: jest.fn().mockImplementation(() => { + return appointmentText; + }), + }, + }, + ]; const wrapper = shallowMount(addToCalendar, mountOptions); wrapper.vm.$refs.calendarModalQuestion.openModal = jest.fn(); return { wrapper }; diff --git a/src/layouts/confirmation/add-to-calendar/add-to-calendar.vue b/src/layouts/confirmation/add-to-calendar/add-to-calendar.vue new file mode 100644 index 000000000..48e67b72b --- /dev/null +++ b/src/layouts/confirmation/add-to-calendar/add-to-calendar.vue @@ -0,0 +1,313 @@ + + + diff --git a/src/layouts/add-to-calendar/calendar-modal-question/calendar-modal-list-button/calendar-modal-list-button.vue b/src/layouts/confirmation/add-to-calendar/calendar-modal-question/calendar-modal-list-button/calendar-modal-list-button.vue similarity index 100% rename from src/layouts/add-to-calendar/calendar-modal-question/calendar-modal-list-button/calendar-modal-list-button.vue rename to src/layouts/confirmation/add-to-calendar/calendar-modal-question/calendar-modal-list-button/calendar-modal-list-button.vue diff --git a/src/layouts/add-to-calendar/calendar-modal-question/calendar-modal-question.spec.js b/src/layouts/confirmation/add-to-calendar/calendar-modal-question/calendar-modal-question.spec.js similarity index 92% rename from src/layouts/add-to-calendar/calendar-modal-question/calendar-modal-question.spec.js rename to src/layouts/confirmation/add-to-calendar/calendar-modal-question/calendar-modal-question.spec.js index d28c2442f..2f0a51a33 100644 --- a/src/layouts/add-to-calendar/calendar-modal-question/calendar-modal-question.spec.js +++ b/src/layouts/confirmation/add-to-calendar/calendar-modal-question/calendar-modal-question.spec.js @@ -1,6 +1,6 @@ import { shallowMount } from "@vue/test-utils"; import { getMountOptions } from "@/helpers/unit-test-helper.js"; -import calendarModalQuestion from "@/layouts/add-to-calendar/calendar-modal-question/calendar-modal-question.vue"; +import calendarModalQuestion from "@/layouts/confirmation/add-to-calendar/calendar-modal-question/calendar-modal-question.vue"; describe("calendar-modal-question.vue", () => { test("When selected calendar option is changed, a correctly selectedCalendarOption should be emitted", async () => { diff --git a/src/layouts/add-to-calendar/calendar-modal-question/calendar-modal-question.vue b/src/layouts/confirmation/add-to-calendar/calendar-modal-question/calendar-modal-question.vue similarity index 100% rename from src/layouts/add-to-calendar/calendar-modal-question/calendar-modal-question.vue rename to src/layouts/confirmation/add-to-calendar/calendar-modal-question/calendar-modal-question.vue diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index 1fbcbe4fc..87d4d41ea 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -20,7 +20,19 @@

{{ ScheduleDateFormatted }}

{{ ScheduleTimeFormatted }}

- +
@@ -43,22 +55,17 @@ import funnelHeader from "@/fmg-components/funnel-header/funnel-header"; import vehicleBanner from "@/fmg-components/vehicle-banner/vehicle-banner"; import navbar from "@/fmg-components/nav-bar/nav-bar"; -import addToCalendar from "@/layouts/add-to-calendar/add-to-calendar"; +import addToCalendar from "@/layouts/confirmation/add-to-calendar/add-to-calendar"; //Supporting files import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; -import { AppointmentTypeStrings, RouteCodeFlags } from "@/constants/schedule-constants"; +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 { - calculateDuration, - combineDateAndTime, - shortTimeString, - addMinutes, -} from "@/helpers/date-helper"; + import { Form } from "vee-validate"; import store from "@/store"; -import { serviceType } from "@/constants/service-type"; + import { get12HourTimeFormat, get12HourTimeMobileFormat } from "@/helpers/date-helper"; export default { name: "confirmation", @@ -190,138 +197,6 @@ export default { return `at ${get12HourTimeFormat(this.ScheduleStartTime)}`; } }, - IsSameDayDropOff() { - const todaysDate = new Date().toISOString().split("T")[0]; - return this.ScheduleDate === todaysDate; - }, - Mobile_Appointment_Subject() { - return this.getCmsContent("Mobile_Appointment_Widget", "HeaderText"); - }, - Mobile_Appointment_Body() { - return this.getCmsContent("Mobile_Appointment_Widget", "BodyText"); - }, - InShop_Appointment_Subject() { - return this.getCmsContent("InShop_Appointment_Widget", "HeaderText"); - }, - InShop_Appointment_Body() { - return this.getCmsContent("InShop_Appointment_Widget", "BodyText"); - }, - Drop_Off_Appointment_Subject() { - return this.getCmsContent("Drop_Off_Appointment_Widget", "HeaderText"); - }, - Drop_Off_Appointment_Body() { - return this.getCmsContent("Drop_Off_Appointment_Widget", "BodyText"); - }, - Overnight_Drop_Off_Appointment_Subject() { - return this.getCmsContent("Drop_Off_Appointment_Widget", "HeaderText"); - }, - Overnight_Drop_Off_Appointment_Body() { - return this.getCmsContent("Drop_Off_Appointment_Widget", "BodyText"); - }, - All_Day_Drop_Off_Appointment_Subject() { - return this.getCmsContent("All_Day_Drop_Off_Appointment_Widget", "HeaderText"); - }, - All_Day_Drop_Off_Appointment_Body() { - return this.getCmsContent("All_Day_Drop_Off_Appointment_Widget", "BodyText"); - }, - Same_Day_Drop_Off_Appointment_Subject() { - return this.getCmsContent("Same_Day_Drop_Off_Appointment_Widget", "HeaderText"); - }, - Same_Day_Drop_Off_Appointment_Body() { - return this.getCmsContent("Same_Day_Drop_Off_Appointment_Widget", "BodyText"); - }, - UniqueId() { - return store.getters.order.referralNumber?.toString(); - }, - ServiceType() { - const isRepair = store.getters.order.damage.isRepair; - const funnelHasRecalibrationPart = store.getters.funnelHasRecalibrationPart; - if (!isRepair) { - if (funnelHasRecalibrationPart) { - return serviceType.REPLACEMENT_AND_RECALIBRATION; - } else { - return serviceType.REPLACEMENT; - } - } - return serviceType.REPAIR; - }, - RouteCode() { - return store.getters.order.schedule.routeCode; - }, - AppointmentData() { - var subject = ""; - var location = ""; - var startDateTime = combineDateAndTime(this.ScheduleDate, this.ScheduleStartTime); - var endDateTime = combineDateAndTime(this.ScheduleDate, this.ScheduleEndTime); - var body = ""; - var isHTML = false; - var duration = ""; - - if (this.AppointmentType === AppointmentTypeStrings.MOBILE) { - location = this.ServiceLocationFullAddress?.replace("
", ""); - subject = this.Mobile_Appointment_Subject?.replace( - "{custom:SERVICETYPE}", - this.ServiceType - ); - body = this.Mobile_Appointment_Body; - } else { - location = this.ProviderFullAddress?.replace("
", ""); - if (this.AppointmentType === AppointmentTypeStrings.DROP_OFF) { - if (this.RouteCode.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) { - subject = this.Overnight_Drop_Off_Appointment_Subject; - body = this.Overnight_Drop_Off_Appointment_Body; - } else if (this.RouteCode.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)) { - if (this.IsSameDayDropOff) { - subject = this.Same_Day_Drop_Off_Appointment_Subject; - endDateTime = addMinutes(startDateTime, 120); - body = this.Same_Day_Drop_Off_Appointment_Body; - } else { - endDateTime = addMinutes(startDateTime, 120); - subject = this.All_Day_Drop_Off_Appointment_Subject?.replace( - "{custom:STARTDATETIME}", - shortTimeString(startDateTime) - ).replace("{custom:ENDDATETIME}", shortTimeString(endDateTime)); - body = this.All_Day_Drop_Off_Appointment_Body?.replace( - "{custom:ENDDATETIME}", - shortTimeString(endDateTime) - ); - } - } //normal time slot - else { - subject = this.Drop_Off_Appointment_Subject?.replace( - "{custom:SERVICETYPE}", - this.ServiceType - ); - body = this.Drop_Off_Appointment_Body?.replace( - "{custom:ADDRESS}", - location - ); - } - } else { - subject = this.InShop_Appointment_Subject?.replace( - "{custom:SERVICETYPE}", - this.ServiceType - ); - body = this.InShop_Appointment_Body?.replace("{custom:ADDRESS}", location); - } - duration = calculateDuration(startDateTime, endDateTime); - } - return { - Subject: subject, - Location: location, - StartDate: startDateTime, - EndDate: endDateTime, - RefrrlSeqNum: this.UniqueId, - Body: body, - IsHTML: isHTML, - Duration: duration, - }; - }, - }, - data() { - return { - workOrderNumber: store.getters.order.workOrderNumber, - }; }, methods: { arePagePrerequisitesValid() { From 2404c5f9f2d0448855d080fbdc139622075afab2 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Fri, 20 Oct 2023 19:10:19 +0530 Subject: [PATCH 06/38] move external links to Vue config move external links to Vue config --- src/constants/application-config.js | 3 +++ .../confirmation/add-to-calendar/add-to-calendar.vue | 11 ++++++----- vue.config.js | 3 +++ vue.release.config.js | 3 +++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/constants/application-config.js b/src/constants/application-config.js index b4c0d9a1e..438cc9885 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -21,6 +21,9 @@ 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, }; export { applicationConfig }; diff --git a/src/layouts/confirmation/add-to-calendar/add-to-calendar.vue b/src/layouts/confirmation/add-to-calendar/add-to-calendar.vue index 48e67b72b..24427b2d5 100644 --- a/src/layouts/confirmation/add-to-calendar/add-to-calendar.vue +++ b/src/layouts/confirmation/add-to-calendar/add-to-calendar.vue @@ -33,6 +33,7 @@ import { } from "@/helpers/date-helper"; import store from "@/store"; import { serviceType } from "@/constants/service-type"; +import { applicationConfig } from "@/constants/application-config.js"; export default { name: "add-to-calendar", components: { @@ -207,8 +208,8 @@ export default { methods: { setCalendarAppointment(calendarOption) { if ( - calendarOption.name.includes(calendarOptions.ICAL) || - calendarOption.name.includes(calendarOptions.OUTLOOK) + calendarOption.name == calendarOptions.ICAL || + calendarOption.name == calendarOptions.OUTLOOK ) { this.getAppointment(); } else { @@ -227,7 +228,7 @@ export default { const dateFormat = "yyyyMMddTHHmmss"; const outlookComTimeSpanFormat = "yyyy-MM-ddTHH:mm:ss"; if (type == calendarOptions.OUTLOOKCOM) { - URL = `https://outlook.office.com/calendar/deeplink/compose?path=/calendar/action/compose&rru=addevent&startdt=${encodeURIComponent( + URL = `${applicationConfig.OUTLOOK_CALENDAR}&startdt=${encodeURIComponent( getDateFormat(this.Appointment.StartDate, outlookComTimeSpanFormat) )}&enddt=${encodeURIComponent( getDateFormat(this.Appointment.EndDate, outlookComTimeSpanFormat) @@ -238,7 +239,7 @@ export default { )}`; } if (type == calendarOptions.GOOGLE) { - URL = `https://www.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent( + URL = `${applicationConfig.GOOGLE_CALENDAR}&text=${encodeURIComponent( this.Appointment.Subject )}&dates=${encodeURIComponent( getDateFormat(this.Appointment.StartDate, dateFormat) @@ -249,7 +250,7 @@ export default { )}&location=${encodeURIComponent(this.Appointment.Location)}&sf=true&output=xml`; } if (type == calendarOptions.YAHOO) { - URL = `https://calendar.yahoo.com/?v=60&TITLE=${encodeURIComponent( + URL = `${applicationConfig.YAHOO_CALENDAR}&TITLE=${encodeURIComponent( this.Appointment.Subject )}&DESC=${encodeURIComponent(this.Appointment.Body)}&ST=${encodeURIComponent( getDateFormat(this.Appointment.StartDate, dateFormat) diff --git a/vue.config.js b/vue.config.js index a8c6ee8f8..f105d8e30 100644 --- a/vue.config.js +++ b/vue.config.js @@ -6,6 +6,9 @@ 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 ec84c2d2a..d3a16cc35 100644 --- a/vue.release.config.js +++ b/vue.release.config.js @@ -5,6 +5,9 @@ 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 8c7e1953a96f5911fa91a46b37eee2cf49415566 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Fri, 20 Oct 2023 10:11:15 -0400 Subject: [PATCH 07/38] 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 08/38] 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 09/38] 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 7c60a4c0698fbc9d2ea7021682dff2d4e20d8506 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Fri, 20 Oct 2023 11:20:03 -0400 Subject: [PATCH 10/38] 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 11/38] 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 @@
- + @@ -25,7 +24,13 @@ export default { }, computed: { answersFromCms() { - return this.getCmsContent(this.cmsWidgetName, "Answers"); + const answers = this.getCmsContent(this.cmsWidgetName, "Answers"); + if (answers) { + answers.forEach( + (answer) => (answer.additionalButtonData = this.additionalButtonData) + ); + } + return answers; }, additionalButtonData() { return { diff --git a/src/layouts/quote/service-package-question/service-package-question.spec.js b/src/layouts/quote/service-package-question/service-package-question.spec.js index dc0d2005c..c156ef34c 100644 --- a/src/layouts/quote/service-package-question/service-package-question.spec.js +++ b/src/layouts/quote/service-package-question/service-package-question.spec.js @@ -46,6 +46,7 @@ describe("service-package-question.vue", () => { price: 35.5, }, ], + activePromos: [], }; const packageNameKey = "05_01_CSR_Quote_Standard_Repair"; Object.assign(processedCmsContent, mockProcessedCmsContent[packageNameKey]); @@ -291,6 +292,7 @@ describe("service-package-question.vue, matching business rules for package disp price: 35.5, }, ], + activePromos: [], }; }); it("should match the 05_01_CSR_Quote_Standard_Repair mock", () => { diff --git a/src/layouts/quote/service-package-question/service-package-question.vue b/src/layouts/quote/service-package-question/service-package-question.vue index 70872153a..229d97c1b 100644 --- a/src/layouts/quote/service-package-question/service-package-question.vue +++ b/src/layouts/quote/service-package-question/service-package-question.vue @@ -32,6 +32,8 @@ import { import { getPromosThatMatchLineItemsOnOrder, removeVapsPromosFromPromoArray, + getPromosWithAddableVaps, + getLineItemsThatMatchPromos, } from "@/helpers/promotions-helper"; export default { @@ -54,7 +56,10 @@ export default { }, watch: { availableLineItems() { - if (this.$store.getters.payment.isInsurance != null) { + if ( + this.$store.getters.payment.isInsurance != null || + getPromosWithAddableVaps(this.activePromos).length + ) { this.selectDefaultPackage(); } }, @@ -217,13 +222,16 @@ export default { return price; }, selectDefaultPackage() { + const promosWithAddableVaps = getPromosWithAddableVaps(this.activePromos); + const vapsThatMatchPromos = getLineItemsThatMatchPromos(promosWithAddableVaps, this.nullSafeAvailableLineItems); const vapsFromStore = this.$store.getters.lineItems.vaps ?? []; + const vapsToUseForDefaultPackageSelection = this.combineLineItemsWithoutDuplicates(vapsThatMatchPromos, vapsFromStore); this.selectedPackageName = getHighestRequiredTier( this.glassToReplace, this.nullSafeAvailableLineItems, this.isRepair, - vapsFromStore + vapsToUseForDefaultPackageSelection ); }, getVapsLineItemsForSelectedPackage(packageName) { @@ -244,6 +252,19 @@ export default { return vapsLineItemsForSelectedPackage; }, + combineLineItemsWithoutDuplicates(lineItemsOne, lineItemsTwo) { + const combinedLineItemArray = [...lineItemsTwo]; + lineItemsOne.forEach((lineItemOne) => { + if ( + !lineItemsTwo.filter( + (lineItemTwo) => lineItemTwo.id === lineItemOne.id + ).length + ) { + combinedLineItemArray.push(lineItemOne); + } + }); + return combinedLineItemArray; + }, getCustomValueFromString(str) { switch (str) { case "isRecalibrationOnOrder": diff --git a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.spec.js b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.spec.js index fefef4044..333cb0663 100644 --- a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.spec.js +++ b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.spec.js @@ -122,6 +122,8 @@ const mockProps = { buttonBodyCopy: "
  • buttonBodyCopy test copy
  • 2
  • 3
  • 4
  • 5
", buttonFooterCopy: "buttonFooterCopy test copy", + buttonAuxillaryCopy: "buttonAuxillaryCopy test copy", + additionalButtonData: { strikeThroughPrice: "strikeThroughPrice test copy"}, }; function setupMocks({ mountOptionsMockData = {} }) { diff --git a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue index 7c4654721..138e174ce 100644 --- a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue +++ b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue @@ -7,7 +7,13 @@

- + + + +

Date: Wed, 25 Oct 2023 10:36:25 -0400 Subject: [PATCH 28/38] CSR-1520 | Formatting --- src/helpers/promotions-helper.js | 8 ++------ .../service-package-question.vue | 14 +++++++++----- .../service-package-radio.spec.js | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/helpers/promotions-helper.js b/src/helpers/promotions-helper.js index 7aed45878..08f7daa8f 100644 --- a/src/helpers/promotions-helper.js +++ b/src/helpers/promotions-helper.js @@ -22,9 +22,7 @@ export function getPromosWithAddableVaps(promoList) { return []; } - return promoList.filter((promo) => - addableVapsPromoPartNumbers.includes(promo.partNumber) - ); + return promoList.filter((promo) => addableVapsPromoPartNumbers.includes(promo.partNumber)); } export function getLineItemsThatMatchPromos(promos, availableLineItems) { @@ -32,9 +30,7 @@ export function getLineItemsThatMatchPromos(promos, availableLineItems) { promos.forEach((promo) => { promo.discountedLineItemIds.forEach((discountedLineItemId) => { matchingLineItems.push( - ...availableLineItems.filter( - (lineItem) => lineItem.id === discountedLineItemId - ) + ...availableLineItems.filter((lineItem) => lineItem.id === discountedLineItemId) ); }); }); diff --git a/src/layouts/quote/service-package-question/service-package-question.vue b/src/layouts/quote/service-package-question/service-package-question.vue index 229d97c1b..28727f155 100644 --- a/src/layouts/quote/service-package-question/service-package-question.vue +++ b/src/layouts/quote/service-package-question/service-package-question.vue @@ -223,9 +223,15 @@ export default { }, selectDefaultPackage() { const promosWithAddableVaps = getPromosWithAddableVaps(this.activePromos); - const vapsThatMatchPromos = getLineItemsThatMatchPromos(promosWithAddableVaps, this.nullSafeAvailableLineItems); + const vapsThatMatchPromos = getLineItemsThatMatchPromos( + promosWithAddableVaps, + this.nullSafeAvailableLineItems + ); const vapsFromStore = this.$store.getters.lineItems.vaps ?? []; - const vapsToUseForDefaultPackageSelection = this.combineLineItemsWithoutDuplicates(vapsThatMatchPromos, vapsFromStore); + const vapsToUseForDefaultPackageSelection = this.combineLineItemsWithoutDuplicates( + vapsThatMatchPromos, + vapsFromStore + ); this.selectedPackageName = getHighestRequiredTier( this.glassToReplace, @@ -256,9 +262,7 @@ export default { const combinedLineItemArray = [...lineItemsTwo]; lineItemsOne.forEach((lineItemOne) => { if ( - !lineItemsTwo.filter( - (lineItemTwo) => lineItemTwo.id === lineItemOne.id - ).length + !lineItemsTwo.filter((lineItemTwo) => lineItemTwo.id === lineItemOne.id).length ) { combinedLineItemArray.push(lineItemOne); } diff --git a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.spec.js b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.spec.js index 333cb0663..fe42a73d0 100644 --- a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.spec.js +++ b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.spec.js @@ -123,7 +123,7 @@ const mockProps = { "

  • buttonBodyCopy test copy
  • 2
  • 3
  • 4
  • 5
", buttonFooterCopy: "buttonFooterCopy test copy", buttonAuxillaryCopy: "buttonAuxillaryCopy test copy", - additionalButtonData: { strikeThroughPrice: "strikeThroughPrice test copy"}, + additionalButtonData: { strikeThroughPrice: "strikeThroughPrice test copy" }, }; function setupMocks({ mountOptionsMockData = {} }) { From 75b47e2ebd7f0ef8d78e5d53149e39951d82ff33 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 25 Oct 2023 11:29:47 -0400 Subject: [PATCH 29/38] Actually key into experiment setting --- src/layouts/payment-method/payment-method.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index f72784abb..19034c1ad 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -353,11 +353,8 @@ export default { isPiaDisabled() { const piaExperience = this.getSettingValue(experimentSettings.PIA_EXPERIENCE) === "PIA Optional"; - const enablePIA = - this.getSettingValue(experimentSettings.SUBMIT_ORDER_ENABLE_PIA) === "true"; - return false; - //return !(piaExperience && enablePIA); + return !piaExperience; }, paymentMethod() { if (this.isPiaDisabled) { From 992f2e9215120e8b4499fd1336e8eaf2e08c166e Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Wed, 25 Oct 2023 13:15:20 -0400 Subject: [PATCH 30/38] CSR-1392 return a higher to test Paypal settlement error also changed how to build the display line items sent to paypal so it's just pats, supportingitems and vaps. --- src/layouts/payment/payment.vue | 45 +++++++++++++++++---------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index c4dcb9469..f247c5bb8 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -1,5 +1,5 @@