From 67f5a270af7950f2b736a4a816f82260c1398661 Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Thu, 16 May 2024 22:58:19 +0200 Subject: [PATCH] Huge refactor for backend and client This is barely functionnal, but at least it can display some data without crashing Most other functionnalities other than displaying events are broken, and so are the relative date operations, they need to be fixed asap --- components/calendar/Calendar.vue | 2 - components/calendar/CalendarEvent.vue | 6 +- components/calendar/CalendarEventDetails.vue | 4 +- components/calendar/CalendarMenuSubnav.vue | 4 +- components/calendar/Dashboard.vue | 12 +- components/calendar/search/CalendarSearch.vue | 6 +- .../search/lists/CharacterCallout.vue | 4 +- .../calendar/search/lists/EventCallout.vue | 4 +- .../calendar/search/lists/SearchList.vue | 12 +- components/calendar/state/monthly/DayTile.vue | 6 +- components/calendar/state/monthly/Layout.vue | 43 +------ components/calendar/state/yearly/DayTile.vue | 4 +- components/calendar/state/yearly/Layout.vue | 13 +- .../calendar/state/yearly/MonthTile.vue | 20 ++- models/CalendarConfig.ts | 12 +- models/CalendarEvent.ts | 18 +++ models/CalendarMonth.ts | 6 + models/Category.ts | 4 + models/Characters.ts | 6 +- models/Date.ts | 28 ++--- models/Events.ts | 39 ------ pages/index.vue | 16 --- server/api/calendars/query.get.ts | 17 ++- server/api/events/query.get.ts | 2 +- stores/CalendarStore.ts | 119 +++++------------- stores/EventStore.ts | 12 +- supabase/migrations/202401_init.sql | 65 +++++++--- supabase/seed.sql | 66 ++++++---- 28 files changed, 247 insertions(+), 303 deletions(-) create mode 100644 models/CalendarEvent.ts create mode 100644 models/CalendarMonth.ts create mode 100644 models/Category.ts delete mode 100644 models/Events.ts diff --git a/components/calendar/Calendar.vue b/components/calendar/Calendar.vue index e9b65df..6c39ec0 100644 --- a/components/calendar/Calendar.vue +++ b/components/calendar/Calendar.vue @@ -2,8 +2,6 @@ import { useCalendar } from '@/stores/CalendarStore' import { computed, type Component, type ComputedRef } from 'vue' -import CalendarMenu from './CalendarMenu.vue' - import MonthlyLayout from './state/monthly/Layout.vue' import CenturyLayout from './state/centennially/Layout.vue' import DecadeLayout from './state/decennially/Layout.vue' diff --git a/components/calendar/CalendarEvent.vue b/components/calendar/CalendarEvent.vue index cfb6b74..e80d2ce 100644 --- a/components/calendar/CalendarEvent.vue +++ b/components/calendar/CalendarEvent.vue @@ -1,14 +1,14 @@ diff --git a/components/calendar/search/CalendarSearch.vue b/components/calendar/search/CalendarSearch.vue index f01ba74..c1a266c 100644 --- a/components/calendar/search/CalendarSearch.vue +++ b/components/calendar/search/CalendarSearch.vue @@ -5,13 +5,13 @@ import { type Character, type CharacterCategory } from '@/models/Characters' -import type { LeimDateOrder } from '@/models/Date' +import type { RPGDateOrder } from '@/models/Date' import { calendarEventCategories, isCalendarEvent, type CalendarEvent, type CalendarEventCategory -} from '@/models/Events' +} from '~/models/CalendarEvent' import { useCharacters } from '@/stores/CharacterStore' import { useCalendarEvents } from '@/stores/EventStore' import { capitalize } from '@/utils/Strings' @@ -41,7 +41,7 @@ const searchQuery = ref('') const selectedEntity = useStorage('se', 'events' as SearchMode) // Order -const selectedOrder = ref('asc') +const selectedOrder = ref('asc') function setOrderAsc() { selectedOrder.value = 'asc' resetPage() diff --git a/components/calendar/search/lists/CharacterCallout.vue b/components/calendar/search/lists/CharacterCallout.vue index 932fde1..44df23c 100644 --- a/components/calendar/search/lists/CharacterCallout.vue +++ b/components/calendar/search/lists/CharacterCallout.vue @@ -1,6 +1,6 @@