blacklight 5.8.0 → 5.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +7 -7
- data/Gemfile +3 -1
- data/VERSION +1 -1
- data/app/helpers/blacklight/url_helper_behavior.rb +2 -1
- data/lib/blacklight/catalog/component_configuration.rb +2 -2
- data/lib/blacklight/solr_helper.rb +5 -0
- data/lib/blacklight/solr_repository.rb +6 -2
- data/spec/helpers/component_helper_spec.rb +19 -0
- data/spec/lib/blacklight/solr_repository_spec.rb +18 -0
- data/spec/views/catalog/_document_action.html.erb_spec.rb +21 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f9651eef53cd449f3bb428731943e8759b52af1
|
4
|
+
data.tar.gz: 4db418373c1ea6262414f5442c816bd9c0a46d36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2505780053f2cc34f8285d3589e82b18ca5bef37a8f0242fea877c14d2f858260e4fe8029b97b1fd4bfcb70042b049f12bc08247b94527dc1812be2c8e184ca4
|
7
|
+
data.tar.gz: 91578686f80295bc9e9a93e543b00ccf9cba18434ab18f5066ec79cdd911d8872220b275391bc9b67d441d12fd53c49e064803581f2a8bd2bbbaf46c2b2a2721
|
data/.travis.yml
CHANGED
@@ -7,22 +7,22 @@ rvm:
|
|
7
7
|
matrix:
|
8
8
|
include:
|
9
9
|
- rvm: 2.1.4
|
10
|
-
env: "RAILS_VERSION=4.0.
|
10
|
+
env: "RAILS_VERSION=4.0.12"
|
11
11
|
- rvm: 2.0.0
|
12
|
-
env: "RAILS_VERSION=4.1.
|
12
|
+
env: "RAILS_VERSION=4.1.8"
|
13
13
|
- rvm: 1.9.3
|
14
|
-
env: "RAILS_VERSION=4.1.
|
14
|
+
env: "RAILS_VERSION=4.1.8"
|
15
15
|
- rvm: jruby
|
16
|
-
env: "RAILS_VERSION=4.1.
|
16
|
+
env: "RAILS_VERSION=4.1.8 JRUBY_OPTS=\"-J-Xms512m -J-Xmx1024m\""
|
17
17
|
- rvm: 2.1.4
|
18
|
-
env: "RAILS_VERSION=4.2.0.
|
18
|
+
env: "RAILS_VERSION=4.2.0.rc3"
|
19
19
|
|
20
20
|
before_install:
|
21
21
|
- gem install bundler
|
22
22
|
|
23
23
|
env:
|
24
|
-
- "RAILS_VERSION=3.2.
|
25
|
-
- "RAILS_VERSION=4.1.
|
24
|
+
- "RAILS_VERSION=3.2.21"
|
25
|
+
- "RAILS_VERSION=4.1.8"
|
26
26
|
|
27
27
|
notifications:
|
28
28
|
irc: "irc.freenode.org#blacklight"
|
data/Gemfile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.8.
|
1
|
+
5.8.1
|
@@ -304,7 +304,8 @@ module Blacklight::UrlHelperBehavior
|
|
304
304
|
end
|
305
305
|
end
|
306
306
|
|
307
|
-
|
307
|
+
# For exporting a single endnote document. (endnote_catalog_path is defined by blacklight-marc and it is used for multiple document export)
|
308
|
+
def single_endnote_catalog_path opts = {}
|
308
309
|
catalog_path(opts.merge(format: 'endnote'))
|
309
310
|
end
|
310
311
|
|
@@ -10,8 +10,8 @@ module Blacklight
|
|
10
10
|
add_results_collection_tool(:view_type_group)
|
11
11
|
|
12
12
|
add_show_tools_partial(:bookmark, partial: 'bookmark_control', if: :render_bookmarks_control?)
|
13
|
-
add_show_tools_partial(:refworks, if: :render_refworks_action
|
14
|
-
add_show_tools_partial(:endnote, if: :render_endnote_action
|
13
|
+
add_show_tools_partial(:refworks, if: :render_refworks_action?, modal: false)
|
14
|
+
add_show_tools_partial(:endnote, if: :render_endnote_action?, modal: false, path: :single_endnote_catalog_path )
|
15
15
|
add_show_tools_partial(:email, callback: :email_action, validator: :validate_email_params)
|
16
16
|
add_show_tools_partial(:sms, callback: :sms_action, validator: :validate_sms_params)
|
17
17
|
add_show_tools_partial(:citation)
|
@@ -236,6 +236,11 @@ module Blacklight::SolrHelper
|
|
236
236
|
@solr_repository ||= Blacklight::SolrRepository.new(blacklight_config)
|
237
237
|
end
|
238
238
|
|
239
|
+
def blacklight_solr
|
240
|
+
solr_repository.blacklight_solr
|
241
|
+
end
|
242
|
+
deprecation_deprecate :blacklight_solr
|
243
|
+
|
239
244
|
private
|
240
245
|
|
241
246
|
##
|
@@ -16,7 +16,11 @@ module Blacklight
|
|
16
16
|
# @param [String] document's unique key value
|
17
17
|
# @param [Hash] additional solr query parameters
|
18
18
|
def find id, params = {}
|
19
|
-
|
19
|
+
doc_params = params.reverse_merge(qt: blacklight_config.document_solr_request_handler)
|
20
|
+
.reverse_merge(blacklight_config.default_document_solr_params)
|
21
|
+
.merge(blacklight_config.document_unique_id_param => id)
|
22
|
+
|
23
|
+
solr_response = send_and_receive blacklight_config.document_solr_path || blacklight_config.solr_path, doc_params
|
20
24
|
raise Blacklight::Exceptions::InvalidSolrID.new if solr_response.documents.empty?
|
21
25
|
solr_response
|
22
26
|
end
|
@@ -25,7 +29,7 @@ module Blacklight
|
|
25
29
|
# Execute a search query against solr
|
26
30
|
# @param [Hash] solr query parameters
|
27
31
|
def search params = {}
|
28
|
-
send_and_receive blacklight_config.solr_path,
|
32
|
+
send_and_receive blacklight_config.solr_path, params.reverse_merge(qt: blacklight_config.qt)
|
29
33
|
end
|
30
34
|
|
31
35
|
##
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe '#document_action_path' do
|
4
|
+
before do
|
5
|
+
allow(helper).to receive_messages(controller_name: 'catalog')
|
6
|
+
end
|
7
|
+
|
8
|
+
let(:document_action_config) { Blacklight::Configuration::ToolConfig.new(tool_config) }
|
9
|
+
let(:document) { SolrDocument.new(id: '123') }
|
10
|
+
|
11
|
+
subject { helper.document_action_path(document_action_config, id: document) }
|
12
|
+
|
13
|
+
context "for endnote" do
|
14
|
+
let(:tool_config) { { if: :render_refworks_action?, partial: "document_action",
|
15
|
+
name: :endnote, key: :endnote, path: :single_endnote_catalog_path } }
|
16
|
+
|
17
|
+
it { is_expected.to eq '/catalog/123.endnote' }
|
18
|
+
end
|
19
|
+
end
|
@@ -42,6 +42,14 @@ describe Blacklight::SolrRepository do
|
|
42
42
|
allow(subject.blacklight_solr).to receive(:send_and_receive).with('select', hash_including(params: { id: '123', qt: 'abc'})).and_return(mock_response)
|
43
43
|
expect(subject.find("123", {qt: 'abc'})).to be_a_kind_of Blacklight::SolrResponse
|
44
44
|
end
|
45
|
+
|
46
|
+
it "should preserve the class of the incoming params" do
|
47
|
+
doc_params = HashWithIndifferentAccess.new
|
48
|
+
allow(subject.blacklight_solr).to receive(:send_and_receive).with('select', anything).and_return(mock_response)
|
49
|
+
response = subject.find("123", doc_params)
|
50
|
+
expect(response).to be_a_kind_of Blacklight::SolrResponse
|
51
|
+
expect(response.params).to be_a_kind_of HashWithIndifferentAccess
|
52
|
+
end
|
45
53
|
end
|
46
54
|
|
47
55
|
describe "#search" do
|
@@ -67,6 +75,16 @@ describe Blacklight::SolrRepository do
|
|
67
75
|
allow(subject.blacklight_solr).to receive(:send_and_receive).with('select', hash_including(params: { qt: 'abc'})).and_return(mock_response)
|
68
76
|
expect(subject.search({qt: 'abc'})).to be_a_kind_of Blacklight::SolrResponse
|
69
77
|
end
|
78
|
+
|
79
|
+
it "should preserve the class of the incoming params" do
|
80
|
+
search_params = HashWithIndifferentAccess.new
|
81
|
+
search_params[:q] = "query"
|
82
|
+
allow(subject.blacklight_solr).to receive(:send_and_receive).with('select', anything).and_return(mock_response)
|
83
|
+
|
84
|
+
response = subject.search(search_params)
|
85
|
+
expect(response).to be_a_kind_of Blacklight::SolrResponse
|
86
|
+
expect(response.params).to be_a_kind_of HashWithIndifferentAccess
|
87
|
+
end
|
70
88
|
end
|
71
89
|
|
72
90
|
describe "#send_and_receive" do
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'catalog/_document_action' do
|
4
|
+
let(:document_action_config) { Blacklight::Configuration::ToolConfig.new(tool_config) }
|
5
|
+
let(:document) { SolrDocument.new(id: '123') }
|
6
|
+
|
7
|
+
before do
|
8
|
+
allow(view).to receive_messages(controller_name: 'catalog')
|
9
|
+
render 'catalog/document_action', document_action_config: document_action_config, document: document
|
10
|
+
end
|
11
|
+
|
12
|
+
context "for refworks" do
|
13
|
+
let(:tool_config) { { if: :render_refworks_action?, partial: "document_action",
|
14
|
+
name: :refworks, key: :refworks, modal: false } }
|
15
|
+
|
16
|
+
it "should not be modal" do
|
17
|
+
expect(rendered).to have_link('Export to Refworks')
|
18
|
+
expect(rendered).not_to have_selector('a[data-ajax-modal]')
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.8.
|
4
|
+
version: 5.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire:
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
|
-
date: 2014-12-
|
20
|
+
date: 2014-12-16 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -487,6 +487,7 @@ files:
|
|
487
487
|
- spec/features/search_spec.rb
|
488
488
|
- spec/helpers/blacklight_helper_spec.rb
|
489
489
|
- spec/helpers/catalog_helper_spec.rb
|
490
|
+
- spec/helpers/component_helper_spec.rb
|
490
491
|
- spec/helpers/configuration_helper_spec.rb
|
491
492
|
- spec/helpers/facets_helper_spec.rb
|
492
493
|
- spec/helpers/hash_as_hidden_fields_spec.rb
|
@@ -532,6 +533,7 @@ files:
|
|
532
533
|
- spec/views/catalog/_constraints.html.erb_spec.rb
|
533
534
|
- spec/views/catalog/_constraints_element.html.erb_spec.rb
|
534
535
|
- spec/views/catalog/_document.html.erb_spec.rb
|
536
|
+
- spec/views/catalog/_document_action.html.erb_spec.rb
|
535
537
|
- spec/views/catalog/_document_list.html.erb_spec.rb
|
536
538
|
- spec/views/catalog/_facet_layout.html.erb_spec.rb
|
537
539
|
- spec/views/catalog/_facets.html.erb_spec.rb
|
@@ -600,6 +602,7 @@ test_files:
|
|
600
602
|
- spec/features/search_spec.rb
|
601
603
|
- spec/helpers/blacklight_helper_spec.rb
|
602
604
|
- spec/helpers/catalog_helper_spec.rb
|
605
|
+
- spec/helpers/component_helper_spec.rb
|
603
606
|
- spec/helpers/configuration_helper_spec.rb
|
604
607
|
- spec/helpers/facets_helper_spec.rb
|
605
608
|
- spec/helpers/hash_as_hidden_fields_spec.rb
|
@@ -645,6 +648,7 @@ test_files:
|
|
645
648
|
- spec/views/catalog/_constraints.html.erb_spec.rb
|
646
649
|
- spec/views/catalog/_constraints_element.html.erb_spec.rb
|
647
650
|
- spec/views/catalog/_document.html.erb_spec.rb
|
651
|
+
- spec/views/catalog/_document_action.html.erb_spec.rb
|
648
652
|
- spec/views/catalog/_document_list.html.erb_spec.rb
|
649
653
|
- spec/views/catalog/_facet_layout.html.erb_spec.rb
|
650
654
|
- spec/views/catalog/_facets.html.erb_spec.rb
|