blacklight 7.5.0 → 7.5.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/.rubocop_todo.yml +1 -1
- data/.travis.yml +4 -4
- data/VERSION +1 -1
- data/app/controllers/concerns/blacklight/catalog.rb +4 -1
- data/app/models/blacklight/icon.rb +2 -2
- data/lib/blacklight/nested_open_struct_with_hash_access.rb +1 -1
- data/package.json +1 -1
- data/spec/controllers/catalog_controller_spec.rb +13 -1
- data/spec/models/blacklight/icon_spec.rb +6 -6
- 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: b85d437eb826605fb701c8c18e4263528b67f4c881a43288e46b8f46ad48881b
|
4
|
+
data.tar.gz: daa54afe4a032f8ab13348850decaa8340dca486f993b3b508943e00103225c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caab714113f5900e604ee045cbea1c28410d4c099ef340a4bc2c97f1f36806861eea82ab5d5b85cbe4f686dc796282fe678d1886f2d090d44825797a1da759be
|
7
|
+
data.tar.gz: 7446370ad47268865a69220be2b5c43120781666500c9bd97dff7e368718faad227a02ac542a6441a53c99f6f9f72242cc142918431af9e1b6e480eaa5f6e943
|
data/.rubocop_todo.yml
CHANGED
data/.travis.yml
CHANGED
@@ -8,18 +8,18 @@ notifications:
|
|
8
8
|
|
9
9
|
matrix:
|
10
10
|
include:
|
11
|
+
- rvm: 2.7.0
|
12
|
+
env: "RAILS_VERSION=6.0.2.1"
|
11
13
|
- rvm: 2.6.5
|
12
14
|
env: "RAILS_VERSION=6.0.0 ENGINE_CART_RAILS_OPTIONS=\"--skip-webpack-install\""
|
13
15
|
- rvm: 2.6.5
|
14
16
|
env: "RAILS_VERSION=5.2.3"
|
15
|
-
- rvm: 2.5.7
|
16
|
-
env: "RAILS_VERSION=5.1.7"
|
17
17
|
- rvm: 2.5.7
|
18
18
|
env: "RAILS_VERSION=5.2.3 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.9
|
20
|
-
env: "RAILS_VERSION=5.1
|
20
|
+
env: "RAILS_VERSION=5.2.4.1"
|
21
21
|
- rvm: jruby-9.2.8.0
|
22
|
-
env: "RAILS_VERSION=5.1
|
22
|
+
env: "RAILS_VERSION=5.2.4.1 JRUBY_OPTS=\"-J-Xms512m -J-Xmx1024m\""
|
23
23
|
allow_failures:
|
24
24
|
- rvm: jruby-9.2.8.0
|
25
25
|
fast_finish: true
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.5.
|
1
|
+
7.5.1
|
@@ -114,7 +114,10 @@ module Blacklight::Catalog
|
|
114
114
|
# @return [Array] first value is a Blacklight::Solr::Response and the second
|
115
115
|
# is a list of documents
|
116
116
|
def action_documents
|
117
|
-
search_service.fetch(Array(params[:id]))
|
117
|
+
deprecated_response, @documents = search_service.fetch(Array(params[:id]))
|
118
|
+
raise Blacklight::Exceptions::RecordNotFound if @documents.blank?
|
119
|
+
|
120
|
+
[deprecated_response, @documents]
|
118
121
|
end
|
119
122
|
|
120
123
|
def action_success_redirect_path
|
@@ -10,7 +10,7 @@ module Blacklight
|
|
10
10
|
# @param [Boolean] aria_hidden include aria_hidden attribute
|
11
11
|
# @param [Boolean] label include <title> and aria-label as part of svg
|
12
12
|
# @param [String] role role attribute to be included in svg
|
13
|
-
def initialize(icon_name, classes: '', aria_hidden: false, label: true, role: '
|
13
|
+
def initialize(icon_name, classes: '', aria_hidden: false, label: true, role: 'img')
|
14
14
|
@icon_name = icon_name
|
15
15
|
@classes = classes
|
16
16
|
@aria_hidden = aria_hidden
|
@@ -24,7 +24,7 @@ module Blacklight
|
|
24
24
|
def svg
|
25
25
|
svg = ng_xml.at_xpath('svg')
|
26
26
|
svg['role'] = role
|
27
|
-
svg['aria-
|
27
|
+
svg['aria-labelledby'] = unique_id if label
|
28
28
|
svg.add_child("<title id='#{unique_id}'>#{icon_label}</title>") if label
|
29
29
|
ng_xml.to_xml
|
30
30
|
end
|
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "blacklight-frontend",
|
3
|
-
"version": "7.5.
|
3
|
+
"version": "7.5.1",
|
4
4
|
"description": "[](https://travis-ci.org/projectblacklight/blacklight) [](http://badge.fury.io/rb/blacklight) [](https://coveralls.io/github/projectblacklight/blacklight?branch=master)",
|
5
5
|
"main": "app/assets/javascripts/blacklight",
|
6
6
|
"scripts": {
|
@@ -468,8 +468,13 @@ RSpec.describe CatalogController, api: true do
|
|
468
468
|
let(:mock_response) { instance_double(Blacklight::Solr::Response, documents: [SolrDocument.new(id: 'my_fake_doc'), SolrDocument.new(id: 'my_other_doc')]) }
|
469
469
|
|
470
470
|
before do
|
471
|
+
mock_document.extend(Blacklight::Document::Sms)
|
472
|
+
mock_document.extend(Blacklight::Document::Email)
|
473
|
+
allow(mock_document).to receive(:to_semantic_values).and_return({})
|
474
|
+
allow(mock_document).to receive(:to_model).and_return(SolrDocument.new(id: 'my_fake_doc'))
|
475
|
+
|
471
476
|
allow(controller).to receive(:search_service).and_return(search_service)
|
472
|
-
expect(search_service).to receive(:fetch).and_return([mock_response, []])
|
477
|
+
expect(search_service).to receive(:fetch).and_return([mock_response, [mock_document]])
|
473
478
|
request.env["HTTP_REFERER"] = "/catalog/#{doc_id}"
|
474
479
|
SolrDocument.use_extension(Blacklight::Document::Email)
|
475
480
|
SolrDocument.use_extension(Blacklight::Document::Sms)
|
@@ -553,6 +558,13 @@ RSpec.describe CatalogController, api: true do
|
|
553
558
|
end.to raise_error Blacklight::Exceptions::RecordNotFound
|
554
559
|
end
|
555
560
|
|
561
|
+
it "returns status 404 for exportable actions on records that do not exist" do
|
562
|
+
allow(controller).to receive_messages(find: double(documents: []))
|
563
|
+
expect do
|
564
|
+
get :citation, params: { id: "bad-record-identifer" }
|
565
|
+
end.to raise_error Blacklight::Exceptions::RecordNotFound
|
566
|
+
end
|
567
|
+
|
556
568
|
context "when there is an invalid search", api: false do
|
557
569
|
let(:service) { instance_double(Blacklight::SearchService) }
|
558
570
|
let(:fake_error) { Blacklight::Exceptions::InvalidRequest.new }
|
@@ -11,17 +11,17 @@ RSpec.describe Blacklight::Icon do
|
|
11
11
|
expect(Capybara.string(subject.svg))
|
12
12
|
.to have_css 'svg[width="24"]'
|
13
13
|
end
|
14
|
-
it 'adds role="
|
14
|
+
it 'adds role="img"' do
|
15
15
|
expect(Capybara.string(subject.svg))
|
16
|
-
.to have_css 'svg[role="
|
16
|
+
.to have_css 'svg[role="img"]'
|
17
17
|
end
|
18
18
|
it 'adds title' do
|
19
19
|
expect(Capybara.string(subject.svg))
|
20
20
|
.to have_css 'title[id^="bl-icon-search-"]', text: 'search icon'
|
21
21
|
end
|
22
|
-
it 'adds aria-
|
22
|
+
it 'adds aria-labelledby' do
|
23
23
|
expect(Capybara.string(subject.svg))
|
24
|
-
.to have_css 'svg[aria-
|
24
|
+
.to have_css 'svg[aria-labelledby^="bl-icon-search-"]'
|
25
25
|
end
|
26
26
|
context 'when label is false' do
|
27
27
|
subject { described_class.new(:search, classes: 'awesome', aria_hidden: true, label: false) }
|
@@ -30,9 +30,9 @@ RSpec.describe Blacklight::Icon do
|
|
30
30
|
expect(Capybara.string(subject.svg))
|
31
31
|
.not_to have_css 'title', text: 'search icon'
|
32
32
|
end
|
33
|
-
it 'does not add aria-
|
33
|
+
it 'does not add aria-labelledby' do
|
34
34
|
expect(Capybara.string(subject.svg))
|
35
|
-
.not_to have_css 'svg[aria-
|
35
|
+
.not_to have_css 'svg[aria-labelledby^="bl-icon-search-"]'
|
36
36
|
end
|
37
37
|
end
|
38
38
|
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.5.
|
4
|
+
version: 7.5.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: 2020-01-30 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|