Skip to content

[SSF-226] Pantry Deleting & Editing Food Requests Frontend#186

Open
jiang-h-y wants to merge 14 commits into
mainfrom
hj/SSF-226-pantry-delete-edit-requests
Open

[SSF-226] Pantry Deleting & Editing Food Requests Frontend#186
jiang-h-y wants to merge 14 commits into
mainfrom
hj/SSF-226-pantry-delete-edit-requests

Conversation

@jiang-h-y

Copy link
Copy Markdown

ℹ️ Issue

Closes SSF-226

📝 Description

  • added edit and delete buttons
  • added editing view + delete request modal
  • added success/error toasts
    • Note: the status for the toasts are temporarily incorrect + hard-coded since I recently refactored alerts in a different branch, and I would rather use the refactored version once it's merged.
  • connected to existing backend endpoints
  • edge case handling for if the user:
    • clears "Additional Information"
    • makes back-to-back edits without closing the modal
    • clicks "Update Request" but changes nothing

✔️ Verification

  • tested edit/delete request flows
  • verified that changes are committed to the database

Base Request Modal:
image

Editing View:
image

Delete Request Modal:
image

Success Toast Example:
image

🏕️ (Optional) Future Work / Notes

  • not sure if some of my design choices (colors, hover, etc.) were consistent with the rest of the codebase
  • sometimes received this error, but I couldn't reproduce it:
    Uncaught Error: Your focus-trap needs to have at least one focusable element

@jiang-h-y jiang-h-y self-assigned this May 31, 2026

@dburkhart07 dburkhart07 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

few things, looking beautiful tho!!

Comment thread apps/frontend/src/containers/formRequests.tsx Outdated
Comment thread apps/frontend/src/components/forms/requestDetailsModal.tsx Outdated
Comment thread apps/frontend/src/components/forms/requestDetailsModal.tsx Outdated
Comment thread apps/frontend/src/components/forms/requestDetailsModal.tsx Outdated
Comment thread apps/frontend/src/theme.ts Outdated
Comment thread apps/frontend/src/components/forms/pantryDeleteRequestModal.tsx Outdated
Comment thread apps/frontend/src/components/forms/pantryDeleteRequestModal.tsx Outdated
Comment thread apps/frontend/src/components/foodRequestManagement.tsx Outdated
@dburkhart07 dburkhart07 self-assigned this Jun 1, 2026
@Yurika-Kan Yurika-Kan self-requested a review June 3, 2026 00:34
@Yurika-Kan Yurika-Kan self-assigned this Jun 3, 2026
@jiang-h-y

Copy link
Copy Markdown
Author

Closed requests no longer have edit/delete buttons:
image

Admin + volunteer view (with only a delete button):
image

@jiang-h-y

Copy link
Copy Markdown
Author

Currently, trying to delete a food request as an admin/volunteer will return an error. Pretty sure it's because of role gating in the backend, so I didn't try to fix it for ticket separation purposes.

But if it's a different issue/if it's better to address it here, I can fix the role gating.

@dburkhart07 dburkhart07 self-requested a review June 8, 2026 07:35

@dburkhart07 dburkhart07 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

some very small changes so i trust to approve. functionality looks great.

regarding the unauthorized access. perhaps if you want to copy the request.controller file from https://github.com/Code-4-Community/ssf/pull/185/changes#diff-b57a26ea6a57a9ef34ba9812231f9f3dabd0397c2c252a1e777b3a0aa367858b this will allow it to keep the intended functionality

also just make sure the alert comment gets addressed, since that pr should be good to merge.

Comment thread apps/frontend/src/components/forms/requestDetailsModal.tsx Outdated
Comment thread apps/frontend/src/components/editDeleteButtons.tsx Outdated
Comment thread apps/frontend/src/components/editDeleteButtons.tsx Outdated
Comment thread apps/frontend/src/components/forms/pantryDeleteRequestModal.tsx
@jiang-h-y jiang-h-y requested a review from dburkhart07 June 8, 2026 14:09

@dburkhart07 dburkhart07 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

see new comments above

@Yurika-Kan Yurika-Kan left a comment

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.

getting a few nest errors preventing the backend from running correctly:
Nest can't resolve dependencies of the OrdersService (OrderRepository, PantryRepository, DonationRepository, FoodRequestRepository, RequestsService, UsersService, FoodManufacturersService, DonationItemsService, AllocationsService, ?, DonationService, DataSource, EmailsService). Please make sure that the argument PantriesService at index [9] is available in the OrdersModule context. - seems to be from ssf-212

great pr! just some logistics & flattening stuff out~

Comment thread apps/frontend/src/components/forms/pantryDeleteRequestModal.tsx Outdated
Comment thread apps/frontend/src/components/editDeleteButtons.tsx
Comment thread apps/frontend/src/components/forms/requestDetailsModal.tsx Outdated
Comment thread apps/frontend/src/components/forms/requestDetailsModal.tsx Outdated
Comment thread apps/frontend/src/components/forms/requestDetailsModal.tsx
Comment thread apps/frontend/src/components/forms/requestDetailsModal.tsx Outdated
@dburkhart07

Copy link
Copy Markdown

getting a few nest errors preventing the backend from running correctly: Nest can't resolve dependencies of the OrdersService (OrderRepository, PantryRepository, DonationRepository, FoodRequestRepository, RequestsService, UsersService, FoodManufacturersService, DonationItemsService, AllocationsService, ?, DonationService, DataSource, EmailsService). Please make sure that the argument PantriesService at index [9] is available in the OrdersModule context. - seems to be from ssf-212

great pr! just some logistics & flattening stuff out~

This is fixed on merging main in

@jiang-h-y

Copy link
Copy Markdown
Author

Still waiting on the verdict for colors, but I'm currently using button colors from here:
https://www.figma.com/design/brc5luMhizIFp893XIutYe/SP26---SSF-Designs?node-id=4366-18805&m=dev

And hover colors from here:
https://www.figma.com/design/brc5luMhizIFp893XIutYe/SP26---SSF-Designs?node-id=1-1261&p=f&m=dev

@Yurika-Kan Yurika-Kan left a comment

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.

LGTM you are awesome!

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