Skip to content

Jx/ssf 202 dashboard stats#183

Open
jxuistrying wants to merge 2 commits into
mainfrom
jx/SSF-202-dashboard-stats
Open

Jx/ssf 202 dashboard stats#183
jxuistrying wants to merge 2 commits into
mainfrom
jx/SSF-202-dashboard-stats

Conversation

@jxuistrying
Copy link
Copy Markdown

ℹ️ Issue

Closes #202

📝 Description

Write a short summary of what you added. Why is it important? Any member of C4C should be able to read this and understand your contribution -- not just your team members.

I connected frontend ui to stats endpoint to display top 4 stats on dashboards

Briefly list the changes made to the code:

  1. Added interface for stats responses
  2. Added getUserStats(userId) method to ApiClient to call stats endpoint
  3. Updated adminDashboard.tsx, volunteerDashboard.tsx, and pantryDashboard.tsx to display stats

✔️ Verification

logged in with admin and volunteer accounts to check that the stats is displayed on the dashboard
image
image

🏕️ (Optional) Future Work / Notes

I couldn't log in as a valid pantry user still so I still have to check if the pantry stats is displayed but the stats should be working

@jiang-h-y jiang-h-y self-requested a review May 24, 2026 20:01
@Yurika-Kan Yurika-Kan self-assigned this May 25, 2026
Copy link
Copy Markdown

@jiang-h-y jiang-h-y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pantry, admin, and volunteer stats look good.

Similarly to the empty state ticket, might want to wait until the FM dashboard is merged.

@Yurika-Kan Yurika-Kan self-requested a review May 31, 2026 02:22
@Yurika-Kan
Copy link
Copy Markdown
Collaborator

@jxuistrying btw - justin's FM dashboard pr has been merged! could you add the stats for FM dashboards~

Copy link
Copy Markdown
Collaborator

@Yurika-Kan Yurika-Kan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left comments regarding cleaning the pr, simplifying implementation, and a design bug!

  • pls add fmdashboard to this pr as well :)

foodRescue?: boolean;
}

export interface AdminVolunteerStats {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these types already exist as their own dtos when the backend was done~ so these con't need to be in here!

take a look as [users.controller.ts:43] where it wires all 3 stat dtos

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls remove these duplicate files / changes of your other pr!

/>
))}
</Box>
{stats && <DashboardStats stats={stats} />}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you investigate the frontend component and align the leftmost & rightmost (edges) of the top stat cards with the leftmost & rightmost of the bottom action cards?

see figma: https://www.figma.com/design/brc5luMhizIFp893XIutYe/SP26---SSF-Designs?node-id=1548-10689&t=t4V3LpXPMkcEiRMS-4

vs our current version:
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants