From 8056eea2e2714e962f98227e0c345ce50f3c6f50 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Fri, 27 Jun 2025 10:10:53 -0400 Subject: [PATCH] Revert "Merge pull request #2605 from Safelite/feature/Digital/CASH-814" This reverts commit 1e4ee3d544ab28df08521f1bdbb37403ec61303e, reversing changes made to 7cb65a585660919d4244a3439a00638ab7f71c36. --- .../time-slot-question/time-slot-question.vue | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 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 f0499e11a..58648746e 100644 --- a/src/layouts/schedule/time-slot-question/time-slot-question.vue +++ b/src/layouts/schedule/time-slot-question/time-slot-question.vue @@ -12,7 +12,10 @@ buttonTypeString="timeSlotModalListButton" :buttonTypeObject="timeSlotModalListButton" class="mt-4" - :class="[isMobileAppointment ? 'is-mobile-appointment' : '']" + :class="[ + isMobileAppointment ? 'is-mobile-appointment' : '', + isDropOffAppointment ? 'is-drop-off-appointment' : '', + ]" :answers="availableTimeSlots" groupName="chooseTimeSlot" textPosition="text-center" @@ -94,7 +97,7 @@ const cmsWidgetFieldMappings = { defineRule("time-slot-required", required(errorMessages.OPTION_REQUIRED)); export default { - name: "time-slot-question", + name: "time-slot-no-modal-question", emits: ["update:modelValue", "TimeSlotSelected", "click-event"], props: { modelValue: { @@ -237,9 +240,6 @@ export default { ); }, disclaimerTextBlockCopy() { - /* AppointmentTypeStrings.DROP_OFF should never be used per CASH-803 epic - but I'm leaving this in assuming that a future card in this epic - will handle disclaimers in a different way */ if (this.appointmentType === AppointmentTypeStrings.DROP_OFF) { if (this.selectedRouteCode?.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)) { if (this.isSameDay) { @@ -329,7 +329,11 @@ export default { return null; } - if (this.appointmentType === AppointmentTypeStrings.MOBILE) { + if (this.appointmentType === AppointmentTypeStrings.DROP_OFF) { + return this.getAvailableTimeSlotsForDropOff( + this.timeSlotsForSelectedDate.timeSlots + ); + } else if (this.appointmentType === AppointmentTypeStrings.MOBILE) { return this.getAvailableTimeSlotsForMobile(this.timeSlotsForSelectedDate.timeSlots); } else { return this.getAvailableTimeSlotsForInshop(this.timeSlotsForSelectedDate.timeSlots); @@ -353,6 +357,9 @@ export default { isMobileAppointment() { return this.appointmentType === AppointmentTypeStrings.MOBILE; }, + isDropOffAppointment() { + return this.appointmentType === AppointmentTypeStrings.DROP_OFF; + }, }, methods: { async setSelectedTimeSlot() { @@ -375,20 +382,23 @@ export default { } }, getAvailableTimeSlotsForInshop(timeSlotsForSelectedDate) { - let dropOffIndex = -1; - const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot, index) => { + return timeSlotsForSelectedDate.map((timeSlot) => { const readableTime = militaryToTwelveHourTime(timeSlot.startTime); - let buttonLabelValue = readableTime; - if (timeSlot.id.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)) { - dropOffIndex = index; - if (this.isSameDay) { - buttonLabelValue = this.sameDayDropoffButtonText; - } else { - buttonLabelValue = this.dropoffButtonText; - } - } else if (timeSlot.id.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) { - dropOffIndex = index; + return { + value: timeSlot.id, + buttonLabel: readableTime, + }; + }); + }, + getAvailableTimeSlotsForDropOff(timeSlotsForSelectedDate) { + const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot) => { + let buttonLabelValue; + if (timeSlot.id.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) { buttonLabelValue = this.overnightDropoffButtonText; + } else if (this.isSameDay) { + buttonLabelValue = this.sameDayDropoffButtonText; + } else { + buttonLabelValue = this.dropoffButtonText; } return { value: timeSlot.id, @@ -396,10 +406,6 @@ export default { }; }); - if (dropOffIndex) { - const dropOffTimeSlot = availableTimeSlots.splice(dropOffIndex, 1)[0]; - availableTimeSlots.unshift(dropOffTimeSlot); - } return availableTimeSlots; }, getAvailableTimeSlotsForMobile(timeSlotsForSelectedDate) {