From 00ca94d5ddbff81ba295509fdcc87909541e4aae Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 9 Nov 2023 13:51:49 -0500 Subject: [PATCH 1/3] CSR-1384: fix if lineItems.vaps is null --- src/layouts/payment-method/payment-method.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index c8ef38b3e..41de977b6 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -201,6 +201,7 @@ export default { taxedVaps, lineItems ); + lineItems.vaps = lineItems.vaps ?? []; lineItems.vaps.push(...vapsToAddToCart); // Call the "next" function to complete the transition to this page. From 621c1423f87d68674949494ad7dd320f40dd15c3 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Thu, 9 Nov 2023 14:46:19 -0500 Subject: [PATCH 2/3] CSR-1392 No need for this logic. token is persisted in customerportallogintoken table and is pulled from there now in the api on final submit --- src/store/index.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index de2e6b45b..94a50f46d 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1039,14 +1039,7 @@ export const actions = { context.commit(storeMutations.UPDATE_CRM_CUSTOMER_ID, crmCustomerId); context.commit(storeMutations.WORK_ORDER_NUMBER, workOrderNumber); context.commit(storeMutations.LOCK_TOKEN, lockToken); - - // if we already have the token, do not update it. pia does 2 work order submits and the value is not persisted after the first submit - if ( - state.order.customerPortalLoginToken != null && - state.order.customerPortalLoginToken != "00000000-0000-0000-0000-000000000000" - ) { - context.commit(storeMutations.Customer_Portal_Login_Token, customerPortalLoginToken); - } + context.commit(storeMutations.Customer_Portal_Login_Token, customerPortalLoginToken); }, logPageView( From 1715194c5bd66999a60d0c0ef9db6eef8d4cc0dc Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 9 Nov 2023 15:16:38 -0500 Subject: [PATCH 3/3] Update add-to-calendar to pull from submitted order --- .../confirmation/add-to-calendar/add-to-calendar.spec.js | 2 +- .../confirmation/add-to-calendar/add-to-calendar.vue | 8 ++++---- src/store/index.js | 9 +++++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/layouts/confirmation/add-to-calendar/add-to-calendar.spec.js b/src/layouts/confirmation/add-to-calendar/add-to-calendar.spec.js index c55b170cd..52063c1b9 100644 --- a/src/layouts/confirmation/add-to-calendar/add-to-calendar.spec.js +++ b/src/layouts/confirmation/add-to-calendar/add-to-calendar.spec.js @@ -12,7 +12,7 @@ beforeEach(() => { jest.restoreAllMocks(); jest.clearAllMocks(); store.getters = { - order: { + submittedOrder: { schedule: { date: "2019-01-01", startTime: "09:00", 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 24427b2d5..4cbe0d748 100644 --- a/src/layouts/confirmation/add-to-calendar/add-to-calendar.vue +++ b/src/layouts/confirmation/add-to-calendar/add-to-calendar.vue @@ -110,11 +110,11 @@ export default { return this.getCmsContent(this.sameDayDropOffWidgetName, "BodyText"); }, UniqueId() { - return store.getters.order.referralNumber?.toString(); + return store.getters.submittedOrder.referralNumber?.toString(); }, ServiceType() { - const isRepair = store.getters.order.damage.isRepair; - const funnelHasRecalibrationPart = store.getters.funnelHasRecalibrationPart; + const isRepair = store.getters.submittedOrder.damage.isRepair; + const funnelHasRecalibrationPart = store.getters.isRecalibrationOnSubmittedOrder; if (!isRepair) { if (funnelHasRecalibrationPart) { return serviceType.REPLACEMENT_AND_RECALIBRATION; @@ -125,7 +125,7 @@ export default { return serviceType.REPAIR; }, RouteCode() { - return store.getters.order.schedule.routeCode; + return store.getters.submittedOrder.schedule.routeCode; }, Appointment() { var subject = ""; diff --git a/src/store/index.js b/src/store/index.js index de2e6b45b..b75c16390 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -595,6 +595,15 @@ export const getters = { isRecalibrationOnOrder: (state) => { return getHasRecalibrationPart(state); }, + isRecalibrationOnSubmittedOrder: (state) => { + if (window.sessionStorage.getItem("submittedOrder") !== null) { + return getHasRecalibrationPart({ + order: JSON.parse(window.sessionStorage.getItem("submittedOrder")), + }); + } + + return false; + }, areRearWipersOnOrder: (state) => { return !!state.order.lineItems.vaps?.some( (vap) => vap.partType.toUpperCase() === partTypeStrings.REAR_WIPER.toUpperCase()