diff --git a/app/helpers/request_helper.rb b/app/helpers/request_helper.rb index 0c89d977..05b5b948 100644 --- a/app/helpers/request_helper.rb +++ b/app/helpers/request_helper.rb @@ -75,6 +75,10 @@ def holding_notes(holding) holding["notes"].select { |note| note["holdingsNoteType"] != "Restriction" } end + def shelving_title(holding) + holding["shelvingTitle"] + end + def format_items_in_use(holding) holding["checkedOutItems"].map do |item| concatenated = "#{item["enumeration"]} #{item["chronology"]} #{item["yearCaption"]}" diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index 16611f11..ced9e579 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -56,6 +56,11 @@
<%= @request.holding["shelvingTitle"] %>
<% end %> + <% if @request.holding["shelvingTitle"].present? %> +
<%= t("requesting.metadata.shelving_title") %>
+
<%= @request.holding["shelvingTitle"] %>
+ <% end %> +
<%= t("requesting.metadata.status") %>
<%= @request.item["displayStatus"] %>
diff --git a/app/views/request_item/_holding.html.erb b/app/views/request_item/_holding.html.erb index 59aca73d..7945abca 100644 --- a/app/views/request_item/_holding.html.erb +++ b/app/views/request_item/_holding.html.erb @@ -23,6 +23,11 @@ <% end %>

+ <% if shelving_title(holding).present? %> +
<%= t("requesting.metadata.shelving_title") %>
+
<%= shelving_title(holding) %>
+ <% end %> +
<%= t("requesting.metadata.status") %>
<%= item["requestable"] ? item["displayStatus"] : "Not for loan" %>
diff --git a/spec/helpers/request_helper_spec.rb b/spec/helpers/request_helper_spec.rb index 0154ed2b..c92bc7a5 100644 --- a/spec/helpers/request_helper_spec.rb +++ b/spec/helpers/request_helper_spec.rb @@ -163,6 +163,24 @@ end end + describe "#shelving_title" do + context "when there is a shelving title" do + let(:holding) { {"shelvingTitle" => "G.C. Bleeck/Misc #1"} } + + it "returns the shelvingTitle" do + expect(helper.shelving_title(holding)).to eq "G.C. Bleeck/Misc #1" + end + end + + context "when there is no shelvingTitle" do + let(:holding) { {"shelvingTitle" => nil} } + + it "returns nil" do + expect(helper.shelving_title(holding)).to be_nil + end + end + end + describe "#items_issues_in_use" do context "when there are notes" do let(:holding) { holdings_response["holdingsRecords"][4] }