From 921c34c2319d541044a8736b3aa6a92063e50c4d Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Tue, 7 Nov 2023 08:00:39 -0800 Subject: [PATCH] Clean up unused library settings; part of #3369 --- config/settings.yml | 37 +++-------------------------- lib/hours_request.rb | 2 +- spec/features/brief_view_spec.rb | 4 ++-- spec/features/mhld_spec.rb | 2 +- spec/fixtures/solr_documents/10.yml | 20 ++++++++-------- spec/lib/holdings_spec.rb | 4 ++-- 6 files changed, 19 insertions(+), 50 deletions(-) diff --git a/config/settings.yml b/config/settings.yml index 8db775b8e..1a74c1859 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -92,16 +92,10 @@ libraries: about_url: https://library.stanford.edu/libraries/bowes-art-architecture-library hours_api_url: art/location/art_library name: Art & Architecture Library (Bowes) - BIOLOGY: - hours_api_url: biology/location/biology_library - name: Biology Library (Falconer) BUSINESS: about_url: https://www.gsb.stanford.edu/library hours_api_url: business/location/business_library name: Business Library - CHEMCHMENG: - hours_api_url: chemistry/location/chemistry_library - name: Chemistry & ChemEng Library (Swain) CLASSICS: name: Classics Library EARTH-SCI: @@ -120,13 +114,13 @@ libraries: about_url: https://library.stanford.edu/libraries/terman-engineering-library hours_api_url: engineering/location/engineering_library name: Engineering Library (Terman) - GOV-DOCS: + GOV-DOCS: # not a FOLIO library, but shows up in MHLD data name: Green Library GREEN: about_url: https://library.stanford.edu/libraries/cecil-h-green-library hours_api_url: green/location/green_library name: Green Library - GRN-REF: + GRN-REF: # not a FOLIO library, but probably shows up in MHLD data name: Green Library HILA: about_url: https://www.hoover.org/library-archives @@ -134,13 +128,9 @@ libraries: 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) IC: hours_api_url: green/location/reference - IC-CHAT: + IC-CHAT: # fake code used internally for IC chat hours hours_api_url: green/location/reference JACKSON: name: Business Library @@ -149,14 +139,6 @@ libraries: ezproxy_host: https://login.laneproxy.stanford.edu/login? hours_api_url: medical/location/medical_library name: Lane Medical Library - LANE-MED: - about_url: https://lane.stanford.edu/index.html - ezproxy_host: https://login.laneproxy.stanford.edu/login? - hours_api_url: medical/location/medical_library - name: Lane Medical Library - LATHROP: - hours_api_url: lathrop/location/tech-lounge - name: Lathrop Library LAW: about_url: https://law.stanford.edu/robert-crown-law-library/ ezproxy_host: https://ezproxy.law.stanford.edu/login? @@ -166,26 +148,13 @@ libraries: 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) - MATH-CS: - hours_api_url: math_stats/location/math_stats_library - name: Math & Statistics Library MEDIA-CENTER: hours_api_url: green/location/media_microtext name: Media & Microtext Center - MEDIA-MTXT: - hours_api_url: green/location/media_microtext - name: Media & Microtext Center - MEYER: - hours_api_url: meyer/location/meyer_24_hour - name: Meyer Library MUSIC: about_url: https://library.stanford.edu/libraries/music-library hours_api_url: music/location/music_library name: Music Library - RUMSEYMAP: - about_url: https://library.stanford.edu/libraries/david-rumsey-map-center - hours_api_url: Rumsey/location/visitor-access - name: David Rumsey Map Center RUMSEY-MAP: about_url: https://library.stanford.edu/libraries/david-rumsey-map-center hours_api_url: Rumsey/location/visitor-access diff --git a/lib/hours_request.rb b/lib/hours_request.rb index 3b0bb3573..406fe2f37 100644 --- a/lib/hours_request.rb +++ b/lib/hours_request.rb @@ -8,7 +8,7 @@ def full_url end def find_library - Settings.libraries[@library].hours_api_url + Settings.libraries[@library]&.hours_api_url end def get diff --git a/spec/features/brief_view_spec.rb b/spec/features/brief_view_spec.rb index b3b60a57f..b0fc44cef 100644 --- a/spec/features/brief_view_spec.rb +++ b/spec/features/brief_view_spec.rb @@ -16,8 +16,8 @@ end within '[data-preview-url="/preview/10"]' do expect(page).to have_css('.brief-document ul li', text: 'Green Library : Stacks : (no call number)') - expect(page).to have_css('.brief-document ul li', text: 'Chemistry & ChemEng Library (Swain) : Current periodicals : (no call number)') - expect(page).to have_css('.brief-document ul li', text: 'Chemistry & ChemEng Library (Swain) : Stacks : ABC') + expect(page).to have_css('.brief-document ul li', text: 'Engineering Library (Terman) : Current periodicals : (no call number)') + expect(page).to have_css('.brief-document ul li', text: 'Engineering Library (Terman) : Stacks : ABC') end end skip 'Brief preview', :js do diff --git a/spec/features/mhld_spec.rb b/spec/features/mhld_spec.rb index 10da0e174..29ab21476 100644 --- a/spec/features/mhld_spec.rb +++ b/spec/features/mhld_spec.rb @@ -5,7 +5,7 @@ it "should be present in the location access panel" do visit solr_document_path('10') - within('[data-hours-route="/hours/CHEMCHMENG"]') do + within('[data-hours-route="/hours/ENG"]') do expect(page).to have_css('.location-name', text: 'Current periodicals') expect(page).to have_css('.mhld', text: 'public note2') expect(page).to have_css('.mhld.note-highlight', text: 'Latest: latest received2') diff --git a/spec/fixtures/solr_documents/10.yml b/spec/fixtures/solr_documents/10.yml index c6c3ad7f2..496ccea0c 100644 --- a/spec/fixtures/solr_documents/10.yml +++ b/spec/fixtures/solr_documents/10.yml @@ -17,32 +17,32 @@ - sirsi :item_display_struct: - barcode: "123" - library: CHEMCHMENG + library: ENG home_location: STACKS callnumber: ABC full_shelfkey: ABC - barcode: "456" - library: CHEMCHMENG + library: ENG home_location: STACKS callnumber: DEF full_shelfkey: DEF - barcode: "123" - library: CHEMCHMENG + library: ENG home_location: STACKS callnumber: GHI full_shelfkey: GHI - barcode: "321" - library: CHEMCHMENG + library: ENG home_location: STACKS callnumber: CBA full_shelfkey: CBA - barcode: "654" - library: CHEMCHMENG + library: ENG home_location: STACKS callnumber: FED full_shelfkey: FED - barcode: "876" - library: CHEMCHMENG + library: ENG home_location: STACKS callnumber: IHG full_shelfkey: IHG @@ -52,18 +52,18 @@ callnumber: JKL full_shelfkey: JKL - barcode: "123" - library: CHEMCHMENG + library: ENG home_location: STACKS callnumber: MNO full_shelfkey: MNO - barcode: "543" - library: BIOLOGY + library: MARINE-BIO home_location: STACKS callnumber: PQR full_shelfkey: PQR :mhld_display: - - "CHEMCHMENG -|- STACKS -|- public note1 -|- library has1 -|- latest received1" - - "CHEMCHMENG -|- CURRENTPER -|- public note2 -|- library has2 -|- latest received2" + - "ENG -|- STACKS -|- public note1 -|- library has1 -|- latest received1" + - "ENG -|- CURRENTPER -|- public note2 -|- library has2 -|- latest received2" - "GREEN -|- STACKS -|- public note3 -|- library has3 -|- latest received3" :isbn_display: - "0393040801" diff --git a/spec/lib/holdings_spec.rb b/spec/lib/holdings_spec.rb index f1674bea2..debeb45bd 100644 --- a/spec/lib/holdings_spec.rb +++ b/spec/lib/holdings_spec.rb @@ -76,7 +76,7 @@ item_display_struct: [ { barcode: 'barcode', library: 'SAL3', home_location: 'home-location' }, { barcode: 'barcode', library: 'GREEN', home_location: 'home-location' }, - { barcode: 'barcode', library: 'BIOLOGY', home_location: 'home-location' } + { barcode: 'barcode', library: 'MARINE-BIO', home_location: 'home-location' } ] ).items ) @@ -90,7 +90,7 @@ end it "should sort Green first then the rest alpha" do expect(sortable_libraries.libraries.length).to eq 3 - expect(sortable_libraries.libraries.map(&:code)).to eq ['GREEN', 'BIOLOGY', 'SAL3'] + expect(sortable_libraries.libraries.map(&:code)).to eq ['GREEN', 'MARINE-BIO', 'SAL3'] end end