Story #16 Search Members Pagination | User and Technical Documentation - cseseniordesign/reservations GitHub Wiki

End User Documentation

Dev Testing Instructions

  1. Make sure you are on the most recent version of the dev-search-member-pagination branch.
  2. Start your dev environment and log in with development2 so you have all permissions.
  3. Navigate to the Admin -> Users page
  4. Ensure there is a dropdown to select the user shown per page. Ensure when you change the value in the dropdown that the page reloads with the new number of users shown per page.
  5. Ensure pagination appears at the bottom of the screen if the search has more than 1 page.
    • The current page should not have a box around it or be clickable. Ensure other pages take you to the appropriate page when clicked.
    • There should be at most 5 pages shown in the pagination. If there are more pages than the ones shown in either direction there should be ellipses at the beginning and/or the end of the pagination.
    • There should be buttons to navigate to the first, previous, next, and last pages. If you're on the first page, the first and previous buttons shouldn't show. If you're on the last page, the next and last buttons shouldn't show. Ensure these buttons work as expected.
  6. Ensure there is no way to navigate to an invalid page besides directly changing the parameter in the URL.
  7. Ensure there are no errors in the console throughout your testing and that the page is still responsive on all screen sizes.

Production Testing Instructions

  1. Go to https://innovationstudio-manager.unl.edu/login/ and log in with an account that has elevated permissions to view the Admin -> Users page.
  2. Follow steps 3 and up from the dev testing instructions above.

Technical Documentation

routes/admin/users.rb

  • Changes within the get /admin/users/? route:
    • Added parameters for page and users_per_page.
    • Added logic to default user per page to 10.
    • Added logic to determine where the pagination starts and ends.
    • Added logic to pass the current page, max_page, pagination_start, pagination_end, and users_per_page to the view.

views/admin/users.erb

  • Added a dropdown to choose between 1, 5, and 10 users shown per page.
  • Added pagination to the bottom of the page if the search has more than 1 page.
  • Added javascript logic to handle changing pages and changing the users per page.