From 92dd950549604a1ae6ca8a63a1c235057b8a01f9 Mon Sep 17 00:00:00 2001 From: Aaryanpal Date: Fri, 13 Sep 2024 22:44:58 +0530 Subject: [PATCH 1/5] Add Total Quantity header in Distribution Request --- app/views/distributions/_form.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/distributions/_form.html.erb b/app/views/distributions/_form.html.erb index f28782234c..564ec364a2 100644 --- a/app/views/distributions/_form.html.erb +++ b/app/views/distributions/_form.html.erb @@ -36,6 +36,7 @@
Items in this distribution <% if distribution.request %> +
Add Quantity (Total Units)
Requested
<% end %>
From 8be1c547136db22fb6aa08c2eb3cbd0a686344ce Mon Sep 17 00:00:00 2001 From: Aaryanpal Date: Sat, 14 Sep 2024 18:38:55 +0530 Subject: [PATCH 2/5] updated text to Quantity - Total Units --- app/views/distributions/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/distributions/_form.html.erb b/app/views/distributions/_form.html.erb index 564ec364a2..da523a8d3b 100644 --- a/app/views/distributions/_form.html.erb +++ b/app/views/distributions/_form.html.erb @@ -36,7 +36,7 @@
Items in this distribution <% if distribution.request %> -
Add Quantity (Total Units)
+
Quantity - Total Units
Requested
<% end %>
From 81a9ddd03d6cd3bb336dcb8de63d186df74133c7 Mon Sep 17 00:00:00 2001 From: Italo Matos Date: Sun, 15 Sep 2024 16:11:21 -0300 Subject: [PATCH 3/5] change profile terminology --- app/views/layouts/partners/navigation/_sidebar.html.erb | 2 +- app/views/partners/_partner_row.html.erb | 4 ++-- app/views/partners/show.html.erb | 2 +- docs/user_guide/bank/essentials_dashboard.md | 2 +- spec/system/partner_system_spec.rb | 8 ++++---- spec/system/partners/approval_process_spec.rb | 4 ++-- spec/system/profile_served_area_system_spec.rb | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views/layouts/partners/navigation/_sidebar.html.erb b/app/views/layouts/partners/navigation/_sidebar.html.erb index b33ad3afd2..e4422507aa 100644 --- a/app/views/layouts/partners/navigation/_sidebar.html.erb +++ b/app/views/layouts/partners/navigation/_sidebar.html.erb @@ -10,7 +10,7 @@ diff --git a/app/views/partners/_partner_row.html.erb b/app/views/partners/_partner_row.html.erb index e295988684..55d62a13ad 100644 --- a/app/views/partners/_partner_row.html.erb +++ b/app/views/partners/_partner_row.html.erb @@ -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 %> Request Recertification diff --git a/app/views/partners/show.html.erb b/app/views/partners/show.html.erb index a2ee539850..e1280b31f6 100644 --- a/app/views/partners/show.html.erb +++ b/app/views/partners/show.html.erb @@ -189,7 +189,7 @@
-

Application & Information

+

Partner Profile

<% unless @partner.approved? %> diff --git a/docs/user_guide/bank/essentials_dashboard.md b/docs/user_guide/bank/essentials_dashboard.md index 1ef9214ed3..f818402206 100644 --- a/docs/user_guide/bank/essentials_dashboard.md +++ b/docs/user_guide/bank/essentials_dashboard.md @@ -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. diff --git a/spec/system/partner_system_spec.rb b/spec/system/partner_system_spec.rb index e27747f8da..b54b9fc42b 100644 --- a/spec/system/partner_system_spec.rb +++ b/spec/system/partner_system_spec.rb @@ -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!' @@ -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}" @@ -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 diff --git a/spec/system/partners/approval_process_spec.rb b/spec/system/partners/approval_process_spec.rb index cc27021951..26d69cbcd4 100644 --- a/spec/system/partners/approval_process_spec.rb +++ b/spec/system/partners/approval_process_spec.rb @@ -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' @@ -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 diff --git a/spec/system/profile_served_area_system_spec.rb b/spec/system/profile_served_area_system_spec.rb index 9c20d02d9b..b3d260f312 100644 --- a/spec/system/profile_served_area_system_spec.rb +++ b/spec/system/profile_served_area_system_spec.rb @@ -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 From 7c9de7273c0065d5c3c8d13b1aeffafb80fd442d Mon Sep 17 00:00:00 2001 From: Italo Matos Date: Sun, 15 Sep 2024 17:08:51 -0300 Subject: [PATCH 4/5] code review suggestions --- app/views/layouts/partners/navigation/_sidebar.html.erb | 2 +- app/views/partners/profiles/edit.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/partners/navigation/_sidebar.html.erb b/app/views/layouts/partners/navigation/_sidebar.html.erb index e4422507aa..922beb725f 100644 --- a/app/views/layouts/partners/navigation/_sidebar.html.erb +++ b/app/views/layouts/partners/navigation/_sidebar.html.erb @@ -17,7 +17,7 @@ diff --git a/app/views/partners/profiles/edit.html.erb b/app/views/partners/profiles/edit.html.erb index 77f8dd00de..c671712d5e 100644 --- a/app/views/partners/profiles/edit.html.erb +++ b/app/views/partners/profiles/edit.html.erb @@ -3,7 +3,7 @@
<% content_for :title, "Editing - #{current_partner.name}" %> -

  Edit My Organization    +

  Edit My Profile    <%= partner_status_badge(current_partner) %> for <%= current_partner.name %>

From d59c559dd8022f9871c2c17d504de2a3a3431b9c Mon Sep 17 00:00:00 2001 From: VictorHWatanabe <32168967+victorhwmn@users.noreply.github.com> Date: Mon, 16 Sep 2024 12:24:34 -0300 Subject: [PATCH 5/5] 4635: Comment is missing from purchase details (#4642) * chore(model/purchase): add comment_view * feat(view/purchases/show): show comment on purchase details * chore(model/purchase): remove comment_view * fix(purchases/show): indent html * chore(purchases_requests_rspec): use expected value on test * fix(purchases_requests_rspec): use freeze_time on show purchase info test --- app/views/purchases/show.html.erb | 23 +++++++++++++++++------ spec/requests/purchases_requests_spec.rb | 16 +++++++++++++++- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/app/views/purchases/show.html.erb b/app/views/purchases/show.html.erb index d75fb18684..9969b9153c 100644 --- a/app/views/purchases/show.html.erb +++ b/app/views/purchases/show.html.erb @@ -30,17 +30,28 @@
+ + + + + + + - - - + + + +
Date of Purchase:Vendor:Storage Location:
Date of Purchase:Vendor:Storage Location:<%= @purchase.issued_at.to_fs(:distribution_date) %> (entered: <%= @purchase.created_at.to_fs(:distribution_date) %>)<%= @purchase.purchased_from_view %><%= @purchase.storage_view %>
+ + + + + - - - +
Comment:
<%= @purchase.issued_at.to_fs(:distribution_date) %> (entered: <%= @purchase.created_at.to_fs(:distribution_date) %>)<%= @purchase.purchased_from_view %><%= @purchase.storage_view %><%= @purchase.comment || '' %>
diff --git a/spec/requests/purchases_requests_spec.rb b/spec/requests/purchases_requests_spec.rb index abf7f1342a..d60b23f484 100644 --- a/spec/requests/purchases_requests_spec.rb +++ b/spec/requests/purchases_requests_spec.rb @@ -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)