blacklight 7.1.0.alpha → 7.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +27 -16
- data/.travis.yml +1 -5
- data/CONTRIBUTING.md +48 -0
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +3 -3
- data/app/assets/stylesheets/blacklight/_search_results.scss +3 -3
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +4 -4
- data/app/helpers/blacklight/catalog_helper_behavior.rb +7 -2
- data/app/javascript/blacklight/checkbox_submit.js +3 -3
- data/app/models/blacklight/icon.rb +4 -2
- data/app/models/record_mailer.rb +4 -1
- data/app/views/catalog/_facet_layout.html.erb +5 -3
- data/app/views/catalog/_search_form.html.erb +1 -1
- data/app/views/catalog/_show_sidebar.html.erb +7 -5
- data/app/views/catalog/_show_tools.html.erb +0 -9
- data/app/views/catalog/show.html.erb +1 -1
- data/app/views/record_mailer/email_record.text.erb +6 -5
- data/app/views/shared/_header_navbar.html.erb +1 -1
- data/blacklight.gemspec +1 -1
- data/package-lock.json +12 -12
- data/package.json +1 -1
- data/spec/models/blacklight/document/cache_key_spec.rb +1 -1
- data/spec/models/blacklight/icon_spec.rb +15 -1
- data/spec/models/blacklight/solr/response/facets_spec.rb +2 -2
- data/spec/models/blacklight/solr/response_spec.rb +17 -17
- data/spec/models/blacklight/suggest/response_spec.rb +1 -1
- data/spec/models/solr_document_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -12
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +2 -2
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +3 -3
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1781363312295e0871899850efea8278e255485d84991ad9e5ce1c798eba9680
|
4
|
+
data.tar.gz: 2be4ffe011dc4a8c96d58097db27c768422fb24b2528cd9cbc8d91cf80728072
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 737b9592762ed056e36f6d41a5560387764bf01643bcfee555c0bc8e17ddf7d6d663161a6bc777c41d0cdbf8e157ae42ab2ed92f4d596dbeac0409b76a4d8a17
|
7
|
+
data.tar.gz: 62e3b74deba357f21e09145d6fcd25a241d05b1fbcd6ca3e40c3794fca3fe202074e8bab9ecbb2dac21b1980db54a9cee6af62144fe6545760b9d135ba4cfed7
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2019-
|
3
|
+
# on 2019-08-05 11:45:43 -0500 using RuboCop version 0.63.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -36,7 +36,7 @@ Layout/ClosingParenthesisIndentation:
|
|
36
36
|
Exclude:
|
37
37
|
- 'app/views/catalog/index.atom.builder'
|
38
38
|
|
39
|
-
# Offense count:
|
39
|
+
# Offense count: 109
|
40
40
|
# Cop supports --auto-correct.
|
41
41
|
Layout/EmptyLineAfterMagicComment:
|
42
42
|
Enabled: false
|
@@ -69,11 +69,10 @@ Layout/LeadingCommentSpace:
|
|
69
69
|
- 'app/models/concerns/blacklight/document/export.rb'
|
70
70
|
- 'app/views/catalog/_document.atom.builder'
|
71
71
|
|
72
|
-
# Offense count:
|
72
|
+
# Offense count: 1
|
73
73
|
# Cop supports --auto-correct.
|
74
74
|
Layout/MultilineBlockLayout:
|
75
75
|
Exclude:
|
76
|
-
- 'lib/generators/blacklight/install_generator.rb'
|
77
76
|
- 'lib/generators/blacklight/test_support_generator.rb'
|
78
77
|
|
79
78
|
# Offense count: 2
|
@@ -127,13 +126,12 @@ Layout/SpaceInsideParens:
|
|
127
126
|
- 'app/views/catalog/_document.rss.builder'
|
128
127
|
- 'app/views/catalog/index.atom.builder'
|
129
128
|
|
130
|
-
# Offense count:
|
129
|
+
# Offense count: 1
|
131
130
|
# Cop supports --auto-correct.
|
132
131
|
# Configuration parameters: AllowInHeredoc.
|
133
132
|
Layout/TrailingWhitespace:
|
134
133
|
Exclude:
|
135
134
|
- 'app/views/catalog/_document.rss.builder'
|
136
|
-
- 'app/views/catalog/index.atom.builder'
|
137
135
|
|
138
136
|
# Offense count: 1
|
139
137
|
Lint/AmbiguousBlockAssociation:
|
@@ -211,7 +209,7 @@ Metrics/ClassLength:
|
|
211
209
|
Metrics/CyclomaticComplexity:
|
212
210
|
Max: 12
|
213
211
|
|
214
|
-
# Offense count:
|
212
|
+
# Offense count: 48
|
215
213
|
# Configuration parameters: CountComments, ExcludedMethods.
|
216
214
|
Metrics/MethodLength:
|
217
215
|
Max: 35
|
@@ -219,7 +217,7 @@ Metrics/MethodLength:
|
|
219
217
|
# Offense count: 8
|
220
218
|
# Configuration parameters: CountComments.
|
221
219
|
Metrics/ModuleLength:
|
222
|
-
Max:
|
220
|
+
Max: 210
|
223
221
|
|
224
222
|
# Offense count: 1
|
225
223
|
# Configuration parameters: CountKeywordArgs.
|
@@ -255,7 +253,7 @@ Naming/UncommunicativeMethodParamName:
|
|
255
253
|
- 'spec/features/search_context_spec.rb'
|
256
254
|
- 'spec/features/search_results_spec.rb'
|
257
255
|
|
258
|
-
# Offense count:
|
256
|
+
# Offense count: 16
|
259
257
|
# Configuration parameters: EnforcedStyle.
|
260
258
|
# SupportedStyles: snake_case, normalcase, non_integer
|
261
259
|
Naming/VariableNumber:
|
@@ -332,7 +330,7 @@ RSpec/FilePath:
|
|
332
330
|
- 'spec/presenters/pipeline_spec.rb'
|
333
331
|
- 'spec/presenters/thumbnail_presenter_spec.rb'
|
334
332
|
|
335
|
-
# Offense count:
|
333
|
+
# Offense count: 197
|
336
334
|
# Configuration parameters: AssignmentOnly.
|
337
335
|
RSpec/InstanceVariable:
|
338
336
|
Enabled: false
|
@@ -344,6 +342,18 @@ RSpec/IteratedExpectation:
|
|
344
342
|
- 'spec/models/blacklight/solr/response/group_spec.rb'
|
345
343
|
- 'spec/models/blacklight/solr/response_spec.rb'
|
346
344
|
|
345
|
+
# Offense count: 17
|
346
|
+
RSpec/LeakyConstantDeclaration:
|
347
|
+
Exclude:
|
348
|
+
- 'spec/controllers/blacklight/search_fields_spec.rb'
|
349
|
+
- 'spec/controllers/bookmarks_controller_spec.rb'
|
350
|
+
- 'spec/controllers/catalog_controller_spec.rb'
|
351
|
+
- 'spec/models/blacklight/configurable_spec.rb'
|
352
|
+
- 'spec/models/blacklight/document/active_model_shim_spec.rb'
|
353
|
+
- 'spec/models/blacklight/document_spec.rb'
|
354
|
+
- 'spec/models/blacklight/solr/document_spec.rb'
|
355
|
+
- 'spec/presenters/blacklight/show_presenter_spec.rb'
|
356
|
+
|
347
357
|
# Offense count: 8
|
348
358
|
RSpec/MessageChain:
|
349
359
|
Exclude:
|
@@ -371,12 +381,12 @@ RSpec/MessageSpies:
|
|
371
381
|
- 'spec/presenters/blacklight/show_presenter_spec.rb'
|
372
382
|
- 'spec/presenters/thumbnail_presenter_spec.rb'
|
373
383
|
|
374
|
-
# Offense count:
|
384
|
+
# Offense count: 346
|
375
385
|
# Configuration parameters: AggregateFailuresByDefault.
|
376
386
|
RSpec/MultipleExpectations:
|
377
387
|
Max: 16
|
378
388
|
|
379
|
-
# Offense count:
|
389
|
+
# Offense count: 329
|
380
390
|
# Configuration parameters: IgnoreSharedExamples.
|
381
391
|
RSpec/NamedSubject:
|
382
392
|
Enabled: false
|
@@ -406,13 +416,14 @@ RSpec/ScatteredLet:
|
|
406
416
|
- 'spec/models/blacklight/solr/search_builder_spec.rb'
|
407
417
|
- 'spec/views/catalog/index.atom.builder_spec.rb'
|
408
418
|
|
409
|
-
# Offense count:
|
419
|
+
# Offense count: 10
|
410
420
|
RSpec/SubjectStub:
|
411
421
|
Exclude:
|
412
422
|
- 'spec/lib/blacklight/search_state_spec.rb'
|
423
|
+
- 'spec/models/blacklight/search_builder_spec.rb'
|
413
424
|
- 'spec/services/blacklight/search_service_spec.rb'
|
414
425
|
|
415
|
-
# Offense count:
|
426
|
+
# Offense count: 119
|
416
427
|
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
417
428
|
RSpec/VerifiedDoubles:
|
418
429
|
Enabled: false
|
@@ -476,7 +487,7 @@ Style/BracesAroundHashParameters:
|
|
476
487
|
- 'lib/blacklight/solr/response/facets.rb'
|
477
488
|
- 'lib/generators/blacklight/test_support_generator.rb'
|
478
489
|
|
479
|
-
# Offense count:
|
490
|
+
# Offense count: 51
|
480
491
|
# Cop supports --auto-correct.
|
481
492
|
# Configuration parameters: AutoCorrect, EnforcedStyle.
|
482
493
|
# SupportedStyles: nested, compact
|
@@ -497,7 +508,7 @@ Style/ConditionalAssignment:
|
|
497
508
|
Exclude:
|
498
509
|
- 'lib/blacklight/solr/response/spelling.rb'
|
499
510
|
|
500
|
-
# Offense count:
|
511
|
+
# Offense count: 94
|
501
512
|
Style/Documentation:
|
502
513
|
Enabled: false
|
503
514
|
|
data/.travis.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
dist:
|
1
|
+
dist: bionic
|
2
2
|
addons:
|
3
3
|
chrome: stable
|
4
4
|
language: ruby
|
@@ -18,8 +18,6 @@ matrix:
|
|
18
18
|
env: "RAILS_VERSION=5.2.1 BLACKLIGHT_API_TEST=true ENGINE_CART_RAILS_OPTIONS=\"--api --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-test\""
|
19
19
|
- rvm: 2.4.5
|
20
20
|
env: "RAILS_VERSION=5.1.6"
|
21
|
-
- rvm: 2.3.8
|
22
|
-
env: "RAILS_VERSION=5.2.1"
|
23
21
|
- rvm: jruby-9.2.0.0
|
24
22
|
env: "RAILS_VERSION=5.1.6 JRUBY_OPTS=\"-J-Xms512m -J-Xmx1024m\""
|
25
23
|
allow_failures:
|
@@ -27,8 +25,6 @@ matrix:
|
|
27
25
|
fast_finish: true
|
28
26
|
|
29
27
|
before_install:
|
30
|
-
- gem install chromedriver-helper --no-document
|
31
|
-
- chromedriver-update 73.0.3683.68
|
32
28
|
- google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=9222 http://localhost &
|
33
29
|
|
34
30
|
notifications:
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Contributing to Blacklight
|
2
|
+
|
3
|
+
Blacklight is a collaborative, open source project produced by developers from many diverse organizations. The Blacklight developers want to create an out-of-the-box framework that is easy to install and get started with, both as a service to the community and in the interests of our own institutions in creating a sustainable project and product.
|
4
|
+
|
5
|
+
Development is largely motivated by the needs of each developer’s organization, and we work on the shared project together so we can benefit from the community’s development efforts, experiences building discovery systems, and shared problem solving.
|
6
|
+
|
7
|
+
We always welcome contributions from the community, especially to add new features, address bugs or defects, and clarify existing code for future developers.
|
8
|
+
|
9
|
+
## Adding a ticket
|
10
|
+
Let us know you're interested in working on a feature by filing a ticket in our [issue tracker](https://github.com/projectblacklight/blacklight/issues).
|
11
|
+
|
12
|
+
## Making Your Changes
|
13
|
+
|
14
|
+
* Fork the project
|
15
|
+
* Start a feature/bugfix branch
|
16
|
+
* Commit and push until you are happy with your contribution
|
17
|
+
* Make sure to add tests for it. This is important so we don't break it in a future version unintentionally.
|
18
|
+
* After making your changes, be sure to run the [Blacklight tests](https://github.com/projectblacklight/blacklight/wiki/testing) to make sure everything works.
|
19
|
+
* Submit your change as a [Pull Request](https://help.github.com/en/articles/about-pull-requests).
|
20
|
+
|
21
|
+
## Pull Requests and Code Review
|
22
|
+
- Pull requests must be reviewed and approved by one non-author with write-permissions
|
23
|
+
- A reviewer who has approved a PR but has not merged it should provide a comment (e.g. "This looks good, I'm just waiting for Travis to build", "This is a breaking change. I would like at least one more reviewer.")
|
24
|
+
- An approved PR may be merged by the reviewer, the author, or another committer
|
25
|
+
|
26
|
+
## Support
|
27
|
+
If you are interested in working on the Blacklight plugin, but want guidance or support, please send an email to our [Blacklight-development mailing list](http://groups.google.com/group/blacklight-development) and we'll be glad to help.
|
28
|
+
|
29
|
+
## Becoming a Committer
|
30
|
+
|
31
|
+
Anyone can contribute to Blacklight using pull requests, the issue tracker, and being active on the mailing list and IRC channels. Being a contributor means that you take an active interest in the project and contribute regularly in some way, ranging from asking sensible questions (which documents the project and provides feedback to developers) to providing new features as patches.
|
32
|
+
|
33
|
+
If you become a valuable contributor to the project you may be invited to become a committer. Blacklight code contributors become committers after being sponsored by one of the current active committers. The committers will take an Apache-style (+1/0/-1) vote to elevate them, and then a formal invitation will be extended to the contributor.
|
34
|
+
|
35
|
+
Committers should be:
|
36
|
+
|
37
|
+
- technically adept
|
38
|
+
- constructive, positive members of the Blacklight software community
|
39
|
+
- committed to producing useful, practical code for the community
|
40
|
+
|
41
|
+
You're expected to:
|
42
|
+
|
43
|
+
- contribute patches and new functionality to Blacklight and other shared development efforts (RSolr, Blacklight plugins, etc)
|
44
|
+
- actively participate in technical discussions on the email list, IRC, and github
|
45
|
+
- answer user support questions via the various channels
|
46
|
+
- review pull requests from fellow committers and the community
|
47
|
+
- test-drive new release candidates against your own institution's Blacklight applications
|
48
|
+
- participate in regular committer meetings, usually in the form of conference calls, to coordinate development & direction
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.1.0
|
1
|
+
7.1.0
|
@@ -160,17 +160,17 @@ Blacklight.onLoad(function () {
|
|
160
160
|
//Set the Rails hidden field that fakes an HTTP verb
|
161
161
|
//properly for current state action.
|
162
162
|
form.find('input[name=_method]').val('delete');
|
163
|
-
span.
|
163
|
+
span.html(form.attr('data-present'));
|
164
164
|
} else {
|
165
165
|
form.find('input[name=_method]').val('put');
|
166
|
-
span.
|
166
|
+
span.html(form.attr('data-absent'));
|
167
167
|
}
|
168
168
|
}
|
169
169
|
|
170
170
|
form.append(checkboxDiv);
|
171
171
|
updateStateFor(checked);
|
172
172
|
checkbox.click(function () {
|
173
|
-
span.
|
173
|
+
span.html(form.attr('data-inprogress'));
|
174
174
|
label.attr('disabled', 'disabled');
|
175
175
|
checkbox.attr('disabled', 'disabled');
|
176
176
|
$.ajax({
|
@@ -13,7 +13,7 @@
|
|
13
13
|
// bookmarks checkbox on index, give it some
|
14
14
|
// lower margin when it collapses
|
15
15
|
.index-document-functions {
|
16
|
-
margin-bottom: ($
|
16
|
+
margin-bottom: ($spacer * 1.5);
|
17
17
|
|
18
18
|
@media (min-width: breakpoint-min(sm)) {
|
19
19
|
margin-bottom: 0;
|
@@ -22,8 +22,8 @@
|
|
22
22
|
|
23
23
|
.document-thumbnail {
|
24
24
|
float: right;
|
25
|
-
margin-bottom: $
|
26
|
-
padding-left: $
|
25
|
+
margin-bottom: ($spacer * 3);
|
26
|
+
padding-left: ($spacer * 3);
|
27
27
|
}
|
28
28
|
}
|
29
29
|
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# Methods added to this helper will be available to all templates in the hosting application
|
3
3
|
module Blacklight::BlacklightHelperBehavior
|
4
|
-
include UrlHelperBehavior
|
5
|
-
include HashAsHiddenFieldsHelperBehavior
|
6
|
-
include LayoutHelperBehavior
|
7
|
-
include IconHelperBehavior
|
4
|
+
include Blacklight::UrlHelperBehavior
|
5
|
+
include Blacklight::HashAsHiddenFieldsHelperBehavior
|
6
|
+
include Blacklight::LayoutHelperBehavior
|
7
|
+
include Blacklight::IconHelperBehavior
|
8
8
|
|
9
9
|
##
|
10
10
|
# Get the name of this application from an i18n string
|
@@ -153,8 +153,13 @@ module Blacklight::CatalogHelperBehavior
|
|
153
153
|
#
|
154
154
|
# @param [SolrDocument] document
|
155
155
|
# @return [String]
|
156
|
-
def render_document_sidebar_partial(
|
157
|
-
|
156
|
+
def render_document_sidebar_partial(document = nil)
|
157
|
+
unless document
|
158
|
+
Deprecation.warn(self, 'render_document_sidebar_partial expects one argument ' /
|
159
|
+
'(@document) and you passed none. This behavior will be removed in version 8')
|
160
|
+
document = @document
|
161
|
+
end
|
162
|
+
render 'show_sidebar', document: document
|
158
163
|
end
|
159
164
|
|
160
165
|
##
|
@@ -73,10 +73,10 @@
|
|
73
73
|
//Set the Rails hidden field that fakes an HTTP verb
|
74
74
|
//properly for current state action.
|
75
75
|
form.find('input[name=_method]').val('delete');
|
76
|
-
span.
|
76
|
+
span.html(form.attr('data-present'));
|
77
77
|
} else {
|
78
78
|
form.find('input[name=_method]').val('put');
|
79
|
-
span.
|
79
|
+
span.html(form.attr('data-absent'));
|
80
80
|
}
|
81
81
|
}
|
82
82
|
|
@@ -84,7 +84,7 @@
|
|
84
84
|
updateStateFor(checked);
|
85
85
|
|
86
86
|
checkbox.click(function() {
|
87
|
-
span.
|
87
|
+
span.html(form.attr('data-inprogress'));
|
88
88
|
label.attr('disabled', 'disabled');
|
89
89
|
checkbox.attr('disabled', 'disabled');
|
90
90
|
|
@@ -7,9 +7,10 @@ module Blacklight
|
|
7
7
|
# @param [String, Symbol] icon_name
|
8
8
|
# @param [Hash] options
|
9
9
|
# @param [String] classes additional classes separated by a string
|
10
|
-
def initialize(icon_name, classes: '')
|
10
|
+
def initialize(icon_name, classes: '', aria_hidden: false)
|
11
11
|
@icon_name = icon_name
|
12
12
|
@classes = classes
|
13
|
+
@aria_hidden = aria_hidden
|
13
14
|
end
|
14
15
|
|
15
16
|
##
|
@@ -23,7 +24,8 @@ module Blacklight
|
|
23
24
|
# @return [Hash]
|
24
25
|
def options
|
25
26
|
{
|
26
|
-
class: classes
|
27
|
+
class: classes,
|
28
|
+
"aria-hidden": (true if @aria_hidden)
|
27
29
|
}
|
28
30
|
end
|
29
31
|
|
data/app/models/record_mailer.rb
CHANGED
@@ -7,7 +7,10 @@ class RecordMailer < ActionMailer::Base
|
|
7
7
|
rescue
|
8
8
|
I18n.t('blacklight.email.text.default_title')
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
|
+
subject = I18n.t('blacklight.email.text.subject',
|
12
|
+
count: documents.length,
|
13
|
+
title: Array(title).first)
|
11
14
|
|
12
15
|
@documents = documents
|
13
16
|
@message = details[:message]
|
@@ -1,8 +1,10 @@
|
|
1
1
|
<div class="card facet-limit blacklight-<%= facet_field.key.parameterize %> <%= 'facet-limit-active' if facet_field_in_params?(facet_field.key) %>">
|
2
|
-
<h3 class="card-header <%= "collapsed" if should_collapse_facet?(facet_field) %> collapse-toggle facet-field-heading" aria-expanded="false" data-toggle="collapse" data-target="#<%= facet_field_id(facet_field) %>">
|
2
|
+
<h3 class="card-header <%= "collapsed" if should_collapse_facet?(facet_field) %> collapse-toggle facet-field-heading" aria-expanded="false" data-toggle="collapse" data-target="#<%= facet_field_id(facet_field) %>" id="<%= facet_field_id(facet_field) %>-header">
|
3
3
|
<%= link_to facet_field_label(facet_field.key), "##{ facet_field_id(facet_field)}", "data-turbolinks": false %>
|
4
4
|
</h3>
|
5
|
-
<div id="<%= facet_field_id(facet_field) %>" class="
|
6
|
-
|
5
|
+
<div id="<%= facet_field_id(facet_field) %>" aria-labelledby="<%= facet_field_id(facet_field) %>-header" class="panel-collapse facet-content <%= should_collapse_facet?(facet_field) ? 'collapse' : 'show' %>">
|
6
|
+
<div class="card-body">
|
7
|
+
<%= yield %>
|
8
|
+
</div>
|
7
9
|
</div>
|
8
10
|
</div>
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<span class="input-group-append">
|
21
21
|
<button type="submit" class="btn btn-primary search-btn" id="search">
|
22
22
|
<span class="submit-search-text"><%= t('blacklight.search.form.submit') %></span>
|
23
|
-
<%= blacklight_icon :search %>
|
23
|
+
<%= blacklight_icon :search, aria_hidden: true %>
|
24
24
|
</button>
|
25
25
|
</span>
|
26
26
|
</div>
|
@@ -1,10 +1,12 @@
|
|
1
|
-
<%= render
|
2
|
-
|
3
|
-
<% unless
|
1
|
+
<%= render 'show_tools' %>
|
2
|
+
|
3
|
+
<% unless document.more_like_this.empty? %>
|
4
4
|
<div class="card">
|
5
5
|
<div class="card-header">More Like This</div>
|
6
6
|
<div class="card-body">
|
7
|
-
<%= render :
|
7
|
+
<%= render collection: document.more_like_this,
|
8
|
+
partial: 'show_more_like_this',
|
9
|
+
as: :document %>
|
8
10
|
</div>
|
9
11
|
</div>
|
10
|
-
<% end %>
|
12
|
+
<% end %>
|
@@ -1,12 +1,3 @@
|
|
1
|
-
<%-
|
2
|
-
# Compare with render_document_functions_partial helper, and
|
3
|
-
# _document_functions partial. BL actually has two groups
|
4
|
-
# of document-related tools. "document functions" by default
|
5
|
-
# contains Bookmark functionality shown on both results and
|
6
|
-
# item view. While "document tools" contains external export type
|
7
|
-
# functions by default only on detail.
|
8
|
-
|
9
|
-
-%>
|
10
1
|
<% if show_doc_actions? %>
|
11
2
|
<div class="card show-tools">
|
12
3
|
<div class="card-header">
|
@@ -1,5 +1,6 @@
|
|
1
|
-
<% @documents.each do |document| %>
|
2
|
-
<%= document.to_email_text %>
|
3
|
-
<%= t('blacklight.email.text.url', :url =>polymorphic_url(document, @url_gen_params)) %>
|
4
|
-
|
5
|
-
|
1
|
+
<% @documents.each do |document| %>
|
2
|
+
<%= document.to_email_text %>
|
3
|
+
<%= t('blacklight.email.text.url', :url =>polymorphic_url(document, @url_gen_params)) %>
|
4
|
+
|
5
|
+
<% end %>
|
6
|
+
<%= t('blacklight.email.text.message', :message => @message) %>
|
data/blacklight.gemspec
CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.add_development_dependency "rspec-its"
|
38
38
|
s.add_development_dependency "rspec-collection_matchers", ">= 1.0"
|
39
39
|
s.add_development_dependency "capybara", '~> 3'
|
40
|
-
s.add_development_dependency '
|
40
|
+
s.add_development_dependency 'webdrivers', '~> 3.0'
|
41
41
|
s.add_development_dependency "selenium-webdriver", '>= 3.13.1'
|
42
42
|
s.add_development_dependency 'engine_cart', '~> 2.1'
|
43
43
|
s.add_development_dependency "equivalent-xml"
|
data/package-lock.json
CHANGED
@@ -1884,9 +1884,9 @@
|
|
1884
1884
|
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
1885
1885
|
},
|
1886
1886
|
"jquery": {
|
1887
|
-
"version": "3.
|
1888
|
-
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.
|
1889
|
-
"integrity": "sha512-
|
1887
|
+
"version": "3.4.1",
|
1888
|
+
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz",
|
1889
|
+
"integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw=="
|
1890
1890
|
},
|
1891
1891
|
"js-tokens": {
|
1892
1892
|
"version": "4.0.0",
|
@@ -1928,9 +1928,9 @@
|
|
1928
1928
|
}
|
1929
1929
|
},
|
1930
1930
|
"lodash": {
|
1931
|
-
"version": "4.17.
|
1932
|
-
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.
|
1933
|
-
"integrity": "sha512-
|
1931
|
+
"version": "4.17.15",
|
1932
|
+
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
1933
|
+
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
1934
1934
|
"dev": true
|
1935
1935
|
},
|
1936
1936
|
"map-cache": {
|
@@ -1989,9 +1989,9 @@
|
|
1989
1989
|
"dev": true
|
1990
1990
|
},
|
1991
1991
|
"mixin-deep": {
|
1992
|
-
"version": "1.3.
|
1993
|
-
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.
|
1994
|
-
"integrity": "sha512-
|
1992
|
+
"version": "1.3.2",
|
1993
|
+
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
|
1994
|
+
"integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
|
1995
1995
|
"dev": true,
|
1996
1996
|
"optional": true,
|
1997
1997
|
"requires": {
|
@@ -2291,9 +2291,9 @@
|
|
2291
2291
|
"dev": true
|
2292
2292
|
},
|
2293
2293
|
"set-value": {
|
2294
|
-
"version": "2.0.
|
2295
|
-
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.
|
2296
|
-
"integrity": "sha512-
|
2294
|
+
"version": "2.0.1",
|
2295
|
+
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
|
2296
|
+
"integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
|
2297
2297
|
"dev": true,
|
2298
2298
|
"optional": true,
|
2299
2299
|
"requires": {
|
data/package.json
CHANGED
@@ -5,7 +5,7 @@ RSpec.describe Blacklight::Document::CacheKey, api: true do
|
|
5
5
|
let(:subject) { SolrDocument.new(attributes) }
|
6
6
|
|
7
7
|
it 'SolrDocument includes the module' do
|
8
|
-
expect(subject.class).to include(
|
8
|
+
expect(subject.class).to include(described_class)
|
9
9
|
end
|
10
10
|
|
11
11
|
describe 'new record' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.describe Blacklight::Icon do
|
4
|
-
subject { described_class.new(:search, classes: 'awesome') }
|
4
|
+
subject { described_class.new(:search, classes: 'awesome', aria_hidden: true) }
|
5
5
|
|
6
6
|
describe '#svg' do
|
7
7
|
it 'returns a string' do
|
@@ -17,6 +17,20 @@ RSpec.describe Blacklight::Icon do
|
|
17
17
|
it 'applies options classes and default class' do
|
18
18
|
expect(subject.options[:class]).to eq 'blacklight-icons awesome'
|
19
19
|
end
|
20
|
+
it 'applies options aria-hidden=true' do
|
21
|
+
expect(subject.options[:'aria-hidden']).to be true
|
22
|
+
end
|
23
|
+
context 'no options provided' do
|
24
|
+
subject { described_class.new(:view) }
|
25
|
+
|
26
|
+
it 'applies default class with no options' do
|
27
|
+
expect(subject.options[:class]).to eq 'blacklight-icons'
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'has no aria-hidden attribute with no options' do
|
31
|
+
expect(subject.options[:'aria-hidden']).to be nil
|
32
|
+
end
|
33
|
+
end
|
20
34
|
end
|
21
35
|
|
22
36
|
describe '#path' do
|
@@ -3,7 +3,7 @@
|
|
3
3
|
RSpec.describe Blacklight::Solr::Response::Facets, api: true do
|
4
4
|
describe Blacklight::Solr::Response::Facets::FacetField do
|
5
5
|
describe "A field with default options" do
|
6
|
-
subject {
|
6
|
+
subject { described_class.new "my_field", [] }
|
7
7
|
|
8
8
|
its(:name) { is_expected.to eq "my_field" }
|
9
9
|
its(:limit) { is_expected.to eq 100 }
|
@@ -12,7 +12,7 @@ RSpec.describe Blacklight::Solr::Response::Facets, api: true do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe "A field with additional options" do
|
15
|
-
subject {
|
15
|
+
subject { described_class.new "my_field", [], limit: 15, sort: 'alpha', offset: 23 }
|
16
16
|
|
17
17
|
its(:name) { is_expected.to eq "my_field" }
|
18
18
|
its(:limit) { is_expected.to eq 15 }
|
@@ -6,9 +6,9 @@ RSpec.describe Blacklight::Solr::Response, api: true do
|
|
6
6
|
let(:config) { Blacklight::Configuration.new }
|
7
7
|
|
8
8
|
let(:r) do
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
described_class.new(raw_response,
|
10
|
+
raw_response['params'],
|
11
|
+
blacklight_config: config)
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'creates a valid response' do
|
@@ -113,13 +113,13 @@ RSpec.describe Blacklight::Solr::Response, api: true do
|
|
113
113
|
it 'provides the responseHeader params' do
|
114
114
|
raw_response = eval(mock_query_response)
|
115
115
|
raw_response['responseHeader']['params']['test'] = :test
|
116
|
-
r =
|
116
|
+
r = described_class.new(raw_response, raw_response['params'])
|
117
117
|
expect(r.params['test']).to eq :test
|
118
118
|
end
|
119
119
|
|
120
120
|
it 'provides the solr-returned params and "rows" should be 11' do
|
121
121
|
raw_response = eval(mock_query_response)
|
122
|
-
r =
|
122
|
+
r = described_class.new(raw_response, {})
|
123
123
|
expect(r.params[:rows].to_s).to eq '11'
|
124
124
|
expect(r.params[:sort]).to eq 'title_si asc, pub_date_si desc'
|
125
125
|
end
|
@@ -127,42 +127,42 @@ RSpec.describe Blacklight::Solr::Response, api: true do
|
|
127
127
|
it 'provides the ruby request params if responseHeader["params"] does not exist' do
|
128
128
|
raw_response = eval(mock_query_response)
|
129
129
|
raw_response.delete 'responseHeader'
|
130
|
-
r =
|
130
|
+
r = described_class.new(raw_response, rows: 999, sort: 'score desc, pub_date_si desc, title_si asc')
|
131
131
|
expect(r.params[:rows].to_s).to eq '999'
|
132
132
|
expect(r.params[:sort]).to eq 'score desc, pub_date_si desc, title_si asc'
|
133
133
|
end
|
134
134
|
|
135
135
|
it 'provides spelling suggestions for regular spellcheck results' do
|
136
136
|
raw_response = eval(mock_response_with_spellcheck)
|
137
|
-
r =
|
137
|
+
r = described_class.new(raw_response, {})
|
138
138
|
expect(r.spelling.words).to include("dell")
|
139
139
|
expect(r.spelling.words).to include("ultrasharp")
|
140
140
|
end
|
141
141
|
|
142
142
|
it 'provides spelling suggestions for extended spellcheck results' do
|
143
143
|
raw_response = eval(mock_response_with_spellcheck_extended)
|
144
|
-
r =
|
144
|
+
r = described_class.new(raw_response, {})
|
145
145
|
expect(r.spelling.words).to include("dell")
|
146
146
|
expect(r.spelling.words).to include("ultrasharp")
|
147
147
|
end
|
148
148
|
|
149
149
|
it 'provides no spelling suggestions when extended results and suggestion frequency is the same as original query frequency' do
|
150
150
|
raw_response = eval(mock_response_with_spellcheck_same_frequency)
|
151
|
-
r =
|
151
|
+
r = described_class.new(raw_response, {})
|
152
152
|
expect(r.spelling.words).to eq []
|
153
153
|
end
|
154
154
|
|
155
155
|
context "pre solr 5 spellcheck collation syntax" do
|
156
156
|
it 'provides spelling suggestions for a regular spellcheck results with a collation' do
|
157
157
|
raw_response = eval(mock_response_with_spellcheck_collation)
|
158
|
-
r =
|
158
|
+
r = described_class.new(raw_response, {})
|
159
159
|
expect(r.spelling.words).to include("dell")
|
160
160
|
expect(r.spelling.words).to include("ultrasharp")
|
161
161
|
end
|
162
162
|
|
163
163
|
it 'provides spelling suggestion collation' do
|
164
164
|
raw_response = eval(mock_response_with_spellcheck_collation)
|
165
|
-
r =
|
165
|
+
r = described_class.new(raw_response, {})
|
166
166
|
expect(r.spelling.collation).to eq 'dell ultrasharp'
|
167
167
|
end
|
168
168
|
end
|
@@ -170,14 +170,14 @@ RSpec.describe Blacklight::Solr::Response, api: true do
|
|
170
170
|
context "solr 5 spellcheck collation syntax" do
|
171
171
|
it 'provides spelling suggestions for a regular spellcheck results with a collation' do
|
172
172
|
raw_response = eval(mock_response_with_spellcheck_collation_solr5)
|
173
|
-
r =
|
173
|
+
r = described_class.new(raw_response, {})
|
174
174
|
expect(r.spelling.words).to include("dell")
|
175
175
|
expect(r.spelling.words).to include("ultrasharp")
|
176
176
|
end
|
177
177
|
|
178
178
|
it 'provides spelling suggestion collation' do
|
179
179
|
raw_response = eval(mock_response_with_spellcheck_collation_solr5)
|
180
|
-
r =
|
180
|
+
r = described_class.new(raw_response, {})
|
181
181
|
expect(r.spelling.collation).to eq 'dell ultrasharp'
|
182
182
|
end
|
183
183
|
end
|
@@ -185,7 +185,7 @@ RSpec.describe Blacklight::Solr::Response, api: true do
|
|
185
185
|
context 'solr 6.5 spellcheck collation syntax' do
|
186
186
|
it 'provides spelling suggestions for a regular spellcheck results with a collation' do
|
187
187
|
raw_response = eval(mock_response_with_spellcheck_collation_solr65)
|
188
|
-
r =
|
188
|
+
r = described_class.new(raw_response, {})
|
189
189
|
expect(r.spelling.words).to include("dell")
|
190
190
|
expect(r.spelling.words).to include("ultrasharp")
|
191
191
|
end
|
@@ -193,19 +193,19 @@ RSpec.describe Blacklight::Solr::Response, api: true do
|
|
193
193
|
|
194
194
|
it "provides MoreLikeThis suggestions" do
|
195
195
|
raw_response = eval(mock_response_with_more_like_this)
|
196
|
-
r =
|
196
|
+
r = described_class.new(raw_response, {})
|
197
197
|
expect(r.more_like(double(id: '79930185'))).to have(2).items
|
198
198
|
end
|
199
199
|
|
200
200
|
it "is empty when the response has no results" do
|
201
|
-
r =
|
201
|
+
r = described_class.new({}, {})
|
202
202
|
allow(r).to receive_messages(total: 0)
|
203
203
|
expect(r).to be_empty
|
204
204
|
end
|
205
205
|
|
206
206
|
describe "#export_formats" do
|
207
207
|
it "collects the unique export formats for the current response" do
|
208
|
-
r =
|
208
|
+
r = described_class.new({}, {})
|
209
209
|
allow(r).to receive_messages(documents: [double(export_formats: { a: 1, b: 2 }), double(export_formats: { b: 1, c: 2 })])
|
210
210
|
expect(r.export_formats).to include :a, :b
|
211
211
|
end
|
@@ -43,7 +43,7 @@ RSpec.describe Blacklight::Suggest::Response, api: true do
|
|
43
43
|
|
44
44
|
describe '#initialize' do
|
45
45
|
it 'creates a Blacklight::Suggest::Response' do
|
46
|
-
expect(empty_response).to be_an
|
46
|
+
expect(empty_response).to be_an described_class
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
RSpec.describe SolrDocument, api: true do
|
4
4
|
describe "access methods" do
|
5
5
|
let(:solrdoc) do
|
6
|
-
|
6
|
+
described_class.new(id: '00282214', format: ['Book'], title_tsim: 'some-title')
|
7
7
|
end
|
8
8
|
|
9
9
|
describe "#[]" do
|
data/spec/spec_helper.rb
CHANGED
@@ -22,19 +22,9 @@ require 'rspec/collection_matchers'
|
|
22
22
|
require 'capybara/rspec'
|
23
23
|
require 'selenium-webdriver'
|
24
24
|
require 'equivalent-xml'
|
25
|
-
require '
|
25
|
+
require 'webdrivers'
|
26
26
|
|
27
|
-
Capybara.javascript_driver = :
|
28
|
-
|
29
|
-
Capybara.register_driver :headless_chrome do |app|
|
30
|
-
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
|
31
|
-
chromeOptions: { args: %w[headless disable-gpu no-sandbox] }
|
32
|
-
)
|
33
|
-
|
34
|
-
Capybara::Selenium::Driver.new(app,
|
35
|
-
browser: :chrome,
|
36
|
-
desired_capabilities: capabilities)
|
37
|
-
end
|
27
|
+
Capybara.javascript_driver = :selenium_chrome_headless
|
38
28
|
|
39
29
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
40
30
|
# in spec/support/ and its subdirectories.
|
@@ -28,13 +28,13 @@ RSpec.describe "catalog/facet_layout" do
|
|
28
28
|
it "is collapsable" do
|
29
29
|
render partial: 'catalog/facet_layout', locals: { facet_field: facet_field }
|
30
30
|
expect(rendered).to have_selector '.card-header.collapsed'
|
31
|
-
expect(rendered).to have_selector '.collapse.card-body'
|
31
|
+
expect(rendered).to have_selector '.collapse .card-body'
|
32
32
|
end
|
33
33
|
|
34
34
|
it "is configured to be open by default" do
|
35
35
|
allow(facet_field).to receive_messages(collapse: false)
|
36
36
|
render partial: 'catalog/facet_layout', locals: { facet_field: facet_field }
|
37
37
|
expect(rendered).not_to have_selector '.card-header.collapsed'
|
38
|
-
expect(rendered).to have_selector '.show.card-body'
|
38
|
+
expect(rendered).to have_selector '.show .card-body'
|
39
39
|
end
|
40
40
|
end
|
@@ -17,9 +17,9 @@ RSpec.describe "/catalog/_show_sidebar.html.erb" do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "shows more-like-this titles in the sidebar" do
|
20
|
-
|
21
|
-
allow(
|
22
|
-
render
|
20
|
+
document = SolrDocument.new id: 1, title_s: 'abc', format: 'default'
|
21
|
+
allow(document).to receive(:more_like_this).and_return([SolrDocument.new('id' => '2', 'title_tsim' => 'Title of MLT Document')])
|
22
|
+
render 'catalog/show_sidebar', document: document
|
23
23
|
expect(rendered).to include("More Like This")
|
24
24
|
expect(rendered).to include("Title of MLT Document")
|
25
25
|
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.1.0
|
4
|
+
version: 7.1.0
|
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-
|
20
|
+
date: 2019-09-12 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -180,19 +180,19 @@ dependencies:
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '3'
|
182
182
|
- !ruby/object:Gem::Dependency
|
183
|
-
name:
|
183
|
+
name: webdrivers
|
184
184
|
requirement: !ruby/object:Gem::Requirement
|
185
185
|
requirements:
|
186
186
|
- - "~>"
|
187
187
|
- !ruby/object:Gem::Version
|
188
|
-
version: '
|
188
|
+
version: '3.0'
|
189
189
|
type: :development
|
190
190
|
prerelease: false
|
191
191
|
version_requirements: !ruby/object:Gem::Requirement
|
192
192
|
requirements:
|
193
193
|
- - "~>"
|
194
194
|
- !ruby/object:Gem::Version
|
195
|
-
version: '
|
195
|
+
version: '3.0'
|
196
196
|
- !ruby/object:Gem::Dependency
|
197
197
|
name: selenium-webdriver
|
198
198
|
requirement: !ruby/object:Gem::Requirement
|
@@ -312,6 +312,7 @@ files:
|
|
312
312
|
- ".solr_wrapper.yml"
|
313
313
|
- ".travis.yml"
|
314
314
|
- ".yardopts"
|
315
|
+
- CONTRIBUTING.md
|
315
316
|
- Gemfile
|
316
317
|
- LICENSE
|
317
318
|
- README.md
|
@@ -739,12 +740,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
739
740
|
version: '2.1'
|
740
741
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
741
742
|
requirements:
|
742
|
-
- - "
|
743
|
+
- - ">="
|
743
744
|
- !ruby/object:Gem::Version
|
744
|
-
version:
|
745
|
+
version: '0'
|
745
746
|
requirements: []
|
746
|
-
|
747
|
-
rubygems_version: 2.7.6
|
747
|
+
rubygems_version: 3.0.3
|
748
748
|
signing_key:
|
749
749
|
specification_version: 4
|
750
750
|
summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
|