Conversation
dburkhart07
left a comment
There was a problem hiding this comment.
very clean pr justin!!!! one other thing, can we rename this route to admin-dashboard now, since its no longer the test one?
Yurika-Kan
left a comment
There was a problem hiding this comment.
looking so so great! mostly nits & comprehensive error prevention comments~
thanks justin! everything is coming together!
| /> | ||
| )} | ||
| <Heading textStyle="h1" color="gray.600" mb={6}> | ||
| Welcome, Admin! |
There was a problem hiding this comment.
should be welcome, [user's name]
no exclamation (exciting still though)
| Pending Actions | ||
| </Text> | ||
| <Box display="grid" gridTemplateColumns="repeat(2, 1fr)" gap={4} mb={16}> | ||
| {pendingApplications.map((application) => ( |
There was a problem hiding this comment.
for mapping over (on line 86, 113, 137)
the maps render <dashboardcard ... /> without a key, which leads to react logs giving "Warning: Each child in a list should have a unique 'key' prop". no key means it falls back to using array index, which causes wrong cards to rerender or keep stale state when the list reorders
can we include key=entity.entityid for each of these maps?
| }, [selectedManufacturers]); | ||
|
|
||
| useEffect(() => { | ||
| const donationIdFromUrl = searchParams.get('donationId'); |
There was a problem hiding this comment.
nit: can we also do an early return if the donationIdFromUrl is null ie there is nothing to look up
| id: number; | ||
| name: string; | ||
| type: 'pantry' | 'food_manufacturer'; | ||
| dateApplied: Date; |
There was a problem hiding this comment.
for consistency with other types, can we use string here? since all uses of this field wrap it with new Date() anyways
There was a problem hiding this comment.
in the nav bar, can we have Dashboard point to the actual admin dashboard?
ℹ️ Issue
Closes https://vidushimisra.atlassian.net/jira/software/projects/SSF/boards/1?selectedIssue=SSF-198
📝 Description
Added proper display and functionality of admin dashboard frontend pending action, recent order, and recent donation cards. They also navigate to the corresponding application, order and donation.
http://localhost:4200/test-admin-dashboard
✔️ Verification
Verified frontend and design matched and proper information is displayed on each card. Verified proper navigation.
🏕️ (Optional) Future Work / Notes
Should this route still be named test-admin-dashboard? other than that n/a