From 7fe18c3b8279f9ba5dcd8f8f52db76cdafe15af6 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Sat, 6 Dec 2025 08:42:15 -0500 Subject: [PATCH 01/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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 6a033237c14ac0cbfcdc01e5eaae6db18f0cff96 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 16 Dec 2025 16:42:23 -0500 Subject: [PATCH 09/11] CASH-1790 quick fix; missed event emit (cherry picked from commit dbd7681b4748b598d3a5eac95daa08c63ecab659) --- .../appointment-type-question/appointment-type-question.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue index fc4d08b92..924b2e62a 100644 --- a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue +++ b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue @@ -80,6 +80,7 @@ export default { }, set: function (newValue) { this.$emit("update:modelValue", newValue); + this.$emit("handle-appointment-type-change", newValue); }, }, isMobileOnly() { From 29c7243b9825e42b6d876bfd41ffa06b7cbcdce1 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 11 Dec 2025 12:45:34 -0500 Subject: [PATCH 10/11] CASH-1790: remove no longer needed boolean check (cherry picked from commit 165157ae4728b53f184a9f502997673404576762) --- 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 8faea66f7..bee86a537 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:38:19 -0500 Subject: [PATCH 11/11] CASH-1790: refactoring and restoring watch on time-slot-question (cherry picked from commit 290ea914e2d8fed5d26e2dd2dbc85915b2b6c53d) --- src/layouts/schedule/time-slot-question/time-slot-question.vue | 3 --- 1 file changed, 3 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 84701bc09..d12757571 100644 --- a/src/layouts/schedule/time-slot-question/time-slot-question.vue +++ b/src/layouts/schedule/time-slot-question/time-slot-question.vue @@ -190,9 +190,6 @@ export default { 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();