-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a search bar and filter box in the Locations page #509
base: master
Are you sure you want to change the base?
Conversation
…y -Isn't responsive enough, flashes everytime you select or deselect an option -One bug is that you can't deselect the last element
…ed filtering for specific tags yet
[diff-counting] Significant lines: 75. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty good PR. Search functionality works as expected and tags also work as expected. Will merge this but will have to change the dropdown to use the react-select library.
Great job
Lol and also hop on a huddle lets figure out what the issue with prettier is
const loc = useLocations().locations; | ||
|
||
useEffect(() => { | ||
setLocations(loc); | ||
setSearchLocations(loc); | ||
}, [loc]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job here! A lot of people forget to add the dependency array when using useEffect and its a huge pain lol
Summary
Added a search bar based on name of location and filter box for filtering by tags in the Locations Page.
The search functionality is just checking if the string in the search bar is contained in the names of the location. If yes then it displays it in the table below.
The filter box filters the locations by tags. If None is chosen then it filters nothing.
Here is both of them working together:
screen-capture.webm
Test Plan
I have so far tested it manually and everything seems to work. I honestly don't know how to test it more rigorously, so any feedback in this area is greatly appreciated.
Notes
I couldn't find any figma designs of the filter box, so I just decided to give it the minimum amount of styling.