From ce1da1fd336f367586296aae3ed0a496fcae5be5 Mon Sep 17 00:00:00 2001 From: Eric Ni Date: Tue, 28 May 2024 15:13:32 -0700 Subject: [PATCH 1/2] en - changed course number input field to accept department names before class number --- .../components/BasicCourseSearch/CourseOverTimeSearchForm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/main/components/BasicCourseSearch/CourseOverTimeSearchForm.js b/frontend/src/main/components/BasicCourseSearch/CourseOverTimeSearchForm.js index 95739e1e0..6eafe9772 100644 --- a/frontend/src/main/components/BasicCourseSearch/CourseOverTimeSearchForm.js +++ b/frontend/src/main/components/BasicCourseSearch/CourseOverTimeSearchForm.js @@ -69,7 +69,8 @@ const CourseOverTimeSearchForm = ({ fetchJSON }) => { }; const handleCourseNumberOnChange = (event) => { - const rawCourse = event.target.value; + const rawInput = event.target.value; + const rawCourse = rawInput.replace(/^[a-zA-Z]+/, ''); if (rawCourse.match(/\d+/g) != null) { const number = rawCourse.match(/\d+/g)[0]; setCourseNumber(number); From 94f7fe2cfa01532b5252f0d29dae39553d2e7485 Mon Sep 17 00:00:00 2001 From: Eric Ni Date: Tue, 28 May 2024 15:35:20 -0700 Subject: [PATCH 2/2] en - fixed formatting on CourseOverTimeSearchForm.js --- .../components/BasicCourseSearch/CourseOverTimeSearchForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/main/components/BasicCourseSearch/CourseOverTimeSearchForm.js b/frontend/src/main/components/BasicCourseSearch/CourseOverTimeSearchForm.js index 6eafe9772..87c11ba73 100644 --- a/frontend/src/main/components/BasicCourseSearch/CourseOverTimeSearchForm.js +++ b/frontend/src/main/components/BasicCourseSearch/CourseOverTimeSearchForm.js @@ -70,7 +70,7 @@ const CourseOverTimeSearchForm = ({ fetchJSON }) => { const handleCourseNumberOnChange = (event) => { const rawInput = event.target.value; - const rawCourse = rawInput.replace(/^[a-zA-Z]+/, ''); + const rawCourse = rawInput.replace(/^[a-zA-Z]+/, ""); if (rawCourse.match(/\d+/g) != null) { const number = rawCourse.match(/\d+/g)[0]; setCourseNumber(number);