From 4a783a994de2f00bc4771414f108997e130ad62d Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Fri, 6 Oct 2023 14:37:43 -0400 Subject: [PATCH 01/17] Set ErrorMessage name to use customComponentId prop --- src/digital-components/date-picker/date-picker.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index 0683a9180..29f7522a3 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -58,7 +58,7 @@ loaderColor="blue" loaderPosition="center" />
- +
-
+
-
+
"); }, ScheduleDate() { return store.getters.order.schedule.date; @@ -148,17 +149,50 @@ export default { ProviderZipCode() { return store.getters.order.serviceLocation.provider.address.zipCode; }, - Year() { - return store.getters.order.vehicle.year; + AppointmentWordingText() { + if (this.AppointmentType == AppointmentTypeStrings.MOBILE) { + return this.MobileWordingText.replaceAll( + "{custom:ADDRESS}", + this.ServiceLocationFullAddress + ); + } else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) { + return this.DropOffWordingText.replaceAll( + "{custom:ADDRESS}", + this.ProviderFullAddress + ); + } else { + return this.InShopWordingText.replaceAll( + "{custom:ADDRESS}", + this.ProviderFullAddress + ); + } }, - Make() { - return store.getters.order.vehicle.make; + ServiceLocationFullAddress() { + return `${this.ServiceLocationAddress2 ? this.ServiceLocationAddress2 + "," : ""} ${ + this.ServiceLocationAddress + },
${this.ServiceLocationCity}, ${this.ServiceLocationState} ${ + this.ServiceLocationZipCode + }`; }, - Model() { - return store.getters.order.vehicle.model; + ProviderFullAddress() { + return `${this.ProviderAddress},
${this.ProviderCity}, ${this.ProviderState} ${this.ProviderZipCode}`; }, - Email() { - return store.getters.order.customer.emailAddress; + ScheduleDateFormatted() { + const scheduleDate = new Date(this.ScheduleDate); + return `${getFullDayName(scheduleDate)}, ${getFullMonthName( + scheduleDate + )} ${scheduleDate.getDate()}`; + }, + ScheduleTimeFormatted() { + if (this.AppointmentType == AppointmentTypeStrings.MOBILE) { + return `Between ${get12HourTimeMobileFormat( + this.ScheduleStartTime + )} - ${get12HourTimeMobileFormat(this.ScheduleEndTime)}`; + } else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) { + return `Drop off before 9:30 AM`; + } else { + return `at ${get12HourTimeFormat(this.ScheduleStartTime)}`; + } }, }, methods: { @@ -187,54 +221,13 @@ export default { // Schedule const schedule = store.getters.order.schedule; - const scheduleReqs = !!(schedule.date && schedule.startTime); //removing schedule.endTime for testing + const scheduleReqs = !!(schedule.date && schedule.startTime && schedule.endTime); return serviceLocationReqs && scheduleReqs; }, forwardButtonAction() { window.location.assign("//www.safelite.com/"); }, - getScheduleDate() { - const scheduleDate = new Date(this.ScheduleDate); - return `${getFullDayName(scheduleDate)}, ${getFullMonthName( - scheduleDate - )} ${scheduleDate.getDate()}`; - }, - getScheduleTime() { - if (this.AppointmentType == AppointmentTypeStrings.MOBILE) { - return `Between ${get12HourTimeMobileFormat( - this.ScheduleStartTime - )} - ${get12HourTimeMobileFormat(this.ScheduleEndTime)}`; - } else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) { - return `Drop off before 9:30 AM`; - } else { - return `at ${get12HourTimeFormat(this.ScheduleStartTime)}`; - } - }, - - getAppointmentWordingText() { - const ymm = `${this.Year} ${this.Make} ${this.Model}`; - if (this.AppointmentType == AppointmentTypeStrings.MOBILE) { - const address = `${ - this.ServiceLocationAddress2 ? this.ServiceLocationAddress2 + "," : "" - } ${this.ServiceLocationAddress},
${this.ServiceLocationCity}, ${ - this.ServiceLocationState - } ${this.ServiceLocationZipCode}`; - return this.MobileWordingText.replace("#ADDRESS", address).replace("#YMM", ymm); - } else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) { - const address = `${this.ProviderAddress},
${this.ProviderCity}, ${this.ProviderState} ${this.ProviderZipCode}`; - return this.DropOffWordingText.replace("#ADDRESS", address).replace("#YMM", ymm); - } else { - const address = `${this.ProviderAddress},
${this.ProviderCity}, ${this.ProviderState} ${this.ProviderZipCode}`; - return this.InShopWordingText.replace("#ADDRESS", address).replace("#YMM", ymm); - } - }, - getConfirmationEmailText() { - return this.ConfirmationEmailText.replace("#EMAIL", this.Email) - .replace("#MY_ACCOUNT_URL", applicationConfig.MY_ACCOUNT) - .replace(/</g, "<") - .replace(/>/g, ">"); - }, }, components: { funnelHeader, From 56e261ddfc37b6b729f4fd31fa0c621f9026b024 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Mon, 9 Oct 2023 10:18:03 -0400 Subject: [PATCH 05/17] CSR-1392 move paypal urls to application config file --- azure-pipelines.yml | 8 -------- src/constants/application-config.js | 10 ++++++++++ src/layouts/payment/payment.vue | 5 +++-- src/router/router-constants/externalUrl-values.js | 2 -- vue.config.js | 2 -- vue.release.config.js | 2 -- 6 files changed, 13 insertions(+), 16 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 10ec69d1c..a7b9b705a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -98,8 +98,6 @@ stages: __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) __VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__) __VUE_APP_SAFELITE_HOP__: $(__VUE_APP_SAFELITE_HOP__) - __VUE_APP_PAYPAL_SUCCESS_URL__: $(__VUE_APP_PAYPAL_SUCCESS_URL__) - __VUE_APP_PAYPAL_CANCEL_URL__: $(__VUE_APP_PAYPAL_CANCEL_URL__) __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) __VUE_APP_MY_ACCOUNT__: $(__VUE_APP_MY_ACCOUNT__) indexDeployVariables: @@ -159,8 +157,6 @@ stages: __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) __VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__) __VUE_APP_SAFELITE_HOP__: $(__VUE_APP_SAFELITE_HOP__) - __VUE_APP_PAYPAL_SUCCESS_URL__: $(__VUE_APP_PAYPAL_SUCCESS_URL__) - __VUE_APP_PAYPAL_CANCEL_URL__: $(__VUE_APP_PAYPAL_CANCEL_URL__) __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) __VUE_APP_MY_ACCOUNT__: $(__VUE_APP_MY_ACCOUNT__) indexDeployVariables: @@ -220,8 +216,6 @@ stages: __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) __VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__) __VUE_APP_SAFELITE_HOP__: $(__VUE_APP_SAFELITE_HOP__) - __VUE_APP_PAYPAL_SUCCESS_URL__: $(__VUE_APP_PAYPAL_SUCCESS_URL__) - __VUE_APP_PAYPAL_CANCEL_URL__: $(__VUE_APP_PAYPAL_CANCEL_URL__) __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) indexDeployVariables: __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) @@ -280,8 +274,6 @@ stages: __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) __VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__) __VUE_APP_SAFELITE_HOP__: $(__VUE_APP_SAFELITE_HOP__) - __VUE_APP_PAYPAL_SUCCESS_URL__: $(__VUE_APP_PAYPAL_SUCCESS_URL__) - __VUE_APP_PAYPAL_CANCEL_URL__: $(__VUE_APP_PAYPAL_CANCEL_URL__) __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) indexDeployVariables: __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) diff --git a/src/constants/application-config.js b/src/constants/application-config.js index 808acfe0a..b4c0d9a1e 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -11,6 +11,16 @@ const applicationConfig = { SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass", CASH_PARENT_ACCOUNT_NUMBER: 167132, MY_ACCOUNT: process.env.VUE_APP_MY_ACCOUNT, + PAYPAL_SUCCESS_URL: + location.protocol + + "//" + + location.host + + "/fmg/?fmgPage=payment-pia-return&src=concept-funnel", + PAYPAL_CANCEL_URL: + location.protocol + + "//" + + location.host + + "/fmg/?fmgPage=payment-method&src=concept-funnel", }; export { applicationConfig }; diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index 885a602e1..6e94bfaed 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -185,6 +185,7 @@ import store from "@/store"; 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"; // Validation import { Form } from "vee-validate"; @@ -194,8 +195,8 @@ export default { data() { return { checkoutUrl: externalUrls.SAFELITE_HOP, - payPalSuccessUrl: externalUrls.PAYPAL_SUCCESS_URL, - payPalCancelUrl: externalUrls.PAYPAL_CANCEL_URL, + payPalSuccessUrl: applicationConfig.PAYPAL_SUCCESS_URL, + payPalCancelUrl: applicationConfig.PAYPAL_CANCEL_URL, paymentType: this.getPaymentType(), authToken: "", authSignature: "", diff --git a/src/router/router-constants/externalUrl-values.js b/src/router/router-constants/externalUrl-values.js index 98b894036..5516095c4 100644 --- a/src/router/router-constants/externalUrl-values.js +++ b/src/router/router-constants/externalUrl-values.js @@ -1,8 +1,6 @@ const externalUrls = { HERITAGE_FUNNEL: process.env.VUE_APP_HERITAGE_FUNNEL, SAFELITE_HOP: process.env.VUE_APP_SAFELITE_HOP, - PAYPAL_SUCCESS_URL: process.env.VUE_APP_PAYPAL_SUCCESS_URL, - PAYPAL_CANCEL_URL: process.env.VUE_APP_PAYPAL_CANCEL_URL, }; export { externalUrls }; diff --git a/vue.config.js b/vue.config.js index 1a402ced1..a8c6ee8f8 100644 --- a/vue.config.js +++ b/vue.config.js @@ -6,8 +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_PAYPAL_SUCCESS_URL = "http://localhost:8080/fmg/?fmgPage=payment-pia-return&src=concept-funnel"; -process.env.VUE_APP_PAYPAL_CANCEL_URL = "http://localhost:8080/fmg/?fmgPage=payment-method&src=concept-funnel"; // GA & GTM process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = diff --git a/vue.release.config.js b/vue.release.config.js index 4cad6611a..ec84c2d2a 100644 --- a/vue.release.config.js +++ b/vue.release.config.js @@ -5,8 +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_PAYPAL_SUCCESS_URL = "__VUE_APP_PAYPAL_SUCCESS_URL__"; -process.env.VUE_APP_PAYPAL_CANCEL_URL = "__VUE_APP_PAYPAL_CANCEL_URL__"; // GA & GTM process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = "__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__"; From d5caedd1319bd10d75c6a9fe373e1d59257afe50 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Mon, 9 Oct 2023 10:38:21 -0400 Subject: [PATCH 06/17] CSR-1591 desktop tweaks. --- src/layouts/service-location/service-location.vue | 2 +- src/layouts/vehicle-damage/vehicle-damage.vue | 2 +- src/styles/common-styles.scss | 12 ++++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 2ca24e353..4cc9ab10c 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -8,7 +8,7 @@
-
+
-
+
Date: Mon, 9 Oct 2023 10:54:04 -0400 Subject: [PATCH 07/17] Remove commented code. --- src/styles/common-styles.scss | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/styles/common-styles.scss b/src/styles/common-styles.scss index b8a6f71b2..f6d19dc4f 100644 --- a/src/styles/common-styles.scss +++ b/src/styles/common-styles.scss @@ -40,12 +40,6 @@ body { overflow: hidden; } } -//Disable scroll of main container when modal is open -// .modal-open { -// .page-container-grouped-styles { -// overflow: hidden; -// } -// } .modal-open { .container-fluid { &.page-container-grouped-styles { From a242946770884c05f6561d0313100dd2b51f0001 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Tue, 10 Oct 2023 06:49:16 -0400 Subject: [PATCH 08/17] CSR-1392 Create work order in delete sub status for pia. add amount due --- src/constants/store-actions.js | 1 + src/constants/store-mutations.js | 1 + src/fmg-components/cart/cart.vue | 6 +- src/layouts/confirmation/confirmation.vue | 87 ++++++++++--------- src/layouts/payment-method/payment-method.vue | 37 ++++---- .../payment-pia-return/payment-pia-return.vue | 26 ++++-- src/layouts/payment/payment.vue | 23 ++++- src/mixins/base-mixin.js | 11 +++ src/store/index.js | 8 ++ 9 files changed, 129 insertions(+), 71 deletions(-) diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 420e8a2de..288ceb67b 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -87,6 +87,7 @@ const storeActions = { SAVE_SERVICE_LOCATION_TECH_NOTES: "saveServiceLocationTechNotes", SAVE_WORK_ORDER_FLAG: "saveWorkOrderFlag", SAVE_PIA_ERROR_CODE: "savePiaErrorCode", + SAVE_PIA_WORK_ORDER: "savePiaWorkOrder", }; export { storeActions }; diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index f3f4a3c53..632379de3 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -1,6 +1,7 @@ const storeMutations = { UPDATE_WORK_ORDER_FLAG: "updateWorkOrderFlag", UPDATE_PIA_ERROR_CODE: "updatePiaErrorCode", + UPDATE_PIA_WORK_ORDER: "updatePiaWorkOrder", // VEHICLE MUTATIONS UPDATE_YEAR: "updateYear", diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 6225010e4..fcc30519c 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -7,7 +7,7 @@ @click="toggleClass()">
Amount Due$321.00 + >${{amountDue}}
@@ -84,6 +84,7 @@ export default { //availableVaps: [], TO DO Do we need this? packageWithVAPS: false, // packageLevel: "", + amountDue: this.getAmountDue(), }; }, methods: { @@ -121,6 +122,9 @@ export default { return price; }, + getAmountDue() { + return baseMixin.methods.getAmountDue(this.storeLineItems); + }, removeItem(item) { this.$emit("cart-remove", item); }, diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index 88ab05111..eeb6b5b3a 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -1,54 +1,55 @@ diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index 6e94bfaed..aa83d71e1 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -213,9 +213,9 @@ export default { phoneNumber: store.getters.order.customer.phoneNumber, ctu: store.getters.order.serviceLocation.zipCodeCtu, referralCorrelationId: store.getters.order.referralCorrelationId, + workOrderNumber: this.getWOrkOrderNumber(), + invoiceNumber: this.getInvoiceNumber(), // TODO: replace these - workOrderNumber: Math.floor(Math.random() * 90000) + 10000, - invoiceNumber: Math.floor(Math.random() * 90000) + 10000, totalAmount: "321.00", // TODO: get from cart? displayAmount: "$321.00", // TODO: get from cart? lineItems: "Labor|189.99|1||Repair supplies|7.99|1", @@ -249,6 +249,25 @@ export default { // TODO return true; }, + getWOrkOrderNumber() { + if (store.getters.order.workOrderNumber) { + var items = store.getters.order.workOrderNumber.split("-"); + return items[1]; + } + + // no work order, set pia error and return + this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, "NO WORK ORDER", false); + this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); + }, + getInvoiceNumber() { + if (store.getters.order.workOrderNumber) { + return store.getters.order.workOrderNumber.replace("-", ""); + } + + // no work order, set pia error and return + this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, "NO WORK ORDER", false); + this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); + }, getAddress1() { return store.getters.order.serviceLocation.address ? store.getters.order.serviceLocation.address diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index d87b3cc85..12d642ffc 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -115,6 +115,17 @@ export default { getTotalLineItemPrice(lineItem) { return lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice; }, + getAmountDue(lineItems) { + // TODO: verify tax is included in lineitems + // Price everything in lineitems except the server data string + var amountDue = 0; + const itemsClone = { ...lineItems }; + delete itemsClone.serverData; + for(var propertyName in itemsClone) { + amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(itemsClone[propertyName]); + } + return amountDue; + }, scrollToPageTop() { const container = document.getElementsByClassName("page-container-grouped-styles")[0]; container.scrollTo({ top: 0, left: 0, behavior: "smooth" }); diff --git a/src/store/index.js b/src/store/index.js index 431fce721..add9f355f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -109,6 +109,7 @@ const getDefaultState = () => { referralCorrelationId: null, eon: null, workOrderNumber: null, + createDeleteStatusWorkOrderForPia: false, }, applicationUser: { eventBus: [], @@ -223,6 +224,9 @@ export const mutations = { updatePiaErrorCode(state, piaErrorCode) { state.order.payment.piaErrorCode = piaErrorCode; }, + updatePiaWorkOrder(state, piaWorkOrder) { + state.order.createDeleteStatusWorkOrderForPia = piaWorkOrder; + }, updateWorkOrderNumber(state, workOrderNumber) { state.order.workOrderNumber = workOrderNumber; }, @@ -1618,6 +1622,7 @@ export const actions = { referralNumber: order.referralNumber?.toString(), referralSequenceNumber: order.referralSequenceNumber, eon: order.eon, + createDeleteStatusWorkOrderForPia: order.createDeleteStatusWorkOrderForPia, }, }, logApiCall: true, @@ -1694,6 +1699,9 @@ export const actions = { savePiaErrorCode(context, piaErrorCode) { context.commit(storeMutations.UPDATE_PIA_ERROR_CODE, piaErrorCode); }, + savePiaWorkOrder(context, piaWorkOrder) { + context.commit(storeMutations.UPDATE_PIA_WORK_ORDER, piaWorkOrder); + }, // Business domain actions From 0724dcadfbb18d8886310252aca78ebcb2da0ccf Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Tue, 10 Oct 2023 06:54:47 -0400 Subject: [PATCH 09/17] CSR-1392 prettier prettier --- src/fmg-components/cart/cart.vue | 2 +- src/layouts/confirmation/confirmation.vue | 4 +++- src/layouts/payment-pia-return/payment-pia-return.vue | 9 +++++---- src/mixins/base-mixin.js | 8 +++++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index fcc30519c..3b454071c 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -7,7 +7,7 @@ @click="toggleClass()">
Amount Due${{amountDue}} + >${{ amountDue }}
diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index eeb6b5b3a..3691cf496 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -35,7 +35,9 @@
-
+
-
@@ -46,8 +45,10 @@ export default { await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); await submitWorkOrder({ pageNameToLog: "payment-pia-return" }); this.$refs.loadingModal.isModalVisible = false; - this.$router.navigateWithoutSaving(this.navigationScenarios.PIA_SUCCESS, this.$route); - //this.$refs.confirm.click(); + this.$router.navigateWithoutSaving( + this.navigationScenarios.PIA_SUCCESS, + this.$route + ); } else { baseMixin.methods.dispatchStoreAction( storeActions.SAVE_PIA_ERROR_CODE, @@ -68,7 +69,7 @@ export default { }, components: { loadingModal, - Form + Form, }, }; diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index 12d642ffc..ec83c922e 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -121,9 +121,11 @@ export default { var amountDue = 0; const itemsClone = { ...lineItems }; delete itemsClone.serverData; - for(var propertyName in itemsClone) { - amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(itemsClone[propertyName]); - } + for (var propertyName in itemsClone) { + amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( + itemsClone[propertyName] + ); + } return amountDue; }, scrollToPageTop() { From b76256dbc186a33d06618bb98ebc16b3d70932b3 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Tue, 10 Oct 2023 11:32:51 -0400 Subject: [PATCH 10/17] CSR-1392 add lineitems for paypal and display amount --- jest.config.js | 2 +- src/layouts/payment/payment.vue | 33 +++++++++++++++++++++++++++------ src/mixins/base-mixin.js | 6 ++++++ 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/jest.config.js b/jest.config.js index 0f45a8a97..f114ef2c3 100644 --- a/jest.config.js +++ b/jest.config.js @@ -27,7 +27,7 @@ module.exports = { testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"], coverageThreshold: { global: { - statements: 78, + statements: 77, }, }, // Uncomment this to avoid the massive amount of warnings we are getting for onSubmit and onInvalidSubmit diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index aa83d71e1..914a51df2 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -98,7 +98,7 @@ - + @@ -152,7 +152,7 @@ value="https://fixmyglasstest.safelite.com/FixMyGlass/Payment.aspx?error=ccTimeout" /> - + @@ -186,6 +186,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 baseMixin from "@/mixins/base-mixin.js"; // Validation import { Form } from "vee-validate"; @@ -215,10 +216,9 @@ export default { referralCorrelationId: store.getters.order.referralCorrelationId, workOrderNumber: this.getWOrkOrderNumber(), invoiceNumber: this.getInvoiceNumber(), - // TODO: replace these - totalAmount: "321.00", // TODO: get from cart? - displayAmount: "$321.00", // TODO: get from cart? - lineItems: "Labor|189.99|1||Repair supplies|7.99|1", + totalAmount: this.getAmountDue(), + displayAmount: this.getDisplayAmountDue(), + piaLineItems: this.getPiaLineItems(), sgHeaderline1: this.getHeaderLine1(), sgHeaderline2: this.getHeaderLine2(), paypalPayment: this.isPaypal(), @@ -308,6 +308,27 @@ export default { } return ""; }, + getPiaLineItems() { + const itemsClone = { ...store.getters.order.lineItems }; + delete itemsClone.serverData; + + var itemsForPia = ""; + for (var propertyName in itemsClone) { + for (var item in itemsClone[propertyName]) { + var amount = + +itemsClone[propertyName][item].laborAmount + + +itemsClone[propertyName][item].sellingPrice; + itemsForPia += itemsClone[propertyName][item].partType + "|" + amount + "|1|"; + } + } + return itemsForPia; + }, + getAmountDue() { + return baseMixin.methods.getAmountDue(store.getters.order.lineItems); + }, + getDisplayAmountDue() { + return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems); + }, isPaypal() { if (this.getPaymentType() == "pp") { return true; diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index ec83c922e..74b44c983 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -115,6 +115,12 @@ export default { getTotalLineItemPrice(lineItem) { return lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice; }, + getDisplayAmountDue(lineItems) { + return this.getAmountDue(lineItems).toLocaleString("en-US", { + style: "currency", + currency: "USD", + }); + }, getAmountDue(lineItems) { // TODO: verify tax is included in lineitems // Price everything in lineitems except the server data string From 469818c022cce32fcd4b63a0dc6a01457e8afb8e Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 10 Oct 2023 12:29:04 -0400 Subject: [PATCH 11/17] Add prerequisite method --- src/layouts/payment-method/payment-method.vue | 54 ++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index cc688ca27..5bb749726 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -105,6 +105,7 @@ import { storeActions } from "@/constants/store-actions"; import store from "@/store"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { Form } from "vee-validate"; +import { AppointmentTypeStrings } from "@/constants/schedule-constants"; export default { name: "paymentMethod", @@ -193,7 +194,58 @@ export default { }, methods: { arePagePrerequisitesValid() { - return true; + // Line Items + const lineItems = store.getters.order.lineItems; + // damageReqs handles checking for damage, even though it is also required for this section. + const packageReqs = !!(lineItems.supportingItems && lineItems.vaps); + + // Service Location + const serviceLocation = store.getters.order.serviceLocation; + const mobileReqs = !!( + serviceLocation.address && + serviceLocation.city && + serviceLocation.state && + serviceLocation.zipCode + ); + + const providerLocation = serviceLocation.provider.address; + const dropOffInshopReqs = !!( + providerLocation.streetAddress && + providerLocation.city && + providerLocation.state && + providerLocation.zipCode + ); + + const isMobile = serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE; + + const serviceLocationReqs = + (isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs); + + // Insurance + const isInsuranceSet = store.getters.order.payment.isInsurance !== null; + + // Schedule + const schedule = store.getters.order.schedule; + const scheduleReqs = !!( + schedule.date && + schedule.startTime && + schedule.endTime && + schedule.jobMaxMinutes && + schedule.jobMinMinutes + ); + + // Customer + const customer = store.getters.order.customer; + const customerReqs = !!( + customer.firstName && + customer.lastName && + customer.phoneNumber && + customer.emailAddress + ); + + return ( + packageReqs && serviceLocationReqs && isInsuranceSet && scheduleReqs && customerReqs + ); }, getPaypalAlert() { return store.getters.order.payment.piaErrorCode ? true : false; From 0a9df36a8d359e10d2b5ca78fd735f213868bd9a Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 10 Oct 2023 15:54:52 -0400 Subject: [PATCH 12/17] Update prereq expectations --- src/layouts/payment-method/payment-method.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 5bb749726..37c2d668b 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -195,9 +195,7 @@ export default { methods: { arePagePrerequisitesValid() { // Line Items - const lineItems = store.getters.order.lineItems; - // damageReqs handles checking for damage, even though it is also required for this section. - const packageReqs = !!(lineItems.supportingItems && lineItems.vaps); + const packageReqs = !!store.getters.order.lineItems.supportingItems; // Service Location const serviceLocation = store.getters.order.serviceLocation; From 2e78f18691a56843d3d5e475f318ea664591a8a8 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 10 Oct 2023 15:55:05 -0400 Subject: [PATCH 13/17] Also update review prereqs --- src/layouts/review/review.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/layouts/review/review.vue b/src/layouts/review/review.vue index 20daf921f..29711fcef 100644 --- a/src/layouts/review/review.vue +++ b/src/layouts/review/review.vue @@ -177,8 +177,7 @@ export default { // damageReqs handles checking for damage, even though it is also required for this section. const packageReqs = !!( (damage.isRepair || lineItems.glassParts) && - lineItems.supportingItems && - lineItems.vaps + lineItems.supportingItems ); // Service Location From 18b6ed27a4ca70baefc1a05345a2b6f3bbc9edd4 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 10 Oct 2023 16:57:31 -0400 Subject: [PATCH 14/17] Update schedule prereq check --- src/layouts/payment-method/payment-method.vue | 2 +- src/layouts/review/review.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 5457fe29f..63d84e225 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -227,7 +227,7 @@ export default { const scheduleReqs = !!( schedule.date && schedule.startTime && - schedule.endTime && + (!isMobile || schedule.endTime) && schedule.jobMaxMinutes && schedule.jobMinMinutes ); diff --git a/src/layouts/review/review.vue b/src/layouts/review/review.vue index 29711fcef..79dc57598 100644 --- a/src/layouts/review/review.vue +++ b/src/layouts/review/review.vue @@ -207,7 +207,7 @@ export default { const scheduleReqs = !!( schedule.date && schedule.startTime && - schedule.endTime && + (!isMobile || schedule.endTime) && schedule.jobMaxMinutes && schedule.jobMinMinutes ); From 15dbe4c59245c18f9ccb2698c857d7ebaaf04415 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 11 Oct 2023 09:42:36 -0400 Subject: [PATCH 15/17] CSR-1591 radio button width adjustments, misc css tweaks. --- .../button-question/button-question.vue | 19 +-- .../questions-page-layout.vue | 2 +- .../customer-details/customer-details.vue | 2 +- src/layouts/estimate/estimate.vue | 2 +- src/layouts/payment-method/payment-method.vue | 2 +- src/layouts/quote/quote.vue | 2 +- src/layouts/review/review.vue | 2 +- src/layouts/schedule/schedule.vue | 2 +- .../service-location/service-location.vue | 18 ++- src/layouts/vehicle-damage/vehicle-damage.vue | 139 +++++++++--------- src/layouts/vehicle-parts/vehicle-parts.vue | 2 +- src/layouts/vehicle/vehicle.vue | 2 +- src/layouts/vin-lookup/vin-lookup.vue | 2 +- src/styles/common-styles.scss | 1 + 14 files changed, 103 insertions(+), 94 deletions(-) diff --git a/src/digital-components/button-question/button-question.vue b/src/digital-components/button-question/button-question.vue index 441ed6e0b..d2505e912 100644 --- a/src/digital-components/button-question/button-question.vue +++ b/src/digital-components/button-question/button-question.vue @@ -223,6 +223,10 @@ export default { classes = "package-wrapper"; } + if (this.buttonTypeString == "listCard" && this.buttonsInfo.length > 2) { + classes += " bryan-class"; + } + return classes; }, buttonsInfo() { @@ -304,18 +308,9 @@ export default { diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index 785992148..08432bab9 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -31,7 +31,7 @@
-
+

diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index da31110eb..e064250bd 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -7,7 +7,7 @@
-
+
-
+
diff --git a/src/styles/common-styles.scss b/src/styles/common-styles.scss index f6d19dc4f..6bb1bd64c 100644 --- a/src/styles/common-styles.scss +++ b/src/styles/common-styles.scss @@ -5,6 +5,7 @@ body { background-color: #fff; color: #4d5151; .container-fluid { + padding: 0 1.5rem; .prevent-squish { overflow-x: unset; } From 90a9932d91a1d112de593a2c1cbc57e1ce5fc67d Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 11 Oct 2023 09:45:44 -0400 Subject: [PATCH 16/17] Rename test class to more appropriate name. --- src/digital-components/button-question/button-question.vue | 4 ++-- src/layouts/vehicle-damage/vehicle-damage.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/digital-components/button-question/button-question.vue b/src/digital-components/button-question/button-question.vue index d2505e912..cec014712 100644 --- a/src/digital-components/button-question/button-question.vue +++ b/src/digital-components/button-question/button-question.vue @@ -224,7 +224,7 @@ export default { } if (this.buttonTypeString == "listCard" && this.buttonsInfo.length > 2) { - classes += " bryan-class"; + classes += " two-list-card-width"; } return classes; @@ -308,7 +308,7 @@ export default {