blacklight 7.4.1 → 7.4.2

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: e85413f5ec17400714a059ee6085c1dd7df348697cecf371d4d1aef37d1025c6
4
- data.tar.gz: 05ac84ca08a7ba17f6eec011e06df185523c96d0562b255c0b5cdfc777e3e2bb
3
+ metadata.gz: e934144a8f41701622a5173bbafbc5ed5e362035ab2b8e1385a44b62e1e9fb0e
4
+ data.tar.gz: 7f70a70e1cd8912173c85a4e6f75e5dc0616735a80ddaa1a92b3f8c8718bdca4
5
5
  SHA512:
6
- metadata.gz: e510c3ca5b812ea54cfabeb5f601ff90a016b13a9cdf7c9c762875d2f68807aa1dbb98adcbf6b0c3bccb42bc12b724480e447f12ea2921730ac4ef27b40e9215
7
- data.tar.gz: 18bf32778bae7470b066341bd99fb170e50048cee6c54ed319fbf9c113adcc922a72ae65492bae2d4cfeaec24b4ede3aa5a37345c7ba655765505b224b3ed6fc
6
+ metadata.gz: 60909c87a1875508abe174257d0d80448113d2e62a1dc66b65a382f8acf8f539b91e70439b9bb3f1ecd7d30c9ccc6136f2ea586711866eabd0d453244d4db6c3
7
+ data.tar.gz: c042494903310dfb577677e7b98aa82a4551c877beb2b1082dd6d356057f50e0539291e943118667b6f33b912f9600bd5841f8132e9dc19e32b7ffac7fa5957c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.4.1
1
+ 7.4.2
@@ -47,7 +47,7 @@ module Blacklight
47
47
  display_type = fields.lazy.map { |field| retrieve_values(field_config(field)) }.detect(&:any?)
48
48
  display_type ||= Array(default) if default
49
49
 
50
- display_type
50
+ display_type || []
51
51
  end
52
52
 
53
53
  ##
@@ -4,7 +4,7 @@
4
4
 
5
5
  <% unless paginator.last_page? || params[:action] == "facet" %>
6
6
  <li class="more_facets">
7
- <%= link_to t("more_#{field_name}_html", scope: 'blacklight.search.facets', default: :more_html, field_name: facet_field.label),
7
+ <%= link_to t("more_#{field_name}_html", scope: 'blacklight.search.facets', default: :more_html, field_name: facet_field_label(facet_field.key)),
8
8
  search_facet_path(id: facet_field.key),
9
9
  data: { blacklight_modal: 'trigger' } %>
10
10
  </li>
@@ -5,6 +5,6 @@ json.set!(field_name) do
5
5
  json.type 'document_value'
6
6
  json.attributes do
7
7
  json.value doc_presenter.field_value(field)
8
- json.label field.label
8
+ json.label field.display_label(view_type)
9
9
  end
10
10
  end
@@ -6,7 +6,7 @@
6
6
  </button>
7
7
  <div class="dropdown-menu dropdown-menu-right" role="menu">
8
8
  <%- per_page_options_for_select.each do |(label, count)| %>
9
- <%= link_to(label, url_for(search_state.params_for_search(per_page: count)), class: 'dropdown-item') %>
9
+ <%= link_to(label, url_for(search_state.params_for_search(per_page: count)), class: 'dropdown-item', role: 'menuitem') %>
10
10
  <%- end -%>
11
11
  </div>
12
12
  </div>
@@ -6,7 +6,7 @@
6
6
 
7
7
  <div class="dropdown-menu" role="menu">
8
8
  <%- active_sort_fields.each do |sort_key, field_config| %>
9
- <%= link_to(sort_field_label(sort_key), url_for(search_state.params_for_search(sort: sort_key)), class: 'dropdown-item') %>
9
+ <%= link_to(sort_field_label(sort_key), url_for(search_state.params_for_search(sort: sort_key)), class: 'dropdown-item', role: 'menuitem') %>
10
10
  <%- end -%>
11
11
  </div>
12
12
  </div>
@@ -21,7 +21,8 @@ json.data do
21
21
  json.partial! 'field', field: field,
22
22
  field_name: field_name,
23
23
  document_url: document_url,
24
- doc_presenter: doc_presenter
24
+ doc_presenter: doc_presenter,
25
+ view_type: 'index'
25
26
  end
26
27
  end
27
28
 
@@ -15,7 +15,8 @@ json.data do
15
15
  json.partial! 'field', field: field,
16
16
  field_name: field_name,
17
17
  document_url: document_url,
18
- doc_presenter: doc_presenter
18
+ doc_presenter: doc_presenter,
19
+ view_type: 'show'
19
20
  end
20
21
  end
21
22
  end
@@ -1,7 +1,7 @@
1
1
  ar:
2
2
  views:
3
3
  pagination:
4
- first: 'الأولى ;&laquo'
4
+ first: 'الأولى &laquo;'
5
5
  last: 'الأخيرة &raquo;'
6
6
  previous: '&laquo; السابقة'
7
7
  next: 'التالية &raquo;'
@@ -183,4 +183,32 @@ RSpec.describe Blacklight::IndexPresenter, api: true do
183
183
 
184
184
  it { is_expected.to be_instance_of Blacklight::ThumbnailPresenter }
185
185
  end
186
+
187
+ describe '#display_type' do
188
+ context 'with no configuration' do
189
+ it 'returns an empty array' do
190
+ expect(presenter.display_type).to be_empty
191
+ end
192
+ end
193
+
194
+ context 'with a default value' do
195
+ it 'returns the default' do
196
+ expect(presenter.display_type(default: 'default')).to eq ['default']
197
+ end
198
+ end
199
+
200
+ context 'with field configuration' do
201
+ let(:document) do
202
+ SolrDocument.new(id: 1, xyz: 'abc')
203
+ end
204
+
205
+ before do
206
+ config.index.display_type_field = :xyz
207
+ end
208
+
209
+ it 'returns the value from the field' do
210
+ expect(presenter.display_type).to eq ['abc']
211
+ end
212
+ end
213
+ end
186
214
  end
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.4.1
4
+ version: 7.4.2
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: 2019-11-15 00:00:00.000000000 Z
20
+ date: 2019-12-10 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails