SSF-205 FM Dashboard Frontend#173
Conversation
Yurika-Kan
left a comment
There was a problem hiding this comment.
small little fixes~ great pr!
dburkhart07
left a comment
There was a problem hiding this comment.
first pass looks good, should hopefully be done after this! ty justinnnn
| init(); | ||
| }, []); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
I know this is not part of your ticket, but I noticed an issue come up. When we go to deeplink to a new page, but the selected id is not on the current pagination, the page does not open up until we move the pagination to that page (e.g. if the donation id for this was on page 2 under available donations, i would need to navigate to page 2 after being deeplinked in order for it to open up. we should be going there automatically instead. i think this will require using the searchParams to set the current page to the appropriate one that has the actual modal on it, and then on close setting the current page back to 1. Can you look into this perhaps? If it's not too much of a hassle, could you change this for each of the modals?
There was a problem hiding this comment.
@dburkhart07 bello just wanted to get more clarification on why we want to set the page back to 1? when the user clicks x out of the modal, it makes sense for the page to stay (not reset) there to indicate where that order/donation/etc came from
There was a problem hiding this comment.
hmm you make a good point, let's change it to that.
Yurika-Kan
left a comment
There was a problem hiding this comment.
this is awesome! thanks for adding the pagination deeplinking! found a missing portion regarding admin request management, but should be a quick fix~
| init(); | ||
| }, []); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
@dburkhart07 bello just wanted to get more clarification on why we want to set the page back to 1? when the user clicks x out of the modal, it makes sense for the page to stay (not reset) there to indicate where that order/donation/etc came from
| setWasDeeplinked(true); | ||
| } | ||
| } else { | ||
| navigate(ROUTES.REQUEST_FORM, { replace: true }); |
There was a problem hiding this comment.
when the deeplinked id doesn't match anything, it does navigates to the pantry route (/request-form), so an admin or volunteer hitting ?requestId=999 (not found) goes to an unrelated page. can we change it to match what the close handler does & just strip the query param
| const RequestManagement: React.FC<RequestManagementProps> = ({ | ||
| fetchRequests: fetchData, | ||
| enableVolunteerActions = true, | ||
| initialRequestId, |
There was a problem hiding this comment.
i noticed admin food request deeplink wasn't working & turns out admin wrapper never passed initialRequestId but volunteer wrapper had it from before this pr.
could you abstract the searchParams into this shared component so neither wrapper needs the prop for the deeplink to work?
dburkhart07
left a comment
There was a problem hiding this comment.
i know you just implemented it but, based on yurika's point, can we actually not reset the pagination back to 1 on modal closing?
| setErrorMessage('Error fetching upcoming donations.'); | ||
| } | ||
|
|
||
| if (donations.status === 'fulfilled') { |
There was a problem hiding this comment.
why do we need to check for it to be fulfilled? im trying to think about a case where the food manufacturer ships out a donation, and while being shipped (or maybe a volunteer updates the status to fulfilled much later), there is a chance it could be sooner than some of the other fulfilled status orders. lmk your thoughts/if this makes sense.
ℹ️ Issue
Closes https://vidushimisra.atlassian.net/browse/SSF-205
📝 Description
I simply implemented the food manufacturer dashboard frontend and linking functionality for both upcoming and recent donations.
/fm-dashboard
✔️ Verification
Verified proper functionality and aligned design with figma
🏕️ (Optional) Future Work / Notes
N/A