From aa5483aabca993ab471c3c6fcf0a56094a7011a3 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Wed, 3 Apr 2024 19:18:08 -0700 Subject: [PATCH 1/3] chore: add UCLA data --- lib/constants.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/constants.tsx b/lib/constants.tsx index ad51f33..47f7038 100644 --- a/lib/constants.tsx +++ b/lib/constants.tsx @@ -21,4 +21,13 @@ export const UNIVERSITY_GE: Record = { "GE F", "GE G", ], + "University of California, Los Angeles": [ + "Arts and Humanities: Literary and Cultural Analysis", + "Arts and Humanities: Philosophical and Linguistic Analysis", + "Arts and Humanities: Visual and Performance Arts Analysis and Practice", + "Scientific Inquiry: Life Sciences", + "Scientific Inquiry: Physical Sciences", + "Society and Culture: Historical Analysis", + "Society and Culture: Social Analysis", + ], }; From eaa72ffba133ed521bf0dd932ab1d94c85ff3806 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 5 Apr 2024 00:43:22 -0700 Subject: [PATCH 2/3] refactor: swap ternary condition order --- components/search/Search.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/search/Search.tsx b/components/search/Search.tsx index 37cedd9..3a72136 100644 --- a/components/search/Search.tsx +++ b/components/search/Search.tsx @@ -196,7 +196,7 @@ const Search = () => { const fetchData = async () => { try { const universityParam = university; - const geParam = !ge.includes("GE") ? ge : ge.split(" ")[1]; + const geParam = ge.includes("GE") ? ge.split(" ")[1] : ge; const courses = await queryDatabase(universityParam, geParam); setCourses(courses); From c22317b87ed9ddb8e3799cb5ebd51997830ee8be Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 5 Apr 2024 00:43:43 -0700 Subject: [PATCH 3/3] feat: handle colon in UCLA categories --- components/search/SearchResults.tsx | 13 ++++++++++++- components/search/SearchSelect.tsx | 30 +++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/components/search/SearchResults.tsx b/components/search/SearchResults.tsx index 21b9682..99068e4 100644 --- a/components/search/SearchResults.tsx +++ b/components/search/SearchResults.tsx @@ -88,7 +88,18 @@ const SearchResults = (props: SearchResultsProps) => {
{result.fulfillsGEs - .map((obj) => obj.category) + .map((obj) => { + const category = + obj.category; + + return category.includes( + ":", + ) + ? category.split( + ": ", + )[1] + : category; + }) .join(", ")}
diff --git a/components/search/SearchSelect.tsx b/components/search/SearchSelect.tsx index c7df1de..e904cfa 100644 --- a/components/search/SearchSelect.tsx +++ b/components/search/SearchSelect.tsx @@ -21,17 +21,31 @@ export const SearchSelect = (props: DropdownComponentProps) => { return (