geoblacklight 2.2.1 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +140 -97
- data/.rubocop_todo.yml +0 -13
- data/Gemfile +3 -8
- data/app/assets/javascripts/geoblacklight/basemaps.js +18 -0
- data/app/assets/javascripts/geoblacklight/modules/results.js +4 -2
- data/app/assets/stylesheets/geoblacklight/_blacklight_overrides.scss +1 -1
- data/app/models/concerns/geoblacklight/solr_document.rb +1 -1
- data/app/views/shared/_header_navbar.html.erb +1 -1
- data/geoblacklight.gemspec +2 -2
- data/lib/generators/geoblacklight/install_generator.rb +5 -0
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +2 -0
- data/lib/generators/geoblacklight/webpacker_generator.rb +1 -1
- data/lib/geoblacklight/download.rb +4 -4
- data/lib/geoblacklight/metadata/base.rb +2 -2
- data/lib/geoblacklight/version.rb +1 -1
- data/lib/geoblacklight/wms_layer.rb +2 -2
- data/solr/conf/schema.xml +5 -5
- data/spec/controllers/download_controller_spec.rb +1 -1
- data/spec/controllers/wms_controller_spec.rb +1 -1
- data/spec/features/configurable_basemap_spec.rb +9 -0
- data/spec/features/esri_viewer_spec.rb +0 -1
- data/spec/features/missing_metadata_spec.rb +12 -0
- data/spec/features/split_view.html.erb_spec.rb +1 -1
- data/spec/fixtures/solr_documents/metadata_no_dct_provenance_s.json +30 -0
- data/spec/fixtures/solr_documents/metadata_no_layer_geom_type_s.json +17 -0
- data/spec/fixtures/solr_documents/metadata_no_solr_geom.json +23 -0
- data/spec/lib/geoblacklight/download_spec.rb +2 -2
- data/spec/lib/geoblacklight/metadata/base_spec.rb +3 -3
- data/spec/lib/geoblacklight/wms_layer_spec.rb +2 -2
- data/spec/test_app_templates/Gemfile.extra +1 -0
- metadata +19 -12
- data/app/assets/images/blacklight/logo.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f61832ee1c73971aba39a0274862bfcb02da7bb159e3b442ae4d510a617a6fd8
|
4
|
+
data.tar.gz: 21611d0326e071ac549f546668f474b9889eef2611f3a58976efe18b82401d24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c053aa4af51bbf0a1ed10e34b4937cc66d4659296eada0dec44a2a69e087d5391d23de1a31593abed3b06ea71cc028c167cb454f8063c4dc73f99fb20155a01
|
7
|
+
data.tar.gz: 29afb9d926d461f10fde92c864511e83ccaf6a1bdc505c0cfe1144c6981c0ee2e312db1576731599000cb917104a9613aadc564e7093591fefa4e96f270c3ecb
|
data/.circleci/config.yml
CHANGED
@@ -1,21 +1,32 @@
|
|
1
1
|
---
|
2
|
-
version: 2
|
2
|
+
version: 2.1
|
3
3
|
jobs:
|
4
|
-
|
4
|
+
build:
|
5
5
|
working_directory: ~/geoblacklight
|
6
|
+
parameters:
|
7
|
+
ruby_version:
|
8
|
+
type: string
|
9
|
+
default: '2.5.7'
|
10
|
+
solr_port:
|
11
|
+
type: string
|
12
|
+
default: '8983'
|
13
|
+
rails_version:
|
14
|
+
type: string
|
15
|
+
default: '5.1.7'
|
6
16
|
docker:
|
7
|
-
- image: circleci/ruby
|
8
|
-
environment:
|
9
|
-
BUNDLE_JOBS: 3
|
10
|
-
BUNDLE_RETRY: 3
|
11
|
-
# We need both GEM_HOME and BUNDLE_PATH because of the test app
|
12
|
-
GEM_HOME: /home/circleci/geoblacklight/vendor/bundle
|
13
|
-
BUNDLE_PATH: /home/circleci/geoblacklight/vendor/bundle
|
14
|
-
CI: true
|
15
|
-
RAILS_ENV: test
|
16
|
-
RAILS_VERSION: 5.2.3
|
17
|
+
- image: circleci/ruby:<< parameters.ruby_version >>-node-browsers-legacy
|
17
18
|
- image: solr:7-alpine
|
18
|
-
command: bin/solr -cloud -noprompt -f -p
|
19
|
+
command: bin/solr -cloud -noprompt -f -p <<parameters.solr_port>>
|
20
|
+
environment:
|
21
|
+
GEM_HOME: /home/circleci/geoblacklight/vendor/bundle
|
22
|
+
BUNDLE_PATH: /home/circleci/geoblacklight/vendor/bundle
|
23
|
+
BUNDLE_JOBS: 4
|
24
|
+
BUNDLE_RETRY: 3
|
25
|
+
RAILS_ENV: test
|
26
|
+
RACK_ENV: test
|
27
|
+
RAILS_VERSION: <<parameters.rails_version>>
|
28
|
+
COVERAGE: true
|
29
|
+
parallelism: 4
|
19
30
|
steps:
|
20
31
|
- checkout
|
21
32
|
# Update chrome
|
@@ -23,86 +34,46 @@ jobs:
|
|
23
34
|
- run: sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
|
24
35
|
- run: sudo apt-get update
|
25
36
|
- run: sudo apt-get -y install google-chrome-stable
|
26
|
-
# Restore bundle cache
|
27
|
-
-
|
28
|
-
|
29
|
-
|
37
|
+
# Restore bundle and internal test app from the cache
|
38
|
+
- restore_cache:
|
39
|
+
keys:
|
40
|
+
- geoblacklight-bundle-{{ checksum "geoblacklight.gemspec" }}-{{ checksum "Gemfile" }}-<< parameters.ruby_version >>-<< parameters.rails_version >>
|
30
41
|
# Install gems
|
31
42
|
- run: bundle check || bundle install
|
32
|
-
#
|
33
|
-
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
curl -H "Content-type:application/octet-stream" --data-binary @solr_config.zip "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=solrconfig"
|
43
|
-
curl -H 'Content-type: application/json' http://localhost:8983/api/collections/ -d '{create: {name: blacklight-core, config: solrconfig, numShards: 1}}'
|
44
|
-
- run:
|
45
|
-
name: Seed Solr
|
46
|
-
command: |
|
47
|
-
cd .internal_test_app
|
48
|
-
bundle exec rake geoblacklight:index:seed
|
49
|
-
bundle exec rake geoblacklight:downloads:mkdir
|
43
|
+
# Store bundle cache
|
44
|
+
- save_cache:
|
45
|
+
key: geoblacklight-bundle-{{ checksum "geoblacklight.gemspec" }}-{{ checksum "Gemfile" }}-<< parameters.ruby_version >>-<< parameters.rails_version >>
|
46
|
+
paths:
|
47
|
+
- /home/circleci/geoblacklight/vendor/bundle
|
48
|
+
# Restore internal test app from the cache
|
49
|
+
- restore_cache:
|
50
|
+
keys:
|
51
|
+
- geoblacklight-internal-test-app-{{ checksum "geoblacklight.gemspec" }}-{{ checksum "Gemfile" }}-{{ checksum "spec/test_app_templates/Gemfile.extra" }}-<< parameters.ruby_version >>-<< parameters.rails_version >>
|
52
|
+
# Generate the internal test app
|
50
53
|
- run:
|
51
|
-
name:
|
54
|
+
name: Generate test app
|
52
55
|
command: |
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
command: bundle exec rake geoblacklight:coverage
|
60
|
-
- run:
|
61
|
-
name: Run the Teaspoon test suites
|
62
|
-
command: bundle exec rake teaspoon
|
63
|
-
# Store bundle cache
|
64
|
-
- type: cache-save
|
65
|
-
name: Store bundle cache
|
66
|
-
key: geoblacklight-bundle-5-2-0-{{ checksum "geoblacklight.gemspec" }}-{{ checksum "Gemfile" }}-3f5eff
|
67
|
-
paths:
|
68
|
-
- /home/circleci/geoblacklight/vendor/bundle
|
69
|
-
rails_5_1_7:
|
70
|
-
working_directory: ~/geoblacklight
|
71
|
-
docker:
|
72
|
-
- image: circleci/ruby:2.4.4-node-browsers
|
73
|
-
environment:
|
74
|
-
BUNDLE_JOBS: 3
|
75
|
-
BUNDLE_RETRY: 3
|
76
|
-
GEM_HOME: /home/circleci/geoblacklight/vendor/bundle
|
77
|
-
BUNDLE_PATH: /home/circleci/geoblacklight/vendor/bundle
|
78
|
-
RAILS_ENV: test
|
79
|
-
RAILS_VERSION: 5.1.7
|
80
|
-
- image: solr:7-alpine
|
81
|
-
command: bin/solr -cloud -noprompt -f -p 8983
|
82
|
-
steps:
|
83
|
-
- checkout
|
84
|
-
# Restore bundle cache
|
85
|
-
- type: cache-restore
|
86
|
-
name: Restore bundle cache
|
87
|
-
key: geoblacklight-bundle-5-1-7-{{ checksum "Gemfile" }}-{{ checksum "geoblacklight.gemspec" }}-3f5eff
|
88
|
-
# Install gems and run specs
|
89
|
-
- run: bundle check || bundle install
|
90
|
-
# Run the test suites
|
91
|
-
- run: bundle exec rake engine_cart:generate
|
56
|
+
[ -e ./.internal_test_app ] || bundle exec rake engine_cart:generate
|
57
|
+
- save_cache:
|
58
|
+
name: Save test app cache
|
59
|
+
key: geoblacklight-internal-test-app-{{ checksum "geoblacklight.gemspec" }}-{{ checksum "Gemfile" }}-{{ checksum "spec/test_app_templates/Gemfile.extra" }}-<< parameters.ruby_version >>-<< parameters.rails_version >>
|
60
|
+
paths:
|
61
|
+
- ./.internal_test_app
|
92
62
|
- run:
|
93
63
|
name: Wait for Solr
|
94
|
-
command: dockerize -wait tcp://localhost
|
64
|
+
command: dockerize -wait tcp://localhost:<<parameters.solr_port>> -timeout 1m
|
95
65
|
- run:
|
96
66
|
name: Load config into solr
|
97
67
|
command: |
|
98
68
|
cd .internal_test_app/solr/conf
|
99
69
|
zip -1 -r solr_config.zip ./*
|
100
70
|
curl -H "Content-type:application/octet-stream" --data-binary @solr_config.zip "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=solrconfig"
|
101
|
-
curl -H 'Content-type: application/json' http://localhost
|
71
|
+
curl -H 'Content-type: application/json' http://localhost:<<parameters.solr_port>>/api/collections/ -d '{create: {name: blacklight-core, config: solrconfig, numShards: 1}}'
|
102
72
|
- run:
|
103
73
|
name: Seed Solr
|
104
74
|
command: |
|
105
75
|
cd .internal_test_app
|
76
|
+
bundle check || bundle install
|
106
77
|
bundle exec rake geoblacklight:index:seed
|
107
78
|
bundle exec rake geoblacklight:downloads:mkdir
|
108
79
|
- run:
|
@@ -114,39 +85,111 @@ jobs:
|
|
114
85
|
bundle exec rails webpacker:compile
|
115
86
|
- run:
|
116
87
|
name: Run the RSpec test suites
|
117
|
-
command: bundle exec
|
88
|
+
command: bundle exec rspec $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
|
118
89
|
- run:
|
119
90
|
name: Run the Teaspoon test suites
|
120
91
|
command: bundle exec rake teaspoon
|
121
|
-
|
122
|
-
- type: cache-save
|
123
|
-
name: Store bundle cache
|
124
|
-
key: geoblacklight-bundle-5-1-7-{{ checksum "Gemfile" }}-{{ checksum "geoblacklight.gemspec" }}-3f5eff
|
125
|
-
paths:
|
126
|
-
- /home/circleci/geoblacklight/vendor/bundle
|
92
|
+
|
127
93
|
rubocop:
|
128
94
|
working_directory: ~/geoblacklight
|
95
|
+
parameters:
|
96
|
+
ruby_version:
|
97
|
+
type: string
|
98
|
+
default: '2.5.7'
|
99
|
+
rails_version:
|
100
|
+
type: string
|
101
|
+
default: '5.1.7'
|
129
102
|
docker:
|
130
|
-
- image: circleci/ruby
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
103
|
+
- image: circleci/ruby:<< parameters.ruby_version >>-node-browsers-legacy
|
104
|
+
environment:
|
105
|
+
GEM_HOME: /home/circleci/geoblacklight/vendor/bundle
|
106
|
+
BUNDLE_PATH: /home/circleci/geoblacklight/vendor/bundle
|
107
|
+
BUNDLE_JOBS: 4
|
108
|
+
BUNDLE_RETRY: 3
|
109
|
+
RAILS_ENV: test
|
110
|
+
RACK_ENV: test
|
111
|
+
RAILS_VERSION: <<parameters.rails_version>>
|
135
112
|
steps:
|
136
113
|
- checkout
|
137
114
|
# Restore bundle cache
|
138
|
-
-
|
139
|
-
|
140
|
-
|
115
|
+
- restore_cache:
|
116
|
+
keys:
|
117
|
+
- geoblacklight-bundle-{{ checksum "geoblacklight.gemspec" }}-{{ checksum "Gemfile" }}-<< parameters.ruby_version >>-<< parameters.rails_version >>
|
118
|
+
paths:
|
119
|
+
- /home/circleci/geoblacklight/vendor/bundle
|
141
120
|
# Install gems and run rubocop
|
142
121
|
- run: bundle check || bundle install
|
143
122
|
- run: bundle exec rake rubocop
|
123
|
+
|
144
124
|
workflows:
|
145
125
|
version: 2
|
146
|
-
|
126
|
+
build:
|
127
|
+
jobs:
|
128
|
+
- build:
|
129
|
+
ruby_version: 2.6.5
|
130
|
+
rails_version: 5.2.4.1
|
131
|
+
name: "ruby2-6_rails5-2"
|
132
|
+
- build:
|
133
|
+
ruby_version: 2.5.7
|
134
|
+
rails_version: 5.2.4.1
|
135
|
+
name: "ruby2-5_rails5-2"
|
136
|
+
- rubocop:
|
137
|
+
ruby_version: 2.6.5
|
138
|
+
rails_version: 5.2.4.1
|
139
|
+
name: "rubocop_ruby2-6_rails5-2"
|
140
|
+
- rubocop:
|
141
|
+
ruby_version: 2.5.7
|
142
|
+
rails_version: 5.2.4.1
|
143
|
+
name: "rubocop_ruby2-5_rails5-2"
|
144
|
+
|
145
|
+
- build:
|
146
|
+
ruby_version: 2.6.5
|
147
|
+
name: "ruby2-6_rails5-1"
|
148
|
+
- build:
|
149
|
+
ruby_version: 2.5.7
|
150
|
+
name: "ruby2-5_rails5-1"
|
151
|
+
- rubocop:
|
152
|
+
ruby_version: 2.6.5
|
153
|
+
name: "rubocop_ruby2-6_rails5-1"
|
154
|
+
- rubocop:
|
155
|
+
ruby_version: 2.5.7
|
156
|
+
name: "rubocop_ruby2-5_rails5-1"
|
157
|
+
|
158
|
+
nightly:
|
159
|
+
triggers:
|
160
|
+
- schedule:
|
161
|
+
cron: "0 0 * * *"
|
162
|
+
filters:
|
163
|
+
branches:
|
164
|
+
only:
|
165
|
+
- master
|
147
166
|
jobs:
|
148
|
-
-
|
149
|
-
|
167
|
+
- build:
|
168
|
+
ruby_version: 2.6.5
|
169
|
+
rails_version: 5.2.4.1
|
170
|
+
name: "ruby2-6_rails5-2"
|
171
|
+
- build:
|
172
|
+
ruby_version: 2.5.7
|
173
|
+
rails_version: 5.2.4.1
|
174
|
+
name: "ruby2-5_rails5-2"
|
175
|
+
- rubocop:
|
176
|
+
ruby_version: 2.6.5
|
177
|
+
rails_version: 5.2.4.1
|
178
|
+
name: "rubocop_ruby2-6_rails5-2"
|
179
|
+
- rubocop:
|
180
|
+
ruby_version: 2.5.7
|
181
|
+
rails_version: 5.2.4.1
|
182
|
+
name: "rubocop_ruby2-5_rails5-2"
|
183
|
+
|
184
|
+
- build:
|
185
|
+
ruby_version: 2.6.5
|
186
|
+
name: "ruby2-6_rails5-1"
|
187
|
+
- build:
|
188
|
+
ruby_version: 2.5.7
|
189
|
+
name: "ruby2-5_rails5-1"
|
190
|
+
- rubocop:
|
191
|
+
ruby_version: 2.6.5
|
192
|
+
name: "rubocop_ruby2-6_rails5-1"
|
150
193
|
- rubocop:
|
151
|
-
|
152
|
-
|
194
|
+
ruby_version: 2.5.7
|
195
|
+
name: "rubocop_ruby2-5_rails5-1"
|
data/.rubocop_todo.yml
CHANGED
@@ -46,13 +46,6 @@ Lint/UnusedBlockArgument:
|
|
46
46
|
Metrics/BlockLength:
|
47
47
|
Max: 247
|
48
48
|
|
49
|
-
# Offense count: 1
|
50
|
-
# Cop supports --auto-correct.
|
51
|
-
# Configuration parameters: AutoCorrect.
|
52
|
-
Performance/HashEachMethods:
|
53
|
-
Exclude:
|
54
|
-
- 'app/presenters/geoblacklight/document_presenter.rb'
|
55
|
-
|
56
49
|
# Offense count: 2
|
57
50
|
# Configuration parameters: CustomIncludeMethods.
|
58
51
|
RSpec/EmptyExampleGroup:
|
@@ -161,12 +154,6 @@ Style/HashSyntax:
|
|
161
154
|
Exclude:
|
162
155
|
- 'lib/tasks/geoblacklight.rake'
|
163
156
|
|
164
|
-
# Offense count: 2
|
165
|
-
Style/MethodMissing:
|
166
|
-
Exclude:
|
167
|
-
- 'app/models/concerns/geoblacklight/solr_document.rb'
|
168
|
-
- 'lib/geoblacklight/references.rb'
|
169
|
-
|
170
157
|
# Offense count: 2
|
171
158
|
# Cop supports --auto-correct.
|
172
159
|
Style/MultilineIfModifier:
|
data/Gemfile
CHANGED
@@ -31,14 +31,9 @@ else
|
|
31
31
|
gem 'rails', ENV['RAILS_VERSION']
|
32
32
|
end
|
33
33
|
end
|
34
|
+
end
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
gem 'responders', '~> 2.0'
|
38
|
-
gem 'sass-rails', '>= 5.0'
|
39
|
-
gem 'coffee-rails', '~> 4.1.0'
|
40
|
-
when /^4.[01]/
|
41
|
-
gem 'sass-rails', '< 5.0'
|
42
|
-
end
|
36
|
+
if File.exists?('spec/test_app_templates/Gemfile.extra')
|
37
|
+
eval File.read('spec/test_app_templates/Gemfile.extra'), nil, 'spec/test_app_templates/Gemfile.extra'
|
43
38
|
end
|
44
39
|
# END ENGINE_CART BLOCK
|
@@ -63,5 +63,23 @@ GeoBlacklight.Basemaps = {
|
|
63
63
|
retina: '@2x',
|
64
64
|
detectRetina: false
|
65
65
|
}
|
66
|
+
),
|
67
|
+
openstreetmapHot: L.tileLayer(
|
68
|
+
'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {
|
69
|
+
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>',
|
70
|
+
maxZoom: 19,
|
71
|
+
worldCopyJump: true,
|
72
|
+
retina: '@2x',
|
73
|
+
detectRetina: false
|
74
|
+
}
|
75
|
+
),
|
76
|
+
openstreetmapStandard: L.tileLayer(
|
77
|
+
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
78
|
+
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
79
|
+
maxZoom: 19,
|
80
|
+
worldCopyJump: true,
|
81
|
+
retina: '@2x',
|
82
|
+
detectRetina: false
|
83
|
+
}
|
66
84
|
)
|
67
85
|
};
|
@@ -50,8 +50,10 @@ Blacklight.onLoad(function() {
|
|
50
50
|
// set hover listeners on map
|
51
51
|
$('#content')
|
52
52
|
.on('mouseenter', '#documents [data-layer-id]', function() {
|
53
|
-
|
54
|
-
|
53
|
+
if($(this).data('bbox').length > 0) {
|
54
|
+
var bounds = L.bboxToBounds($(this).data('bbox'));
|
55
|
+
geoblacklight.addBoundsOverlay(bounds);
|
56
|
+
}
|
55
57
|
})
|
56
58
|
.on('mouseleave', '#documents [data-layer-id]', function() {
|
57
59
|
geoblacklight.removeBoundsOverlay();
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
$logo-image: image_url('blacklight/logo.svg') !default
|
6
6
|
|
7
|
-
.navbar-
|
7
|
+
.navbar-logo { /* The main logo image for the Blacklight instance */
|
8
8
|
@if $logo-image {
|
9
9
|
background: transparent $logo-image no-repeat top left;
|
10
10
|
}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<nav class="navbar navbar-expand-md navbar-dark bg-dark topbar" role="navigation">
|
4
4
|
<div class="<%= container_classes %>">
|
5
|
-
<%= link_to application_name, root_path, class: 'mb-0 navbar-
|
5
|
+
<%= link_to application_name, root_path, class: 'mb-0 navbar-logo' %>
|
6
6
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#user-util-collapse" aria-controls="user-util-collapse" aria-expanded="false" aria-label="Toggle navigation">
|
7
7
|
<span class="navbar-toggler-icon"></span>
|
8
8
|
</button>
|
data/geoblacklight.gemspec
CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency 'blacklight', '~> 7.0'
|
24
24
|
spec.add_dependency 'font-awesome-rails'
|
25
25
|
spec.add_dependency 'config'
|
26
|
-
spec.add_dependency 'faraday'
|
27
|
-
spec.add_dependency 'faraday_middleware'
|
26
|
+
spec.add_dependency 'faraday', '~> 1.0'
|
27
|
+
spec.add_dependency 'faraday_middleware', '~> 1.0.0.rc1'
|
28
28
|
spec.add_dependency 'coderay'
|
29
29
|
spec.add_dependency 'geoblacklight-icons', '>= 0.2'
|
30
30
|
spec.add_dependency 'deprecation'
|
@@ -91,6 +91,11 @@ module Geoblacklight
|
|
91
91
|
gsub_file('config/locales/blacklight.en.yml', 'Blacklight', 'GeoBlacklight')
|
92
92
|
end
|
93
93
|
|
94
|
+
# Ensure that assets/images exists
|
95
|
+
def create_image_assets_directory
|
96
|
+
FileUtils.mkdir_p('app/assets/images') unless File.directory?('app/assets/images')
|
97
|
+
end
|
98
|
+
|
94
99
|
def bundle_install
|
95
100
|
Bundler.with_clean_env do
|
96
101
|
run 'bundle install'
|
@@ -55,8 +55,8 @@ module Geoblacklight
|
|
55
55
|
|
56
56
|
##
|
57
57
|
# Initiates download from a remote source url using the `request_params`.
|
58
|
-
# Will catch Faraday::
|
59
|
-
# Faraday::
|
58
|
+
# Will catch Faraday::ConnectionFailed and
|
59
|
+
# Faraday::TimeoutError
|
60
60
|
# @return [Faraday::Request] returns a Faraday::Request object
|
61
61
|
def initiate_download
|
62
62
|
conn = Faraday.new(url: url)
|
@@ -65,11 +65,11 @@ module Geoblacklight
|
|
65
65
|
request.options.timeout = timeout
|
66
66
|
request.options.open_timeout = timeout
|
67
67
|
end
|
68
|
-
rescue Faraday::
|
68
|
+
rescue Faraday::ConnectionFailed
|
69
69
|
raise Geoblacklight::Exceptions::ExternalDownloadFailed,
|
70
70
|
message: 'Download connection failed',
|
71
71
|
url: conn.url_prefix.to_s
|
72
|
-
rescue Faraday::
|
72
|
+
rescue Faraday::TimeoutError
|
73
73
|
raise Geoblacklight::Exceptions::ExternalDownloadFailed,
|
74
74
|
message: 'Download timed out',
|
75
75
|
url: conn.url_prefix.to_s
|
@@ -54,10 +54,10 @@ module Geoblacklight
|
|
54
54
|
return response.body unless response.nil? || response.status == 404
|
55
55
|
Geoblacklight.logger.error "Could not reach #{@reference.endpoint}"
|
56
56
|
''
|
57
|
-
rescue Faraday::
|
57
|
+
rescue Faraday::ConnectionFailed => error
|
58
58
|
Geoblacklight.logger.error error.inspect
|
59
59
|
''
|
60
|
-
rescue Faraday::
|
60
|
+
rescue Faraday::TimeoutError => error
|
61
61
|
Geoblacklight.logger.error error.inspect
|
62
62
|
''
|
63
63
|
rescue OpenSSL::SSL::SSLError => error
|
@@ -24,10 +24,10 @@ module Geoblacklight
|
|
24
24
|
request.options.timeout = Settings.TIMEOUT_WMS
|
25
25
|
request.options.open_timeout = Settings.TIMEOUT_WMS
|
26
26
|
end
|
27
|
-
rescue Faraday::
|
27
|
+
rescue Faraday::ConnectionFailed => error
|
28
28
|
Geoblacklight.logger.error error.inspect
|
29
29
|
{ error: error.inspect }
|
30
|
-
rescue Faraday::
|
30
|
+
rescue Faraday::TimeoutError => error
|
31
31
|
Geoblacklight.logger.error error.inspect
|
32
32
|
{ error: error.inspect }
|
33
33
|
end
|
data/solr/conf/schema.xml
CHANGED
@@ -147,8 +147,8 @@
|
|
147
147
|
<!-- Adding field type for bboxField that enables, among other things, overlap ratio calculations -->
|
148
148
|
<fieldType name="bbox" class="solr.BBoxField"
|
149
149
|
geo="true" distanceUnits="kilometers" numberType="pdouble" />
|
150
|
-
<fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>
|
151
|
-
|
150
|
+
<fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>
|
151
|
+
|
152
152
|
|
153
153
|
</types>
|
154
154
|
|
@@ -169,8 +169,8 @@
|
|
169
169
|
<copyField source="layer_slug_s" dest="layer_slug_ti" maxChars="100"/>
|
170
170
|
|
171
171
|
<!-- core text search -->
|
172
|
-
<copyField source="*
|
173
|
-
<copyField source="*
|
172
|
+
<copyField source="*_s" dest="text" />
|
173
|
+
<copyField source="*_sm" dest="text" />
|
174
174
|
|
175
175
|
<!-- for sorting text fields -->
|
176
176
|
<copyField source="dct_provenance_s" dest="dct_provenance_sort"/>
|
@@ -192,7 +192,7 @@
|
|
192
192
|
<copyField source="dct_provenance_s" dest="suggest"/>
|
193
193
|
<copyField source="dc_subject_sm" dest="suggest"/>
|
194
194
|
<copyField source="dct_spatial_sm" dest="suggest"/>
|
195
|
-
|
195
|
+
|
196
196
|
<!-- for bbox value -->
|
197
197
|
<copyField source="solr_geom" dest="solr_bboxtype"/>
|
198
198
|
</schema>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe WmsController, type: :controller do
|
4
4
|
let(:wms_layer) { instance_double('Geoblacklight::WmsLayer') }
|
5
5
|
let(:feature_info) { { values: ['fid', 'layer:example'] } }
|
6
6
|
let(:params) do
|
@@ -23,4 +23,13 @@ feature 'Configurable basemap', js: true do
|
|
23
23
|
expect(page).to have_css "img[src*='dark_all']"
|
24
24
|
end
|
25
25
|
end
|
26
|
+
feature 'using openstreetmapHot' do
|
27
|
+
before do
|
28
|
+
CatalogController.blacklight_config.basemap_provider = 'openstreetmapHot'
|
29
|
+
end
|
30
|
+
scenario 'has openstreetmapHot map' do
|
31
|
+
visit root_path
|
32
|
+
expect(page).to have_css "img[src*='hot']"
|
33
|
+
end
|
34
|
+
end
|
26
35
|
end
|
@@ -13,7 +13,6 @@ feature 'feature_layer reference', js: true do
|
|
13
13
|
expect(page).to have_css 'img.leaflet-image-layer', visible: true
|
14
14
|
end
|
15
15
|
scenario 'displays dynamic layer (single layer)' do
|
16
|
-
pending 'external service disabled cors access'
|
17
16
|
visit solr_document_path '4669301e-b4b2-4c8b-bf40-01b968a2865b'
|
18
17
|
expect(page).to have_css '.leaflet-control-zoom', visible: true
|
19
18
|
expect(page).to have_css 'img.leaflet-image-layer', visible: true
|
@@ -9,4 +9,16 @@ feature 'Missing metadata', js: true do
|
|
9
9
|
visit solr_document_path('aster-global-emissivity-dataset-1-kilometer-v003-ag1kmcad20')
|
10
10
|
expect(page).to have_css('#map')
|
11
11
|
end
|
12
|
+
scenario 'Yields error free show page for no layer_geom_type_s' do
|
13
|
+
visit solr_document_path('05d-03-noGeomType')
|
14
|
+
expect(page).to have_css('#map')
|
15
|
+
end
|
16
|
+
scenario 'Yields error free show page for no dct_provenance_s' do
|
17
|
+
visit solr_document_path('99-0001-noProvenance')
|
18
|
+
expect(page).to have_css('#map')
|
19
|
+
end
|
20
|
+
scenario 'Yields error free show page for no solr_geom' do
|
21
|
+
visit solr_document_path('05d-p16022coll246-noGeo')
|
22
|
+
expect(page).to have_css('#map')
|
23
|
+
end
|
12
24
|
end
|
@@ -30,7 +30,7 @@ feature 'Index view', js: true do
|
|
30
30
|
expect(page).to have_css('div.card.facet-limit', text: 'Data type')
|
31
31
|
expect(page).to have_css('div.card.facet-limit', text: 'Format')
|
32
32
|
end
|
33
|
-
|
33
|
+
click_button 'Institution'
|
34
34
|
using_wait_time 120 do
|
35
35
|
expect(page).to have_css('a.facet-select', text: 'Minnesota', visible: true)
|
36
36
|
expect(page).to have_css('a.facet-select', text: 'MIT', visible: true)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"geoblacklight_version": "1.0",
|
3
|
+
"layer_modified_dt": "2019-12-16T15:57:35Z",
|
4
|
+
"layer_slug_s": "99-0001-noProvenance",
|
5
|
+
"dc_identifier_s": "99-0001-noProvenance",
|
6
|
+
"dc_title_s": "Social Explorer",
|
7
|
+
"dct_temporal_sm": [
|
8
|
+
"1790-present"
|
9
|
+
],
|
10
|
+
"dc_description_s": "Requires creating a free account or logging in through an organization with licensed access. This interactive website includes the entire US census history from 1790 to 2000, the American Community Survey (ACS), and the Religious Congregations and Membership Study (RCMS) from 1980 to 2000? the most complete census available on religion in the U.S. Overall, the site contains 39 billion data points, 200,000 variables, and 15,000 interactive maps",
|
11
|
+
"dc_subject_sm": [
|
12
|
+
"Society"
|
13
|
+
],
|
14
|
+
"dc_type_sm": [
|
15
|
+
"Interactive Resource"
|
16
|
+
],
|
17
|
+
"dc_rights_s": "Restricted",
|
18
|
+
"layer_geom_type_s": "Table",
|
19
|
+
"solr_geom": "ENVELOPE(-179.9,-64.4,71.6,-14.8)",
|
20
|
+
"dc_publisher_sm": [
|
21
|
+
"Social Explorer"
|
22
|
+
],
|
23
|
+
"dc_creator_sm": [
|
24
|
+
"Queens College (New York, N.Y.). Department of Sociology"
|
25
|
+
],
|
26
|
+
"dct_spatial_sm": [
|
27
|
+
"United States"
|
28
|
+
],
|
29
|
+
"dct_references_s": "{\"http://schema.org/url\":\"https://www.socialexplorer.com/\"}"
|
30
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"geoblacklight_version": "1.0",
|
3
|
+
"layer_modified_dt": "2020-01-17T15:31:30Z",
|
4
|
+
"layer_slug_s": "05d-03-noGeomType",
|
5
|
+
"dc_identifier_s": "05d-03-noGeomType",
|
6
|
+
"dc_title_s": "University of Minnesota Digital Conservancy DRUM",
|
7
|
+
"dc_description_s": "DRUM is a publicly available collection of digital research data generated by University of Minnesota researchers, students, and staff. Anyone can search and download the data housed in the repository, instantly or by request.",
|
8
|
+
"dc_publisher_sm": [
|
9
|
+
"University of Minnesota Digital Conservancy"
|
10
|
+
],
|
11
|
+
"dc_type_sm": [
|
12
|
+
"Collection"
|
13
|
+
],
|
14
|
+
"dct_provenance_s": "Minnesota",
|
15
|
+
"dc_rights_s": "Public",
|
16
|
+
"dct_references_s": "{\"http://schema.org/url\":\"https://conservancy.umn.edu/handle/11299/166578\"}"
|
17
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"geoblacklight_version": "1.0",
|
3
|
+
"layer_modified_dt": "2020-01-23T14:01:19Z",
|
4
|
+
"layer_slug_s": "05d-p16022coll246-noGeo",
|
5
|
+
"dc_identifier_s": "05d-p16022coll246-noGeo",
|
6
|
+
"dc_title_s": "Ames Library of South Asia Maps",
|
7
|
+
"dc_description_s": "A collection of maps covering Asia held by the University of Minnesota's Ames Library of South Asia.",
|
8
|
+
"dc_publisher_sm": [
|
9
|
+
"University of Minnesota"
|
10
|
+
],
|
11
|
+
"dc_type_sm": [
|
12
|
+
"Collection"
|
13
|
+
],
|
14
|
+
"layer_geom_type_s": "Table",
|
15
|
+
"dct_provenance_s": "Minnesota",
|
16
|
+
"dct_spatial_sm": [
|
17
|
+
"Asia",
|
18
|
+
"India",
|
19
|
+
"Afghanistan"
|
20
|
+
],
|
21
|
+
"dc_rights_s": "Public",
|
22
|
+
"dct_references_s": "{\"http://schema.org/url\":\"https://umedia.lib.umn.edu/search?facets[collection_name_s][]=Ames+Library+of+South+Asia+Maps\"}"
|
23
|
+
}
|
@@ -141,14 +141,14 @@ describe Geoblacklight::Download do
|
|
141
141
|
|
142
142
|
it 'raises Geoblacklight::Exceptions::ExternalDownloadFailed with a connection failure' do
|
143
143
|
expect(faraday_connection).to receive(:url_prefix).and_return 'http://www.example.com/wms'
|
144
|
-
expect(faraday_connection).to receive(:get).and_raise(Faraday::
|
144
|
+
expect(faraday_connection).to receive(:get).and_raise(Faraday::ConnectionFailed.new('Failed'))
|
145
145
|
expect(Faraday).to receive(:new).with(url: 'http://www.example.com/wms').and_return(faraday_connection)
|
146
146
|
expect { download.initiate_download }.to raise_error(Geoblacklight::Exceptions::ExternalDownloadFailed)
|
147
147
|
end
|
148
148
|
|
149
149
|
it 'raises Geoblacklight::Exceptions::ExternalDownloadFailed with a connection timout' do
|
150
150
|
expect(faraday_connection).to receive(:url_prefix).and_return 'http://www.example.com/wms'
|
151
|
-
expect(faraday_connection).to receive(:get).and_raise(Faraday::
|
151
|
+
expect(faraday_connection).to receive(:get).and_raise(Faraday::TimeoutError)
|
152
152
|
expect(Faraday).to receive(:new).with(url: 'http://www.example.com/wms').and_return(faraday_connection)
|
153
153
|
expect { download.initiate_download }.to raise_error(Geoblacklight::Exceptions::ExternalDownloadFailed)
|
154
154
|
end
|
@@ -30,7 +30,7 @@ describe Geoblacklight::Metadata::Base do
|
|
30
30
|
subject { metadata.document }
|
31
31
|
|
32
32
|
before do
|
33
|
-
allow(connection).to receive(:get).and_raise(Faraday::
|
33
|
+
allow(connection).to receive(:get).and_raise(Faraday::ConnectionFailed, 'test connection failures')
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'returns nil when a connection error' do
|
@@ -73,7 +73,7 @@ describe Geoblacklight::Metadata::Base do
|
|
73
73
|
|
74
74
|
context 'when attempts to connect to an endpoint URL fail' do
|
75
75
|
before do
|
76
|
-
allow(connection).to receive(:get).and_raise(Faraday::
|
76
|
+
allow(connection).to receive(:get).and_raise(Faraday::ConnectionFailed, 'test connection failures')
|
77
77
|
end
|
78
78
|
|
79
79
|
it 'returns true' do
|
@@ -144,7 +144,7 @@ describe Geoblacklight::Metadata::Base do
|
|
144
144
|
context 'when requesting the metadata resource times out' do
|
145
145
|
before do
|
146
146
|
allow(geocombine_metadata).to receive(:to_html).and_return('')
|
147
|
-
allow(connection).to receive(:get).and_raise(Faraday::
|
147
|
+
allow(connection).to receive(:get).and_raise(Faraday::TimeoutError)
|
148
148
|
allow(Geoblacklight.logger).to receive(:error).with('#<Faraday::TimeoutError #<Faraday::TimeoutError: timeout>>')
|
149
149
|
end
|
150
150
|
|
@@ -73,7 +73,7 @@ describe Geoblacklight::WmsLayer do
|
|
73
73
|
context 'when the HTTP connection fails' do
|
74
74
|
before do
|
75
75
|
allow(Geoblacklight.logger).to receive(:error).with('#<Faraday::ConnectionFailed wrapped=#<StandardError: test connection error>>')
|
76
|
-
allow(connection).to receive(:get).and_raise(Faraday::
|
76
|
+
allow(connection).to receive(:get).and_raise(Faraday::ConnectionFailed.new(StandardError.new('test connection error')))
|
77
77
|
end
|
78
78
|
|
79
79
|
it 'logs the Faraday error' do
|
@@ -86,7 +86,7 @@ describe Geoblacklight::WmsLayer do
|
|
86
86
|
context 'when the HTTP connection times out' do
|
87
87
|
before do
|
88
88
|
allow(Geoblacklight.logger).to receive(:error).with('#<Faraday::TimeoutError #<Faraday::TimeoutError: timeout>>')
|
89
|
-
allow(connection).to receive(:get).and_raise(Faraday::
|
89
|
+
allow(connection).to receive(:get).and_raise(Faraday::TimeoutError)
|
90
90
|
end
|
91
91
|
|
92
92
|
it 'logs the Faraday error' do
|
@@ -0,0 +1 @@
|
|
1
|
+
gem 'sprockets', '< 4'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geoblacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Graves
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2020-04-01 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -73,30 +73,30 @@ dependencies:
|
|
73
73
|
name: faraday
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|
75
75
|
requirements:
|
76
|
-
- - "
|
76
|
+
- - "~>"
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version: '0'
|
78
|
+
version: '1.0'
|
79
79
|
type: :runtime
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
|
-
- - "
|
83
|
+
- - "~>"
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: '0'
|
85
|
+
version: '1.0'
|
86
86
|
- !ruby/object:Gem::Dependency
|
87
87
|
name: faraday_middleware
|
88
88
|
requirement: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
|
-
- - "
|
90
|
+
- - "~>"
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version:
|
92
|
+
version: 1.0.0.rc1
|
93
93
|
type: :runtime
|
94
94
|
prerelease: false
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
|
-
- - "
|
97
|
+
- - "~>"
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version:
|
99
|
+
version: 1.0.0.rc1
|
100
100
|
- !ruby/object:Gem::Dependency
|
101
101
|
name: coderay
|
102
102
|
requirement: !ruby/object:Gem::Requirement
|
@@ -429,7 +429,6 @@ files:
|
|
429
429
|
- app/assets/images/blacklight/leaf.svg
|
430
430
|
- app/assets/images/blacklight/lewis-clark.svg
|
431
431
|
- app/assets/images/blacklight/line.svg
|
432
|
-
- app/assets/images/blacklight/logo.png
|
433
432
|
- app/assets/images/blacklight/logo.svg
|
434
433
|
- app/assets/images/blacklight/map-marker.svg
|
435
434
|
- app/assets/images/blacklight/map.svg
|
@@ -717,6 +716,9 @@ files:
|
|
717
716
|
- spec/fixtures/solr_documents/index-map-polygon.json
|
718
717
|
- spec/fixtures/solr_documents/index-map-stanford.json
|
719
718
|
- spec/fixtures/solr_documents/index_map_point.json
|
719
|
+
- spec/fixtures/solr_documents/metadata_no_dct_provenance_s.json
|
720
|
+
- spec/fixtures/solr_documents/metadata_no_layer_geom_type_s.json
|
721
|
+
- spec/fixtures/solr_documents/metadata_no_solr_geom.json
|
720
722
|
- spec/fixtures/solr_documents/no_spatial.json
|
721
723
|
- spec/fixtures/solr_documents/oembed.json
|
722
724
|
- spec/fixtures/solr_documents/princeton-child1.json
|
@@ -776,6 +778,7 @@ files:
|
|
776
778
|
- spec/support/features.rb
|
777
779
|
- spec/support/features/session_helpers.rb
|
778
780
|
- spec/teaspoon_env.rb
|
781
|
+
- spec/test_app_templates/Gemfile.extra
|
779
782
|
- spec/test_app_templates/lib/generators/test_app_generator.rb
|
780
783
|
- spec/test_app_templates/metadata/fgdc.html
|
781
784
|
- spec/test_app_templates/metadata/fgdc.xml
|
@@ -822,7 +825,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
822
825
|
- !ruby/object:Gem::Version
|
823
826
|
version: 2.5.2
|
824
827
|
requirements: []
|
825
|
-
rubygems_version: 3.
|
828
|
+
rubygems_version: 3.1.2
|
826
829
|
signing_key:
|
827
830
|
specification_version: 4
|
828
831
|
summary: A discovery platform for geospatial holdings
|
@@ -888,6 +891,9 @@ test_files:
|
|
888
891
|
- spec/fixtures/solr_documents/index-map-polygon.json
|
889
892
|
- spec/fixtures/solr_documents/index-map-stanford.json
|
890
893
|
- spec/fixtures/solr_documents/index_map_point.json
|
894
|
+
- spec/fixtures/solr_documents/metadata_no_dct_provenance_s.json
|
895
|
+
- spec/fixtures/solr_documents/metadata_no_layer_geom_type_s.json
|
896
|
+
- spec/fixtures/solr_documents/metadata_no_solr_geom.json
|
891
897
|
- spec/fixtures/solr_documents/no_spatial.json
|
892
898
|
- spec/fixtures/solr_documents/oembed.json
|
893
899
|
- spec/fixtures/solr_documents/princeton-child1.json
|
@@ -947,6 +953,7 @@ test_files:
|
|
947
953
|
- spec/support/features.rb
|
948
954
|
- spec/support/features/session_helpers.rb
|
949
955
|
- spec/teaspoon_env.rb
|
956
|
+
- spec/test_app_templates/Gemfile.extra
|
950
957
|
- spec/test_app_templates/lib/generators/test_app_generator.rb
|
951
958
|
- spec/test_app_templates/metadata/fgdc.html
|
952
959
|
- spec/test_app_templates/metadata/fgdc.xml
|
Binary file
|