Story #4 Sort Member Table | 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 are three buttons above the user table. Ensure when you click any of the buttons that the page reloads with the users resorted based on the clicked button.
  5. Click the Name Sort button.
    • The current page should be reloaded to be sorted based on name. Ensure if clicked again it will reverse the order based on name.
  6. Click the Email Sort button.
    • The current page should be reloaded to be sorted based on email. Ensure if clicked again it will reverse the order based on email.
  7. Click the Expiration Date Sort button.
    • The current page should be reloaded to be sorted based on the expiration date. Ensure if clicked again it will reverse the order based on expiration date.

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 logic to determine which way to sort based on passed fields from the view
    • Added logic to pass the current 'sort_by_name', 'sort_by_email', and 'sort_by_expiration' to the view.

views/admin/users.erb

  • Added one button for each type of sort (three buttons)
  • Added hidden fields to keep track of each sort
  • Added javascript logic to handle reloading the page to change the sort of the users