-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4582 from pulibrary/Blacklight8-upgrade-v2
Blacklight upgrade to 8.6.1
- Loading branch information
Showing
21 changed files
with
161 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
app/components/blacklight/search_context/server_item_pagination_component.html.erb
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
app/components/blacklight/search_context/server_item_pagination_component.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/presenters/orangelight/electronic_access_plain_text_presenter.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/presenters/orangelight/electronic_portfolio_plain_text_presenter.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
module Orangelight | ||
# This class is responsible for presenting electronic portfolio data from solr documents | ||
# in a way suitable for plain text settings, like a plain text email | ||
class ElectronicPortfolioPlainTextPresenter < Blacklight::FieldPresenter | ||
def values | ||
super.map { |access_point| format_access_point(access_point) } | ||
end | ||
|
||
private | ||
|
||
# :reek:DuplicateMethodCall | ||
# :reek:UtilityFunction | ||
def format_access_point(access_point) | ||
portfolio = JSON.parse(access_point) | ||
"\t#{portfolio['title']}: #{portfolio['url']}\n" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
spec/presenters/orangelight/electronic_portfolio_plain_text_presenter_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
require 'rails_helper' | ||
|
||
RSpec.describe Orangelight::ElectronicPortfolioPlainTextPresenter do | ||
describe '#values' do | ||
it 'is formatted nicely' do | ||
document = SolrDocument.new({ | ||
electronic_portfolio_s: [ | ||
'{"desc":null,"title":"Full Text","url":"https://na05.alma.exlibrisgroup.com/view/uresolver/01PRI_INST/openurl?u.ignore_date_coverage=true&portfolio_pid=53827030770006421&Force_direct=true","start":null,"end":"latest"}', | ||
'{"desc":null,"title":"Second Title","url":"https://example.com","start":null,"end":"latest"}' | ||
] | ||
}) | ||
field_config = Blacklight::Configuration::Field.new(label: 'Online access', field: 'electronic_portfolio_s') | ||
# rubocop:disable RSpec/VerifiedDoubles | ||
view_context = double('View context', should_render_field?: true) | ||
# rubocop:enable RSpec/VerifiedDoubles | ||
presenter = described_class.new(view_context, document, field_config) | ||
expect(presenter.values[0]).to eq("\tFull Text: https://na05.alma.exlibrisgroup.com/view/uresolver/01PRI_INST/openurl?u.ignore_date_coverage=true&portfolio_pid=53827030770006421&Force_direct=true\n") | ||
expect(presenter.values[1]).to eq("\tSecond Title: https://example.com\n") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,23 @@ | |
expect(page).to have_text 'Your question has been submitted' | ||
end | ||
end | ||
describe 'pressing the send button' do | ||
before do | ||
stub_libanswers_api | ||
stub_holding_locations | ||
visit '/catalog/99101035463506421' | ||
scroll_to(:bottom) # needed when js: true | ||
click_link 'Ask a Question' | ||
fill_in 'ask_a_question_form_name', with: 'Agatha' | ||
fill_in 'ask_a_question_form_email', with: '[email protected]' | ||
fill_in 'ask_a_question_form_message', with: 'Murder on the Orient Express' | ||
end | ||
it 'closes the modal', js: true do | ||
expect(page).to have_text('Ask a Question') | ||
expect(page).to have_text('Message') | ||
click_button 'Send' | ||
expect(current_path).to eq '/catalog/99101035463506421' | ||
expect(page).not_to have_text('Message') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.