blacklight 6.3.3 → 6.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/assets/stylesheets/blacklight/_twitter_typeahead.scss +4 -4
- data/app/controllers/concerns/blacklight/facet.rb +12 -5
- data/app/views/layouts/blacklight.html.erb +0 -6
- data/lib/blacklight/configuration/field.rb +2 -0
- data/spec/helpers/facets_helper_spec.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08a32b124f67c2eee4651aa298a0c04c6cc1b0a3
|
4
|
+
data.tar.gz: 99eb3c4e5a513755c0b44572d3f59e43ad46ae84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36debbcf121bb69692fd23a4f3183fa11a463cf33d754e2dd25589ef3fed03b2d89ef8c12a695bbc6666f42ecb67b2d6cc00600fbec0eeb1e2d2bd12970c993c
|
7
|
+
data.tar.gz: 4efcffee2bac9324aa344f2671a987e5628f1be7444c3517c4f8b63ea6917a7b8fee38dc796d616fb5a637dfca961382d89e6e0bca6512c49733f60a7c891874
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.
|
1
|
+
6.4.0
|
@@ -19,21 +19,28 @@ module Blacklight
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def facet_field_names
|
22
|
-
blacklight_config.facet_fields.
|
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
|
-
|
27
|
-
|
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
|
39
|
+
when String, Symbol
|
35
40
|
facet_field = facet_configuration_for_field(field_or_field_name)
|
36
|
-
@response.aggregations[facet_field.
|
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' %>
|
@@ -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(:
|
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(
|
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('
|
111
|
+
allow(@response).to receive(:aggregations).and_return('b' => facet_field)
|
112
112
|
|
113
|
-
expect(helper.facet_by_field_name('
|
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.
|
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-
|
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
|
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)
|