blacklight 6.3.3 → 6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe529651eb30f40e0df003554a192dbc40d0ab30
4
- data.tar.gz: d154c23eab23af0c127054df1e9ba245230ff620
3
+ metadata.gz: 08a32b124f67c2eee4651aa298a0c04c6cc1b0a3
4
+ data.tar.gz: 99eb3c4e5a513755c0b44572d3f59e43ad46ae84
5
5
  SHA512:
6
- metadata.gz: fad74eb425ca3df818b78d6b3e2f483b9b9b5250e549d487a1b467c4e4028649a844c10aee6487ac9b470754ce522a4444a7ddd3bf2a9c7aad86672831604363
7
- data.tar.gz: 05301c63ff664355cd63125188c9d6e5aa1a0e22dbc2b1d63a4300825f5b71d696dd22a9bb0b768500285cbb75c2d88732afd316e048c03005914feb003d22d5
6
+ metadata.gz: 36debbcf121bb69692fd23a4f3183fa11a463cf33d754e2dd25589ef3fed03b2d89ef8c12a695bbc6666f42ecb67b2d6cc00600fbec0eeb1e2d2bd12970c993c
7
+ data.tar.gz: 4efcffee2bac9324aa344f2671a987e5628f1be7444c3517c4f8b63ea6917a7b8fee38dc796d616fb5a637dfca961382d89e6e0bca6512c49733f60a7c891874
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.3.3
1
+ 6.4.0
@@ -2,12 +2,12 @@
2
2
  float: left;
3
3
  width: 100%;
4
4
  z-index: 10000;
5
-
6
- .tt-input.form-control {
5
+
6
+ input.tt-input.form-control {
7
7
  width: 100%;
8
8
  }
9
-
10
- .tt-hint.form-control {
9
+
10
+ input.tt-hint.form-control {
11
11
  width: 100%;
12
12
  }
13
13
 
@@ -19,21 +19,28 @@ module Blacklight
19
19
  end
20
20
 
21
21
  def facet_field_names
22
- blacklight_config.facet_fields.keys
22
+ blacklight_config.facet_fields.values.map(&:field)
23
23
  end
24
24
 
25
+ # @param [String] field Solr facet name
26
+ # @return [Blacklight::Configuration::FacetField] Blacklight facet configuration for the solr field
25
27
  def facet_configuration_for_field(field)
26
- blacklight_config.facet_fields[field] ||
27
- blacklight_config.facet_fields.values.find { |v| v.field.to_s == field.to_s } ||
28
+ # short-circuit on the common case, where the solr field name and the blacklight field name are the same.
29
+ return blacklight_config.facet_fields[field] if blacklight_config.facet_fields[field] && blacklight_config.facet_fields[field].field == field
30
+
31
+ # Find the facet field configuration for the solr field, or provide a default.
32
+ blacklight_config.facet_fields.values.find { |v| v.field.to_s == field.to_s } ||
28
33
  Blacklight::Configuration::FacetField.new(field: field).normalize!
29
34
  end
30
35
 
31
36
  # Get a FacetField object from the @response
32
37
  def facet_by_field_name(field_or_field_name)
33
38
  case field_or_field_name
34
- when String, Symbol, Blacklight::Configuration::FacetField
39
+ when String, Symbol
35
40
  facet_field = facet_configuration_for_field(field_or_field_name)
36
- @response.aggregations[facet_field.key]
41
+ @response.aggregations[facet_field.field]
42
+ when Blacklight::Configuration::FacetField
43
+ @response.aggregations[field_or_field_name.field]
37
44
  else
38
45
  # is this really a useful case?
39
46
  field_or_field_name
@@ -23,12 +23,6 @@
23
23
  <%= javascript_include_tag "application" %>
24
24
  <%= csrf_meta_tags %>
25
25
  <%= content_for(:head) %>
26
-
27
- <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
28
- <!--[if lt IE 9]>
29
- <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
30
- <![endif]-->
31
-
32
26
  </head>
33
27
  <body class="<%= render_body_class %>">
34
28
  <%= render :partial => 'shared/header_navbar' %>
@@ -10,6 +10,8 @@ module Blacklight
10
10
  self.if = true if self.if.nil?
11
11
  self.unless = false if self.unless.nil?
12
12
 
13
+ self.field &&= self.field.to_s
14
+
13
15
  self
14
16
  end
15
17
 
@@ -104,13 +104,13 @@ describe FacetsHelper do
104
104
 
105
105
  describe "facet_by_field_name" do
106
106
  it "retrieves the facet from the response given a string" do
107
- facet_config = double(:query => nil, field: 'a', key: 'a')
107
+ facet_config = double(query: nil, field: 'b', key: 'a')
108
108
  facet_field = double()
109
- allow(helper).to receive(:facet_configuration_for_field).with(anything()).and_return(facet_config)
109
+ allow(helper).to receive(:facet_configuration_for_field).with('b').and_return(facet_config)
110
110
  @response = double()
111
- allow(@response).to receive(:aggregations).and_return('a' => facet_field)
111
+ allow(@response).to receive(:aggregations).and_return('b' => facet_field)
112
112
 
113
- expect(helper.facet_by_field_name('a')).to eq facet_field
113
+ expect(helper.facet_by_field_name('b')).to eq facet_field
114
114
  end
115
115
  end
116
116
 
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: 6.3.3
4
+ version: 6.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: 2016-07-26 00:00:00.000000000 Z
20
+ date: 2016-07-28 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails
@@ -688,7 +688,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
688
688
  version: '0'
689
689
  requirements: []
690
690
  rubyforge_project:
691
- rubygems_version: 2.4.5.1
691
+ rubygems_version: 2.6.4
692
692
  signing_key:
693
693
  specification_version: 4
694
694
  summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)