From 211906eab93696969311932848fad6a555137a4a Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Sat, 6 Dec 2025 08:42:15 -0500 Subject: [PATCH 1/8] CASH-1790-ref: more accurate naming --- src/digital-components/date-picker/date-picker.vue | 2 +- src/layouts/schedule/schedule.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index d586ff839..db1eba7ff 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -281,7 +281,7 @@ export default { if (event.screenX === 0 && event.screenY === 0) { return; } - this.$emit("date-clicked", date); + this.$emit("date-selected", date); }, getWeekStartDate(dateString) { const date = convertDateStringToDate(dateString); diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index d3d382980..175ece2b1 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -144,7 +144,7 @@ class="text-link-small" :getMoreDatesCallback="getMoreScheduleData" validationRules="date-required" - @date-clicked="handleDateClicked" + @date-selected="handleDateSelected" :pricingByDayBasePrice="pricingByDayBasePrice" :pricingByDayUpcharge="pricingByDayUpcharge" :showPricingByDay="showPricingByDay" @@ -1572,7 +1572,7 @@ export default { handleWaitListRequested(value) { this.waitListRequested = value; }, - handleDateClicked(date) { + handleDateSelected(date) { // do something to mark this as upcharge day or not... if (date.isPricingByDayUpchargeDay) { this.includePricingByDayUpcharge = true; From 2af1b71a5264cc4187beac2ffb4c7cc78950438b Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Mon, 8 Dec 2025 10:30:19 -0500 Subject: [PATCH 2/8] CSR-1790-ref remove watch on selectedDate and use direct events instead --- src/layouts/schedule/schedule.vue | 97 +++++++++++++------------------ 1 file changed, 39 insertions(+), 58 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 175ece2b1..00ad09b46 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -1573,27 +1573,46 @@ export default { this.waitListRequested = value; }, handleDateSelected(date) { - // do something to mark this as upcharge day or not... - if (date.isPricingByDayUpchargeDay) { - this.includePricingByDayUpcharge = true; - } else { - this.includePricingByDayUpcharge = false; + const previousDate = this.selectedDate; + + // check if date actually changed + if (previousDate !== date.dateString) { + this.handleDateChanged({ + newDate: date.dateString, + oldDate: previousDate + }); } + + // TODO: REMOVE AS PART OF CASH-1634 + // // do something to mark this as upcharge day or not... + // if (date.isPricingByDayUpchargeDay) { + // this.includePricingByDayUpcharge = true; + // } else { + // this.includePricingByDayUpcharge = false; + // } }, - updateTimeSlot(timeSlotObj) { + handleDateChanged(newDate) { + // Clear time slot selection when date changes + this.selectedTimeSlotInfo = this.getEmptyTimeSlot(); + this.updateFooterButtonText(this.selectedTimeSlotInfo); + }, + getEmptyTimeSlot() { + return { + timeSlot: { + date: null, + routeCode: null, + startTime: null, + endTime: null, + jobMaxMinutes: null, + jobMinMinutes: null, + }, + isPremiumAppointment: null, + }; + }, + updateTimeSlot(timeSlotObj) { if (!timeSlotObj?.routeCode) { this.appointmentType = AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF; - this.selectedTimeSlotInfo = { - timeSlot: { - date: null, - routeCode: null, - startTime: null, - endTime: null, - jobMaxMinutes: null, - jobMinMinutes: null, - }, - isPremiumAppointment: null, - }; + this.selectedTimeSlotInfo = this.getEmptyTimeSlot(); return; } const timeSlot = this.timeSlotsForSelectedDate?.timeSlots?.find( @@ -1690,6 +1709,9 @@ export default { }, handleAppointmentTypeChange(newAppointmentType) { this.updateFooterButtonText(); + // if time appointment type changes, clear any selected time slot + this.selectedTimeSlotInfo = this.getEmptyTimeSlot(); + if (newAppointmentType === AppointmentTypeStrings.MOBILE) { // Remember last shop selected if previous selection was inshop/dropoff if ( @@ -1698,17 +1720,6 @@ export default { AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF) && this.selectedProvider ) { - this.selectedTimeSlotInfo = { - timeSlot: { - date: null, - routeCode: null, - startTime: null, - endTime: null, - jobMaxMinutes: null, - jobMinMinutes: null, - }, - isPremiumAppointment: null, - }; this.lastSelectedInshopOrDropoffProvider = this.selectedProvider; } this.appointmentType = AppointmentTypeStrings.MOBILE; @@ -1856,36 +1867,6 @@ export default { this.handleAppointmentTypeChange(newValue); }, }, - selectedDate(newValue, oldValue) { - if (!this.isDatePickerDoneInitializing) { - return; - } // needed otherwise it nulls selectedTimeSlotInfo too early and prevents a previously selected time slot from auto-selecting - - // Clear time slot selection if date selected changes - const selectedDate = this.getSelectedDateFromStore(); - if (oldValue && this.appointmentType === AppointmentTypeStrings.MOBILE) { - oldValue = `${oldValue}-mobile`; - } - const hasValueChanged = newValue !== oldValue; - const isDateDifferent = (newValue || oldValue) !== selectedDate; - - if (hasValueChanged && isDateDifferent && !this.selectedMobileFirstAppointment) { - this.selectedTimeSlotInfo = { - timeSlot: { - date: null, - routeCode: null, - startTime: null, - endTime: null, - jobMaxMinutes: null, - jobMinMinutes: null, - }, - isPremiumAppointment: null, - }; - } - }, - selectedTimeSlotInfo(newValue) { - this.updateFooterButtonText(newValue); - }, }, components: { funnelHeader, From 88682fe1b338ef5a70b2a0fec756153a2c7049ff Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 10 Dec 2025 15:46:41 -0500 Subject: [PATCH 3/8] CASH-1790 remove unused props --- src/layouts/schedule/schedule.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 00ad09b46..898be4a1b 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -133,8 +133,6 @@ :isOvernightDropoff="isOvernightDropoff" /> Date: Wed, 10 Dec 2025 17:15:11 -0500 Subject: [PATCH 4/8] CASH-1790: refactor to remove another watch on time-slot-question --- src/layouts/schedule/schedule.vue | 13 ++++++------- .../time-slot-question/time-slot-question.vue | 8 -------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 898be4a1b..d78c37115 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -636,12 +636,12 @@ export default { showTimeSlotQuestion() { if ( this.selectedDate && - this.selectedDate.includes("mobile") && - !this.isMobileSelected + this.appointmentTypeFromAppointmentTypeQuestion && + this.timeSlotsForSelectedDate ) { - this.setSelectedDateToFirstAvailable(); + return true; } - return this.selectedDate && this.appointmentTypeFromAppointmentTypeQuestion; + return false; }, isMobileStaticRecalibrationApplicable() { return ( @@ -1572,12 +1572,12 @@ export default { }, handleDateSelected(date) { const previousDate = this.selectedDate; - + // check if date actually changed if (previousDate !== date.dateString) { this.handleDateChanged({ newDate: date.dateString, - oldDate: previousDate + oldDate: previousDate, }); } @@ -1877,7 +1877,6 @@ export default { textBlock, timeSlotQuestion, mobileFirstModal, - alert, serviceZipModalQuestion, appointmentTypeQuestion, diff --git a/src/layouts/schedule/time-slot-question/time-slot-question.vue b/src/layouts/schedule/time-slot-question/time-slot-question.vue index d2e43054c..3690370e0 100644 --- a/src/layouts/schedule/time-slot-question/time-slot-question.vue +++ b/src/layouts/schedule/time-slot-question/time-slot-question.vue @@ -190,14 +190,6 @@ export default { selectedRouteCodeData(newValue) { this.updateDropoffAndTimeSlotAnswersFromSelectedRouteCodeData(newValue); }, - timeSlotsForSelectedDate() { - if (!this.isDatePickerDoneInitializing) { - return; - } // needed otherwise it nulls these too early and prevents a previously selected time slot from auto-selecting - this.selectedAnswerForDropOffOrInshop = null; - this.selectedAnswerForTimeSlots = null; - this.autoSelectTimeSlotIfOnlyOneIsAvailable(); - }, }, computed: { supplementalInformationBlock() { From cc45d3b521bdec35d999d625e22ff684fd68addb Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 11 Dec 2025 11:48:33 -0500 Subject: [PATCH 5/8] CASH-1790: removing date-picker watch bc it was causing issues and redundant --- src/digital-components/date-picker/date-picker.vue | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index db1eba7ff..9d620ec77 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -846,12 +846,6 @@ export default { }, }, watch: { - isLoading(newValue) { - // if done loading dates, then set to first available date - if (newValue === false && this.firstAvailableSelectableDate) { - this.selectedDate = this.firstAvailableSelectableDate; - } - }, modelValue(newValue) { this.resetField({ value: newValue, From 290ea914e2d8fed5d26e2dd2dbc85915b2b6c53d Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 11 Dec 2025 12:38:19 -0500 Subject: [PATCH 6/8] CASH-1790: refactoring and restoring watch on time-slot-question --- src/layouts/schedule/schedule.vue | 13 ++----------- .../time-slot-question/time-slot-question.vue | 5 +++++ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index d78c37115..a58d7182c 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -1179,8 +1179,6 @@ export default { async initializeDatePicker() { this.isShowMobileFirstAppt && this.showLoadingModal(); - this.selectedDate = null; - const includeMobileTimeSlots = this.isServiceableMobile; const includeInshopTimeSlots = this.isServiceableInshop || this.isServiceableDropoff; const datePickerInitialData = await this.$refs.datePicker.loadInitialData({ @@ -1575,10 +1573,8 @@ export default { // check if date actually changed if (previousDate !== date.dateString) { - this.handleDateChanged({ - newDate: date.dateString, - oldDate: previousDate, - }); + this.selectedTimeSlotInfo = this.getEmptyTimeSlot(); + this.updateFooterButtonText(this.selectedTimeSlotInfo); } // TODO: REMOVE AS PART OF CASH-1634 @@ -1589,11 +1585,6 @@ export default { // this.includePricingByDayUpcharge = false; // } }, - handleDateChanged(newDate) { - // Clear time slot selection when date changes - this.selectedTimeSlotInfo = this.getEmptyTimeSlot(); - this.updateFooterButtonText(this.selectedTimeSlotInfo); - }, getEmptyTimeSlot() { return { timeSlot: { diff --git a/src/layouts/schedule/time-slot-question/time-slot-question.vue b/src/layouts/schedule/time-slot-question/time-slot-question.vue index 3690370e0..647d7c48b 100644 --- a/src/layouts/schedule/time-slot-question/time-slot-question.vue +++ b/src/layouts/schedule/time-slot-question/time-slot-question.vue @@ -190,6 +190,11 @@ export default { selectedRouteCodeData(newValue) { this.updateDropoffAndTimeSlotAnswersFromSelectedRouteCodeData(newValue); }, + timeSlotsForSelectedDate() { + this.selectedAnswerForDropOffOrInshop = null; + this.selectedAnswerForTimeSlots = null; + this.autoSelectTimeSlotIfOnlyOneIsAvailable(); + }, }, computed: { supplementalInformationBlock() { From 165157ae4728b53f184a9f502997673404576762 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 11 Dec 2025 12:45:34 -0500 Subject: [PATCH 7/8] CASH-1790: remove no longer needed boolean check --- src/layouts/schedule/schedule.vue | 4 ---- .../schedule/time-slot-question/time-slot-question.vue | 1 - 2 files changed, 5 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index a58d7182c..d2a4e8038 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -165,7 +165,6 @@ :timeSlotsForSelectedDate="timeSlotsForSelectedDate" :isSameDay="isSameDay" :selectedRouteCodeData="selectedRouteCodeData" - :isDatePickerDoneInitializing="isDatePickerDoneInitializing" @waitListRequested="handleWaitListRequested" /> Date: Thu, 11 Dec 2025 12:54:37 -0500 Subject: [PATCH 8/8] CASH-1790: copilot suggestion --- src/layouts/schedule/schedule.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index d2a4e8038..bee86a537 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -1594,7 +1594,7 @@ export default { isPremiumAppointment: null, }; }, - updateTimeSlot(timeSlotObj) { + updateTimeSlot(timeSlotObj) { if (!timeSlotObj?.routeCode) { this.appointmentType = AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF; this.selectedTimeSlotInfo = this.getEmptyTimeSlot();