From 5a7280d8b1b5b726677892321671a7e80f44ba65 Mon Sep 17 00:00:00 2001 From: Derek Chen Date: Thu, 14 Mar 2024 02:54:09 -0500 Subject: [PATCH] schema errors fixed --- src/pages/background/lib/createSchedule.ts | 1 + src/shared/storage/UserScheduleStore.ts | 1 + src/stories/components/calendar/CalendarSchedules.stories.tsx | 2 ++ src/stories/injected/CourseCatalogInjectedPopup.stories.tsx | 2 +- src/stories/injected/mocked.ts | 3 +++ src/views/hooks/useFlattenedCourseSchedule.ts | 1 + src/views/hooks/useSchedules.ts | 2 +- 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/background/lib/createSchedule.ts b/src/pages/background/lib/createSchedule.ts index a602d081..1c89459b 100644 --- a/src/pages/background/lib/createSchedule.ts +++ b/src/pages/background/lib/createSchedule.ts @@ -16,6 +16,7 @@ export default async function createSchedule(scheduleName: string): Promise({ name: 'Schedule 1', hours: 0, updatedAt: Date.now(), + id: '', }), ], activeIndex: 0, diff --git a/src/stories/components/calendar/CalendarSchedules.stories.tsx b/src/stories/components/calendar/CalendarSchedules.stories.tsx index ba0a8962..9765041a 100644 --- a/src/stories/components/calendar/CalendarSchedules.stories.tsx +++ b/src/stories/components/calendar/CalendarSchedules.stories.tsx @@ -67,6 +67,7 @@ const schedules = [ name: 'Main Schedule', hours: 0, updatedAt: Date.now(), + id: '', }), new UserSchedule({ courses: [ @@ -138,6 +139,7 @@ const schedules = [ name: 'Backup #3', hours: 0, updatedAt: Date.now(), + id: '', }), ]; diff --git a/src/stories/injected/CourseCatalogInjectedPopup.stories.tsx b/src/stories/injected/CourseCatalogInjectedPopup.stories.tsx index 73c8f1fa..b56e7fe6 100644 --- a/src/stories/injected/CourseCatalogInjectedPopup.stories.tsx +++ b/src/stories/injected/CourseCatalogInjectedPopup.stories.tsx @@ -55,7 +55,7 @@ export const ClosedCourse: Story = { ...MikeScottCS314Course, status: Status.CLOSED, } as Course, - activeSchedule: new UserSchedule({ courses: [], name: '', hours: 0, updatedAt: Date.now() }), + activeSchedule: new UserSchedule({ courses: [], name: '', hours: 0, updatedAt: Date.now(), id: '' }), }, }; diff --git a/src/stories/injected/mocked.ts b/src/stories/injected/mocked.ts index 0be0195d..22177ecf 100644 --- a/src/stories/injected/mocked.ts +++ b/src/stories/injected/mocked.ts @@ -58,6 +58,7 @@ export const exampleSchedule: UserSchedule = new UserSchedule({ name: 'Example Schedule', hours: 3, updatedAt: Date.now(), + id: '', }); export const bevoCourse: Course = new Course({ @@ -110,6 +111,7 @@ export const bevoScheule: UserSchedule = new UserSchedule({ name: 'Bevo Schedule', hours: 3, updatedAt: Date.now(), + id: '', }); export const MikeScottCS314Course: Course = new Course({ @@ -163,4 +165,5 @@ export const MikeScottCS314Schedule: UserSchedule = new UserSchedule({ name: 'Mike Scott CS314 Schedule', hours: 3, updatedAt: Date.now(), + id: '', }); diff --git a/src/views/hooks/useFlattenedCourseSchedule.ts b/src/views/hooks/useFlattenedCourseSchedule.ts index 9e195e28..b0adf777 100644 --- a/src/views/hooks/useFlattenedCourseSchedule.ts +++ b/src/views/hooks/useFlattenedCourseSchedule.ts @@ -62,6 +62,7 @@ export function useFlattenedCourseSchedule(): FlattenedCourseSchedule { name: 'Something may have went wrong', hours: 0, updatedAt: Date.now(), + id: '', }), } satisfies FlattenedCourseSchedule; } diff --git a/src/views/hooks/useSchedules.ts b/src/views/hooks/useSchedules.ts index 4a27516a..3cb2c3f4 100644 --- a/src/views/hooks/useSchedules.ts +++ b/src/views/hooks/useSchedules.ts @@ -65,7 +65,7 @@ export default function useSchedules(): [active: UserSchedule, schedules: UserSc export function getActiveSchedule(): UserSchedule { return ( schedulesCache[activeIndexCache] || - new UserSchedule({ courses: [], name: 'An error has occurred', hours: 0, updatedAt: Date.now() }) + new UserSchedule({ courses: [], name: 'An error has occurred', hours: 0, updatedAt: Date.now(), id: '' }) ); }