Skip to content

Commit

Permalink
Merge branch 'main' into 4486-address-pickup-email-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
panacotar committed Sep 16, 2024
2 parents 91d4db1 + d59c559 commit ab7eba7
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 21 deletions.
1 change: 1 addition & 0 deletions app/views/distributions/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<div class="distribution-title">
<legend class="<%= 'with-request' if distribution.request %>">Items in this distribution</legend>
<% if distribution.request %>
<div class="distribution-request-unit">Quantity - Total Units</div>
<div class="distribution-request-unit">Requested</div>
<% end %>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/partners/navigation/_sidebar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<li class="nav-item">
<%= link_to(partners_profile_path, class: "nav-link") do %>
<i class="nav-icon fa fa-building"></i>
<p>My Organization</p>
<p>My Profile</p>
<% end %>
</li>

<li class="nav-item">
<%= link_to(edit_partners_profile_path, class: "nav-link") do %>
<i class="nav-icon fa fa-cog"></i>
<p>Edit My Organization</p>
<p>Edit My Profile</p>
<% end %>
</li>

Expand Down
4 changes: 2 additions & 2 deletions app/views/partners/_partner_row.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
<%= invite_button_to(invite_partner_path(partner_row), confirm: "Send an invitation to #{partner_row.name} to begin using the partner application?") %>
<% end %>
<% when "invited" %>
<%= view_button_to partner_path(partner_row) + "#partner-information", { text: "Review Application", icon: "check", type: "warning" } %>
<%= view_button_to partner_path(partner_row) + "#partner-information", { text: "Review Applicant's Profile", icon: "check", type: "warning" } %>
<%= invite_button_to(invite_partner_path(partner_row), confirm: "Re-send an invitation to #{partner_row.name}?", text: 'Re-send Invite') %>
<% when "awaiting_review" %>
<%= view_button_to partner_path(partner_row) + "#partner-information", { text: "Review Application", icon: "check", type: "warning" } %>
<%= view_button_to partner_path(partner_row) + "#partner-information", { text: "Review Applicant's Profile", icon: "check", type: "warning" } %>
<% when "approved" %>
<%= button_to recertify_partner_partner_path(partner_row), data: { confirm: "Recertify partner #{partner_row.name}?"}, class: "btn btn-xs bg-red" do %>
<i class="fa fa-refresh"></i> Request Recertification
Expand Down
2 changes: 1 addition & 1 deletion app/views/partners/profiles/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="row mb-2">
<div class="col-sm-6">
<% content_for :title, "Editing - #{current_partner.name}" %>
<h1><i class="fa fa-edit"></i>&nbsp;&nbsp;Edit My Organization&nbsp;&nbsp;&nbsp;
<h1><i class="fa fa-edit"></i>&nbsp;&nbsp;Edit My Profile&nbsp;&nbsp;&nbsp;
<%= partner_status_badge(current_partner) %>
<small>for <%= current_partner.name %></small>
</h1>
Expand Down
2 changes: 1 addition & 1 deletion app/views/partners/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
<section class="card card-info card-outline" id='partner-information'>
<div class="card-header">
<div class="clearfix">
<h2 class="card-title">Application & Information</h2>
<h2 class="card-title">Partner Profile</h2>
</div>
<div class='pull-right'>
<% unless @partner.approved? %>
Expand Down
23 changes: 17 additions & 6 deletions app/views/purchases/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,28 @@
<div class="card-body p-0">
<table class="table">
<thead>
<tr>
<th>Date of Purchase:</th>
<th>Vendor:</th>
<th>Storage Location:</th>
</tr>
</thead>
<tbody>
<tr>
<th>Date of Purchase:</th>
<th>Vendor:</th>
<th>Storage Location:</th>
<td><%= @purchase.issued_at.to_fs(:distribution_date) %> (entered: <%= @purchase.created_at.to_fs(:distribution_date) %>)</td>
<td><%= @purchase.purchased_from_view %></td>
<td><%= @purchase.storage_view %></td>
</tr>
</table>
<table class="table">
<thead>
<tr>
<th>Comment:</th>
</tr>
</thead>
<tbody>
<tr>
<td><%= @purchase.issued_at.to_fs(:distribution_date) %> (entered: <%= @purchase.created_at.to_fs(:distribution_date) %>)</td>
<td><%= @purchase.purchased_from_view %></td>
<td><%= @purchase.storage_view %></td>
<td><%= @purchase.comment || '' %></td>
</tr>
</table>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/bank/essentials_dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This is pretty much what it sounds like - a list of the requests from your partn
![bottom of dashboard page](images/essentials/dashboard/essentials_dashboard_2.png)

