Skip to content
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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

namanhboi
Copy link
Contributor

Summary

Added a search bar based on name of location and filter box for filtering by tags in the Locations Page.

image

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.
image
image

The filter box filters the locations by tags. If None is chosen then it filters nothing.
image
image

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.

…y -Isn't responsive enough, flashes everytime you select or deselect an option -One bug is that you can't deselect the last element
@namanhboi namanhboi requested a review from a team as a code owner April 4, 2024 22:51
@dti-github-bot
Copy link
Member

dti-github-bot commented Apr 4, 2024

[diff-counting] Significant lines: 75.

Atikpui007
Atikpui007 previously approved these changes Apr 14, 2024
Copy link
Collaborator

@Atikpui007 Atikpui007 left a 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]);
Copy link
Collaborator

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

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.

None yet

3 participants