Story #40 Edit Multiple Expirations | User and Technical Documentation - cseseniordesign/reservations GitHub Wiki
End User Documentation
Dev Testing Instructions
Make sure you are on the most recent version of the dev-edit-multiple-expirations branch.
Start your dev environment and log in with development2 so you have all permissions.
Navigate to the Admin -> Users page
Ensure that the sort buttons are now icons within the table header. Ensure the current sort mode icon is orange whereas the others are red.
Click "show toolbox" next to "Manage Users" at the top of the page. Ensure there is a button that says "Modify Expirations".
Click the "Modify Expirations" button and ensure it takes you to a new page where you can add days to all users' expirations.
Once on this page, execute this query on the database to view the expiration dates of all users with non-null expiration dates. Take note of the expiration dates before you add days.
SELECT expiration_date from users where expiration_date IS NOT NULL;
Ensure the input box on the page only allows numeric values.
Enter a number of days in the input box and click "Modify".
Ensure that you are redirected to the admin/users page and that a success message is shown. The success message should say how many users were updated as well as how many days were added.
Execute the query from step 7 again and make sure that the number of days you added is reflected in the expiration dates.
Ensure that there are no console errors throughout your testing. Ensure the UI changes are responsive and that they contrast well in both dark and light modes.
Follow steps 3 and up from the dev testing instructions above.
Technical Documentation
routes/admin/users.rb
Changes within the get /admin/users/? route:
Removed logic for searching by tool authorization
Added new get route /admin/users/modify_expirations/? which loads the admin/modify_expirations.erb
Added new post route /admin/users/modify_expirations/? which adds the number of days set on the page to all users with expiration dates that are not null. Then it flashes a success message and redirects to the admin/users/ page.
src/less/innovation_studio.less
Added styling for the new .sort class to make the sort icons responsive and stack on top of each other.
views/admin/modify_expirations.erb
Added this new .erb for the modify_expirations route. It uses a form to post the number of days to add to all users' expiration dates.
views/admin/users.erb
Added new button in the toolbox to take users to the modify expirations page.
Changed the sort buttons into SVG icons and moved them to the table header.
Removed javascript related to building the search filter for searching by tool authorization.