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

Majorlist edits #33

Merged
merged 3 commits into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions frontend/src/commons/components/InfoButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { GoInfo } from "react-icons/go";
import "react-tooltip/dist/react-tooltip.css";
import { Tooltip } from "react-tooltip";

export default function InfoButton(props: { text: string }) {
export default function InfoButton(props: { text: string, size?: number}) {
return (
<div style={{ display: "flex", marginLeft: "3px", marginTop: "2px"}}>
<div style={{ display: "flex", marginLeft: "3px", marginTop: "0px"}}>
<div
data-tooltip-id="info-tooltip"
data-tooltip-content={props.text}
data-tooltip-place="top"
>
<GoInfo />
<GoInfo style={{ fontSize: props.size ? props.size : 16 }}/>
</div>
<Tooltip id="info-tooltip" style={{
backgroundColor: "#444444",
Expand Down
27 changes: 19 additions & 8 deletions frontend/src/commons/mock/MockCourses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const MATH244: Course = { code: "MATH 244", title: "Title MATH244", seasons: ["F
const CPSC223: Course = { code: "CPSC 223", title: "Title CPSC223", seasons: ["FALL", "SPRING"], evaluation: { rating: 4.1, workload: 4.2, professor: 5}, distribution: ["QR"] };
const CPSC323: Course = { code: "CPSC 323", title: "Title CPSC323", seasons: ["FALL", "SPRING"], evaluation: { rating: 4.1, workload: 4.2, professor: 5}, distribution: ["QR"] };
const CPSC365: Course = { code: "CPSC 365", title: "Title CPSC365", seasons: ["FALL", "SPRING"], evaluation: { rating: 4.1, workload: 4.2, professor: 5}, distribution: ["QR"] };
const CGSC110: Course = { code: "CGSC 110", title: "Title CGSC110", seasons: ["FALL", "SPRING"], evaluation: { rating: 4.1, workload: 4.2, professor: 5}, distribution: ["So"] };

const EMPTYCOURSE: Course = { code: "N/A", title: "Title NULL", seasons: [], evaluation: { rating: 3, workload: 3, professor: 3}, distribution: [] };

const Student201: StudentCourse = { course: CPSC201, enrollmentStatus: "COMPLETED", season: "FALL", year: "2022-2023" };
const Student223: StudentCourse = { course: CPSC223, enrollmentStatus: "COMPLETED", season: "SPRING", year: "2022-2023" };
Expand All @@ -15,14 +18,22 @@ const Student323: StudentCourse = { course: CPSC323, enrollmentStatus: "ENROLLED
const CGSC274: Course = { code: "CGSC 274", title: "Title CGSC274", seasons: ["FALL", "SPRING"], evaluation: { rating: 4.1, workload: 4.2, professor: 5}, distribution: ["QR", "Sc", "So"] };
const Student274: StudentCourse = { course: CGSC274, enrollmentStatus: "COMPLETED", season: "FALL", year: "2023-2024" };

export const MockCourses = [
CPSC201,
CPSC202,
MATH244,
CPSC223,
CPSC323,
CPSC365,
];
// make a dictionary of Course objects
export const MockCourses: { [key: string]: Course } = {
"CGSC 110": CGSC110,
"CPSC 201": CPSC201,
"CPSC 202": CPSC202,
"MATH 244": MATH244,
"CPSC 223": CPSC223,
"CPSC 323": CPSC323,
"CPSC 365": CPSC365,
"CGSC 274": CGSC274,
};

// a function that returns a course if in the dictionary, otherwise return an empty course
export function getCourse(courseCode: string): Course {
return MockCourses[courseCode] || EMPTYCOURSE;
}

export const MockStudentCourses = [
Student201,
Expand Down
Loading
Loading