-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Need to make recurring rides work as a feature; Fixed Schedule so that rides from other days show up. #539
base: master
Are you sure you want to change the base?
Conversation
What has been done: - fixed the schedule so that rides from other days show up - unscheduledRides and scheduledRides from useRides of RidesContext now includes recurring rides, however these rides are not in the backend. Then plan is to add them to the backend once you edit/delete them. Edit shouldn't be too hard but delete I need to figure out. - The Edit button on recurring rides now works
[diff-counting] Significant lines: 697. |
…e ride which creates a new ride entirely or to edit all recurring rides) and delete (delete that single ride or delete all rides). Lots of bugs: all recurring rides now are unscheduled, also probabaly won't work as a rider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Nam, great job noticing the bugs! When I pulled your branch, I am coming across an error 500—I took a look at the server log and it appears that the problem lies in your get request const ridesDataToday: Ride[] = await axios
in RidesContext. I left a more specific comment in the file that could help you with debugging.
Because of the AxioError, I couldn't add a ride to test how you squashed the bugs.
Ride type:
Recurring rides design:
useRides()
Add and Edit design:3 options to edit:
3 options to delete:
|
…d to fix bug when axios.put
…ing rides, but deleting is still an issue because updating childRideId everytime an axios.put or axios.post is called is wrong
…es now work as expected
…editing a single ride in a chain of recurring rides, but encountered Invalid UpdateExpression: Two document paths overlap with each other; must remove or rewrite one of these paths; path one: [driver], path two: [parentRideId]
Summary
Currently, recurring rides doesn't work at all. It doesn't show up in the scheduled/unscheduled rides table of other days nor does it show up in the big Schedule in the home page.
screen-capture (3).webm
This is because the useRides() function that both the rides table and schedule uses from RidesContext.tsx only pulls from the backend the rides from the current day. Since the recurring rides doesn't exist in the backend, they won't show up in the tables or the schedule.
I plan to add the recurring rides feature by updating
scheduledRides
andunscheduledRides
ofRidesContext
to have both the normal and recurring rides, which haven't been added to the backend yet. This ensures that these recurring rides show up in the ride tables and schedules. When we need to delete or edit these recurring rides, that's when we communiate with the database.Additionaly, I also found 2 bugs which I both fixed:
Here, the ride at the bottom doesn't show up on the schedule
__I clicked on the edit button of the ride on the bottom, which is a recurring ride, and nothing shows up.
However, I found another bug in the backend that diasbled access to the carriage website which persists on the master branch.
The origin is here
This might have been caused by me doing some work in
RidesContext
.This pull request is the first step towards making the recurring rides work.
scheduledRides
andunscheduledRides
ofRidesContext
. These rides are not in the back end.Test Plan
I plan to add recurring rides and manually check if they show up in other days.
Breaking Changes
This bug:
This might have been caused by me doing some work in
RidesContext
. The master branch now doesn't work?