Merge pull request #1129 from Safelite/feature/CSR-1144
Feature/csr 1144
This commit is contained in:
commit
8402a4f8bc
2 changed files with 13 additions and 6 deletions
|
|
@ -127,9 +127,9 @@ export default {
|
||||||
name: "schedule",
|
name: "schedule",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedDate: null,
|
selectedDate: this.getSelectedDate(),
|
||||||
selectedTimeSlotData: {
|
selectedTimeSlotData: {
|
||||||
id: null,
|
id: this.getSelectedRouteCode(),
|
||||||
isPremiumAppointment: null,
|
isPremiumAppointment: null,
|
||||||
},
|
},
|
||||||
selectableDatesData: [],
|
selectableDatesData: [],
|
||||||
|
|
@ -219,7 +219,7 @@ export default {
|
||||||
if (this.selectedDate === null) {
|
if (this.selectedDate === null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return this.selectableDatesData.days.find(
|
return this.selectableDatesData.days?.find(
|
||||||
(selectableDate) => selectableDate.dateString === this.selectedDate.dateString
|
(selectableDate) => selectableDate.dateString === this.selectedDate.dateString
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
@ -230,6 +230,7 @@ export default {
|
||||||
const timeSlotSelectedObject = this.getTimeSlotObjectFromTimeSlotId(
|
const timeSlotSelectedObject = this.getTimeSlotObjectFromTimeSlotId(
|
||||||
this.selectedTimeSlotData.id
|
this.selectedTimeSlotData.id
|
||||||
);
|
);
|
||||||
|
|
||||||
if (timeSlotSelectedObject) {
|
if (timeSlotSelectedObject) {
|
||||||
return {
|
return {
|
||||||
date: this.selectedDate.dateString,
|
date: this.selectedDate.dateString,
|
||||||
|
|
@ -277,6 +278,12 @@ export default {
|
||||||
).timeSlots;
|
).timeSlots;
|
||||||
return timeSlots.find((timeSlot) => timeSlot.id === timeSlotId);
|
return timeSlots.find((timeSlot) => timeSlot.id === timeSlotId);
|
||||||
},
|
},
|
||||||
|
getSelectedDate() {
|
||||||
|
return store.getters.order.schedule.date;
|
||||||
|
},
|
||||||
|
getSelectedRouteCode() {
|
||||||
|
return store.getters.order.schedule.routeCode;
|
||||||
|
},
|
||||||
timeSlotModalClosed() {
|
timeSlotModalClosed() {
|
||||||
// Clear the selectedDate if no timeSlot has been selected
|
// Clear the selectedDate if no timeSlot has been selected
|
||||||
if (!this.selectedTimeSlotData.id) {
|
if (!this.selectedTimeSlotData.id) {
|
||||||
|
|
@ -344,7 +351,6 @@ export default {
|
||||||
this.appointmentDateAndTime,
|
this.appointmentDateAndTime,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
navigateToHeritageFunnel({ loadingModal: this.$refs.loadingModal });
|
navigateToHeritageFunnel({ loadingModal: this.$refs.loadingModal });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -157,9 +157,10 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
dateSelectedReadableDate() {
|
dateSelectedReadableDate() {
|
||||||
if (this.dateAndTimeSlotData === null) {
|
if (!this.dateAndTimeSlotData) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This conversion ensures we don't get get GMT induced date changes
|
// This conversion ensures we don't get get GMT induced date changes
|
||||||
const dateObject = new Date(`${this.dateAndTimeSlotData.dateString}T00:00:00`);
|
const dateObject = new Date(`${this.dateAndTimeSlotData.dateString}T00:00:00`);
|
||||||
// Ex: Tuesday, April 22
|
// Ex: Tuesday, April 22
|
||||||
|
|
@ -170,7 +171,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
availableTimeSlots() {
|
availableTimeSlots() {
|
||||||
if (this.dateAndTimeSlotData === null) {
|
if (!this.dateAndTimeSlotData) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (this.appointmentType === AppointmentTypeStrings.DROP_OFF) {
|
if (this.appointmentType === AppointmentTypeStrings.DROP_OFF) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue