hack4impact-mcgill / MADA-v2

5 stars 2 forks source link

MyTasks page connected to backend #130

Closed KihyeokK closed 1 year ago

KihyeokK commented 1 year ago

Summary

Note:

  1. Now uses backend data fetched from db
  2. Uses data from one specific volunteer (user). The volunteer ID used is hard coded for now.
  3. Replaced the hard coded address in deliveryDetails with client address, and just removed date and time.

Things still needed to be worked on:

  1. using the ID of the logged in user. The logged in volunteer's ID should be stored somewhere (context?) so that it can be accessed in MyTasks page to retrieve data specific to that volunteer.
  2. Availabilities check-in top header must turn green or be removed once the volunteer notifies their avaialbility for the current week. Need that info in the MyTasks page. Screenshot 2023-06-02 at 1 30 31 AM
  3. Blue Help button hidden under header.
  4. some more I can't think of as of now

Related Issues

Which issues does this PR resolve/work on? Closes #114

selenajin99 commented 1 year ago

also there is a conflict, please resolve it by merging main into this branch and manually resolving it :) don't forget to recompile and make sure the app runs [a mistake I always make at work ;( ]

KihyeokK commented 1 year ago

Applied suggested changes. Some "major" change to note was refactoring all the states related to date filtering for deliveries into date context. To preserve the selected filtering date when visiting delivery-details page and clicking x to go back, using browser history stack (history.back() method) and creating date context that wraps different route components was needed (this was painful :') ). I also enabled preserving the selected date for myHistory page, but in general, visiting other pages will reset the browser history stack and the whole date context because the whole application gets rerendered.
You can check commit message descriptions for more detail.

I left the console.logs as is for now. Updating availabilities-check-in header is still needed to be done after this PR.

Let me know if other changes are needed for this PR!