Skip to content

Commit

Permalink
Merge pull request #4991 from Oce-ane/issue_4979_donation_site
Browse files Browse the repository at this point in the history
issue #4979: Donation site screen improvement
  • Loading branch information
cielf authored Feb 7, 2025
2 parents 53def81 + 67d53ba commit 69c4891
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 94 deletions.
1 change: 0 additions & 1 deletion app/controllers/donation_sites_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def create
render action: :new
end
end
format.js { render partial: "shared/table_row_prepend", object: @donation_site }
end
end

Expand Down
18 changes: 0 additions & 18 deletions app/views/donation_sites/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,6 @@
<h3 class="card-title">Donation Sites</h3>
</div>
<!-- /.card-header -->
<!-- form start -->
<div class="card-body">
<table class="table">
<thead>
<tr>
<th>Donation Site</th>
<th>Address</th>
<th>Contact Name</th>
<th>E-mail</th>
<th>Phone</th>
<th>&nbsp;</th>
</tr>
<%= render partial: 'shared/table_row_form',
object: @donation_site,
locals: {columns: [{name: :text_field}, {address: :text_field}, {contact_name: :text_field}, {email: :text_field}, {phone: :text_field}]} %>
</thead>
</table>
</div>
<div class="card-footer">
<div class="pull-right">
<%= modal_button_to("#csvImportModal", {icon: "upload", text: "Import Donation Sites", size: "md"}) if @donation_sites.empty? %>
Expand Down
10 changes: 0 additions & 10 deletions app/views/shared/_table_row_form.html.erb

This file was deleted.

20 changes: 0 additions & 20 deletions app/views/shared/_table_row_prepend.js.erb

This file was deleted.

23 changes: 11 additions & 12 deletions docs/user_guide/bank/community_donation_sites.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
READY FOR REVIEW
# Donation Sites

Donation Sites are places where people drop off Donations.
Donation Sites are places where people drop off Donations.

## The Donation Site list
You can manage the sites' information on the "Donation Sites" page under the "Community" section.
You can manage the sites' information on the "Donation Sites" page under the "Community" section.

![Donation Sites](images/community/donation_sites/donation_sites.jpg)
![Donation Sites](images/community/donation_sites/donation_sites.png)

Previously recorded information about Donation Sites appears on this page including the name of the Donation Site name, address, contact name, e-mail and phone number.

### Adding a Donation Site

Create a new site by populating the Donation Site, address, contact name, e-mail and phone fields and clicking the "Create" button.
Create a new site by clicking the "+ New Donation Site" button.

![Create Donation_Site](images/community/donation_sites/create_donation_site.jpg)
![Create Donation Site](images/community/donation_sites/create_donation_site.png)

Note that the Donation Site and address fields are mandatory while the contact name, email and phone are optional.

You can also use the "+ New Donation Site" button which renders a form for you to fill in details of a new Donation Site.
This renders a form for you to fill the site's name, address, contact name, e-mail, and phone number. After entering the required details, click the "Save" button to create the new Donation Site.

![Add Donation Site](images/community/donation_sites/add_new_donation_site.jpg)

![Add Donation_Site](images/community/donation_sites/add_new_donation_site.jpg)
Note that the Donation Site and address fields are mandatory while the contact name, email and phone are optional.

After saving the site's details there will be a new row on the Donation Sites page.

Expand All @@ -43,12 +42,12 @@ Use the "Deactivate" button to hide a Donation Site that is no longer active.

##### (NB) at time of writing there is no way for you to undo this.

![Deactivate Donation Sites](images/community/donation_sites/deactivate_donation_site.jpg)
![Deactivate Donation Sites](images/community/donation_sites/deactivate_donation_site.png)

## Exporting Donation Sites

You can export the active Donation Sites by clicking on the "Export Donation Sites" button. This will provide a .csv file containing the name, address, and contact information for each active Donation Site.

![Export Donation Sites](images/community/donation_sites/export_donation_sites.jpg)
![Export Donation Sites](images/community/donation_sites/export_donation_sites.png)

[Prior: Product Drive Participants](community_product_drive_participants.md)[Next: Vendors](community_vendors.md)
[Prior: Product Drive Participants](community_product_drive_participants.md)[Next: Vendors](community_vendors.md)
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 0 additions & 33 deletions spec/system/donation_site_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,6 @@
expect(page.find(:xpath, "//table/tbody/tr[1]/td[1]")).to have_content(@first.name)
expect(page.find(:xpath, "//table/tbody/tr[3]/td[1]")).to have_content(@third.name)
end

it "allows the user to quick-create a new donation site only with required fields" do
visit subject
donation_site_name = "A Unique Donation Site Name"
donation_site_address = "1500 Remount Road, Front Royal, VA 22630"

fill_in "donation_site_name", with: donation_site_name
fill_in "donation_site_address", with: donation_site_address
click_button "Create"
expect(page.find("tbody tr")).to have_content(donation_site_name)
expect(page.find("tbody tr")).to have_content(donation_site_address)
end

it "allows the user to quick-create a new donation site with all fields including optional ones" do
visit subject
donation_site_name = "A Unique Donation Site Name"
donation_site_address = "1500 Remount Road, Front Royal, VA 22630"
donation_site_contact_name = "John Doe"
donation_site_phone = "123-456-7890"
donation_site_email = "asda2@gmail.com"

fill_in "donation_site_name", with: donation_site_name
fill_in "donation_site_address", with: donation_site_address
fill_in "donation_site_contact_name", with: donation_site_contact_name
fill_in "donation_site_phone", with: donation_site_phone
fill_in "donation_site_email", with: donation_site_email
click_button "Create"
expect(page.find("tbody tr")).to have_content(donation_site_name)
expect(page.find("tbody tr")).to have_content(donation_site_address)
expect(page.find("tbody tr")).to have_content(donation_site_contact_name)
expect(page.find("tbody tr")).to have_content(donation_site_phone)
expect(page.find("tbody tr")).to have_content(donation_site_email)
end
end

context "When creating a new donation site" do
Expand Down

0 comments on commit 69c4891

Please sign in to comment.