blacklight 7.4.0 → 7.4.1

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
  SHA256:
3
- metadata.gz: 05d5576219e73622cf05af970590c5492d1e7f18a2b1a3654fb26de71d424b64
4
- data.tar.gz: 94a2e2b0b64d07b4fe0083df1e7658130c6d9dfba7c3acae4ee5b930a1ceb74c
3
+ metadata.gz: e85413f5ec17400714a059ee6085c1dd7df348697cecf371d4d1aef37d1025c6
4
+ data.tar.gz: 05ac84ca08a7ba17f6eec011e06df185523c96d0562b255c0b5cdfc777e3e2bb
5
5
  SHA512:
6
- metadata.gz: 9d8fbf65bfad8b2d4dfac62bb3048dfdebca06f4752b6b66bfbfce218afa1b5deef6b7865896056760c1f7265e7d5968ffa3d52511ce49d54004a118191261b9
7
- data.tar.gz: f1921d4f36915aa5761788ae8a80ddb1836777c2a6db8613d01987930af30ac8d2a273ccea62ecdbcb502c3716747a4ea551a64cc02b3cda7e1ade71067ddbb2
6
+ metadata.gz: e510c3ca5b812ea54cfabeb5f601ff90a016b13a9cdf7c9c762875d2f68807aa1dbb98adcbf6b0c3bccb42bc12b724480e447f12ea2921730ac4ef27b40e9215
7
+ data.tar.gz: 18bf32778bae7470b066341bd99fb170e50048cee6c54ed319fbf9c113adcc922a72ae65492bae2d4cfeaec24b4ede3aa5a37345c7ba655765505b224b3ed6fc
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.4.0
1
+ 7.4.1
@@ -441,7 +441,7 @@ Blacklight.doSearchContextBehavior = function () {
441
441
  const nodes = Array.prototype.slice.call(elements);
442
442
  nodes.forEach(function (element) {
443
443
  element.addEventListener('click', function (e) {
444
- Blacklight.handleSearchContextMethod.call(e.target, e);
444
+ Blacklight.handleSearchContextMethod.call(e.currentTarget, e);
445
445
  });
446
446
  });
447
447
  }; // this is the Rails.handleMethod with a couple adjustments, described inline:
@@ -9,7 +9,7 @@
9
9
  }
10
10
  }
11
11
 
