Skip to content
Draft
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cf949fe
initial changes to Tables + migration script
Purplegaze May 19, 2026
dc460de
Merge branch 'master' of https://github.com/Courseography/courseograp…
Purplegaze May 19, 2026
f8ea373
changelog
Purplegaze May 21, 2026
aa12db7
Added tests for JSON parsing of Time' data type (#1706)
r-weng May 22, 2026
e21e084
Add tests for Database.Tables FromJSON Meeting instance (#1707)
AngelsandDevsLOL May 22, 2026
3a2ebe7
build(deps): bump tmp from 0.2.5 to 0.2.7 (#1717)
dependabot[bot] May 30, 2026
bc71bea
Refactored graph helper functions from Svg.Database to Models.Graph (…
r-weng May 31, 2026
61112ab
Updated documentation in Util.Blaze (#1719)
r-weng May 31, 2026
4921e7c
Refactored Building and Time functions into Models (#1718)
AngelsandDevsLOL Jun 2, 2026
70767e4
Removed SvgJSON data type (#1720)
r-weng Jun 3, 2026
150bafe
build(deps-dev): bump the jest group with 2 updates (#1724)
dependabot[bot] Jun 5, 2026
2bac4c6
build(deps): bump the babel group across 1 directory with 5 updates (…
dependabot[bot] Jun 6, 2026
432042e
Renamed Course data type to CourseData (#1721)
AngelsandDevsLOL Jun 7, 2026
14b37a4
Updated CS graph and config for 2026-27 (#1726)
david-yz-liu Jun 9, 2026
95edff2
Added privacy-preserving analytics using GoatCounter and updated priv…
david-yz-liu Jun 9, 2026
a46556b
build(deps): bump the react group across 1 directory with 2 updates (…
dependabot[bot] Jun 9, 2026
35a47ad
build(deps): bump the ag-grid group across 1 directory with 2 updates…
dependabot[bot] Jun 9, 2026
07281cf
build(deps): bump shell-quote from 1.8.3 to 1.8.4 (#1728)
dependabot[bot] Jun 9, 2026
8358a26
chore: Run yarn dedupe (#1729)
david-yz-liu Jun 9, 2026
fd7c78c
Update backend wiring
Purplegaze Jun 9, 2026
4129868
Update frontend wiring
Purplegaze Jun 9, 2026
97b1fa0
fix course controller tests
Purplegaze Jun 9, 2026
ba03e3e
add mini changelog
Purplegaze Jun 9, 2026
87f08d6
Merge branch 'y-course-refactor' into y-session-compilation
Purplegaze Jun 9, 2026
3f3894e
Release version 0.8.0 (#1730)
david-yz-liu Jun 9, 2026
5807048
fix shadowing in Models/Meeting
Purplegaze Jun 9, 2026
9fb3f60
Merge branch 'y-session-compilation' of https://github.com/Purplegaze…
Purplegaze Jun 9, 2026
69b0aab
fix getimages shadowing
Purplegaze Jun 9, 2026
56e925d
skip test instead of commenting it out
Purplegaze Jun 13, 2026
94819cd
rename fields
Purplegaze Jun 13, 2026
c445897
fix tests 2
Purplegaze Jun 13, 2026
ded4583
rename in frontend
Purplegaze Jun 13, 2026
31a48ae
Renamed Courses datatype and table to Course (#1732)
AngelsandDevsLOL Jun 17, 2026
054afb9
build(deps): bump launch-editor from 2.11.1 to 2.14.1 (#1733)
dependabot[bot] Jun 19, 2026
2a568d4
build(deps-dev): bump webpack-dev-server from 5.2.4 to 5.2.5 (#1734)
dependabot[bot] Jun 21, 2026
fca3906
build(deps): bump form-data from 4.0.4 to 4.0.6 (#1735)
dependabot[bot] Jun 21, 2026
112ebfb
build(deps): bump tar from 7.5.11 to 7.5.16 (#1736)
dependabot[bot] Jun 21, 2026
5b8463c
Changed background colour of application (#1737)
AngelsandDevsLOL Jun 22, 2026
81d6fb0
Merge branch 'master' of https://github.com/Courseography/courseograp…
Purplegaze Jun 23, 2026
4fbfb9d
resolve buildTimes
Purplegaze Jun 23, 2026
d06db08
resolve TablesTests
Purplegaze Jun 24, 2026
886a85e
Merge branch 'y-course-refactor' into y-session-parse
Purplegaze Jun 24, 2026
65528f6
fix duplicate changelog lines
Purplegaze Jun 24, 2026
881bfec
add Y session display logic (no tests yet)
Purplegaze Jun 24, 2026
09375f9
Merge branch 'y-course-refactor' of https://github.com/Courseography/…
Purplegaze Jun 27, 2026
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
135 changes: 120 additions & 15 deletions js/components/common/react_modal.js.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@ class CourseModal extends React.Component {
}
}

/* Generate the data needed for each row of the timetable based on course meeting times for
* each session F, S, Y.
/**
* Generate the data needed for the course modal table based on the meeting times corresponding
* to a course in a given session.
* @param allMeetingTimes An array of MeetTime' objects corresponding to a particular course.
* @param session The session (F, S, Y) to query.
* @returns A map containing the table data that will appear in the course modal.
*/
getTable(allMeetingTimes, session) {
const sessions = allMeetingTimes.filter(lec => lec.meetData.session === session)
Expand All @@ -144,6 +148,7 @@ class CourseModal extends React.Component {

return sortedSessions.map(lecture => {
const occurrences = { times: [], locations: [] }
const yearOccurrences = {fallTimes: [], fallLocations: [], winterTimes: [], winterLocations: []}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use two different variables (occurrences and yearOccurrences). Stick with one object with keys times1, locations1, times2, locations2. Use just times1 and locations1 for fall and winter courses, and both locations for year-long courses.

This will let you simplify the logic below (times1/locations1 are updated in all cases except when session === "Y" && occurences.timeSession.endsWith("1")

const sortedTimeData = lecture.timeData.sort((occ1, occ2) =>
occ1.weekDay > occ2.weekDay ? 1 : -1
)
Expand All @@ -152,14 +157,42 @@ class CourseModal extends React.Component {
if (occurrence.timeLocation !== null && occurrence.timeLocation !== undefined) {
location = occurrence.timeLocation.buildingCode
}
occurrences.locations.push(location)
occurrences.times.push(
DAY_TO_INT[occurrence.weekDay] +
" " +
occurrence.startHour +
" - " +
occurrence.endHour
)

// Time and location formatting for Y session courses
if (session === "Y") {
if (occurrence.timeSession.endsWith("9")) {
yearOccurrences.fallLocations.push(location)
yearOccurrences.fallTimes.push(
DAY_TO_INT[occurrence.weekDay].substring(0, 3) +
" " +
occurrence.startHour +
" - " +
occurrence.endHour
)
}
else {
yearOccurrences.winterLocations.push(location)
yearOccurrences.winterTimes.push(
DAY_TO_INT[occurrence.weekDay].substring(0, 3) +
" " +
occurrence.startHour +
" - " +
occurrence.endHour
)
}
}

// Time and location formatting for F/S courses
else {
occurrences.locations.push(location)
occurrences.times.push(
DAY_TO_INT[occurrence.weekDay] +
" " +
occurrence.startHour +
" - " +
occurrence.endHour
)
}
})
const rowData = {
activity: lecture.meetData.section,
Expand All @@ -169,10 +202,14 @@ class CourseModal extends React.Component {
lecture.meetData.enrol +
" of " +
lecture.meetData.cap +
" available",
(session === "Y" ? "" : " available"), // Account for shortened column width for Y courses

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't shorten this column text. We can play with the width of the modal to make it wider

waitList: lecture.meetData.wait + " students",
time: occurrences.times,
location: occurrences.locations,
fallTime: yearOccurrences.fallTimes,
fallLocation: yearOccurrences.fallLocations,
winterTime: yearOccurrences.winterTimes,
winterLocation: yearOccurrences.winterLocations
}

return rowData
Expand Down Expand Up @@ -269,10 +306,12 @@ class Description extends React.Component {
<AgGridReact
rowData={this.props.sessions[session]}
columnDefs={[
{ field: "activity", width: 130 },
{ field: "instructor", width: 190 },
{ field: "availability", width: 180 },
{ field: "waitList", width: 130 },
{ field: "activity", width: session === "Y" ? 100 : 130 },
{ field: "instructor", width: session === "Y" ? 172 : 190 },
{ field: "availability", width: session === "Y" ? 130 : 180 },
{ field: "waitList", width: session === "Y" ? 120 : 130 },

/* Single-session occurrence columns */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to my above comment, use one set of columns (times1, locations1, times2, locations2), showing only the first two for fall/winter sessions.

You can make the column header names conditional on whether a fall/winter or full-year session is being displayed by using the headerName field.

{
field: "time",
cellStyle: {
Expand All @@ -284,6 +323,7 @@ class Description extends React.Component {
valueFormatter: col => col.data.time.join("\n"),
width: 180,
autoHeight: true,
hide: session === "Y",
},
{
field: "location",
Expand All @@ -296,6 +336,71 @@ class Description extends React.Component {
valueFormatter: col => col.data.location.join("\n"),
width: 128,
autoHeight: true,
hide: session === "Y"
},

/* Y session occurrence columns */
{
field: "fallTime",
cellStyle: {
whiteSpace: "pre",
lineHeight: "1.8",
paddingTop: "7px",
paddingBottom: "6px",
},
valueFormatter: col => col.data.fallTime.join("\n"),
width: 115,
autoHeaderHeight: false,
autoHeight: true,
wrapHeaderText: true,
autoHeaderHeight: true,
hide: session !== "Y",
},
{
field: "fallLocation",
cellStyle: {
whiteSpace: "pre",
lineHeight: "1.8",
paddingTop: "7px",
paddingBottom: "6px",
},
valueFormatter: col => col.data.fallLocation.join("\n"),
width: 93,
autoHeaderHeight: false,
autoHeight: true,
wrapHeaderText: true,
autoHeaderHeight: true,
hide: session !== "Y",
},
{
field: "winterTime",
cellStyle: {
whiteSpace: "pre",
lineHeight: "1.8",
paddingTop: "7px",
paddingBottom: "6px",
},
valueFormatter: col => col.data.winterTime.join("\n"),
width: 115,
autoHeight: true,
wrapHeaderText: true,
autoHeaderHeight: true,
hide: session !== "Y",
},
{
field: "winterLocation",
cellStyle: {
whiteSpace: "pre",
lineHeight: "1.8",
paddingTop: "7px",
paddingBottom: "6px",
},
valueFormatter: col => col.data.winterLocation.join("\n"),
width: 93,
autoHeight: true,
wrapHeaderText: true,
autoHeaderHeight: true,
hide: session !== "Y",
},
]}
domLayout="autoHeight"
Expand Down