diff --git a/class_registration_app/src/assets/main.css b/class_registration_app/src/assets/main.css index bc889ca..99c6929 100644 --- a/class_registration_app/src/assets/main.css +++ b/class_registration_app/src/assets/main.css @@ -137,6 +137,7 @@ a, border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); transition: transform 1s, box-shadow 1s; + color:#000 } .course-list-item:hover{ diff --git a/class_registration_app/src/components/CourseSearch.vue b/class_registration_app/src/components/CourseSearch.vue index 8f58e0a..adbfe22 100644 --- a/class_registration_app/src/components/CourseSearch.vue +++ b/class_registration_app/src/components/CourseSearch.vue @@ -6,7 +6,8 @@ const AsyncComponent = defineAsyncComponent(() => import('./CourseSearch.vue') ); -interface CourseInfo { + +interface CourseInfo { //enter all course info parameters here to prevent TypeScript errors CourseId: string; CourseLocation: string; OpenStatus: boolean; @@ -14,7 +15,7 @@ interface CourseInfo { MaxStudents: number; StudentsEnrolled: number; Prerequisites: string[]; - Section: string; // added for section + Section: string; CourseScheduledDays: string[]; Level: string; } @@ -88,17 +89,17 @@ function applySelectedFilters(courses: CourseInfo[]): CourseInfo[] { } function handleSearch() { + // for multiple searches... delete all previous results to populate new ones const elementsToRemove = document.querySelectorAll(`.${"course-list-item"}`); elementsToRemove.forEach(element => { element.remove(); }); - - console.log("button clicked"); //arn:aws:execute-api:us-east-1:671289147354:5prodolbi7/*/GET/courses + //API Gateway link const apiUrl = 'https://5prodolbi7.execute-api.us-east-1.amazonaws.com/Beta'; - + //using fetch instead of axios let courseJson = fetch(`${apiUrl}/courses`) .then(response => { if (response.ok) { @@ -107,10 +108,12 @@ function handleSearch() { throw "Error" } }).then(response => { - console.log(response.Items); + console.log(response.Items); //testing results + //must include type of element with typescript let searchbar = document.getElementById("search"); - + + //filter all courses retrieved from API with user input console.log(response); let filteredCourses = response.Items.filter(function (course: CourseInfo) { return course.CourseId.includes(searchbar.value.toUpperCase())} ); @@ -140,7 +143,7 @@ function handleSearch() { course_location.textContent = Course.CourseLocation; course_status.className = "course-status"; - if(Course.OpenStatus){ + if(Course.OpenStatus){ //course_status returns a bool course_status.textContent = "Enroll Status: Open"; }else{ course_status.textContent = "Enroll Status: Closed"; @@ -157,9 +160,10 @@ function handleSearch() { course_section.className = "course-section"; course_section.textContent = "Section: " + Course.Section; + //*****IMPORTANT - all classes are found in main.css under "assets" + //classes under style scoped are not reactive for some reason - - // Append the div to the container + // Append the divs to the container if (container != null){ container.appendChild(div); div.appendChild(course_name); diff --git a/class_registration_app/src/components/DashBoard.vue b/class_registration_app/src/components/DashBoard.vue index e71cfab..7477a9a 100644 --- a/class_registration_app/src/components/DashBoard.vue +++ b/class_registration_app/src/components/DashBoard.vue @@ -2,6 +2,7 @@