Skip to content

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

Open
jiang-h-y wants to merge 10 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 10 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!!

isOpen={deleteRequest !== null}
onClose={() => setDeleteRequest(null)}
onSuccess={() => {
setAlertMessage('Successfully deleted food request.');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note: Once you merge in your PR for fixing the alert messages, you'll need to adjust this to be a success (right now, it shows up as an error, but don't bother fixing that till your later PR comes in)

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
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.

onDelete,
}) => {
useModalBodyCleanup();
const { authStatus } = useAuthenticator((context) => [context.authStatus]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

we should only be using this for components that are not within a protected route, since the protected route wrapper already calls this, and we know we will have the user before getting here. can we just do a regular await ApiClient.getMe()?

gap={1}
borderRadius="sm"
color={'neutral.800'}
background="neutral.50"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this is supposed to be F4F4F5, can we turn this into grey.subtle as well?

flexShrink={0}
borderRadius="sm"
color="red.hover"
background="red.200"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is supposed to be #FEE2E2. Can we make this red.subtle?

</Text>
</Box>
<Flex justifyContent="flex-end" gap={2.5}>
<Button

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we get a little more horizontal padding, it kinda looks squished compared to the figma. Same with the Delete button

@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

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