Pass schedule as a prop to Timetable
This commit is contained in:
parent
f550ca921b
commit
d0ee6a40eb
2 changed files with 6 additions and 3 deletions
|
@ -93,7 +93,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { DateTime } from "luxon";
|
import { DateTime } from "luxon";
|
||||||
import type { Role, ScheduleEvent, ScheduleLocation, Shift, ShiftSlot, TimeSlot } from "~/shared/types/schedule";
|
import type { Role, Schedule, ScheduleEvent, ScheduleLocation, Shift, ShiftSlot, TimeSlot } from "~/shared/types/schedule";
|
||||||
import { pairs, setEquals } from "~/shared/utils/functions";
|
import { pairs, setEquals } from "~/shared/utils/functions";
|
||||||
|
|
||||||
const oneHourMs = 60 * 60 * 1000;
|
const oneHourMs = 60 * 60 * 1000;
|
||||||
|
@ -476,7 +476,10 @@ function tableElementsFromStretches(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const schedule = await useSchedule();
|
const props = defineProps<{
|
||||||
|
schedule: Schedule,
|
||||||
|
}>();
|
||||||
|
const schedule = computed(() => props.schedule);
|
||||||
const junctions = computed(() => junctionsFromEdges([
|
const junctions = computed(() => junctionsFromEdges([
|
||||||
...edgesFromEvents(schedule.value.events),
|
...edgesFromEvents(schedule.value.events),
|
||||||
...edgesFromShifts(schedule.value.rota ?? []),
|
...edgesFromShifts(schedule.value.rota ?? []),
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
Check out your <NuxtLink to="/account/settings">Account Setting</NuxtLink> to set up notifications for changes to schedule.
|
Check out your <NuxtLink to="/account/settings">Account Setting</NuxtLink> to set up notifications for changes to schedule.
|
||||||
</p>
|
</p>
|
||||||
<h2>Schedule</h2>
|
<h2>Schedule</h2>
|
||||||
<Timetable />
|
<Timetable :schedule />
|
||||||
<EventsEdit />
|
<EventsEdit />
|
||||||
<h2>Events</h2>
|
<h2>Events</h2>
|
||||||
<EventCard v-for="event in schedule.events" :event/>
|
<EventCard v-for="event in schedule.events" :event/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue