feat: Calendar Schedule component finished, fix: list didn't allow updates when adding a new schedule (#115)

* Temporarily uninstalling husky cause github desktop has issues with it

* Cleaned up some code. Removed unnecessary state value on injected popup

* Should've fixed popup alignment issue. Still need to integrate course schedule with calendar. Still debugging.

* Updated CalendarGridStories

* Fix: change to ExampleCourse from exampleCourse

* setCourse and calendar header need work

* Update as part of merge

* Fix: fixed build errors

* Fix: Added Todo

* Chore: Cleaned up useFlattenedCourseSchedule hook

* fix: List now keeps track of state when existing items are switched, while adding new items to the end

* Added back husky

* Update src/views/components/calendar/Calendar/Calendar.tsx

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>

* refactor: added type-safety, destructuring, etc. ready for re-review

* refactor: got rid of ts-ignore in openNewTabFromContentScript

* Update src/views/components/calendar/CalendarHeader/CalenderHeader.tsx

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>

* refactor: using path aliasing

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>

* refactor: using path aliasing

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>

* refactor: using satisfies instead of as

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>

* refactor: using satisfies instead of as

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>

* style: reformatted spacing

* style: eslint import order

* refactor: added new constructor for UserSchedule to avoid passing down null values to child props

---------

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>
This commit is contained in:
Som Gupta
2024-02-29 20:15:45 -06:00
committed by doprz
parent 3a48859ddd
commit a99a55788a
15 changed files with 899 additions and 301 deletions

View File

@@ -4,6 +4,8 @@ import type { Meta, StoryObj } from '@storybook/react';
import CalendarGrid from '@views/components/calendar/CalendarGrid/CalendarGrid';
import type { CalendarGridCourse } from '@views/hooks/useFlattenedCourseSchedule';
import { ExampleCourse } from '../PopupCourseBlock.stories';
const meta = {
title: 'Components/Calendar/CalendarGrid',
component: CalendarGrid,
@@ -32,6 +34,7 @@ const testData: CalendarGridCourse[] = [
status: Status.OPEN,
colors: getCourseColors('emerald', 500),
},
course: ExampleCourse,
},
{
calendarGridPoint: {
@@ -45,6 +48,7 @@ const testData: CalendarGridCourse[] = [
status: Status.OPEN,
colors: getCourseColors('emerald', 500),
},
course: ExampleCourse,
},
{
calendarGridPoint: {
@@ -58,6 +62,7 @@ const testData: CalendarGridCourse[] = [
status: Status.CLOSED,
colors: getCourseColors('emerald', 500),
},
course: ExampleCourse,
},
{
calendarGridPoint: {
@@ -71,6 +76,7 @@ const testData: CalendarGridCourse[] = [
status: Status.OPEN,
colors: getCourseColors('emerald', 500),
},
course: ExampleCourse,
},
{
calendarGridPoint: {
@@ -84,6 +90,7 @@ const testData: CalendarGridCourse[] = [
status: Status.CLOSED,
colors: getCourseColors('emerald', 500),
},
course: ExampleCourse,
},
{
calendarGridPoint: {
@@ -97,6 +104,7 @@ const testData: CalendarGridCourse[] = [
status: Status.CLOSED,
colors: getCourseColors('emerald', 500),
},
course: ExampleCourse,
},
{
calendarGridPoint: {
@@ -110,6 +118,7 @@ const testData: CalendarGridCourse[] = [
status: Status.CLOSED,
colors: getCourseColors('emerald', 500),
},
course: ExampleCourse,
},
];