chore: lint and format repo
This commit is contained in:
@@ -36,7 +36,7 @@ export class CourseMeeting {
|
|||||||
* */
|
* */
|
||||||
startTime: number;
|
startTime: number;
|
||||||
/** NOTE: Times starting and after 12 PM have an additional 720 minutes (12 hrs) added to them
|
/** NOTE: Times starting and after 12 PM have an additional 720 minutes (12 hrs) added to them
|
||||||
* The end time of the course, in minutes since midnight
|
* The end time of the course, in minutes since midnight
|
||||||
* */
|
* */
|
||||||
endTime: number;
|
endTime: number;
|
||||||
/** The location that the course is taught */
|
/** The location that the course is taught */
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
import { UserSchedule } from '@shared/types/UserSchedule';
|
/* eslint-disable storybook/story-exports */
|
||||||
import type { Meta, StoryObj } from '@storybook/react';
|
// import { UserSchedule } from '@shared/types/UserSchedule';
|
||||||
import CourseCatalogInjectedPopup from '@views/components/injected/CourseCatalogInjectedPopup/CourseCatalogInjectedPopup';
|
// import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
// import CourseCatalogInjectedPopup from '@views/components/injected/CourseCatalogInjectedPopup/CourseCatalogInjectedPopup';
|
||||||
|
|
||||||
import { exampleCourse } from './mocked';
|
// import { exampleCourse } from './mocked';
|
||||||
|
|
||||||
const exampleSchedule: UserSchedule = new UserSchedule({
|
// const exampleSchedule: UserSchedule = new UserSchedule({
|
||||||
courses: [exampleCourse],
|
// courses: [exampleCourse],
|
||||||
name: 'Example Schedule',
|
// name: 'Example Schedule',
|
||||||
hours: 0,
|
// hours: 0,
|
||||||
});
|
// });
|
||||||
// TODO (achadaga): import this after
|
// TODO (achadaga): import this after
|
||||||
// https://github.com/Longhorn-Developers/UT-Registration-Plus/pull/106 is merged
|
// https://github.com/Longhorn-Developers/UT-Registration-Plus/pull/106 is merged
|
||||||
// const bevoCourse: Course = new Course({
|
// const bevoCourse: Course = new Course({
|
||||||
@@ -107,3 +108,4 @@ const exampleSchedule: UserSchedule = new UserSchedule({
|
|||||||
// course: bevoCourse,
|
// course: bevoCourse,
|
||||||
// },
|
// },
|
||||||
// };
|
// };
|
||||||
|
export default {};
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ function AccountForCourseConflicts({ courseCells, setCourse }: AccountForCourseC
|
|||||||
|
|
||||||
// Part of TODO: block.course is definitely a course object
|
// Part of TODO: block.course is definitely a course object
|
||||||
// console.log(courseCells);
|
// console.log(courseCells);
|
||||||
|
|
||||||
return courseCells.map((block, i) => {
|
return courseCells.map((block, i) => {
|
||||||
const { courseDeptAndInstr, timeAndLocation, status, colors } = courseCells[i].componentProps;
|
const { courseDeptAndInstr, timeAndLocation, status, colors } = courseCells[i].componentProps;
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ function AccountForCourseConflicts({ courseCells, setCourse }: AccountForCourseC
|
|||||||
onClick={() => setCourse(block.course)}
|
onClick={() => setCourse(block.course)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const handleOpenOptions = async () => {
|
|||||||
await openTabFromContentScript(url);
|
await openTabFromContentScript(url);
|
||||||
};
|
};
|
||||||
|
|
||||||
const CalendarHeader = ( { totalHours, totalCourses, scheduleName } ) => (
|
const CalendarHeader = ({ totalHours, totalCourses, scheduleName }) => (
|
||||||
<div className='min-h-79px min-w-672px w-full flex px-0 py-15'>
|
<div className='min-h-79px min-w-672px w-full flex px-0 py-15'>
|
||||||
<div className='flex flex-row gap-20'>
|
<div className='flex flex-row gap-20'>
|
||||||
<div className='flex gap-10'>
|
<div className='flex gap-10'>
|
||||||
@@ -49,7 +49,7 @@ const CalendarHeader = ( { totalHours, totalCourses, scheduleName } ) => (
|
|||||||
<div className='flex flex-row'>
|
<div className='flex flex-row'>
|
||||||
<Button variant='single' icon={UndoIcon} color='ut-black' />
|
<Button variant='single' icon={UndoIcon} color='ut-black' />
|
||||||
<Button variant='single' icon={RedoIcon} color='ut-black' />
|
<Button variant='single' icon={RedoIcon} color='ut-black' />
|
||||||
<Button variant='single' icon={SettingsIcon} color='ut-black' onClick={handleOpenOptions}/>
|
<Button variant='single' icon={SettingsIcon} color='ut-black' onClick={handleOpenOptions} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -32,7 +32,11 @@ export default function CourseCatalogInjectedPopup({
|
|||||||
<Popup overlay className='max-w-[780px] px-6' onClose={onClose}>
|
<Popup overlay className='max-w-[780px] px-6' onClose={onClose}>
|
||||||
<div className='flex flex-col'>
|
<div className='flex flex-col'>
|
||||||
<HeadingAndActions course={course} onClose={onClose} activeSchedule={activeSchedule} />
|
<HeadingAndActions course={course} onClose={onClose} activeSchedule={activeSchedule} />
|
||||||
<Description course={course} /* lines={course.description} Looks like this was replaced. Description now set internally*/ />
|
<Description
|
||||||
|
course={
|
||||||
|
course
|
||||||
|
} /* lines={course.description} Looks like this was replaced. Description now set internally */
|
||||||
|
/>
|
||||||
<GradeDistribution course={course} />
|
<GradeDistribution course={course} />
|
||||||
</div>
|
</div>
|
||||||
</Popup>
|
</Popup>
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import type { CalendarCourseCellProps } from '@views/components/calendar/Calenda
|
|||||||
|
|
||||||
import useSchedules from './useSchedules';
|
import useSchedules from './useSchedules';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const dayToNumber: { [day: string]: number } = {
|
const dayToNumber: { [day: string]: number } = {
|
||||||
Monday: 0,
|
Monday: 0,
|
||||||
Tuesday: 1,
|
Tuesday: 1,
|
||||||
@@ -66,25 +64,26 @@ export function useFlattenedCourseSchedule(): FlattenedCourseSchedule {
|
|||||||
if (activeSchedule.courses.length === 0) {
|
if (activeSchedule.courses.length === 0) {
|
||||||
return {
|
return {
|
||||||
courseCells: [] as CalendarGridCourse[],
|
courseCells: [] as CalendarGridCourse[],
|
||||||
activeSchedule
|
activeSchedule,
|
||||||
} satisfies FlattenedCourseSchedule;
|
} satisfies FlattenedCourseSchedule;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const { courses, name, hours } = activeSchedule;
|
const { courses, name, hours } = activeSchedule;
|
||||||
|
|
||||||
const processedCourses = courses.flatMap((course: Course) => {
|
const processedCourses = courses
|
||||||
const { status, courseDeptAndInstr, meetings } = extractCourseInfo(course);
|
.flatMap((course: Course) => {
|
||||||
|
const { status, courseDeptAndInstr, meetings } = extractCourseInfo(course);
|
||||||
if (meetings.length === 0) {
|
|
||||||
return processAsyncCourses({ courseDeptAndInstr, status, course });
|
if (meetings.length === 0) {
|
||||||
}
|
return processAsyncCourses({ courseDeptAndInstr, status, course });
|
||||||
|
}
|
||||||
return meetings.flatMap((meeting: CourseMeeting) =>
|
|
||||||
processInPersonMeetings(meeting, { courseDeptAndInstr, status, course })
|
return meetings.flatMap((meeting: CourseMeeting) =>
|
||||||
);
|
processInPersonMeetings(meeting, { courseDeptAndInstr, status, course })
|
||||||
}).sort(sortCourses);
|
);
|
||||||
|
})
|
||||||
|
.sort(sortCourses);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
courseCells: processedCourses as CalendarGridCourse[],
|
courseCells: processedCourses as CalendarGridCourse[],
|
||||||
activeSchedule: { name, courses, hours } as UserSchedule,
|
activeSchedule: { name, courses, hours } as UserSchedule,
|
||||||
@@ -106,23 +105,33 @@ function extractCourseInfo(course: Course) {
|
|||||||
/**
|
/**
|
||||||
* Function to process each in-person class into its distinct meeting objects for calendar grid
|
* Function to process each in-person class into its distinct meeting objects for calendar grid
|
||||||
*/
|
*/
|
||||||
function processAsyncCourses({ courseDeptAndInstr, status, course }: { courseDeptAndInstr: string, status: StatusType, course: Course }) {
|
function processAsyncCourses({
|
||||||
return [{
|
courseDeptAndInstr,
|
||||||
calendarGridPoint: {
|
status,
|
||||||
dayIndex: 0,
|
course,
|
||||||
startIndex: 0,
|
}: {
|
||||||
endIndex: 0,
|
courseDeptAndInstr: string;
|
||||||
},
|
status: StatusType;
|
||||||
componentProps: {
|
course: Course;
|
||||||
courseDeptAndInstr,
|
}) {
|
||||||
status,
|
return [
|
||||||
colors: {
|
{
|
||||||
primaryColor: 'ut-gray',
|
calendarGridPoint: {
|
||||||
secondaryColor: 'ut-gray',
|
dayIndex: 0,
|
||||||
|
startIndex: 0,
|
||||||
|
endIndex: 0,
|
||||||
},
|
},
|
||||||
|
componentProps: {
|
||||||
|
courseDeptAndInstr,
|
||||||
|
status,
|
||||||
|
colors: {
|
||||||
|
primaryColor: 'ut-gray',
|
||||||
|
secondaryColor: 'ut-gray',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
course,
|
||||||
},
|
},
|
||||||
course,
|
] satisfies CalendarGridCourse[];
|
||||||
}] satisfies CalendarGridCourse[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user