From 61e350dcbe74207a8eabc9740e47fb56c9f6eec1 Mon Sep 17 00:00:00 2001 From: AdamCaouetteSafelite Date: Mon, 22 Sep 2025 12:06:40 -0400 Subject: [PATCH 1/2] CASH-1338: fix instances where wrong pageName is set and/or pass in pageName var --- src/layouts/schedule/schedule.vue | 14 ++++++++------ .../schedule/shop-location/shop-location.vue | 2 ++ .../service-location-helper.js | 18 +++++++++--------- .../mobile-location-modal-questions.vue | 19 +++++++------------ .../service-location/service-location.vue | 7 ++++--- .../service-zip-modal-question.vue | 14 ++++++++------ .../shop-question/shop-question-popup.vue | 5 +++-- 7 files changed, 41 insertions(+), 38 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 6f1cf5e8b..f3a2c17f1 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -77,6 +77,7 @@ :carId="carId" :isVehicleHeavyTruck="isVehicleHeavyTruck" :mobileFeePart="mobileFeePart" + pageName="schedule" @updated-mobile-fee-part="setMobileFeePart" @updated-recycle-fee-part="setRecycleFeePart" @updated-serviceability="setServiceabilityDetails" @@ -100,6 +101,7 @@ :shopProviderDataFromParent="shopProviderData" :zipCodeFromParent="zipCode" :isShopQuestionDisplayed="isShopQuestionDisplayed" + pageName="schedule" @shop-selected="onShopSelected" @updated-serviceability="setServiceabilityDetails" /> @@ -497,14 +499,14 @@ export default { ); const serviceZipCode = store.getters.order.serviceLocation.zipCode; - const zipCodeDataPromise = getZipCodeData(serviceZipCode); + const zipCodeDataPromise = getZipCodeData(serviceZipCode, "schedule"); const serviceabilityDetailsPromise = getServiceabilityDetails( serviceZipCode, null, - "service-location" + "schedule" ); - const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, "service-location"); - const shopProviderData = await getShopProviderData(serviceZipCode); + const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, "schedule"); + const shopProviderData = await getShopProviderData(serviceZipCode, "schedule"); const providerNumber = shopProviderData?.data?.shopProviders[0]?.providerNumber; // Get pricingByDayUpcharge needed for Pricing By Day @@ -1305,7 +1307,7 @@ export default { ) { navigateToHeritageFunnel({ shouldSaveSession: false, - pageNameToLog: "service-location", + pageNameToLog: "schedule", navType: "back", }); } else { @@ -1630,7 +1632,7 @@ export default { handleZipCodeChange(newZipCode) { this.resetMobileLocation(); - getShopProviderData(newZipCode.zipCode).then((result) => { + getShopProviderData(newZipCode.zipCode, "schedule").then((result) => { this.shopProviderData = result.data; this.resetSelectedProvider(); this.state = newZipCode.state; diff --git a/src/layouts/schedule/shop-location/shop-location.vue b/src/layouts/schedule/shop-location/shop-location.vue index 33ec097e8..e407a7449 100644 --- a/src/layouts/schedule/shop-location/shop-location.vue +++ b/src/layouts/schedule/shop-location/shop-location.vue @@ -17,6 +17,7 @@ :selectedProviderNumberFromParent="selectedProviderNumberFromParent" :shopProviderDataFromParent="shopProviderDataFromParent" :zipCodeFromParent="zipCodeFromParent" + :pageName="pageName" @shop-selected="onShopSelected" @updated-serviceability="setServiceabilityDetails" cmsWidgetName="YourSafeliteShopWidget" /> @@ -55,6 +56,7 @@ export default { type: String, default: null, }, + pageName: String, }, computed: { questionText() { 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 3b81966cc..602fff0e3 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 @@ -7,8 +7,8 @@ export async function getPricedMobileFeePart(serviceZipCode, pageNameToLog) { return null; } - const zipCodeData = await getZipCodeData(serviceZipCode); - const providerData = await getShopProviderData(serviceZipCode); + const zipCodeData = await getZipCodeData(serviceZipCode, pageNameToLog); + const providerData = await getShopProviderData(serviceZipCode, pageNameToLog); // Get the Mobile Fee Part const mobileFeePart = await baseMixin.methods.dispatchStoreActionWithLogging( @@ -50,7 +50,7 @@ export async function getPricedRecycleFeePart(serviceZipCode, pageNameToLog) { return null; } - const zipCodeData = await getZipCodeData(serviceZipCode); + const zipCodeData = await getZipCodeData(serviceZipCode, pageNameToLog); // Get supporting items const supportingItems = await baseMixin.methods.dispatchStoreActionWithLogging( @@ -102,23 +102,23 @@ export async function getServiceabilityDetails(serviceZipCode, lineItems, pageNa ); } -export async function getBillToAccountNumber(providerNumber) { +export async function getBillToAccountNumber(providerNumber, pageNameToLog) { // Get the BillTo Account Number return await baseMixin.methods.dispatchStoreActionWithLogging( storeActions.GET_BILL_TO_ACCOUNT_NUMBER, { providerNumber: providerNumber }, - "service-location", + pageNameToLog, false ); } -export async function getShopProviderData(serviceZipCode) { +export async function getShopProviderData(serviceZipCode, pageNameToLog) { return await baseMixin.methods.dispatchStoreActionWithLogging( storeActions.GET_PROVIDERS, { serviceZipCode: serviceZipCode, }, - "service-location" + pageNameToLog ); } @@ -139,6 +139,6 @@ export async function getClosestApplicableShops(serviceZipCode, carId, pageNameT return closestShops.data; } -export async function getZipCodeData(serviceZipCode) { - return await baseMixin.methods.getZipCodeData(serviceZipCode, "service-location"); +export async function getZipCodeData(serviceZipCode, pageNameToLog) { + return await baseMixin.methods.getZipCodeData(serviceZipCode, pageNameToLog); } 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 ccd4b1aca..7a761afe6 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 @@ -127,6 +127,7 @@ export default { type: Object, default: () => ({}), }, + pageName: String, linkWidgetName: String, modalWidgetName: String, alertNonServiceableZipWidgetName: String, @@ -193,8 +194,7 @@ export default { return; } const zipCodeData = await this.getZipCodeData( - this.internalModel.addressQuestions.zipCode, - "service-location" + this.internalModel.addressQuestions.zipCode ); if (!zipCodeData.isValid) { @@ -216,26 +216,21 @@ export default { // retrieve mobile fee part const serviceZipCode = this.internalModel.addressQuestions.zipCode; - const mobileFeePart = await getPricedMobileFeePart( - serviceZipCode, - "service-location" - ); + const mobileFeePart = await getPricedMobileFeePart(serviceZipCode, this.pageName); // retrieve recycle fee part - const recycleFeePart = await getPricedRecycleFeePart( - serviceZipCode, - "service-location" - ); + const recycleFeePart = await getPricedRecycleFeePart(serviceZipCode, this.pageName); // retrieve serviceability details const serviceabilityDetails = await getServiceabilityDetails( serviceZipCode, null, - "service-location" + this.pageName ); const billToAccountNumber = await getBillToAccountNumber( - this.internalModel.zipCodeCtu + this.internalModel.zipCodeCtu, + this.pageName ); // update content related to service zip code diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index dd6b75d53..62945632a 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -14,6 +14,7 @@ :carId="carId" :isVehicleHeavyTruck="isVehicleHeavyTruck" :mobileFeePart="mobileFeePart" + pageName="service-location" @updated-mobile-fee-part="setMobileFeePart" @updated-recycle-fee-part="setRecycleFeePart" @updated-serviceability="setServiceabilityDetails" @@ -226,7 +227,7 @@ export default { const cmsContentPromise = fetchCmsContentForPage(to.name); const serviceZipCode = store.getters.order.serviceLocation.zipCode; - const zipCodeDataPromise = getZipCodeData(serviceZipCode); + const zipCodeDataPromise = getZipCodeData(serviceZipCode, "service-location"); const serviceabilityDetailsPromise = getServiceabilityDetails( serviceZipCode, @@ -236,7 +237,7 @@ export default { const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, "service-location"); - const shopProviderDataPromise = getShopProviderData(serviceZipCode); // shopQuestion.methods.loadInitialData(serviceZipCode); + const shopProviderDataPromise = getShopProviderData(serviceZipCode, "service-location"); // shopQuestion.methods.loadInitialData(serviceZipCode); // Settle promises and get results const promiseResultMap = [ @@ -846,7 +847,7 @@ export default { zipCode: { handler(newValue) { if (!this.navigatingForward) { - getShopProviderData(this.zipCode).then(async (result) => { + getShopProviderData(this.zipCode, "service-location").then(async (result) => { this.shopProviderData = result.data; if (this.selectedAppointmentType === "Mobile") { 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 2ee6aac3f..2363a2581 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 @@ -91,6 +91,7 @@ export default { type: Object, default: () => ({}), }, + pageName: String, linkWidgetName: String, modalWidgetName: String, editScreenReaderTextCmsWidgetName: String, @@ -162,7 +163,7 @@ export default { const zipCodeData = await this.getZipCodeData( this.internalModel.zipCode, - "service-location" + this.pageName ); if (!zipCodeData.isValid) { @@ -175,7 +176,7 @@ export default { const closestShops = await getClosestApplicableShops( this.internalModel.zipCode, this.carId, - "service-location" + this.pageName ); if (!closestShops || closestShops.inShopProviders?.length === 0) { @@ -193,24 +194,25 @@ export default { const serviceZipCode = this.internalModel.zipCode; const mobileFeePart = await getPricedMobileFeePart( serviceZipCode, - "service-location" + this.pageName ); // retrieve recycle fee part const recycleFeePart = await getPricedRecycleFeePart( serviceZipCode, - "service-location" + this.pageName ); // retrieve serviceability details const serviceabilityDetails = await getServiceabilityDetails( serviceZipCode, null, - "service-location" + this.pageName ); const billToAccountNumber = await getBillToAccountNumber( - this.internalModel.zipCodeCtu + this.internalModel.zipCodeCtu, + this.pageName ); // update content related to service zip code diff --git a/src/layouts/service-location/shop-question/shop-question-popup.vue b/src/layouts/service-location/shop-question/shop-question-popup.vue index 58871decc..e14d96545 100644 --- a/src/layouts/service-location/shop-question/shop-question-popup.vue +++ b/src/layouts/service-location/shop-question/shop-question-popup.vue @@ -136,6 +136,7 @@ export default { type: String, default: null, }, + pageName: String, }, computed: { shopQuestionLinkText() { @@ -280,7 +281,7 @@ export default { } this.isLoading = true; - this.zipCodeData = await this.getZipCodeData(this.localZipCode, "service-location"); + this.zipCodeData = await this.getZipCodeData(this.localZipCode, this.pageName); // Add zipCode to zipCodeData as it does not come back from endpoint this.zipCodeData.zipCode = this.localZipCode; if (this.zipCodeData.isValid) { @@ -289,7 +290,7 @@ export default { const closestShops = await getClosestApplicableShops( this.localZipCode, this.$store.getters.order.vehicle.carId, - "service-location" + this.pageName ); if (!closestShops || closestShops.inShopProviders?.length === 0) { this.isLoading = false; From e5a1bcbdab523a3450275acc25009593edb9e54a Mon Sep 17 00:00:00 2001 From: AdamCaouetteSafelite Date: Mon, 22 Sep 2025 14:28:43 -0400 Subject: [PATCH 2/2] CASH-1338 refactor to use base-mixin var pageName --- src/layouts/schedule/schedule.vue | 18 ++++++++---------- .../schedule/shop-location/shop-location.vue | 2 -- .../mobile-location-modal-questions.vue | 1 - .../service-location/service-location.vue | 11 +++++------ .../service-zip-modal-question.vue | 1 - .../shop-question/shop-question-popup.vue | 1 - 6 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index f3a2c17f1..56a27d15a 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -77,7 +77,6 @@ :carId="carId" :isVehicleHeavyTruck="isVehicleHeavyTruck" :mobileFeePart="mobileFeePart" - pageName="schedule" @updated-mobile-fee-part="setMobileFeePart" @updated-recycle-fee-part="setRecycleFeePart" @updated-serviceability="setServiceabilityDetails" @@ -101,7 +100,6 @@ :shopProviderDataFromParent="shopProviderData" :zipCodeFromParent="zipCode" :isShopQuestionDisplayed="isShopQuestionDisplayed" - pageName="schedule" @shop-selected="onShopSelected" @updated-serviceability="setServiceabilityDetails" /> @@ -499,14 +497,14 @@ export default { ); const serviceZipCode = store.getters.order.serviceLocation.zipCode; - const zipCodeDataPromise = getZipCodeData(serviceZipCode, "schedule"); + const zipCodeDataPromise = getZipCodeData(serviceZipCode, to.name); const serviceabilityDetailsPromise = getServiceabilityDetails( serviceZipCode, null, - "schedule" + to.name ); - const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, "schedule"); - const shopProviderData = await getShopProviderData(serviceZipCode, "schedule"); + const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, to.name); + const shopProviderData = await getShopProviderData(serviceZipCode, to.name); const providerNumber = shopProviderData?.data?.shopProviders[0]?.providerNumber; // Get pricingByDayUpcharge needed for Pricing By Day @@ -517,7 +515,7 @@ export default { const premiumFeePromise = baseMixin.methods.dispatchStoreActionWithLogging( storeActions.GET_MOBILE_PREMIUM_FEE, null, - "schedule" + to.name ); const premiumFeeWithPricePromise = premiumFeePromise.then((result) => { if (result.data) { @@ -526,7 +524,7 @@ export default { { availableLineItems: [result.data], }, - "schedule", + to.name, false ); } else { @@ -1307,7 +1305,7 @@ export default { ) { navigateToHeritageFunnel({ shouldSaveSession: false, - pageNameToLog: "schedule", + pageNameToLog: this.pageName, navType: "back", }); } else { @@ -1632,7 +1630,7 @@ export default { handleZipCodeChange(newZipCode) { this.resetMobileLocation(); - getShopProviderData(newZipCode.zipCode, "schedule").then((result) => { + getShopProviderData(newZipCode.zipCode, this.pageName).then((result) => { this.shopProviderData = result.data; this.resetSelectedProvider(); this.state = newZipCode.state; diff --git a/src/layouts/schedule/shop-location/shop-location.vue b/src/layouts/schedule/shop-location/shop-location.vue index e407a7449..33ec097e8 100644 --- a/src/layouts/schedule/shop-location/shop-location.vue +++ b/src/layouts/schedule/shop-location/shop-location.vue @@ -17,7 +17,6 @@ :selectedProviderNumberFromParent="selectedProviderNumberFromParent" :shopProviderDataFromParent="shopProviderDataFromParent" :zipCodeFromParent="zipCodeFromParent" - :pageName="pageName" @shop-selected="onShopSelected" @updated-serviceability="setServiceabilityDetails" cmsWidgetName="YourSafeliteShopWidget" /> @@ -56,7 +55,6 @@ export default { type: String, default: null, }, - pageName: String, }, computed: { questionText() { 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 7a761afe6..4e74786f1 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 @@ -127,7 +127,6 @@ export default { type: Object, default: () => ({}), }, - pageName: String, linkWidgetName: String, modalWidgetName: String, alertNonServiceableZipWidgetName: String, diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 62945632a..ee7f1797a 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -14,7 +14,6 @@ :carId="carId" :isVehicleHeavyTruck="isVehicleHeavyTruck" :mobileFeePart="mobileFeePart" - pageName="service-location" @updated-mobile-fee-part="setMobileFeePart" @updated-recycle-fee-part="setRecycleFeePart" @updated-serviceability="setServiceabilityDetails" @@ -227,17 +226,17 @@ export default { const cmsContentPromise = fetchCmsContentForPage(to.name); const serviceZipCode = store.getters.order.serviceLocation.zipCode; - const zipCodeDataPromise = getZipCodeData(serviceZipCode, "service-location"); + const zipCodeDataPromise = getZipCodeData(serviceZipCode, to.name); const serviceabilityDetailsPromise = getServiceabilityDetails( serviceZipCode, null, - "service-location" + to.name ); - const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, "service-location"); + const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, to.name); - const shopProviderDataPromise = getShopProviderData(serviceZipCode, "service-location"); // shopQuestion.methods.loadInitialData(serviceZipCode); + const shopProviderDataPromise = getShopProviderData(serviceZipCode, to.name); // shopQuestion.methods.loadInitialData(serviceZipCode); // Settle promises and get results const promiseResultMap = [ @@ -847,7 +846,7 @@ export default { zipCode: { handler(newValue) { if (!this.navigatingForward) { - getShopProviderData(this.zipCode, "service-location").then(async (result) => { + getShopProviderData(this.zipCode, this.pageName).then(async (result) => { this.shopProviderData = result.data; if (this.selectedAppointmentType === "Mobile") { 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 2363a2581..d91fcd210 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 @@ -91,7 +91,6 @@ export default { type: Object, default: () => ({}), }, - pageName: String, linkWidgetName: String, modalWidgetName: String, editScreenReaderTextCmsWidgetName: String, diff --git a/src/layouts/service-location/shop-question/shop-question-popup.vue b/src/layouts/service-location/shop-question/shop-question-popup.vue index e14d96545..430c347e1 100644 --- a/src/layouts/service-location/shop-question/shop-question-popup.vue +++ b/src/layouts/service-location/shop-question/shop-question-popup.vue @@ -136,7 +136,6 @@ export default { type: String, default: null, }, - pageName: String, }, computed: { shopQuestionLinkText() {