diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 991553571..8b283857e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -357,9 +357,16 @@ def holding_requests_adapter HoldingRequestsAdapter.new(@document, Bibdata) end + # Returns true for locations with remote storage. + # Remote storage locations have a value of 'recap_rmt' in Alma. + def remote_storage?(location_code) + Bibdata.holding_locations[location_code]["remote_storage"] == 'recap_rmt' + end + # Returns true for locations where the user can walk and fetch an item. # Currently this logic is duplicated in Javascript code in availability.es6 def find_it_location?(location_code) + return false if remote_storage?(location_code) return false if (location_code || "").start_with?("plasma$", "marquand$") return false if StackmapService::Url.missing_stackmap_reserves.include?(location_code) diff --git a/spec/helpers/holding_block_spec.rb b/spec/helpers/holding_block_spec.rb index 858107793..043c66de9 100644 --- a/spec/helpers/holding_block_spec.rb +++ b/spec/helpers/holding_block_spec.rb @@ -42,13 +42,13 @@ '3668455' => { location: 'Firestone Library', library: 'Firestone Library', - location_code: 'f', + location_code: 'firestone$se', call_number: 'PS3539.A74Z93 2000' }, '4362737' => { location: 'Firestone Library', library: 'Firestone Library', - location_code: 'f', + location_code: 'firestone$se', call_number: 'PS3539.A74Z93 2000' } }.to_json.to_s @@ -579,8 +579,8 @@ end context '#holding_block record show - online holdings' do + before { stub_alma_holding_locations } it 'link missing label appears when 856s is missing from elf location' do - stub_holding_locations expect(show_result.first).to include 'Link Missing' end end @@ -615,14 +615,14 @@ '22270490580006421' => { location: '', library: 'Very Special Library', - location_code: 'xspecial&nil', + location_code: 'mendel$stacks', call_number: 'special', call_number_browse: 'special' } }.to_json.to_s end - before { stub_holding_locations } + before { stub_alma_holding_locations } it 'returns a string with call number and location display values' do expect(show_result.last).to include call_number diff --git a/spec/services/physical_holdings_markup_builder_spec.rb b/spec/services/physical_holdings_markup_builder_spec.rb index 76bf19a8e..f2df0d201 100644 --- a/spec/services/physical_holdings_markup_builder_spec.rb +++ b/spec/services/physical_holdings_markup_builder_spec.rb @@ -36,7 +36,7 @@ holding_id => { location:, library: 'Firestone Library', - location_code: 'f', + location_code: 'firestone$stacks', call_number:, shelving_title:, supplements:, @@ -117,7 +117,7 @@ it 'includes a link with mapping details' do expect(holding_location_markup).to include '