From 3cd95431ff9caf77c186bab110cc6f339b465318 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:39:21 -0500 Subject: [PATCH 1/4] CSR-1858 ctu corrections --- .../mobile-location-modal-questions.vue | 1 + .../service-location/service-location.vue | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) 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 8bac8dbb4..762af0d72 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 @@ -252,6 +252,7 @@ export default { this.$emit("updated-mobile-fee-part", mobileFeePart); this.$emit("updated-serviceability", serviceabilityDetails.data); this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); + this.$emit("updated-mobile-ctu", zipCodeData.zipCodeCtu); // update the page level model this.$emit("update:modelValue", this.internalModel); diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 0a74ab21e..1c25b8f40 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -83,6 +83,7 @@ @updated-mobile-fee-part="setMobileFeePart" @updated-serviceability="setServiceabilityDetails" @updated-contains-military-base="setContainsMilitaryBase" + @updated-mobile-ctu="setCtuForMobile" validationRules="mobile-location-required" ref="mobileLocationQuestions" linkWidgetName="MobileLocationLinkWidget" @@ -128,6 +129,7 @@ import contentGroupModal from "@/fmg-components/content-group-modal/content-grou // Supporting files import baseMixin from "@/mixins/base-mixin.js"; +import { AppointmentTypeStrings } from "@/constants/schedule-constants"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; @@ -374,6 +376,9 @@ export default { this.zipContainsMilitaryBase = val; } }, + setCtuForMobile(val) { + this.zipCodeCtu = val; + }, setMobileFeePart(mobileFeePart) { this.mobileFeePart = mobileFeePart; }, @@ -472,6 +477,28 @@ export default { } }, async forwardButtonAction() { + // clear items not needed for appointmentType + if (this.selectedAppointmentType == AppointmentTypeStrings.IN_SHOP) { + // if we have a provider.zipCodeCtu that's different than the servicelocation.zipCodeCtu then they + // may have selected a shop in a different ctu. change the servicelocation zip/ctu if different + if (this.zipCodeCtu != this.selectedProvider.address.zipCodeCtu) { + this.zipCodeCtu = this.selectedProvider.address.zipCodeCtu; + this.zipCode = this.selectedProvider.address.zipCode; + } + + this.city = null; + this.streetAddress = null; + } + + if (this.selectedAppointmentType == AppointmentTypeStrings.MOBILE && + this.selectedProvider && this.selectedProvider.address) { + this.selectedProvider.address.streetAddress = null; + this.selectedProvider.address.city = null; + this.selectedProvider.address.state = null; + this.selectedProvider.address.zipCode = null; + this.selectedProvider.address.zipCodeCtu = null; + } + await this.dispatchStoreAction( this.storeActions.SAVE_SERVICE_LOCATION, { From 7783d233d2909f0f618b417d89c41a71779cec44 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 1 Dec 2023 14:43:03 -0500 Subject: [PATCH 2/4] csr-1853 prettier --- src/layouts/service-location/service-location.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 1c25b8f40..e6cb2138e 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -479,7 +479,7 @@ export default { async forwardButtonAction() { // clear items not needed for appointmentType if (this.selectedAppointmentType == AppointmentTypeStrings.IN_SHOP) { - // if we have a provider.zipCodeCtu that's different than the servicelocation.zipCodeCtu then they + // if we have a provider.zipCodeCtu that's different than the servicelocation.zipCodeCtu then they // may have selected a shop in a different ctu. change the servicelocation zip/ctu if different if (this.zipCodeCtu != this.selectedProvider.address.zipCodeCtu) { this.zipCodeCtu = this.selectedProvider.address.zipCodeCtu; @@ -490,8 +490,11 @@ export default { this.streetAddress = null; } - if (this.selectedAppointmentType == AppointmentTypeStrings.MOBILE && - this.selectedProvider && this.selectedProvider.address) { + if ( + this.selectedAppointmentType == AppointmentTypeStrings.MOBILE && + this.selectedProvider && + this.selectedProvider.address + ) { this.selectedProvider.address.streetAddress = null; this.selectedProvider.address.city = null; this.selectedProvider.address.state = null; From 82e2e041def20be3794b1140414504cd3ed94166 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Fri, 1 Dec 2023 15:27:05 -0500 Subject: [PATCH 3/4] Fix typo --- src/mixins/analytics-mixin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index 6ea36a903..d3fa4d0dd 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -155,7 +155,7 @@ export default { const deviceId = getDeviceIdValue(); // cookieNames.DXDEV const sessionId = getSessionIdValue(); // cookieNames.SESSION_ID const userAgent = navigator.userAgent; // navigator.userAgent - const refferer = + const referrer = applicationConfig.CURRENT_ENVIRONMENT != "Localhost" ? document.referrer : null; // see above const payload = { @@ -163,7 +163,7 @@ export default { deviceId: deviceId, sessionId: sessionId, userAgent: userAgent, - refferer: refferer, + referrer: referrer, }; const response = await baseMixin.methods.dispatchStoreAction( From 0630faa6a5d4d0b01931c1b34ddfc0e39a0e2b2b Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 5 Dec 2023 05:31:10 -0500 Subject: [PATCH 4/4] CSR-1867 introduced by defect CSR-1858 needing to reset zipcode and ctu when selecting a location in a different ctu. fix is to not execute zipcode watch logic while navigating forward. --- .../service-location/service-location.vue | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index e6cb2138e..bfec46932 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -183,6 +183,7 @@ export default { zipContainsMilitaryBase: false, zipCodeCtu: null, shopProviderData: null, + navigatingForward: false, }; }, async beforeRouteEnter(to, from, next) { @@ -477,6 +478,8 @@ export default { } }, async forwardButtonAction() { + this.navigatingForward = true; + // clear items not needed for appointmentType if (this.selectedAppointmentType == AppointmentTypeStrings.IN_SHOP) { // if we have a provider.zipCodeCtu that's different than the servicelocation.zipCodeCtu then they @@ -537,16 +540,18 @@ export default { watch: { zipCode: { handler(newValue) { - getShopProviderData(this.zipCode).then(async (result) => { - this.shopProviderData = result.data; - if (this.selectedAppointmentType === "Mobile") { - this.selectedProvider = new Provider( - this.shopProviderData.mobileProviderNumber - ); - } else { - this.selectedProvider = new Provider(); - } - }); + if (!this.navigatingForward) { + getShopProviderData(this.zipCode).then(async (result) => { + this.shopProviderData = result.data; + if (this.selectedAppointmentType === "Mobile") { + this.selectedProvider = new Provider( + this.shopProviderData.mobileProviderNumber + ); + } else { + this.selectedProvider = new Provider(); + } + }); + } }, }, selectedAppointmentType: {