From 9c45a69d527ac8610673312ca1cde1aa8dc9a3b9 Mon Sep 17 00:00:00 2001 From: v6ctor Date: Sat, 16 Nov 2024 03:39:25 -0500 Subject: [PATCH 01/14] add linked sections to course model --- prisma/migrations/20241116082646_/migration.sql | 2 ++ prisma/schema.prisma | 1 + swatscraper | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 prisma/migrations/20241116082646_/migration.sql diff --git a/prisma/migrations/20241116082646_/migration.sql b/prisma/migrations/20241116082646_/migration.sql new file mode 100644 index 0000000..76d7c18 --- /dev/null +++ b/prisma/migrations/20241116082646_/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Course" ADD COLUMN "linkedSections" TEXT; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 5bd6175..4107bff 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -43,6 +43,7 @@ model Course { facultyId Int facultyMeetId Int year String + linkedSections String? avgRating Float? instructor Faculty @relation(fields: [facultyId], references: [id]) facultyMeet MeetingsFaculty @relation(fields: [facultyMeetId], references: [id]) diff --git a/swatscraper b/swatscraper index a08d124..5bc17f5 160000 --- a/swatscraper +++ b/swatscraper @@ -1 +1 @@ -Subproject commit a08d124dbde1384db998f38939d94744e9ce9173 +Subproject commit 5bc17f5c8e9f1cd556014d1d9726feaf9a1625b9 From 07cec38552895cdf8aed16190a27784c12c48024 Mon Sep 17 00:00:00 2001 From: v6ctor Date: Sat, 16 Nov 2024 04:11:22 -0500 Subject: [PATCH 02/14] add linked sections to course db model --- swatscraper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swatscraper b/swatscraper index 5bc17f5..56682bf 160000 --- a/swatscraper +++ b/swatscraper @@ -1 +1 @@ -Subproject commit 5bc17f5c8e9f1cd556014d1d9726feaf9a1625b9 +Subproject commit 56682bf41fe36416286e562aba479dc1d6abed20 From dc700a387f55115d254f8588677b7caa291235cc Mon Sep 17 00:00:00 2001 From: Thomas Makin Date: Mon, 18 Nov 2024 11:38:25 -0500 Subject: [PATCH 03/14] calendar: make start/end dynamic also fix ts --- app/calendar/page.tsx | 185 ++++++++++++++++++++-------------------- components/Calendar.tsx | 51 ++++++----- 2 files changed, 115 insertions(+), 121 deletions(-) diff --git a/app/calendar/page.tsx b/app/calendar/page.tsx index 03fc762..5acf8c8 100644 --- a/app/calendar/page.tsx +++ b/app/calendar/page.tsx @@ -5,123 +5,120 @@ import Calendar from "../../components/Calendar"; import prisma from "../../lib/prisma"; import { getPlanCookie } from "../actions/actions"; import { generateColorFromName } from "../../components/primitives"; -export default async function CalendarPage() { - async function getEvents() { - const output: any = []; - const planCookie: any = await getPlanCookie(); - let courses; +interface Event { + classNames: string; + textColor: string; + title: string; + daColor: string; + subject: string; + courseNumber: string; + instructor: string; + room: string; + color: string; + borderWidth: string; + daysOfWeek: (false | "0" | "1" | "2" | "3" | "4" | "5" | "6" | undefined)[]; + startTime: string; + endTime: string; +} - if (planCookie) { - const plan = await prisma.coursePlan.findUnique({ - where: { - id: parseInt(planCookie), - }, - include: { - courses: { - include: { - instructor: true, - facultyMeet: { - include: { - meetingTimes: true, - }, +async function getEvents(): Promise { + "use server"; + const output: Event[] = []; + const planCookie: any = await getPlanCookie(); + + let courses; + + if (planCookie) { + const plan = await prisma.coursePlan.findUnique({ + where: { + id: parseInt(planCookie), + }, + include: { + courses: { + include: { + instructor: true, + facultyMeet: { + include: { + meetingTimes: true, }, }, }, }, - }); + }, + }); - courses = plan?.courses; - } + courses = plan?.courses; + } - if (courses) { - for (let i = 0; i < courses.length; i++) { - const color = generateColorFromName(courses[i].subject); + if (courses) { + for (let i = 0; i < courses.length; i++) { + const color = generateColorFromName(courses[i].subject); - const num: string = courses[i].courseReferenceNumber; - const meetingTimes = await prisma.meetingTime.findFirst({ - where: { - courseReferenceNumber: num, - }, - }); + const num: string = courses[i].courseReferenceNumber; + const meetingTimes = await prisma.meetingTime.findFirst({ + where: { + courseReferenceNumber: num, + }, + }); - output.push({ - classNames: "font-sans", - textColor: "white", - title: courses[i]?.courseTitle, - daColor: color, - subject: courses[i]?.subject, - courseNumber: courses[i]?.courseNumber, - instructor: courses[i]?.instructor.displayName, - room: - courses[i]?.facultyMeet.meetingTimes.building + - " " + - courses[i]?.facultyMeet.meetingTimes.room, - color: "rgba(0,0,0,0)", + output.push({ + classNames: "font-sans", + textColor: "white", + title: courses[i]?.courseTitle, + daColor: color, + subject: courses[i]?.subject, + courseNumber: courses[i]?.courseNumber, + instructor: courses[i]?.instructor.displayName, + room: + courses[i]?.facultyMeet.meetingTimes.building + + " " + + courses[i]?.facultyMeet.meetingTimes.room, + color: "rgba(0,0,0,0)", - borderWidth: "0px", - daysOfWeek: [ - meetingTimes?.sunday && "0", - meetingTimes?.monday && "1", - meetingTimes?.tuesday && "2", - meetingTimes?.wednesday && "3", - meetingTimes?.thursday && "4", - meetingTimes?.friday && "5", - meetingTimes?.saturday && "6", - ], + borderWidth: "0px", + daysOfWeek: [ + meetingTimes?.sunday && "0", + meetingTimes?.monday && "1", + meetingTimes?.tuesday && "2", + meetingTimes?.wednesday && "3", + meetingTimes?.thursday && "4", + meetingTimes?.friday && "5", + meetingTimes?.saturday && "6", + ], - startTime: - meetingTimes?.beginTime.slice(0, 2) + - ":" + - meetingTimes?.beginTime.slice(2), - endTime: - meetingTimes?.endTime.slice(0, 2) + - ":" + - meetingTimes?.endTime.slice(2), - }); - } + startTime: + meetingTimes?.beginTime.slice(0, 2) + + ":" + + meetingTimes?.beginTime.slice(2), + endTime: + meetingTimes?.endTime.slice(0, 2) + + ":" + + meetingTimes?.endTime.slice(2), + }); } - - return output; } - async function getUniqueStartEndTimes() { - const maxstart = await prisma.meetingTime.findFirst({ - where: { - beginTime: { not: "" }, - }, - orderBy: { - beginTime: "desc", - }, - }); - const maxend = await prisma.meetingTime.findFirst({ - where: { - endTime: { not: "" }, - }, - orderBy: { - beginTime: "desc", - }, - }); + return output; +} - /* - let times = { - minTime: - maxstart?.beginTime.slice(0, 2) + ":" + maxstart?.beginTime.slice(2), - maxTime: - maxstart?.endTime.slice(0, 2) + ":" + maxstart?.beginTime.slice(2), - };*/ - console.log(maxstart); +export default async function CalendarPage() { + const events: Event[] = await getEvents(); + let endTime = "17:00"; + let startTime = "09:00"; - return maxstart; + for (const event of events) { + if (event.startTime < startTime && event.startTime != ":") + startTime = event.startTime; + if (event.endTime > endTime && event.endTime != ":") + endTime = event.endTime; } - const events = await getEvents(); - //let times = await getUniqueStartEndTimes(); return (
- +
diff --git a/components/Calendar.tsx b/components/Calendar.tsx index 2274217..4150c36 100644 --- a/components/Calendar.tsx +++ b/components/Calendar.tsx @@ -1,49 +1,46 @@ "use client"; +import { + DayHeaderContentArg, + EventContentArg, + EventSourceInput, +} from "@fullcalendar/core"; import FullCalendar from "@fullcalendar/react"; import timeGridPlugin from "@fullcalendar/timegrid"; // a plugin! import { Card } from "@nextui-org/react"; import moment from "moment"; -export default function Calendar(props: any) { - function dayHeaderContent(args: any) { +export default function Calendar({ + events, + startTime, + endTime, +}: { + events: EventSourceInput | undefined; + startTime: string; + endTime: string; +}) { + function dayHeaderContent(args: DayHeaderContentArg) { return moment(args.date).format("ddd"); } - function renderEventContent(eventInfo: any) { - console.log(eventInfo); - + function renderEventContent(eventInfo: EventContentArg) { return ( - {/* - - -
- */} - - + {eventInfo.timeText} {"|"} {eventInfo.event.extendedProps.room} -
+
{eventInfo.event.extendedProps.subject} {eventInfo.event.extendedProps.courseNumber} :

