Skip to content

Commit

Permalink
Bugfix/uni 315 text overflow (#322)
Browse files Browse the repository at this point in the history
* feat: update devsoc branding references (#260)

* chore(landing): update landing meta description

* Update README.md

* Merge Develop To Main (#289)

* fix: added schema (#285)

Added Offers and hasCourseInstance schema to the metadata of courses
Schema Docs: https://developers.google.com/search/docs/appearance/structured-data/course-info#structured-data-type-definitions

* fix: UNI-278 add else branch in getInitialDisplayCourses to reset search bar state (#284)

---------

Co-authored-by: 3syth <[email protected]>
Co-authored-by: Adrian Balbalosa <[email protected]>

* Feature/uni 274 sponsor logos (#283)

* chore(logos): add jane street and tiktok svgs

* feat(sponsors): add sponsors to hero section

* feat(heading): add sponsored by heading and fix padding

* fix(height): fix height on smaller screens

* fix(quotes): replace single quotes with double quotes

* fix: truncated reviews and t&c (#290)

* fix: added schema (#285)

Added Offers and hasCourseInstance schema to the metadata of courses
Schema Docs: https://developers.google.com/search/docs/appearance/structured-data/course-info#structured-data-type-definitions

* fix: UNI-278 add else branch in getInitialDisplayCourses to reset search bar state (#284)

* chore/uni-270-desc-and-tnc-fix (#279)

* feat: update devsoc branding references (#260)

* chore(landing): update landing meta description

* Update README.md

* fixed truncated descriptions

* deleted some useless code

* Fixed some eedge cases and added comments

* reverted some old changes regarding fetching reviews

* Merge Develop To Main (#289)

* fix: added schema (#285)

Added Offers and hasCourseInstance schema to the metadata of courses
Schema Docs: https://developers.google.com/search/docs/appearance/structured-data/course-info#structured-data-type-definitions

* fix: UNI-278 add else branch in getInitialDisplayCourses to reset search bar state (#284)

---------

Co-authored-by: 3syth <[email protected]>
Co-authored-by: Adrian Balbalosa <[email protected]>

* Fixed bug of review card showing another review's description

* removed inline from review desc

---------

Co-authored-by: Bob Chen <[email protected]>
Co-authored-by: Jared L <[email protected]>
Co-authored-by: Dylan W <[email protected]>
Co-authored-by: eaglethrost <[email protected]>
Co-authored-by: Dimas Putra Anugerah <[email protected]>
Co-authored-by: 3syth <[email protected]>
Co-authored-by: Adrian Balbalosa <[email protected]>

---------

Co-authored-by: 3syth <[email protected]>
Co-authored-by: Adrian Balbalosa <[email protected]>
Co-authored-by: Maximilian Falco Widjaya <[email protected]>
Co-authored-by: Bob Chen <[email protected]>
Co-authored-by: Jared L <[email protected]>
Co-authored-by: Dylan W <[email protected]>

* chore: 271 (added sitemap) & 287 (setup linters) (#294)

* Chore/uni 271 sitemap xml (#293)

* finished code to generate the sitemap (using temp data currently)

* fixed branch name

* added api to get a list of all courses and updated swagger.json to include this route

* changed name of all courses api

* fixed the inconsistent names when logging info on /courses/all

* generated sitemap in both root and frontend folder

* removed sitemap.ts from root (was moved to frontend so we could generate the xml)

* moved sitemap to public folder

---------

Co-authored-by: lightAndTangy <[email protected]>

* chore: UNI-287 Set up linter and formatter (#291)

* install prettier and add configs, uninstall eslint-plugin-prettier for backend

* move eslint to dev dependencies in frontend

* install and configure prettier and eslint-config-prettier

* install eslint for migration package

* install and configure prettier for migration package

* add lint command to package.json in migration

---------

Co-authored-by: Adrian Balbalosa <[email protected]>

* merge linting gh actions (#303)

chore: UNI-292 linting GitHub actions (#295)

* add ci for migration

* add 'npm run format' command to all three packages

* remove all instances of any type being used in migration

* remove logger in migration service

Co-authored-by: Adrian Balbalosa <[email protected]>

* bugfix: load more courses & login button missing (#307)

* Bugfix/uni 304 load courses (#305)

* UNI-304: changed layout screen height

* UNI-304: course titles set to not break

---------

Co-authored-by: dylan <birds@DylanW-PC>
Co-authored-by: Dylan <[email protected]>

---------

* feature/uni 261 filter button (#308)

* Feature/uni 261 filter button (#306)

* filter modal and tried to implement the api

* deleted file

* made the filter modal look nicer

* rearranged buttons and repsonsiveness of it

* finished the frontend of the filter button

---------

* help fix pls xD

* attempt to make backend work

* save curr progress

* query works with hardcoded terms

* working draft

* trying to fix sql query (remove unsafe)

* combined search and filters together

* deleted search functions

* commented out all the search functions

* fixed canberra bug

* merge linting gh actions (#303)

chore: UNI-292 linting GitHub actions (#295)

* add ci for migration

* add 'npm run format' command to all three packages

* remove all instances of any type being used in migration

* remove logger in migration service

Co-authored-by: Adrian Balbalosa <[email protected]>

* uncommented search and fixed responsiveness and added semesters

* removed console logs

* fixed any type

* UNI-304: changed layout screen height

* UNI-304: course titles set to not break

* working filter function

* added dark mode

* added hover over buttons

* fixed type

* fix filter object type

* bugfix: load more courses & login button missing (#307)

* Bugfix/uni 304 load courses (#305)

* UNI-304: changed layout screen height

* UNI-304: course titles set to not break

---------

Co-authored-by: dylan <birds@DylanW-PC>
Co-authored-by: Dylan <[email protected]>

---------

* fixed not offered issue

---------

* fix: filter buttons too tall in safari

* Revert "fix: filter buttons too tall in safari"

This reverts commit 7547be2.

* fix: fixed filter buttons too tall in safari

---------

* feat: upgrade migration node to 20.4, fixed migration upsert query to remove duplicate columns

* Fixed overflowing word

* Added self-hosted Plausible script (#320)

added self-hosted plausible script

* Update layout.tsx

* fixed text overflow

---------

Co-authored-by: Bob Chen <[email protected]>
Co-authored-by: Jared L <[email protected]>
Co-authored-by: Dylan W <[email protected]>
Co-authored-by: eaglethrost <[email protected]>
Co-authored-by: Dimas Putra Anugerah <[email protected]>
Co-authored-by: 3syth <[email protected]>
Co-authored-by: Adrian Balbalosa <[email protected]>
Co-authored-by: ur-ja <[email protected]>
Co-authored-by: Maximilian Falco Widjaya <[email protected]>
Co-authored-by: dylan <birds@DylanW-PC>
  • Loading branch information
11 people authored Oct 29, 2024
1 parent 7344397 commit 6f98835
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
54 changes: 27 additions & 27 deletions frontend/src/app/course/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function generateMetadata(props: {
};
}): Promise<Metadata> {
const { course } = (await get(
`/course/${props.params.id.toUpperCase()}`
`/course/${props.params.id.toUpperCase()}`,
)) as {
course: Course;
};
Expand All @@ -50,7 +50,7 @@ export default async function ReviewPage({
if (!course) notFound();

const { reviews } = (await get(
`/reviews/${course.courseCode.toUpperCase()}`
`/reviews/${course.courseCode.toUpperCase()}`,
)) as Reviews;

let userCourseInfo: string[] = [];
Expand All @@ -60,7 +60,7 @@ export default async function ReviewPage({
"GET",
`/user/course/${params.id.toUpperCase()}`,
session?.user?.accessToken ?? "",
session?.user?.id ?? ""
session?.user?.id ?? "",
)) as { userCourseInfo: string[] };
userCourseInfo = res.userCourseInfo;
} catch (err) {
Expand Down Expand Up @@ -91,7 +91,7 @@ export default async function ReviewPage({
// };

return (
<div className='isolate bg-white dark:bg-slate-800 duration-150'>
<div className="isolate bg-white dark:bg-slate-800 duration-150">
{/* Structured data */}
<Head>
<script
Expand Down Expand Up @@ -119,53 +119,53 @@ export default async function ReviewPage({
/>
</Head>
{/* Header */}
<div className='relative'>
<div className='w-1/2 ml-auto md:w-full pr-16 md:px-8 py-8'>
<div className="relative">
<div className="w-1/2 ml-auto md:w-full pr-16 md:px-8 py-8">
{/* Search bar */}
<ReviewSearchbar />
</div>
{/* Waves */}
<Image
className='w-full h-full absolute object-cover top-0 -z-10 dark:opacity-75'
className="w-full h-full absolute object-cover top-0 -z-10 dark:opacity-75"
src={waves}
alt='Waves'
alt="Waves"
/>
</div>
{/* Course details */}
<div className='flex gap-8 pt-12 px-16 md:px-8 lg:pt-8 md:flex-wrap'>
<div className="flex gap-8 pt-12 px-16 md:px-8 lg:pt-8 md:flex-wrap">
<Suspense fallback={<div>Loading...</div>}>
{/* <script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(metaLD) }}
/> */}
<section className='space-y-4 w-full block md:static md:max-h-full sticky top-8 max-h-[calc(100vh-4rem)] overflow-y-scroll scrollbar-none'>
<h1 className='text-6xl font-bold break-words'>
<section className="space-y-4 w-full block md:static md:max-h-full sticky top-8 max-h-[calc(100vh-4rem)] overflow-y-scroll scrollbar-none">
<h1 className="text-6xl font-bold break-words">
{course.courseCode}
</h1>
<h2 className='text-3xl font-bold break-words'>{course.title}</h2>
<h2 className="text-3xl font-bold break-words">{course.title}</h2>
{/* Terms */}
<TermsGroup
className='py-1 px-2 rounded-full bg-unilectives-tags-pink font-bold text-black/50'
className="py-1 px-2 rounded-full bg-unilectives-tags-pink font-bold text-black/50"
terms={course.terms}
/>
{/* Link to handbook */}
<Link
target='_blank'
rel='noopener noreferrer'
target="_blank"
rel="noopener noreferrer"
href={`//www.handbook.unsw.edu.au/undergraduate/courses/${new Date().getFullYear()}/${
course.courseCode
}`}
className='flex items-center w-fit gap-1 text-unilectives-blue hover:underline flex-1'
className="flex items-center w-fit gap-1 text-unilectives-blue hover:underline flex-1"
>
<LinkIcon className='w-4 h-4' />
<LinkIcon className="w-4 h-4" />
{course.courseCode} Handbook Page
</Link>
{/* StarRating */}
<div className='space-x-2'>
<div className='text-2xl inline'>
<div className="space-x-2">
<div className="text-2xl inline">
<Rating
type='star'
color='purple'
type="star"
color="purple"
overallRating={course.overallRating}
/>
</div>
Expand All @@ -182,7 +182,7 @@ export default async function ReviewPage({
</span>
</div>
{/* Doughnut Charts */}
<div className='flex flex-wrap justify-around'>
<div className="flex flex-wrap justify-around">
{[
{ metric: course.enjoyability, title: "Enjoyment" },
{ metric: course.usefulness, title: "Usefulness" },
Expand All @@ -194,30 +194,30 @@ export default async function ReviewPage({
width={90}
strokeWidth={9}
/>
<p className='text-center font-bold'>{item.title}</p>
<p className="text-center font-bold">{item.title}</p>
</div>
))}
</div>
{/* Pre-requisites group */}
{course.enrolmentRules ? (
<div>
<h3 className='font-bold'>Enrolment Rules</h3>
<h3 className="font-bold">Enrolment Rules</h3>
<p>{course.enrolmentRules}</p>
</div>
) : (
<div></div>
)}
<div>
<h3 className='font-bold'>Description</h3>
<p className='whitespace-pre-line'>{course.description}</p>
<h3 className="font-bold">Description</h3>
<p className="whitespace-pre-line">{course.description}</p>
</div>
</section>
</Suspense>
{/* Reviews */}
{/* Show reviews is separated as another client component "ReviewsBar"
so the review page can stay as a server side component to ensure server side
rendering */}
<section className='space-y-4 w-full mb-8'>
<section className="space-y-4 w-1/2 md:w-full mb-8">
<Suspense fallback={<div>Loading...</div>}>
<ReviewsBar
courseCode={course.courseCode}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default async function RootLayout({
`,
}}
/>
<script defer data-domain="cselectives.staging.csesoc.unsw.edu.au" src="https://plausible.io/js/script.js"></script>
<script defer data-domain="unilectives.devsoc.app" src="https://plausible.unilectives.com/js/script.outbound-links.tagged-events.js"></script>
</head>
<body className="bg-white dark:bg-slate-800 dark:text-gray-200">
<Provider session={session}>
Expand Down

0 comments on commit 6f98835

Please sign in to comment.