#### Partner Approvals
This lists the partner profiles that have been submitted for approval. Partners can not submit requests until they have been approved. To review the application, click on the "Review Application" button beside the partner in the Action colum. For more details on that, see [Approving a partner](pm_approving_a_partner.md)
This lists the partner profiles that have been submitted for approval. Partners can not submit requests until they have been approved. To review the application, click on the "Review Applicant's Profile" button beside the partner in the Action column. For more details on that, see [Approving a partner](pm_approving_a_partner.md)

#### Bank-wide Low Inventory
This lists items whose *bank-wide* inventory has fallen below the recommended or minimum quantity levels you have set on the items. If the item's level in inventory across the bank has fallen below the minimum quantity, it will appear in red.
Expand Down
16 changes: 15 additions & 1 deletion spec/requests/purchases_requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,21 @@

describe "GET #show" do
let(:item) { create(:item) }
let!(:purchase) { create(:purchase, :with_items, item: item) }
let(:storage_location) { create(:storage_location, organization: organization, name: 'Some Storage') }
let(:vendor) { create(:vendor, organization: organization, business_name: 'Another Business') }
let(:purchase) { create(:purchase, :with_items, comment: 'Fine day for diapers, it is.', created_at: 1.month.ago, issued_at: 1.day.ago, item: item, storage_location: storage_location, vendor: vendor) }

it "shows the purchase info" do
freeze_time do
date_of_purchase = "#{1.day.ago.to_fs(:distribution_date)} (entered: #{1.month.ago.to_fs(:distribution_date)})"

get purchase_path(id: purchase.id)
expect(response.body).to include(date_of_purchase)
expect(response.body).to include('Another Business')
expect(response.body).to include('Some Storage')
expect(response.body).to include('Fine day for diapers, it is.')
end
end

it "shows an enabled edit button" do
get purchase_path(id: purchase.id)
Expand Down
8 changes: 4 additions & 4 deletions spec/system/partner_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
visit partners_path

assert page.has_content? partner_awaiting_approval.name
click_on 'Review Application'
click_on "Review Applicant's Profile"

assert page.has_content?('Application & Information')
assert page.has_content?('Partner Profile')
click_on 'Approve Partner'
assert page.has_content? 'Partner approved!'

Expand All @@ -45,7 +45,7 @@

assert page.has_content? partner_awaiting_approval.name

click_on 'Review Application'
click_on "Review Applicant's Profile"
click_on 'Approve Partner'
assert page.has_content? "Failed to approve partner because: #{fake_error_msg}"

Expand Down Expand Up @@ -539,5 +539,5 @@
def visit_approval_page(partner_name:)
visit partners_path
ele = find('tr', text: partner_name)
within(ele) { click_on "Review Application" }
within(ele) { click_on "Review Applicant's Profile" }
end
4 changes: 2 additions & 2 deletions spec/system/partners/approval_process_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

context 'AND they fill out the form and submit it' do
before do
click_on 'My Organization'
click_on 'My Profile'
assert page.has_content? 'Uninvited'
click_on 'Update Information'

Expand Down Expand Up @@ -76,7 +76,7 @@
partner.profile.update(website: '', facebook: '', twitter: '', instagram: '', no_social_media_presence: false, partner_status: 'pending')
login_as(partner_user)
visit partner_user_root_path
click_on 'My Organization'
click_on 'My Profile'
click_on 'Submit for Approval'
end

Expand Down
2 changes: 1 addition & 1 deletion spec/system/profile_served_area_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
expect(page).to have_content("100 %")
expect(page).not_to have_content("The total client share must be either 0 or 100 %")
click_on "Update Information"
expect(page).to have_content("Application & Information")
expect(page).to have_content("Partner Profile")
expect(page).to have_content("26 %")
end

Expand Down

0 comments on commit ab7eba7

Please sign in to comment.