Skip to content

Commit

Permalink
Merge pull request #272 from senior-knights/production
Browse files Browse the repository at this point in the history
  • Loading branch information
charkour authored Nov 18, 2022
2 parents bb9ab7c + 84d2763 commit 4e91e7b
Show file tree
Hide file tree
Showing 8 changed files with 1,269 additions and 2,065 deletions.
3,129 changes: 1,140 additions & 1,989 deletions client-course-schedulizer/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions client-course-schedulizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"lodash": "4.17.21",
"material-ui-image": "3.3.1",
"material-ui-popup-state": "^1.7.0",
"moment": "2.29.2",
"moment": "2.29.4",
"moment-range": "^4.0.2",
"node-sass": "4.14.1",
"sass": "1.56.1",
"object-hash": "^2.1.1",
"papaparse": "^5.3.0",
"path": "^0.12.7",
Expand Down Expand Up @@ -102,7 +102,7 @@
"eslint-plugin-sort-keys-fix": "1.1.1",
"eslint-plugin-typescript-sort-keys": "1.5.0",
"gh-pages": "^3.1.0",
"husky": "4.3.0",
"husky": "4.3.8",
"lint-staged": "10.4.0",
"prettier": "2.1.2",
"react-scripts": "3.4.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Grid } from "@material-ui/core";
import { NewTabLink, Page } from "components/reuseables";
import React from "react";
import { team2020, team2021, teamAdvisors, TeamMember } from "utilities";
import { team2020, team2021, team2022, teamAdvisors, TeamMember } from "utilities";
import { TeamMemberProfile, TextSection } from ".";
import "./AboutPage.scss";

