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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9494eb9f9c98dc35a06a369d93d30095cb05718427599f49c2179c3ab0d44456
4
- data.tar.gz: fafdd89b5d4bf169f303e2673a7369b32b14894dfb983405cb37f556dcab1a3b
3
+ metadata.gz: b85d437eb826605fb701c8c18e4263528b67f4c881a43288e46b8f46ad48881b
4
+ data.tar.gz: daa54afe4a032f8ab13348850decaa8340dca486f993b3b508943e00103225c4
5
5
  SHA512:
6
- metadata.gz: 5011b8be264ee25f7b701e77e0e099add0f382d7f95e85123e53a6f2b215fe867b4bc5fdbb0ff02845c125fe0d89674f83750bb044650acdad103d6eb4fcb1ac
7
- data.tar.gz: c772cdf8efef43a8c86c81b7ff445f5a7a6a7ab6ebdb8d6d2bac4654a558528522e6e76eec8e330996288f2e0d991fb531fb7852ded86c4bd8f0f69f0db53563
6
+ metadata.gz: caab714113f5900e604ee045cbea1c28410d4c099ef340a4bc2c97f1f36806861eea82ab5d5b85cbe4f686dc796282fe678d1886f2d090d44825797a1da759be
7
+ data.tar.gz: 7446370ad47268865a69220be2b5c43120781666500c9bd97dff7e368718faad227a02ac542a6441a53c99f6f9f72242cc142918431af9e1b6e480eaa5f6e943
@@ -217,7 +217,7 @@ Metrics/MethodLength:
217
217
  # Offense count: 8
218
218
  # Configuration parameters: CountComments.
219
219
  Metrics/ModuleLength:
220
- Max: 210
220
+ Max: 212
221
221
 
222
222
  # Offense count: 1
223
223
  # Configuration parameters: CountKeywordArgs.
@@ -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.7"
20
+ env: "RAILS_VERSION=5.2.4.1"
21
21
  - rvm: jruby-9.2.8.0
22
- env: "RAILS_VERSION=5.1.7 JRUBY_OPTS=\"-J-Xms512m -J-Xmx1024m\""
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.0
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: 'image')
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-labelled-by'] = unique_id if label
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
@@ -89,7 +89,7 @@ module Blacklight
89
89
  len = args.length
90
90
 
91
91
  if len.zero?
92
- new_ostruct_member(mid)
92
+ new_ostruct_member!(mid)
93
93
  @table[mid]
94
94
  else
95
95
  super
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blacklight-frontend",
3
- "version": "7.5.0",
3
+ "version": "7.5.1",
4
4
  "description": "[![Build Status](https://travis-ci.org/projectblacklight/blacklight.png?branch=master)](https://travis-ci.org/projectblacklight/blacklight) [![Gem Version](https://badge.fury.io/rb/blacklight.png)](http://badge.fury.io/rb/blacklight) [![Coverage Status](https://coveralls.io/repos/github/projectblacklight/blacklight/badge.svg?branch=master)](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="image"' do
14
+ it 'adds role="img"' do
15
15
  expect(Capybara.string(subject.svg))
16
- .to have_css 'svg[role="image"]'
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-labelled-by' do
22
+ it 'adds aria-labelledby' do
23
23
  expect(Capybara.string(subject.svg))
24
- .to have_css 'svg[aria-labelled-by^="bl-icon-search-"]'
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-labelled-by' do
33
+ it 'does not add aria-labelledby' do
34
34
  expect(Capybara.string(subject.svg))
35
- .not_to have_css 'svg[aria-labelled-by^="bl-icon-search-"]'
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.0
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: 2019-12-18 00:00:00.000000000 Z
20
+ date: 2020-01-30 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails