blacklight 7.12.0 → 7.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +109 -0
- data/.rubocop.yml +3 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +4 -2
- data/app/components/blacklight/constraints_component.rb +14 -6
- data/app/components/blacklight/document/thumbnail_component.html.erb +1 -1
- data/app/components/blacklight/document/thumbnail_component.rb +1 -1
- data/app/components/blacklight/document_component.html.erb +1 -0
- data/app/components/blacklight/document_component.rb +14 -1
- data/app/components/blacklight/facet_field_component.html.erb +1 -0
- data/app/components/blacklight/facet_field_pagination_component.html.erb +4 -4
- data/app/components/blacklight/facet_field_pagination_component.rb +0 -4
- data/app/components/blacklight/hidden_search_state_component.rb +54 -0
- data/app/components/blacklight/search_bar_component.html.erb +10 -8
- data/app/components/blacklight/search_bar_component.rb +14 -1
- data/app/controllers/concerns/blacklight/catalog.rb +3 -3
- data/app/controllers/concerns/blacklight/search_context.rb +2 -2
- data/app/controllers/concerns/blacklight/searchable.rb +1 -1
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +1 -1
- data/app/helpers/blacklight/component_helper_behavior.rb +1 -1
- data/app/helpers/blacklight/configuration_helper_behavior.rb +3 -9
- data/app/helpers/blacklight/facets_helper_behavior.rb +8 -2
- data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +2 -38
- data/app/helpers/blacklight/icon_helper_behavior.rb +1 -1
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +7 -5
- data/app/helpers/blacklight/render_partials_helper_behavior.rb +2 -2
- data/app/javascript/blacklight/button_focus.js +1 -0
- data/app/javascript/blacklight/modal.js +10 -4
- data/app/presenters/blacklight/document_presenter.rb +4 -0
- data/app/presenters/blacklight/facet_item_presenter.rb +7 -3
- data/app/presenters/blacklight/index_presenter.rb +2 -2
- data/app/presenters/blacklight/rendering/link_to_facet.rb +3 -1
- data/app/presenters/blacklight/show_presenter.rb +0 -4
- data/app/services/blacklight/search_service.rb +13 -11
- data/app/values/blacklight/types.rb +1 -1
- data/app/views/bookmarks/_tools.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +1 -1
- data/app/views/catalog/index.json.jbuilder +3 -1
- data/blacklight.gemspec +5 -4
- data/lib/blacklight/configuration/facet_field.rb +7 -0
- data/lib/blacklight/configuration/fields.rb +1 -1
- data/lib/blacklight/configuration/search_field.rb +5 -0
- data/lib/blacklight/configuration/tool_config.rb +4 -0
- data/lib/blacklight/configuration/view_config.rb +12 -0
- data/lib/blacklight/nested_open_struct_with_hash_access.rb +1 -1
- data/lib/blacklight/search_builder.rb +13 -23
- data/lib/blacklight/search_state.rb +82 -70
- data/lib/blacklight/search_state/filter_field.rb +122 -0
- data/lib/blacklight/solr/repository.rb +3 -3
- data/lib/blacklight/solr/response.rb +1 -1
- data/lib/blacklight/solr/search_builder_behavior.rb +71 -51
- data/package.json +5 -1
- data/spec/components/blacklight/constraint_layout_component_spec.rb +1 -1
- data/spec/components/blacklight/document_component_spec.rb +17 -0
- data/spec/components/blacklight/hidden_search_state_component_spec.rb +24 -0
- data/spec/features/facets_spec.rb +2 -17
- data/spec/features/search_filters_spec.rb +0 -20
- data/spec/features/search_spec.rb +0 -5
- data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +1 -2
- data/spec/helpers/blacklight/hash_as_hidden_fields_behavior_spec.rb +1 -0
- data/spec/helpers/blacklight/url_helper_behavior_spec.rb +1 -0
- data/spec/lib/blacklight/configuration/view_config_spec.rb +15 -0
- data/spec/lib/blacklight/nested_open_struct_with_hash_access_spec.rb +9 -0
- data/spec/lib/blacklight/search_state/filter_field_spec.rb +125 -0
- data/spec/lib/blacklight/search_state_spec.rb +132 -3
- data/spec/models/blacklight/configuration_spec.rb +8 -0
- data/spec/models/blacklight/solr/response/facets_spec.rb +1 -1
- data/spec/models/blacklight/solr/search_builder_spec.rb +32 -2
- data/spec/spec_helper.rb +8 -3
- data/spec/test_app_templates/Gemfile.extra +1 -1
- data/spec/views/catalog/_document.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_thumbnail.html.erb_spec.rb +2 -0
- data/tasks/blacklight.rake +3 -3
- metadata +50 -29
- data/.npmignore +0 -23
- data/.travis.yml +0 -40
@@ -14,4 +14,13 @@ RSpec.describe Blacklight::NestedOpenStructWithHashAccess do
|
|
14
14
|
expect(copy.a[:b]).to eq 1
|
15
15
|
end
|
16
16
|
end
|
17
|
+
|
18
|
+
describe '#<<' do
|
19
|
+
subject { described_class.new(Blacklight::Configuration::Field) }
|
20
|
+
|
21
|
+
it 'includes the key in the hash' do
|
22
|
+
subject << :blah
|
23
|
+
expect(subject.blah).to have_attributes(key: :blah)
|
24
|
+
end
|
25
|
+
end
|
17
26
|
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe Blacklight::SearchState::FilterField do
|
4
|
+
let(:search_state) { Blacklight::SearchState.new(params.with_indifferent_access, blacklight_config, controller) }
|
5
|
+
|
6
|
+
let(:params) { { f: { some_field: %w[1 2], another_field: ['3'] } } }
|
7
|
+
let(:blacklight_config) do
|
8
|
+
Blacklight::Configuration.new.configure do |config|
|
9
|
+
config.add_facet_field 'some_field'
|
10
|
+
config.add_facet_field 'another_field', single: true
|
11
|
+
end
|
12
|
+
end
|
13
|
+
let(:controller) { double }
|
14
|
+
|
15
|
+
describe '#add' do
|
16
|
+
it 'adds the parameter to the filter list' do
|
17
|
+
filter = search_state.filter('some_field')
|
18
|
+
new_state = filter.add('4')
|
19
|
+
|
20
|
+
expect(new_state.filter('some_field').values).to eq %w[1 2 4]
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'creates new parameter as needed' do
|
24
|
+
filter = search_state.filter('unknown_field')
|
25
|
+
new_state = filter.add('4')
|
26
|
+
|
27
|
+
expect(new_state.filter('unknown_field').values).to eq %w[4]
|
28
|
+
expect(new_state.params[:f]).to include(:unknown_field)
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'without any parameters in the url' do
|
32
|
+
let(:params) { {} }
|
33
|
+
|
34
|
+
it 'adds the necessary structure' do
|
35
|
+
filter = search_state.filter('some_field')
|
36
|
+
new_state = filter.add('1')
|
37
|
+
|
38
|
+
expect(new_state.filter('some_field').values).to eq %w[1]
|
39
|
+
expect(new_state.params).to include(:f)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'with a single-valued field' do
|
44
|
+
it 'replaces any existing parameter from the filter list' do
|
45
|
+
filter = search_state.filter('another_field')
|
46
|
+
new_state = filter.add('5')
|
47
|
+
|
48
|
+
expect(new_state.filter('another_field').values).to eq %w[5]
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
context 'with a pivot facet-type item' do
|
53
|
+
it 'includes the pivot facet fqs' do
|
54
|
+
filter = search_state.filter('some_field')
|
55
|
+
new_state = filter.add(OpenStruct.new(fq: { some_other_field: '5' }, value: '4'))
|
56
|
+
|
57
|
+
expect(new_state.filter('some_field').values).to eq %w[1 2 4]
|
58
|
+
expect(new_state.filter('some_other_field').values).to eq %w[5]
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'handles field indirection' do
|
62
|
+
filter = search_state.filter('some_field')
|
63
|
+
new_state = filter.add(OpenStruct.new(field: 'some_other_field', value: '4'))
|
64
|
+
|
65
|
+
expect(new_state.filter('some_other_field').values).to eq %w[4]
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'handles value indirection' do
|
69
|
+
filter = search_state.filter('some_field')
|
70
|
+
new_state = filter.add(OpenStruct.new(value: '4'))
|
71
|
+
|
72
|
+
expect(new_state.filter('some_field').values).to eq %w[1 2 4]
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe '#remove' do
|
78
|
+
it 'returns a search state without the given filter applied' do
|
79
|
+
filter = search_state.filter('some_field')
|
80
|
+
new_state = filter.remove('1')
|
81
|
+
|
82
|
+
expect(new_state.filter('some_field').values).to eq ['2']
|
83
|
+
end
|
84
|
+
|
85
|
+
it 'removes the whole field if there are no filter left for the field' do
|
86
|
+
filter = search_state.filter('another_field')
|
87
|
+
new_state = filter.remove('3')
|
88
|
+
|
89
|
+
expect(new_state.filter('another_field').values).to eq []
|
90
|
+
expect(new_state.params[:f]).not_to include :another_field
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'removes the filter parameter entirely if there are no filters left' do
|
94
|
+
new_state = search_state.filter('some_field').remove('1')
|
95
|
+
new_state = new_state.filter('some_field').remove('2')
|
96
|
+
new_state = new_state.filter('another_field').remove('3')
|
97
|
+
|
98
|
+
expect(new_state.params).not_to include :f
|
99
|
+
end
|
100
|
+
|
101
|
+
it 'handles value indirection' do
|
102
|
+
filter = search_state.filter('some_field')
|
103
|
+
new_state = filter.remove(OpenStruct.new(value: '1'))
|
104
|
+
|
105
|
+
expect(new_state.filter('some_field').values).to eq ['2']
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
describe '#values' do
|
110
|
+
it 'returns the currently selected values of the filter' do
|
111
|
+
expect(search_state.filter('some_field').values).to eq %w[1 2]
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
describe '#include?' do
|
116
|
+
it 'checks whether the value is currently selected' do
|
117
|
+
expect(search_state.filter('some_field').include?('1')).to eq true
|
118
|
+
expect(search_state.filter('some_field').include?('3')).to eq false
|
119
|
+
end
|
120
|
+
|
121
|
+
it 'handles value indirection' do
|
122
|
+
expect(search_state.filter('some_field').include?(OpenStruct.new(value: '1'))).to eq true
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
@@ -3,6 +3,8 @@
|
|
3
3
|
RSpec.describe Blacklight::SearchState do
|
4
4
|
subject(:search_state) { described_class.new(params, blacklight_config, controller) }
|
5
5
|
|
6
|
+
around { |test| Deprecation.silence(described_class) { test.call } }
|
7
|
+
|
6
8
|
let(:blacklight_config) do
|
7
9
|
Blacklight::Configuration.new.configure do |config|
|
8
10
|
config.index.title_field = 'title_tsim'
|
@@ -242,9 +244,9 @@ RSpec.describe Blacklight::SearchState do
|
|
242
244
|
end
|
243
245
|
|
244
246
|
it "uses the facet's key in the url" do
|
245
|
-
|
247
|
+
blacklight_config.add_facet_field 'some_key', single: true, field: "a_solr_field"
|
246
248
|
|
247
|
-
result_params = search_state.add_facet_params('
|
249
|
+
result_params = search_state.add_facet_params('some_key', 'my_value')
|
248
250
|
|
249
251
|
expect(result_params[:f]['some_key']).to have(1).item
|
250
252
|
expect(result_params[:f]['some_key'].first).to eq 'my_value'
|
@@ -284,7 +286,7 @@ RSpec.describe Blacklight::SearchState do
|
|
284
286
|
let(:params) { parameter_class.new f: { 'single_value_facet_field' => 'other_value' } }
|
285
287
|
|
286
288
|
it "replaces facets configured as single" do
|
287
|
-
|
289
|
+
blacklight_config.add_facet_field 'single_value_facet_field', single: true
|
288
290
|
result_params = search_state.add_facet_params('single_value_facet_field', 'my_value')
|
289
291
|
|
290
292
|
expect(result_params[:f]['single_value_facet_field']).to have(1).item
|
@@ -415,4 +417,131 @@ RSpec.describe Blacklight::SearchState do
|
|
415
417
|
expect(new_state.to_hash).to eq('a' => 1)
|
416
418
|
end
|
417
419
|
end
|
420
|
+
|
421
|
+
describe '#page' do
|
422
|
+
context 'with a page' do
|
423
|
+
let(:params) { { 'page' => '3' } }
|
424
|
+
|
425
|
+
it 'is mapped from page' do
|
426
|
+
expect(search_state.page).to eq 3
|
427
|
+
end
|
428
|
+
end
|
429
|
+
|
430
|
+
context 'without a page' do
|
431
|
+
let(:params) { {} }
|
432
|
+
|
433
|
+
it 'is defaults to page 1' do
|
434
|
+
expect(search_state.page).to eq 1
|
435
|
+
end
|
436
|
+
|
437
|
+
context 'with negative numbers or other bad data' do
|
438
|
+
let(:params) { { 'page' => '-3' } }
|
439
|
+
|
440
|
+
it 'is defaults to page 1' do
|
441
|
+
expect(search_state.page).to eq 1
|
442
|
+
end
|
443
|
+
end
|
444
|
+
end
|
445
|
+
end
|
446
|
+
|
447
|
+
describe '#per_page' do
|
448
|
+
context 'with rows' do
|
449
|
+
let(:params) { { rows: '30' } }
|
450
|
+
|
451
|
+
it 'maps from rows' do
|
452
|
+
expect(search_state.per_page).to eq 30
|
453
|
+
end
|
454
|
+
end
|
455
|
+
|
456
|
+
context 'with per_page' do
|
457
|
+
let(:params) { { per_page: '14' } }
|
458
|
+
|
459
|
+
it 'maps from rows' do
|
460
|
+
expect(search_state.per_page).to eq 14
|
461
|
+
end
|
462
|
+
end
|
463
|
+
|
464
|
+
context 'it defaults to the configured value' do
|
465
|
+
let(:params) { {} }
|
466
|
+
|
467
|
+
it 'maps from rows' do
|
468
|
+
expect(search_state.per_page).to eq 10
|
469
|
+
end
|
470
|
+
end
|
471
|
+
end
|
472
|
+
|
473
|
+
describe '#sort_field' do
|
474
|
+
let(:params) { { 'sort' => 'author' } }
|
475
|
+
|
476
|
+
before do
|
477
|
+
blacklight_config.add_sort_field 'relevancy', label: 'relevance'
|
478
|
+
blacklight_config.add_sort_field 'author', label: 'asd'
|
479
|
+
end
|
480
|
+
|
481
|
+
it 'returns the current search field' do
|
482
|
+
expect(search_state.sort_field).to have_attributes(key: 'author')
|
483
|
+
end
|
484
|
+
|
485
|
+
context 'without a search field' do
|
486
|
+
let(:params) { {} }
|
487
|
+
|
488
|
+
it 'returns the current search field' do
|
489
|
+
expect(search_state.sort_field).to have_attributes(key: 'relevancy')
|
490
|
+
end
|
491
|
+
end
|
492
|
+
end
|
493
|
+
|
494
|
+
describe '#search_field' do
|
495
|
+
let(:params) { { 'search_field' => 'author' } }
|
496
|
+
|
497
|
+
before do
|
498
|
+
blacklight_config.add_search_field 'author', label: 'asd'
|
499
|
+
end
|
500
|
+
|
501
|
+
it 'returns the current search field' do
|
502
|
+
expect(search_state.search_field).to have_attributes(key: 'author')
|
503
|
+
end
|
504
|
+
end
|
505
|
+
|
506
|
+
describe '#facet_page' do
|
507
|
+
context 'with a page' do
|
508
|
+
let(:params) { { 'facet.page' => '3' } }
|
509
|
+
|
510
|
+
it 'is mapped from facet.page' do
|
511
|
+
expect(search_state.facet_page).to eq 3
|
512
|
+
end
|
513
|
+
end
|
514
|
+
|
515
|
+
context 'without a page' do
|
516
|
+
let(:params) { {} }
|
517
|
+
|
518
|
+
it 'is defaults to page 1' do
|
519
|
+
expect(search_state.facet_page).to eq 1
|
520
|
+
end
|
521
|
+
end
|
522
|
+
|
523
|
+
context 'with negative numbers or other bad data' do
|
524
|
+
let(:params) { { 'facet.page' => '-3' } }
|
525
|
+
|
526
|
+
it 'is defaults to page 1' do
|
527
|
+
expect(search_state.facet_page).to eq 1
|
528
|
+
end
|
529
|
+
end
|
530
|
+
end
|
531
|
+
|
532
|
+
describe '#facet_sort' do
|
533
|
+
let(:params) { { 'facet.sort' => 'index' } }
|
534
|
+
|
535
|
+
it 'is mapped from facet.sort' do
|
536
|
+
expect(search_state.facet_sort).to eq 'index'
|
537
|
+
end
|
538
|
+
end
|
539
|
+
|
540
|
+
describe '#facet_prefix' do
|
541
|
+
let(:params) { { 'facet.prefix' => 'A' } }
|
542
|
+
|
543
|
+
it 'is mapped from facet.prefix' do
|
544
|
+
expect(search_state.facet_prefix).to eq 'A'
|
545
|
+
end
|
546
|
+
end
|
418
547
|
end
|
@@ -62,6 +62,14 @@ RSpec.describe "Blacklight::Configuration", api: true do
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
+
describe 'config.index.document_actions' do
|
66
|
+
it 'allows you to use the << operator' do
|
67
|
+
config.index.document_actions << :blah
|
68
|
+
expect(config.index.document_actions.blah).to have_attributes key: :blah
|
69
|
+
expect(config.index.document_actions.blah.name).to eq :blah
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
65
73
|
describe "config.index.respond_to" do
|
66
74
|
it "has a list of additional formats for index requests to respond to" do
|
67
75
|
config.index.respond_to.xml = true
|
@@ -109,7 +109,7 @@ RSpec.describe Blacklight::Solr::Response::Facets, api: true do
|
|
109
109
|
let(:facet) { { name: "foo", value: "bar", hits: 1 } }
|
110
110
|
|
111
111
|
before do
|
112
|
-
response.merge_facet(facet)
|
112
|
+
response.merge_facet(**facet)
|
113
113
|
end
|
114
114
|
|
115
115
|
context "facet does not already exist" do
|
@@ -186,9 +186,9 @@ RSpec.describe Blacklight::Solr::SearchBuilderBehavior, api: true do
|
|
186
186
|
end
|
187
187
|
|
188
188
|
describe "for request params also passed in as argument" do
|
189
|
-
let(:user_params) { {
|
189
|
+
let(:user_params) { { 'q' => 'another value', q: "some query" } }
|
190
190
|
|
191
|
-
it "
|
191
|
+
it "only has one value for the key 'q' regardless if a symbol or string" do
|
192
192
|
expect(subject[:q]).to eq 'some query'
|
193
193
|
expect(subject['q']).to eq 'some query'
|
194
194
|
end
|
@@ -244,6 +244,21 @@ RSpec.describe Blacklight::Solr::SearchBuilderBehavior, api: true do
|
|
244
244
|
end
|
245
245
|
end
|
246
246
|
|
247
|
+
describe 'with a facet with a custom filter query builder' do
|
248
|
+
let(:user_params) { { f: { some: ['value'] } }.with_indifferent_access }
|
249
|
+
|
250
|
+
before do
|
251
|
+
blacklight_config.add_facet_field 'some', filter_query_builder: (lambda do |*_args|
|
252
|
+
['some:filter', { qq1: 'abc' }]
|
253
|
+
end)
|
254
|
+
end
|
255
|
+
|
256
|
+
it "has proper solr parameters" do
|
257
|
+
expect(subject[:fq]).to include('some:filter')
|
258
|
+
expect(subject[:qq1]).to include('abc')
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
247
262
|
describe "solr parameters for a field search from config (subject)" do
|
248
263
|
let(:user_params) { subject_search_params }
|
249
264
|
|
@@ -384,6 +399,21 @@ RSpec.describe Blacklight::Solr::SearchBuilderBehavior, api: true do
|
|
384
399
|
end
|
385
400
|
end
|
386
401
|
|
402
|
+
describe 'the search field query_builder config' do
|
403
|
+
let(:blacklight_config) do
|
404
|
+
Blacklight::Configuration.new do |config|
|
405
|
+
config.add_search_field('built_query', query_builder: ->(builder, *_args) { [builder.blacklight_params[:q].reverse, qq1: 'xyz'] })
|
406
|
+
end
|
407
|
+
end
|
408
|
+
|
409
|
+
let(:user_params) { { search_field: 'built_query', q: 'value' } }
|
410
|
+
|
411
|
+
it 'uses the provided query builder' do
|
412
|
+
expect(subject[:q]).to eq 'eulav'
|
413
|
+
expect(subject[:qq1]).to eq 'xyz'
|
414
|
+
end
|
415
|
+
end
|
416
|
+
|
387
417
|
describe "mapping facet.field" do
|
388
418
|
let(:blacklight_config) do
|
389
419
|
Blacklight::Configuration.new do |config|
|
data/spec/spec_helper.rb
CHANGED
@@ -20,12 +20,17 @@ require 'rspec/rails'
|
|
20
20
|
require 'rspec/its'
|
21
21
|
require 'rspec/collection_matchers'
|
22
22
|
require 'capybara/rspec'
|
23
|
-
require '
|
23
|
+
require 'capybara/apparition'
|
24
24
|
require 'equivalent-xml'
|
25
|
-
require 'webdrivers'
|
26
25
|
|
27
|
-
Capybara.javascript_driver = :
|
26
|
+
Capybara.javascript_driver = :apparition
|
28
27
|
Capybara.disable_animation = true
|
28
|
+
# Capybara.enable_aria_label = true
|
29
|
+
|
30
|
+
# Uncomment for a headed browser
|
31
|
+
# Capybara.register_driver :apparition do |app|
|
32
|
+
# Capybara::Apparition::Driver.new(app, headless: false)
|
33
|
+
# end
|
29
34
|
|
30
35
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
31
36
|
# in spec/support/ and its subdirectories.
|
@@ -1,2 +1,2 @@
|
|
1
1
|
gem 'rails-controller-testing'
|
2
|
-
gem 'thor', '~> 0.20'
|
2
|
+
gem 'thor', '~> 0.20' if /^5.[12]/.match?(ENV['RAILS_VERSION'])
|
@@ -5,6 +5,7 @@ RSpec.describe "catalog/_document" do
|
|
5
5
|
let(:blacklight_config) { Blacklight::Configuration.new }
|
6
6
|
|
7
7
|
before do
|
8
|
+
allow(controller).to receive(:controller_name).and_return('test')
|
8
9
|
allow(view).to receive(:render_grouped_response?).and_return(false)
|
9
10
|
allow(view).to receive(:blacklight_config).and_return(blacklight_config)
|
10
11
|
assign(:response, instance_double(Blacklight::Solr::Response, start: 20))
|
@@ -16,6 +16,8 @@ RSpec.describe "catalog/_thumbnail" do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
before do
|
19
|
+
# Every call to view_context returns a different object. This ensures it stays stable.
|
20
|
+
allow(controller).to receive(:view_context).and_return(view)
|
19
21
|
allow(controller).to receive(:action_name).and_return('index')
|
20
22
|
assign :response, instance_double(Blacklight::Solr::Response, start: 0)
|
21
23
|
allow(view).to receive(:render_grouped_response?).and_return false
|
data/tasks/blacklight.rake
CHANGED
@@ -14,14 +14,14 @@ require 'solr_wrapper'
|
|
14
14
|
require 'open3'
|
15
15
|
|
16
16
|
def system_with_error_handling(*args)
|
17
|
-
Open3.popen3(*args) do |stdout, stderr,
|
17
|
+
Open3.popen3(*args) do |_stdin, stdout, stderr, thread|
|
18
18
|
puts stdout.read
|
19
|
-
raise "Unable to run #{args.inspect}: #{stderr.read}" unless
|
19
|
+
raise "Unable to run #{args.inspect}: #{stderr.read}" unless thread.value.success?
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
def with_solr
|
24
|
-
if system('docker-compose')
|
24
|
+
if system('docker-compose -v')
|
25
25
|
begin
|
26
26
|
puts "Starting Solr"
|
27
27
|
system_with_error_handling "docker-compose up -d solr"
|
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: 7.
|
4
|
+
version: 7.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -14,10 +14,10 @@ authors:
|
|
14
14
|
- Dan Funk
|
15
15
|
- Naomi Dushay
|
16
16
|
- Justin Coyne
|
17
|
-
autorequire:
|
17
|
+
autorequire:
|
18
18
|
bindir: exe
|
19
19
|
cert_chain: []
|
20
|
-
date:
|
20
|
+
date: 2021-01-10 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -95,20 +95,48 @@ dependencies:
|
|
95
95
|
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: i18n
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 1.7.0
|
105
|
+
type: :runtime
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 1.7.0
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: ostruct
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: 0.3.2
|
119
|
+
type: :runtime
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.3.2
|
98
126
|
- !ruby/object:Gem::Dependency
|
99
127
|
name: view_component
|
100
128
|
requirement: !ruby/object:Gem::Requirement
|
101
129
|
requirements:
|
102
130
|
- - ">="
|
103
131
|
- !ruby/object:Gem::Version
|
104
|
-
version:
|
132
|
+
version: 2.23.0
|
105
133
|
type: :runtime
|
106
134
|
prerelease: false
|
107
135
|
version_requirements: !ruby/object:Gem::Requirement
|
108
136
|
requirements:
|
109
137
|
- - ">="
|
110
138
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
139
|
+
version: 2.23.0
|
112
140
|
- !ruby/object:Gem::Dependency
|
113
141
|
name: rsolr
|
114
142
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,33 +214,19 @@ dependencies:
|
|
186
214
|
- !ruby/object:Gem::Version
|
187
215
|
version: '3'
|
188
216
|
- !ruby/object:Gem::Dependency
|
189
|
-
name:
|
190
|
-
requirement: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - "~>"
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '3.0'
|
195
|
-
type: :development
|
196
|
-
prerelease: false
|
197
|
-
version_requirements: !ruby/object:Gem::Requirement
|
198
|
-
requirements:
|
199
|
-
- - "~>"
|
200
|
-
- !ruby/object:Gem::Version
|
201
|
-
version: '3.0'
|
202
|
-
- !ruby/object:Gem::Dependency
|
203
|
-
name: selenium-webdriver
|
217
|
+
name: apparition
|
204
218
|
requirement: !ruby/object:Gem::Requirement
|
205
219
|
requirements:
|
206
220
|
- - ">="
|
207
221
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
222
|
+
version: '0'
|
209
223
|
type: :development
|
210
224
|
prerelease: false
|
211
225
|
version_requirements: !ruby/object:Gem::Requirement
|
212
226
|
requirements:
|
213
227
|
- - ">="
|
214
228
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
229
|
+
version: '0'
|
216
230
|
- !ruby/object:Gem::Dependency
|
217
231
|
name: engine_cart
|
218
232
|
requirement: !ruby/object:Gem::Requirement
|
@@ -339,15 +353,14 @@ files:
|
|
339
353
|
- ".docker/app/Dockerfile"
|
340
354
|
- ".docker/app/entrypoint.sh"
|
341
355
|
- ".env"
|
356
|
+
- ".github/workflows/ruby.yml"
|
342
357
|
- ".gitignore"
|
343
358
|
- ".hound.yml"
|
344
359
|
- ".jshintrc"
|
345
|
-
- ".npmignore"
|
346
360
|
- ".rspec"
|
347
361
|
- ".rubocop.yml"
|
348
362
|
- ".rubocop_todo.yml"
|
349
363
|
- ".solr_wrapper.yml"
|
350
|
-
- ".travis.yml"
|
351
364
|
- ".yardopts"
|
352
365
|
- CONTRIBUTING.md
|
353
366
|
- Gemfile
|
@@ -416,6 +429,7 @@ files:
|
|
416
429
|
- app/components/blacklight/facet_field_pagination_component.rb
|
417
430
|
- app/components/blacklight/facet_item_component.rb
|
418
431
|
- app/components/blacklight/facet_item_pivot_component.rb
|
432
|
+
- app/components/blacklight/hidden_search_state_component.rb
|
419
433
|
- app/components/blacklight/metadata_field_component.html.erb
|
420
434
|
- app/components/blacklight/metadata_field_component.rb
|
421
435
|
- app/components/blacklight/metadata_field_layout_component.html.erb
|
@@ -653,6 +667,7 @@ files:
|
|
653
667
|
- lib/blacklight/runtime_registry.rb
|
654
668
|
- lib/blacklight/search_builder.rb
|
655
669
|
- lib/blacklight/search_state.rb
|
670
|
+
- lib/blacklight/search_state/filter_field.rb
|
656
671
|
- lib/blacklight/solr.rb
|
657
672
|
- lib/blacklight/solr/document.rb
|
658
673
|
- lib/blacklight/solr/facet_paginator.rb
|
@@ -712,6 +727,7 @@ files:
|
|
712
727
|
- spec/components/blacklight/facet_field_list_component_spec.rb
|
713
728
|
- spec/components/blacklight/facet_item_component_spec.rb
|
714
729
|
- spec/components/blacklight/facet_item_pivot_component_spec.rb
|
730
|
+
- spec/components/blacklight/hidden_search_state_component_spec.rb
|
715
731
|
- spec/components/blacklight/metadata_field_component_spec.rb
|
716
732
|
- spec/components/blacklight/system/flash_message_component_spec.rb
|
717
733
|
- spec/controllers/alternate_controller_spec.rb
|
@@ -756,9 +772,11 @@ files:
|
|
756
772
|
- spec/integration/generators/blacklight/solr_generator_spec.rb
|
757
773
|
- spec/lib/blacklight/configuration/facet_field_spec.rb
|
758
774
|
- spec/lib/blacklight/configuration/field_spec.rb
|
775
|
+
- spec/lib/blacklight/configuration/view_config_spec.rb
|
759
776
|
- spec/lib/blacklight/nested_open_struct_with_hash_access_spec.rb
|
760
777
|
- spec/lib/blacklight/open_struct_with_hash_access_spec.rb
|
761
778
|
- spec/lib/blacklight/parameters_spec.rb
|
779
|
+
- spec/lib/blacklight/search_state/filter_field_spec.rb
|
762
780
|
- spec/lib/blacklight/search_state_spec.rb
|
763
781
|
- spec/lib/blacklight_spec.rb
|
764
782
|
- spec/lib/tasks/blacklight_task_spec.rb
|
@@ -846,23 +864,23 @@ homepage: http://projectblacklight.org/
|
|
846
864
|
licenses:
|
847
865
|
- Apache 2.0
|
848
866
|
metadata: {}
|
849
|
-
post_install_message:
|
867
|
+
post_install_message:
|
850
868
|
rdoc_options: []
|
851
869
|
require_paths:
|
852
870
|
- lib
|
853
871
|
required_ruby_version: !ruby/object:Gem::Requirement
|
854
872
|
requirements:
|
855
|
-
- - "
|
873
|
+
- - ">="
|
856
874
|
- !ruby/object:Gem::Version
|
857
|
-
version: '2.
|
875
|
+
version: '2.3'
|
858
876
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
859
877
|
requirements:
|
860
878
|
- - ">="
|
861
879
|
- !ruby/object:Gem::Version
|
862
880
|
version: '0'
|
863
881
|
requirements: []
|
864
|
-
rubygems_version: 3.
|
865
|
-
signing_key:
|
882
|
+
rubygems_version: 3.2.3
|
883
|
+
signing_key:
|
866
884
|
specification_version: 4
|
867
885
|
summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
|
868
886
|
index.
|
@@ -875,6 +893,7 @@ test_files:
|
|
875
893
|
- spec/components/blacklight/facet_field_list_component_spec.rb
|
876
894
|
- spec/components/blacklight/facet_item_component_spec.rb
|
877
895
|
- spec/components/blacklight/facet_item_pivot_component_spec.rb
|
896
|
+
- spec/components/blacklight/hidden_search_state_component_spec.rb
|
878
897
|
- spec/components/blacklight/metadata_field_component_spec.rb
|
879
898
|
- spec/components/blacklight/system/flash_message_component_spec.rb
|
880
899
|
- spec/controllers/alternate_controller_spec.rb
|
@@ -919,9 +938,11 @@ test_files:
|
|
919
938
|
- spec/integration/generators/blacklight/solr_generator_spec.rb
|
920
939
|
- spec/lib/blacklight/configuration/facet_field_spec.rb
|
921
940
|
- spec/lib/blacklight/configuration/field_spec.rb
|
941
|
+
- spec/lib/blacklight/configuration/view_config_spec.rb
|
922
942
|
- spec/lib/blacklight/nested_open_struct_with_hash_access_spec.rb
|
923
943
|
- spec/lib/blacklight/open_struct_with_hash_access_spec.rb
|
924
944
|
- spec/lib/blacklight/parameters_spec.rb
|
945
|
+
- spec/lib/blacklight/search_state/filter_field_spec.rb
|
925
946
|
- spec/lib/blacklight/search_state_spec.rb
|
926
947
|
- spec/lib/blacklight_spec.rb
|
927
948
|
- spec/lib/tasks/blacklight_task_spec.rb
|