CSR-1449 | Formatting

This commit is contained in:
Scott Kiener 2023-06-22 10:04:11 -04:00
parent 19c4d60e23
commit 048e5449be
2 changed files with 21 additions and 23 deletions

View file

@ -11,6 +11,6 @@ const PREMIUM_FEE_PART_TYPE = "EARLY BIRD";
const RouteCodeFlags = { const RouteCodeFlags = {
ALL_DAY_DROP_OFF: "ALL DAY DROP OFF", ALL_DAY_DROP_OFF: "ALL DAY DROP OFF",
OVERNIGHT_DROP_OFF: "OVERNIGHT DROP OFF", OVERNIGHT_DROP_OFF: "OVERNIGHT DROP OFF",
} };
export { AppointmentTypeStrings, PREMIUM_TIME_SLOT_ID_FLAG, PREMIUM_FEE_PART_TYPE, RouteCodeFlags }; export { AppointmentTypeStrings, PREMIUM_TIME_SLOT_ID_FLAG, PREMIUM_FEE_PART_TYPE, RouteCodeFlags };

View file

@ -120,9 +120,12 @@ export default {
} else { } else {
if (!this.selectedTimeSlotId) { if (!this.selectedTimeSlotId) {
return null; return null;
} } else {
else { appointmentTypeCmsWidgetName =
appointmentTypeCmsWidgetName = this.getRelevantDropOffCmsWidgetNameForSelectedTimeSlot(this.selectedTimeSlotId, true); this.getRelevantDropOffCmsWidgetNameForSelectedTimeSlot(
this.selectedTimeSlotId,
true
);
} }
} }
return this.getCmsContent(appointmentTypeCmsWidgetName, "BodyText"); return this.getCmsContent(appointmentTypeCmsWidgetName, "BodyText");
@ -183,13 +186,9 @@ export default {
} else if (this.appointmentType === AppointmentTypeStrings.IN_SHOP) { } else if (this.appointmentType === AppointmentTypeStrings.IN_SHOP) {
return this.inshopDurationText; return this.inshopDurationText;
} else { } else {
if (this.selectedTimeSlotId?.includes( if (this.selectedTimeSlotId?.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) {
RouteCodeFlags.OVERNIGHT_DROP_OFF
)) {
return this.overnightDropoffDurationText; return this.overnightDropoffDurationText;
} else if (this.selectedTimeSlotId?.includes( } else if (this.selectedTimeSlotId?.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)) {
RouteCodeFlags.ALL_DAY_DROP_OFF
)) {
return this.dropOffDurationText; return this.dropOffDurationText;
} else { } else {
return null; return null;
@ -204,7 +203,7 @@ export default {
return false; return false;
} }
const selectedDate = this.dateAndTimeSlotData.date; const selectedDate = this.dateAndTimeSlotData.date;
const todaysDate = (new Date()).toISOString().split("T")[0]; const todaysDate = new Date().toISOString().split("T")[0];
return selectedDate === todaysDate; return selectedDate === todaysDate;
}, },
@ -278,17 +277,16 @@ export default {
} }
return displayTextForDurationLength; return displayTextForDurationLength;
}, },
getRelevantDropOffCmsWidgetNameForSelectedTimeSlot(selectedTimeSlotId, isSameDayRelevant = false) { getRelevantDropOffCmsWidgetNameForSelectedTimeSlot(
if (selectedTimeSlotId.includes( selectedTimeSlotId,
RouteCodeFlags.OVERNIGHT_DROP_OFF isSameDayRelevant = false
)) { ) {
if (selectedTimeSlotId.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) {
return this.overnightDropOffCmsWidgetName; return this.overnightDropOffCmsWidgetName;
} else if (selectedTimeSlotId.includes( } else if (selectedTimeSlotId.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)) {
RouteCodeFlags.ALL_DAY_DROP_OFF
)) {
return this.isSameDay && isSameDayRelevant return this.isSameDay && isSameDayRelevant
? this.sameDayDropOffCmsWidgetName ? this.sameDayDropOffCmsWidgetName
: this.dropoffCmsWidgetName; : this.dropoffCmsWidgetName;
} }
}, },
getAvailableTimeSlotsForInshop(timeSlotsForSelectedDate) { getAvailableTimeSlotsForInshop(timeSlotsForSelectedDate) {
@ -302,9 +300,9 @@ export default {
}, },
getAvailableTimeSlotsForDropOff(timeSlotsForSelectedDate) { getAvailableTimeSlotsForDropOff(timeSlotsForSelectedDate) {
const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot) => { const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot) => {
const buttonLabelValue = timeSlot.id.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF) ? const buttonLabelValue = timeSlot.id.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)
this.overnightDropoffButtonText : ? this.overnightDropoffButtonText
this.dropoffButtonText; : this.dropoffButtonText;
return { return {
value: timeSlot.id, value: timeSlot.id,
buttonLabel: buttonLabelValue, buttonLabel: buttonLabelValue,