From 7c621727680749b76adfca1c44856a601408082e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 18:03:51 +0000 Subject: [PATCH 1/4] Bump cross-spawn from 7.0.3 to 7.0.6 Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6. - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a4e37f4..b5c0cb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7003,9 +7003,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", From d0ca5f7dc57b2f78da6a132055366beeef2b307a Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Tue, 3 Dec 2024 12:13:52 -0600 Subject: [PATCH 2/4] Fix loading jumping --- src/components/CourseOverview.tsx | 22 ++++++++++++-------- src/components/SearchResultsTable.tsx | 18 ++++++++--------- src/components/SingleProfInfo.tsx | 29 ++++++++++++++++----------- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/src/components/CourseOverview.tsx b/src/components/CourseOverview.tsx index 34b99aa..b06f149 100644 --- a/src/components/CourseOverview.tsx +++ b/src/components/CourseOverview.tsx @@ -1,3 +1,4 @@ +import { Skeleton } from '@mui/material'; import React from 'react'; import { TRENDS_URL } from '~data/config'; @@ -11,15 +12,20 @@ type CourseOverviewProps = { const CourseOverview = ({ course, grades }: CourseOverviewProps) => { return ( -
-

+

+

{searchQueryLabel(course)}

- {grades.state === 'done' && ( -

- {'Overall grade: ' + grades.data.letter_grade} -

- )} + {(grades.state === 'loading' && ( + +

Overall grade: A+

+
+ )) || + (grades.state === 'done' && ( +

+ {'Overall grade: ' + grades.data.letter_grade} +

+ ))} { encodeURIComponent(searchQueryLabel(course)) } target="_blank" - className="underline text-blue-600 hover:text-blue-800 visited:text-purple-600 text-center" + className="underline text-blue-600 hover:text-blue-800 visited:text-purple-600" rel="noreferrer" > See on Trends diff --git a/src/components/SearchResultsTable.tsx b/src/components/SearchResultsTable.tsx index 1b40772..be7a060 100644 --- a/src/components/SearchResultsTable.tsx +++ b/src/components/SearchResultsTable.tsx @@ -117,16 +117,16 @@ function Row({ course, grades, backupGrades, rmp, setPage }: RowProps) { - + {((typeof grades === 'undefined' || grades.state === 'error') && (((typeof backupGrades === 'undefined' || backupGrades.state === 'error') && <>) || (backupGrades.state === 'loading' && ( - A + A+ )) || (backupGrades.state === 'done' && ( @@ -155,7 +155,7 @@ function Row({ course, grades, backupGrades, rmp, setPage }: RowProps) { } > - A + A+ )) || (grades.state === 'done' && ( @@ -179,7 +179,7 @@ function Row({ course, grades, backupGrades, rmp, setPage }: RowProps) { placement="top" > {grades.data.letter_grade} @@ -188,10 +188,10 @@ function Row({ course, grades, backupGrades, rmp, setPage }: RowProps) { )) || null} - + {((typeof rmp === 'undefined' || rmp.state === 'error') && <>) || (rmp.state === 'loading' && ( - + )) || diff --git a/src/components/SingleProfInfo.tsx b/src/components/SingleProfInfo.tsx index b6eef84..414a9cb 100644 --- a/src/components/SingleProfInfo.tsx +++ b/src/components/SingleProfInfo.tsx @@ -16,29 +16,34 @@ function SingleProfInfo({ rmp }: Props) { return ( -

- -

+ +

5.0

+

Professor rating

-

- -

+ +

5.0

+

Difficulty

-

- -

+ +

1,000

+

Ratings given

-

- -

+ +

99%

+

Would take again

+ + +

Visit Rate My Professors

+
+
); } From d268e8781de72719b41aa70ffa17a671931b0698 Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Tue, 3 Dec 2024 12:16:42 -0600 Subject: [PATCH 3/4] Format --- src/components/CourseOverview.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/CourseOverview.tsx b/src/components/CourseOverview.tsx index b06f149..73050d3 100644 --- a/src/components/CourseOverview.tsx +++ b/src/components/CourseOverview.tsx @@ -13,9 +13,7 @@ type CourseOverviewProps = { const CourseOverview = ({ course, grades }: CourseOverviewProps) => { return (
-

- {searchQueryLabel(course)} -

+

{searchQueryLabel(course)}

{(grades.state === 'loading' && (

Overall grade: A+

From 9f2ad55cdec3e5eca993334e087e65d3955abe88 Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Tue, 3 Dec 2024 12:28:44 -0600 Subject: [PATCH 4/4] Display RMP tags --- src/components/SearchResultsTable.tsx | 30 ++++++++++++--- src/components/SingleProfInfo.tsx | 55 ++++++++++++++++++++++++++- 2 files changed, 77 insertions(+), 8 deletions(-) diff --git a/src/components/SearchResultsTable.tsx b/src/components/SearchResultsTable.tsx index 1b40772..a77a3f7 100644 --- a/src/components/SearchResultsTable.tsx +++ b/src/components/SearchResultsTable.tsx @@ -72,14 +72,32 @@ function Row({ course, grades, backupGrades, rmp, setPage }: RowProps) { className="cursor-pointer" > - e.stopPropagation() // prevents opening/closing the card when clicking on the text + 0 + ? 'Tags: ' + + rmp.data.teacherRatingTags + .sort((a, b) => b.tagCount - a.tagCount) + .slice(0, 3) + .map((tag) => tag.tagName) + .join(', ') + : 'No Tags Available') } - className="leading-tight text-lg text-gray-600 dark:text-gray-200" + placement="top" > - {searchQueryLabel(convertToProfOnly(course))} - + e.stopPropagation() // prevents opening/closing the card when clicking on the text + } + className="leading-tight text-lg text-gray-600 dark:text-gray-200 cursor-text w-fit" + > + {searchQueryLabel(convertToProfOnly(course))} + + @@ -42,6 +46,13 @@ function SingleProfInfo({ rmp }: Props) { ); } + + const topTags = rmp.data.teacherRatingTags.sort( + (a, b) => b.tagCount - a.tagCount, + ); + const first5 = topTags.slice(0, 5); + const next5 = topTags.slice(5, 10); + return ( @@ -64,6 +75,46 @@ function SingleProfInfo({ rmp }: Props) {

Would take again

+ + {first5.length > 0 && ( + +
+ {first5.map((tag, index) => ( + + ))} + {next5.length > 0 && ( + <> + {next5.map((tag, index) => ( + + + + ))} + setShowMore(!showMore)} + > + + + + )} +
+
+ )} +