Squashed commit of the following:
commitf6896e37e2Author: knownotunknown <78577376+knownotunknown@users.noreply.github.com> Date: Mon Feb 19 20:46:57 2024 -0600 Calendar Page mostly styled commita28422e6b0Merge:297601e41e6d77Author: knownotunknown <78577376+knownotunknown@users.noreply.github.com> Date: Mon Feb 19 18:46:59 2024 -0600 Merge branch 'hackathon' into Som commit297601e715Author: knownotunknown <78577376+knownotunknown@users.noreply.github.com> Date: Sun Feb 18 16:28:29 2024 -0600 Grid works cleanly with up to two course conflicts. Prob needs refactoring commit313a9648c9Merge:b0a95a60acd0b7Author: knownotunknown <78577376+knownotunknown@users.noreply.github.com> Date: Sun Feb 18 15:45:57 2024 -0600 Merge branch 'hackathon' into Som commitb0a95a6153Author: knownotunknown <78577376+knownotunknown@users.noreply.github.com> Date: Sun Feb 18 14:10:13 2024 -0600 Made CourseCells and CalendarGridCells more responsive. CourseCells now rendering onto grid. Still, need to make course cells more responsive, and add edge cases commita1a0f00514Merge:7479004ac71b83Author: knownotunknown <78577376+knownotunknown@users.noreply.github.com> Date: Sat Feb 17 17:07:06 2024 -0600 Merge branch 'hackathon' into Som commit7479004a65Author: knownotunknown <78577376+knownotunknown@users.noreply.github.com> Date: Sat Feb 17 16:59:34 2024 -0600 Need to add sorting
This commit is contained in:
144
src/stories/components/calendar/CalendarSchedules.stories.tsx
Normal file
144
src/stories/components/calendar/CalendarSchedules.stories.tsx
Normal file
@@ -0,0 +1,144 @@
|
||||
import { Course, Status } from '@shared/types/Course';
|
||||
import { UserSchedule } from '@shared/types/UserSchedule';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import React from 'react';
|
||||
import { CourseMeeting, DAY_MAP } from 'src/shared/types/CourseMeeting';
|
||||
import { CourseSchedule } from 'src/shared/types/CourseSchedule';
|
||||
import Instructor from 'src/shared/types/Instructor';
|
||||
import { CalendarSchedules } from 'src/views/components/calendar/CalendarSchedules/CalendarSchedules';
|
||||
|
||||
const meta = {
|
||||
title: 'Components/Calendar/CalendarSchedules',
|
||||
component: CalendarSchedules,
|
||||
parameters: {
|
||||
layout: 'centered',
|
||||
tags: ['autodocs'],
|
||||
},
|
||||
argTypes: {
|
||||
dummySchedules: { control: 'object' },
|
||||
dummyActiveIndex: { control: 'number' },
|
||||
},
|
||||
render: (args: any) => (
|
||||
<div>
|
||||
<CalendarSchedules {...args} />
|
||||
</div>
|
||||
),
|
||||
} satisfies Meta<typeof CalendarSchedules>;
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof meta>;
|
||||
|
||||
const schedules = [
|
||||
new UserSchedule({
|
||||
courses: [
|
||||
new Course({
|
||||
uniqueId: 123,
|
||||
number: '311C',
|
||||
fullName: "311C - Bevo's Default Course",
|
||||
courseName: "Bevo's Default Course",
|
||||
department: 'BVO',
|
||||
creditHours: 3,
|
||||
status: Status.WAITLISTED,
|
||||
instructors: [new Instructor({ firstName: '', lastName: 'Bevo', fullName: 'Bevo' })],
|
||||
isReserved: false,
|
||||
url: '',
|
||||
flags: [],
|
||||
schedule: new CourseSchedule({
|
||||
meetings: [
|
||||
new CourseMeeting({
|
||||
days: [DAY_MAP.M, DAY_MAP.W, DAY_MAP.F],
|
||||
startTime: 480,
|
||||
endTime: 570,
|
||||
location: {
|
||||
building: 'UTC',
|
||||
room: '123',
|
||||
},
|
||||
}),
|
||||
],
|
||||
}),
|
||||
instructionMode: 'In Person',
|
||||
semester: {
|
||||
year: 2024,
|
||||
season: 'Fall',
|
||||
},
|
||||
}),
|
||||
],
|
||||
name: 'Main Schedule',
|
||||
hours: 0, // Add the missing 'hours' property
|
||||
}),
|
||||
new UserSchedule({
|
||||
courses: [
|
||||
new Course({
|
||||
uniqueId: 123,
|
||||
number: '311C',
|
||||
fullName: "311C - Bevo's Default Course",
|
||||
courseName: "Bevo's Default Course",
|
||||
department: 'BVO',
|
||||
creditHours: 3,
|
||||
status: Status.WAITLISTED,
|
||||
instructors: [new Instructor({ firstName: '', lastName: 'Bevo', fullName: 'Bevo' })],
|
||||
isReserved: false,
|
||||
url: '',
|
||||
flags: [],
|
||||
schedule: new CourseSchedule({
|
||||
meetings: [
|
||||
new CourseMeeting({
|
||||
days: [DAY_MAP.M, DAY_MAP.W, DAY_MAP.F],
|
||||
startTime: 480,
|
||||
endTime: 570,
|
||||
location: {
|
||||
building: 'UTC',
|
||||
room: '123',
|
||||
},
|
||||
}),
|
||||
],
|
||||
}),
|
||||
instructionMode: 'In Person',
|
||||
semester: {
|
||||
year: 2024,
|
||||
season: 'Spring',
|
||||
},
|
||||
}),
|
||||
new Course({
|
||||
uniqueId: 123,
|
||||
number: '311C',
|
||||
fullName: "311C - Bevo's Default Course",
|
||||
courseName: "Bevo's Default Course",
|
||||
department: 'BVO',
|
||||
creditHours: 3,
|
||||
status: Status.WAITLISTED,
|
||||
instructors: [new Instructor({ firstName: '', lastName: 'Bevo', fullName: 'Bevo' })],
|
||||
isReserved: false,
|
||||
url: '',
|
||||
flags: [],
|
||||
schedule: new CourseSchedule({
|
||||
meetings: [
|
||||
new CourseMeeting({
|
||||
days: [DAY_MAP.M, DAY_MAP.W, DAY_MAP.F],
|
||||
startTime: 480,
|
||||
endTime: 570,
|
||||
location: {
|
||||
building: 'UTC',
|
||||
room: '123',
|
||||
},
|
||||
}),
|
||||
],
|
||||
}),
|
||||
instructionMode: 'In Person',
|
||||
semester: {
|
||||
year: 2024,
|
||||
season: 'Fall',
|
||||
},
|
||||
}),
|
||||
],
|
||||
name: 'Backup #3',
|
||||
hours: 0, // Add the missing 'hours' property
|
||||
}),
|
||||
];
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
dummySchedules: schedules,
|
||||
dummyActiveIndex: 0,
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user