refactor(UserSchedule): index by a unique id rather than name (#166)
* refactor(UserSchedule): index by a unique id rather than name * refactor: Update parameter names in schedule function jsdocs * refactor: change more instances of .name to .id * refactor: Fix typo in variable name and update references * refactor: Remove console.log statement * fix(chromatic): Update ScheduleListItem story * refactor: remove unused eslint rule
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import type { Course } from '@shared/types/Course';
|
||||
import { Status } from '@shared/types/Course';
|
||||
import { UserSchedule } from '@shared/types/UserSchedule';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import CourseCatalogInjectedPopup from '@views/components/injected/CourseCatalogInjectedPopup/CourseCatalogInjectedPopup';
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import { bevoCourse, bevoScheule, MikeScottCS314Course, MikeScottCS314Schedule } from './mocked';
|
||||
import { bevoCourse, mikeScottCS314Course } from './mocked';
|
||||
|
||||
const meta = {
|
||||
title: 'Components/Injected/CourseCatalogInjectedPopup',
|
||||
@@ -14,23 +13,7 @@ const meta = {
|
||||
open: true,
|
||||
onClose: () => {},
|
||||
},
|
||||
argTypes: {
|
||||
course: {
|
||||
control: {
|
||||
type: 'object',
|
||||
},
|
||||
},
|
||||
activeSchedule: {
|
||||
control: {
|
||||
type: 'object',
|
||||
},
|
||||
},
|
||||
onClose: {
|
||||
control: {
|
||||
type: 'function',
|
||||
},
|
||||
},
|
||||
},
|
||||
tags: ['autodocs'],
|
||||
render(args) {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
const [isOpen, setIsOpen] = useState(args.open);
|
||||
@@ -44,24 +27,21 @@ type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const OpenCourse: Story = {
|
||||
args: {
|
||||
course: MikeScottCS314Course,
|
||||
activeSchedule: MikeScottCS314Schedule,
|
||||
course: mikeScottCS314Course,
|
||||
},
|
||||
};
|
||||
|
||||
export const ClosedCourse: Story = {
|
||||
args: {
|
||||
course: {
|
||||
...MikeScottCS314Course,
|
||||
...mikeScottCS314Course,
|
||||
status: Status.CLOSED,
|
||||
} as Course,
|
||||
activeSchedule: new UserSchedule({ courses: [], name: '', hours: 0, updatedAt: Date.now() }),
|
||||
},
|
||||
};
|
||||
|
||||
export const CourseWithNoData: Story = {
|
||||
args: {
|
||||
course: bevoCourse,
|
||||
activeSchedule: bevoScheule,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user