From 7344397d9580430fca900641213d1b40bcb74fe0 Mon Sep 17 00:00:00 2001 From: Christin322 <78027463+Christin322@users.noreply.github.com> Date: Fri, 4 Oct 2024 12:19:20 +1000 Subject: [PATCH 1/2] Bugfix/uni 315 text overflow (#318) * Fixed overflowing word --------- --- backend/src/repositories/course.repository.ts | 2 ++ .../TruncatedDescription.tsx | 3 ++- migration/Dockerfile | 2 +- migration/src/migrate/repository.ts | 20 +------------------ 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/backend/src/repositories/course.repository.ts b/backend/src/repositories/course.repository.ts index 51b571bb5..620ff19a7 100644 --- a/backend/src/repositories/course.repository.ts +++ b/backend/src/repositories/course.repository.ts @@ -4,6 +4,8 @@ import { CourseCodeSchema, CourseSchema, } from "../api/schemas/course.schema"; +import e from "express"; +import { Console } from "console"; export class CourseRepository { constructor(private readonly prisma: PrismaClient) {} diff --git a/frontend/src/components/TruncatedDescription/TruncatedDescription.tsx b/frontend/src/components/TruncatedDescription/TruncatedDescription.tsx index e08fa3074..dcf3fa607 100644 --- a/frontend/src/components/TruncatedDescription/TruncatedDescription.tsx +++ b/frontend/src/components/TruncatedDescription/TruncatedDescription.tsx @@ -35,6 +35,7 @@ export default function TruncatedDescription({ newMax++; index++; } + if (index === content.length) { setShortenedContent(content); } else { @@ -50,7 +51,7 @@ export default function TruncatedDescription({ }, [content]) return ( -
+

{showFullContent ? content : shortenedContent}

diff --git a/migration/Dockerfile b/migration/Dockerfile index 27a01a5af..8bc0fdefc 100644 --- a/migration/Dockerfile +++ b/migration/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.2-alpine +FROM node:20.4-alpine # Set the current working directory inside the container WORKDIR /app diff --git a/migration/src/migrate/repository.ts b/migration/src/migrate/repository.ts index cb93b0d49..9dfd8089e 100644 --- a/migration/src/migrate/repository.ts +++ b/migration/src/migrate/repository.ts @@ -88,25 +88,7 @@ export default class MigrationRepository { "terms", "title", "uoc", - "rating", - "archived", - "attributes", - "calendar", - "campus", - "description", - "enrolment_rules", - "equivalents", - "exclusions", - "faculty", - "field_of_education", - "gen_ed", - "level", - "school", - "study_level", - "terms", - "title", - "uoc", - "rating", + "rating" ], ["course_code"], { skipUpdateIfNoValuesChanged: true }, From 5676c5364101e1436ce58b29426e40b523393acb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 22:14:48 +0000 Subject: [PATCH 2/2] chore(deps): update dependency @types/node to v20 --- frontend/package-lock.json | 18 ++++++++++++++---- frontend/package.json | 2 +- migration/package-lock.json | 30 +++++++++++++++++++++++------- migration/package.json | 2 +- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index aa9765192..761eb9328 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@headlessui/react": "^1.7.14", "@heroicons/react": "^2.0.18", - "@types/node": "18.15.11", + "@types/node": "20.17.2", "@types/react": "18.0.31", "@types/react-dom": "18.0.11", "date-fns": "^2.30.0", @@ -539,9 +539,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==" + "version": "20.17.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.2.tgz", + "integrity": "sha512-OOHK4sjXqkL7yQ7VEEHcf6+0jSvKjWqwnaCtY7AKD/VLEvRHMsxxu7eI8ErnjxHS8VwmekD4PeVCpu4qZEZSxg==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } }, "node_modules/@types/prop-types": { "version": "15.7.5", @@ -5387,6 +5391,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT" + }, "node_modules/untildify": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index 48b0bef7d..64ebe3b18 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,7 +12,7 @@ "dependencies": { "@headlessui/react": "^1.7.14", "@heroicons/react": "^2.0.18", - "@types/node": "18.15.11", + "@types/node": "20.17.2", "@types/react": "18.0.31", "@types/react-dom": "18.0.11", "date-fns": "^2.30.0", diff --git a/migration/package-lock.json b/migration/package-lock.json index 2fe79f9a8..88b88fda0 100644 --- a/migration/package-lock.json +++ b/migration/package-lock.json @@ -18,7 +18,7 @@ "devDependencies": { "@eslint/js": "^9.2.0", "@types/express": "^4.17.14", - "@types/node": "^18.7.18", + "@types/node": "^20.0.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "globals": "^15.2.0", @@ -1063,9 +1063,12 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.7.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.18.tgz", - "integrity": "sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg==" + "version": "20.17.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.2.tgz", + "integrity": "sha512-OOHK4sjXqkL7yQ7VEEHcf6+0jSvKjWqwnaCtY7AKD/VLEvRHMsxxu7eI8ErnjxHS8VwmekD4PeVCpu4qZEZSxg==", + "dependencies": { + "undici-types": "~6.19.2" + } }, "node_modules/@types/qs": { "version": "6.9.7", @@ -4792,6 +4795,11 @@ } } }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -5849,9 +5857,12 @@ "dev": true }, "@types/node": { - "version": "18.7.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.18.tgz", - "integrity": "sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg==" + "version": "20.17.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.2.tgz", + "integrity": "sha512-OOHK4sjXqkL7yQ7VEEHcf6+0jSvKjWqwnaCtY7AKD/VLEvRHMsxxu7eI8ErnjxHS8VwmekD4PeVCpu4qZEZSxg==", + "requires": { + "undici-types": "~6.19.2" + } }, "@types/qs": { "version": "6.9.7", @@ -8337,6 +8348,11 @@ "@typescript-eslint/utils": "7.8.0" } }, + "undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", diff --git a/migration/package.json b/migration/package.json index 15e1dab24..5b34fa44c 100644 --- a/migration/package.json +++ b/migration/package.json @@ -21,7 +21,7 @@ "devDependencies": { "@eslint/js": "^9.2.0", "@types/express": "^4.17.14", - "@types/node": "^18.7.18", + "@types/node": "^20.0.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "globals": "^15.2.0",