Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge: Dcrepublic dev #19

Merged
merged 25 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b0d0129
add rating average to profs
DCRepublic Nov 11, 2024
81a581d
more changes
DCRepublic Nov 11, 2024
5922772
Fix seatsavailable, calendar ui
DCRepublic Nov 11, 2024
59932e1
Add admin dashboard, and ability to delete ratings
DCRepublic Nov 11, 2024
cf32d34
prisma: fieldReference is no longer preview
makinbacon21 Nov 12, 2024
6738479
scheduler: auth and types overhaul
makinbacon21 Nov 12, 2024
1b32671
scheduler: ui overhaul
makinbacon21 Nov 12, 2024
7f1980d
Create main.yml
DCRepublic Nov 12, 2024
4782b6f
scheduler: unbreak other page ui
makinbacon21 Nov 12, 2024
92e4ffe
plan: fix suspense
makinbacon21 Nov 12, 2024
05bd6af
pagination, gitlab
DCRepublic Nov 12, 2024
f2b2d5c
fix build erro
DCRepublic Nov 12, 2024
f7f8be6
Fix navbar
Spazzinq Nov 13, 2024
c035022
Updated main UI
Spazzinq Nov 13, 2024
dc522d4
Revert breaking replace-all
Spazzinq Nov 13, 2024
e3fa8fd
FullCourseList: improve skel and loading
makinbacon21 Nov 13, 2024
cca94ea
Main: fix search and card heights/defautl to s2025, Rating: fix sizin…
DCRepublic Nov 13, 2024
e059baf
Fix spacing issues
Spazzinq Nov 13, 2024
7ca3ee9
FullCourseList: fix take desync
makinbacon21 Nov 14, 2024
d9a35c4
scheduler: further improve mobile
makinbacon21 Nov 14, 2024
8b27b7b
CreatePlan: add auto scroller
makinbacon21 Nov 14, 2024
277963f
CourseCard: minor fixes
makinbacon21 Nov 14, 2024
6d215b1
Calendar: Format for mobile, Fix events to show course number, Add Fo…
DCRepublic Nov 17, 2024
a714f38
Fix build error:
DCRepublic Nov 17, 2024
36a17eb
Merge branch 'main' into dcrepublic-dev
DCRepublic Nov 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ export default function AdminPage() {
if (status === "authenticated") {
if (session.user?.role === "admin") {
return (
<div className="w-[90vw]">
<div>
<Table
isHeaderSticky
className="overflow-scroll scrollbar-thin scrollbar-thumb-accent-500 scrollbar-track-transparent"
className="overflow-scroll scrollbar-thin scrollbar-thumb-accent-500 scrollbar-track-transparent h-[80vh] p-4"
fullWidth
aria-label="Rating table with dynamic content(ratings)"
>
Expand Down
14 changes: 10 additions & 4 deletions app/calendar/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export default async function CalendarPage() {
id: parseInt(planCookie),
},
include: {
courses: true,
courses: {
include: {
instructor: true,
},
},
},
});

Expand All @@ -42,6 +46,8 @@ export default async function CalendarPage() {
title: courses[i]?.courseTitle,
daColor: color,
subject: courses[i]?.subject,
courseNumber: courses[i]?.courseNumber,
instructor: courses[i]?.instructor.displayName,
color: "rgba(0,0,0,0)",

borderWidth: "0px",
Expand Down Expand Up @@ -104,11 +110,11 @@ export default async function CalendarPage() {

//let times = await getUniqueStartEndTimes();
return (
<div className="grid grid-cols-3 p-4 w-screen absolute start-0 px-32 gap-20">
<div className=" col-start-1 h-[70vh] w-[57vw] col-span-2 font-sans font-normal">
<div className="grid grid-cols-3 sm:gap-20 grid-rows-2 sm:grid-rows-1 p-4 ">
<div className="sm:h-[75vh] sm:w-[57vw] col-span-3 md:col-span-2 font-sans font-normal ">
<Calendar events={events} />
</div>
<div className="col-start-3 h-[62vh] ">
<div className="sm:h-[62vh] col-span-3 sm:col-span-1 ">
<CreatePlan />
</div>
</div>
Expand Down
30 changes: 3 additions & 27 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { NextAuthProvider } from "../components/providers/NextAuthProvider";
import { siteConfig } from "../config/site";
import { fontSans } from "../config/fonts";
import { Navbar } from "../components/navbar";
import FooterInfo from "../components/FooterInfo";

import { Providers } from "./providers";

Expand Down Expand Up @@ -54,35 +55,10 @@ export default function RootLayout({
>
<div className="flex flex-col h-screen ">
<Navbar />
<main className="container mx-auto px-1 lg:px-7 lg:pt-10 justify-center items-center flex-grow">
<main className="container mx-auto px-1 lg:px-7 lg:pt-10 justify-center items-center flex-grow ">
{children}
</main>
<footer className="w-full flex items-center justify-center py-3">
<div className="columns-1 container max-w-4xl text-center">
<span className="text-xs">
The Course Planner is a student-run service, and displays
classes from the Tri-College course database. We recommend
confirming your schedule with the official course listings
just in case. If there are any issues, email us.
</span>
<br />

<div className="space-x-5">
<Link
isExternal
href="https://www.sccs.swarthmore.edu/docs/policy"
title="SCCS Usage & Data Policy"
>
<span className=" text-xs underline ">
Usage & Data Policy
</span>
</Link>
<span className="text-xs ">
© 2024 Swarthmore College Computer Society | v2.0.0
</span>
</div>
</div>
</footer>
<FooterInfo />
</div>
</Providers>
</body>
Expand Down
2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default async function Page(props: {
homePageProps["createPlan"] = (
<Suspense
fallback={
<Skeleton className="rounded-lg w-8/12 h-full align-top justify-start" />
<Skeleton className="rounded-lg w-8/12 h-fit align-top justify-start" />
}
>
<CreatePlan />
Expand Down
10 changes: 9 additions & 1 deletion components/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,17 @@ export default function Calendar(props: any) {
*/}

<b className="font-sans text-[9px] ml-1 mt-1">{eventInfo.timeText}</b>
<div className="font-sans text-[10px] ml-1 ">
<div className="font-sans text-[10px] ml-1 font-bold">
{eventInfo.event.extendedProps.subject} {""}
{eventInfo.event.extendedProps.courseNumber}
</div>
<div className="font-sans text-[10px] ml-1 mt-5 ">
{eventInfo.event.title}
</div>
<div className="font-sans text-[10px] ml-1 mt-5 ">
{eventInfo.event.extendedProps.instructor.replace("&#39;", "'")}
</div>

</Card>
);
}
Expand Down
14 changes: 11 additions & 3 deletions components/CreatePlan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,15 @@ export default function CreatePlan(props: any) {
/>

<CardHeader className="justify-between">
<div className="ml-2 lg:text-base truncate">
{course.courseTitle.replace(/&amp;/g, "&")}

<div className="ml-2 lg:text-base truncate text-bold">
{course.subject} {""} {course.courseNumber}
<div className="text-tiny ">
{course.courseTitle.replace(/&amp;/g, "&")}
</div>

</div>

<Button
isIconOnly
startContent={<HighlightOffIcon />}
Expand Down Expand Up @@ -258,7 +264,9 @@ export default function CreatePlan(props: any) {
</div>

<div
className="flex flex-col h-[55vh] overflow-y-scroll gap-3 scrollbar-thin scrollbar-thumb-accent-500 scrollbar-track-transparent"

className="flex flex-col h-[45vh] overflow-y-scroll gap-3 scrollbar-thin scrollbar-thumb-accent-500 scrollbar-track-transparent"

id="scrollMe"
>
<CoursesList />
Expand Down
89 changes: 89 additions & 0 deletions components/FooterInfo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
"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,
ModalContent,
ModalFooter,
ModalHeader,
useDisclosure,
} from "@nextui-org/react";
import moment from "moment";

export default function FooterInfo(props: any) {
const { isOpen, onOpen, onClose } = useDisclosure();

const handleOpen = () => {
onOpen();
};
return (
<>
<div
role="presentation"
className="flex flex-wrap gap-3 fixed bottom-10 left-10 opacity-50 hover:opacity-80 invisible sm:visible"
onClick={() => handleOpen()}
>
<InfoIcon />
</div>
<Modal backdrop={"blur"} isOpen={isOpen} onClose={onClose}>
<ModalContent>
{(onClose) => (
<>
<ModalHeader className="flex flex-col gap-1">
Usage & Data Policy
</ModalHeader>
<ModalBody>
<div className="columns-1 container max-w-4xl text-center">
<span className="">
The Course Planner is a student-run service, and displays
classes from the Tri-College course database. We recommend
confirming your schedule with the official course listings
just in case. If there are any issues,
</span>
<span>
{" "}
<Link
isExternal
className="text-[#f46523]"
href="mailto:[email protected]"
title="Sccs Staff Email"
>
email us.
</Link>
</span>
<br />
<br />

<div className="space-x-5">
<Link
isExternal
href="https://www.sccs.swarthmore.edu/docs/policy"
title="SCCS Usage & Data Policy"
>
<span className=" underline ">Usage & Data Policy</span>
</Link>
</div>
<br />
<span className="text-xs mt-3 ">
© 2024 Swarthmore College Computer Society | v2.0.0
</span>
</div>
</ModalBody>
<ModalFooter>
<Button color="danger" variant="light" onPress={onClose}>
Close
</Button>
</ModalFooter>
</>
)}
</ModalContent>
</Modal>
</>
);
}
2 changes: 1 addition & 1 deletion lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const config = {
return token;
},
async session({ session, token }) {
session.role = token.role;
session.user.role = token.role;
session.user.id = token.sub || "";
return session;
},
Expand Down
Loading