From 754ddd11d49bc1777105a56b80f4b0006552aff6 Mon Sep 17 00:00:00 2001 From: ajdj100 Date: Tue, 16 Dec 2025 02:18:01 -0500 Subject: [PATCH 1/3] fixed calendar attendance grouping --- shared/types/calendar.ts | 2 +- ui/src/components/calendar/ViewCalendarEvent.vue | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/shared/types/calendar.ts b/shared/types/calendar.ts index 5a62a8b..6f31a03 100644 --- a/shared/types/calendar.ts +++ b/shared/types/calendar.ts @@ -26,7 +26,7 @@ export interface CalendarSignup { eventID: number; status: CalendarAttendance; member_name?: string; - member_unit?: string; + unit_name?: string; } export interface CalendarEventShort { diff --git a/ui/src/components/calendar/ViewCalendarEvent.vue b/ui/src/components/calendar/ViewCalendarEvent.vue index 838e8ce..1aab52c 100644 --- a/ui/src/components/calendar/ViewCalendarEvent.vue +++ b/ui/src/components/calendar/ViewCalendarEvent.vue @@ -104,11 +104,11 @@ const attendanceTab = ref<"Alpha" | "Echo" | "Other">("Alpha"); const attendanceList = computed(() => { let out: CalendarSignup[] = []; if (attendanceTab.value === 'Alpha') { - out = activeEvent.value.eventSignups?.filter((s) => s.member_unit === 'Alpha Company'); + out = activeEvent.value.eventSignups?.filter((s) => s.unit_name === 'Alpha Company'); } else if (attendanceTab.value === 'Echo') { - out = activeEvent.value.eventSignups?.filter((s) => s.member_unit === 'Echo Company') + out = activeEvent.value.eventSignups?.filter((s) => s.unit_name === 'Echo Company') } else { - out = activeEvent.value.eventSignups?.filter((s) => s.member_unit != 'Alpha Company' && s.member_unit != 'Echo Company') + out = activeEvent.value.eventSignups?.filter((s) => s.unit_name != 'Alpha Company' && s.unit_name != 'Echo Company') } const statusOrder: Record = { @@ -126,11 +126,11 @@ const attendanceCountsByGroup = computed(() => { const signups = activeEvent.value.eventSignups ?? []; return { - Alpha: signups.filter(s => s.member_unit === "Alpha Company").length, - Echo: signups.filter(s => s.member_unit === "Echo Company").length, + Alpha: signups.filter(s => s.unit_name === "Alpha Company").length, + Echo: signups.filter(s => s.unit_name === "Echo Company").length, Other: signups.filter(s => - s.member_unit !== "Alpha Company" && - s.member_unit !== "Echo Company" + s.unit_name !== "Alpha Company" && + s.unit_name !== "Echo Company" ).length, }; }); From 89ee1899e05d0c00de14a2f152848f851141e525 Mon Sep 17 00:00:00 2001 From: ajdj100 Date: Tue, 16 Dec 2025 02:30:54 -0500 Subject: [PATCH 2/3] fixed user store references --- ui/src/components/calendar/ViewCalendarEvent.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/src/components/calendar/ViewCalendarEvent.vue b/ui/src/components/calendar/ViewCalendarEvent.vue index 1aab52c..ee47cba 100644 --- a/ui/src/components/calendar/ViewCalendarEvent.vue +++ b/ui/src/components/calendar/ViewCalendarEvent.vue @@ -64,11 +64,11 @@ const maybe = computed(() => { return activeEvent.value.eventS const declined = computed(() => { return activeEvent.value.eventSignups.filter((s) => s.status == CalendarAttendance.NotAttending) }) const viewedState = ref(CalendarAttendance.Attending); -let user = useUserStore(); +let userStore = useUserStore(); const myAttendance = computed(() => { - if (!user.isLoggedIn) return null; + if (!userStore.isLoggedIn) return null; return activeEvent.value.eventSignups.find( - (s) => s.member_id === user.user.id + (s) => s.member_id === userStore.user.member.member_id ) || null; }); @@ -79,8 +79,8 @@ async function setAttendance(state: CalendarAttendance) { } const canEditEvent = computed(() => { - if (!user.isLoggedIn) return false; - if (user.user.id == activeEvent.value.creator_id) + if (!userStore.isLoggedIn) return false; + if (userStore.user.member.member_id == activeEvent.value.creator_id) return true; }); @@ -215,7 +215,7 @@ defineExpose({ forceReload }) This event has been cancelled -
+