{eventInfo.event.title}

-
+
{eventInfo.event.extendedProps.instructor.replace("'", "'")}
- ); } @@ -52,17 +49,17 @@ export default function Calendar(props: any) { ); From 5f2b138d80ab9aa94ed2a250a54b4eb682499a95 Mon Sep 17 00:00:00 2001 From: Thomas Makin Date: Mon, 18 Nov 2024 11:43:43 -0500 Subject: [PATCH 04/14] FooterInfo: update spec Also rebrand and bump packs --- components/FooterInfo.tsx | 14 ++- package-lock.json | 211 ++++++++++++++++++-------------------- package.json | 4 +- 3 files changed, 110 insertions(+), 119 deletions(-) diff --git a/components/FooterInfo.tsx b/components/FooterInfo.tsx index c50b958..6ac8dd9 100644 --- a/components/FooterInfo.tsx +++ b/components/FooterInfo.tsx @@ -1,11 +1,8 @@ "use client"; -import FullCalendar from "@fullcalendar/react"; -import timeGridPlugin from "@fullcalendar/timegrid"; // a plugin! import InfoIcon from "@mui/icons-material/Info"; import { Button, - Card, Link, Modal, ModalBody, @@ -14,9 +11,9 @@ import { ModalHeader, useDisclosure, } from "@nextui-org/react"; -import moment from "moment"; +import packageInfo from "../package.json"; -export default function FooterInfo(props: any) { +export default function FooterInfo() { const { isOpen, onOpen, onClose } = useDisclosure(); const handleOpen = () => { @@ -52,7 +49,7 @@ export default function FooterInfo(props: any) { isExternal className="text-[#f46523]" href="mailto:staff@sccs.swarthmore.edu" - title="Sccs Staff Email" + title="SCCS Staff Email" > email us. @@ -70,8 +67,9 @@ export default function FooterInfo(props: any) {

