Refactor timeslot to time-slot and timeSlot
This commit is contained in:
parent
53d11767c5
commit
7327de6e7b
3 changed files with 12 additions and 12 deletions
|
|
@ -262,7 +262,7 @@ export default {
|
||||||
return timeSlots.find((timeSlot) => timeSlot.id === timeSlotId);
|
return timeSlots.find((timeSlot) => timeSlot.id === timeSlotId);
|
||||||
},
|
},
|
||||||
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) {
|
||||||
this.selectedDate = null;
|
this.selectedDate = null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import baseInputButton from "@/digital-components/base-input-button/base-input-b
|
||||||
import inputButtonWrapperMixin from "@/mixins/input-button-wrapper-mixin";
|
import inputButtonWrapperMixin from "@/mixins/input-button-wrapper-mixin";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "timeslotModalListButton",
|
name: "timeSlotModalListButton",
|
||||||
mixins: [inputButtonWrapperMixin],
|
mixins: [inputButtonWrapperMixin],
|
||||||
computed: {
|
computed: {
|
||||||
formattedButtonLabelSubCopy() {
|
formattedButtonLabelSubCopy() {
|
||||||
|
|
@ -14,8 +14,8 @@
|
||||||
typeStyle="small"
|
typeStyle="small"
|
||||||
class="duration-text-block" />
|
class="duration-text-block" />
|
||||||
<buttonQuestion
|
<buttonQuestion
|
||||||
buttonTypeString="timeslotModalListButton"
|
buttonTypeString="timeSlotModalListButton"
|
||||||
:buttonTypeObject="timeslotModalListButton"
|
:buttonTypeObject="timeSlotModalListButton"
|
||||||
:answers="availableTimeSlots"
|
:answers="availableTimeSlots"
|
||||||
groupName="ChooseTimeSlot"
|
groupName="ChooseTimeSlot"
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
import modal from "@/digital-components/modal/modal";
|
import modal from "@/digital-components/modal/modal";
|
||||||
import textBlock from "@/digital-components/text-block/text-block";
|
import textBlock from "@/digital-components/text-block/text-block";
|
||||||
import buttonQuestion from "@/digital-components/button-question/button-question";
|
import buttonQuestion from "@/digital-components/button-question/button-question";
|
||||||
import timeslotModalListButton from "./timeslot-modal-list-button/timeslot-modal-list-button";
|
import timeSlotModalListButton from "./time-slot-modal-list-button/time-slot-modal-list-button";
|
||||||
|
|
||||||
// TODO: Move this somewhere more global
|
// TODO: Move this somewhere more global
|
||||||
import { DAYS_OF_WEEK, MONTHS_OF_YEAR } from "@/digital-components/date-picker/mixins/constants.js";
|
import { DAYS_OF_WEEK, MONTHS_OF_YEAR } from "@/digital-components/date-picker/mixins/constants.js";
|
||||||
|
|
@ -81,7 +81,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
selectedTimeSlotId: null,
|
selectedTimeSlotId: null,
|
||||||
isSelectedAppointmentPremium: null,
|
isSelectedAppointmentPremium: null,
|
||||||
timeslotModalListButton: timeslotModalListButton,
|
timeSlotModalListButton: timeSlotModalListButton,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
|
|
@ -183,17 +183,17 @@ export default {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
availableTimeSlots = this.dateAndTimeSlotData.timeSlots.map((timeslot) => {
|
availableTimeSlots = this.dateAndTimeSlotData.timeSlots.map((timeSlot) => {
|
||||||
let readableTime;
|
let readableTime;
|
||||||
if (this.appointmentType === AppointmentTypeStrings.IN_SHOP) {
|
if (this.appointmentType === AppointmentTypeStrings.IN_SHOP) {
|
||||||
readableTime = this.getDisplayTextForMilitaryTime(timeslot.startTime);
|
readableTime = this.getDisplayTextForMilitaryTime(timeSlot.startTime);
|
||||||
} else if (this.appointmentType === AppointmentTypeStrings.MOBILE) {
|
} else if (this.appointmentType === AppointmentTypeStrings.MOBILE) {
|
||||||
readableTime = `${this.getDisplayTextForMilitaryTime(
|
readableTime = `${this.getDisplayTextForMilitaryTime(
|
||||||
timeslot.startTime
|
timeSlot.startTime
|
||||||
)} - ${this.getDisplayTextForMilitaryTime(timeslot.endTime)}`;
|
)} - ${this.getDisplayTextForMilitaryTime(timeSlot.endTime)}`;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
value: timeslot.id,
|
value: timeSlot.id,
|
||||||
buttonLabel: readableTime,
|
buttonLabel: readableTime,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
@ -207,7 +207,7 @@ export default {
|
||||||
const formattedPrice =
|
const formattedPrice =
|
||||||
"+$" + this.getTotalLineItemPrice(this.premiumAppointmentFee).toFixed(2);
|
"+$" + this.getTotalLineItemPrice(this.premiumAppointmentFee).toFixed(2);
|
||||||
availableTimeSlots.unshift({
|
availableTimeSlots.unshift({
|
||||||
// Unique value is required for each <input> and the premium appoinment shares a timeslot ID
|
// Unique value is required for each <input> and the premium appoinment shares a timeSlot ID
|
||||||
value: this.addPremiumFlagToInput(this.dateAndTimeSlotData.timeSlots[0].id),
|
value: this.addPremiumFlagToInput(this.dateAndTimeSlotData.timeSlots[0].id),
|
||||||
buttonLabel: this.premiumAppointmentButtonText,
|
buttonLabel: this.premiumAppointmentButtonText,
|
||||||
buttonLabelSubCopy: formattedPrice,
|
buttonLabelSubCopy: formattedPrice,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue