Add logic for displaying Y session courses in the course modal#1740
Add logic for displaying Y session courses in the course modal#1740Purplegaze wants to merge 45 commits into
Conversation
… into y-session-fix
Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.5 to 0.2.7. - [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md) - [Commits](raszi/node-tmp@v0.2.5...v0.2.7) --- updated-dependencies: - dependency-name: tmp dependency-version: 0.2.7 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Replaced SvgJSON with ([Text], [Shape], [Path]) instead.
Bumps the jest group with 2 updates: [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest) and [jest-environment-jsdom](https://github.com/jestjs/jest/tree/HEAD/packages/jest-environment-jsdom). Updates `jest` from 30.3.0 to 30.4.2 - [Release notes](https://github.com/jestjs/jest/releases) - [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jestjs/jest/commits/v30.4.2/packages/jest) Updates `jest-environment-jsdom` from 30.3.0 to 30.4.1 - [Release notes](https://github.com/jestjs/jest/releases) - [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jestjs/jest/commits/v30.4.1/packages/jest-environment-jsdom) --- updated-dependencies: - dependency-name: jest dependency-version: 30.4.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: jest - dependency-name: jest-environment-jsdom dependency-version: 30.4.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: jest ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ourseography#1723) Bumps the babel group with 5 updates in the / directory: | Package | From | To | | --- | --- | --- | | [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) | `7.29.2` | `7.29.7` | | [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) | `7.29.0` | `7.29.7` | | [@babel/eslint-parser](https://github.com/babel/babel/tree/HEAD/eslint/babel-eslint-parser) | `7.28.6` | `7.29.7` | | [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) | `7.29.3` | `7.29.7` | | [@babel/preset-react](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-react) | `7.28.5` | `7.29.7` | Updates `@babel/runtime` from 7.29.2 to 7.29.7 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.29.7/packages/babel-runtime) Updates `@babel/core` from 7.29.0 to 7.29.7 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.29.7/packages/babel-core) Updates `@babel/eslint-parser` from 7.28.6 to 7.29.7 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.29.7/eslint/babel-eslint-parser) Updates `@babel/preset-env` from 7.29.3 to 7.29.7 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.29.7/packages/babel-preset-env) Updates `@babel/preset-react` from 7.28.5 to 7.29.7 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.29.7/packages/babel-preset-react) --- updated-dependencies: - dependency-name: "@babel/core" dependency-version: 7.29.7 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: babel - dependency-name: "@babel/eslint-parser" dependency-version: 7.29.7 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: babel - dependency-name: "@babel/preset-env" dependency-version: 7.29.7 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: babel - dependency-name: "@babel/preset-react" dependency-version: 7.29.7 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: babel - dependency-name: "@babel/runtime" dependency-version: 7.29.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: babel ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ourseography#1700) Bumps the react group with 2 updates in the / directory: [react](https://github.com/facebook/react/tree/HEAD/packages/react) and [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom). Updates `react` from 19.2.4 to 19.2.7 - [Release notes](https://github.com/facebook/react/releases) - [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/react/commits/v19.2.7/packages/react) Updates `react-dom` from 19.2.4 to 19.2.7 - [Release notes](https://github.com/facebook/react/releases) - [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/react/commits/v19.2.7/packages/react-dom) --- updated-dependencies: - dependency-name: react dependency-version: 19.2.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: react - dependency-name: react-dom dependency-version: 19.2.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: react ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…Courseography#1697) Bumps the ag-grid group with 2 updates in the / directory: [ag-grid-community](https://github.com/ag-grid/ag-grid) and [ag-grid-react](https://github.com/ag-grid/ag-grid). Updates `ag-grid-community` from 35.2.0 to 35.3.1 - [Release notes](https://github.com/ag-grid/ag-grid/releases) - [Commits](ag-grid/ag-grid@release-35.2.0...release-35.3.1) Updates `ag-grid-react` from 35.2.0 to 35.3.1 - [Release notes](https://github.com/ag-grid/ag-grid/releases) - [Commits](ag-grid/ag-grid@release-35.2.0...release-35.3.1) --- updated-dependencies: - dependency-name: ag-grid-community dependency-version: 35.2.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ag-grid - dependency-name: ag-grid-react dependency-version: 35.2.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ag-grid ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [shell-quote](https://github.com/ljharb/shell-quote) from 1.8.3 to 1.8.4. - [Changelog](https://github.com/ljharb/shell-quote/blob/main/CHANGELOG.md) - [Commits](ljharb/shell-quote@v1.8.3...v1.8.4) --- updated-dependencies: - dependency-name: shell-quote dependency-version: 1.8.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…/courseography into y-session-compilation test
…1733) Bumps [launch-editor](https://github.com/vitejs/launch-editor) from 2.11.1 to 2.14.1. - [Commits](vitejs/launch-editor@v2.11.1...v2.14.1) --- updated-dependencies: - dependency-name: launch-editor dependency-version: 2.14.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…graphy#1734) Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 5.2.4 to 5.2.5. - [Release notes](https://github.com/webpack/webpack-dev-server/releases) - [Changelog](https://github.com/webpack/webpack-dev-server/blob/main/CHANGELOG.md) - [Commits](webpack/webpack-dev-server@v5.2.4...v5.2.5) --- updated-dependencies: - dependency-name: webpack-dev-server dependency-version: 5.2.5 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [form-data](https://github.com/form-data/form-data) from 4.0.4 to 4.0.6. - [Changelog](https://github.com/form-data/form-data/blob/master/CHANGELOG.md) - [Commits](form-data/form-data@v4.0.4...v4.0.6) --- updated-dependencies: - dependency-name: form-data dependency-version: 4.0.6 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.11 to 7.5.16. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v7.5.11...v7.5.16) --- updated-dependencies: - dependency-name: tar dependency-version: 7.5.16 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… into y-session-parse
…courseography into y-session-parse2
david-yz-liu
left a comment
There was a problem hiding this comment.
@Purplegaze nice work and sorry for the delay in reviewing this. I left a few comments, but overall I think you're on the right track; I like the approach of showing the time/location information for full-year courses as separate columns.
|
|
||
| return sortedSessions.map(lecture => { | ||
| const occurrences = { times: [], locations: [] } | ||
| const yearOccurrences = {fallTimes: [], fallLocations: [], winterTimes: [], winterLocations: []} |
There was a problem hiding this comment.
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")
| " of " + | ||
| lecture.meetData.cap + | ||
| " available", | ||
| (session === "Y" ? "" : " available"), // Account for shortened column width for Y courses |
There was a problem hiding this comment.
Don't shorten this column text. We can play with the width of the modal to make it wider
| { field: "availability", width: session === "Y" ? 130 : 180 }, | ||
| { field: "waitList", width: session === "Y" ? 120 : 130 }, | ||
|
|
||
| /* Single-session occurrence columns */ |
There was a problem hiding this comment.
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.
|
Oh and @Purplegaze please do not make additional modifications to variable names in this PR; doing so will obscure the logical changes that are currently shown. |


Proposed Changes
Draft PR to add logic for displaying Y course timetable info. Tests are not yet updated.
Sorry for the clutter with the "Files changed" section of this PR right now caused by the merge from master being left over. I tried to split the changes off of this branch to prevent it, but somehow that caused issues that severed the whole database connection, so I'm just gonna leave it like this and wait until #1739 gets merged.The only changes to review here are in
react_modal.js.jsx....
Screenshots of your changes (if applicable)
Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]into a[x]in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
See below.