Skip to content

Commit

Permalink
Consolidate Symphony library codes for HOOVER and HV-ARCHIVE into the…
Browse files Browse the repository at this point in the history
… FOLIO code HILA
  • Loading branch information
cbeer committed Nov 7, 2023
1 parent d0420d8 commit db8973f
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 90 deletions.
2 changes: 1 addition & 1 deletion app/components/location_request_link_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class LocationRequestLinkComponent < ViewComponent::Base
# @params [String] location the code for location with the holdings
def self.for(document:, library:, location:, **kwargs)
link_type = case library
when 'HOOVER', 'HV-ARCHIVE', 'HILA'
when 'HILA'
if document&.index_links&.finding_aid&.first&.href
RequestLinks::HooverArchiveRequestLinkComponent
else
Expand Down
15 changes: 0 additions & 15 deletions app/models/hoover_open_url_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ def as_params
end

def request_type
return 'GenericRequestManuscript' if archive?

'GenericRequestMonograph'
end

Expand Down Expand Up @@ -54,14 +52,10 @@ def item_author
end

def item_date
return unless archive?

marc_data(field_codes: '245', subfield_codes: ['f'])
end

def item_publisher
return if archive?

marc_260 = marc_data(field_codes: '260', subfield_codes: %w[a b c])
marc_264 = marc_data(field_codes: '264', subfield_codes: %w[a b c])
safe_join([marc_260, marc_264], ' ')
Expand All @@ -72,8 +66,6 @@ def item_place
end

def item_edition
return if archive?

marc_data(field_codes: '250', subfield_codes: ['a'])
end

Expand All @@ -82,20 +74,13 @@ def item_restrictions
end

def item_conditions
return unless archive?

marc_data(field_codes: '540', subfield_codes: %w[3 a])
end

private

attr_reader :library, :document

def archive?
# We are not currently routing any HV-ARCHIVE request links through this code...
library == 'HV-ARCHIVE'
end

def marc
document.to_marc
end
Expand Down
12 changes: 0 additions & 12 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,10 @@ libraries:
name: Hoover Library
suppress_items_list_on_results_view: true
suppress_location_request_link: true
HOOVER:
about_url: https://www.hoover.org/library-archives
hours_api_url: hoover_archives/location/hv_archives
name: Hoover Library
suppress_items_list_on_results_view: true
suppress_location_request_link: true
HOPKINS:
about_url: https://library.stanford.edu/libraries/harold-miller-library-hopkins-marine-station
hours_api_url: marine_biology/location/marine_biology_library
name: Marine Biology Library (Miller)
HV-ARCHIVE:
about_url: https://www.hoover.org/library-archives
hours_api_url: hoover_archives/location/hv_archives
name: Hoover Archives
suppress_items_list_on_results_view: true
suppress_location_request_link: true
IC:
hours_api_url: green/location/reference
IC-CHAT:
Expand Down
10 changes: 1 addition & 9 deletions lib/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ module FolioStatus
'EDU-RESV' => 'EDUCATION',
'ENG-RESV' => 'ENG',
'GREEN-RESV' => 'GREEN',
'HOOV-RESV' => 'HOOVER',
'HOOV-RESV' => 'HILA',
'HOP-RESV' => 'HOPKINS',
'LAW-RESV' => 'LAW',
'MEDIA-RESV' => 'MEDIA-MTXT',
Expand Down Expand Up @@ -882,14 +882,6 @@ module FolioStatus
heading: 'Access',
text: 'Items must be requested in advance and viewed on-site.'
},
'HOOVER' => {
heading: 'Access',
text: 'Items must be requested in advance and viewed on-site.'
},
'HV-ARCHIVE' => {
heading: 'Access',
text: 'Items must be requested in advance and viewed on-site.'
},
'RUMSEY-MAP' => {
heading: 'On-site access',
text: 'Researchers can request to view these materials in the David Rumsey Map Center.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
document = SolrDocument.new(
id: '123',
item_display_struct: [
{ barcode: '123', library: 'HOOVER', home_location: 'STACKS', callnumber: 'ABC' }
{ barcode: '123', library: 'HILA', home_location: 'STACKS', callnumber: 'ABC' }
],
marc_links_struct: [{ href: "http://oac.cdlib.org/findaid/ark:/something-else", finding_aid: true }]
)
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/solr_documents/56.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<%= hoover_request_fixture %>
:item_display_struct:
- barcode: '123'
library: HOOVER
library: HILA
home_location: STACKS
callnumber: ABC 123
54 changes: 5 additions & 49 deletions spec/models/hoover_open_url_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

subject(:url) { described_class.new(library, document) }

let(:library) { 'HOOVER' }
let(:library) { 'HILA' }
let(:marc_json_struct) { metadata1 }
let(:document) do
SolrDocument.new(
Expand Down Expand Up @@ -43,32 +43,10 @@
expect(url.as_params.keys).to include 'ReferenceNumber'
expect(url.as_params.keys).to include 'ItemAuthor'
expect(url.as_params.keys).to include 'Value'
end

context 'for HOOVER' do
it 'includes keys that are specific to hoover' do
expect(url.as_params.keys).to include 'ItemEdition'
expect(url.as_params.keys).to include 'ItemPublisher'
end

it 'does not include keys that are specific to the archive' do
expect(url.as_params.keys).not_to include 'ItemInfo3'
expect(url.as_params.keys).not_to include 'ItemDate'
end
end

context 'for HV-ARCHIVE' do
let(:library) { 'HV-ARCHIVE' }

it 'includes keys that are specific to the archive' do
expect(url.as_params.keys).to include 'ItemInfo3'
expect(url.as_params.keys).to include 'ItemDate'
end

it 'does not include keys that are specific to hoover' do
expect(url.as_params.keys).not_to include 'ItemEdition'
expect(url.as_params.keys).not_to include 'ItemPublisher'
end
expect(url.as_params.keys).to include 'ItemInfo3'
expect(url.as_params.keys).to include 'ItemDate'
expect(url.as_params.keys).to include 'ItemEdition'
expect(url.as_params.keys).to include 'ItemPublisher'
end
end
end
Expand Down Expand Up @@ -151,21 +129,9 @@
expect(url.item_edition).to eq '250 Subfield $a'
end
end

describe '#item_conditions' do
let(:marc_json_struct) { hoover_request_fixture }

it { expect(url.item_conditions).to be_nil }
end
end

context 'Hoover Archive' do
let(:library) { 'HV-ARCHIVE' }

describe '#request_type' do
it { expect(url.request_type).to eq 'GenericRequestManuscript' }
end

describe '#item_date' do
let(:marc_json_struct) { hoover_request_fixture }

Expand All @@ -174,16 +140,6 @@
end
end

describe '#item_publisher' do
it { expect(url.item_publisher).to be_nil }
end

describe '#item_edition' do
let(:marc_json_struct) { edition_imprint_fixture }

it { expect(url.item_edition).to be_nil }
end

describe '#item_conditions' do
let(:marc_json_struct) { hoover_request_fixture }

Expand Down
4 changes: 2 additions & 2 deletions spec/policies/location_request_link_policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
RSpec.describe LocationRequestLinkPolicy do
subject(:policy) { described_class.new(location:, library:, items:) }

let(:location) { 'HOOVER' }
let(:library) { 'STACKS' }
let(:library) { 'HILA' }
let(:location) { 'STACKS' }

describe '#show?' do
subject { policy.show? }
Expand Down

0 comments on commit db8973f

Please sign in to comment.