Repository navigation
Refactor Grid CoursePanel into Typescript React Components - #1830
Conversation
Coverage Report for CI Build 43685013005Coverage increased (+0.02%) to 61.618%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
… into ts-migrate-course_panel
david-yz-liu
left a comment
There was a problem hiding this comment.
Thanks @PeanutPiglet, I just left two inline comments
| * Also retrieves the course information. It holds list of F, S and Y lecture, tutorial | ||
| * and practical sections for the course. | ||
| */ | ||
|
|
There was a problem hiding this comment.
Do not include a blank line between the class docstring and the header (throughout)
| @@ -0,0 +1,210 @@ | |||
| import { useState, useEffect, useCallback } from "react" | |||
| import { getCourse } from "../common/utils" | |||
| import { SelectedLecture } from "./types" | |||
There was a problem hiding this comment.
throughout, use type-only imports for identifiers that are only imported for type annotations
| <h3 | ||
| onClick={toggleSelect} | ||
| data-satisfied="true" | ||
| data-taken={containsSelectedLecture() ? "true" : "false"} |
There was a problem hiding this comment.
@PeanutPiglet sorry I forgot about this when I published my review, but if this attribute is not actually used anywhere in the codebase, you can just remove it.
| unhoverLecture, | ||
| selectLecture, | ||
| displayInfo, | ||
| }: CourseProps) { |
There was a problem hiding this comment.
@PeanutPiglet Ah, looking at #1831, I realized I should have asked you to provide return type annotations for all of these components as well!
… into ts-migrate-course_panel
david-yz-liu
left a comment
There was a problem hiding this comment.
Nice work, @PeanutPiglet!
Proposed Changes
Refactored components previously in
js/components/grid/course_panel.js.jsxinto individual files.Migrated from javascript react (jsx) to typescript (tsx).
Appended previously missing fields to common frontend type.
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
(Include any questions or comments you have regarding your changes.)