Begin implementation of timeblocks. Update workflow to build on devel branch
All checks were successful
Build BAB Application Deployment Artifact / build (push) Successful in 2m21s
All checks were successful
Build BAB Application Deployment Artifact / build (push) Successful in 2m21s
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
name: Build BAB Application Deployment Artifact
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- devel
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
@@ -117,6 +117,16 @@ import { date } from 'quasar';
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import type { StatusTypes } from 'src/stores/schedule';
|
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];
|
const durations = [1, 1.5, 2, 2.5, 3, 3.5, 4];
|
||||||
|
|
||||||
type ResourceIntervalScope = {
|
type ResourceIntervalScope = {
|
||||||
@@ -202,14 +212,16 @@ function onPrev() {
|
|||||||
function onNext() {
|
function onNext() {
|
||||||
calendar.value.next();
|
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.
|
// TODO: Add a duration picker, here.
|
||||||
emit('onClickTime', data);
|
emit('onClickTime', data);
|
||||||
}
|
}
|
||||||
function onUpdateDuration(value) {
|
function onUpdateDuration(value: EventData) {
|
||||||
emit('onUpdateDuration', value);
|
emit('onUpdateDuration', value);
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
|
|||||||
@@ -3,9 +3,14 @@ import { ref } from 'vue';
|
|||||||
import { Boat, useBoatStore } from './boat';
|
import { Boat, useBoatStore } from './boat';
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
import { DateOptions } from 'quasar';
|
import { DateOptions } from 'quasar';
|
||||||
|
import {
|
||||||
|
Timestamp,
|
||||||
|
parseTimestamp,
|
||||||
|
TimestampArray,
|
||||||
|
} from '@quasar/quasar-ui-qcalendar';
|
||||||
|
|
||||||
export type StatusTypes = 'tentative' | 'confirmed' | 'pending' | undefined;
|
export type StatusTypes = 'tentative' | 'confirmed' | 'pending' | undefined;
|
||||||
export interface Reservation {
|
export type Reservation = {
|
||||||
id: number;
|
id: number;
|
||||||
user: string;
|
user: string;
|
||||||
start: Date;
|
start: Date;
|
||||||
@@ -13,9 +18,21 @@ export interface Reservation {
|
|||||||
resource: Boat;
|
resource: Boat;
|
||||||
reservationDate: Date;
|
reservationDate: Date;
|
||||||
status?: StatusTypes;
|
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 = [
|
const sampleData = [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@@ -83,13 +100,18 @@ function getSampleData(): Reservation[] {
|
|||||||
end: date.adjustDate(now, makeOpts(splitTime(entry.end))),
|
end: date.adjustDate(now, makeOpts(splitTime(entry.end))),
|
||||||
resource: boat,
|
resource: boat,
|
||||||
reservationDate: now,
|
reservationDate: now,
|
||||||
status: entry.status,
|
status: entry.status as StatusTypes,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useScheduleStore = defineStore('schedule', () => {
|
export const useScheduleStore = defineStore('schedule', () => {
|
||||||
const reservations = ref<Reservation[]>(getSampleData());
|
// TODO: Implement functions to dynamically pull this data.
|
||||||
|
const reservations = ref<Reservation[]>(getSampleReservations());
|
||||||
|
const timeblocks = sampleBlocks;
|
||||||
|
|
||||||
|
const getTimeblocksForDate = (date: Date): Timeblock[] => timeblocks;
|
||||||
|
|
||||||
const getBoatReservations = (
|
const getBoatReservations = (
|
||||||
boat: number | string,
|
boat: number | string,
|
||||||
curDate: Date
|
curDate: Date
|
||||||
|
|||||||
Reference in New Issue
Block a user