From a193cd1808954cd9d6d26cd71df23ffe272b73ab Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Thu, 31 Jul 2025 08:09:52 -0400 Subject: [PATCH] Moved duration into schedule --- .../date-picker/date-picker.vue | 103 ------------------ src/layouts/schedule/schedule.vue | 91 ++++++++++++++++ 2 files changed, 91 insertions(+), 103 deletions(-) diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index 5f508f5be..dd3f7862a 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -2,17 +2,6 @@
-
- - -
-
Select a day and time
diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 24635a1f5..67056c67d 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -116,6 +116,16 @@
+
+ + +
{ @@ -835,9 +847,88 @@ export default { ); } }, + durationTextBlockCopy() { + console.log("durationTextBlockCopy", this.appointmentType, this.getServiceMinutesMax, this.getServiceMinutesMin); + if (this.appointmentType === AppointmentTypeStrings.MOBILE) { + return this.mobileDurationText; + } else if (this.appointmentType === AppointmentTypeStrings.IN_SHOP) { + return this.inshopDurationText; + } else if ( + this.appointmentType === AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF || + this.appointmentType === AppointmentTypeStrings.DROP_OFF + ) { + return this.getDurationTextBlockCopyForInshopOrDropoff(this.selectedTimeSlotInfo.timeSlot.routeCode); + } + return null; + }, + isSameDay() { + const todaysDate = new Date().toISOString().split("T")[0]; + return this.selectedDate === todaysDate; + }, + dropOffDurationText() { + return this.getCmsContent("DropOffTimeSlotModal", cmsWidgetFieldMappings.DURATION); + }, + sameDayDropoffDurationText() { + return this.getCmsContent( + "SameDayDropOffTimeSlotModal", + cmsWidgetFieldMappings.DURATION + ); + }, + overnightDropoffDurationText() { + return this.getCmsContent( + "OvernightDropOffTimeSlotModal", + cmsWidgetFieldMappings.DURATION + ); + }, + inshopDurationText() { + const inshopDurationTextWithoutTime = this.getCmsContent( + "TimeSlotModalQuestion", + cmsWidgetFieldMappings.DURATION + ); + + const inshopDurationTime = getDisplayTextForDurationLength( + this.getServiceMinutesMin, + this.getServiceMinutesMax + ); + + if (this.getServiceMinutesMin && this.getServiceMinutesMax) { + return `${inshopDurationTextWithoutTime} ${inshopDurationTime}`; + } + + return null; + }, + mobileDurationText() { + const mobileDurationTextWithoutTime = this.getCmsContent( + "TimeSlotModalQuestion", + cmsWidgetFieldMappings.DURATION + ); + + const mobileDurationTime = getDisplayTextForDurationLength( + this.getServiceMinutesMin, + this.getServiceMinutesMax + ); + + if (this.getServiceMinutesMin && this.getServiceMinutesMax) { + return `${mobileDurationTextWithoutTime} ${mobileDurationTime}`; + } + + return null; + }, }, methods: { splitCopyOnCMSPlaceHolder, + getDurationTextBlockCopyForInshopOrDropoff(selectedRouteCode) { + if (selectedRouteCode?.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) { + return this.overnightDropoffDurationText; + } else if (selectedRouteCode?.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)) { + if (this.isSameDay) { + return this.sameDayDropoffDurationText; + } else { + return this.dropOffDurationText; + } + } + return this.inshopDurationText; + }, arePagePrerequisitesValid() { const paymentInfo = store.getters.payment.isInsurance !== null; const damageInfo =