Refactor timeslot to time-slot and timeSlot

This commit is contained in:
Scott Kiener 2023-05-25 10:53:46 -04:00
parent 53d11767c5
commit 7327de6e7b
3 changed files with 12 additions and 12 deletions

View file

@ -262,7 +262,7 @@ export default {
return timeSlots.find((timeSlot) => timeSlot.id === timeSlotId);
},
timeSlotModalClosed() {
// Clear the selectedDate if no timeslot has been selected
// Clear the selectedDate if no timeSlot has been selected
if (!this.selectedTimeSlotData.id) {
this.selectedDate = null;
}

View file

@ -28,7 +28,7 @@ import baseInputButton from "@/digital-components/base-input-button/base-input-b
import inputButtonWrapperMixin from "@/mixins/input-button-wrapper-mixin";
export default {
name: "timeslotModalListButton",
name: "timeSlotModalListButton",
mixins: [inputButtonWrapperMixin],
computed: {
formattedButtonLabelSubCopy() {

View file

@ -14,8 +14,8 @@
typeStyle="small"
class="duration-text-block" />
<buttonQuestion
buttonTypeString="timeslotModalListButton"
:buttonTypeObject="timeslotModalListButton"
buttonTypeString="timeSlotModalListButton"
:buttonTypeObject="timeSlotModalListButton"
:answers="availableTimeSlots"
groupName="ChooseTimeSlot"
textPosition="text-center"
@ -41,7 +41,7 @@
import modal from "@/digital-components/modal/modal";
import textBlock from "@/digital-components/text-block/text-block";
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
import { DAYS_OF_WEEK, MONTHS_OF_YEAR } from "@/digital-components/date-picker/mixins/constants.js";
@ -81,7 +81,7 @@ export default {
return {
selectedTimeSlotId: null,
isSelectedAppointmentPremium: null,
timeslotModalListButton: timeslotModalListButton,
timeSlotModalListButton: timeSlotModalListButton,
};
},
setup(props) {
@ -183,17 +183,17 @@ export default {
},
];
} else {
availableTimeSlots = this.dateAndTimeSlotData.timeSlots.map((timeslot) => {
availableTimeSlots = this.dateAndTimeSlotData.timeSlots.map((timeSlot) => {
let readableTime;
if (this.appointmentType === AppointmentTypeStrings.IN_SHOP) {
readableTime = this.getDisplayTextForMilitaryTime(timeslot.startTime);
readableTime = this.getDisplayTextForMilitaryTime(timeSlot.startTime);
} else if (this.appointmentType === AppointmentTypeStrings.MOBILE) {
readableTime = `${this.getDisplayTextForMilitaryTime(
timeslot.startTime
)} - ${this.getDisplayTextForMilitaryTime(timeslot.endTime)}`;
timeSlot.startTime
)} - ${this.getDisplayTextForMilitaryTime(timeSlot.endTime)}`;
}
return {
value: timeslot.id,
value: timeSlot.id,
buttonLabel: readableTime,
};
});
@ -207,7 +207,7 @@ export default {
const formattedPrice =
"+$" + this.getTotalLineItemPrice(this.premiumAppointmentFee).toFixed(2);
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),
buttonLabel: this.premiumAppointmentButtonText,
buttonLabelSubCopy: formattedPrice,