12
- .navbar-brand { /* The main logo image for the Blacklight instance */
12
+ .navbar-logo { /* The main logo image for the Blacklight instance */
13
13
  @if $logo-image {
14
14
  background: transparent $logo-image no-repeat top left;
15
15
  }
@@ -10,7 +10,7 @@ Blacklight.doSearchContextBehavior = function() {
10
10
 
11
11
  nodes.forEach(function(element) {
12
12
  element.addEventListener('click', function(e) {
13
- Blacklight.handleSearchContextMethod.call(e.target, e)
13
+ Blacklight.handleSearchContextMethod.call(e.currentTarget, e)
14
14
  })
15
15
  })
16
16
  };
@@ -1,7 +1,7 @@
1
1
  <div class="card facet-limit blacklight-<%= facet_field.key.parameterize %> <%= 'facet-limit-active' if facet_field_in_params?(facet_field.key) %>">
2
2
  <h3 class="card-header p-0 facet-field-heading" id="<%= facet_field_id(facet_field) %>-header">
3
3
  <button
4
- class="btn btn-block p-2 text-left collapse-toggle"
4
+ class="btn btn-block p-2 text-left collapse-toggle <%= "collapsed" if should_collapse_facet?(facet_field) %>"
5
5
  data-toggle="collapse"
6
6
  data-target="#<%= facet_field_id(facet_field) %>"
7
7
  aria-expanded="<%= should_collapse_facet?(facet_field) ? 'false' : 'true' %>"
@@ -10,7 +10,7 @@
10
10
  </button>
11
11
  </h3>
12
12
  <div id="<%= facet_field_id(facet_field) %>" aria-labelledby="<%= facet_field_id(facet_field) %>-header" class="panel-collapse facet-content collapse <%= "show" unless should_collapse_facet?(facet_field) %>">
13
- <div class="card-body">
13
+ <div class="card-body">
14
14
  <%= yield %>
15
15
  </div>
16
16
  </div>
@@ -1,6 +1,6 @@
1
1
  <nav class="navbar navbar-expand-md navbar-dark bg-dark topbar" role="navigation">
2
2
  <div class="<%= container_classes %>">
3
- <%= link_to application_name, root_path, class: 'mb-0 navbar-brand' %>
3
+ <%= link_to application_name, root_path, class: 'mb-0 navbar-brand navbar-logo' %>
4
4
  <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#user-util-collapse" aria-controls="user-util-collapse" aria-expanded="false" aria-label="Toggle navigation">
5
5
  <span class="navbar-toggler-icon"></span>
6
6
  </button>
@@ -357,29 +357,41 @@ module Blacklight
357
357
  ##
358
358
  # Return a list of fields for the index display that should be used for the
359
359
  # provided document. This respects any configuration made using for_display_type
360
- def index_fields_for(document_or_display_type)
361
- display_type = if document_or_display_type.is_a? Blacklight::Document
362
- Deprecation.warn self, "Calling index_fields_for with a #{document_or_display_type.class} is deprecated and will be removed in Blacklight 8. Pass the display type instead."
363
- document_or_display_type.first(index.display_type_field)
364
- else
365
- document_or_display_type
366
- end
360
+ def index_fields_for(document_or_display_types)
361
+ display_types = if document_or_display_types.is_a? Blacklight::Document
362
+ Deprecation.warn self, "Calling index_fields_for with a #{document_or_display_types.class} is deprecated and will be removed in Blacklight 8. Pass the display type instead."
363
+ document_or_display_types[index.display_type_field]
364
+ else
365
+ document_or_display_types
366
+ end
367
+
368
+ fields = {}.with_indifferent_access
369
+
370
+ Array.wrap(display_types).each do |display_type|
371
+ fields = fields.merge(for_display_type(display_type).index_fields)
372
+ end
367
373
 
368
- for_display_type(display_type).index_fields.merge(index_fields)
374
+ fields.merge(index_fields)
369
375
  end
370
376
 
371
377
  ##
372
378
  # Return a list of fields for the show page that should be used for the
373
379
  # provided document. This respects any configuration made using for_display_type
374
- def show_fields_for(document_or_display_type)
375
- display_type = if document_or_display_type.is_a? Blacklight::Document
376
- Deprecation.warn self, "Calling show_fields_for with a #{document_or_display_type.class} is deprecated and will be removed in Blacklight 8. Pass the display type instead."
377
- document_or_display_type.first(show.display_type_field)
378
- else
379
- document_or_display_type
380
- end
381
-
382
- for_display_type(display_type).show_fields.merge(show_fields)
380
+ def show_fields_for(document_or_display_types)
381
+ display_types = if document_or_display_types.is_a? Blacklight::Document
382
+ Deprecation.warn self, "Calling show_fields_for with a #{document_or_display_types.class} is deprecated and will be removed in Blacklight 8. Pass the display type instead."
383
+ document_or_display_types[show.display_type_field]
384
+ else
385
+ document_or_display_types
386
+ end
387
+
388
+ fields = {}.with_indifferent_access
389
+
390
+ Array.wrap(display_types).each do |display_type|
391
+ fields = fields.merge(for_display_type(display_type).show_fields)
392
+ end
393
+
394
+ fields.merge(show_fields)
383
395
  end
384
396
 
385
397
  private
@@ -115,10 +115,10 @@ RSpec.describe "Blacklight::Configuration", api: true do
115
115
  end
116
116
  config.add_index_field :title
117
117
 
118
- expect(config.index_fields_for('Image')).to have_key 'dimensions'
119
- expect(config.index_fields_for('Image')).to have_key 'title'
120
- expect(config.index_fields_for('Sound')).not_to have_key 'dimensions'
121
- expect(config.index_fields_for('Image')).to have_key 'title'
118
+ expect(config.index_fields_for(['Image'])).to have_key 'dimensions'
119
+ expect(config.index_fields_for(['Image'])).to have_key 'title'
120
+ expect(config.index_fields_for(['Sound'])).not_to have_key 'dimensions'
121
+ expect(config.index_fields_for(['Image'])).to have_key 'title'
122
122
  expect(config.index_fields).not_to have_key 'dimensions'
123
123
  end
124
124
 
@@ -128,10 +128,10 @@ RSpec.describe "Blacklight::Configuration", api: true do
128
128
  end
129
129
  config.add_show_field :title
130
130
 
131
- expect(config.show_fields_for('Image')).to have_key 'dimensions'
132
- expect(config.show_fields_for('Image')).to have_key 'title'
133
- expect(config.show_fields_for('Sound')).not_to have_key 'dimensions'
134
- expect(config.show_fields_for('Image')).to have_key 'title'
131
+ expect(config.show_fields_for(['Image'])).to have_key 'dimensions'
132
+ expect(config.show_fields_for(['Image'])).to have_key 'title'
133
+ expect(config.show_fields_for(['Sound'])).not_to have_key 'dimensions'
134
+ expect(config.show_fields_for(['Image'])).to have_key 'title'
135
135
  expect(config.show_fields).not_to have_key 'dimensions'
136
136
  end
137
137
 
@@ -143,8 +143,8 @@ RSpec.describe "Blacklight::Configuration", api: true do
143
143
  c.add_show_field :photographer
144
144
  end
145
145
 
146
- expect(config.show_fields_for('Image')).to have_key 'dimensions'
147
- expect(config.show_fields_for('Image')).to have_key 'photographer'
146
+ expect(config.show_fields_for(['Image'])).to have_key 'dimensions'
147
+ expect(config.show_fields_for(['Image'])).to have_key 'photographer'
148
148
  end
149
149
  end
150
150
 
@@ -27,7 +27,7 @@ RSpec.describe "catalog/facet_layout" do
27
27
 
28
28
  it "is collapsable" do
29
29
  render partial: 'catalog/facet_layout', locals: { facet_field: facet_field }
30
- expect(rendered).to have_selector 'button[data-toggle="collapse"][aria-expanded="false"]'
30
+ expect(rendered).to have_selector 'button.collapsed[data-toggle="collapse"][aria-expanded="false"]'
31
31
  expect(rendered).to have_selector '.collapse .card-body'
32
32
  end
33
33
 
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.0
4
+ version: 7.4.1
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-08 00:00:00.000000000 Z
20
+ date: 2019-11-15 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails