Merge pull request #2610 from Safelite/feature/Digital/CASH-814
Revert "Merge pull request #2605 from Safelite/feature/Digital/CASH-814"
This commit is contained in:
commit
88d3baeed2
1 changed files with 28 additions and 22 deletions
|
|
@ -12,7 +12,10 @@
|
||||||
buttonTypeString="timeSlotModalListButton"
|
buttonTypeString="timeSlotModalListButton"
|
||||||
:buttonTypeObject="timeSlotModalListButton"
|
:buttonTypeObject="timeSlotModalListButton"
|
||||||
class="mt-4"
|
class="mt-4"
|
||||||
:class="[isMobileAppointment ? 'is-mobile-appointment' : '']"
|
:class="[
|
||||||
|
isMobileAppointment ? 'is-mobile-appointment' : '',
|
||||||
|
isDropOffAppointment ? 'is-drop-off-appointment' : '',
|
||||||
|
]"
|
||||||
:answers="availableTimeSlots"
|
:answers="availableTimeSlots"
|
||||||
groupName="chooseTimeSlot"
|
groupName="chooseTimeSlot"
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
|
|
@ -94,7 +97,7 @@ const cmsWidgetFieldMappings = {
|
||||||
defineRule("time-slot-required", required(errorMessages.OPTION_REQUIRED));
|
defineRule("time-slot-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "time-slot-question",
|
name: "time-slot-no-modal-question",
|
||||||
emits: ["update:modelValue", "TimeSlotSelected", "click-event"],
|
emits: ["update:modelValue", "TimeSlotSelected", "click-event"],
|
||||||
props: {
|
props: {
|
||||||
modelValue: {
|
modelValue: {
|
||||||
|
|
@ -237,9 +240,6 @@ export default {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
disclaimerTextBlockCopy() {
|
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.appointmentType === AppointmentTypeStrings.DROP_OFF) {
|
||||||
if (this.selectedRouteCode?.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)) {
|
if (this.selectedRouteCode?.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)) {
|
||||||
if (this.isSameDay) {
|
if (this.isSameDay) {
|
||||||
|
|
@ -329,7 +329,11 @@ export default {
|
||||||
return null;
|
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);
|
return this.getAvailableTimeSlotsForMobile(this.timeSlotsForSelectedDate.timeSlots);
|
||||||
} else {
|
} else {
|
||||||
return this.getAvailableTimeSlotsForInshop(this.timeSlotsForSelectedDate.timeSlots);
|
return this.getAvailableTimeSlotsForInshop(this.timeSlotsForSelectedDate.timeSlots);
|
||||||
|
|
@ -353,6 +357,9 @@ export default {
|
||||||
isMobileAppointment() {
|
isMobileAppointment() {
|
||||||
return this.appointmentType === AppointmentTypeStrings.MOBILE;
|
return this.appointmentType === AppointmentTypeStrings.MOBILE;
|
||||||
},
|
},
|
||||||
|
isDropOffAppointment() {
|
||||||
|
return this.appointmentType === AppointmentTypeStrings.DROP_OFF;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async setSelectedTimeSlot() {
|
async setSelectedTimeSlot() {
|
||||||
|
|
@ -375,20 +382,23 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getAvailableTimeSlotsForInshop(timeSlotsForSelectedDate) {
|
getAvailableTimeSlotsForInshop(timeSlotsForSelectedDate) {
|
||||||
let dropOffIndex = -1;
|
return timeSlotsForSelectedDate.map((timeSlot) => {
|
||||||
const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot, index) => {
|
|
||||||
const readableTime = militaryToTwelveHourTime(timeSlot.startTime);
|
const readableTime = militaryToTwelveHourTime(timeSlot.startTime);
|
||||||
let buttonLabelValue = readableTime;
|
return {
|
||||||
if (timeSlot.id.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)) {
|
value: timeSlot.id,
|
||||||
dropOffIndex = index;
|
buttonLabel: readableTime,
|
||||||
if (this.isSameDay) {
|
};
|
||||||
buttonLabelValue = this.sameDayDropoffButtonText;
|
});
|
||||||
} else {
|
},
|
||||||
buttonLabelValue = this.dropoffButtonText;
|
getAvailableTimeSlotsForDropOff(timeSlotsForSelectedDate) {
|
||||||
}
|
const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot) => {
|
||||||
} else if (timeSlot.id.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) {
|
let buttonLabelValue;
|
||||||
dropOffIndex = index;
|
if (timeSlot.id.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) {
|
||||||
buttonLabelValue = this.overnightDropoffButtonText;
|
buttonLabelValue = this.overnightDropoffButtonText;
|
||||||
|
} else if (this.isSameDay) {
|
||||||
|
buttonLabelValue = this.sameDayDropoffButtonText;
|
||||||
|
} else {
|
||||||
|
buttonLabelValue = this.dropoffButtonText;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
value: timeSlot.id,
|
value: timeSlot.id,
|
||||||
|
|
@ -396,10 +406,6 @@ export default {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
if (dropOffIndex) {
|
|
||||||
const dropOffTimeSlot = availableTimeSlots.splice(dropOffIndex, 1)[0];
|
|
||||||
availableTimeSlots.unshift(dropOffTimeSlot);
|
|
||||||
}
|
|
||||||
return availableTimeSlots;
|
return availableTimeSlots;
|
||||||
},
|
},
|
||||||
getAvailableTimeSlotsForMobile(timeSlotsForSelectedDate) {
|
getAvailableTimeSlotsForMobile(timeSlotsForSelectedDate) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue