rshah98626 / PoolCar

Pool it up!
0 stars 0 forks source link

Fixing and Improving Filters and Ride Table #65

Closed Raajesh12 closed 4 years ago

Raajesh12 commented 4 years ago

Filter Screen No Longer Shows Up By Default Display All Rides with start times of today and after by default Paginate the ride table whether displaying all rides or filtered rides Saving state of user's choices for filters so when they click on filter again, they will see their past choices Added Clear Filters button that allows users to clear filters and get the default of all rides that started today and after

Added Functionality in backend to support paginated queries Made backend query also return Rides in sorted order by time.

Screen Shot 2020-02-27 at 10 06 43 PM
rshah98626 commented 4 years ago

The only thing is I don't know how to load more results. I don't see that blue "More Results" button on my end. When I filter for the 28th, quite a few rides show up (about 25) but they just all load. I was wondering if there were more results, if we could just auto generate them by scrolling, not hitting another button.

Raajesh12 commented 4 years ago

The only thing is I don't know how to load more results. I don't see that blue "More Results" button on my end. When I filter for the 28th, quite a few rides show up (about 25) but they just all load. I was wondering if there were more results, if we could just auto generate them by scrolling, not hitting another button.

Yeah the reason is: You have to to run the server locally because the pagination changes are in this branch. Also in APIFetcher change the baseURL to "http://localhost:8000/" to fully test these changes with the locally running server.

In regards to auto scrolling: That's actually how I first implemented it, and I saw some suggestions online about running the code to fetch more results in the onAppear() of the last row, but sometimes the onAppear() got triggered multiple times when I tried scrolling fast, so it would fetch the same results twice. Overall, was just inconsistent and too buggy compared to this approach. While I think this approach is a little bit slower than auto-scroll, it doesn't have any weird bugs or inconsistencies, which is pretty important. We definitely don't watch to show them duplicate rides for example.

rshah98626 commented 4 years ago

Gotcha, ok that makes sense, totally forgot about the server changes not being deployed. Let me test them out again.