blacklight-gallery 3.4.0 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c352955a6ff3422f81258dd566cfe58114da0c93f65241e70ae093ee3a76dfb
4
- data.tar.gz: 58707632ea6223e59985771c6cb79f5cfa3a2e410e44cb5f02a631ed24f2c7be
3
+ metadata.gz: c6cef93b47ca74eb2e2cf9083baafce7e28948cc568b1146dd30f98a842720f6
4
+ data.tar.gz: 890631e78d834ac011666bb1b652ef97f9948b12352a4085c421b4e6f7aec6f7
5
5
  SHA512:
6
- metadata.gz: b3220d3e51e3a178532a61678631b3d4dba3b0d38042a0bc4b9a62e447daefce4afa3833b4d2d0cce41442088af8004b4791e1e54e2bd42f2dfdfdfa600a7c51
7
- data.tar.gz: dda77c2f7e9e80bb37e4783b6559e53cc0acaa6a403e3b17f66fc8a5db3501f01cc2c9f3844747809bf54f1f8e37648b3099102a428e6d169cd30045090f2b15
6
+ metadata.gz: 79942d8ad4a805a6020fc30e96e26fc392ea38b51dbab5868379a2744fd6ee798fd1b75f9c71f744678456deb165e3510e31820ff24f5c2eb7e21c9343be3c7f
7
+ data.tar.gz: 136ddeb750ddafe01d690265d734e9a183ffefebd896a024e893ae4fd8ab41762c5558fc72a4a88a7198358be9bc5594c69fc3de84304e7f1d2677148ecc64d0
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Blacklight::Gallery
2
- [![Gem Version](https://badge.fury.io/rb/blacklight-gallery.svg)](http://badge.fury.io/rb/blacklight-gallery) [![Build Status](https://travis-ci.org/projectblacklight/blacklight-gallery.svg?branch=master)](https://travis-ci.org/projectblacklight/blacklight-gallery)
2
+ [![Gem Version](https://badge.fury.io/rb/blacklight-gallery.svg)](http://badge.fury.io/rb/blacklight-gallery) [![CI](https://github.com/projectblacklight/blacklight-gallery/actions/workflows/ruby.yml/badge.svg)](https://github.com/projectblacklight/blacklight-gallery/actions/workflows/ruby.yml)
3
3
 
4
4
  Gallery views for Blacklight search results
5
5
 
@@ -85,10 +85,16 @@ $gray-dark: #343a40 !default;
85
85
 
86
86
  .caption {
87
87
  font-size: 1rem;
88
- color: $gray-light;
89
88
  margin: 10px auto;
90
89
  min-width: 200px;
91
90
  max-width: 50%;
91
+ a {
92
+ color: $gray-light;
93
+ text-decoration: underline;
94
+ &:hover, &:focus {
95
+ color: #ffffff;
96
+ }
97
+ }
92
98
  }
93
99
 
94
100
  .counter {
@@ -2,7 +2,7 @@
2
2
  <div class="frame">
3
3
  <%= slideshow_tag %>
4
4
  <div class="caption">
5
- <%= presenter.heading %>
5
+ <%= helpers.link_to_document(presenter.document, presenter.heading, counter: @counter) %>
6
6
  </div>
7
7
 
8
8
  <span class="counter">
@@ -20,11 +20,11 @@ module Blacklight
20
20
  method_name = view_config.slideshow_method
21
21
  @view_context.send(method_name, @document, image_options)
22
22
  elsif view_config.slideshow_field
23
- url = slideshow_image_url
24
-
25
- image_tag url, image_options if url.present?
23
+ return if slideshow_image_url.blank?
24
+ image = image_tag slideshow_image_url, image_options
25
+ helpers.link_to_document(@document, image)
26
26
  elsif presenter.thumbnail.exists?
27
- presenter.thumbnail.thumbnail_tag(image_options, url_options.reverse_merge(suppress_link: true))
27
+ presenter.thumbnail.thumbnail_tag(image_options)
28
28
  end
29
29
  end
30
30
 
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Gallery
3
- VERSION = "3.4.0"
3
+ VERSION = "3.5.0"
4
4
  end
5
5
  end
@@ -15,20 +15,30 @@ RSpec.describe Blacklight::Gallery::SlideshowComponent, type: :component do
15
15
  Capybara::Node::Simple.new(render)
16
16
  end
17
17
 
18
- let(:blacklight_config) { Blacklight::Configuration.new }
18
+ let(:document) do
19
+ SolrDocument.new(
20
+ id: 'x',
21
+ )
22
+ end
23
+
19
24
  let(:presenter) { Blacklight::IndexPresenter.new(document, view_context, blacklight_config) }
20
25
 
21
26
  before do
27
+ allow(view_context).to receive(:current_search_session).and_return(nil)
28
+ allow(view_context).to receive(:search_session).and_return({})
22
29
  allow(view_context).to receive(:blacklight_config).and_return(blacklight_config)
23
30
  end
24
31
 
25
32
  describe '#slideshow_tag' do
26
33
  subject { rendered }
27
34
 
28
- let(:document) { SolrDocument.new({}) }
29
-
30
35
  context 'with a slideshow method' do
31
- let(:blacklight_config) { Blacklight::Configuration.new.tap { |config| config.index.slideshow_method = :xyz } }
36
+ let(:blacklight_config) do
37
+ Blacklight::Configuration.new.tap do |config|
38
+ config.index.slideshow_method = :xyz
39
+ config.track_search_session = false
40
+ end
41
+ end
32
42
 
33
43
  it 'calls the provided slideshow method' do
34
44
  expect(view_context).to receive_messages(xyz: 'some-slideshow')
@@ -41,26 +51,39 @@ RSpec.describe Blacklight::Gallery::SlideshowComponent, type: :component do
41
51
  end
42
52
  end
43
53
 
44
- context 'with a field' do
45
- let(:blacklight_config) { Blacklight::Configuration.new.tap { |config| config.index.slideshow_field = :xyz } }
46
- let(:document) { SolrDocument.new({ xyz: 'http://example.com/some.jpg' }) }
54
+ context 'with a slideshow field' do
55
+ let(:blacklight_config) do
56
+ Blacklight::Configuration.new.tap do |config|
57
+ config.index.slideshow_field = :xyz
58
+ config.track_search_session = false
59
+ end
60
+ end
61
+ let(:document) { SolrDocument.new({ xyz: 'http://example.com/some.jpg', id: 'x' }) }
47
62
 
48
63
  it { is_expected.to have_selector 'img[src="http://example.com/some.jpg"]' }
49
64
 
50
65
  context 'without data in the field' do
51
- let(:document) { SolrDocument.new({}) }
66
+ let(:document) { SolrDocument.new({id: 'x'}) }
52
67
 
53
68
  it { is_expected.not_to have_selector 'img' }
54
69
  end
55
70
  end
56
71
 
57
- context 'with nothing configured' do
72
+ context 'with no view_config' do
73
+ let(:blacklight_config) { Blacklight::Configuration.new.tap { |config|
74
+ config.track_search_session = false
75
+ } }
58
76
  it { is_expected.not_to have_selector 'img' }
59
77
  end
60
78
 
61
79
  context 'falling back to a thumbnail' do
62
- let(:blacklight_config) { Blacklight::Configuration.new.tap { |config| config.index.thumbnail_field = :xyz } }
63
- let(:document) { SolrDocument.new({ xyz: 'http://example.com/thumb.jpg' }) }
80
+ let(:blacklight_config) do
81
+ Blacklight::Configuration.new.tap do |config|
82
+ config.index.thumbnail_field = :xyz
83
+ config.track_search_session = false
84
+ end
85
+ end
86
+ let(:document) { SolrDocument.new({ xyz: 'http://example.com/thumb.jpg', id: 'x' }) }
64
87
 
65
88
  it { is_expected.to have_selector 'img[src="http://example.com/thumb.jpg"]' }
66
89
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-gallery
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-04 00:00:00.000000000 Z
11
+ date: 2022-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails