From 7fe18c3b8279f9ba5dcd8f8f52db76cdafe15af6 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Sat, 6 Dec 2025 08:42:15 -0500 Subject: [PATCH 01/15] CASH-1790-ref: more accurate naming (cherry picked from commit 211906eab93696969311932848fad6a555137a4a) --- 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 5c54c07f3..491a0c2bc 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" @@ -1591,7 +1591,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 dd94ee4d8b96fcd480ffb231da0897a933fb8dce Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Mon, 8 Dec 2025 10:30:19 -0500 Subject: [PATCH 02/15] CSR-1790-ref remove watch on selectedDate and use direct events instead (cherry picked from commit 2af1b71a5264cc4187beac2ffb4c7cc78950438b) --- src/layouts/schedule/schedule.vue | 93 +++++++++++++------------------ 1 file changed, 39 insertions(+), 54 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 491a0c2bc..25e64b8c4 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -1592,27 +1592,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( @@ -1709,6 +1728,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 ( @@ -1717,17 +1739,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; @@ -1875,32 +1886,6 @@ export default { this.handleAppointmentTypeChange(newValue); }, }, - selectedDate(newValue, oldValue) { - // 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 e1b617774c30867d33bcc9f84447df907ad2d5f9 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 10 Dec 2025 15:46:41 -0500 Subject: [PATCH 03/15] CASH-1790 remove unused props (cherry picked from commit 88682fe1b338ef5a70b2a0fec756153a2c7049ff) --- 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 25e64b8c4..936846602 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 04/15] CASH-1790: refactor to remove another watch on time-slot-question (cherry picked from commit 17bcaac1b6331f02cae08040c4cb8af3aade9369) --- src/layouts/schedule/schedule.vue | 13 ++++++------- .../time-slot-question/time-slot-question.vue | 5 ----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 936846602..dd0397da2 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -634,12 +634,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 ( @@ -1591,12 +1591,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, }); } @@ -1896,7 +1896,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 1b8a2cb2e..3a148972b 100644 --- a/src/layouts/schedule/time-slot-question/time-slot-question.vue +++ b/src/layouts/schedule/time-slot-question/time-slot-question.vue @@ -185,11 +185,6 @@ export default { selectedRouteCodeData(newValue) { this.updateDropoffAndTimeSlotAnswersFromSelectedRouteCodeData(newValue); }, - timeSlotsForSelectedDate() { - this.selectedAnswerForDropOffOrInshop = null; - this.selectedAnswerForTimeSlots = null; - this.autoSelectTimeSlotIfOnlyOneIsAvailable(); - }, }, computed: { supplementalInformationBlock() { From 5e0bee779f16b60d5a96bc8382c1d4e0a5bd9ecc Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 11 Dec 2025 11:48:33 -0500 Subject: [PATCH 05/15] CASH-1790: removing date-picker watch bc it was causing issues and redundant (cherry picked from commit cc45d3b521bdec35d999d625e22ff684fd68addb) --- 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 260448886faeaf1c5fad5e9d7de53cee0869b2aa Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 11 Dec 2025 12:38:19 -0500 Subject: [PATCH 06/15] CASH-1790: refactoring and restoring watch on time-slot-question (cherry picked from commit 290ea914e2d8fed5d26e2dd2dbc85915b2b6c53d) --- 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 dd0397da2..bcf138387 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -1200,8 +1200,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({ @@ -1594,10 +1592,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 @@ -1608,11 +1604,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 3a148972b..1b8a2cb2e 100644 --- a/src/layouts/schedule/time-slot-question/time-slot-question.vue +++ b/src/layouts/schedule/time-slot-question/time-slot-question.vue @@ -185,6 +185,11 @@ export default { selectedRouteCodeData(newValue) { this.updateDropoffAndTimeSlotAnswersFromSelectedRouteCodeData(newValue); }, + timeSlotsForSelectedDate() { + this.selectedAnswerForDropOffOrInshop = null; + this.selectedAnswerForTimeSlots = null; + this.autoSelectTimeSlotIfOnlyOneIsAvailable(); + }, }, computed: { supplementalInformationBlock() { From 730b41a3ab80caeae86910e674a43f2e0f0d070c Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 11 Dec 2025 12:45:34 -0500 Subject: [PATCH 07/15] CASH-1790: remove no longer needed boolean check (cherry picked from commit 165157ae4728b53f184a9f502997673404576762) From 50685aaebd186068281122a93261cbfedd9f6c92 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 11 Dec 2025 12:54:37 -0500 Subject: [PATCH 08/15] CASH-1790: copilot suggestion (cherry picked from commit 47e57c8425649efbb0ba6c2ff30f8c0e34c31caf) --- 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 bcf138387..d9f21a950 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -1617,7 +1617,7 @@ export default { isPremiumAppointment: null, }; }, - updateTimeSlot(timeSlotObj) { + updateTimeSlot(timeSlotObj) { if (!timeSlotObj?.routeCode) { this.appointmentType = AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF; this.selectedTimeSlotInfo = this.getEmptyTimeSlot(); From 45d9e9baa92968365b2dba5420ea8d97c309cf5b Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 4 Dec 2025 16:25:28 -0500 Subject: [PATCH 09/15] CASH-1790: remove obsolete method (cherry picked from commit ffb4156b14033ab296430ea2881fa6b1abe2d283) --- src/layouts/schedule/schedule.vue | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 5c54c07f3..377a49ad3 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -1130,29 +1130,6 @@ export default { ); } }, - getTimeSlotInfo() { - // Get the current date - const currentDate = getTodayDate(); - - // Add 10 days to the current date - currentDate.setDate(currentDate.getDate() + 10); - - // Format the date as yyyy-mm-dd - const year = currentDate.getFullYear(); - const month = String(currentDate.getMonth() + 1).padStart(2, "0"); - const day = String(currentDate.getDate()).padStart(2, "0"); - - const formattedDate = `${year}-${month}-${day}`; - - return { - date: formattedDate, - endTime: "12:00", - jobMaxMinutes: "180", - jobMinMinutes: "120", - routeCode: "3357I-03357-M-I*20988*AM", - startTime: "08:00", - }; - }, onShopSelected(shopQuestionPopUpData) { this.resetWaitlist(); this.preSelectedDate = null; From 205b7f1cf3bdfc2f4b0b6f9e914b16c091fb82cf Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 4 Dec 2025 16:26:46 -0500 Subject: [PATCH 10/15] CASH-1790: add refs for self-documenting clarity (cherry picked from commit 56e14ab1cd0d2ecc3dd5ffc9ed97a26772a91e6b) --- .../schedule/time-slot-question/time-slot-question.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 1b8a2cb2e..6f3fb3283 100644 --- a/src/layouts/schedule/time-slot-question/time-slot-question.vue +++ b/src/layouts/schedule/time-slot-question/time-slot-question.vue @@ -1,6 +1,7 @@