diff --git a/app/views/donation_sites/create.js.erb b/app/views/donation_sites/create.js.erb
index 4822f7aff9..37311f998f 100644
--- a/app/views/donation_sites/create.js.erb
+++ b/app/views/donation_sites/create.js.erb
@@ -2,5 +2,5 @@
$("#modal_new").modal("hide");
$("#donation_donation_site_id").empty();
$("#donation_donation_site_id").html('<%= j options_from_collection_for_select(current_organization.donation_sites, :id, :name) %>');
-$("#donation_donation_site_id").append('');
+$("#donation_donation_site_id").append('');
$("#donation_donation_site_id").val('<%= @donation_site[:id] %>');
diff --git a/spec/system/donation_system_spec.rb b/spec/system/donation_system_spec.rb
index e94e8789a7..10a23622f3 100644
--- a/spec/system/donation_system_spec.rb
+++ b/spec/system/donation_system_spec.rb
@@ -261,6 +261,19 @@
select "drivenametest", from: "donation_product_drive_id"
end
+ it "Allows User to create a Donation Site from donation" do
+ select Donation::SOURCES[:donation_site], from: "donation_source"
+ select "---Create New Donation Site---", from: "donation_donation_site_id"
+
+ find(".modal-content")
+ expect(page).to have_content("New Donation Site")
+
+ fill_in "donation_site_name", with: "donationsitetest"
+ fill_in "donation_site_address", with: "1500 Remount Road, Front Royal, VA 22630"
+ click_on "donation-site-submit"
+ select "donationsitetest", from: "donation_donation_site_id"
+ end
+
it "Allows User to create a Product Drive Participant from donation" do
select Donation::SOURCES[:product_drive], from: "donation_source"
select "---Create new Participant---", from: "donation_product_drive_participant_id"
From 41e292865ca81f9c79856aaad23ccf9cd1422a27 Mon Sep 17 00:00:00 2001
From: Neenu Chacko <45137335+neenu-chacko@users.noreply.github.com>
Date: Sat, 19 Apr 2025 20:48:15 +0530
Subject: [PATCH 4/5] Updated documentation
---
docs/user_guide/bank/essentials_donations.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/user_guide/bank/essentials_donations.md b/docs/user_guide/bank/essentials_donations.md
index 8315229cf1..79f83025ca 100644
--- a/docs/user_guide/bank/essentials_donations.md
+++ b/docs/user_guide/bank/essentials_donations.md
@@ -67,7 +67,7 @@ For Product Drive, Manufacturer, or Donation Site, you will further specify the
If you specify Product drive, you'll also need to specify the particular drive and participant for the Donation -- but you can enter them "on the fly", here. You can view summaries for the Product Drives in [Product Drives](product_drives.md), and manage the contact info for a Product Drive Participant under [Community -- Product Drive Participants](community_product_drive_participants.md).
##### *Donation Site
Donation Site is meant to capture the concept of any place you have a more-or-less permanent place people can drop off donations at, such as your main office, or community locations such as fire halls, etc.
-You can see the Donations for each Donation Site and manage their contact information under [Community -- Donation Sites](community_donation_sites.md). Unlike Product Drives, you can't create a new Donation Site 'on the fly' through the fields here
+You can see the Donations for each Donation Site and manage their contact information under [Community -- Donation Sites](community_donation_sites.md). Like Product Drives, you can create a new Donation Site 'on the fly' through the fields here too.
##### *Manufacturer
This is for the donations that come straight from a Manufacturer. You can view a breakdown of the Donations for each Manufacturer under [Community -- Manufacturers](community_manufacturers.md)
##### *Misc. Donation
From 8865ce59cacb4d18a1aa55b18eb63b00fae77104 Mon Sep 17 00:00:00 2001
From: Neenu Chacko <45137335+neenu-chacko@users.noreply.github.com>
Date: Sun, 27 Apr 2025 20:05:55 +0530
Subject: [PATCH 5/5] Removed extra check
---
app/controllers/donation_sites_controller.rb | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/app/controllers/donation_sites_controller.rb b/app/controllers/donation_sites_controller.rb
index 5f6aa5becb..78e6a5d00c 100644
--- a/app/controllers/donation_sites_controller.rb
+++ b/app/controllers/donation_sites_controller.rb
@@ -35,10 +35,9 @@ def create
def new
@donation_site = current_organization.donation_sites.new
- if request.xhr?
- respond_to do |format|
- format.js { render template: "donation_sites/new_modal" }
- end
+ respond_to do |format|
+ format.html
+ format.js { render template: "donation_sites/new_modal" }
end
end