icefoganalytics / travel-authorization

0 stars 0 forks source link

Ytgov Issue 113: Travel Desk Request Missing Fields in Grid #222

Closed klondikemarlen closed 1 month ago

klondikemarlen commented 1 month ago

Fixes https://github.com/ytgov/travel-authorization/issues/113

Context

Describe the bug On the https://travel-auth-dev.ynet.gov.yk.ca/travel-desk grid screen the user, department and branch fields are not being populated. To Reproduce Steps to reproduce the behavior:

Updated steps to reproduce.

  1. In the top right click on the kebab menu and select Administration.
  2. Click on the User Management entry.
  3. Find your user in the table and click on them.
  4. Set your user's first name, last name, and department and then click save.
  5. Note that there is no way to edit your division, branch or unit via the UI.
  6. In the database, find your user's record update the department, division, and branch to match something like Health and Social Services -> Community and Primary Care -> Integrated Health Services This information can be found in the YgDepartments table.
  7. Go to your profile via the top nav kebab menu and refresh the page to check that your details are correct.
  8. Go to the My Travel Request page via the top drop down nav.
  9. Click on the "+ Travel Authorization" button to create a travel authorization.
  10. Fill in the first two sections and make sure that your travel method is "Aircraft".
  11. Generate the estimate via the call-to-action button.
  12. Submit to yourself as the supervisor.
  13. Go to the Manager View via the top drop down nav.
  14. Find your approval in the Pending Approvals section and click on it.
  15. Scroll down to the bottom and approve it via the button and dialog.
  16. Go back to the "My Travel Request" page via the top drop down nav.
  17. Find you travel request in the table and click the "Submit Travel Desk Request button.
  18. Fill in all required fields and submit the request.
  19. Go to the "Travel Desk" page via the top drop down nav.
  20. Find the request in the Travel Desk Requests table, and note that the department and branch are missing.

    I fixed the Name column in a previous PR.

Note that the "Travel Start Date" column is returning "Dec 29 1969" which is unlikely to be correct. The "Travel End Date" column is blank.

Expected behavior The traveler name, department and branch should be populated.

Screenshots image

Desktop (please complete the following information):

Implementation

  1. Standardize travel desk page component.
  2. Break export to csv code out into a component.
  3. Move csv and print data serialization to back-end.
  4. Standardize travel-desk-travel-requests use files, front-end api, back-end api, policy and serializer.
  5. Update TravelSegment#departureOn field type to match actual type returned by Sequelize. DATEONLY returns a string, but accepts both Date and string. Sadly Sequelize + Typescript doesn't support one format for setter and a different format for getter.

Screenshots

Table View with fixed data image

Pre-Print view with fixed data image

Print view with fixed data image

CSV export of table image

Testing Instructions

  1. Run the test suite via dev test (or dev test_api)
  2. Boot the app via dev up
  3. Log in to the app at http://localhost:8080
  4. In the top right click on the kebab menu and select Administration.
  5. Click on the User Management entry.
  6. Find your user in the table and click on them.
  7. Set your user's first name, last name, and department and then click save.
  8. Note that there is no way to edit your division, branch or unit via the UI.
  9. In the database, find your user's record update the department, division, and branch to match something like Health and Social Services -> Community and Primary Care -> Integrated Health Services This information can be found in the YgDepartments table.
  10. Go to your profile via the top nav kebab menu and refresh the page to check that your details are correct.
  11. Go to the My Travel Request page via the top drop down nav.
  12. Click on the "+ Travel Authorization" button to create a travel authorization.
  13. Fill in the first two sections and make sure that your travel method is "Aircraft".
  14. Generate the estimate via the call-to-action button.
  15. Submit to yourself as the supervisor.
  16. Go to the Manager View via the top drop down nav.
  17. Find your approval in the Pending Approvals section and click on it.
  18. Scroll down to the bottom and approve it via the button and dialog.
  19. Go back to the "My Travel Request" page via the top drop down nav.
  20. Find you travel request in the table and click the "Submit Travel Desk Request button.
  21. Fill in all required fields and submit the request.
  22. Go to the "Travel Desk" page via the top drop down nav.
  23. Check that the table now has the correct Department, Branch, Travel Start Date, Travel End Date info.
  24. Export to CSV, check the data is correct.
  25. Print the report, check the data is correct.