oss-slu / shelter_volunteers

MIT License
2 stars 3 forks source link

Search bar displayed on the sign up for shifts page fixed (issue #75) #77

Closed cbiddle3 closed 6 months ago

cbiddle3 commented 7 months ago

Fixes #75

What was changed?

When the user presses Signup for Shifts from the navigation bar, there is now a search bar with a clear button and a search button. The user can also press enter while in the search bar field to search. This validates users' input and only allows them to enter alphanumeric characters as well as "-", " ' ", '&', " / ", "(", ")", ":" or "," and requires the search to be at least 5 characters.

Why was it changed?

To provide easier functionality for the user so they could search for a specific shelter instead of having to scroll through all the shelters.

How was it changed?

SearchBar.js was created as a Component and is in the Components directory. The SearchBar object has its own search button, clear button, and keyDown listener so the user can press enter. SearchBar.css provides styling for the search bar, and code that ensures the buttons match the styling from the rest of the webpage. To add the Search bar on the page, I altered Shifts.js and added the component between the current location and radius selection.

Search button enabled:

Screenshot 2024-02-22 at 11 59 15 AM

Search button disabled:

Screenshot 2024-02-22 at 11 59 02 AM
SiriChandanaGarimella commented 6 months ago

@cbiddle3 - Summarizing the key points that we discussed for your reference,

  1. Ensure the Search box is aligned with other elements on the page.
  2. Minimize the padding in the input field of Search.
  3. Disable the Search button after the Clear button is clicked also disable the Clear button when there is no input provided.
  4. Enable the Search feature upon pressing the Enter key.
  5. Allow a maximum of 55 characters in the Search box input.

Also, I could see that a compose-dev file has been added. As it is not relevant to this story, can you please remove it?

SiriChandanaGarimella commented 6 months ago

Closing this PR as this is verified and approved as part of the PR #79