blacklight-gallery 3.4.0 → 3.5.0
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/README.md +1 -1
- data/app/assets/stylesheets/blacklight_gallery/_slideshow.scss +7 -1
- data/app/components/blacklight/gallery/slideshow_component.html.erb +1 -1
- data/app/components/blacklight/gallery/slideshow_component.rb +4 -4
- data/lib/blacklight/gallery/version.rb +1 -1
- data/spec/components/blacklight/gallery/slideshow_component_spec.rb +34 -11
- 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: c6cef93b47ca74eb2e2cf9083baafce7e28948cc568b1146dd30f98a842720f6
|
4
|
+
data.tar.gz: 890631e78d834ac011666bb1b652ef97f9948b12352a4085c421b4e6f7aec6f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79942d8ad4a805a6020fc30e96e26fc392ea38b51dbab5868379a2744fd6ee798fd1b75f9c71f744678456deb165e3510e31820ff24f5c2eb7e21c9343be3c7f
|
7
|
+
data.tar.gz: 136ddeb750ddafe01d690265d734e9a183ffefebd896a024e893ae4fd8ab41762c5558fc72a4a88a7198358be9bc5594c69fc3de84304e7f1d2677148ecc64d0
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Blacklight::Gallery
|
2
|
-
[](http://badge.fury.io/rb/blacklight-gallery)
|
2
|
+
[](http://badge.fury.io/rb/blacklight-gallery) [](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 {
|
@@ -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
|
-
|
24
|
-
|
25
|
-
|
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
|
27
|
+
presenter.thumbnail.thumbnail_tag(image_options)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -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(:
|
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)
|
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)
|
46
|
-
|
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
|
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)
|
63
|
-
|
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
|
+
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-
|
11
|
+
date: 2022-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|