Story #99 Single button for membership renewing - cseseniordesign/reservations GitHub Wiki

End User Documentation

Dev Testing Instructions

  1. Make sure you are on the most recent version of the dev-single-button-for-renewing branch.
  2. Start your dev environment.
  3. Underneath the Admin header click Users.
  4. Click the edit button next to the user who's expiration date you would like to renew.
  5. Scroll down to the bottom of the page and click the Renew Membership button.
  6. Validate that the user's expiration date has been updated to be 30 days from the current day.
  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/home/.
  2. Follow steps 3 and up from the dev testing instructions above.

Technical Documentation

routes/admin/users.rb

  • Added new POST method, /admin/users/:user_id/renew/?.
  • This POST method is extremely similar to the expiration date section of another post method /admin/users/:user_id/edit/?.
  • /admin/users/:user_id/renew/? gets the user and then sets their expiration date to be 30 days out from the current day.
  • The information is saved to the database and the user is redirected to /admin/users/.

views/admin/edit_user.erb

  • Added a new form which gets the edited user's ID and passes it to the renew POST method.
  • Added a submit button for the form which has a label of "Renew Membership".