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

[97] Search interface - last name #55

Merged
merged 7 commits into from
Jul 20, 2023
Merged

[97] Search interface - last name #55

merged 7 commits into from
Jul 20, 2023

Conversation

AbigailMcP
Copy link
Contributor

@AbigailMcP AbigailMcP commented Jul 19, 2023

Context

As a user I want to be able to search the Children's Barred List by last name.

Changes proposed in this pull request

  • includes_record? method in ChidrensBarredListEntry model which
    checks whether theres a matching record in the list
  • SearchesController with new and show actions
    • show performs the search and redirects to no_record if there are no matching records
  • Search page
    • contains search form with last_name input (date of birth input to come)
    • currently sits on root path
  • 'Record found' page with summary list containing user's search params
  • SearchForm to handle validations on the search parameters:
    • Add presence validation to last_name field

Other:

  • Update ApplicationController so that basic authentication used when service closed. This means system tests can just set service_open feature to true.
  • Add launchy and factorybot gems for testing
  • Tidy up rails_helper.rb
  • Remove old PagesController and route

Out of scope

  • Date of birth field (new Trello card created)
  • Any fancy text search (characters with accents, spaces etc)

Screenshots

Search page (current siting on the root "/"):

Screenshot 2023-07-19 at 14 28 42

Search page with errors:

Screenshot 2023-07-19 at 14 28 45

Record found page:

Screenshot 2023-07-19 at 14 28 51

No record found page:

Screenshot 2023-07-19 at 14 28 56

Guidance to review

Link to Trello card

https://trello.com/c/sNiptrzp/97-search-interface

Checklist

  • Attach to Trello card
  • Rebased main
  • Cleaned commit history
  • Tested by running locally

- Add SearchesController with new and show actions
- Add new.html.erb containing search form with last name input
- Add show.html.erb with summary list rendering the result last_name
- Update ApplicationController so that basic authentication used when service closed
- Create SearchForm to handle validations on the search parameters
- Add presence validation to last_name field
- Add error message to en.yml
- New includes_record? method in ChidrensBarredListEntry model which
  checks whether theres a matching record on the list
- Use new includes_record? method in SearchesController and redirect to
  no_record page if none found
- New no_record page
- Install factorybot for system specs and tidy up rails_helper.rb
@AbigailMcP AbigailMcP changed the title [97] Search interface [97] Search interface - last name Jul 19, 2023
@AbigailMcP AbigailMcP added the deploy Deploys a review app label Jul 19, 2023
@github-actions github-actions bot temporarily deployed to review-55 July 19, 2023 13:41 Destroyed
@AbigailMcP AbigailMcP marked this pull request as ready for review July 19, 2023 13:42
Copy link
Contributor

@steventux steventux left a comment

Choose a reason for hiding this comment

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

🚀

@AbigailMcP
Copy link
Contributor Author

@AbigailMcP AbigailMcP merged commit 69cfc39 into main Jul 20, 2023
14 checks passed
@AbigailMcP AbigailMcP deleted the 97-search-interface branch July 20, 2023 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy Deploys a review app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants