diff --git a/frontend/src/components/CalendarQalendar.vue b/frontend/src/components/CalendarQalendar.vue index 260f2be49..15c22a129 100644 --- a/frontend/src/components/CalendarQalendar.vue +++ b/frontend/src/components/CalendarQalendar.vue @@ -6,11 +6,9 @@ import { Qalendar } from 'qalendar'; import 'qalendar/dist/style.css'; import CalendarEvent from '@/elements/calendar/CalendarEvent.vue'; import { - bookingStatus, ColorSchemes, dateFormatStrings, defaultSlotDuration, - qalendarSlotDurations, } from '@/definitions'; import { getLocale, getPreferredTheme, timeFormat } from '@/utils'; import { useRoute, useRouter } from 'vue-router'; @@ -38,6 +36,25 @@ const { events, appointments, schedules, isBookingRoute, currentDate, fixedDuration, } = toRefs(props); +const bookingStatus = { + none: 1, + requested: 2, + booked: 3, +}; + +/** + * Only available duration values supported for Qalendar + * This defines basically the number of intervals there will be. + * See: https://tomosterlund.github.io/qalendar/guide.html#intervals + * @enum + * @readonly + */ +const qalendarSlotDurations = { + 15: 15, + 30: 30, + 60: 60, +}; + const qalendarRef = ref(); const isValidMode = (mode) => ['#day', '#week', '#month'].indexOf(mode) !== -1; diff --git a/frontend/src/components/ScheduleCreation.vue b/frontend/src/components/ScheduleCreation.vue index d31d93a53..63ff0d5e5 100644 --- a/frontend/src/components/ScheduleCreation.vue +++ b/frontend/src/components/ScheduleCreation.vue @@ -1,406 +1,30 @@ - - - + + -// track changes and send schedule updates -watch( - () => [ - scheduleInput.value.name, - scheduleInput.value.calendar_id, - scheduleInput.value.start_date, - scheduleInput.value.end_date, - scheduleInput.value.start_time, - scheduleInput.value.end_time, - scheduleInput.value.weekdays, - scheduleInput.value.booking_confirmation, - props.activeDate, - ], - () => { - // if an existing schedule was given update anyway - // if a new schedule gets created, only update on step 2 - if ((props.schedule && props.schedule.active) || (!props.schedule && visitedStep1.value)) { - emit('updated', getScheduleAppointment()); - } - }, -); -