Skip to content

[SSF-232] Edit & Delete Donation Items Frontend#199

Open
jiang-h-y wants to merge 4 commits into
mainfrom
hj/SSF-232-edit-delete-donations
Open

[SSF-232] Edit & Delete Donation Items Frontend#199
jiang-h-y wants to merge 4 commits into
mainfrom
hj/SSF-232-edit-delete-donations

Conversation

@jiang-h-y

Copy link
Copy Markdown

ℹ️ Issue

Closes SSF-232

📝 Description

For /fm-donation-management:

  • added edit/delete buttons for donations
  • added editing view + delete modal

✔️ Verification

Tested cases for:

  • editing donations
  • adding/removing donation rows
  • updating donations without making any changes
  • deleting donations
  • no edit/delete buttons if the user is not a FM or if the donation already has allocations (matches editDonationItems backend)
  • all fields are required

Edit/Delete Buttons:
image

Editing View:
image

Delete Modal:
image

🏕️ (Optional) Future Work / Notes

  • made a small bug fix where i removed ownership guards for creating donations (may need to revisit this)
  • not sure if deleting donations should be allowed if there already are allocations

what's the difference between "matched" and "available" donations?

i have an "available" donation with allocations, so no edit/delete buttons are displayed (screenshot).

if some "available" donations have edit/delete buttons (no allocations) and some don't have these buttons (because they have allocations), i think it's kind of confusing for the user since both donations are under "available." it would be helpful to put a note/visual indicator that "available" donations with allocations cannot be edited/deleted.

image

@dburkhart07 dburkhart07 self-assigned this Jun 24, 2026
@jiang-h-y jiang-h-y self-assigned this Jun 24, 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.

looking good so far! just some small things

Comment thread apps/frontend/src/components/editDeleteButtons.tsx Outdated
Comment thread apps/backend/src/donations/donations.controller.ts
Comment thread apps/frontend/src/components/forms/donationDetailsModal.tsx
Comment thread apps/frontend/src/components/forms/donationDetailsModal.tsx Outdated
Comment thread apps/frontend/src/components/forms/donationDetailsModal.tsx Outdated
Comment thread apps/frontend/src/components/forms/donationDetailsModal.tsx Outdated
Comment thread apps/frontend/src/components/forms/donationDetailsModal.tsx Outdated
Comment thread apps/frontend/src/components/forms/donationDetailsModal.tsx Outdated
</Dialog.Title>
{currentUser?.role === Role.FOODMANUFACTURER &&
donation.status === DonationStatus.AVAILABLE &&
!hasAllocations && (

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

correct me if im wrong, but i think these checks are redundant. a donation that is available means it has no allocations attached to it. i think we can remove this and hasAllocations entirely

@jiang-h-y jiang-h-y Jun 25, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

In the db, there's a donation that is "available" but has allocations (screenshot). Without the check, the buttons render but don't allow edits/deletes.

Not sure if this donation is just for testing purposes, so if we don't think that this will be a general issue, I can remove this check.

image image

Comment thread apps/frontend/src/containers/foodManufacturerDonationManagement.tsx Outdated
@jiang-h-y jiang-h-y requested a review from dburkhart07 June 25, 2026 10:05
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.

2 participants