blacklight 7.23.0.1 → 7.24.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7895d66b40843f8b85bc61e5b82adc59d9a4e3b9dbd4e63eed41446f74c790e
4
- data.tar.gz: 07d6a7302ee044fbb2a3b866e0f04f57f05319fd769800fcd2703ab6427e2988
3
+ metadata.gz: 6488b7d6a423e0f783458e7398cce167abd6638fe4b75765dc02480ef5906394
4
+ data.tar.gz: 1670c1b8631f8c17738216a734e66046459461462d55e0056be52cb19dad8e86
5
5
  SHA512:
6
- metadata.gz: 28fe2e4ac6ef07980d74fb2ec33c4a4e68b0a9412d3824258b8792df893b4b7466bbf6359a997678a0deb055f9aa364531c1ed72a48e12ad809f56dd2162586b
7
- data.tar.gz: 7aea50d06ab5198e186290061bbabbfafe972570d0b2ba05b1f70fc62edf37e92d5e4d8d31297014a9b906ee8654dc7084da9c3e0e84f3d356046b613a05351d
6
+ metadata.gz: 560fc0c64261c3502a1ca897fdb03d8d242ad08d9619bdc528753f0a39f466f5dd147a21a89baf1779fafc6f0aa84f3f7de12ea51df502a480052686bd5b064f
7
+ data.tar.gz: 2eb309a4b911bc60dbaa44e2cb81b1c3703531a15274e8e14b3602081d7856b17b9a321307f5b1778363f63ecf6b7a581eed4f283df68b7467fbf6d7be823095
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.23.0.1
1
+ 7.24.0
@@ -12,6 +12,7 @@
12
12
  cursor: default;
13
13
  text-overflow: ellipsis;
14
14
  overflow: hidden;
15
+ white-space: nowrap;
15
16
 
16
17
  @media (max-width: breakpoint-min(sm)) {
17
18
  max-width: breakpoint-min(sm) * .5;
@@ -22,7 +22,7 @@
22
22
  </div>
23
23
 
24
24
  <%= content_tag :div, id: @panel_id, class: 'facets-collapse collapse' do %>
25
- <% Deprecation.silence(Blacklight::FacetsHelperBehavior) do %>
25
+ <% ::Deprecation.silence(Blacklight::FacetsHelperBehavior) do %>
26
26
  <%= helpers.render_facet_partials @fields, response: @response %>
27
27
  <% end %>
28
28
  <% end %>
@@ -9,11 +9,11 @@ module Blacklight
9
9
  def initialize(response:, html: {}, **pagination_args)
10
10
  @response = response
11
11
  @html_attr = { aria: { label: t('views.pagination.aria.container_label') } }.merge(html)
12
- @pagination_args = { outer_window: 2, theme: 'blacklight' }.merge(pagination_args)
12
+ @pagination_args = pagination_args
13
13
  end
14
14
 
15
15
  def pagination
16
- helpers.paginate @response, **@pagination_args
16
+ helpers.paginate @response, **Blacklight::Engine.config.blacklight.default_pagination_options, **@pagination_args
17
17
  end
18
18
  end
19
19
  end
@@ -52,6 +52,13 @@ module Blacklight
52
52
 
53
53
  bl_global_config.facet_missing_param = '[* TO *]'
54
54
 
55
+ # These options are passed through to the kaminari #paginate helper
56
+ # https://www.rubydoc.info/gems/kaminari/1.2.2#helpers
57
+ bl_global_config.default_pagination_options = {
58
+ theme: 'blacklight',
59
+ outer_window: 2
60
+ }
61
+
55
62
  # Anything that goes into Blacklight::Engine.config is stored as a class
56
63
  # variable on Railtie::Configuration. we're going to encapsulate all the
57
64
  # Blacklight specific stuff in this single struct:
@@ -1,11 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/per_thread_registry'
4
-
5
3
  module Blacklight
6
4
  class RuntimeRegistry
7
- extend ActiveSupport::PerThreadRegistry
8
-
9
- attr_accessor :connection, :connection_config
5
+ thread_mattr_accessor :connection, :connection_config
10
6
  end
11
7
  end
@@ -42,11 +42,8 @@ module Blacklight
42
42
  end
43
43
 
44
44
  # Normalize facet parameters mangled by facebook
45
- if params[:f].is_a?(Hash) && params[:f].values.any? { |x| x.is_a?(Hash) }
46
- params[:f] = params[:f].transform_values do |value|
47
- value.is_a?(Hash) ? value.values : value
48
- end
49
- end
45
+ params[:f] = normalize_facet_params(params[:f]) if facet_params_need_normalization(params[:f])
46
+ params[:f_inclusive] = normalize_facet_params(params[:f_inclusive]) if facet_params_need_normalization(params[:f_inclusive])
50
47
 
51
48
  params
52
49
  end
@@ -251,6 +248,16 @@ module Blacklight
251
248
  params[facet_request_keys[:prefix]]
252
249
  end
253
250
 
251
+ def self.facet_params_need_normalization(facet_params)
252
+ facet_params.is_a?(Hash) && facet_params.values.any? { |x| x.is_a?(Hash) }
253
+ end
254
+
255
+ def self.normalize_facet_params(facet_params)
256
+ facet_params.transform_values do |value|
257
+ value.is_a?(Hash) ? value.values : value
258
+ end
259
+ end
260
+
254
261
  private
255
262
 
256
263
  def search_field_key
@@ -50,10 +50,14 @@ RSpec.describe Blacklight::SearchState do
50
50
  end
51
51
 
52
52
  context 'with facebooks badly mangled query parameters' do
53
- let(:params) { { f: { field: { '0': 'first', '1': 'second' } } } }
53
+ let(:params) do
54
+ { f: { field: { '0': 'first', '1': 'second' } },
55
+ f_inclusive: { field: { '0': 'first', '1': 'second' } } }
56
+ end
54
57
 
55
58
  it 'normalizes the facets to the expected format' do
56
59
  expect(search_state.to_h).to include f: { field: %w[first second] }
60
+ expect(search_state.to_h).to include f_inclusive: { field: %w[first second] }
57
61
  end
58
62
  end
59
63
 
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.23.0.1
4
+ version: 7.24.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: 2022-02-28 00:00:00.000000000 Z
20
+ date: 2022-03-14 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails