Skip to content

Add Drive Participant column to the donation details page (5590)#5598

Open
augustocbx wants to merge 1 commit into
rubyforgood:mainfrom
augustocbx:5590-show-product-drive-participant-on-donation-view
Open

Add Drive Participant column to the donation details page (5590)#5598
augustocbx wants to merge 1 commit into
rubyforgood:mainfrom
augustocbx:5590-show-product-drive-participant-on-donation-view

Conversation

@augustocbx

Copy link
Copy Markdown

Resolves #5590

Description

The donation details page did not show the product drive participant, even though it is captured when creating a product drive donation. This adds a Drive Participant column to the donation summary table, between Donation Site and Storage Location, as specified in the issue.

The participant is displayed by business name, falling back to contact name — the same representation used in the participant dropdown on the donation form, so users see the same label they picked when creating the donation. When the donation has no participant, the column shows N/A, consistent with the existing Donation Site and Storage Location columns.

Implementation mirrors the existing Donation#donation_site_view / #storage_view pattern with a new Donation#drive_participant_view, backed by a new ProductDriveParticipant#display_name.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Added two request spec examples to spec/requests/donations_requests_spec.rb (GET #show): one asserting the participant's business name appears in the new column positioned right after Donation Site, and one asserting N/A for a donation without a participant. Both were written first and failed before the change.

  • bundle exec rspec spec/requests/donations_requests_spec.rb — 43 examples, 0 failures
  • bundle exec rspec spec/models/donation_spec.rb spec/models/product_drive_participant_spec.rb — 51 examples, 0 failures
  • bundle exec rspec spec/system/donation_system_spec.rb -e "When viewing an existing donation" — 4 examples, 0 failures
  • bundle exec rubocop on touched files and bundle exec erb_lint on the view — no offenses

Screenshots

Before / after screenshots coming in a follow-up comment.

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.

Add product drive participant to donations view

1 participant