Skip to content

Conversation

@Juwang110
Copy link

ℹ️ Issue

Closes Food Manufacturer Dashboard

📝 Description

I added support for the Food Manufacturer Dashboard. This page features a hamburger menu for various page navigation. It also displays details about the current manufacturer such as email, number of donations, etc. Here you can also update the frequency of donations that a manufacturer wants (weekly, monthly, etc.). This information is stored and updated in the database. This page is important because it will serve as a hub for food manufacturers to look at their own information and navigate to places they need as well as update their requested donation frequency.

Briefly list the changes made to the code:

  1. Added manufacturer dashboard page
  2. Backend support for food manufacturer table
  3. Support for updating manufacturer's donation frequency

✔️ Verification

I verified that data displayed on my page matched with the database for the given manufacturer using manually inputted data. To verify the put request for donation frequency I changed it in the frontend and verified these changes took place in PGAdmin.

Screenshot 2025-04-03 215305
Screenshot 2025-04-03 215718

🏕️ (Optional) Future Work / Notes

The hamburger menu doesn't have functionality for the following routes: profile, orders, donation statistics, sign out. Sign out functionality and orders page are waiting to be merged in so we can update this page once that is done.

Copy link
Collaborator

@sam-schu sam-schu left a comment

Choose a reason for hiding this comment

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

A few comments:

  1. The frontend error handling for an invalid food manufacturer ID is inconsistent - for example, if I create a food manufacturer with ID 1, /food-manufacturer-dashboard/0 will cause the dashboard to show up but with all the values blank, while /food-manufacturer-dashboard/2 will give

    Oops!
    Sorry, an unexpected error has occurred.
    Cannot read properties of undefined (reading 'firstName')

    Could we make both of these cases give a more user-friendly error message saying the manufacturer could not be found?

  2. For the "Update Frequency of Donations" section of the dashboard:

    • Is the "x" after "Current Frequency:" a placeholder?
    • When donation_frequency is NULL, could we make the "Current Frequency" line show something more meaningful? Currently, it shows "Current Frequency: x donations," just without the frequency at the end.
    • Can we make it so that when you update the donation frequency, the current frequency updates on the dashboard without having to refresh the page?
    • I know this section had to be made different than the original design now that we want the number of donations per week, month, etc. to always be 1, but could we change the "A donation" text before the dropdown to something clearer (maybe "New Frequency:")? I was confused what that meant when I first saw it.

I like the overall appearance of the dashboard, and the backend looks good!

@Juwang110
Copy link
Author

A few comments:

  1. The frontend error handling for an invalid food manufacturer ID is inconsistent - for example, if I create a food manufacturer with ID 1, /food-manufacturer-dashboard/0 will cause the dashboard to show up but with all the values blank, while /food-manufacturer-dashboard/2 will give

    Oops!
    Sorry, an unexpected error has occurred.
    Cannot read properties of undefined (reading 'firstName')

    Could we make both of these cases give a more user-friendly error message saying the manufacturer could not be found?

  2. For the "Update Frequency of Donations" section of the dashboard:

    • Is the "x" after "Current Frequency:" a placeholder?
    • When donation_frequency is NULL, could we make the "Current Frequency" line show something more meaningful? Currently, it shows "Current Frequency: x donations," just without the frequency at the end.
    • Can we make it so that when you update the donation frequency, the current frequency updates on the dashboard without having to refresh the page?
    • I know this section had to be made different than the original design now that we want the number of donations per week, month, etc. to always be 1, but could we change the "A donation" text before the dropdown to something clearer (maybe "New Frequency:")? I was confused what that meant when I first saw it.

I like the overall appearance of the dashboard, and the backend looks good!

Justin: I think I addressed all of the above

@Juwang110 Juwang110 requested a review from sam-schu September 16, 2025 02:27
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.

4 participants