SSF-207 Deep-linking for view orders and view assigned pantries#176
SSF-207 Deep-linking for view orders and view assigned pantries#176Juwang110 wants to merge 5 commits into
Conversation
dburkhart07
left a comment
There was a problem hiding this comment.
looks really great, everything seems to work. just some discussion points worth having i think
| </Badge> | ||
| </Table.Cell> | ||
| <Table.Cell textAlign="right"> | ||
| <Link |
There was a problem hiding this comment.
I wonder if we should disable this entirely if there are no orders for the pantry, as opposed to displaying it and navigating these but doing nothing (same would apply for the volunteer assigned pantries page too). thoughts?
There was a problem hiding this comment.
This does make sense and it would be nice to have but there would have to be a decent amount of additional backend logic or calls to get the orders for each of the pantries. I don't see an easy way to implement that without a good amount of changing/more overhead. An easy fix that I think would make sense would be if there are no orders for a pantry, when the view orders button is clicked it goes to the order management page and there's an alert that says no orders for this pantry or something along those lines (it will show orders with no filters). What do you think about that? I guess I could also alternatively get all orders with one api call and see for each pantry if there is an order with order.request.pantryId similar to the current logic in adminOrderManagement
There was a problem hiding this comment.
hmm i think the navigating and showing an error may not be bad. let's go with that
Yurika-Kan
left a comment
There was a problem hiding this comment.
looking dapper! main change requested is on reload/persisting functionality that dalton brought up~
dburkhart07
left a comment
There was a problem hiding this comment.
the adminOrderManagement pantry filter is still not working for me. Can you check that out?
| const pantryIdFromUrl = searchParams.get('pantryId'); | ||
|
|
||
| const allOrders = Object.values(statusOrders).flat(); | ||
| if (!pantryIdFromUrl || allOrders.length === 0) return; |
There was a problem hiding this comment.
Even if we have no orders at all, we should still automatically fill in the filters with the pantry i think. While this is easier, if we don't have orders, we should just fetch the pantry and use its name to prefill the filter. This logic should apply for the volunteerOrderManagement too.
| ); | ||
| const pantryName = matchedOrder?.request.pantry.pantryName; | ||
|
|
||
| if (pantryName) { |
There was a problem hiding this comment.
In the instance where we get no match from the query parameter, can we just throw an error, rather than silently failing? Same with volunteerOrderManagement
ℹ️ Issue
Closes https://vidushimisra.atlassian.net/browse/SSF-207
📝 Description
Various changes:
✔️ Verification
Verified deeplink functionality and design matched figma
🏕️ (Optional) Future Work / Notes
N/A