Skip to content

Commit

Permalink
Schedule page and several definitions TypeScript (#613)
Browse files Browse the repository at this point in the history
* ➕ Add types for several definitions

* ➕ Add types for schedule components

* 🔨 Fix section order

* 🔨 Fix appointment store test

* 💚 Improve code readability
  • Loading branch information
devmount authored Aug 26, 2024
1 parent 96a5347 commit 3852ab1
Show file tree
Hide file tree
Showing 13 changed files with 654 additions and 634 deletions.
21 changes: 19 additions & 2 deletions frontend/src/components/CalendarQalendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 3852ab1

Please sign in to comment.