Skip to content

Added filters to take more than one filter parameters, enabled empty filter params, changed campus parameters#19

Open
djennedy wants to merge 3 commits into
mainfrom
more-than-one-filter
Open

Added filters to take more than one filter parameters, enabled empty filter params, changed campus parameters#19
djennedy wants to merge 3 commits into
mainfrom
more-than-one-filter

Conversation

@djennedy

@djennedy djennedy commented Feb 25, 2023

Copy link
Copy Markdown
Owner

Added filter functions that now take more than one filter parameter as a list.

The filters that can take more than one filter parameter:

  • Filter by Levels
  • Filter by Campuses
  • Filter by WQB Designations

All of these filters have checkbox parameters so we be able to filter with more than one parameter. They also take empty lists as a no-filters option

The filters that doesn't take more than one filter parameters:

  • Filter by Instructor
  • Filter by Credits

Both of these filters are text input from the user so it doesn't make sense to have more than one filter parameter

Chaining all of these filters work with each other, for example, I tested:

let testTerm = getTermInfo("Spring 2023", ["cmpt", "cmns", "ca"])
testTerm.then(termInfoList => filterByCredits(filterByCampuses(filterByWqbs(filterByLevels(filterByInstructor(termInfoList, ""),[100,200,300]),["w"]),["Burnaby"]), 4))

I also made a change for campus filtering, now instead of taking a "Vancouver" option, the checkbox will show "Online" and "Other" instead. Reasoning is because there are multiple Vancouver campuses and all of them are encoded differently in the API, so we'd rather just bunch them together than deal with edge cases one by one

@djennedy djennedy requested a review from sarah-vo February 25, 2023 20:20

@sarah-vo sarah-vo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🫡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants