diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index fb4ea58..5d5541f 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,9 +1,10 @@ name: Build BAB Application Deployment Artifact -run-name: ${{ gitea.actor }} is building an artifact 🚀 +run-name: ${{ gitea.actor }} is building a BAB App artifact 🚀 on: push: branches: - main + - devel jobs: build: diff --git a/src/components/ResourceScheduleViewerComponent.vue b/src/components/ResourceScheduleViewerComponent.vue index 37048b2..180774c 100644 --- a/src/components/ResourceScheduleViewerComponent.vue +++ b/src/components/ResourceScheduleViewerComponent.vue @@ -117,6 +117,16 @@ import { date } from 'quasar'; import { computed } from 'vue'; import type { StatusTypes } from 'src/stores/schedule'; +type EventData = { + event: object; + scope: { + timestamp: object; + columnindex: number; + activeDate: boolean; + droppable: boolean; + }; +}; + const durations = [1, 1.5, 2, 2.5, 3, 3.5, 4]; type ResourceIntervalScope = { @@ -202,14 +212,16 @@ function onPrev() { function onNext() { calendar.value.next(); } -function onClickDate(data) { - return; + +function onClickDate(data: EventData) { + return data; } -function onClickTime(data) { + +function onClickTime(data: EventData) { // TODO: Add a duration picker, here. emit('onClickTime', data); } -function onUpdateDuration(value) { +function onUpdateDuration(value: EventData) { emit('onUpdateDuration', value); } // eslint-disable-next-line @typescript-eslint/no-empty-function diff --git a/src/stores/schedule.ts b/src/stores/schedule.ts index b60de11..72b658a 100644 --- a/src/stores/schedule.ts +++ b/src/stores/schedule.ts @@ -3,9 +3,14 @@ import { ref } from 'vue'; import { Boat, useBoatStore } from './boat'; import { date } from 'quasar'; import { DateOptions } from 'quasar'; +import { + Timestamp, + parseTimestamp, + TimestampArray, +} from '@quasar/quasar-ui-qcalendar'; export type StatusTypes = 'tentative' | 'confirmed' | 'pending' | undefined; -export interface Reservation { +export type Reservation = { id: number; user: string; start: Date; @@ -13,9 +18,21 @@ export interface Reservation { resource: Boat; reservationDate: Date; status?: StatusTypes; -} +}; -function getSampleData(): Reservation[] { +export type Timeblock = { + start: Timestamp; + end: Timestamp; +}; + +const sampleBlocks = [ + { start: { hour: 9, minute: 0 }, end: { hour: 12, minute: 0 } }, + { start: { hour: 12, minute: 0 }, end: { hour: 15, minute: 0 } }, + { start: { hour: 15, minute: 0 }, end: { hour: 18, minute: 0 } }, + { start: { hour: 18, minute: 0 }, end: { hour: 21, minute: 0 } }, +] as Timeblock[]; + +function getSampleReservations(): Reservation[] { const sampleData = [ { id: 1, @@ -83,13 +100,18 @@ function getSampleData(): Reservation[] { end: date.adjustDate(now, makeOpts(splitTime(entry.end))), resource: boat, reservationDate: now, - status: entry.status, + status: entry.status as StatusTypes, }; }); } export const useScheduleStore = defineStore('schedule', () => { - const reservations = ref(getSampleData()); + // TODO: Implement functions to dynamically pull this data. + const reservations = ref(getSampleReservations()); + const timeblocks = sampleBlocks; + + const getTimeblocksForDate = (date: Date): Timeblock[] => timeblocks; + const getBoatReservations = ( boat: number | string, curDate: Date