blacklight 8.3.0 → 8.4.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/.github/workflows/ruby.yml +9 -5
- data/.rubocop.yml +3 -0
- data/.rubocop_todo.yml +22 -55
- data/Gemfile +2 -10
- data/README.md +2 -2
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.esm.js +5 -1
- data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +5 -1
- data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
- data/app/assets/stylesheets/blacklight/_balanced_list.scss +1 -1
- data/app/assets/stylesheets/blacklight/_bookmark.scss +30 -0
- data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +0 -4
- data/app/assets/stylesheets/blacklight/_constraints.scss +15 -9
- data/app/assets/stylesheets/blacklight/_controls.scss +0 -1
- data/app/assets/stylesheets/blacklight/_facets.scss +33 -37
- data/app/assets/stylesheets/blacklight/_header.scss +2 -35
- data/app/assets/stylesheets/blacklight/_icons.scss +3 -2
- data/app/assets/stylesheets/blacklight/_layout.scss +3 -0
- data/app/assets/stylesheets/blacklight/_mixins.scss +4 -4
- data/app/assets/stylesheets/blacklight/_search_form.scss +3 -8
- data/app/assets/stylesheets/blacklight/_search_history.scss +5 -5
- data/app/assets/stylesheets/blacklight/_search_results.scss +5 -2
- data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +16 -10
- data/app/components/blacklight/advanced_search_form_component.html.erb +1 -1
- data/app/components/blacklight/advanced_search_form_component.rb +6 -0
- data/app/components/blacklight/constraint_layout_component.html.erb +2 -9
- data/app/components/blacklight/constraint_layout_component.rb +8 -0
- data/app/components/blacklight/constraints_component.rb +3 -3
- data/app/components/blacklight/document/action_component.rb +2 -1
- data/app/components/blacklight/document/bookmark_component.html.erb +2 -1
- data/app/components/blacklight/document/bookmark_component.rb +6 -0
- data/app/components/blacklight/document/page_header_component.html.erb +7 -0
- data/app/components/blacklight/document/page_header_component.rb +85 -0
- data/app/components/blacklight/document_component.rb +1 -1
- data/app/components/blacklight/facet_component.rb +1 -1
- data/app/components/blacklight/facet_field_checkboxes_component.html.erb +1 -1
- data/app/components/blacklight/facet_field_checkboxes_component.rb +1 -1
- data/app/components/blacklight/facet_field_inclusive_constraint_component.html.erb +1 -1
- data/app/components/blacklight/facet_field_list_component.html.erb +1 -1
- data/app/components/blacklight/facet_item_component.rb +1 -1
- data/app/components/blacklight/icons/bookmark_icon_component.rb +17 -0
- data/app/components/blacklight/icons/icon_component.rb +9 -4
- data/app/components/blacklight/icons/remove_component.rb +16 -0
- data/app/components/blacklight/metadata_field_component.html.erb +1 -1
- data/app/components/blacklight/metadata_field_component.rb +5 -0
- data/app/components/blacklight/response/facet_group_component.rb +1 -1
- data/app/components/blacklight/response/pagination_component.html.erb +1 -1
- data/app/components/blacklight/response/sort_component.html.erb +1 -6
- data/app/components/blacklight/response/sort_component.rb +15 -0
- data/app/components/blacklight/search/per_page_component.html.erb +2 -0
- data/app/components/blacklight/search/per_page_component.rb +50 -0
- data/app/components/blacklight/search_bar_component.html.erb +1 -1
- data/app/components/blacklight/search_context/server_item_pagination_component.html.erb +4 -7
- data/app/components/blacklight/skip_link_component.html.erb +7 -0
- data/app/components/blacklight/skip_link_component.rb +17 -0
- data/app/components/blacklight/system/dropdown_button_component.rb +18 -0
- data/app/components/blacklight/system/dropdown_component.rb +3 -6
- data/app/components/blacklight/system/flash_message_component.html.erb +1 -1
- data/app/components/blacklight/top_navbar_component.html.erb +2 -2
- data/app/components/blacklight/top_navbar_component.rb +4 -0
- data/app/helpers/blacklight/catalog_helper_behavior.rb +2 -0
- data/app/helpers/blacklight/component_helper_behavior.rb +4 -4
- data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -0
- data/app/javascript/blacklight/checkbox_submit.js +5 -1
- data/app/models/concerns/blacklight/document/semantic_fields.rb +1 -1
- data/app/presenters/blacklight/facet_checkbox_item_presenter.rb +11 -0
- data/app/presenters/blacklight/facet_field_presenter.rb +9 -1
- data/app/services/blacklight/search_service.rb +9 -1
- data/app/views/catalog/_per_page_widget.html.erb +1 -10
- data/app/views/catalog/_search_results.html.erb +1 -1
- data/app/views/catalog/_show_main_content.html.erb +1 -1
- data/app/views/catalog/show.html.erb +0 -2
- data/app/views/catalog/suggest.html.erb +1 -1
- data/app/views/kaminari/blacklight/_page.html.erb +14 -8
- data/app/views/layouts/blacklight/base.html.erb +3 -4
- data/blacklight.gemspec +4 -0
- data/{docker-compose.yml → compose.yaml} +1 -1
- data/config/locales/blacklight.ar.yml +3 -0
- data/config/locales/blacklight.de.yml +3 -0
- data/config/locales/blacklight.en.yml +216 -229
- data/config/locales/blacklight.es.yml +3 -0
- data/config/locales/blacklight.fr.yml +3 -0
- data/config/locales/blacklight.hu.yml +3 -0
- data/config/locales/blacklight.it.yml +3 -0
- data/config/locales/blacklight.nl.yml +3 -0
- data/config/locales/blacklight.pt-BR.yml +3 -0
- data/config/locales/blacklight.sq.yml +3 -0
- data/config/locales/blacklight.zh.yml +3 -0
- data/lib/blacklight/abstract_repository.rb +6 -0
- data/lib/blacklight/configuration.rb +32 -19
- data/lib/blacklight/parameters.rb +1 -1
- data/lib/blacklight/solr/repository.rb +11 -4
- data/lib/blacklight/solr/response/params.rb +1 -1
- data/lib/blacklight/solr/response.rb +0 -12
- data/lib/blacklight/solr/search_builder_behavior.rb +1 -1
- data/lib/blacklight/solr.rb +0 -6
- data/lib/blacklight.rb +4 -14
- data/lib/generators/blacklight/assets/propshaft_generator.rb +2 -2
- data/lib/generators/blacklight/models_generator.rb +1 -1
- data/package.json +1 -1
- data/spec/components/blacklight/document/action_component_spec.rb +1 -1
- data/spec/components/blacklight/document/page_header_component_spec.rb +92 -0
- data/spec/components/blacklight/document_component_spec.rb +20 -0
- data/spec/components/blacklight/icons/icon_component_spec.rb +42 -0
- data/spec/components/blacklight/search_context/server_item_pagination_component_spec.rb +1 -1
- data/spec/controllers/blacklight/catalog_spec.rb +1 -1
- data/spec/controllers/catalog_controller_spec.rb +5 -5
- data/spec/features/advanced_search_spec.rb +16 -2
- data/spec/features/bookmarks_spec.rb +15 -0
- data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +2 -2
- data/spec/lib/blacklight/nested_open_struct_with_hash_access_spec.rb +1 -1
- data/spec/lib/blacklight/open_struct_with_hash_access_spec.rb +1 -1
- data/spec/models/blacklight/configuration_spec.rb +12 -12
- data/spec/models/blacklight/solr/document_spec.rb +2 -2
- data/spec/models/blacklight/solr/repository_spec.rb +31 -13
- data/spec/models/blacklight/solr/response/facets_spec.rb +2 -2
- data/spec/models/blacklight/solr/response/group_spec.rb +1 -1
- data/spec/models/blacklight/solr/response_spec.rb +2 -2
- data/spec/models/blacklight/solr/search_builder_behavior_spec.rb +1 -1
- data/spec/models/bookmark_spec.rb +1 -1
- data/spec/presenters/blacklight/document_presenter_spec.rb +2 -2
- data/spec/presenters/blacklight/facet_checkbox_item_presenter_spec.rb +42 -0
- data/spec/presenters/blacklight/facet_field_presenter_spec.rb +14 -0
- data/spec/requests/load_suggestions_spec.rb +5 -5
- data/spec/services/blacklight/search_service_spec.rb +2 -2
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
- data/tasks/blacklight.rake +5 -5
- metadata +76 -4
@@ -24,12 +24,12 @@ RSpec.describe Blacklight::Solr::Repository, :api do
|
|
24
24
|
blacklight_config.document_solr_path = 'abc'
|
25
25
|
blacklight_config.solr_path = 'xyz'
|
26
26
|
allow(subject.connection).to receive(:send_and_receive).with('abc', anything).and_return(mock_response)
|
27
|
-
expect(subject.find("123")).to
|
27
|
+
expect(subject.find("123")).to be_a Blacklight::Solr::Response
|
28
28
|
end
|
29
29
|
|
30
30
|
it "uses a default :qt param" do
|
31
31
|
allow(subject.connection).to receive(:send_and_receive).with('get', hash_including(params: hash_including(ids: '123'))).and_return(mock_response)
|
32
|
-
expect(subject.find("123", {})).to
|
32
|
+
expect(subject.find("123", {})).to be_a Blacklight::Solr::Response
|
33
33
|
end
|
34
34
|
|
35
35
|
context "without a document solr path configured" do
|
@@ -40,7 +40,7 @@ RSpec.describe Blacklight::Solr::Repository, :api do
|
|
40
40
|
it "uses the default solr path" do
|
41
41
|
blacklight_config.solr_path = 'xyz'
|
42
42
|
allow(subject.connection).to receive(:send_and_receive).with('xyz', anything).and_return(mock_response)
|
43
|
-
expect(subject.find("123")).to
|
43
|
+
expect(subject.find("123")).to be_a Blacklight::Solr::Response
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -53,14 +53,14 @@ RSpec.describe Blacklight::Solr::Repository, :api do
|
|
53
53
|
it "uses the provided :qt param" do
|
54
54
|
blacklight_config.document_solr_request_handler = 'xyz'
|
55
55
|
allow(subject.connection).to receive(:send_and_receive).with('select', hash_including(params: { id: '123', qt: 'abc' })).and_return(mock_response)
|
56
|
-
expect(subject.find("123", qt: 'abc')).to
|
56
|
+
expect(subject.find("123", qt: 'abc')).to be_a Blacklight::Solr::Response
|
57
57
|
end
|
58
58
|
|
59
59
|
it "uses the :qt parameter from the default_document_solr_params" do
|
60
60
|
blacklight_config.default_document_solr_params[:qt] = 'abc'
|
61
61
|
blacklight_config.document_solr_request_handler = 'xyz'
|
62
62
|
allow(subject.connection).to receive(:send_and_receive).with('select', hash_including(params: { id: '123', qt: 'abc' })).and_return(mock_response)
|
63
|
-
expect(subject.find("123")).to
|
63
|
+
expect(subject.find("123")).to be_a Blacklight::Solr::Response
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
@@ -68,8 +68,26 @@ RSpec.describe Blacklight::Solr::Repository, :api do
|
|
68
68
|
doc_params = ActiveSupport::HashWithIndifferentAccess.new
|
69
69
|
allow(subject.connection).to receive(:send_and_receive).with('get', anything).and_return(mock_response)
|
70
70
|
response = subject.find("123", doc_params)
|
71
|
-
expect(response).to
|
72
|
-
expect(response.params).to
|
71
|
+
expect(response).to be_a Blacklight::Solr::Response
|
72
|
+
expect(response.params).to be_a ActiveSupport::HashWithIndifferentAccess
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe '#find_many' do
|
77
|
+
context 'with a configured fetch_many_documents_path' do
|
78
|
+
it 'uses the path' do
|
79
|
+
blacklight_config.fetch_many_documents_path = 'documents'
|
80
|
+
allow(subject.connection).to receive(:send_and_receive).with('documents', anything).and_return(mock_response)
|
81
|
+
expect(subject.find_many({})).to be_a Blacklight::Solr::Response
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
context 'without a configured fetch_many_documents_path' do
|
86
|
+
it 'falls back to the search path' do
|
87
|
+
blacklight_config.solr_path = 'xyz'
|
88
|
+
allow(subject.connection).to receive(:send_and_receive).with('xyz', anything).and_return(mock_response)
|
89
|
+
expect(subject.find_many({})).to be_a Blacklight::Solr::Response
|
90
|
+
end
|
73
91
|
end
|
74
92
|
end
|
75
93
|
|
@@ -77,24 +95,24 @@ RSpec.describe Blacklight::Solr::Repository, :api do
|
|
77
95
|
it "uses the search-specific solr path" do
|
78
96
|
blacklight_config.solr_path = 'xyz'
|
79
97
|
allow(subject.connection).to receive(:send_and_receive).with('xyz', anything).and_return(mock_response)
|
80
|
-
expect(subject.search({})).to
|
98
|
+
expect(subject.search({})).to be_a Blacklight::Solr::Response
|
81
99
|
end
|
82
100
|
|
83
101
|
it "uses the default solr path" do
|
84
102
|
allow(subject.connection).to receive(:send_and_receive).with('select', anything).and_return(mock_response)
|
85
|
-
expect(subject.search({})).to
|
103
|
+
expect(subject.search({})).to be_a Blacklight::Solr::Response
|
86
104
|
end
|
87
105
|
|
88
106
|
it "uses a default :qt param" do
|
89
107
|
blacklight_config.qt = 'xyz'
|
90
108
|
allow(subject.connection).to receive(:send_and_receive).with('select', hash_including(params: { qt: 'xyz' })).and_return(mock_response)
|
91
|
-
expect(subject.search({})).to
|
109
|
+
expect(subject.search({})).to be_a Blacklight::Solr::Response
|
92
110
|
end
|
93
111
|
|
94
112
|
it "uses the provided :qt param" do
|
95
113
|
blacklight_config.qt = 'xyz'
|
96
114
|
allow(subject.connection).to receive(:send_and_receive).with('select', hash_including(params: { qt: 'abc' })).and_return(mock_response)
|
97
|
-
expect(subject.search(qt: 'abc')).to
|
115
|
+
expect(subject.search(qt: 'abc')).to be_a Blacklight::Solr::Response
|
98
116
|
end
|
99
117
|
|
100
118
|
it "preserves the class of the incoming params" do
|
@@ -103,8 +121,8 @@ RSpec.describe Blacklight::Solr::Repository, :api do
|
|
103
121
|
allow(subject.connection).to receive(:send_and_receive).with('select', anything).and_return(mock_response)
|
104
122
|
|
105
123
|
response = subject.search(search_params)
|
106
|
-
expect(response).to
|
107
|
-
expect(response.params).to
|
124
|
+
expect(response).to be_a Blacklight::Solr::Response
|
125
|
+
expect(response.params).to be_a ActiveSupport::HashWithIndifferentAccess
|
108
126
|
end
|
109
127
|
|
110
128
|
it "calls send_and_receive with params returned from request factory method" do
|
@@ -247,7 +247,7 @@ RSpec.describe Blacklight::Solr::Response::Facets, :api do
|
|
247
247
|
it "converts the query facets into a double RSolr FacetField" do
|
248
248
|
field = subject.aggregations['my_query_facet_field']
|
249
249
|
|
250
|
-
expect(field).to
|
250
|
+
expect(field).to be_a Blacklight::Solr::Response::Facets::FacetField
|
251
251
|
|
252
252
|
expect(field.name).to eq 'my_query_facet_field'
|
253
253
|
expect(field.items.size).to eq 3
|
@@ -316,7 +316,7 @@ RSpec.describe Blacklight::Solr::Response::Facets, :api do
|
|
316
316
|
it "converts the pivot facet into a double RSolr FacetField" do
|
317
317
|
field = subject.aggregations['my_pivot_facet_field']
|
318
318
|
|
319
|
-
expect(field).to
|
319
|
+
expect(field).to be_a Blacklight::Solr::Response::Facets::FacetField
|
320
320
|
|
321
321
|
expect(field.name).to eq 'my_pivot_facet_field'
|
322
322
|
|
@@ -37,7 +37,7 @@ RSpec.describe Blacklight::Solr::Response::Group, :api do
|
|
37
37
|
describe "#docs" do
|
38
38
|
it "is a list of SolrDocuments" do
|
39
39
|
subject.docs.each do |doc|
|
40
|
-
expect(doc).to
|
40
|
+
expect(doc).to be_a SolrDocument
|
41
41
|
end
|
42
42
|
|
43
43
|
expect(subject.docs.first.id).to eq 1
|
@@ -79,7 +79,7 @@ RSpec.describe Blacklight::Solr::Response, :api do
|
|
79
79
|
if Kaminari.config.respond_to? :max_pages
|
80
80
|
expect(r.max_pages).to be_nil
|
81
81
|
end
|
82
|
-
expect(r).to
|
82
|
+
expect(r).to be_a Kaminari::PageScopeMethods
|
83
83
|
end
|
84
84
|
|
85
85
|
describe "FacetItem" do
|
@@ -101,7 +101,7 @@ RSpec.describe Blacklight::Solr::Response, :api do
|
|
101
101
|
|
102
102
|
expect(item.hits).to eq 15
|
103
103
|
expect(item.value).to eq 'value'
|
104
|
-
expect(item).to
|
104
|
+
expect(item).to be_a(OpenStruct)
|
105
105
|
end
|
106
106
|
|
107
107
|
it "provides a label accessor" do
|
@@ -591,7 +591,7 @@ RSpec.describe Blacklight::Solr::SearchBuilderBehavior, :api do
|
|
591
591
|
|
592
592
|
subject.add_facet_fq_to_solr(solr_parameters)
|
593
593
|
|
594
|
-
expect(solr_parameters[:fq]).to
|
594
|
+
expect(solr_parameters[:fq]).to be_a Array
|
595
595
|
end
|
596
596
|
|
597
597
|
context "facet not defined in config" do
|
@@ -30,7 +30,7 @@ RSpec.describe Bookmark do
|
|
30
30
|
|
31
31
|
describe "#document" do
|
32
32
|
it "is a SolrDocument with just an id field" do
|
33
|
-
expect(subject.document).to
|
33
|
+
expect(subject.document).to be_a SolrDocument
|
34
34
|
expect(subject.document.id).to eq 'u001'
|
35
35
|
end
|
36
36
|
end
|
@@ -50,14 +50,14 @@ RSpec.describe Blacklight::DocumentPresenter do
|
|
50
50
|
|
51
51
|
describe '#thumbnail' do
|
52
52
|
it 'returns a thumbnail presenter' do
|
53
|
-
expect(presenter.thumbnail).to
|
53
|
+
expect(presenter.thumbnail).to be_a(Blacklight::ThumbnailPresenter)
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'use the configured thumbnail presenter' do
|
57
57
|
custom_presenter_class = Class.new(Blacklight::ThumbnailPresenter)
|
58
58
|
blacklight_config.index.thumbnail_presenter = custom_presenter_class
|
59
59
|
|
60
|
-
expect(presenter.thumbnail).to
|
60
|
+
expect(presenter.thumbnail).to be_a custom_presenter_class
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Blacklight::FacetCheckboxItemPresenter, type: :presenter do
|
6
|
+
subject(:presenter) do
|
7
|
+
described_class.new(facet_item, facet_config, view_context, facet_field, search_state)
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:facet_item) { Blacklight::Solr::Response::Facets::FacetItem.new(value: 'Book', hits: 30) }
|
11
|
+
let(:facet_config) { Blacklight::Configuration::FacetField.new(key: 'format') }
|
12
|
+
let(:view_context) { controller.view_context }
|
13
|
+
let(:filter_field) { Blacklight::SearchState::FilterField.new(facet_config, search_state) }
|
14
|
+
let(:facet_field) { Blacklight::Solr::Response::Facets::FacetField.new('format', [facet_item]) }
|
15
|
+
let(:params) { ActionController::Parameters.new(f_inclusive: { format: ["Book"] }) }
|
16
|
+
let(:blacklight_config) { Blacklight::Configuration.new }
|
17
|
+
let(:search_state) { Blacklight::SearchState.new(params, blacklight_config) }
|
18
|
+
|
19
|
+
before do
|
20
|
+
blacklight_config.add_facet_field 'format'
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '#selected?' do
|
24
|
+
subject { presenter.selected? }
|
25
|
+
|
26
|
+
context 'with a matching inclusive filter' do
|
27
|
+
it { is_expected.to be true }
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'with an inclusive filter that does not match' do
|
31
|
+
let(:params) { ActionController::Parameters.new(f_inclusive: { format: ["Manuscript"] }) }
|
32
|
+
|
33
|
+
it { is_expected.to be false }
|
34
|
+
end
|
35
|
+
|
36
|
+
context 'with a matching exclusive filter' do
|
37
|
+
let(:params) { ActionController::Parameters.new(f: { format: ["Book"] }) }
|
38
|
+
|
39
|
+
it { is_expected.to be false }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -51,6 +51,20 @@ RSpec.describe Blacklight::FacetFieldPresenter, type: :presenter do
|
|
51
51
|
it "is false if no value for facet is selected" do
|
52
52
|
expect(presenter.active?).to be false
|
53
53
|
end
|
54
|
+
|
55
|
+
context 'with an advanced search action' do
|
56
|
+
before { controller.params[:action] = 'advanced_search' }
|
57
|
+
|
58
|
+
it "is true if any value for inclusive facet is selected" do
|
59
|
+
search_state.params[:f_inclusive] = ActiveSupport::HashWithIndifferentAccess.new(key: [1])
|
60
|
+
expect(presenter.active?).to be true
|
61
|
+
end
|
62
|
+
|
63
|
+
it "is false if no value for inclusive facet is selected" do
|
64
|
+
search_state.params[:f] = ActiveSupport::HashWithIndifferentAccess.new(key: [1])
|
65
|
+
expect(presenter.active?).to be false
|
66
|
+
end
|
67
|
+
end
|
54
68
|
end
|
55
69
|
|
56
70
|
describe '#in_modal?' do
|
@@ -6,11 +6,11 @@ RSpec.describe 'GET /catalog/suggest' do
|
|
6
6
|
it 'returns suggestions' do
|
7
7
|
get '/catalog/suggest?q=new'
|
8
8
|
expect(response.body).to eq <<-RESULT
|
9
|
-
<li role="option"><span>new jersey</span></li>
|
10
|
-
<li role="option"><span>new jersey bridgeton biography</span></li>
|
11
|
-
<li role="option"><span>new jersey bridgeton history</span></li>
|
12
|
-
<li role="option"><span>new york</span></li>
|
13
|
-
<li role="option"><span>nuwākshūṭ</span></li>
|
9
|
+
<li role="option" class="dropdown-item"><span>new jersey</span></li>
|
10
|
+
<li role="option" class="dropdown-item"><span>new jersey bridgeton biography</span></li>
|
11
|
+
<li role="option" class="dropdown-item"><span>new jersey bridgeton history</span></li>
|
12
|
+
<li role="option" class="dropdown-item"><span>new york</span></li>
|
13
|
+
<li role="option" class="dropdown-item"><span>nuwākshūṭ</span></li>
|
14
14
|
RESULT
|
15
15
|
end
|
16
16
|
end
|
@@ -77,7 +77,7 @@ RSpec.describe Blacklight::SearchService, :api do
|
|
77
77
|
end
|
78
78
|
|
79
79
|
it "returns a grouped response" do
|
80
|
-
expect(service.search_results).to
|
80
|
+
expect(service.search_results).to be_a Blacklight::Solr::Response::GroupResponse
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
@@ -93,7 +93,7 @@ RSpec.describe Blacklight::SearchService, :api do
|
|
93
93
|
|
94
94
|
it "returns a grouped response" do
|
95
95
|
solr_response = service.search_results
|
96
|
-
expect(solr_response).to
|
96
|
+
expect(solr_response).to be_a Blacklight::Solr::Response::GroupResponse
|
97
97
|
expect(solr_response.group_field).to eq "title_si"
|
98
98
|
end
|
99
99
|
end
|
@@ -39,7 +39,7 @@ class TestAppGenerator < Rails::Generators::Base
|
|
39
39
|
src_template = File.join(Blacklight::Engine.root, 'app', 'components', 'blacklight', 'top_navbar_component.html.erb')
|
40
40
|
target_template = File.join('app', 'components', 'blacklight', 'top_navbar_component.html.erb')
|
41
41
|
create_file(target_template) do
|
42
|
-
File.read(src_template).gsub('
|
42
|
+
File.read(src_template).gsub('aria-label', 'data-template-override="top_navbar_component" aria-label')
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
data/tasks/blacklight.rake
CHANGED
@@ -21,18 +21,18 @@ def system_with_error_handling(*args)
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def with_solr(&block)
|
24
|
-
# We're being invoked by the app entrypoint script and solr is already up via docker
|
24
|
+
# We're being invoked by the app entrypoint script and solr is already up via docker compose
|
25
25
|
if ENV['SOLR_ENV'] == 'docker-compose'
|
26
26
|
yield
|
27
|
-
elsif system('docker
|
28
|
-
# We're not running docker
|
27
|
+
elsif system('docker compose -v')
|
28
|
+
# We're not running `docker compose up' but still want to use a docker instance of solr.
|
29
29
|
begin
|
30
30
|
puts "Starting Solr"
|
31
|
-
system_with_error_handling "docker
|
31
|
+
system_with_error_handling "docker compose up -d solr"
|
32
32
|
yield
|
33
33
|
ensure
|
34
34
|
puts "Stopping Solr"
|
35
|
-
system_with_error_handling "docker
|
35
|
+
system_with_error_handling "docker compose stop solr"
|
36
36
|
end
|
37
37
|
else
|
38
38
|
SolrWrapper.wrap do |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: 8.
|
4
|
+
version: 8.4.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: 2024-
|
20
|
+
date: 2024-09-18 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -129,6 +129,20 @@ dependencies:
|
|
129
129
|
- - "<"
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '4'
|
132
|
+
- !ruby/object:Gem::Dependency
|
133
|
+
name: zeitwerk
|
134
|
+
requirement: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
type: :runtime
|
140
|
+
prerelease: false
|
141
|
+
version_requirements: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
132
146
|
- !ruby/object:Gem::Dependency
|
133
147
|
name: rsolr
|
134
148
|
requirement: !ruby/object:Gem::Requirement
|
@@ -303,6 +317,48 @@ dependencies:
|
|
303
317
|
- - ">="
|
304
318
|
- !ruby/object:Gem::Version
|
305
319
|
version: '0'
|
320
|
+
- !ruby/object:Gem::Dependency
|
321
|
+
name: rubocop-capybara
|
322
|
+
requirement: !ruby/object:Gem::Requirement
|
323
|
+
requirements:
|
324
|
+
- - ">="
|
325
|
+
- !ruby/object:Gem::Version
|
326
|
+
version: '0'
|
327
|
+
type: :development
|
328
|
+
prerelease: false
|
329
|
+
version_requirements: !ruby/object:Gem::Requirement
|
330
|
+
requirements:
|
331
|
+
- - ">="
|
332
|
+
- !ruby/object:Gem::Version
|
333
|
+
version: '0'
|
334
|
+
- !ruby/object:Gem::Dependency
|
335
|
+
name: rubocop-rspec_rails
|
336
|
+
requirement: !ruby/object:Gem::Requirement
|
337
|
+
requirements:
|
338
|
+
- - ">="
|
339
|
+
- !ruby/object:Gem::Version
|
340
|
+
version: '0'
|
341
|
+
type: :development
|
342
|
+
prerelease: false
|
343
|
+
version_requirements: !ruby/object:Gem::Requirement
|
344
|
+
requirements:
|
345
|
+
- - ">="
|
346
|
+
- !ruby/object:Gem::Version
|
347
|
+
version: '0'
|
348
|
+
- !ruby/object:Gem::Dependency
|
349
|
+
name: rubocop-factory_bot
|
350
|
+
requirement: !ruby/object:Gem::Requirement
|
351
|
+
requirements:
|
352
|
+
- - ">="
|
353
|
+
- !ruby/object:Gem::Version
|
354
|
+
version: '0'
|
355
|
+
type: :development
|
356
|
+
prerelease: false
|
357
|
+
version_requirements: !ruby/object:Gem::Requirement
|
358
|
+
requirements:
|
359
|
+
- - ">="
|
360
|
+
- !ruby/object:Gem::Version
|
361
|
+
version: '0'
|
306
362
|
- !ruby/object:Gem::Dependency
|
307
363
|
name: i18n-tasks
|
308
364
|
requirement: !ruby/object:Gem::Requirement
|
@@ -409,6 +465,8 @@ files:
|
|
409
465
|
- app/components/blacklight/document/group_component.rb
|
410
466
|
- app/components/blacklight/document/more_like_this_component.html.erb
|
411
467
|
- app/components/blacklight/document/more_like_this_component.rb
|
468
|
+
- app/components/blacklight/document/page_header_component.html.erb
|
469
|
+
- app/components/blacklight/document/page_header_component.rb
|
412
470
|
- app/components/blacklight/document/show_tools_component.html.erb
|
413
471
|
- app/components/blacklight/document/show_tools_component.rb
|
414
472
|
- app/components/blacklight/document/sidebar_component.html.erb
|
@@ -440,9 +498,11 @@ files:
|
|
440
498
|
- app/components/blacklight/header_component.html.erb
|
441
499
|
- app/components/blacklight/header_component.rb
|
442
500
|
- app/components/blacklight/hidden_search_state_component.rb
|
501
|
+
- app/components/blacklight/icons/bookmark_icon_component.rb
|
443
502
|
- app/components/blacklight/icons/icon_component.rb
|
444
503
|
- app/components/blacklight/icons/legacy_icon_component.rb
|
445
504
|
- app/components/blacklight/icons/list_component.rb
|
505
|
+
- app/components/blacklight/icons/remove_component.rb
|
446
506
|
- app/components/blacklight/icons/search_component.rb
|
447
507
|
- app/components/blacklight/metadata_field_component.html.erb
|
448
508
|
- app/components/blacklight/metadata_field_component.rb
|
@@ -461,6 +521,8 @@ files:
|
|
461
521
|
- app/components/blacklight/response/view_type_button_component.rb
|
462
522
|
- app/components/blacklight/response/view_type_component.html.erb
|
463
523
|
- app/components/blacklight/response/view_type_component.rb
|
524
|
+
- app/components/blacklight/search/per_page_component.html.erb
|
525
|
+
- app/components/blacklight/search/per_page_component.rb
|
464
526
|
- app/components/blacklight/search/sidebar_component.html.erb
|
465
527
|
- app/components/blacklight/search/sidebar_component.rb
|
466
528
|
- app/components/blacklight/search_bar_component.html.erb
|
@@ -475,7 +537,10 @@ files:
|
|
475
537
|
- app/components/blacklight/search_history_constraint_layout_component.rb
|
476
538
|
- app/components/blacklight/search_navbar_component.html.erb
|
477
539
|
- app/components/blacklight/search_navbar_component.rb
|
540
|
+
- app/components/blacklight/skip_link_component.html.erb
|
541
|
+
- app/components/blacklight/skip_link_component.rb
|
478
542
|
- app/components/blacklight/start_over_button_component.rb
|
543
|
+
- app/components/blacklight/system/dropdown_button_component.rb
|
479
544
|
- app/components/blacklight/system/dropdown_component.html.erb
|
480
545
|
- app/components/blacklight/system/dropdown_component.rb
|
481
546
|
- app/components/blacklight/system/flash_message_component.html.erb
|
@@ -536,6 +601,7 @@ files:
|
|
536
601
|
- app/models/solr_document.rb
|
537
602
|
- app/presenters/blacklight/clause_presenter.rb
|
538
603
|
- app/presenters/blacklight/document_presenter.rb
|
604
|
+
- app/presenters/blacklight/facet_checkbox_item_presenter.rb
|
539
605
|
- app/presenters/blacklight/facet_field_presenter.rb
|
540
606
|
- app/presenters/blacklight/facet_grouped_item_presenter.rb
|
541
607
|
- app/presenters/blacklight/facet_item_pivot_presenter.rb
|
@@ -646,6 +712,7 @@ files:
|
|
646
712
|
- app/views/shared/_sitelinks_search_box.html.erb
|
647
713
|
- app/views/shared/_user_util_links.html.erb
|
648
714
|
- blacklight.gemspec
|
715
|
+
- compose.yaml
|
649
716
|
- config/i18n-tasks.yml
|
650
717
|
- config/importmap.rb
|
651
718
|
- config/locales/blacklight.ar.yml
|
@@ -664,7 +731,6 @@ files:
|
|
664
731
|
- db/migrate/20140202020201_create_searches.rb
|
665
732
|
- db/migrate/20140202020202_create_bookmarks.rb
|
666
733
|
- db/migrate/20140320000000_add_polymorphic_type_to_bookmarks.rb
|
667
|
-
- docker-compose.yml
|
668
734
|
- lib/blacklight.rb
|
669
735
|
- lib/blacklight/abstract_repository.rb
|
670
736
|
- lib/blacklight/component.rb
|
@@ -757,6 +823,7 @@ files:
|
|
757
823
|
- spec/components/blacklight/constraints_component_spec.rb
|
758
824
|
- spec/components/blacklight/document/action_component_spec.rb
|
759
825
|
- spec/components/blacklight/document/group_component_spec.rb
|
826
|
+
- spec/components/blacklight/document/page_header_component_spec.rb
|
760
827
|
- spec/components/blacklight/document/sidebar_component_spec.rb
|
761
828
|
- spec/components/blacklight/document_component_spec.rb
|
762
829
|
- spec/components/blacklight/document_metadata_component_spec.rb
|
@@ -767,6 +834,7 @@ files:
|
|
767
834
|
- spec/components/blacklight/facet_item_pivot_component_spec.rb
|
768
835
|
- spec/components/blacklight/header_component_spec.rb
|
769
836
|
- spec/components/blacklight/hidden_search_state_component_spec.rb
|
837
|
+
- spec/components/blacklight/icons/icon_component_spec.rb
|
770
838
|
- spec/components/blacklight/metadata_field_component_spec.rb
|
771
839
|
- spec/components/blacklight/response/pagination_component_spec.rb
|
772
840
|
- spec/components/blacklight/response/spellcheck_component_spec.rb
|
@@ -858,6 +926,7 @@ files:
|
|
858
926
|
- spec/models/solr_document_spec.rb
|
859
927
|
- spec/presenters/blacklight/clause_presenter_spec.rb
|
860
928
|
- spec/presenters/blacklight/document_presenter_spec.rb
|
929
|
+
- spec/presenters/blacklight/facet_checkbox_item_presenter_spec.rb
|
861
930
|
- spec/presenters/blacklight/facet_field_presenter_spec.rb
|
862
931
|
- spec/presenters/blacklight/facet_grouped_item_presenter_spec.rb
|
863
932
|
- spec/presenters/blacklight/facet_item_presenter_spec.rb
|
@@ -925,7 +994,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
925
994
|
- !ruby/object:Gem::Version
|
926
995
|
version: '0'
|
927
996
|
requirements: []
|
928
|
-
rubygems_version: 3.5.
|
997
|
+
rubygems_version: 3.5.18
|
929
998
|
signing_key:
|
930
999
|
specification_version: 4
|
931
1000
|
summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
|
@@ -936,6 +1005,7 @@ test_files:
|
|
936
1005
|
- spec/components/blacklight/constraints_component_spec.rb
|
937
1006
|
- spec/components/blacklight/document/action_component_spec.rb
|
938
1007
|
- spec/components/blacklight/document/group_component_spec.rb
|
1008
|
+
- spec/components/blacklight/document/page_header_component_spec.rb
|
939
1009
|
- spec/components/blacklight/document/sidebar_component_spec.rb
|
940
1010
|
- spec/components/blacklight/document_component_spec.rb
|
941
1011
|
- spec/components/blacklight/document_metadata_component_spec.rb
|
@@ -946,6 +1016,7 @@ test_files:
|
|
946
1016
|
- spec/components/blacklight/facet_item_pivot_component_spec.rb
|
947
1017
|
- spec/components/blacklight/header_component_spec.rb
|
948
1018
|
- spec/components/blacklight/hidden_search_state_component_spec.rb
|
1019
|
+
- spec/components/blacklight/icons/icon_component_spec.rb
|
949
1020
|
- spec/components/blacklight/metadata_field_component_spec.rb
|
950
1021
|
- spec/components/blacklight/response/pagination_component_spec.rb
|
951
1022
|
- spec/components/blacklight/response/spellcheck_component_spec.rb
|
@@ -1037,6 +1108,7 @@ test_files:
|
|
1037
1108
|
- spec/models/solr_document_spec.rb
|
1038
1109
|
- spec/presenters/blacklight/clause_presenter_spec.rb
|
1039
1110
|
- spec/presenters/blacklight/document_presenter_spec.rb
|
1111
|
+
- spec/presenters/blacklight/facet_checkbox_item_presenter_spec.rb
|
1040
1112
|
- spec/presenters/blacklight/facet_field_presenter_spec.rb
|
1041
1113
|
- spec/presenters/blacklight/facet_grouped_item_presenter_spec.rb
|
1042
1114
|
- spec/presenters/blacklight/facet_item_presenter_spec.rb
|