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 +4 -4
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +1 -1
- data/app/assets/stylesheets/blacklight/_header.scss +1 -1
- data/app/javascript/blacklight/search_context.js +1 -1
- data/app/views/catalog/_facet_layout.html.erb +2 -2
- data/app/views/shared/_header_navbar.html.erb +1 -1
- data/lib/blacklight/configuration.rb +29 -17
- data/spec/models/blacklight/configuration_spec.rb +10 -10
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e85413f5ec17400714a059ee6085c1dd7df348697cecf371d4d1aef37d1025c6
|
4
|
+
data.tar.gz: 05ac84ca08a7ba17f6eec011e06df185523c96d0562b255c0b5cdfc777e3e2bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e510c3ca5b812ea54cfabeb5f601ff90a016b13a9cdf7c9c762875d2f68807aa1dbb98adcbf6b0c3bccb42bc12b724480e447f12ea2921730ac4ef27b40e9215
|
7
|
+
data.tar.gz: 18bf32778bae7470b066341bd99fb170e50048cee6c54ed319fbf9c113adcc922a72ae65492bae2d4cfeaec24b4ede3aa5a37345c7ba655765505b224b3ed6fc
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.4.
|
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.
|
444
|
+
Blacklight.handleSearchContextMethod.call(e.currentTarget, e);
|
445
445
|
});
|
446
446
|
});
|
447
447
|
}; // this is the Rails.handleMethod with a couple adjustments, described inline:
|
@@ -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.
|
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
|
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(
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
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
|
-
|
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(
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
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.
|
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-
|
20
|
+
date: 2019-11-15 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|