Expand All @@ -11,6 +11,7 @@ export const AboutPage = () => {
return (
<Page>
<AboutVision />
<AboutTeam2022 />
<AboutTeam2021 />
<AboutTeam2020 />
<AboutTeamAdvisors />
Expand Down Expand Up @@ -74,7 +75,6 @@ const AboutVision = () => {
/>
);
};

const AboutTeam2020 = () => {
return (
<TextSection
Expand Down Expand Up @@ -105,6 +105,21 @@ const AboutTeam2021 = () => {
);
};

const AboutTeam2022 = () => {
return (
<TextSection
body={
<Grid container direction="column" justify="flex-start" spacing={2}>
{team2022.map((member: TeamMember) => {
return <TeamMemberProfile key={member.name} member={member} />;
})}
</Grid>
}
title="Team of 2022"
/>
);
};

const AboutTeamAdvisors = () => {
return (
<TextSection
Expand Down Expand Up @@ -152,6 +167,13 @@ const AboutReport = () => {
body={
<ul>
<li>
<NewTabLink href="https://docs.google.com/document/d/1MjXN3lbgYXInZyUk1V_sh4wVVs2ITd6rloYKjJW8W6c/edit?usp=sharing">
2022 Project Proposal
</NewTabLink>{" "}
- 10.01.2022
</li>
<hr/>
<li>
<NewTabLink href="https://docs.google.com/document/d/e/2PACX-1vSL0Ezm-2XOCQWPv4R7J3MRZAn5PW46cayuKNxxElyVdl9W48ns2cRcd6xquoBc054_w2K_vsx2si7P/pub">
Final Report
</NewTabLink>{" "}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,45 +197,51 @@ export const AddSectionPopover = ({ values }: PopoverValueProps) => {
<Grid container spacing={SPACING}>
<GridItemTextField label="Department" textFieldProps={{ autoFocus: true }} />
</Grid>
<Grid container spacing={SPACING}>
<GridItemAutocomplete label="Prefix" multiple options={getPrefixes(schedule)} />
<GridItemAutocomplete label="Number" options={getNumbers(schedule)} />
<GridItemAutocomplete label="Section" options={getSectionLetters(schedule)} />
<GridItemAutocomplete label="Name" options={getCourseNames(schedule)} />
<GridItemAutocomplete
label="Instructional Method"
options={getInstructionalMethods(schedule)}
/>
</Grid>
<Grid container spacing={SPACING}>
<GridItemAutocomplete label="Instructor" multiple options={[...professors].sort()} />
<GridItemAutocomplete label="Location" options={[...rooms].sort()} />
<GridItemTextField label="Room Capacity" />
<GridItemTextField label="Faculty Hours" />
<GridItemTextField label="Student Hours" />
<Grid item xs = {2}>
<GridItemAutocomplete label="Prefix" multiple options={getPrefixes(schedule)} />
</Grid>
<Grid item xs = {1}>
<GridItemAutocomplete label="Number" options={getNumbers(schedule)} />
</Grid>
<Grid item xs = {1}>
<GridItemAutocomplete label="Section" options={getSectionLetters(schedule)} />
</Grid>
<GridItemAutocomplete label="Course Title" options={getCourseNames(schedule)} />
</Grid>
<Grid container spacing={SPACING}>
<GridItemTextField label="Anticipated Size" />
<GridItemTextField label="Used" />
<GridItemTextField label="Day 10 Used" />
<GridItemTextField label="Local Max" />
<GridItemTextField label="Global Max" />
<Grid item xs = {2}>
<GridItemTextField
label="Start Time"
textFieldProps={{ fullWidth: true, type: "time" }}
/>
</Grid>
<Grid item xs = {1}>
<GridItemTextField
label="Duration"
textFieldProps={{
InputProps: {
endAdornment: <InputAdornment position="end">min</InputAdornment>,
},
}}
/>
</Grid>
<Grid item xs = {3}>
<GridItemAutocomplete label="Location" options={[...rooms].sort()} />
</Grid>
<Grid item xs = {1}>
<GridItemTextField label="Faculty Hours" />
</Grid>
<Grid item xs = {1}>
<GridItemTextField label="Student Hours" />
</Grid>
<GridItemAutocomplete
label="Delivery Mode"
options={getInstructionalMethods(schedule)}
/>
</Grid>
<Grid container spacing={SPACING}>
<GridItemTextField
label="Start Time"
textFieldProps={{ fullWidth: true, type: "time" }}
/>
<GridItemTextField
label="Duration"
textFieldProps={{
InputProps: {
endAdornment: <InputAdornment position="end">min</InputAdornment>,
},
}}
/>
<GridItemTextField label="Year" />
<GridItemTextField label="Status" />
{/* This empty item just fills space */}
<Grid item xs />
</Grid>
Expand Down Expand Up @@ -264,7 +270,7 @@ export const AddSectionPopover = ({ values }: PopoverValueProps) => {
)}
{isIntensiveSemester && (
<GridItemRadioGroup
label="Intensive Semester"
label="Intensive Term"
options={Object.values(SemesterLength).filter((i) => {
return Object.values(Intensive).includes(i);
})}
Expand All @@ -283,7 +289,7 @@ export const AddSectionPopover = ({ values }: PopoverValueProps) => {
}}
/>
<Typography variant="caption">
Custom semester lengths are not supported yet.
Custom term lengths are not supported yet. Please enter start date and include a note about term length.
</Typography>
</Grid>
)}
Expand Down
31 changes: 31 additions & 0 deletions client-course-schedulizer/src/utilities/helpers/teamMembers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,37 @@ export const team2021: TeamMember[] = [
},
];

export const team2022: TeamMember[] = [
{
bio:
"Computer Science Student at Calvin University.",
name: "John White",
photo: "https://avatars.githubusercontent.com/u/90846531?v=4",
website: "https://github.com/jmw-75",
},
{
bio:
"Computer Science Student at Calvin University.",
name: "Samuel Haileselassie",
photo: "https://media-exp1.licdn.com/dms/image/C5603AQH8mr-DiG2BEw/profile-displayphoto-shrink_400_400/0/1634434581718?e=1671667200&v=beta&t=RyVTx8CAqQ8RmELiQN5PBXM7Bf2pQGSGu8uO40E7v4k",
website: "https://github.com/samuelth47",
},
{
bio:
"Computer Science Student at Calvin University.",
name: "Sharon Velpula",
photo: "https://avatars.githubusercontent.com/u/90476681?v=4",
website: "https://github.com/VelSharon",
},
{
bio:
"Computer Science Student at Calvin University.",
name: "Fitsum Maru",
photo: "https://avatars.githubusercontent.com/u/86684529?v=4",
website: "https://github.com/FitsumMaru",
},
];

export const teamAdvisors: TeamMember[] = [
{
bio:
Expand Down
61 changes: 26 additions & 35 deletions client-course-schedulizer/src/utilities/helpers/writeFullCSV.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const scheduleToFullCSVString = (schedule: Schedule): string => {
});

let csvStr =
"Department,Term,TermStart,AcademicYear,SectionName,SubjectCode,CourseNum,SectionCode,CourseLevelCode,MinimumCredits,FacultyLoad,Used,Day10Used,LocalMax,GlobalMax,RoomCapacity,BuildingAndRoom,MeetingDays,MeetingTime,SectionStartDate,SectionEndDate,SemesterLength,Building,RoomNumber,MeetingStart,MeetingStartInternal,MeetingDurationMinutes,MeetingEnd,MeetingEndInternal,Monday,Tuesday,Wednesday,Thursday,Friday,ShortTitle,Faculty,SectionStatus,InstructionalMethod,Comments,LastEditTimestamp\n";
"Department,Term,SubjectCode,CourseNum,SectionCode,CourseLevelCode,MinimumCredits,FacultyLoad,BuildingAndRoom,MeetingDays,MeetingTime,SectionStartDate,SectionEndDate,SemesterLength,Building,RoomNumber,MeetingStart,MeetingDurationMinutes,MeetingEnd,ShortTitle,Faculty,SectionStatus,InstructionalMethod,Comments,LastEditTimestamp\n";
schedule.courses.forEach((course) => {
const termOrder = Object.values(Term);
course.sections = course.sections.sort((a, b): number => {
Expand Down Expand Up @@ -55,11 +55,11 @@ export const scheduleToFullCSVString = (schedule: Schedule): string => {
let buildingAndRoomStr = "";
let roomCapacityStr = "";
let daysStr = "";
let monStr = "";
let tuesStr = "";
let wedStr = "";
let thursStr = "";
let friStr = "";
// let monStr = "";
// let tuesStr = "";
// let wedStr = "";
// let thursStr = "";
// let friStr = "";
section.meetings.forEach((meeting) => {
startMoment = moment(meeting.startTime, "h:mm A");
endMoment = startMoment.clone().add(meeting.duration, "minutes");
Expand All @@ -72,9 +72,9 @@ export const scheduleToFullCSVString = (schedule: Schedule): string => {
} else {
meetingTimeStr += "\n";
meetingStartStr += "\n";
meetingStartInternalStr += "\n";
// meetingStartInternalStr += "\n";
meetingEndStr += "\n";
meetingEndInternalStr += "\n";
// meetingEndInternalStr += "\n";
}
meetingDurationMinutesStr += `${meeting.duration}\n`;
if (meeting.location && meeting.location.building) {
Expand All @@ -86,11 +86,11 @@ export const scheduleToFullCSVString = (schedule: Schedule): string => {
}
roomCapacityStr += `${meeting.location.roomCapacity ?? ""}\n`;
daysStr += `${meeting.days.join("")}\n`;
monStr += `${meeting.days.includes(Day.Monday) ? "M" : ""}\n`;
tuesStr += `${meeting.days.includes(Day.Tuesday) ? "T" : ""}\n`;
wedStr += `${meeting.days.includes(Day.Wednesday) ? "W" : ""}\n`;
thursStr += `${meeting.days.includes(Day.Thursday) ? "TH" : ""}\n`;
friStr += `${meeting.days.includes(Day.Friday) ? "F" : ""}\n`;
// monStr += `${meeting.days.includes(Day.Monday) ? "M" : ""}\n`;
// tuesStr += `${meeting.days.includes(Day.Tuesday) ? "T" : ""}\n`;
// wedStr += `${meeting.days.includes(Day.Wednesday) ? "W" : ""}\n`;
// thursStr += `${meeting.days.includes(Day.Thursday) ? "TH" : ""}\n`;
// friStr += `${meeting.days.includes(Day.Friday) ? "F" : ""}\n`;
});
// Remove trailing newlines
meetingTimeStr = meetingTimeStr.slice(0, -1);
Expand All @@ -104,11 +104,11 @@ export const scheduleToFullCSVString = (schedule: Schedule): string => {
buildingAndRoomStr = buildingAndRoomStr.slice(0, -1);
roomCapacityStr = roomCapacityStr.slice(0, -1);
daysStr = daysStr.slice(0, -1);
monStr = monStr.slice(0, -1);
tuesStr = tuesStr.slice(0, -1);
wedStr = wedStr.slice(0, -1);
thursStr = thursStr.slice(0, -1);
friStr = friStr.slice(0, -1);
// monStr = monStr.slice(0, -1);
// tuesStr = tuesStr.slice(0, -1);
// wedStr = wedStr.slice(0, -1);
// thursStr = thursStr.slice(0, -1);
// friStr = friStr.slice(0, -1);
// Create strings for fields that need to be constructed
const termStr = getTermsStr(section);
const sectionNameStr = `${course.prefixes.length ? course.prefixes[0] : ""}-${
Expand All @@ -117,23 +117,14 @@ export const scheduleToFullCSVString = (schedule: Schedule): string => {
const courseLevelCodeStr = numericReg.test(course.number[0]) ? `${course.number[0]}00` : "";

// Construct a row in the output CSV
csvStr += `"${course.department ?? ""}",${termStr},${section.termStart ?? ""},${
section.year ?? ""
},"${sectionNameStr}","${course.prefixes.join("\n")}",${course.number},${
section.letter
},${courseLevelCodeStr},${section.studentHours > -1 ? section.studentHours : ""},${
section.facultyHours > -1 ? section.facultyHours : ""
},${section.used ?? ""},${section.day10Used ?? ""},${section.localMax ?? ""},${
section.globalMax ?? ""
},"${roomCapacityStr ?? ""}","${buildingAndRoomStr}","${daysStr}","${meetingTimeStr}",${
section.startDate ?? ""
},${section.endDate ?? ""},${
section.semesterLength ?? ""
},"${buildingStr}","${roomNumberStr}","${meetingStartStr}","${meetingStartInternalStr}","${meetingDurationMinutesStr}","${meetingEndStr}","${meetingEndInternalStr}","${monStr}","${tuesStr}","${wedStr}","${thursStr}","${friStr}","${
section.name ?? course.name
}","${section.instructors.join("\n")}","${section.status ?? ""}","${
section.instructionalMethod ?? ""
}","${section.comments ?? ""}","${section.timestamp ?? ""}"\n`;
csvStr += `"${course.department ?? ""}",${termStr
},"${course.prefixes.join("\n")}",${course.number},${section.letter
},${courseLevelCodeStr
},${section.studentHours > -1 ? section.studentHours : ""}, ${section.facultyHours > -1 ? section.facultyHours : ""},"${buildingAndRoomStr
}","${daysStr}","${meetingTimeStr}",${section.startDate ?? ""},${section.endDate ?? ""},${section.semesterLength ?? ""},"${buildingStr
}","${roomNumberStr}","${meetingStartStr}","${meetingDurationMinutesStr
}","${meetingEndStr}","${ section.name ?? course.name
}","${section.instructors.join("\n")}","${section.status ?? ""}","${section.instructionalMethod ?? "" }","${section.comments ?? ""}","${section.timestamp ?? ""}"\n`;
});
});
return csvStr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ const scrollToUpdatedFacultyRow = (instructor: string) => {

// a helper to provide consistent naming and retrieve error messages
export const useInput = <T>(label: string, errors: DeepMap<T, FieldError>) => {
// (temporary?) hack to match new labels to previously used labels
if (label === "Delivery Mode") { label = "Instructional Method" }
if (label === "Course Title") { label = "Name" }
const name = camelCase(label);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const errorMessage = (errors[name as keyof T] as any)?.message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export const mapInternalTypesToInput = (data?: CourseSectionMeeting): SectionInp
convertFromSemesterLength(data?.section.semesterLength) === SemesterLengthOption.HalfSemester
? data?.section.semesterLength
: SemesterLength.HalfFirst) as unknown) as Half,
instructionalMethod: data?.section.instructionalMethod ?? "LEC",
instructionalMethod: data?.section.instructionalMethod ?? "In-person",
instructor: data?.section.instructors ?? [],
intensiveSemester: ((data?.section.semesterLength &&
convertFromSemesterLength(data?.section.semesterLength) ===
Expand Down

0 comments on commit 4e91e7b

Please sign in to comment.