blacklight 7.12.0 → 7.14.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 +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
@@ -133,7 +133,7 @@ module Blacklight::Catalog
|
|
133
133
|
# Check if any search parameters have been set
|
134
134
|
# @return [Boolean]
|
135
135
|
def has_search_parameters?
|
136
|
-
params[:
|
136
|
+
params[:search_field].present? || search_state.has_constraints?
|
137
137
|
end
|
138
138
|
|
139
139
|
# TODO: deprecate this constant with #facet_limit_for
|
@@ -316,11 +316,11 @@ module Blacklight::Catalog
|
|
316
316
|
# If there are errors coming from the index page, we want to trap those sensibly
|
317
317
|
|
318
318
|
if flash[:notice] == flash_notice
|
319
|
-
logger
|
319
|
+
logger&.error "Cowardly aborting rsolr_request_error exception handling, because we redirected to a page that raises another exception"
|
320
320
|
raise exception
|
321
321
|
end
|
322
322
|
|
323
|
-
logger
|
323
|
+
logger&.error exception
|
324
324
|
|
325
325
|
flash[:notice] = flash_notice
|
326
326
|
redirect_to search_action_url
|
@@ -111,13 +111,13 @@ module Blacklight::SearchContext
|
|
111
111
|
def setup_next_and_previous_documents
|
112
112
|
if search_session['counter'] && current_search_session
|
113
113
|
index = search_session['counter'].to_i - 1
|
114
|
-
response, documents = search_service.previous_and_next_documents_for_search index, search_state.reset(current_search_session.query_params)
|
114
|
+
response, documents = search_service.previous_and_next_documents_for_search index, search_state.reset(current_search_session.query_params)
|
115
115
|
|
116
116
|
search_session['total'] = response.total
|
117
117
|
{ prev: documents.first, next: documents.last }
|
118
118
|
end
|
119
119
|
rescue Blacklight::Exceptions::InvalidRequest => e
|
120
|
-
logger
|
120
|
+
logger&.warn "Unable to setup next and previous documents: #{e}"
|
121
121
|
nil
|
122
122
|
end
|
123
123
|
end
|
@@ -13,7 +13,7 @@
|
|
13
13
|
module Blacklight::Searchable
|
14
14
|
# @return [Blacklight::SearchService]
|
15
15
|
def search_service
|
16
|
-
search_service_class.new(config: blacklight_config, user_params: search_state.to_h, **search_service_context)
|
16
|
+
search_service_class.new(config: blacklight_config, search_state: search_state, user_params: search_state.to_h, **search_service_context)
|
17
17
|
end
|
18
18
|
|
19
19
|
# @return [Hash] a hash of context information to pass through to the search service
|
@@ -408,7 +408,7 @@ module Blacklight::BlacklightHelperBehavior
|
|
408
408
|
# @private
|
409
409
|
|
410
410
|
def self.blacklight_path
|
411
|
-
@blacklight_path ||= Gem.loaded_specs["blacklight"].
|
411
|
+
@blacklight_path ||= Gem.loaded_specs["blacklight"].full_gem_path
|
412
412
|
end
|
413
413
|
|
414
414
|
def partial_from_blacklight?(partial)
|
@@ -10,7 +10,7 @@ module Blacklight
|
|
10
10
|
deprecation_deprecate :document_action_label
|
11
11
|
|
12
12
|
# @deprecated
|
13
|
-
def document_action_path action_opts, url_opts =
|
13
|
+
def document_action_path action_opts, url_opts = {}
|
14
14
|
if action_opts.path
|
15
15
|
send(action_opts.path, url_opts)
|
16
16
|
elsif url_opts[:id].class.respond_to?(:model_name)
|
@@ -103,15 +103,9 @@ module Blacklight::ConfigurationHelperBehavior
|
|
103
103
|
# @return [String]
|
104
104
|
def view_label view
|
105
105
|
view_config = blacklight_config.view[view]
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
view_config.label,
|
110
|
-
view_config.title,
|
111
|
-
view.to_s.humanize
|
112
|
-
)
|
113
|
-
end
|
114
|
-
deprecation_deprecate view_label: 'Moving to Blacklight::Response::ViewTypeComponent'
|
106
|
+
view_config.display_label(view)
|
107
|
+
end
|
108
|
+
deprecation_deprecate view_label: 'Moving to ViewConfig#display_label and Blacklight::Response::ViewTypeComponent'
|
115
109
|
|
116
110
|
# Shortcut for commonly needed operation, look up display
|
117
111
|
# label for the key specified.
|
@@ -254,7 +254,10 @@ module Blacklight::FacetsHelperBehavior
|
|
254
254
|
# @return [Boolean]
|
255
255
|
def facet_field_in_params? field
|
256
256
|
config = facet_configuration_for_field(field)
|
257
|
-
|
257
|
+
|
258
|
+
Deprecation.silence(Blacklight::SearchState) do
|
259
|
+
search_state.has_facet? config
|
260
|
+
end
|
258
261
|
end
|
259
262
|
# Left undeprecated for the sake of temporary backwards compatibility
|
260
263
|
# deprecation_deprecate :facet_field_in_params?
|
@@ -269,7 +272,10 @@ module Blacklight::FacetsHelperBehavior
|
|
269
272
|
# @return [Boolean]
|
270
273
|
def facet_in_params?(field, item)
|
271
274
|
config = facet_configuration_for_field(field)
|
272
|
-
|
275
|
+
|
276
|
+
Deprecation.silence(Blacklight::SearchState) do
|
277
|
+
search_state.has_facet? config, value: facet_value_for_facet_item(item)
|
278
|
+
end
|
273
279
|
end
|
274
280
|
deprecation_deprecate :facet_in_params?
|
275
281
|
|
@@ -21,43 +21,7 @@ module Blacklight::HashAsHiddenFieldsHelperBehavior
|
|
21
21
|
# @param [Hash] hash
|
22
22
|
# @return [String]
|
23
23
|
def render_hash_as_hidden_fields(hash)
|
24
|
-
|
25
|
-
flatten_hash(hash).each do |name, value|
|
26
|
-
value = Array.wrap(value)
|
27
|
-
value.each do |v|
|
28
|
-
hidden_fields << hidden_field_tag(name, v.to_s, id: nil)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
safe_join(hidden_fields, "\n")
|
33
|
-
end
|
34
|
-
deprecation_deprecate render_hash_as_hidden_fields: 'Moving to a private method of Blacklight::SearchBarComponent'
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
def flatten_hash(hash = params, ancestor_names = [])
|
39
|
-
flat_hash = {}
|
40
|
-
hash.each do |k, v|
|
41
|
-
names = Array.new(ancestor_names)
|
42
|
-
names << k
|
43
|
-
if v.is_a?(Hash)
|
44
|
-
flat_hash.merge!(flatten_hash(v, names))
|
45
|
-
else
|
46
|
-
key = flat_hash_key(names)
|
47
|
-
key += "[]" if v.is_a?(Array)
|
48
|
-
flat_hash[key] = v
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
flat_hash
|
53
|
-
end
|
54
|
-
|
55
|
-
def flat_hash_key(names)
|
56
|
-
names = Array.new(names)
|
57
|
-
name = names.shift.to_s.dup
|
58
|
-
names.each do |n|
|
59
|
-
name << "[#{n}]"
|
60
|
-
end
|
61
|
-
name
|
24
|
+
render Blacklight::HiddenSearchStateComponent.new(params: hash)
|
62
25
|
end
|
26
|
+
deprecation_deprecate render_hash_as_hidden_fields: 'Use Blacklight::HiddenSearchStateComponent instead'
|
63
27
|
end
|
@@ -12,7 +12,7 @@ module Blacklight::IconHelperBehavior
|
|
12
12
|
def blacklight_icon(icon_name, options = {})
|
13
13
|
Rails.cache.fetch([:blacklight_icons, icon_name, options]) do
|
14
14
|
icon = Blacklight::Icon.new(icon_name, **options)
|
15
|
-
tag.span(icon.svg.html_safe, icon.options)
|
15
|
+
tag.span(icon.svg.html_safe, **icon.options)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -84,12 +84,14 @@ module Blacklight::RenderConstraintsHelperBehavior
|
|
84
84
|
Deprecation.warn(Blacklight::RenderConstraintsHelperBehavior, 'render_constraints_filters is deprecated')
|
85
85
|
search_state = convert_to_search_state(params_or_search_state)
|
86
86
|
|
87
|
-
|
87
|
+
Deprecation.silence(Blacklight::SearchState) do
|
88
|
+
return "".html_safe if search_state.filter_params.blank?
|
88
89
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
Deprecation.silence(Blacklight::RenderConstraintsHelperBehavior) do
|
91
|
+
safe_join(search_state.filter_params.each_pair.map do |facet, values|
|
92
|
+
render_filter_element(facet, values, search_state)
|
93
|
+
end, "\n")
|
94
|
+
end
|
93
95
|
end
|
94
96
|
end
|
95
97
|
|
@@ -173,7 +173,7 @@ module Blacklight::RenderPartialsHelperBehavior
|
|
173
173
|
def find_document_show_template_with_view view_type, base_name, format, locals
|
174
174
|
document_partial_path_templates.each do |str|
|
175
175
|
partial = format(str, action_name: base_name, format: format, index_view_type: view_type)
|
176
|
-
logger
|
176
|
+
logger&.debug "Looking for document partial #{partial}"
|
177
177
|
template = lookup_context.find_all(partial, lookup_context.prefixes + [""], true, locals.keys + [:document], {}).first
|
178
178
|
return template if template
|
179
179
|
end
|
@@ -183,7 +183,7 @@ module Blacklight::RenderPartialsHelperBehavior
|
|
183
183
|
def find_document_index_template_with_view view_type, locals
|
184
184
|
document_index_path_templates.each do |str|
|
185
185
|
partial = format(str, index_view_type: view_type)
|
186
|
-
logger
|
186
|
+
logger&.debug "Looking for document index partial #{partial}"
|
187
187
|
template = lookup_context.find_all(partial, lookup_context.prefixes + [""], true, locals.keys + [:documents], {}).first
|
188
188
|
return template if template
|
189
189
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
Blacklight.onLoad(function() {
|
2
2
|
// Button clicks should change focus. As of 10/3/19, Firefox for Mac and
|
3
3
|
// Safari both do not set focus to a button on button click.
|
4
|
+
// See https://zellwk.com/blog/inconsistent-button-behavior/ for background information
|
4
5
|
document.querySelectorAll('button.collapse-toggle').forEach((button) => {
|
5
6
|
button.addEventListener('click', () => {
|
6
7
|
event.target.focus();
|
@@ -101,12 +101,18 @@ Blacklight.modal.modalCloseSelector = '[data-blacklight-modal~=close]';
|
|
101
101
|
// Called on fatal failure of ajax load, function returns content
|
102
102
|
// to show to user in modal. Right now called only for extreme
|
103
103
|
// network errors.
|
104
|
-
Blacklight.modal.onFailure = function(
|
105
|
-
|
106
|
-
|
104
|
+
Blacklight.modal.onFailure = function(jqXHR, textStatus, errorThrown) {
|
105
|
+
console.error('Server error:', this.url, jqXHR.status, errorThrown);
|
106
|
+
|
107
|
+
var contents = '<div class="modal-header">' +
|
108
|
+
'<div class="modal-title">There was a problem with your request.</div>' +
|
107
109
|
'<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="Close">' +
|
108
110
|
' <span aria-hidden="true">×</span>' +
|
109
|
-
'</button>'
|
111
|
+
'</button></div>' +
|
112
|
+
' <div class="modal-body"><p>Expected a successful response from the server, but got an error</p>' +
|
113
|
+
'<pre>' +
|
114
|
+
this.type + ' ' + this.url + "\n" + jqXHR.status + ': ' + errorThrown +
|
115
|
+
'</pre></div>';
|
110
116
|
$(Blacklight.modal.modalSelector).find('.modal-content').html(contents);
|
111
117
|
$(Blacklight.modal.modalSelector).modal('show');
|
112
118
|
}
|
@@ -18,7 +18,9 @@ module Blacklight
|
|
18
18
|
# Check if the query parameters have the given facet field with the
|
19
19
|
# given value.
|
20
20
|
def selected?
|
21
|
-
|
21
|
+
Deprecation.silence(Blacklight::SearchState) do
|
22
|
+
search_state.has_facet? facet_config, value: facet_value
|
23
|
+
end
|
22
24
|
end
|
23
25
|
|
24
26
|
def field_label
|
@@ -44,7 +46,7 @@ module Blacklight
|
|
44
46
|
facet_config.query[value][:label]
|
45
47
|
elsif facet_config.date
|
46
48
|
localization_options = facet_config.date == true ? {} : facet_config.date
|
47
|
-
I18n.l(Time.zone.parse(value), localization_options)
|
49
|
+
I18n.l(Time.zone.parse(value), **localization_options)
|
48
50
|
else
|
49
51
|
value
|
50
52
|
end
|
@@ -60,7 +62,9 @@ module Blacklight
|
|
60
62
|
|
61
63
|
# @private
|
62
64
|
def remove_href(path = search_state)
|
63
|
-
|
65
|
+
Deprecation.silence(Blacklight::SearchState) do
|
66
|
+
view_context.search_action_path(path.remove_facet_params(facet_config.key, facet_item))
|
67
|
+
end
|
64
68
|
end
|
65
69
|
|
66
70
|
# @private
|
@@ -29,12 +29,12 @@ module Blacklight
|
|
29
29
|
|
30
30
|
deprecation_deprecate label: 'Use #heading'
|
31
31
|
|
32
|
-
private
|
33
|
-
|
34
32
|
def view_config
|
35
33
|
@view_config ||= configuration.view_config(view_context.document_index_view_type)
|
36
34
|
end
|
37
35
|
|
36
|
+
private
|
37
|
+
|
38
38
|
# @return [Hash<String,Configuration::Field>] all the fields for this index view
|
39
39
|
def fields
|
40
40
|
configuration.index_fields_for(display_type)
|
@@ -2,9 +2,10 @@
|
|
2
2
|
# SearchService returns search results from the repository
|
3
3
|
module Blacklight
|
4
4
|
class SearchService
|
5
|
-
def initialize(config:, user_params:
|
5
|
+
def initialize(config:, search_state: nil, user_params: nil, search_builder_class: config.search_builder_class, **context)
|
6
6
|
@blacklight_config = config
|
7
|
-
@
|
7
|
+
@search_state = search_state || Blacklight::SearchState.new(user_params || {}, config)
|
8
|
+
@user_params = @search_state.params
|
8
9
|
@search_builder_class = search_builder_class
|
9
10
|
@context = context
|
10
11
|
end
|
@@ -20,9 +21,9 @@ module Blacklight
|
|
20
21
|
# @yield [search_builder] optional block yields configured SearchBuilder, caller can modify or create new SearchBuilder to be used. Block should return SearchBuilder to be used.
|
21
22
|
# @return [Blacklight::Solr::Response] the solr response object
|
22
23
|
def search_results
|
23
|
-
builder = search_builder.with(
|
24
|
-
builder.page =
|
25
|
-
builder.rows =
|
24
|
+
builder = search_builder.with(search_state)
|
25
|
+
builder.page = search_state.page
|
26
|
+
builder.rows = search_state.per_page
|
26
27
|
|
27
28
|
builder = yield(builder) if block_given?
|
28
29
|
response = repository.search(builder)
|
@@ -51,7 +52,7 @@ module Blacklight
|
|
51
52
|
# Get the solr response when retrieving only a single facet field
|
52
53
|
# @return [Blacklight::Solr::Response] the solr response
|
53
54
|
def facet_field_response(facet_field, extra_controller_params = {})
|
54
|
-
query = search_builder.with(
|
55
|
+
query = search_builder.with(search_state).facet(facet_field)
|
55
56
|
repository.search(query.merge(extra_controller_params))
|
56
57
|
end
|
57
58
|
|
@@ -59,7 +60,8 @@ module Blacklight
|
|
59
60
|
# @return [Blacklight::Solr::Response, Array<Blacklight::SolrDocument>] the solr response and a list of the first and last document
|
60
61
|
def previous_and_next_documents_for_search(index, request_params, extra_controller_params = {})
|
61
62
|
p = previous_and_next_document_params(index)
|
62
|
-
|
63
|
+
new_state = request_params.is_a?(Blacklight::SearchState) ? request_params : Blacklight::SearchState.new(request_params, blacklight_config)
|
64
|
+
query = search_builder.with(new_state).start(p.delete(:start)).rows(p.delete(:rows)).merge(extra_controller_params).merge(p)
|
63
65
|
response = repository.search(query)
|
64
66
|
document_list = response.documents
|
65
67
|
|
@@ -78,15 +80,15 @@ module Blacklight
|
|
78
80
|
def opensearch_response(field = nil, extra_controller_params = {})
|
79
81
|
field ||= blacklight_config.view_config(:opensearch).title_field
|
80
82
|
|
81
|
-
query = search_builder.with(
|
83
|
+
query = search_builder.with(search_state).merge(solr_opensearch_params(field)).merge(extra_controller_params)
|
82
84
|
response = repository.search(query)
|
83
85
|
|
84
|
-
[
|
86
|
+
[search_state.query_param, response.documents.flat_map { |doc| doc[field] }.uniq]
|
85
87
|
end
|
86
88
|
|
87
89
|
private
|
88
90
|
|
89
|
-
attr_reader :search_builder_class, :user_params
|
91
|
+
attr_reader :search_builder_class, :user_params, :search_state
|
90
92
|
|
91
93
|
delegate :repository, to: :blacklight_config
|
92
94
|
|
@@ -135,7 +137,7 @@ module Blacklight
|
|
135
137
|
extra_controller_params ||= {}
|
136
138
|
|
137
139
|
query = search_builder
|
138
|
-
.with(
|
140
|
+
.with(search_state)
|
139
141
|
.where(blacklight_config.document_model.unique_key => ids)
|
140
142
|
.merge(blacklight_config.fetch_many_document_params)
|
141
143
|
.merge(extra_controller_params)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% if render_show_doc_actions_method_from_blacklight? %>
|
2
|
-
<%= render(Blacklight::Document::ActionsComponent.new(document: nil, tag: 'ul', classes: "#{controller_name}Tools nav nav-pills", wrapping_tag: 'li', wrapping_classes: 'nav-item', actions: document_actions(document_list), options: { document_list: @response.documents }, url_opts: Blacklight::Parameters.sanitize(params.to_unsafe_h))) %>
|
2
|
+
<%= render(Blacklight::Document::ActionsComponent.new(document: nil, tag: 'ul', classes: "#{controller_name}Tools nav nav-pills", wrapping_tag: 'li', wrapping_classes: 'nav-item', actions: document_actions(document_list, options: { document: nil }), options: { document_list: @response.documents }, url_opts: Blacklight::Parameters.sanitize(params.to_unsafe_h))) %>
|
3
3
|
<% else %>
|
4
4
|
<% Deprecation.warn(self, '#render_show_doc_actions is deprecated; use ActionComponents instead') %>
|
5
5
|
<ul class="<%= controller_name %>Tools nav nav-pills">
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= render(Blacklight::SearchBarComponent.new(
|
2
2
|
url: search_action_url,
|
3
3
|
params: search_state.params_for_search.except(:qt),
|
4
|
-
search_fields: search_fields,
|
4
|
+
search_fields: Deprecation.silence(Blacklight::ConfigurationHelperBehavior) { search_fields },
|
5
5
|
presenter: presenter,
|
6
6
|
autocomplete_path: search_action_path(action: :suggest))) %>
|
@@ -51,7 +51,9 @@ json.included do
|
|
51
51
|
json.links do
|
52
52
|
Deprecation.silence(Blacklight::FacetsHelperBehavior) do
|
53
53
|
if facet_in_params?(facet.name, item.value)
|
54
|
-
|
54
|
+
Deprecation.silence(Blacklight::SearchState) do
|
55
|
+
json.remove search_action_path(search_state.remove_facet_params(facet.name, item.value))
|
56
|
+
end
|
55
57
|
else
|
56
58
|
json.self path_for_facet(facet.name, item.value, only_path: false)
|
57
59
|
end
|
data/blacklight.gemspec
CHANGED
@@ -23,22 +23,23 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
s.require_paths = ["lib"]
|
25
25
|
|
26
|
-
s.required_ruby_version = '
|
26
|
+
s.required_ruby_version = '>= 2.3'
|
27
27
|
|
28
28
|
s.add_dependency "rails", '>= 5.1', '< 7'
|
29
29
|
s.add_dependency "globalid"
|
30
30
|
s.add_dependency "jbuilder", '~> 2.7'
|
31
31
|
s.add_dependency "kaminari", ">= 0.15" # the pagination (page 1,2,3, etc..) of our search results
|
32
32
|
s.add_dependency "deprecation"
|
33
|
-
s.add_dependency "
|
33
|
+
s.add_dependency "i18n", '>= 1.7.0' # added named parameters
|
34
|
+
s.add_dependency "ostruct", '>= 0.3.2'
|
35
|
+
s.add_dependency "view_component", '>= 2.23.0'
|
34
36
|
|
35
37
|
s.add_development_dependency "rsolr", ">= 1.0.6", "< 3" # Library for interacting with rSolr.
|
36
38
|
s.add_development_dependency "rspec-rails", "~> 4.0.0.beta2"
|
37
39
|
s.add_development_dependency "rspec-its"
|
38
40
|
s.add_development_dependency "rspec-collection_matchers", ">= 1.0"
|
39
41
|
s.add_development_dependency "capybara", '~> 3'
|
40
|
-
s.add_development_dependency '
|
41
|
-
s.add_development_dependency "selenium-webdriver", '>= 3.13.1'
|
42
|
+
s.add_development_dependency 'apparition'
|
42
43
|
s.add_development_dependency 'engine_cart', '~> 2.1'
|
43
44
|
s.add_development_dependency "equivalent-xml"
|
44
45
|
s.add_development_dependency "simplecov"
|