diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index fb7299f8..1e36cd68 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -319,7 +319,6 @@ export default { this.setCalendarData(initialData); }, resetComponent() { - console.log('Resetting Date Picker Component'); this.isLoading = true; this.selectableDatesData = []; // NOTE: uses monthNum (1-based), NOT monthIndex (0-based) this.selectableTimeSlotsData = []; diff --git a/src/layouts/schedule-page/location-alerts/location-alerts.vue b/src/layouts/schedule-page/location-alerts/location-alerts.vue index 4b0c3bde..25232227 100644 --- a/src/layouts/schedule-page/location-alerts/location-alerts.vue +++ b/src/layouts/schedule-page/location-alerts/location-alerts.vue @@ -40,7 +40,6 @@ export default { return []; } - console.log('Prefixed Alert Reasons:', this.alertReasons); return this.alertReasons.reduce((newObj, alertReason) => { newObj.push({ cmsWidgetName: `${this.cmsWidgetPrefix}${alertReason}`, @@ -62,9 +61,6 @@ export default { initializeComponent(initialData) { this.alertReasons = initialData; }, - cmsHeadlineTextFound(widgetName) { - return this.getCmsContent(widgetName, 'HeadlineText') !== ''; - }, getCmsCopyForAlertReason(alertReason) { const widgetName = `${this.cmsWidgetPrefix}${alertReason}`; let content = this.getCmsContent(widgetName, widgetFields.ALERT_WIDGET.HEADLINE_TEXT); diff --git a/src/layouts/schedule-page/schedule-page.vue b/src/layouts/schedule-page/schedule-page.vue index 14c14db8..bf2231d2 100644 --- a/src/layouts/schedule-page/schedule-page.vue +++ b/src/layouts/schedule-page/schedule-page.vue @@ -217,13 +217,11 @@ export default { mixins: [BaseFormMixin], async beforeRouteEnter(to, from, next) { // Call APIs - let preSelectedDate = await useMainStore().order.schedule.date; - if (!preSelectedDate || preSelectedDate.startTime === null) { - preSelectedDate = null; - } - const cmsContentPromise = fetchCmsContentForPage(to.query.issPage); - const serviceZipCode = useMainStore().order.serviceLocation.zipCode || useMainStore().order.customer.address.zipCode; + const storeServiceLocation = useMainStore().order.serviceLocation; + const storeSelectedAppointmentType = storeServiceLocation?.appointmentType; + const storeSelectedProvider = storeServiceLocation?.provider; + const serviceZipCode = storeServiceLocation?.zipCode || useMainStore().order.customer.address.zipCode; const zipCodeData = getZipCodeData(serviceZipCode); const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode); const serviceabilityDetailsPromise = getServiceabilityDetails(serviceZipCode); @@ -281,8 +279,15 @@ export default { }; useMainStore().updateIsSafeliteProvider(true); next(async (vm) => { + const providerToUse = resultMap.providers?.shopProviders + .find((provider) => provider.providerNumber === storeSelectedProvider?.providerNumber) || resultMap.providers?.shopProviders[0]; + const isMobileAppointment = storeSelectedAppointmentType === AppointmentTypeStrings.MOBILE + || storeSelectedAppointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP; const initialServiceLocationObj = { - provider: resultMap.providers?.shopProviders[0], + mobileProviderNumber: isMobileAppointment + ? storeSelectedProvider?.providerNumber + : null, + provider: isMobileAppointment ? null : providerToUse, zipCode: useMainStore().order.serviceLocation.zipCode || useMainStore().order.customer.address.zipCode, zipCodeCtu: resultMap.zipCodeData?.zipCodeCtu }; @@ -302,6 +307,7 @@ export default { inShopDatesData: [], isMobileView: false, mobileDatesData: [], + mobileFeePart: null, mobilePremiumAppointmentFee: null, mobileProviderNumber: null, mobileZipCodeOverride: null, @@ -389,6 +395,12 @@ export default { this.selectableDatesData = initialData.initialShopTimeSlotsResponse; this.$refs.datePicker.setCalendarData(initialData); }); + } else { + this.mobileProviderNumber = initialServiceLocationObj.mobileProviderNumber; + await this.getDatePickerInitialData().then((initialData) => { + this.selectableDatesData = initialData.initialShopTimeSlotsResponse; + this.$refs.datePicker.setCalendarData(initialData); + }); } }, appointmentTypeChangedFromServiceLocation(newAppointmentType) { @@ -605,12 +617,14 @@ export default { this.selectedTimeSlotInfo = timeSlot; this.showDatePickerError = false; }, - forwardButtonAction() { + async forwardButtonAction() { if (!this.isFormValid) { this.showDatePickerError = true; return; } + // Save service location then schedule and navigate forward + await this.$refs.serviceLocation.forwardButtonAction(); this.mainStore.saveSchedule(this.selectedTimeSlotInfo.timeSlot); this.$router.navigate( this.navigationScenarios.CLICKED_FORWARD, diff --git a/src/store/index.js b/src/store/index.js index 3c0206f0..e0434992 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -876,7 +876,6 @@ export const useMainStore = defineStore({ }); }, getMobileTimeSlots(startDate, endDate, zipCodeOverride = null) { - console.log('Getting mobile time slots with zip code override:', zipCodeOverride); const { order } = this; const { vehicle } = this.order; let lineItems = [ @@ -2718,19 +2717,6 @@ export const useMainStore = defineStore({ }, saveServiceLocation(serviceLocationInfo) { - if (this.order.serviceLocation) { - if ( - serviceLocationInfo.zipCode !== this.order.serviceLocation.zipCode - || !providersEqual( - serviceLocationInfo.provider, - this.order.serviceLocation.provider - ) - || serviceLocationInfo.appointmentType - !== this.order.serviceLocation.appointmentType - ) { - this.resetSchedule(); - } - } this.updateServiceLocation(serviceLocationInfo); },