- - © 2024 Swarthmore College Computer Society | v2.0.0 + + © 2024 Swarthmore College Computer Society | v + {packageInfo.version}
diff --git a/package-lock.json b/package-lock.json index e16419f..9b6347f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "next-app-template", - "version": "0.0.1", + "name": "scheduler", + "version": "2.0.0-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "next-app-template", - "version": "0.0.1", + "name": "scheduler", + "version": "2.0.0-beta", "dependencies": { "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", @@ -425,9 +425,9 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", - "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", + "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", "license": "Apache-2.0", "dependencies": { "@eslint/object-schema": "^2.1.4", @@ -439,18 +439,18 @@ } }, "node_modules/@eslint/core": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", - "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", + "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "license": "MIT", "dependencies": { "ajv": "^6.12.4", @@ -483,9 +483,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.14.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.14.0.tgz", - "integrity": "sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==", + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", + "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -501,9 +501,9 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.2.tgz", - "integrity": "sha512-CXtq5nR4Su+2I47WPOlWud98Y5Lv8Kyxp2ukhgFx/eW6Blm18VXJO5WuQylPugRo8nbluoi6GvvxBLqHcvqUUw==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", + "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", "license": "Apache-2.0", "dependencies": { "levn": "^0.4.1" @@ -513,13 +513,13 @@ } }, "node_modules/@formatjs/ecma402-abstract": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.2.3.tgz", - "integrity": "sha512-aElGmleuReGnk2wtYOzYFmNWYoiWWmf1pPPCYg0oiIQSJj0mjc4eUfzUXaSOJ4S8WzI/cLqnCTWjqz904FT2OQ==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.2.4.tgz", + "integrity": "sha512-lFyiQDVvSbQOpU+WFd//ILolGj4UgA/qXrKeZxdV14uKiAUiPAtX6XAn7WBCRi7Mx6I7EybM9E5yYn4BIpZWYg==", "license": "MIT", "dependencies": { "@formatjs/fast-memoize": "2.2.3", - "@formatjs/intl-localematcher": "0.5.7", + "@formatjs/intl-localematcher": "0.5.8", "tslib": "2" } }, @@ -533,30 +533,30 @@ } }, "node_modules/@formatjs/icu-messageformat-parser": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.9.3.tgz", - "integrity": "sha512-9L99QsH14XjOCIp4TmbT8wxuffJxGK8uLNO1zNhLtcZaVXvv626N0s4A2qgRCKG3dfYWx9psvGlFmvyVBa6u/w==", + "version": "2.9.4", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.9.4.tgz", + "integrity": "sha512-Tbvp5a9IWuxUcpWNIW6GlMQYEc4rwNHR259uUFoKWNN1jM9obf9Ul0e+7r7MvFOBNcN+13K7NuKCKqQiAn1QEg==", "license": "MIT", "dependencies": { - "@formatjs/ecma402-abstract": "2.2.3", - "@formatjs/icu-skeleton-parser": "1.8.7", + "@formatjs/ecma402-abstract": "2.2.4", + "@formatjs/icu-skeleton-parser": "1.8.8", "tslib": "2" } }, "node_modules/@formatjs/icu-skeleton-parser": { - "version": "1.8.7", - "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.7.tgz", - "integrity": "sha512-fI+6SmS2g7h3srfAKSWa5dwreU5zNEfon2uFo99OToiLF6yxGE+WikvFSbsvMAYkscucvVmTYNlWlaDPp0n5HA==", + "version": "1.8.8", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.8.tgz", + "integrity": "sha512-vHwK3piXwamFcx5YQdCdJxUQ1WdTl6ANclt5xba5zLGDv5Bsur7qz8AD7BevaKxITwpgDeU0u8My3AIibW9ywA==", "license": "MIT", "dependencies": { - "@formatjs/ecma402-abstract": "2.2.3", + "@formatjs/ecma402-abstract": "2.2.4", "tslib": "2" } }, "node_modules/@formatjs/intl-localematcher": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.7.tgz", - "integrity": "sha512-GGFtfHGQVFe/niOZp24Kal5b2i36eE2bNL0xi9Sg/yd0TR8aLjcteApZdHmismP5QQax1cMnZM9yWySUUjJteA==", + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.8.tgz", + "integrity": "sha512-I+WDNWWJFZie+jkfkiK5Mp4hEDyRSEvmyfYadflOno/mmKJKcB17fEpEH0oJu/OWhhCJ8kJBDz2YMd/6cDl7Mg==", "license": "MIT", "dependencies": { "tslib": "2" @@ -1128,9 +1128,9 @@ } }, "node_modules/@mui/core-downloads-tracker": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-6.1.6.tgz", - "integrity": "sha512-nz1SlR9TdBYYPz4qKoNasMPRiGb4PaIHFkzLzhju0YVYS5QSuFF2+n7CsiHMIDcHv3piPu/xDWI53ruhOqvZwQ==", + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-6.1.7.tgz", + "integrity": "sha512-POuIBi80BZBogQkG4PQKIGwy4QFwB+kOr+OI4k7Znh7LqMAIhwB9OC00l6M+w1GrZJYj3T8R5WX8G6QAIvoVEw==", "license": "MIT", "peer": true, "funding": { @@ -1139,9 +1139,9 @@ } }, "node_modules/@mui/icons-material": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-6.1.6.tgz", - "integrity": "sha512-5r9urIL2lxXb/sPN3LFfFYEibsXJUb986HhhIeu1gOcte460pwdSiEhBSxkAuyT8Dj7jvu9MjqSBmSumQELo8A==", + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-6.1.7.tgz", + "integrity": "sha512-RGzkeHNArIVy5ZQ12bq/8VYNeICEyngngsFskTJ/2hYKhIeIII3iRGtaZaSvLpXh7h3Fg3VKTulT+QU0w5K4XQ==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.26.0" @@ -1154,7 +1154,7 @@ "url": "https://opencollective.com/mui-org" }, "peerDependencies": { - "@mui/material": "^6.1.6", + "@mui/material": "^6.1.7", "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, @@ -1165,17 +1165,17 @@ } }, "node_modules/@mui/material": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-6.1.6.tgz", - "integrity": "sha512-1yvejiQ/601l5AK3uIdUlAVElyCxoqKnl7QA+2oFB/2qYPWfRwDgavW/MoywS5Y2gZEslcJKhe0s2F3IthgFgw==", + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-6.1.7.tgz", + "integrity": "sha512-KsjujQL/A2hLd1PV3QboF+W6SSL5QqH6ZlSuQoeYz9r69+TnyBFIevbYLxdjJcJmGBjigL5pfpn7hTGop+vhSg==", "license": "MIT", "peer": true, "dependencies": { "@babel/runtime": "^7.26.0", - "@mui/core-downloads-tracker": "^6.1.6", - "@mui/system": "^6.1.6", + "@mui/core-downloads-tracker": "^6.1.7", + "@mui/system": "^6.1.7", "@mui/types": "^7.2.19", - "@mui/utils": "^6.1.6", + "@mui/utils": "^6.1.7", "@popperjs/core": "^2.11.8", "@types/react-transition-group": "^4.4.11", "clsx": "^2.1.1", @@ -1194,7 +1194,7 @@ "peerDependencies": { "@emotion/react": "^11.5.0", "@emotion/styled": "^11.3.0", - "@mui/material-pigment-css": "^6.1.6", + "@mui/material-pigment-css": "^6.1.7", "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" @@ -1215,14 +1215,14 @@ } }, "node_modules/@mui/private-theming": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-6.1.6.tgz", - "integrity": "sha512-ioAiFckaD/fJSnTrUMWgjl9HYBWt7ixCh7zZw7gDZ+Tae7NuprNV6QJK95EidDT7K0GetR2rU3kAeIR61Myttw==", + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-6.1.7.tgz", + "integrity": "sha512-uLbfUSsug5K0LVkv0PI6Flste3le8+6WSL2omdTiYde93P89Qr7pKr8TA6d2yXfr+Bm+SvD8/fGnkaRwFkryuQ==", "license": "MIT", "peer": true, "dependencies": { "@babel/runtime": "^7.26.0", - "@mui/utils": "^6.1.6", + "@mui/utils": "^6.1.7", "prop-types": "^15.8.1" }, "engines": { @@ -1243,9 +1243,9 @@ } }, "node_modules/@mui/styled-engine": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-6.1.6.tgz", - "integrity": "sha512-I+yS1cSuSvHnZDBO7e7VHxTWpj+R7XlSZvTC4lS/OIbUNJOMMSd3UDP6V2sfwzAdmdDNBi7NGCRv2SZ6O9hGDA==", + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-6.1.7.tgz", + "integrity": "sha512-Ou4CxN7MQmwrfG1Pu6EYjPgPChQXxPDJrwgizLXlRPOad5qAq4gYXRuzrGQ2DfGjjwmJhjI8T6A0SeapAZPGig==", "license": "MIT", "peer": true, "dependencies": { @@ -1278,17 +1278,17 @@ } }, "node_modules/@mui/system": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-6.1.6.tgz", - "integrity": "sha512-qOf1VUE9wK8syiB0BBCp82oNBAVPYdj4Trh+G1s+L+ImYiKlubWhhqlnvWt3xqMevR+D2h1CXzA1vhX2FvA+VQ==", + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-6.1.7.tgz", + "integrity": "sha512-qbMGgcC/FodpuRSfjXlEDdbNQaW++eATh0vNBcPUv2/YXSpReoOpoT9FhogxEBNks+aQViDXBRZKh6HX2fVmwg==", "license": "MIT", "peer": true, "dependencies": { "@babel/runtime": "^7.26.0", - "@mui/private-theming": "^6.1.6", - "@mui/styled-engine": "^6.1.6", + "@mui/private-theming": "^6.1.7", + "@mui/styled-engine": "^6.1.7", "@mui/types": "^7.2.19", - "@mui/utils": "^6.1.6", + "@mui/utils": "^6.1.7", "clsx": "^2.1.1", "csstype": "^3.1.3", "prop-types": "^15.8.1" @@ -1334,9 +1334,9 @@ } }, "node_modules/@mui/utils": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-6.1.6.tgz", - "integrity": "sha512-sBS6D9mJECtELASLM+18WUcXF6RH3zNxBRFeyCRg8wad6NbyNrdxLuwK+Ikvc38sTZwBzAz691HmSofLqHd9sQ==", + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-6.1.7.tgz", + "integrity": "sha512-Gr7cRZxBoZ0BIa3Xqf/2YaUrBLyNPJvXPQH3OsD9WMZukI/TutibbQBVqLYpgqJn8pKSjbD50Yq2auG0wI1xOw==", "license": "MIT", "peer": true, "dependencies": { @@ -6088,9 +6088,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.5.tgz", - "integrity": "sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -6309,9 +6309,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.56", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.56.tgz", - "integrity": "sha512-7lXb9dAvimCFdvUMTyucD4mnIndt/xhRKFAlky0CyFogdnNmdPQNoHI23msF/2V4mpTxMzgMdjK4+YRlFlRQZw==", + "version": "1.5.62", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.62.tgz", + "integrity": "sha512-t8c+zLmJHa9dJy96yBZRXGQYoiCEnHYgFwn1asvSPZSUdVxnB62A4RASd7k41ytG3ErFBA0TpHlKg9D9SQBmLg==", "license": "ISC" }, "node_modules/emoji-regex": { @@ -6343,9 +6343,9 @@ } }, "node_modules/es-abstract": { - "version": "1.23.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", - "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "version": "1.23.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.5.tgz", + "integrity": "sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ==", "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.1", @@ -6363,7 +6363,7 @@ "function.prototype.name": "^1.1.6", "get-intrinsic": "^1.2.4", "get-symbol-description": "^1.0.2", - "globalthis": "^1.0.3", + "globalthis": "^1.0.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2", "has-proto": "^1.0.3", @@ -6379,10 +6379,10 @@ "is-string": "^1.0.7", "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", - "object-inspect": "^1.13.1", + "object-inspect": "^1.13.3", "object-keys": "^1.1.1", "object.assign": "^4.1.5", - "regexp.prototype.flags": "^1.5.2", + "regexp.prototype.flags": "^1.5.3", "safe-array-concat": "^1.1.2", "safe-regex-test": "^1.0.3", "string.prototype.trim": "^1.2.9", @@ -6523,26 +6523,26 @@ } }, "node_modules/eslint": { - "version": "9.14.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.14.0.tgz", - "integrity": "sha512-c2FHsVBr87lnUtjP4Yhvk4yEhKrQavGafRA/Se1ouse8PfbfC/Qh9Mxa00yWsZRlqeUB9raXip0aiiUZkgnr9g==", + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", + "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.7.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.14.0", - "@eslint/plugin-kit": "^0.2.0", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.9.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.15.0", + "@eslint/plugin-kit": "^0.2.3", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.0", + "@humanwhocodes/retry": "^0.4.1", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.5", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.2.0", @@ -6561,8 +6561,7 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" @@ -7224,9 +7223,9 @@ } }, "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", "license": "ISC" }, "node_modules/follow-redirects": { @@ -7302,9 +7301,9 @@ } }, "node_modules/framer-motion": { - "version": "11.11.12", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.11.12.tgz", - "integrity": "sha512-FC+efAcn62h6tXpeclgsekrpATdkIAa3+MffG2W2OLae0c7MV2NKgOcrwmScPKDg7qgyZC8Rqu36/4n5inMBtA==", + "version": "11.11.17", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.11.17.tgz", + "integrity": "sha512-O8QzvoKiuzI5HSAHbcYuL6xU+ZLXbrH7C8Akaato4JzQbX2ULNeniqC2Vo5eiCtFktX9XsJ+7nUhxcl2E2IjpA==", "license": "MIT", "dependencies": { "tslib": "^2.4.0" @@ -7687,14 +7686,14 @@ } }, "node_modules/intl-messageformat": { - "version": "10.7.6", - "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.7.6.tgz", - "integrity": "sha512-IsMU/hqyy3FJwNJ0hxDfY2heJ7MteSuFvcnCebxRp67di4Fhx1gKKE+qS0bBwUF8yXkX9SsPUhLeX/B6h5SKUA==", + "version": "10.7.7", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.7.7.tgz", + "integrity": "sha512-F134jIoeYMro/3I0h08D0Yt4N9o9pjddU/4IIxMMURqbAtI2wu70X8hvG1V48W49zXHXv3RKSF/po+0fDfsGjA==", "license": "BSD-3-Clause", "dependencies": { - "@formatjs/ecma402-abstract": "2.2.3", + "@formatjs/ecma402-abstract": "2.2.4", "@formatjs/fast-memoize": "2.2.3", - "@formatjs/icu-messageformat-parser": "2.9.3", + "@formatjs/icu-messageformat-parser": "2.9.4", "tslib": "2" } }, @@ -9417,9 +9416,9 @@ } }, "node_modules/react-textarea-autosize": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.5.4.tgz", - "integrity": "sha512-eSSjVtRLcLfFwFcariT77t9hcbVJHQV76b51QjQGarQIHml2+gM2lms0n3XrhnDmgK5B+/Z7TmQk5OHNzqYm/A==", + "version": "8.5.5", + "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.5.5.tgz", + "integrity": "sha512-CVA94zmfp8m4bSHtWwmANaBR8EPsKy2aZ7KwqhoS4Ftib87F9Kvi7XQhOixypPLMc6kVYgOXvKFuuzZDpHGRPg==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.20.13", @@ -10248,12 +10247,6 @@ "node": ">=6" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "license": "MIT" - }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", diff --git a/package.json b/package.json index cec1232..46fab0b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "next-app-template", - "version": "0.0.1", + "name": "scheduler", + "version": "2.0.0-beta", "private": true, "scripts": { "dev": "next dev", From 1da470823d2fe828486ca5b26b7392e567b890af Mon Sep 17 00:00:00 2001 From: Thomas Makin Date: Mon, 18 Nov 2024 11:48:41 -0500 Subject: [PATCH 05/14] CreatePlan: align text in cards --- components/CreatePlan.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/components/CreatePlan.tsx b/components/CreatePlan.tsx index f19f2db..9e8772d 100644 --- a/components/CreatePlan.tsx +++ b/components/CreatePlan.tsx @@ -131,7 +131,7 @@ export default function CreatePlan(props: any) { -
{course.subject} {""} {course.courseNumber}
{course.courseTitle.replace(/&/g, "&")}
-
@@ -133,8 +139,9 @@ export const Navbar = (props: any) => { )} @@ -169,7 +176,7 @@ export const Navbar = (props: any) => { @@ -188,7 +195,7 @@ export const Navbar = (props: any) => { variant="bordered" onClick={() => signIn("keycloak", { callbackUrl: "/" })} > - Log In + Log In )} diff --git a/components/primitives.ts b/components/primitives.ts index af278d0..6607a15 100644 --- a/components/primitives.ts +++ b/components/primitives.ts @@ -56,22 +56,22 @@ export const subtitle = tv({ }); export const courseColors = [ - "hsl(0deg 60% 35%)", - "hsl(21.17deg 60% 35%)", - "hsl(42.34deg 60% 35%)", - "hsl(63.51deg 60% 35%)", - "hsl(84.68deg 60% 35%)", - "hsl(105.85deg 60% 35%)", - "hsl(127.02deg 60% 35%)", - "hsl(148.19deg 60% 35%)", - "hsl(169.36deg 60% 35%)", - "hsl(190.53deg 60% 35%)", - "hsl(211.70deg 60% 35%)", - "hsl(232.87deg 60% 35%)", - "hsl(254.04deg 60% 35%)", - "hsl(275.21deg 60% 35%)", - "hsl(296.38deg 60% 35%)", - "hsl(317.55deg 60% 35%)", + "bg-[color:hsl(0deg_60%_50%)] dark:bg-[color:hsl(0deg_60%_35%)]", + "bg-[color:hsl(21.17deg_60%_50%)] dark:bg-[color:hsl(21.17deg_60%_35%)]", + "bg-[color:hsl(42.34deg_60%_50%)] dark:bg-[color:hsl(42.34deg_60%_35%)]", + "bg-[color:hsl(63.51deg_60%_50%)] dark:bg-[color:hsl(63.51deg_60%_35%)]", + "bg-[color:hsl(84.68deg_60%_50%)] dark:bg-[color:hsl(84.68deg_60%_35%)]", + "bg-[color:hsl(105.85deg_60%_50%)] dark:bg-[color:hsl(105.85deg_60%_35%)]", + "bg-[color:hsl(127.02deg_60%_50%)] dark:bg-[color:hsl(127.02deg_60%_35%)]", + "bg-[color:hsl(148.19deg_60%_50%)] dark:bg-[color:hsl(148.19deg_60%_35%)]", + "bg-[color:hsl(169.36deg_60%_50%)] dark:bg-[color:hsl(169.36deg_60%_35%)]", + "bg-[color:hsl(190.53deg_60%_50%)] dark:bg-[color:hsl(190.53deg_60%_35%)]", + "bg-[color:hsl(211.70deg_60%_50%)] dark:bg-[color:hsl(211.70deg_60%_35%)]", + "bg-[color:hsl(232.87deg_60%_50%)] dark:bg-[color:hsl(232.87deg_60%_35%)]", + "bg-[color:hsl(254.04deg_60%_50%)] dark:bg-[color:hsl(254.04deg_60%_35%)]", + "bg-[color:hsl(275.21deg_60%_50%)] dark:bg-[color:hsl(275.21deg_60%_35%)]", + "bg-[color:hsl(296.38deg_60%_50%)] dark:bg-[color:hsl(296.38deg_60%_35%)]", + "bg-[color:hsl(317.55deg_60%_50%)] dark:bg-[color:hsl(317.55deg_60%_35%)]", ]; export function generateColorFromName(name: string) { @@ -81,5 +81,8 @@ export function generateColorFromName(name: string) { hash += name.charCodeAt(i) * i; } + console.log("generated:"); + console.log(courseColors[hash % courseColors.length]); + return courseColors[hash % courseColors.length]; } diff --git a/components/theme-switch.tsx b/components/theme-switch.tsx index 72b5980..c0636f7 100644 --- a/components/theme-switch.tsx +++ b/components/theme-switch.tsx @@ -43,7 +43,7 @@ export const ThemeSwitch: FC = ({ className: clsx( "px-px transition-opacity hover:opacity-80 cursor-pointer", className, - classNames?.base, + classNames?.base ), })} > @@ -65,11 +65,15 @@ export const ThemeSwitch: FC = ({ "px-0", "mx-0", ], - classNames?.wrapper, + classNames?.wrapper ), })} > - {!isSelected || isSSR ? : } + {!isSelected || isSSR ? ( + + ) : ( + + )}
); diff --git a/styles/globals.css b/styles/globals.css index b8cc390..947af0c 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -40,6 +40,11 @@ .fc-col-header { background-color: #151d2b; font-family: var(--font-sans); + border-radius: 0.5rem 0.5rem 0px 0px; +} + +.fc { + border-radius: 0.5rem; } .fc-event-main-frame { @@ -50,8 +55,15 @@ text-overflow: ellipsis; } -h2 { - font-size: 1.1em; +.fc-theme-standard .fc-scrollgrid { + border-radius: 0.5rem; +} + +.fc-theme-standard td { + border-radius: 0rem 0rem 0.5rem 0.5rem; +} +.fc-theme-standard th { + border-radius: 0.5rem 0.5rem 0rem 0rem; } .smallFont { diff --git a/tailwind.config.js b/tailwind.config.js index 3d455c7..dcccabe 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -24,11 +24,26 @@ module.exports = { plugins: [ nextui({ themes: { - light: {}, + light: { + colors: { + background: "#E5E7EB", + background_navbar: "#31425E", + background_layer: "#31425E", + foreground: "#000000", + light_foreground: "#F1F1F1", + primary: { + DEFAULT: "#9FADBC", + foreground: "#314f25E", + }, + secondary: "#F46523", + focus: "#F46523", + }, + }, dark: { colors: { background: "#0C1019", background_navbar: "#151D2B", + background_layer: "#2C2C33", foreground: "#D9D9D9", light_foreground: "#181C25", primary: { @@ -36,7 +51,7 @@ module.exports = { foreground: "#1D2125", }, secondary: "#F46523", - focus: "#BEF264", + focus: "#F46523", }, }, }, From 8b1892e9940b547ca93d0a75c68938ec302e3293 Mon Sep 17 00:00:00 2001 From: Damian <37555910+DCRepublic@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:20:58 -0500 Subject: [PATCH 13/14] update cron --- Dockerfile.cron | 13 ++++--------- crontab_file | 3 ++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Dockerfile.cron b/Dockerfile.cron index 549ac3a..34e8a55 100644 --- a/Dockerfile.cron +++ b/Dockerfile.cron @@ -3,22 +3,16 @@ FROM golang:1.23-bookworm RUN useradd cronuser RUN mkdir -p /app RUN touch /var/log/cron.log -RUN chown -R cronuser /var/log RUN chown -R cronuser /app -RUN touch /var/run/crond.pid -RUN groupadd cron-users && \ - chgrp cron-users /var/run/crond.pid && \ - usermod -a -G cron-users cronuser + WORKDIR /app RUN apt update RUN apt install -y cron rsyslog -COPY --chown=cronuser:cronuser ./crontab_file /etc/cron.d/cron-scraper -RUN chmod u+s /usr/sbin/cron +COPY ./crontab_file /etc/cron.d/cron-scraper RUN chmod 0644 /etc/cron.d/cron-scraper -RUN crontab -u cronuser /etc/cron.d/cron-scraper -COPY --chown=cronuser:cronuser ./cron-startup.sh ./cron-startup.sh +COPY ./cron-startup.sh ./cron-startup.sh USER cronuser @@ -30,4 +24,5 @@ COPY --chown=cronuser:cronuser ./swatscraper/*.go ./ RUN GOCACHE=/app/.cache CGO_ENABLED=0 GOOS=linux go build -o /app/swatscraper +USER root ENTRYPOINT ["./cron-startup.sh"] diff --git a/crontab_file b/crontab_file index d0844a9..bf1e857 100644 --- a/crontab_file +++ b/crontab_file @@ -1 +1,2 @@ -0 * * * * cronuser /app/swatscraper -semester=spring -year=2025 +* * * * * root date >> /var/log/cron.log +0 * * * * root /app/swatscraper -semester=spring -year=2025 -env=/app/.env >> /var/log/cron.log From 1938e8cce066522bf5856faf4a76a4002fedf584 Mon Sep 17 00:00:00 2001 From: Damian <37555910+DCRepublic@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:22:29 -0500 Subject: [PATCH 14/14] update scraper --- swatscraper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swatscraper b/swatscraper index b3a2157..ed190e6 160000 --- a/swatscraper +++ b/swatscraper @@ -1 +1 @@ -Subproject commit b3a2157105945977bd67c3ad3e81bc4992b85a8b +Subproject commit ed190e652c3e2380e69976869d8e3a2a89a04ab4