blacklight 7.28.0 → 7.29.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: d7e57b2c0a5ca770fa8fbc0560072609b5db93d10c952d33af0db3d69ae2dfc6
4
- data.tar.gz: 231146a7df38ba031b116075b75bf9abe7f91e760485524fb8678a624d9be893
3
+ metadata.gz: 752a397403b186b177e51a6f260f7f385d9e1db6c26abdb9b37c9c25ecf2ad04
4
+ data.tar.gz: f81dc90a28f7c9d9cecc35f60e119bd09ec96bd12584b8f1ffb39e51845a0588
5
5
  SHA512:
6
- metadata.gz: 95bc567df4947b3a11b37749c0c9a123da3c5a20552e78195a77775638bc5075d1db2c6d11d8158864346a1346a29a296a3ce8a873b497a9946eb011cd53843f
7
- data.tar.gz: 28efc83fd658e1e43a3f85c8bea5ec389ee913b540b413ce967925b98b48a5d4d9422a2df1fcbf14d905ba0e31cba3fe9267a3cee38e6371adaf83b963183f41
6
+ metadata.gz: 54c453918cd5521dd2ee24df0d7d874c48705d14422f8746a10bd262681e411ed54efef1202f9785beec20169ca5ca9acd4d648e730df8a930d2aa659190d905
7
+ data.tar.gz: 8014988552c75ebb9bbbd82dcad688dfcd3ea2b6126b63c4c178ab32fe034787bdd61b75a826ecdb1c9022e148a7f9911eb99e7c35090de9361d434756fb85a1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.28.0
1
+ 7.29.0
@@ -1,5 +1,5 @@
1
1
  .group-key {
2
- border-bottom: 1px solid darken($table-border-color, 60%);
2
+ border-bottom: 1px solid darken($border-color, 60%);
3
3
  clear: right;
4
4
  }
5
5
 
@@ -11,4 +11,4 @@
11
11
 
12
12
  .more-in-group {
13
13
  float: right;
14
- }
14
+ }
@@ -11,8 +11,8 @@ module Blacklight
11
11
  # @param [Blacklight::Solr::Response::Facets::FacetField] display_facet
12
12
  # @param [Blacklight::Configuration] blacklight_config
13
13
  # @param [Boolean] layout
14
- # rubocop:disable Metrics/CyclomaticComplexity
15
- def initialize(display_facet_or_field_config: nil, display_facet: nil, field_config: nil, response: nil, blacklight_config: nil, **component_args)
14
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/ParameterLists
15
+ def initialize(display_facet_or_field_config: nil, display_facet: nil, field_config: nil, response: nil, blacklight_config: nil, component: nil, **component_args)
16
16
  if display_facet_or_field_config.is_a? Blacklight::FacetFieldPresenter
17
17
  @facet_field_presenter = display_facet_or_field_config
18
18
  @field_config = @facet_field_presenter.facet_field
@@ -30,9 +30,10 @@ module Blacklight
30
30
  raise ArgumentError, 'You must provide one of display_facet or field_config' unless @field_config
31
31
  end
32
32
 
33
+ @component = component || (@field_config.component == true ? Blacklight::FacetFieldListComponent : @field_config.component)
33
34
  @component_args = component_args
34
35
  end
35
- # rubocop:enable Metrics/CyclomaticComplexity
36
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/ParameterLists
36
37
 
37
38
  def render?
38
39
  helpers.should_render_field?(@field_config, @display_facet)
@@ -41,10 +42,8 @@ module Blacklight
41
42
  def call
42
43
  return render_partial if @field_config.partial
43
44
 
44
- component = @field_config.component == true ? Blacklight::FacetFieldListComponent : @field_config.component
45
-
46
45
  render(
47
- component.new(
46
+ @component.new(
48
47
  facet_field: @facet_field_presenter || helpers.facet_field_presenter(@field_config, @display_facet),
49
48
  **@component_args
50
49
  )
@@ -67,14 +67,16 @@ json.included do
67
67
  end
68
68
  end
69
69
 
70
- json.array! search_fields do |(label, key)|
71
- json.type 'search_field'
72
- json.id key
73
- json.attributes do
74
- json.label label
75
- end
76
- json.links do
77
- json.self url_for(search_state.to_h.merge(search_field: key, only_path: false))
70
+ Deprecation.silence(Blacklight::ConfigurationHelperBehavior) do
71
+ json.array! search_fields do |(label, key)|
72
+ json.type 'search_field'
73
+ json.id key
74
+ json.attributes do
75
+ json.label label
76
+ end
77
+ json.links do
78
+ json.self url_for(search_state.to_h.merge(search_field: key, only_path: false))
79
+ end
78
80
  end
79
81
  end
80
82
 
@@ -27,7 +27,7 @@ module Blacklight
27
27
  end
28
28
 
29
29
  @blacklight_params = {}
30
- search_state_class = @scope&.search_state_class || Blacklight::SearchState
30
+ search_state_class = @scope.try(:search_state_class) || Blacklight::SearchState
31
31
  @search_state = search_state_class.new(@blacklight_params, @scope&.blacklight_config, @scope)
32
32
  @additional_filters = {}
33
33
  @merged_params = {}
@@ -26,6 +26,25 @@ RSpec.describe Blacklight::FacetComponent, type: :component do
26
26
  expect(rendered).to have_selector 'ul.facet-values'
27
27
  end
28
28
 
29
+ context 'with a provided component' do
30
+ let(:component_kwargs) { { field_config: facet_config, display_facet: display_facet, component: component_class } }
31
+ let(:component_class) do
32
+ Class.new(Blacklight::FacetFieldListComponent) do
33
+ def self.name
34
+ 'CustomFacetComponent'
35
+ end
36
+
37
+ def call
38
+ 'Custom facet rendering'
39
+ end
40
+ end
41
+ end
42
+
43
+ it 'renders the provided component' do
44
+ expect(rendered).to have_content 'Custom facet rendering'
45
+ end
46
+ end
47
+
29
48
  context 'with a facet configured to use a partial' do
30
49
  let(:facet_config) do
31
50
  Blacklight::Configuration::FacetField.new(key: 'field', partial: 'catalog/facet_partial').normalize!
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.28.0
4
+ version: 7.29.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-07-13 00:00:00.000000000 Z
20
+ date: 2022-07-26 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails