blacklight 6.9.0 → 6.10.0
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/.rubocop_todo.yml +6 -0
- data/.travis.yml +7 -7
- data/VERSION +1 -1
- data/db/migrate/20140202020201_create_searches.rb +1 -1
- data/db/migrate/20140202020202_create_bookmarks.rb +1 -1
- data/db/migrate/20140320000000_add_polymorphic_type_to_bookmarks.rb +1 -1
- data/lib/blacklight/configuration.rb +2 -1
- data/lib/blacklight/solr/search_builder_behavior.rb +3 -1
- data/lib/generators/blacklight/assets_generator.rb +16 -5
- data/lib/generators/blacklight/templates/alternate_controller.rb +1 -1
- data/lib/generators/blacklight/user_generator.rb +1 -1
- data/spec/helpers/catalog_helper_spec.rb +14 -6
- data/spec/helpers/url_helper_spec.rb +9 -5
- data/spec/models/blacklight/solr/search_builder_spec.rb +4 -3
- data/spec/test_app_templates/Gemfile.extra +1 -1
- data/spec/views/catalog/_facets.html.erb_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60df91a78d3181795975d6b62bb92482e1b05151
|
4
|
+
data.tar.gz: 6c20566992ac377318609c742c12a5786db2f3db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f8b43752993d04d66797cb247c542a3f1ec5b881a6f869ea6ad557cdf329c74039de7e9d7cd10a5664d12d2c88524df86c82a9e2cb324dce0973c6aea914fd2
|
7
|
+
data.tar.gz: 26aa1ebc30886fcda720c4df6b00b728d8cd7a186887c6eda806de0c3680f18956438c795d2a67b17d7868ce30e51f12394abe0e12f96cc0ff4cede008984b7a
|
data/.rubocop_todo.yml
CHANGED
@@ -90,6 +90,8 @@ Metrics/BlockNesting:
|
|
90
90
|
# Configuration parameters: CountComments.
|
91
91
|
Metrics/ClassLength:
|
92
92
|
Max: 186
|
93
|
+
Exclude:
|
94
|
+
- 'lib/blacklight/configuration.rb'
|
93
95
|
|
94
96
|
# Offense count: 20
|
95
97
|
Metrics/CyclomaticComplexity:
|
@@ -99,11 +101,15 @@ Metrics/CyclomaticComplexity:
|
|
99
101
|
# Configuration parameters: CountComments.
|
100
102
|
Metrics/MethodLength:
|
101
103
|
Max: 52
|
104
|
+
Exclude:
|
105
|
+
- 'lib/blacklight/configuration.rb'
|
102
106
|
|
103
107
|
# Offense count: 9
|
104
108
|
# Configuration parameters: CountComments.
|
105
109
|
Metrics/ModuleLength:
|
106
110
|
Max: 208
|
111
|
+
Exclude:
|
112
|
+
- 'lib/blacklight/solr/search_builder_behavior.rb'
|
107
113
|
|
108
114
|
# Offense count: 1
|
109
115
|
# Configuration parameters: CountKeywordArgs.
|
data/.travis.yml
CHANGED
@@ -5,16 +5,16 @@ notifications:
|
|
5
5
|
email: false
|
6
6
|
|
7
7
|
rvm:
|
8
|
-
- 2.
|
8
|
+
- 2.4.1
|
9
9
|
|
10
10
|
matrix:
|
11
11
|
include:
|
12
|
-
- rvm: 2.
|
13
|
-
env: "RAILS_VERSION=
|
14
|
-
- rvm: 2.
|
15
|
-
env: "RAILS_VERSION=5.
|
12
|
+
- rvm: 2.2.7
|
13
|
+
env: "RAILS_VERSION=5.0.3"
|
14
|
+
- rvm: 2.3.4
|
15
|
+
env: "RAILS_VERSION=5.1.1"
|
16
16
|
- rvm: jruby-9.1.7.0
|
17
|
-
env: "RAILS_VERSION=5.0.
|
17
|
+
env: "RAILS_VERSION=5.0.3 JRUBY_OPTS=\"-J-Xms512m -J-Xmx1024m\""
|
18
18
|
allow_failures:
|
19
19
|
- rvm: jruby-9.1.7.0
|
20
20
|
fast_finish: true
|
@@ -24,7 +24,7 @@ before_install:
|
|
24
24
|
- gem install bundler
|
25
25
|
|
26
26
|
env:
|
27
|
-
- "RAILS_VERSION=5.
|
27
|
+
- "RAILS_VERSION=5.1.1"
|
28
28
|
|
29
29
|
notifications:
|
30
30
|
irc: "irc.freenode.org#blacklight"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.
|
1
|
+
6.10.0
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
class AddPolymorphicTypeToBookmarks < ActiveRecord::Migration
|
2
|
+
class AddPolymorphicTypeToBookmarks < ActiveRecord::Migration[4.2]
|
3
3
|
def change
|
4
4
|
add_column(:bookmarks, :document_type, :string) unless Bookmark.connection.column_exists? :bookmarks, :document_type
|
5
5
|
|
@@ -185,11 +185,13 @@ module Blacklight::Solr
|
|
185
185
|
solr_params[:"facet.field"] = with_ex_local_param(facet_ex, facet_config.field)
|
186
186
|
|
187
187
|
limit = if scope.respond_to?(:facet_list_limit)
|
188
|
+
Deprecation.warn(self, "The use of facet_list_limit is deprecated and will be removed in 7.0. " \
|
189
|
+
"Consider using the 'more_limit' option in the field configuration or 'default_more_limit' instead.")
|
188
190
|
scope.facet_list_limit.to_s.to_i
|
189
191
|
elsif solr_params["facet.limit"]
|
190
192
|
solr_params["facet.limit"].to_i
|
191
193
|
else
|
192
|
-
facet_config.fetch(:more_limit,
|
194
|
+
facet_config.fetch(:more_limit, blacklight_config.default_more_limit)
|
193
195
|
end
|
194
196
|
|
195
197
|
page = blacklight_params.fetch(request_keys[:page], 1).to_i
|
@@ -8,23 +8,34 @@ module Blacklight
|
|
8
8
|
|
9
9
|
return if has_blacklight_assets?
|
10
10
|
|
11
|
+
contents = "\n//\n// Required by Blacklight\n"
|
12
|
+
contents += "//= require jquery\n" if rails_5_1?
|
13
|
+
contents += "//= require blacklight/blacklight\n"
|
14
|
+
|
11
15
|
marker = if turbolinks?
|
12
16
|
'//= require turbolinks'
|
17
|
+
elsif rails_5_1?
|
18
|
+
'//= require rails-ujs'
|
13
19
|
else
|
14
20
|
'//= require jquery_ujs'
|
15
21
|
end
|
16
22
|
|
17
23
|
insert_into_file "app/assets/javascripts/application.js", :after => marker do
|
18
|
-
|
19
|
-
//
|
20
|
-
// Required by Blacklight
|
21
|
-
//= require blacklight/blacklight
|
22
|
-
EOF
|
24
|
+
contents
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
28
|
+
# This is not a default in Rails 5.1
|
29
|
+
def add_jquery
|
30
|
+
gem 'jquery-rails' if rails_5_1?
|
31
|
+
end
|
32
|
+
|
26
33
|
private
|
27
34
|
|
35
|
+
def rails_5_1?
|
36
|
+
Rails.version =~ /5\.1/
|
37
|
+
end
|
38
|
+
|
28
39
|
def turbolinks?
|
29
40
|
@turbolinks ||= IO.read("app/assets/javascripts/application.js").include?('turbolinks')
|
30
41
|
end
|
@@ -131,15 +131,19 @@ describe CatalogHelper do
|
|
131
131
|
|
132
132
|
describe "rss_feed_link_tag" do
|
133
133
|
context "when an alternate scope is passed in" do
|
134
|
+
subject(:tag) { helper.rss_feed_link_tag(route_set: my_engine) }
|
135
|
+
|
134
136
|
let(:my_engine) { double("Engine") }
|
135
137
|
let(:query_params) { { controller: 'catalog', action: 'index' } }
|
136
138
|
let(:config) { Blacklight::Configuration.new }
|
137
139
|
let(:search_state) { Blacklight::SearchState.new(query_params, config, controller) }
|
138
140
|
|
139
|
-
|
141
|
+
before do
|
140
142
|
allow(helper).to receive(:search_state).and_return search_state
|
141
|
-
|
142
|
-
|
143
|
+
end
|
144
|
+
|
145
|
+
it "calls url_for on the engine scope" do
|
146
|
+
expect(my_engine).to receive(:url_for).and_return('/rss-path')
|
143
147
|
expect(tag).to match /title="RSS for results"/
|
144
148
|
expect(tag).to match /rel="alternate"/
|
145
149
|
expect(tag).to match %r{type="application/rss\+xml"}
|
@@ -149,15 +153,19 @@ describe CatalogHelper do
|
|
149
153
|
|
150
154
|
describe "atom_feed_link_tag" do
|
151
155
|
context "when an alternate scope is passed in" do
|
156
|
+
subject(:tag) { helper.atom_feed_link_tag(route_set: my_engine) }
|
157
|
+
|
152
158
|
let(:my_engine) { double("Engine") }
|
153
159
|
let(:query_params) { { controller: 'catalog', action: 'index' } }
|
154
160
|
let(:config) { Blacklight::Configuration.new }
|
155
161
|
let(:search_state) { Blacklight::SearchState.new(query_params, config, controller) }
|
156
162
|
|
157
|
-
|
163
|
+
before do
|
158
164
|
allow(helper).to receive(:search_state).and_return search_state
|
159
|
-
|
160
|
-
|
165
|
+
end
|
166
|
+
|
167
|
+
it "calls url_for on the engine scope" do
|
168
|
+
expect(my_engine).to receive(:url_for).and_return('/atom-path')
|
161
169
|
expect(tag).to match /title="Atom for results"/
|
162
170
|
expect(tag).to match /rel="alternate"/
|
163
171
|
expect(tag).to match %r{type="application/atom\+xml"}
|
@@ -127,14 +127,18 @@ describe BlacklightUrlHelper do
|
|
127
127
|
|
128
128
|
context "when an alternate scope is passed in" do
|
129
129
|
let(:my_engine) { double("Engine") }
|
130
|
+
subject(:tag) { helper.link_back_to_catalog(route_set: my_engine) }
|
130
131
|
|
131
|
-
|
132
|
+
before do
|
132
133
|
allow(helper).to receive(:current_search_session).and_return double(:query_params => query_params)
|
133
|
-
|
134
|
-
|
134
|
+
end
|
135
|
+
|
136
|
+
it "calls url_for on the engine scope" do
|
137
|
+
expect(my_engine).to receive(:url_for)
|
138
|
+
.with(q:"query", f: "facets", controller: "catalog")
|
139
|
+
.and_return('link-url')
|
135
140
|
expect(tag).to match /Back to Search/
|
136
|
-
expect(tag).to match /
|
137
|
-
expect(tag).to match /f=facets/
|
141
|
+
expect(tag).to match /link-url/
|
138
142
|
end
|
139
143
|
end
|
140
144
|
end
|
@@ -367,7 +367,7 @@ describe Blacklight::Solr::SearchBuilderBehavior do
|
|
367
367
|
end
|
368
368
|
end
|
369
369
|
|
370
|
-
|
370
|
+
|
371
371
|
describe "#facet_value_to_fq_string" do
|
372
372
|
it "should use the configured field name" do
|
373
373
|
blacklight_config.add_facet_field :facet_key, field: "facet_name"
|
@@ -480,7 +480,7 @@ describe Blacklight::Solr::SearchBuilderBehavior do
|
|
480
480
|
|
481
481
|
let(:solr_parameters) do
|
482
482
|
solr_parameters = Blacklight::Solr::Request.new
|
483
|
-
|
483
|
+
|
484
484
|
subject.add_facetting_to_solr(solr_parameters)
|
485
485
|
|
486
486
|
solr_parameters
|
@@ -512,7 +512,7 @@ describe Blacklight::Solr::SearchBuilderBehavior do
|
|
512
512
|
it "should respect the include_in_request parameter" do
|
513
513
|
blacklight_config.add_facet_field 'yes_facet', include_in_request: true
|
514
514
|
blacklight_config.add_facet_field 'no_facet', include_in_request: false
|
515
|
-
|
515
|
+
|
516
516
|
expect(solr_parameters[:'facet.field']).to include('yes_facet')
|
517
517
|
expect(solr_parameters[:'facet.field']).not_to include('no_facet')
|
518
518
|
end
|
@@ -640,6 +640,7 @@ describe Blacklight::Solr::SearchBuilderBehavior do
|
|
640
640
|
|
641
641
|
context 'when facet_list_limit is defined in scope' do
|
642
642
|
before do
|
643
|
+
allow(Deprecation).to receive(:warn)
|
643
644
|
allow(context).to receive_messages facet_list_limit: 1000
|
644
645
|
end
|
645
646
|
it 'uses scope method for limit' do
|
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: 6.
|
4
|
+
version: 6.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire:
|
18
18
|
bindir: exe
|
19
19
|
cert_chain: []
|
20
|
-
date: 2017-05-
|
20
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|