Skip to content

Commit

Permalink
Remove umlaut (#2677)
Browse files Browse the repository at this point in the history
  • Loading branch information
XanderGardner authored Sep 22, 2021
1 parent e63bc13 commit 37325bb
Show file tree
Hide file tree
Showing 13 changed files with 2 additions and 275 deletions.
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ Metrics/LineLength:
- 'spec/features/searching_spec.rb'
- 'spec/models/solr_document_spec.rb'
- 'spec/controllers/bookmarks_controller_spec.rb'
- 'spec/views/catalog/umlaut_services_spec.rb'
- 'spec/features/availability_spec.rb'
- 'spec/helpers/holding_block_spec.rb'
- 'spec/helpers/blacklight_helper_spec.rb'
Expand Down
20 changes: 0 additions & 20 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,6 @@ def rails_env?
Rails.env.production?
end

# Generate the markup for the <div> containing a link to the umlaut service endpoint for a given record
# @param document [SolrDocument] the Solr Document for the record
# @return [String] the markup
def umlaut_services_fulltext(document)
services = ''
unless document.key? 'electronic_access_1display'
services << content_tag(:div, '', :id => 'full_text', :class => ['availability--online', 'availability_full-text', 'availability--panel_umlaut'], 'data-umlaut-full-text' => true)
end
services.html_safe
end

# Generate the markup for two <div> elements containing links to umlaut services
# @return [String] the markup
def umlaut_services
services = ''
services << content_tag(:div, '', :id => 'excerpts', :class => ['availability--excerpts', 'availability_excerpts', 'availability--panel_umlaut'], 'data-umlaut-services' => true)
services << content_tag(:div, '', :id => 'highlighted_link', :class => ['availability--highlighted', 'availability_highlighted-link', 'availability--panel_umlaut'], 'data-umlaut-services' => true)
services.html_safe
end

# Generate an Array of <div> elements wrapping links to proxied service endpoints for access
# Takes first 2 links for pairing with online holdings in search results
# @param electronic_access [Hash] electronic resource information
Expand Down
12 changes: 0 additions & 12 deletions app/models/concerns/blacklight/solr/document/marc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,6 @@ def alma_record?
end
end

def umlaut_fulltext_eligible?
if (umlaut_full_text_formats & fetch('format', []).map(&:downcase)).empty?
false
else
true
end
end

def umlaut_full_text_formats
%w[book journal]
end

# does we have any standard numbers that can be used by other services
def standard_numbers?
std_numbers.any? { |v| key? v }
Expand Down
6 changes: 0 additions & 6 deletions app/services/holding_requests_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ def getit_accessible?
doc_electronic_access.keys.any? { |link| /getit\.princeton\.edu/.match(link) }
end

# Determine whether or not the electronic resources are accessible using umlaut
# @return [TrueClass, FalseClass]
def umlaut_accessible?
getit_accessible? || doc_electronic_access.empty? || !@document.umlaut_fulltext_eligible?
end

# Retrieve only the ELF holding records
# @return [Hash] ELF holding information
def doc_holdings_elf
Expand Down
9 changes: 0 additions & 9 deletions app/services/online_holdings_markup_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,6 @@ def self.urlify(adapter)
markup << content_tag(:li, link.html_safe, class: 'electronic-access')
end

unless adapter.umlaut_accessible?
markup << content_tag(:li, '',
id: 'full_text',
class: ['availability--panel',
'availability_full-text',
'availability_full-text-alternative'],
'data-umlaut-services' => true)
end

return content_tag(:ul, markup.html_safe) if electronic_access.count > 1
markup
end
Expand Down
6 changes: 1 addition & 5 deletions app/views/catalog/_show_availability.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
<h3><%= t('blacklight.holdings.online') %></h3>
<%= online if online.present? %>
</div>
<% end %>

<% if online.blank? && document.standard_numbers? && document.umlaut_fulltext_eligible? %>
<%= umlaut_services_fulltext(document) %>
<% end %>
<% end %>

<% unless physical.empty? %>
<div class="availability--physical">
Expand Down
6 changes: 1 addition & 5 deletions app/views/catalog/_show_other_versions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@
<div class="section-heading"><h3><%= t('blacklight.holdings.linked') %></h3></div>
<div class="section-content"><%= render 'show_linked_records', linked_records: document_linked_records %></div>
</div>
<% end %>

<% if document.standard_numbers? %>
<%= umlaut_services %>
<% end %>
<% end %>
1 change: 0 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<% unless controller.controller_name == "catalog" && controller.action_name == "show" && @document.alma_record? %>
<%= javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML", async: true %>
<% end %>
<%= javascript_include_tag "#{Requests.config['umlaut_base']}/assets/umlaut/update_html.js" %>
<%= javascript_include_tag "https://www.google.com/books/jsapi.js" %>
<%= csrf_meta_tags %>
<%= content_for(:head) %>
Expand Down
1 change: 0 additions & 1 deletion config/requests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# requests.yml

defaults: &defaults
umlaut_base: https://getit.princeton.edu
bibdata_base: <%= ENV['BIBDATA_BASE'] || "https://bibdata.princeton.edu" %>
proxy_base: https://library.princeton.edu/resolve/lookup?url=
voyager_api_base: https://webvoyage.princeton.edu:7014
Expand Down
19 changes: 0 additions & 19 deletions spec/helpers/holding_block_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
let(:show_result_thesis_no_request) { helper.holding_request_block(SolrDocument.new(document_thesis_no_request_access)) }
let(:show_result_thesis_embargoed) { helper.holding_request_block(SolrDocument.new(document_thesis_embargoed)) }

let(:show_result_umlaut_w_full_text) { helper.umlaut_services }
let(:not_umlaut_full_text_eligible) { SolrDocument.new(document_no_umlaut) }
let(:umlaut_full_text_eligible) { SolrDocument.new(document) }
let(:holding_block_json) do
{
holding_id => {
Expand Down Expand Up @@ -84,13 +81,6 @@
holdings_1display: holding_block_json
}.with_indifferent_access
end
let(:document_no_umlaut) do
{
id: '5',
format: ['Video'],
holdings_1display: holding_block_json
}.with_indifferent_access
end
let(:document_no_holdings) do
{
id: '2'
Expand Down Expand Up @@ -345,15 +335,6 @@
end
end

context '#umlaut_format_eligible? formats' do
it 'is false when it is not umlaut format' do
expect(not_umlaut_full_text_eligible.umlaut_fulltext_eligible?).to be false
end
it 'is true when it is an umlaut format' do
expect(umlaut_full_text_eligible.umlaut_fulltext_eligible?).to be true
end
end

context '#holding_block record show - physical holdings' do
let(:search_result) { helper.holding_block_search(document) }
let(:call_number) { 'CD- 2018-11-11' }
Expand Down
5 changes: 0 additions & 5 deletions spec/services/online_holdings_markup_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
allow(adapter).to receive(:doc_id).and_return('123456')
allow(adapter).to receive(:voyager_holding?).and_return(true)
allow(adapter).to receive(:doc_electronic_access).and_return('http://gateway.proquest.com/url': ['gateway.proquest.com'], 'http://arks.princeton.edu/ark:/88435/dsp0141687h654': ['DataSpace', 'Citation only'])
allow(adapter).to receive(:umlaut_accessible?).and_return(true)
end

describe '.electronic_access_link' do
Expand Down Expand Up @@ -102,10 +101,6 @@
allow(adapter).to receive(:doc_electronic_access).and_return(marcit_url => ['getit.princeton.edu', 'View Princeton online holdings'])
end

it 'is marked as full text record' do
expect(urlified_markup).to include 'data-umlaut-full-text="true"'
end

it 'has a marcit context object' do
expect(urlified_markup).to include 'data-url-marcit'
end
Expand Down
1 change: 0 additions & 1 deletion spec/services/physical_holdings_markup_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
allow(adapter).to receive(:doc_id).and_return('123456')
allow(adapter).to receive(:voyager_holding?).and_return(true)
allow(adapter).to receive(:doc_electronic_access).and_return('http://arks.princeton.edu/ark:/88435/dsp0141687h654': ['DataSpace', 'Citation only'])
allow(adapter).to receive(:umlaut_accessible?).and_return(true)
allow(adapter).to receive(:unavailable_holding?).and_return(false)
end

Expand Down
190 changes: 0 additions & 190 deletions spec/views/catalog/umlaut_services_spec.rb

This file was deleted.

0 comments on commit 37325bb

Please sign in to comment.