CSR-1449 | Formatting
This commit is contained in:
parent
19c4d60e23
commit
048e5449be
2 changed files with 21 additions and 23 deletions
|
|
@ -11,6 +11,6 @@ const PREMIUM_FEE_PART_TYPE = "EARLY BIRD";
|
|||
const RouteCodeFlags = {
|
||||
ALL_DAY_DROP_OFF: "ALL DAY DROP OFF",
|
||||
OVERNIGHT_DROP_OFF: "OVERNIGHT DROP OFF",
|
||||
}
|
||||
};
|
||||
|
||||
export { AppointmentTypeStrings, PREMIUM_TIME_SLOT_ID_FLAG, PREMIUM_FEE_PART_TYPE, RouteCodeFlags };
|
||||
|
|
|
|||
|
|
@ -120,9 +120,12 @@ export default {
|
|||
} else {
|
||||
if (!this.selectedTimeSlotId) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
appointmentTypeCmsWidgetName = this.getRelevantDropOffCmsWidgetNameForSelectedTimeSlot(this.selectedTimeSlotId, true);
|
||||
} else {
|
||||
appointmentTypeCmsWidgetName =
|
||||
this.getRelevantDropOffCmsWidgetNameForSelectedTimeSlot(
|
||||
this.selectedTimeSlotId,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
return this.getCmsContent(appointmentTypeCmsWidgetName, "BodyText");
|
||||
|
|
@ -183,13 +186,9 @@ export default {
|
|||
} else if (this.appointmentType === AppointmentTypeStrings.IN_SHOP) {
|
||||
return this.inshopDurationText;
|
||||
} else {
|
||||
if (this.selectedTimeSlotId?.includes(
|
||||
RouteCodeFlags.OVERNIGHT_DROP_OFF
|
||||
)) {
|
||||
if (this.selectedTimeSlotId?.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) {
|
||||
return this.overnightDropoffDurationText;
|
||||
} else if (this.selectedTimeSlotId?.includes(
|
||||
RouteCodeFlags.ALL_DAY_DROP_OFF
|
||||
)) {
|
||||
} else if (this.selectedTimeSlotId?.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)) {
|
||||
return this.dropOffDurationText;
|
||||
} else {
|
||||
return null;
|
||||
|
|
@ -204,7 +203,7 @@ export default {
|
|||
return false;
|
||||
}
|
||||
const selectedDate = this.dateAndTimeSlotData.date;
|
||||
const todaysDate = (new Date()).toISOString().split("T")[0];
|
||||
const todaysDate = new Date().toISOString().split("T")[0];
|
||||
return selectedDate === todaysDate;
|
||||
},
|
||||
|
||||
|
|
@ -278,17 +277,16 @@ export default {
|
|||
}
|
||||
return displayTextForDurationLength;
|
||||
},
|
||||
getRelevantDropOffCmsWidgetNameForSelectedTimeSlot(selectedTimeSlotId, isSameDayRelevant = false) {
|
||||
if (selectedTimeSlotId.includes(
|
||||
RouteCodeFlags.OVERNIGHT_DROP_OFF
|
||||
)) {
|
||||
getRelevantDropOffCmsWidgetNameForSelectedTimeSlot(
|
||||
selectedTimeSlotId,
|
||||
isSameDayRelevant = false
|
||||
) {
|
||||
if (selectedTimeSlotId.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) {
|
||||
return this.overnightDropOffCmsWidgetName;
|
||||
} else if (selectedTimeSlotId.includes(
|
||||
RouteCodeFlags.ALL_DAY_DROP_OFF
|
||||
)) {
|
||||
} else if (selectedTimeSlotId.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)) {
|
||||
return this.isSameDay && isSameDayRelevant
|
||||
? this.sameDayDropOffCmsWidgetName
|
||||
: this.dropoffCmsWidgetName;
|
||||
? this.sameDayDropOffCmsWidgetName
|
||||
: this.dropoffCmsWidgetName;
|
||||
}
|
||||
},
|
||||
getAvailableTimeSlotsForInshop(timeSlotsForSelectedDate) {
|
||||
|
|
@ -302,9 +300,9 @@ export default {
|
|||
},
|
||||
getAvailableTimeSlotsForDropOff(timeSlotsForSelectedDate) {
|
||||
const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot) => {
|
||||
const buttonLabelValue = timeSlot.id.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF) ?
|
||||
this.overnightDropoffButtonText :
|
||||
this.dropoffButtonText;
|
||||
const buttonLabelValue = timeSlot.id.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)
|
||||
? this.overnightDropoffButtonText
|
||||
: this.dropoffButtonText;
|
||||
return {
|
||||
value: timeSlot.id,
|
||||
buttonLabel: buttonLabelValue,
|
||||
|
|
|
|||
Loading…
Reference in a new issue