oss-slu / shelter_volunteers

MIT License
2 stars 3 forks source link

Display shelters based on user input #Issue 76 and #Issue 75 fixed. #79

Closed vakhil-98 closed 6 months ago

vakhil-98 commented 7 months ago

Fixes #75 and #76

What was changed?

Here, describe what part of the application you changed (e.g. login page, database, etc.). If possible, mention what specific components were added, removed, or modified. client_app/src/Shelters.js client_app/src/Components/SearchBar.css, client_app/src/Components/SearchBar.js

Why was it changed? It is the part of the code base dealing with displaying shelters. To provide easier functionality for the user so they could search for a specific shelter instead of having to scroll through all the shelters.

Here, describe the issue that you are fixing with this code, and why your code fixes it. Display the list of shelters based on the text provided in the "Search" field. The code based on user provided input filters and displays data accordingly on page, else shows a message no match found and by default shows all shelters list as mentioned in issue description.

How was it changed? Reduced the number of displayed shelters based on searchQuery.

Here, get into detail about what files you modified, and talk about the most important lines in regards to fixing the issue. client_app/src/Shelters.js Line 9, 27, 30 - 33, 63 - 65, 146 - 169, 185, 203 - 209 Two new files SearchBar.js which holds the logic for the search bar component, as well as the search and clear button, as well as SearchBar.css which provides the styling for the search bar component.

Screenshots that show the changes (if applicable): image

image

SiriChandanaGarimella commented 6 months ago

@vakhil-98 - Good work! Could you please check on the below points:

  1. When the input in the Search box is cleared using the backspace key, all the available Shelters should be displayed.
  2. If no Shelter names match the entered input, the message "No shelters found with that name." should be followed by a helpful suggestion such as "Explore the list below for available shelters."
  3. If more than one space is entered between the words in the search input, then trim the extra spaces and match them to the shelter name.
  4. Also, I see that you do not have the latest code from the main branch. Please sync your branch with the "main".