Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add editable Campaign dropdown to Donation Details screen #7859

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

pauloiankoski
Copy link
Contributor

@pauloiankoski pauloiankoski commented Apr 3, 2025

Resolves GIVE-2367

Description

This pull request adds a Campaign dropdown to the Donation Details screen in the admin. It displays the campaign currently assigned to the donation and also allows admins to reassign the donation to a different campaign.

Additionally, this PR updates the action triggered when the Donation object is updated, ensuring that the campaign_id property is also updated in the revenue table.

Affects

Donation Details screen

Visuals

CleanShot 2025-04-03 at 19 03 29

CleanShot.2025-04-04.at.20.50.28.mp4

Edit: Added filter to Donation Forms dropdown based on the selected Campaign

Testing Instructions

  1. Make a donation using a donation form that’s assigned to a campaign.
  2. Go to the admin panel and open the donation you just made.
  3. In the Donation Details screen, you should see a Campaign dropdown showing the campaign that was assigned to the form at the time of the donation.
  4. Change the selected campaign using the dropdown.
  5. Save or update the donation, then confirm that the change is reflected correctly (e.g. in the revenue table or wherever it’s used).

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

Copy link
Contributor

@jonwaldstein jonwaldstein left a comment

Choose a reason for hiding this comment

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

@pauloiankoski you're a beast!! just left a couple comments, let me know your thoughts 😄

Copy link
Contributor

@jonwaldstein jonwaldstein left a comment

Choose a reason for hiding this comment

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

@pauloiankoski nice job man!

@jonwaldstein
Copy link
Contributor

@pauloiankoski some last minute feedback on this. Can we limit the donation form dropdown list by the selected Campaign?

@pauloiankoski
Copy link
Contributor Author

@jonwaldstein Implemented the filter on 47c5e99.

Here’s my thought: since we’ve always been loading all forms from the beginning, why not keep doing it that way and handle everything with JavaScript, avoiding extra API requests? What I did was manually rebuild the Campaigns query to only include the necessary data for the dropdown (instead of loading the full model with all fields), but now including all related form_ids. Then, using JS, we use that data to create the relationship between the Campaigns dropdown and the Forms dropdown.

@pauloiankoski
Copy link
Contributor Author

pauloiankoski commented Apr 7, 2025

CleanShot 2025-04-06 at 21 45 15

Latest update: flash forms dropdown on changing the selected campaign. See

Copy link
Contributor

@jonwaldstein jonwaldstein left a comment

Choose a reason for hiding this comment

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

@pauloiankoski nice job! ready for QA 🌈

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