blacklight 7.21.0 → 7.22.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/.docker/app/Dockerfile +3 -1
- data/.dockerignore +3 -0
- data/.env +2 -2
- data/.github/workflows/ruby.yml +3 -2
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +21 -4
- data/app/assets/stylesheets/blacklight/_constraints.scss +2 -0
- data/app/components/blacklight/constraints_component.rb +1 -1
- data/app/components/blacklight/facet_field_checkboxes_component.rb +1 -1
- data/app/components/blacklight/facet_item_pivot_component.rb +1 -1
- data/app/helpers/blacklight/facets_helper_behavior.rb +1 -1
- data/app/helpers/blacklight/render_partials_helper_behavior.rb +4 -1
- data/app/javascript/blacklight/core.js +3 -1
- data/app/javascript/blacklight/modal.js +19 -3
- data/app/views/bookmarks/index.html.erb +1 -1
- data/app/views/catalog/_search_results.html.erb +1 -1
- data/docker-compose.yml +5 -2
- data/lib/blacklight/configuration/facet_field.rb +2 -0
- data/lib/blacklight/solr/response/facets.rb +12 -4
- data/package.json +1 -1
- data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +7 -7
- data/spec/models/blacklight/solr/response/facets_spec.rb +6 -0
- data/tasks/blacklight.rake +5 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6db63ed11099851dc7e85c6d2e9e6ec15d39b6a4baec81545625f6362f7eafb7
|
4
|
+
data.tar.gz: 35c166e0e26c7e6cbfaf8775338677e3968d91f3ad07335c2cc08f92a710b5f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d24a44e67f15f30fb674da5102a7ad48401172da23bddaed461f220805429d4816e6912ffe7a069683d4ee2710e478d2e75ab43ff88ddf4caf2f3349ce1a7830
|
7
|
+
data.tar.gz: 25e2ad757ecc09eb6b5c3243b012f963894f6829314a7db86393ea4ec826b4b5deb4aeb79ad55cb1084a5043f9e33f39de3640638ce6e8a16f8377ceeea623a3
|
data/.docker/app/Dockerfile
CHANGED
data/.dockerignore
ADDED
data/.env
CHANGED
data/.github/workflows/ruby.yml
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.
|
1
|
+
7.22.1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
Blacklight = function () {
|
3
|
+
var Blacklight = function () {
|
4
4
|
var buffer = new Array();
|
5
5
|
return {
|
6
6
|
onLoad: function onLoad(func) {
|
@@ -48,6 +48,7 @@ Blacklight.onLoad(function () {
|
|
48
48
|
elem.classList.remove('no-js');
|
49
49
|
elem.classList.add('js');
|
50
50
|
});
|
51
|
+
window.Blacklight = Blacklight;
|
51
52
|
/*global Bloodhound */
|
52
53
|
|
53
54
|
Blacklight.onLoad(function () {
|
@@ -365,7 +366,7 @@ Blacklight.modal.onFailure = function (jqXHR, textStatus, errorThrown) {
|
|
365
366
|
console.error('Server error:', this.url, jqXHR.status, errorThrown);
|
366
367
|
var contents = '<div class="modal-header">' + '<div class="modal-title">There was a problem with your request.</div>' + '<button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" aria-label="Close">' + ' <span aria-hidden="true">×</span>' + '</button></div>' + ' <div class="modal-body"><p>Expected a successful response from the server, but got an error</p>' + '<pre>' + this.type + ' ' + this.url + "\n" + jqXHR.status + ': ' + errorThrown + '</pre></div>';
|
367
368
|
$(Blacklight.modal.modalSelector).find('.modal-content').html(contents);
|
368
|
-
|
369
|
+
Blacklight.modal.show();
|
369
370
|
};
|
370
371
|
|
371
372
|
Blacklight.modal.receiveAjax = function (contents) {
|
@@ -384,7 +385,7 @@ Blacklight.modal.receiveAjax = function (contents) {
|
|
384
385
|
$(Blacklight.modal.modalSelector).trigger(e); // if they did preventDefault, don't show the dialog
|
385
386
|
|
386
387
|
if (e.isDefaultPrevented()) return;
|
387
|
-
|
388
|
+
Blacklight.modal.show();
|
388
389
|
};
|
389
390
|
|
390
391
|
Blacklight.modal.modalAjaxLinkClick = function (e) {
|
@@ -431,7 +432,7 @@ Blacklight.modal.setupModal = function () {
|
|
431
432
|
Blacklight.modal.checkCloseModal = function (event) {
|
432
433
|
if ($(event.target).find(Blacklight.modal.modalCloseSelector).length) {
|
433
434
|
var modalFlashes = $(this).find('.flash_messages');
|
434
|
-
|
435
|
+
Blacklight.modal.hide(event.target);
|
435
436
|
event.preventDefault();
|
436
437
|
var mainFlashes = $('#main-flashes');
|
437
438
|
mainFlashes.append(modalFlashes);
|
@@ -439,6 +440,22 @@ Blacklight.modal.checkCloseModal = function (event) {
|
|
439
440
|
}
|
440
441
|
};
|
441
442
|
|
443
|
+
Blacklight.modal.hide = function (el) {
|
444
|
+
if (bootstrap.Modal.VERSION >= "5") {
|
445
|
+
bootstrap.Modal.getOrCreateInstance(el || document.querySelector(Blacklight.modal.modalSelector)).hide();
|
446
|
+
} else {
|
447
|
+
$(el || Blacklight.modal.modalSelector).modal('hide');
|
448
|
+
}
|
449
|
+
};
|
450
|
+
|
451
|
+
Blacklight.modal.show = function (el) {
|
452
|
+
if (bootstrap.Modal.VERSION >= "5") {
|
453
|
+
bootstrap.Modal.getOrCreateInstance(el || document.querySelector(Blacklight.modal.modalSelector)).show();
|
454
|
+
} else {
|
455
|
+
$(el || Blacklight.modal.modalSelector).modal('show');
|
456
|
+
}
|
457
|
+
};
|
458
|
+
|
442
459
|
Blacklight.onLoad(function () {
|
443
460
|
Blacklight.modal.setupModal();
|
444
461
|
});
|
@@ -86,7 +86,7 @@ module Blacklight
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def facet_item_presenter(facet_config, facet_item, facet_field)
|
89
|
-
Blacklight::FacetItemPresenter.new(facet_item, facet_config, @view_context, facet_field)
|
89
|
+
(facet_config.item_presenter || Blacklight::FacetItemPresenter).new(facet_item, facet_config, @view_context, facet_field)
|
90
90
|
end
|
91
91
|
|
92
92
|
def inclusive_facet_item_presenter(facet_config, facet_item, facet_field)
|
@@ -17,7 +17,7 @@ module Blacklight
|
|
17
17
|
return to_enum(:presenters) unless block_given?
|
18
18
|
|
19
19
|
@facet_field.paginator.items.each do |item|
|
20
|
-
yield Blacklight::FacetItemPresenter.new(item, @facet_field.facet_field, @view_context, @facet_field.key, @facet_field.search_state)
|
20
|
+
yield (@facet_field.facet_field.item_presenter || Blacklight::FacetItemPresenter).new(item, @facet_field.facet_field, @view_context, @facet_field.key, @facet_field.search_state)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -78,7 +78,7 @@ module Blacklight
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def facet_item_presenter(facet_item)
|
81
|
-
Blacklight::FacetItemPresenter.new(facet_item, @facet_item.facet_config, @view_context, @facet_item.facet_field, @facet_item.search_state)
|
81
|
+
(@facet_item.facet_config.item_presenter || Blacklight::FacetItemPresenter).new(facet_item, @facet_item.facet_config, @view_context, @facet_item.facet_field, @facet_item.search_state)
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
@@ -319,7 +319,7 @@ module Blacklight::FacetsHelperBehavior
|
|
319
319
|
end
|
320
320
|
|
321
321
|
def facet_item_presenter(facet_config, facet_item, facet_field)
|
322
|
-
Blacklight::FacetItemPresenter.new(facet_item, facet_config, self, facet_field)
|
322
|
+
(facet_config.item_presenter || Blacklight::FacetItemPresenter).new(facet_item, facet_config, self, facet_field)
|
323
323
|
end
|
324
324
|
|
325
325
|
def facet_item_component(facet_config, facet_item, facet_field, **args)
|
@@ -9,7 +9,10 @@ module Blacklight::RenderPartialsHelperBehavior
|
|
9
9
|
# @param [Hash] locals to pass to the render call
|
10
10
|
# @return [String]
|
11
11
|
def render_document_index documents = nil, locals = {}
|
12
|
-
|
12
|
+
unless documents
|
13
|
+
Deprecation.warn(self, "Calling render_document_index without documents is deprecated and will be removed in version 8")
|
14
|
+
documents = @response.documents
|
15
|
+
end
|
13
16
|
render_document_index_with_view(document_index_view_type, documents, locals)
|
14
17
|
end
|
15
18
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
Blacklight = function() {
|
1
|
+
const Blacklight = function() {
|
2
2
|
var buffer = new Array;
|
3
3
|
return {
|
4
4
|
onLoad: function(func) {
|
@@ -50,3 +50,5 @@ Blacklight.onLoad(function () {
|
|
50
50
|
elem.classList.remove('no-js')
|
51
51
|
elem.classList.add('js')
|
52
52
|
})
|
53
|
+
|
54
|
+
window.Blacklight = Blacklight
|
@@ -114,7 +114,7 @@ Blacklight.modal.onFailure = function(jqXHR, textStatus, errorThrown) {
|
|
114
114
|
this.type + ' ' + this.url + "\n" + jqXHR.status + ': ' + errorThrown +
|
115
115
|
'</pre></div>';
|
116
116
|
$(Blacklight.modal.modalSelector).find('.modal-content').html(contents);
|
117
|
-
|
117
|
+
Blacklight.modal.show();
|
118
118
|
}
|
119
119
|
|
120
120
|
Blacklight.modal.receiveAjax = function (contents) {
|
@@ -135,7 +135,7 @@ Blacklight.modal.receiveAjax = function (contents) {
|
|
135
135
|
// if they did preventDefault, don't show the dialog
|
136
136
|
if (e.isDefaultPrevented()) return;
|
137
137
|
|
138
|
-
|
138
|
+
Blacklight.modal.show();
|
139
139
|
};
|
140
140
|
|
141
141
|
|
@@ -196,7 +196,7 @@ Blacklight.modal.checkCloseModal = function(event) {
|
|
196
196
|
if ($(event.target).find(Blacklight.modal.modalCloseSelector).length) {
|
197
197
|
var modalFlashes = $(this).find('.flash_messages');
|
198
198
|
|
199
|
-
|
199
|
+
Blacklight.modal.hide(event.target);
|
200
200
|
event.preventDefault();
|
201
201
|
|
202
202
|
var mainFlashes = $('#main-flashes');
|
@@ -205,6 +205,22 @@ Blacklight.modal.checkCloseModal = function(event) {
|
|
205
205
|
}
|
206
206
|
}
|
207
207
|
|
208
|
+
Blacklight.modal.hide = function(el) {
|
209
|
+
if (bootstrap.Modal.VERSION >= "5") {
|
210
|
+
bootstrap.Modal.getOrCreateInstance(el || document.querySelector(Blacklight.modal.modalSelector)).hide();
|
211
|
+
} else {
|
212
|
+
$(el || Blacklight.modal.modalSelector).modal('hide');
|
213
|
+
}
|
214
|
+
}
|
215
|
+
|
216
|
+
Blacklight.modal.show = function(el) {
|
217
|
+
if (bootstrap.Modal.VERSION >= "5") {
|
218
|
+
bootstrap.Modal.getOrCreateInstance(el || document.querySelector(Blacklight.modal.modalSelector)).show();
|
219
|
+
} else {
|
220
|
+
$(el || Blacklight.modal.modalSelector).modal('show');
|
221
|
+
}
|
222
|
+
}
|
223
|
+
|
208
224
|
Blacklight.onLoad(function() {
|
209
225
|
Blacklight.modal.setupModal();
|
210
226
|
});
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<%= render 'sort_and_per_page' %>
|
15
15
|
<%= render partial: 'tools', locals: { document_list: @response.documents } %>
|
16
16
|
<h2 class='section-heading sr-only visually-hidden'><%= t('blacklight.bookmarks.list_title') %></h2>
|
17
|
-
<%= render_document_index %>
|
17
|
+
<%= render_document_index @response.documents %>
|
18
18
|
<%= render 'results_pagination' %>
|
19
19
|
<% end %>
|
20
20
|
</div>
|
@@ -26,7 +26,7 @@
|
|
26
26
|
<%- elsif render_grouped_response? %>
|
27
27
|
<%= Deprecation.silence(Blacklight::RenderPartialsHelperBehavior) { render_grouped_document_index } %>
|
28
28
|
<%- else %>
|
29
|
-
<%= render_document_index %>
|
29
|
+
<%= render_document_index @response.documents %>
|
30
30
|
<%- end %>
|
31
31
|
|
32
32
|
<%= render 'results_pagination' %>
|
data/docker-compose.yml
CHANGED
@@ -7,8 +7,9 @@ services:
|
|
7
7
|
dockerfile: .docker/app/Dockerfile
|
8
8
|
args:
|
9
9
|
- ALPINE_RUBY_VERSION
|
10
|
-
|
11
|
-
|
10
|
+
# mounting . is causing seg-fault on macosx
|
11
|
+
#volumes:
|
12
|
+
#- .:/app
|
12
13
|
depends_on:
|
13
14
|
- solr
|
14
15
|
ports:
|
@@ -16,6 +17,8 @@ services:
|
|
16
17
|
environment:
|
17
18
|
- SOLR_URL # Set via environment variable or use default defined in .env file
|
18
19
|
- RAILS_VERSION # Set via environment variable or use default defined in .env file
|
20
|
+
- SOLR_ENV=docker-compose
|
21
|
+
- ENGINE_CART_RAILS_OPTIONS=--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test --skip-solr
|
19
22
|
|
20
23
|
solr:
|
21
24
|
environment:
|
@@ -58,6 +58,8 @@ module Blacklight
|
|
58
58
|
# Rendering:
|
59
59
|
# @!attribute presenter
|
60
60
|
# @return [Blacklight::FacetFieldPresenter]
|
61
|
+
# @!attribute item_presenter
|
62
|
+
# @return [Blacklight::FacetItemPresenter]
|
61
63
|
# @!attribute component
|
62
64
|
# @return [Blacklight::FacetFieldListComponent]
|
63
65
|
# @!attribute item_component
|
@@ -61,6 +61,10 @@ module Blacklight::Solr::Response::Facets
|
|
61
61
|
@options[:data] || {}
|
62
62
|
end
|
63
63
|
|
64
|
+
def response
|
65
|
+
@options[:response]
|
66
|
+
end
|
67
|
+
|
64
68
|
def index?
|
65
69
|
sort == 'index'
|
66
70
|
end
|
@@ -180,7 +184,7 @@ module Blacklight::Solr::Response::Facets
|
|
180
184
|
end
|
181
185
|
|
182
186
|
options = facet_field_aggregation_options(facet_field_name)
|
183
|
-
facet_field = FacetField.new(facet_field_name, items, options)
|
187
|
+
facet_field = FacetField.new(facet_field_name, items, options.merge(response: self))
|
184
188
|
|
185
189
|
if values[nil]
|
186
190
|
facet_field.missing = items.find(&:missing)
|
@@ -213,7 +217,9 @@ module Blacklight::Solr::Response::Facets
|
|
213
217
|
|
214
218
|
items = items.sort_by(&:hits).reverse if facet_field.sort && facet_field.sort.to_sym == :count
|
215
219
|
|
216
|
-
|
220
|
+
facet_field = Blacklight::Solr::Response::Facets::FacetField.new field_name, items, response: response
|
221
|
+
|
222
|
+
hash[field_name] = facet_field
|
217
223
|
end
|
218
224
|
end
|
219
225
|
|
@@ -244,7 +250,9 @@ module Blacklight::Solr::Response::Facets
|
|
244
250
|
|
245
251
|
# alias all the possible blacklight config names..
|
246
252
|
blacklight_config.facet_fields.select { |_k, v| v.pivot && v.pivot.join(",") == field_name }.each_key do |key|
|
247
|
-
|
253
|
+
facet_field = Blacklight::Solr::Response::Facets::FacetField.new key, items, response: self
|
254
|
+
|
255
|
+
hash[key] = facet_field
|
248
256
|
end
|
249
257
|
end
|
250
258
|
end
|
@@ -288,7 +296,7 @@ module Blacklight::Solr::Response::Facets
|
|
288
296
|
i
|
289
297
|
end
|
290
298
|
|
291
|
-
options = facet_field_aggregation_options(facet_field_name).merge(data: data)
|
299
|
+
options = facet_field_aggregation_options(facet_field_name).merge(data: data, response: self)
|
292
300
|
facet_field = FacetField.new(facet_field_name, items, options)
|
293
301
|
|
294
302
|
facet_field.missing = Blacklight::Solr::Response::Facets::FacetItem.new(
|
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "blacklight-frontend",
|
3
|
-
"version": "7.
|
3
|
+
"version": "7.22.0",
|
4
4
|
"description": "[](https://travis-ci.com/projectblacklight/blacklight) [](http://badge.fury.io/rb/blacklight) [](https://coveralls.io/github/projectblacklight/blacklight?branch=main)",
|
5
5
|
"main": "app/assets/javascripts/blacklight",
|
6
6
|
"scripts": {
|
@@ -305,7 +305,7 @@ RSpec.describe Blacklight::FacetsHelperBehavior do
|
|
305
305
|
let(:search_state) { double(has_facet?: false, add_facet_params_and_redirect: { controller: 'catalog' }) }
|
306
306
|
|
307
307
|
before do
|
308
|
-
allow(helper).to receive(:facet_configuration_for_field).with('simple_field').and_return(Blacklight::Configuration::FacetField.new(key: 'simple_field', query: nil, date: nil, helper_method: nil, single: false, url_method: nil))
|
308
|
+
allow(helper).to receive(:facet_configuration_for_field).with('simple_field').and_return(Blacklight::Configuration::FacetField.new(key: 'simple_field', query: nil, date: nil, helper_method: nil, single: false, url_method: nil, item_presenter: nil))
|
309
309
|
allow(helper).to receive(:facet_display_value).and_return('Z')
|
310
310
|
allow(helper).to receive(:search_state).and_return(search_state)
|
311
311
|
allow(helper).to receive(:search_action_path) do |*args|
|
@@ -326,7 +326,7 @@ RSpec.describe Blacklight::FacetsHelperBehavior do
|
|
326
326
|
let(:expected_html) { '<span class="facet-label"><a class="facet-select" rel="nofollow" href="/blabla">Z</a></span><span class="facet-count">10</span>' }
|
327
327
|
|
328
328
|
it "uses that method" do
|
329
|
-
allow(helper).to receive(:facet_configuration_for_field).with('simple_field').and_return(Blacklight::Configuration::FacetField.new(key: 'simple_field', query: nil, date: nil, helper_method: nil, single: false, url_method: :test_method))
|
329
|
+
allow(helper).to receive(:facet_configuration_for_field).with('simple_field').and_return(Blacklight::Configuration::FacetField.new(key: 'simple_field', query: nil, date: nil, helper_method: nil, single: false, url_method: :test_method, item_presenter: nil))
|
330
330
|
allow(helper).to receive(:test_method).with('simple_field', item).and_return('/blabla')
|
331
331
|
result = helper.render_facet_value('simple_field', item)
|
332
332
|
expect(result).to be_equivalent_to(expected_html).respecting_element_order
|
@@ -345,28 +345,28 @@ RSpec.describe Blacklight::FacetsHelperBehavior do
|
|
345
345
|
|
346
346
|
describe "#facet_display_value" do
|
347
347
|
it "justs be the facet value for an ordinary facet" do
|
348
|
-
allow(helper).to receive(:facet_configuration_for_field).with('simple_field').and_return(double(query: nil, date: nil, helper_method: nil, url_method: nil))
|
348
|
+
allow(helper).to receive(:facet_configuration_for_field).with('simple_field').and_return(double(query: nil, date: nil, helper_method: nil, url_method: nil, item_presenter: nil))
|
349
349
|
expect(helper.facet_display_value('simple_field', 'asdf')).to eq 'asdf'
|
350
350
|
end
|
351
351
|
|
352
352
|
it "allows you to pass in a :helper_method argument to the configuration" do
|
353
|
-
allow(helper).to receive(:facet_configuration_for_field).with('helper_field').and_return(double(query: nil, date: nil, url_method: nil, helper_method: :my_facet_value_renderer))
|
353
|
+
allow(helper).to receive(:facet_configuration_for_field).with('helper_field').and_return(double(query: nil, date: nil, url_method: nil, helper_method: :my_facet_value_renderer, item_presenter: nil))
|
354
354
|
allow(helper).to receive(:my_facet_value_renderer).with('qwerty').and_return('abc')
|
355
355
|
expect(helper.facet_display_value('helper_field', 'qwerty')).to eq 'abc'
|
356
356
|
end
|
357
357
|
|
358
358
|
it "extracts the configuration label for a query facet" do
|
359
|
-
allow(helper).to receive(:facet_configuration_for_field).with('query_facet').and_return(double(query: { 'query_key' => { label: 'XYZ' } }, date: nil, helper_method: nil, url_method: nil))
|
359
|
+
allow(helper).to receive(:facet_configuration_for_field).with('query_facet').and_return(double(query: { 'query_key' => { label: 'XYZ' } }, date: nil, helper_method: nil, url_method: nil, item_presenter: nil))
|
360
360
|
expect(helper.facet_display_value('query_facet', 'query_key')).to eq 'XYZ'
|
361
361
|
end
|
362
362
|
|
363
363
|
it "localizes the label for date-type facets" do
|
364
|
-
allow(helper).to receive(:facet_configuration_for_field).with('date_facet').and_return(double('date' => true, :query => nil, :helper_method => nil, :url_method => nil))
|
364
|
+
allow(helper).to receive(:facet_configuration_for_field).with('date_facet').and_return(double('date' => true, :query => nil, :helper_method => nil, :url_method => nil, :item_presenter => nil))
|
365
365
|
expect(helper.facet_display_value('date_facet', '2012-01-01')).to eq 'Sun, 01 Jan 2012 00:00:00 +0000'
|
366
366
|
end
|
367
367
|
|
368
368
|
it "localizes the label for date-type facets with the supplied localization options" do
|
369
|
-
allow(helper).to receive(:facet_configuration_for_field).with('date_facet').and_return(double('date' => { format: :short }, :query => nil, :helper_method => nil, :url_method => nil))
|
369
|
+
allow(helper).to receive(:facet_configuration_for_field).with('date_facet').and_return(double('date' => { format: :short }, :query => nil, :helper_method => nil, :url_method => nil, :item_presenter => nil))
|
370
370
|
expect(helper.facet_display_value('date_facet', '2012-01-01')).to eq '01 Jan 00:00'
|
371
371
|
end
|
372
372
|
end
|
@@ -102,6 +102,12 @@ RSpec.describe Blacklight::Solr::Response::Facets, api: true do
|
|
102
102
|
expect(subject.aggregations['my_field'].prefix).to be_nil
|
103
103
|
end
|
104
104
|
end
|
105
|
+
|
106
|
+
describe '#response' do
|
107
|
+
it 'provides access to the full solr response' do
|
108
|
+
expect(subject.aggregations['my_field'].response).to eq subject
|
109
|
+
end
|
110
|
+
end
|
105
111
|
end
|
106
112
|
|
107
113
|
describe "#merge_facet" do
|
data/tasks/blacklight.rake
CHANGED
@@ -21,7 +21,11 @@ def system_with_error_handling(*args)
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def with_solr
|
24
|
-
|
24
|
+
# We're being invoked by the app entrypoint script and solr is already up via docker-compose
|
25
|
+
if ENV['SOLR_ENV'] == 'docker-compose'
|
26
|
+
yield
|
27
|
+
elsif system('docker-compose -v')
|
28
|
+
# We're not running docker-compose up but still want to use a docker instance of solr.
|
25
29
|
begin
|
26
30
|
puts "Starting Solr"
|
27
31
|
system_with_error_handling "docker-compose up -d solr"
|
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
|
+
version: 7.22.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: 2021-
|
20
|
+
date: 2021-12-04 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -381,6 +381,7 @@ files:
|
|
381
381
|
- ".babelrc"
|
382
382
|
- ".docker/app/Dockerfile"
|
383
383
|
- ".docker/app/entrypoint.sh"
|
384
|
+
- ".dockerignore"
|
384
385
|
- ".env"
|
385
386
|
- ".github/workflows/ruby.yml"
|
386
387
|
- ".gitignore"
|
@@ -934,7 +935,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
934
935
|
- !ruby/object:Gem::Version
|
935
936
|
version: '0'
|
936
937
|
requirements: []
|
937
|
-
rubygems_version: 3.2.
|
938
|
+
rubygems_version: 3.2.15
|
938
939
|
signing_key:
|
939
940
|
specification_version: 4
|
940
941
|
summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
|