blacklight 7.33.0 → 7.33.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd9f780cd93deb22275984f9441e19bbffba7c3b07ba1173bd092786cd68bcef
|
4
|
+
data.tar.gz: 320dc37ac26ba35cbb9d4916babb45187f1a93203561cc1bcb214d6e1ebb181e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11ab615553f94bbdb382865dc4cd9dc757b9895de17976a8a8e9294987e25ef54d8b1e5d3f744690984508d5f6375cb823b21b78411f9b87c0ab5fe90dde6bec
|
7
|
+
data.tar.gz: afab5ae2f8e18deaf6935abb4160a326849cc4234bc9ac9cd21f757395493b7d698c908541f960ee8a17a3beb4c5e48b71f675c578426736f6055e57659c9709
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.33.
|
1
|
+
7.33.1
|
@@ -13,7 +13,6 @@ var Blacklight = function () {
|
|
13
13
|
},
|
14
14
|
listeners: function listeners() {
|
15
15
|
var listeners = [];
|
16
|
-
|
17
16
|
if (typeof Turbo !== 'undefined') {
|
18
17
|
listeners.push('turbo:load');
|
19
18
|
} else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {
|
@@ -27,23 +26,23 @@ var Blacklight = function () {
|
|
27
26
|
} else {
|
28
27
|
listeners.push('DOMContentLoaded');
|
29
28
|
}
|
30
|
-
|
31
29
|
return listeners;
|
32
30
|
}
|
33
31
|
};
|
34
|
-
}();
|
35
|
-
// If app isn't using turbolinks, this event will never be triggered, no prob.
|
36
|
-
|
32
|
+
}();
|
37
33
|
|
34
|
+
// turbolinks triggers page:load events on page transition
|
35
|
+
// If app isn't using turbolinks, this event will never be triggered, no prob.
|
38
36
|
Blacklight.listeners().forEach(function (listener) {
|
39
37
|
document.addEventListener(listener, function () {
|
40
38
|
Blacklight.activate();
|
41
39
|
});
|
42
40
|
});
|
43
41
|
Blacklight.onLoad(function () {
|
44
|
-
var elem = document.querySelector('.no-js');
|
45
|
-
// run on every turbo:load event, in that case, it won't find an element.
|
42
|
+
var elem = document.querySelector('.no-js');
|
46
43
|
|
44
|
+
// The "no-js" class may already have been removed because this function is
|
45
|
+
// run on every turbo:load event, in that case, it won't find an element.
|
47
46
|
if (!elem) return;
|
48
47
|
elem.classList.remove('no-js');
|
49
48
|
elem.classList.add('js');
|
@@ -56,11 +55,9 @@ Blacklight.onLoad(function () {
|
|
56
55
|
|
57
56
|
$('[data-autocomplete-enabled="true"]').each(function () {
|
58
57
|
var $el = $(this);
|
59
|
-
|
60
58
|
if ($el.hasClass('tt-hint')) {
|
61
59
|
return;
|
62
60
|
}
|
63
|
-
|
64
61
|
var suggestUrl = $el.data().autocompletePath;
|
65
62
|
var terms = new Bloodhound({
|
66
63
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
@@ -82,7 +79,6 @@ Blacklight.onLoad(function () {
|
|
82
79
|
});
|
83
80
|
});
|
84
81
|
});
|
85
|
-
|
86
82
|
(function ($) {
|
87
83
|
//change form submit toggle to checkbox
|
88
84
|
Blacklight.doBookmarkToggleBehavior = function () {
|
@@ -90,7 +86,6 @@ Blacklight.onLoad(function () {
|
|
90
86
|
console.warn("do_bookmark_toggle_behavior is deprecated. Use doBookmarkToggleBehavior instead.");
|
91
87
|
return Blacklight.do_bookmark_toggle_behavior();
|
92
88
|
}
|
93
|
-
|
94
89
|
$(Blacklight.doBookmarkToggleBehavior.selector).blCheckboxSubmit({
|
95
90
|
// cssClass is added to elements added, plus used for id base
|
96
91
|
cssClass: 'toggle-bookmark',
|
@@ -101,13 +96,11 @@ Blacklight.onLoad(function () {
|
|
101
96
|
}
|
102
97
|
});
|
103
98
|
};
|
104
|
-
|
105
99
|
Blacklight.doBookmarkToggleBehavior.selector = 'form.bookmark-toggle';
|
106
100
|
Blacklight.onLoad(function () {
|
107
101
|
Blacklight.doBookmarkToggleBehavior();
|
108
102
|
});
|
109
103
|
})(jQuery);
|
110
|
-
|
111
104
|
Blacklight.onLoad(function () {
|
112
105
|
// Button clicks should change focus. As of 10/3/19, Firefox for Mac and
|
113
106
|
// Safari both do not set focus to a button on button click.
|
@@ -148,23 +141,23 @@ Blacklight.onLoad(function () {
|
|
148
141
|
}
|
149
142
|
});
|
150
143
|
*/
|
151
|
-
|
152
144
|
(function ($) {
|
153
145
|
$.fn.blCheckboxSubmit = function (argOpts) {
|
154
146
|
this.each(function () {
|
155
147
|
var options = $.extend({}, $.fn.blCheckboxSubmit.defaults, argOpts);
|
156
148
|
var form = $(this);
|
157
|
-
form.children().hide();
|
149
|
+
form.children().hide();
|
150
|
+
//We're going to use the existing form to actually send our add/removes
|
158
151
|
//This works conveneintly because the exact same action href is used
|
159
152
|
//for both bookmarks/$doc_id. But let's take out the irrelevant parts
|
160
153
|
//of the form to avoid any future confusion.
|
154
|
+
form.find('input[type=submit]').remove();
|
161
155
|
|
162
|
-
|
156
|
+
//View needs to set data-doc-id so we know a unique value
|
163
157
|
//for making DOM id
|
164
|
-
|
165
|
-
|
158
|
+
var uniqueId = form.attr('data-doc-id') || Math.random();
|
159
|
+
// if form is currently using method delete to change state,
|
166
160
|
// then checkbox is currently checked
|
167
|
-
|
168
161
|
var checked = form.find('input[name=_method][value=delete]').length != 0;
|
169
162
|
var checkbox = $('<input type="checkbox">').addClass(options.cssClass).attr('id', options.cssClass + '_' + uniqueId);
|
170
163
|
var label = $('<label>').addClass(options.cssClass).attr('for', options.cssClass + '_' + uniqueId).attr('title', form.attr('title') || '');
|
@@ -173,11 +166,9 @@ Blacklight.onLoad(function () {
|
|
173
166
|
label.append(' ');
|
174
167
|
label.append(span);
|
175
168
|
var checkboxDiv = $('<div class="checkbox" />').addClass(options.cssClass).append(label);
|
176
|
-
|
177
169
|
function updateStateFor(state) {
|
178
170
|
checkbox.prop('checked', state);
|
179
171
|
label.toggleClass('checked', state);
|
180
|
-
|
181
172
|
if (state) {
|
182
173
|
//Set the Rails hidden field that fakes an HTTP verb
|
183
174
|
//properly for current state action.
|
@@ -188,7 +179,6 @@ Blacklight.onLoad(function () {
|
|
188
179
|
span.html(form.attr('data-absent'));
|
189
180
|
}
|
190
181
|
}
|
191
|
-
|
192
182
|
form.append(checkboxDiv);
|
193
183
|
updateStateFor(checked);
|
194
184
|
checkbox.click(function () {
|
@@ -224,10 +214,8 @@ Blacklight.onLoad(function () {
|
|
224
214
|
return false;
|
225
215
|
}); //checkbox.click
|
226
216
|
}); //this.each
|
227
|
-
|
228
217
|
return this;
|
229
218
|
};
|
230
|
-
|
231
219
|
$.fn.blCheckboxSubmit.defaults = {
|
232
220
|
//cssClass is added to elements added, plus used for id base
|
233
221
|
cssClass: 'blCheckboxSubmit',
|
@@ -235,32 +223,26 @@ Blacklight.onLoad(function () {
|
|
235
223
|
alert("Error");
|
236
224
|
},
|
237
225
|
success: function success() {} //callback
|
238
|
-
|
239
226
|
};
|
240
227
|
})(jQuery);
|
241
228
|
/*global Blacklight */
|
242
229
|
|
243
|
-
|
244
230
|
'use strict';
|
245
|
-
|
246
231
|
Blacklight.doResizeFacetLabelsAndCounts = function () {
|
247
232
|
// adjust width of facet columns to fit their contents
|
248
233
|
function longer(a, b) {
|
249
234
|
return b.textContent.length - a.textContent.length;
|
250
235
|
}
|
251
|
-
|
252
236
|
document.querySelectorAll('.facet-values, .pivot-facet').forEach(function (elem) {
|
253
|
-
var nodes = elem.querySelectorAll('.facet-count');
|
254
|
-
|
237
|
+
var nodes = elem.querySelectorAll('.facet-count');
|
238
|
+
// TODO: when we drop ie11 support, this can become the spread operator:
|
255
239
|
var longest = Array.from(nodes).sort(longer)[0];
|
256
|
-
|
257
240
|
if (longest && longest.textContent) {
|
258
241
|
var width = longest.textContent.length + 1 + 'ch';
|
259
242
|
elem.querySelector('.facet-count').style.width = width;
|
260
243
|
}
|
261
244
|
});
|
262
245
|
};
|
263
|
-
|
264
246
|
Blacklight.onLoad(function () {
|
265
247
|
Blacklight.doResizeFacetLabelsAndCounts();
|
266
248
|
});
|
@@ -336,99 +318,99 @@ Blacklight.onLoad(function () {
|
|
336
318
|
|
337
319
|
The data-blacklight-modal=close behavior is implemented with this event, see for example.
|
338
320
|
*/
|
321
|
+
|
339
322
|
// We keep all our data in Blacklight.modal object.
|
340
323
|
// Create lazily if someone else created first.
|
341
|
-
|
342
324
|
if (Blacklight.modal === undefined) {
|
343
325
|
Blacklight.modal = {};
|
344
|
-
}
|
326
|
+
}
|
345
327
|
|
328
|
+
// a Bootstrap modal div that should be already on the page hidden
|
329
|
+
Blacklight.modal.modalSelector = '#blacklight-modal';
|
346
330
|
|
347
|
-
|
331
|
+
// Trigger selectors identify forms or hyperlinks that should open
|
348
332
|
// inside a modal dialog.
|
349
|
-
|
350
333
|
Blacklight.modal.triggerLinkSelector = 'a[data-blacklight-modal~=trigger]';
|
351
|
-
Blacklight.modal.triggerFormSelector = 'form[data-blacklight-modal~=trigger]';
|
334
|
+
Blacklight.modal.triggerFormSelector = 'form[data-blacklight-modal~=trigger]';
|
335
|
+
|
336
|
+
// preserve selectors identify forms or hyperlinks that, if activated already
|
352
337
|
// inside a modal dialog, should have destinations remain inside the modal -- but
|
353
338
|
// won't trigger a modal if not already in one.
|
354
339
|
//
|
355
340
|
// No need to repeat selectors from trigger selectors, those will already
|
356
341
|
// be preserved. MUST be manually prefixed with the modal selector,
|
357
342
|
// so they only apply to things inside a modal.
|
358
|
-
|
359
343
|
Blacklight.modal.preserveLinkSelector = Blacklight.modal.modalSelector + ' a[data-blacklight-modal~=preserve]';
|
360
344
|
Blacklight.modal.containerSelector = '[data-blacklight-modal~=container]';
|
361
|
-
Blacklight.modal.modalCloseSelector = '[data-blacklight-modal~=close]';
|
345
|
+
Blacklight.modal.modalCloseSelector = '[data-blacklight-modal~=close]';
|
346
|
+
|
347
|
+
// Called on fatal failure of ajax load, function returns content
|
362
348
|
// to show to user in modal. Right now called only for extreme
|
363
349
|
// network errors.
|
364
|
-
|
365
350
|
Blacklight.modal.onFailure = function (jqXHR, textStatus, errorThrown) {
|
366
351
|
console.error('Server error:', this.url, jqXHR.status, errorThrown);
|
367
352
|
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>';
|
368
353
|
$(Blacklight.modal.modalSelector).find('.modal-content').html(contents);
|
369
354
|
Blacklight.modal.show();
|
370
355
|
};
|
371
|
-
|
372
356
|
Blacklight.modal.receiveAjax = function (contents) {
|
373
357
|
// does it have a data- selector for container?
|
374
358
|
// important we don't execute script tags, we shouldn't.
|
375
359
|
// code modelled off of JQuery ajax.load. https://github.com/jquery/jquery/blob/main/src/ajax/load.js?source=c#L62
|
376
360
|
var container = $('<div>').append(jQuery.parseHTML(contents)).find(Blacklight.modal.containerSelector).first();
|
377
|
-
|
378
361
|
if (container.length !== 0) {
|
379
362
|
contents = container.html();
|
380
363
|
}
|
364
|
+
$(Blacklight.modal.modalSelector).find('.modal-content').html(contents);
|
381
365
|
|
382
|
-
|
383
|
-
|
366
|
+
// send custom event with the modal dialog div as the target
|
384
367
|
var e = $.Event('loaded.blacklight.blacklight-modal');
|
385
|
-
$(Blacklight.modal.modalSelector).trigger(e);
|
386
|
-
|
368
|
+
$(Blacklight.modal.modalSelector).trigger(e);
|
369
|
+
// if they did preventDefault, don't show the dialog
|
387
370
|
if (e.isDefaultPrevented()) return;
|
388
371
|
Blacklight.modal.show();
|
389
372
|
};
|
390
|
-
|
391
373
|
Blacklight.modal.modalAjaxLinkClick = function (e) {
|
392
374
|
e.preventDefault();
|
393
375
|
$.ajax({
|
394
376
|
url: $(this).attr('href')
|
395
377
|
}).fail(Blacklight.modal.onFailure).done(Blacklight.modal.receiveAjax);
|
396
378
|
};
|
397
|
-
|
398
379
|
Blacklight.modal.modalAjaxFormSubmit = function (e) {
|
399
380
|
e.preventDefault();
|
400
381
|
$.ajax({
|
401
382
|
url: $(this).attr('action'),
|
402
383
|
data: $(this).serialize(),
|
403
384
|
type: $(this).attr('method') // POST
|
404
|
-
|
405
385
|
}).fail(Blacklight.modal.onFailure).done(Blacklight.modal.receiveAjax);
|
406
386
|
};
|
407
|
-
|
408
387
|
Blacklight.modal.setupModal = function () {
|
409
388
|
// Event indicating blacklight is setting up a modal link,
|
410
389
|
// you can catch it and call e.preventDefault() to abort
|
411
390
|
// setup.
|
412
391
|
var e = $.Event('setup.blacklight.blacklight-modal');
|
413
392
|
$('body').trigger(e);
|
414
|
-
if (e.isDefaultPrevented()) return;
|
393
|
+
if (e.isDefaultPrevented()) return;
|
394
|
+
|
395
|
+
// Register both trigger and preserve selectors in ONE event handler, combining
|
415
396
|
// into one selector with a comma, so if something matches BOTH selectors, it
|
416
397
|
// still only gets the event handler called once.
|
417
|
-
|
418
398
|
$('body').on('click', Blacklight.modal.triggerLinkSelector + ', ' + Blacklight.modal.preserveLinkSelector, Blacklight.modal.modalAjaxLinkClick);
|
419
|
-
$('body').on('submit', Blacklight.modal.triggerFormSelector + ', ' + Blacklight.modal.preserveFormSelector, Blacklight.modal.modalAjaxFormSubmit);
|
399
|
+
$('body').on('submit', Blacklight.modal.triggerFormSelector + ', ' + Blacklight.modal.preserveFormSelector, Blacklight.modal.modalAjaxFormSubmit);
|
400
|
+
|
401
|
+
// Catch our own custom loaded event to implement data-blacklight-modal=closed
|
402
|
+
$('body').on('loaded.blacklight.blacklight-modal', Blacklight.modal.checkCloseModal);
|
420
403
|
|
421
|
-
|
404
|
+
// we support doing data-dismiss=modal on a <a> with a href for non-ajax
|
422
405
|
// use, we need to suppress following the a's href that's there for
|
423
406
|
// non-JS contexts.
|
424
|
-
|
425
407
|
$('body').on('click', Blacklight.modal.modalSelector + ' a[data-dismiss~=modal]', function (e) {
|
426
408
|
e.preventDefault();
|
427
409
|
});
|
428
|
-
};
|
429
|
-
// to catch contained data-blacklight-modal=closed directions
|
430
|
-
|
410
|
+
};
|
431
411
|
|
412
|
+
// A function used as an event handler on loaded.blacklight.blacklight-modal
|
413
|
+
// to catch contained data-blacklight-modal=closed directions
|
432
414
|
Blacklight.modal.checkCloseModal = function (event) {
|
433
415
|
if ($(event.target).find(Blacklight.modal.modalCloseSelector).length) {
|
434
416
|
var modalFlashes = $(this).find('.flash_messages');
|
@@ -439,7 +421,6 @@ Blacklight.modal.checkCloseModal = function (event) {
|
|
439
421
|
modalFlashes.fadeIn(500);
|
440
422
|
}
|
441
423
|
};
|
442
|
-
|
443
424
|
Blacklight.modal.hide = function (el) {
|
444
425
|
if (typeof bootstrap !== 'undefined' && typeof bootstrap.Modal !== 'undefined' && bootstrap.Modal.VERSION >= "5") {
|
445
426
|
bootstrap.Modal.getOrCreateInstance(el || document.querySelector(Blacklight.modal.modalSelector)).hide();
|
@@ -447,7 +428,6 @@ Blacklight.modal.hide = function (el) {
|
|
447
428
|
$(el || Blacklight.modal.modalSelector).modal('hide');
|
448
429
|
}
|
449
430
|
};
|
450
|
-
|
451
431
|
Blacklight.modal.show = function (el) {
|
452
432
|
if (typeof bootstrap !== 'undefined' && typeof bootstrap.Modal !== 'undefined' && bootstrap.Modal.VERSION >= "5") {
|
453
433
|
bootstrap.Modal.getOrCreateInstance(el || document.querySelector(Blacklight.modal.modalSelector)).show();
|
@@ -455,19 +435,16 @@ Blacklight.modal.show = function (el) {
|
|
455
435
|
$(el || Blacklight.modal.modalSelector).modal('show');
|
456
436
|
}
|
457
437
|
};
|
458
|
-
|
459
438
|
Blacklight.onLoad(function () {
|
460
439
|
Blacklight.modal.setupModal();
|
461
440
|
});
|
462
|
-
|
463
441
|
Blacklight.doSearchContextBehavior = function () {
|
464
442
|
if (typeof Blacklight.do_search_context_behavior == 'function') {
|
465
443
|
console.warn("do_search_context_behavior is deprecated. Use doSearchContextBehavior instead.");
|
466
444
|
return Blacklight.do_search_context_behavior();
|
467
445
|
}
|
468
|
-
|
469
|
-
|
470
|
-
|
446
|
+
var elements = document.querySelectorAll('a[data-context-href]');
|
447
|
+
// Equivalent to Array.from(), but supports ie11
|
471
448
|
var nodes = Array.prototype.slice.call(elements);
|
472
449
|
nodes.forEach(function (element) {
|
473
450
|
element.addEventListener('click', function (e) {
|
@@ -475,29 +452,25 @@ Blacklight.doSearchContextBehavior = function () {
|
|
475
452
|
});
|
476
453
|
});
|
477
454
|
};
|
478
|
-
|
479
455
|
Blacklight.csrfToken = function () {
|
480
456
|
var _document$querySelect;
|
481
|
-
|
482
457
|
return (_document$querySelect = document.querySelector('meta[name=csrf-token]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content;
|
483
458
|
};
|
484
|
-
|
485
459
|
Blacklight.csrfParam = function () {
|
486
460
|
var _document$querySelect2;
|
487
|
-
|
488
461
|
return (_document$querySelect2 = document.querySelector('meta[name=csrf-param]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content;
|
489
|
-
};
|
490
|
-
// first, we're attaching this directly to the event handler, so we can check for meta-keys
|
491
|
-
|
462
|
+
};
|
492
463
|
|
464
|
+
// this is the Rails.handleMethod with a couple adjustments, described inline:
|
465
|
+
// first, we're attaching this directly to the event handler, so we can check for meta-keys
|
493
466
|
Blacklight.handleSearchContextMethod = function (event) {
|
494
467
|
if (typeof Blacklight.handle_search_context_method == 'function') {
|
495
468
|
console.warn("handle_search_context_method is deprecated. Use handleSearchContextMethod instead.");
|
496
469
|
return Blacklight.handle_search_context_method(event);
|
497
470
|
}
|
471
|
+
var link = this;
|
498
472
|
|
499
|
-
|
500
|
-
|
473
|
+
// instead of using the normal href, we need to use the context href instead
|
501
474
|
var href = link.getAttribute('data-context-href');
|
502
475
|
var target = link.getAttribute('target');
|
503
476
|
var csrfToken = Blacklight.csrfToken();
|
@@ -505,24 +478,22 @@ Blacklight.handleSearchContextMethod = function (event) {
|
|
505
478
|
var form = document.createElement('form');
|
506
479
|
form.method = 'post';
|
507
480
|
form.action = href;
|
508
|
-
var formContent = "<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"".concat(link.getAttribute('href'), "\" type=\"hidden\" />");
|
481
|
+
var formContent = "<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"".concat(link.getAttribute('href'), "\" type=\"hidden\" />");
|
509
482
|
|
483
|
+
// check for meta keys.. if set, we should open in a new tab
|
510
484
|
if (event.metaKey || event.ctrlKey) {
|
511
485
|
target = '_blank';
|
512
486
|
}
|
513
|
-
|
514
487
|
if (csrfParam !== undefined && csrfToken !== undefined) {
|
515
488
|
formContent += "<input name=\"".concat(csrfParam, "\" value=\"").concat(csrfToken, "\" type=\"hidden\" />");
|
516
|
-
}
|
517
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit
|
518
|
-
|
489
|
+
}
|
519
490
|
|
491
|
+
// Must trigger submit by click on a button, else "submit" event handler won't work!
|
492
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit
|
520
493
|
formContent += '<input type="submit" />';
|
521
|
-
|
522
494
|
if (target) {
|
523
495
|
form.setAttribute('target', target);
|
524
496
|
}
|
525
|
-
|
526
497
|
form.style.display = 'none';
|
527
498
|
form.innerHTML = formContent;
|
528
499
|
document.body.appendChild(form);
|
@@ -530,7 +501,6 @@ Blacklight.handleSearchContextMethod = function (event) {
|
|
530
501
|
event.preventDefault();
|
531
502
|
event.stopPropagation();
|
532
503
|
};
|
533
|
-
|
534
504
|
Blacklight.onLoad(function () {
|
535
505
|
Blacklight.doSearchContextBehavior();
|
536
506
|
});
|
@@ -577,9 +577,13 @@ module Blacklight
|
|
577
577
|
document_or_display_types
|
578
578
|
end
|
579
579
|
|
580
|
+
unless display_types.respond_to?(:each)
|
581
|
+
Deprecation.warn self, "Calling show_fields_for with a scalar value is deprecated. It must receive an Enumerable."
|
582
|
+
display_types = Array.wrap(display_types)
|
583
|
+
end
|
580
584
|
fields = {}.with_indifferent_access
|
581
585
|
|
582
|
-
|
586
|
+
display_types.each do |display_type|
|
583
587
|
fields = fields.merge(for_display_type(display_type).show_fields)
|
584
588
|
end
|
585
589
|
|
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "blacklight-frontend",
|
3
|
-
"version": "7.
|
3
|
+
"version": "7.33.1",
|
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": {
|
@@ -535,6 +535,10 @@ RSpec.describe CatalogController, api: true do
|
|
535
535
|
post :email, xhr: true, params: { id: doc_id, to: 'test_email@projectblacklight.org' }
|
536
536
|
expect(request).to render_template 'email_success'
|
537
537
|
expect(request.flash[:success]).to eq "Email Sent"
|
538
|
+
allow(search_service).to receive(:search_results)
|
539
|
+
# When we go to another page, the flash message should no longer display
|
540
|
+
get :index
|
541
|
+
expect(request.flash[:success]).to be_nil
|
538
542
|
end
|
539
543
|
end
|
540
544
|
|
@@ -589,6 +593,10 @@ RSpec.describe CatalogController, api: true do
|
|
589
593
|
post :sms, xhr: true, params: { id: doc_id, to: '5555555555', carrier: 'txt.att.net' }
|
590
594
|
expect(request).to render_template 'sms_success'
|
591
595
|
expect(request.flash[:success]).to eq "SMS Sent"
|
596
|
+
allow(search_service).to receive(:search_results)
|
597
|
+
# When we go to another page, the flash message should no longer display
|
598
|
+
get :index
|
599
|
+
expect(request.flash[:success]).to be_nil
|
592
600
|
end
|
593
601
|
end
|
594
602
|
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.33.
|
4
|
+
version: 7.33.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:
|
20
|
+
date: 2023-02-02 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -954,7 +954,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
954
954
|
- !ruby/object:Gem::Version
|
955
955
|
version: '0'
|
956
956
|
requirements: []
|
957
|
-
rubygems_version: 3.3.
|
957
|
+
rubygems_version: 3.3.26
|
958
958
|
signing_key:
|
959
959
|
specification_version: 4
|
960
960
|
summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
|