geoblacklight_sidecar_images 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/geoblacklight_sidecar_images/modules/_results.scss +1 -0
- data/app/services/geoblacklight_sidecar_images/image_service.rb +7 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/views/catalog/_index_split_default.html.erb +1 -1
- data/lib/geoblacklight_sidecar_images/version.rb +1 -1
- data/spec/fixtures/files/b1g_thumbnail.json +42 -0
- data/spec/services/image_service_spec.rb +7 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e89b436bb5ef1c4905c614eb923397f8837fe7169095e5ec784c8631cfe04e1
|
4
|
+
data.tar.gz: 18b958b4b4b274ae213281220f00f8557ccc2249807799d467a09fdce33e1986
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bda9efbc7d361c8c171ff39179f63f8b7046d4aff1892c38a58d92a4cede4c6314838778a07a179809ce7c223a4996b910ba48446f6d6405e012dc3332ed9b99
|
7
|
+
data.tar.gz: 8b0a0b1a0e2a6a6de19b441e192656f0a224505b19f5130f998668084b3698476afbec31b55320609adca7ef16b3967f0a63a7f6b9b7dcebebcd7cb22b4b743a
|
@@ -180,11 +180,18 @@ module GeoblacklightSidecarImages
|
|
180
180
|
# from the viewer protocol, and if it's loaded, the image_url
|
181
181
|
# method is called.
|
182
182
|
def service_url
|
183
|
+
|
184
|
+
# Follow image_url instead
|
185
|
+
if gblsi_thumbnail_uri
|
186
|
+
return nil
|
187
|
+
end
|
188
|
+
|
183
189
|
@service_url ||=
|
184
190
|
begin
|
185
191
|
return unless @document.available?
|
186
192
|
|
187
193
|
protocol = @document.viewer_protocol
|
194
|
+
|
188
195
|
if protocol == 'map' || protocol.nil?
|
189
196
|
@metadata['error'] = 'Unsupported viewer protocol'
|
190
197
|
@metadata['placeheld'] = true
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<div class='media'>
|
16
16
|
<% if document.sidecar.image.attached? %>
|
17
17
|
<% if document.sidecar.image.variable? %>
|
18
|
-
<%= image_tag document.sidecar.image.variant(resize: "
|
18
|
+
<%= image_tag document.sidecar.image.variant(resize: "200"), {class: 'mr-3'} %>
|
19
19
|
<% else %>
|
20
20
|
<%= image_tag document.sidecar.image, {class: 'mr-3'} %>
|
21
21
|
<% end %>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"geoblacklight_version": "1.0",
|
3
|
+
"dc_description_s": "The Illinois Environmental Protection Agency's collection of geospatial resources on their Open Data Geoportal include vehicle emissions testing locations and waste disposal sites.",
|
4
|
+
"layer_modified_dt": "2019-08-29T16:54:48Z",
|
5
|
+
"solr_geom": "ENVELOPE(-91.51308, -87.49520, 42.50848, 36.97030)",
|
6
|
+
"dct_references_s": "{\"http://schema.org/url\":\"https://illinoisepaopendata-illinois-epa.opendata.arcgis.com\"}",
|
7
|
+
"dc_rights_s": "Public",
|
8
|
+
"b1g_centroid_ss": "39.73939,-89.50414",
|
9
|
+
"layer_geom_type_s": "Table",
|
10
|
+
"b1g_status_s": "Active",
|
11
|
+
"dct_provenance_s": "Illinois",
|
12
|
+
"dc_subject_sm": [
|
13
|
+
"State agencies geospatial data"
|
14
|
+
],
|
15
|
+
"dct_temporal_sm": [
|
16
|
+
"2015-2018"
|
17
|
+
],
|
18
|
+
"b1g_code_s": "02a-02",
|
19
|
+
"b1g_genre_sm": [
|
20
|
+
"Geospatial data"
|
21
|
+
],
|
22
|
+
"b1g_keyword_sm": [
|
23
|
+
"Environment,Health,Transportation,Location"
|
24
|
+
],
|
25
|
+
"dc_creator_sm": [
|
26
|
+
"Illinois Environmental Protection Agency"
|
27
|
+
],
|
28
|
+
"dc_identifier_s": "02a-02",
|
29
|
+
"solr_year_i": 2015,
|
30
|
+
"thumbnail_path_ss": "https://www2.illinois.gov/epa/Style%20Library/SOISierra/Images/SiteLogo.png",
|
31
|
+
"dct_spatial_sm": [
|
32
|
+
"Illinois"
|
33
|
+
],
|
34
|
+
"dc_publisher_sm": [
|
35
|
+
"State of Illinois"
|
36
|
+
],
|
37
|
+
"dc_type_sm": [
|
38
|
+
"Collection"
|
39
|
+
],
|
40
|
+
"dc_title_s": "Illinois EPA Open Data",
|
41
|
+
"layer_slug_s": "02a-02"
|
42
|
+
}
|
@@ -9,6 +9,8 @@ describe GeoblacklightSidecarImages::ImageService do
|
|
9
9
|
let(:wms_imgsvc) { described_class.new(wms_document) }
|
10
10
|
let(:thumb_document) { SolrDocument.new(json_data('umn_solr_thumb')) }
|
11
11
|
let(:thumb_imgsvc) { described_class.new(thumb_document) }
|
12
|
+
let(:map_document) { SolrDocument.new(json_data('b1g_thumbnail')) }
|
13
|
+
let(:map_imgsvc) { described_class.new(map_document) }
|
12
14
|
|
13
15
|
# @TODO: bdcbcd3e-f6db-4ee4-b7b7-d75fe35f1d92 - Michigan State - thumbnail_path_ss
|
14
16
|
|
@@ -32,6 +34,11 @@ describe GeoblacklightSidecarImages::ImageService do
|
|
32
34
|
it 'returns references without a settings thumbnail field value' do
|
33
35
|
expect(wms_imgsvc.send(:image_url)).to include 'wms'
|
34
36
|
end
|
37
|
+
|
38
|
+
it 'returns image_url over service_url when settings thumbnail field' do
|
39
|
+
expect(map_imgsvc.send(:image_url)).to include 'illinois'
|
40
|
+
expect(map_imgsvc.send(:service_url)).to be_falsey
|
41
|
+
end
|
35
42
|
end
|
36
43
|
|
37
44
|
context 'when #iiif' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geoblacklight_sidecar_images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Larson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-10-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: geoblacklight
|
@@ -316,6 +316,7 @@ files:
|
|
316
316
|
- spec/fixtures/files/actual-point1.json
|
317
317
|
- spec/fixtures/files/actual-polygon1.json
|
318
318
|
- spec/fixtures/files/actual-raster1.json
|
319
|
+
- spec/fixtures/files/b1g_thumbnail.json
|
319
320
|
- spec/fixtures/files/baruch_ancestor1.json
|
320
321
|
- spec/fixtures/files/baruch_ancestor2.json
|
321
322
|
- spec/fixtures/files/baruch_documentation_download.json
|
@@ -389,6 +390,7 @@ test_files:
|
|
389
390
|
- spec/fixtures/files/actual-point1.json
|
390
391
|
- spec/fixtures/files/actual-polygon1.json
|
391
392
|
- spec/fixtures/files/actual-raster1.json
|
393
|
+
- spec/fixtures/files/b1g_thumbnail.json
|
392
394
|
- spec/fixtures/files/baruch_ancestor1.json
|
393
395
|
- spec/fixtures/files/baruch_ancestor2.json
|
394
396
|
- spec/fixtures/files/baruch_documentation_download.json
|