diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index dd3f7862a..1e9d88d48 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -218,9 +218,6 @@ export default { pricingByDayBasePrice: Number, pricingByDayUpcharge: Number, isPricingByDayExperiment: Boolean, - appointmentType: String, - estimatedServiceMinutesMinimum: Number, - estimatedServiceMinutesMaximum: Number, isMobileSelected: Boolean, }, setup(props) { diff --git a/src/layouts/schedule/duration-text-block/duration-text-block.vue b/src/layouts/schedule/duration-text-block/duration-text-block.vue new file mode 100644 index 000000000..957b0cfb0 --- /dev/null +++ b/src/layouts/schedule/duration-text-block/duration-text-block.vue @@ -0,0 +1,126 @@ + + + + + \ No newline at end of file diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 67056c67d..5128d4906 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -118,13 +118,14 @@
- + +
+ :isPricingByDayExperiment="isPricingByDayExperiment" /> { @@ -822,12 +819,12 @@ export default { // Splits content when brackets are found in text so that text can be looped through and router-link can be injected when needed return this.splitCopyOnCMSPlaceHolder(this.ChangeShopLinkText); }, - getServiceMinutesMin() { + estimatedServiceMinutesMinimum() { return this.isMobileSelected ? this.selectableDatesMobile.estimatedServiceMinutesMinimum : this.selectableDatesInshop.estimatedServiceMinutesMinimum; }, - getServiceMinutesMax() { + estimatedServiceMinutesMaximum() { return this.isMobileSelected ? this.selectableDatesMobile.estimatedServiceMinutesMaximum : this.selectableDatesInshop.estimatedServiceMinutesMaximum; @@ -847,88 +844,18 @@ 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 + isOvernightDropoff() { + return ( + this.selectedTimeSlotInfo?.timeSlot?.routeCode && this.selectedTimeSlotInfo.timeSlot.routeCode.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF) ); - }, - 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 = @@ -1851,6 +1778,7 @@ export default { contentGroupModal, shopQuestionPopup, buttonQuestion, + durationTextBlock }, };