blacklight-maps 0.5.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +2 -0
- data/.rubocop.yml +99 -0
- data/.solr_wrapper.yml +7 -0
- data/.travis.yml +19 -16
- data/Gemfile +40 -7
- data/README.md +13 -12
- data/Rakefile +35 -32
- data/app/assets/images/blacklight/maps.svg +1 -0
- data/app/assets/javascripts/blacklight-maps.js +1 -4
- data/app/assets/javascripts/blacklight-maps/blacklight-maps-browse.js +7 -8
- data/app/assets/stylesheets/blacklight_maps/blacklight-maps.scss +1 -2
- data/app/assets/stylesheets/blacklight_maps/default.scss +7 -10
- data/app/helpers/blacklight/blacklight_maps_helper_behavior.rb +81 -86
- data/app/helpers/blacklight_maps_helper.rb +2 -0
- data/app/views/catalog/_show_maplet_default.html.erb +8 -9
- data/app/views/catalog/map.html.erb +2 -2
- data/blacklight-maps.gemspec +27 -26
- data/config/locales/blacklight-maps-zh.yml +7 -7
- data/config/locales/blacklight-maps.ar.yml +21 -0
- data/config/locales/blacklight-maps.de.yml +21 -0
- data/config/locales/blacklight-maps.en.yml +1 -1
- data/config/locales/blacklight-maps.es.yml +21 -0
- data/config/locales/blacklight-maps.fr.yml +8 -8
- data/config/locales/blacklight-maps.hu.yml +21 -0
- data/config/locales/blacklight-maps.it.yml +8 -8
- data/config/locales/blacklight-maps.nl.yml +21 -0
- data/config/locales/blacklight-maps.pt-BR.yml +21 -0
- data/config/locales/blacklight-maps.sq.yml +21 -0
- data/config/routes.rb +3 -2
- data/lib/blacklight/maps.rb +8 -2
- data/lib/blacklight/maps/controller.rb +27 -0
- data/lib/blacklight/maps/engine.rb +12 -13
- data/lib/blacklight/maps/export.rb +112 -93
- data/lib/blacklight/maps/geometry.rb +30 -18
- data/lib/blacklight/maps/maps_search_builder.rb +4 -3
- data/lib/blacklight/maps/render_constraints_override.rb +63 -29
- data/lib/blacklight/maps/version.rb +3 -1
- data/lib/generators/blacklight_maps/install_generator.rb +38 -31
- data/lib/generators/blacklight_maps/templates/search_history_controller.rb +2 -0
- data/{solr_conf → lib/generators/blacklight_maps/templates/solr}/conf/schema.xml +0 -0
- data/{solr_conf → lib/generators/blacklight_maps/templates/solr}/conf/solrconfig.xml +0 -0
- data/lib/railties/blacklight_maps.rake +10 -7
- data/spec/controllers/catalog_controller_spec.rb +20 -10
- data/spec/fixtures/sample_solr_documents.yml +909 -906
- data/spec/helpers/blacklight_maps_helper_spec.rb +60 -108
- data/spec/lib/blacklight/maps/export_spec.rb +109 -143
- data/spec/lib/blacklight/maps/geometry_spec.rb +34 -21
- data/spec/lib/blacklight/maps/maps_search_builder_spec.rb +17 -21
- data/spec/lib/blacklight/maps/render_constraints_override_spec.rb +42 -69
- data/spec/spec_helper.rb +19 -21
- data/spec/system/index_view_spec.rb +127 -0
- data/spec/system/initial_view_spec.rb +28 -0
- data/spec/system/map_view_spec.rb +50 -0
- data/spec/system/show_view_maplet_spec.rb +78 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +6 -21
- data/vendor/assets/images/layers-2x.png +0 -0
- data/vendor/assets/images/layers.png +0 -0
- data/vendor/assets/images/marker-icon-2x.png +0 -0
- data/vendor/assets/images/marker-icon.png +0 -0
- data/vendor/assets/images/marker-shadow.png +0 -0
- data/vendor/assets/javascripts/leaflet.js.erb +13922 -0
- data/vendor/assets/javascripts/leaflet.markercluster.js +3 -0
- data/vendor/assets/stylesheets/MarkerCluster.Default.css +60 -0
- data/vendor/assets/stylesheets/MarkerCluster.css +14 -0
- data/vendor/assets/stylesheets/leaflet.css +635 -0
- metadata +86 -91
- data/config/jetty.yml +0 -7
- data/lib/blacklight/maps/controller_override.rb +0 -20
- data/lib/generators/blacklight_maps/templates/saved_searches_controller.rb +0 -5
- data/spec/features/initial_view_spec.rb +0 -21
- data/spec/features/maps_spec.rb +0 -202
- data/spec/features/show_view_maplet_spec.rb +0 -93
- data/spec/test_app_templates/Gemfile.extra +0 -5
metadata
CHANGED
@@ -1,87 +1,65 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight-maps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
- Jack Reed
|
9
9
|
- Eben English
|
10
|
-
autorequire:
|
11
|
-
bindir:
|
10
|
+
autorequire:
|
11
|
+
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-06-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: rails
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
requirements:
|
19
|
-
- - "<"
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '6'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
requirements:
|
26
|
-
- - "<"
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
version: '6'
|
29
15
|
- !ruby/object:Gem::Dependency
|
30
16
|
name: blacklight
|
31
17
|
requirement: !ruby/object:Gem::Requirement
|
32
18
|
requirements:
|
33
19
|
- - ">="
|
34
20
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
21
|
+
version: 7.8.0
|
36
22
|
- - "<"
|
37
23
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
24
|
+
version: '8'
|
39
25
|
type: :runtime
|
40
26
|
prerelease: false
|
41
27
|
version_requirements: !ruby/object:Gem::Requirement
|
42
28
|
requirements:
|
43
29
|
- - ">="
|
44
30
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
31
|
+
version: 7.8.0
|
46
32
|
- - "<"
|
47
33
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
34
|
+
version: '8'
|
49
35
|
- !ruby/object:Gem::Dependency
|
50
|
-
name:
|
36
|
+
name: rails
|
51
37
|
requirement: !ruby/object:Gem::Requirement
|
52
38
|
requirements:
|
53
|
-
- - "
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '3.2'
|
56
|
-
type: :runtime
|
57
|
-
prerelease: false
|
58
|
-
version_requirements: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - "~>"
|
39
|
+
- - ">="
|
61
40
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
63
|
-
-
|
64
|
-
name: leaflet-rails
|
65
|
-
requirement: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - '='
|
41
|
+
version: '5.1'
|
42
|
+
- - "<"
|
68
43
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
44
|
+
version: '7'
|
70
45
|
type: :runtime
|
71
46
|
prerelease: false
|
72
47
|
version_requirements: !ruby/object:Gem::Requirement
|
73
48
|
requirements:
|
74
|
-
- -
|
49
|
+
- - ">="
|
75
50
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
51
|
+
version: '5.1'
|
52
|
+
- - "<"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '7'
|
77
55
|
- !ruby/object:Gem::Dependency
|
78
|
-
name:
|
56
|
+
name: capybara
|
79
57
|
requirement: !ruby/object:Gem::Requirement
|
80
58
|
requirements:
|
81
59
|
- - ">="
|
82
60
|
- !ruby/object:Gem::Version
|
83
61
|
version: '0'
|
84
|
-
type: :
|
62
|
+
type: :development
|
85
63
|
prerelease: false
|
86
64
|
version_requirements: !ruby/object:Gem::Requirement
|
87
65
|
requirements:
|
@@ -89,104 +67,104 @@ dependencies:
|
|
89
67
|
- !ruby/object:Gem::Version
|
90
68
|
version: '0'
|
91
69
|
- !ruby/object:Gem::Dependency
|
92
|
-
name:
|
70
|
+
name: engine_cart
|
93
71
|
requirement: !ruby/object:Gem::Requirement
|
94
72
|
requirements:
|
95
73
|
- - "~>"
|
96
74
|
- !ruby/object:Gem::Version
|
97
|
-
version: '1
|
75
|
+
version: '2.1'
|
98
76
|
type: :development
|
99
77
|
prerelease: false
|
100
78
|
version_requirements: !ruby/object:Gem::Requirement
|
101
79
|
requirements:
|
102
80
|
- - "~>"
|
103
81
|
- !ruby/object:Gem::Version
|
104
|
-
version: '1
|
82
|
+
version: '2.1'
|
105
83
|
- !ruby/object:Gem::Dependency
|
106
|
-
name:
|
84
|
+
name: rspec-rails
|
107
85
|
requirement: !ruby/object:Gem::Requirement
|
108
86
|
requirements:
|
109
|
-
- - "
|
87
|
+
- - "~>"
|
110
88
|
- !ruby/object:Gem::Version
|
111
|
-
version: '0'
|
89
|
+
version: '3.0'
|
112
90
|
type: :development
|
113
91
|
prerelease: false
|
114
92
|
version_requirements: !ruby/object:Gem::Requirement
|
115
93
|
requirements:
|
116
|
-
- - "
|
94
|
+
- - "~>"
|
117
95
|
- !ruby/object:Gem::Version
|
118
|
-
version: '0'
|
96
|
+
version: '3.0'
|
119
97
|
- !ruby/object:Gem::Dependency
|
120
|
-
name:
|
98
|
+
name: rubocop
|
121
99
|
requirement: !ruby/object:Gem::Requirement
|
122
100
|
requirements:
|
123
101
|
- - "~>"
|
124
102
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
103
|
+
version: 0.63.0
|
126
104
|
type: :development
|
127
105
|
prerelease: false
|
128
106
|
version_requirements: !ruby/object:Gem::Requirement
|
129
107
|
requirements:
|
130
108
|
- - "~>"
|
131
109
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
110
|
+
version: 0.63.0
|
133
111
|
- !ruby/object:Gem::Dependency
|
134
|
-
name:
|
112
|
+
name: rubocop-rspec
|
135
113
|
requirement: !ruby/object:Gem::Requirement
|
136
114
|
requirements:
|
137
|
-
- - "
|
115
|
+
- - "~>"
|
138
116
|
- !ruby/object:Gem::Version
|
139
|
-
version: '
|
117
|
+
version: '1.8'
|
140
118
|
type: :development
|
141
119
|
prerelease: false
|
142
120
|
version_requirements: !ruby/object:Gem::Requirement
|
143
121
|
requirements:
|
144
|
-
- - "
|
122
|
+
- - "~>"
|
145
123
|
- !ruby/object:Gem::Version
|
146
|
-
version: '
|
124
|
+
version: '1.8'
|
147
125
|
- !ruby/object:Gem::Dependency
|
148
|
-
name:
|
126
|
+
name: selenium-webdriver
|
149
127
|
requirement: !ruby/object:Gem::Requirement
|
150
128
|
requirements:
|
151
|
-
- - "
|
129
|
+
- - ">="
|
152
130
|
- !ruby/object:Gem::Version
|
153
|
-
version:
|
131
|
+
version: 3.13.1
|
154
132
|
type: :development
|
155
133
|
prerelease: false
|
156
134
|
version_requirements: !ruby/object:Gem::Requirement
|
157
135
|
requirements:
|
158
|
-
- - "
|
136
|
+
- - ">="
|
159
137
|
- !ruby/object:Gem::Version
|
160
|
-
version:
|
138
|
+
version: 3.13.1
|
161
139
|
- !ruby/object:Gem::Dependency
|
162
|
-
name:
|
140
|
+
name: solr_wrapper
|
163
141
|
requirement: !ruby/object:Gem::Requirement
|
164
142
|
requirements:
|
165
|
-
- - "
|
143
|
+
- - "~>"
|
166
144
|
- !ruby/object:Gem::Version
|
167
|
-
version: '0'
|
145
|
+
version: '2.0'
|
168
146
|
type: :development
|
169
147
|
prerelease: false
|
170
148
|
version_requirements: !ruby/object:Gem::Requirement
|
171
149
|
requirements:
|
172
|
-
- - "
|
150
|
+
- - "~>"
|
173
151
|
- !ruby/object:Gem::Version
|
174
|
-
version: '0'
|
152
|
+
version: '2.0'
|
175
153
|
- !ruby/object:Gem::Dependency
|
176
|
-
name:
|
154
|
+
name: webdrivers
|
177
155
|
requirement: !ruby/object:Gem::Requirement
|
178
156
|
requirements:
|
179
|
-
- - "
|
157
|
+
- - "~>"
|
180
158
|
- !ruby/object:Gem::Version
|
181
|
-
version:
|
159
|
+
version: '3.0'
|
182
160
|
type: :development
|
183
161
|
prerelease: false
|
184
162
|
version_requirements: !ruby/object:Gem::Requirement
|
185
163
|
requirements:
|
186
|
-
- - "
|
164
|
+
- - "~>"
|
187
165
|
- !ruby/object:Gem::Version
|
188
|
-
version:
|
189
|
-
description:
|
166
|
+
version: '3.0'
|
167
|
+
description: Blacklight plugin providing map views for records with geographic data.
|
190
168
|
email:
|
191
169
|
- cabeer@stanford.edu
|
192
170
|
- pjreed@stanford.edu
|
@@ -197,12 +175,15 @@ extra_rdoc_files: []
|
|
197
175
|
files:
|
198
176
|
- ".coveralls.yml"
|
199
177
|
- ".gitignore"
|
178
|
+
- ".rubocop.yml"
|
179
|
+
- ".solr_wrapper.yml"
|
200
180
|
- ".travis.yml"
|
201
181
|
- CONTRIBUTING.md
|
202
182
|
- Gemfile
|
203
183
|
- LICENSE.txt
|
204
184
|
- README.md
|
205
185
|
- Rakefile
|
186
|
+
- app/assets/images/blacklight/maps.svg
|
206
187
|
- app/assets/javascripts/blacklight-maps.js
|
207
188
|
- app/assets/javascripts/blacklight-maps/blacklight-maps-browse.js
|
208
189
|
- app/assets/stylesheets/blacklight_maps/blacklight-maps.scss
|
@@ -216,18 +197,24 @@ files:
|
|
216
197
|
- app/views/catalog/_show_maplet_default.html.erb
|
217
198
|
- app/views/catalog/map.html.erb
|
218
199
|
- blacklight-maps.gemspec
|
219
|
-
- config/jetty.yml
|
220
200
|
- config/locales/blacklight-maps-zh.yml
|
201
|
+
- config/locales/blacklight-maps.ar.yml
|
202
|
+
- config/locales/blacklight-maps.de.yml
|
221
203
|
- config/locales/blacklight-maps.en.yml
|
204
|
+
- config/locales/blacklight-maps.es.yml
|
222
205
|
- config/locales/blacklight-maps.fr.yml
|
206
|
+
- config/locales/blacklight-maps.hu.yml
|
223
207
|
- config/locales/blacklight-maps.it.yml
|
208
|
+
- config/locales/blacklight-maps.nl.yml
|
209
|
+
- config/locales/blacklight-maps.pt-BR.yml
|
210
|
+
- config/locales/blacklight-maps.sq.yml
|
224
211
|
- config/routes.rb
|
225
212
|
- docs/blacklight-maps_index-view.png
|
226
213
|
- docs/blacklight-maps_map-view.png
|
227
214
|
- docs/blacklight-maps_search-control.png
|
228
215
|
- docs/blacklight-maps_show-view.png
|
229
216
|
- lib/blacklight/maps.rb
|
230
|
-
- lib/blacklight/maps/
|
217
|
+
- lib/blacklight/maps/controller.rb
|
231
218
|
- lib/blacklight/maps/engine.rb
|
232
219
|
- lib/blacklight/maps/export.rb
|
233
220
|
- lib/blacklight/maps/geometry.rb
|
@@ -236,15 +223,11 @@ files:
|
|
236
223
|
- lib/blacklight/maps/version.rb
|
237
224
|
- lib/generators/blacklight_maps/install_generator.rb
|
238
225
|
- lib/generators/blacklight_maps/templates/blacklight_maps.css.scss
|
239
|
-
- lib/generators/blacklight_maps/templates/saved_searches_controller.rb
|
240
226
|
- lib/generators/blacklight_maps/templates/search_history_controller.rb
|
227
|
+
- lib/generators/blacklight_maps/templates/solr/conf/schema.xml
|
228
|
+
- lib/generators/blacklight_maps/templates/solr/conf/solrconfig.xml
|
241
229
|
- lib/railties/blacklight_maps.rake
|
242
|
-
- solr_conf/conf/schema.xml
|
243
|
-
- solr_conf/conf/solrconfig.xml
|
244
230
|
- spec/controllers/catalog_controller_spec.rb
|
245
|
-
- spec/features/initial_view_spec.rb
|
246
|
-
- spec/features/maps_spec.rb
|
247
|
-
- spec/features/show_view_maplet_spec.rb
|
248
231
|
- spec/fixtures/sample_solr_documents.yml
|
249
232
|
- spec/helpers/blacklight_maps_helper_spec.rb
|
250
233
|
- spec/lib/blacklight/maps/export_spec.rb
|
@@ -252,13 +235,26 @@ files:
|
|
252
235
|
- spec/lib/blacklight/maps/maps_search_builder_spec.rb
|
253
236
|
- spec/lib/blacklight/maps/render_constraints_override_spec.rb
|
254
237
|
- spec/spec_helper.rb
|
255
|
-
- spec/
|
238
|
+
- spec/system/index_view_spec.rb
|
239
|
+
- spec/system/initial_view_spec.rb
|
240
|
+
- spec/system/map_view_spec.rb
|
241
|
+
- spec/system/show_view_maplet_spec.rb
|
256
242
|
- spec/test_app_templates/lib/generators/test_app_generator.rb
|
243
|
+
- vendor/assets/images/layers-2x.png
|
244
|
+
- vendor/assets/images/layers.png
|
245
|
+
- vendor/assets/images/marker-icon-2x.png
|
246
|
+
- vendor/assets/images/marker-icon.png
|
247
|
+
- vendor/assets/images/marker-shadow.png
|
248
|
+
- vendor/assets/javascripts/leaflet.js.erb
|
249
|
+
- vendor/assets/javascripts/leaflet.markercluster.js
|
250
|
+
- vendor/assets/stylesheets/MarkerCluster.Default.css
|
251
|
+
- vendor/assets/stylesheets/MarkerCluster.css
|
252
|
+
- vendor/assets/stylesheets/leaflet.css
|
257
253
|
homepage: https://github.com/projectblacklight/blacklight-maps
|
258
254
|
licenses:
|
259
255
|
- Apache-2.0
|
260
256
|
metadata: {}
|
261
|
-
post_install_message:
|
257
|
+
post_install_message:
|
262
258
|
rdoc_options: []
|
263
259
|
require_paths:
|
264
260
|
- lib
|
@@ -273,16 +269,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
269
|
- !ruby/object:Gem::Version
|
274
270
|
version: '0'
|
275
271
|
requirements: []
|
276
|
-
|
277
|
-
|
278
|
-
signing_key:
|
272
|
+
rubygems_version: 3.0.8
|
273
|
+
signing_key:
|
279
274
|
specification_version: 4
|
280
275
|
summary: Maps for Blacklight
|
281
276
|
test_files:
|
282
277
|
- spec/controllers/catalog_controller_spec.rb
|
283
|
-
- spec/features/initial_view_spec.rb
|
284
|
-
- spec/features/maps_spec.rb
|
285
|
-
- spec/features/show_view_maplet_spec.rb
|
286
278
|
- spec/fixtures/sample_solr_documents.yml
|
287
279
|
- spec/helpers/blacklight_maps_helper_spec.rb
|
288
280
|
- spec/lib/blacklight/maps/export_spec.rb
|
@@ -290,5 +282,8 @@ test_files:
|
|
290
282
|
- spec/lib/blacklight/maps/maps_search_builder_spec.rb
|
291
283
|
- spec/lib/blacklight/maps/render_constraints_override_spec.rb
|
292
284
|
- spec/spec_helper.rb
|
293
|
-
- spec/
|
285
|
+
- spec/system/index_view_spec.rb
|
286
|
+
- spec/system/initial_view_spec.rb
|
287
|
+
- spec/system/map_view_spec.rb
|
288
|
+
- spec/system/show_view_maplet_spec.rb
|
294
289
|
- spec/test_app_templates/lib/generators/test_app_generator.rb
|
data/config/jetty.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
module BlacklightMaps
|
2
|
-
module ControllerOverride
|
3
|
-
extend ActiveSupport::Concern
|
4
|
-
|
5
|
-
included do
|
6
|
-
self.send(:include, BlacklightMaps::RenderConstraintsOverride)
|
7
|
-
self.send(:helper, BlacklightMaps::RenderConstraintsOverride)
|
8
|
-
end
|
9
|
-
|
10
|
-
def map
|
11
|
-
(@response, @document_list) = search_results(params)
|
12
|
-
params[:view] = 'maps'
|
13
|
-
respond_to do |format|
|
14
|
-
format.html
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
feature 'Initial view parameter', js: true do
|
4
|
-
before :all do
|
5
|
-
CatalogController.configure_blacklight do |config|
|
6
|
-
config.view.maps.facet_mode = 'coordinates'
|
7
|
-
config.view.maps.coordinates_facet_field = 'coordinates_facet'
|
8
|
-
config.add_facet_field 'coordinates_facet', :limit => -2, :label => 'Coordinates', :show => false
|
9
|
-
end
|
10
|
-
end
|
11
|
-
scenario 'defaults to zoom area of markers' do
|
12
|
-
visit search_catalog_path f: { format: ['Book'] }, view: 'maps'
|
13
|
-
expect(page).to have_css '.leaflet-marker-icon.marker-cluster', count: 8
|
14
|
-
end
|
15
|
-
scenario 'when provided sets map to its view' do
|
16
|
-
map_tag = '<div id="blacklight-index-map" data-initialview="[[37.65, -122.56],[37.89, -122.27]]" data-maxzoom="18" data-tileurl="http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" data-mapattribution="Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>" data-searchcontrol="true" data-catalogpath="/catalog" data-placenamefield="placename_field" data-clustercount="hits" />'.html_safe
|
17
|
-
expect_any_instance_of(Blacklight::BlacklightMapsHelperBehavior).to receive(:blacklight_map_tag).and_return(map_tag)
|
18
|
-
visit search_catalog_path f: { format: ['Book'] }, view: 'maps'
|
19
|
-
expect(page).to_not have_css '.leaflet-marker-icon.marker-cluster'
|
20
|
-
end
|
21
|
-
end
|
data/spec/features/maps_spec.rb
DELETED
@@ -1,202 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Map View", js: true do
|
4
|
-
|
5
|
-
before :each do
|
6
|
-
CatalogController.blacklight_config = Blacklight::Configuration.new
|
7
|
-
end
|
8
|
-
|
9
|
-
describe "catalog#index and catalog#map views" do
|
10
|
-
|
11
|
-
describe "catalog#index map view" do
|
12
|
-
|
13
|
-
before :each do
|
14
|
-
CatalogController.configure_blacklight do |config|
|
15
|
-
# use geojson facet for blacklight-maps catalog#index map view specs
|
16
|
-
config.add_facet_field 'geojson', :limit => -2, :label => 'GeoJSON', :show => false
|
17
|
-
config.add_facet_fields_to_solr_request!
|
18
|
-
end
|
19
|
-
visit search_catalog_path :q => 'korea', :view => 'maps'
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should display map elements" do
|
23
|
-
expect(page).to have_selector("#documents.map")
|
24
|
-
expect(page).to have_selector("#blacklight-index-map")
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should display tile layer attribution" do
|
28
|
-
expect(find("div.leaflet-control-container")).to have_content('OpenStreetMap contributors, CC-BY-SA')
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "#sortAndPerPage" do
|
32
|
-
|
33
|
-
it "should show the mapped item count" do
|
34
|
-
expect(page).to have_selector(".mapped-count .badge", text: "4")
|
35
|
-
end
|
36
|
-
|
37
|
-
it "should show the mapped item caveat" do
|
38
|
-
expect(page).to have_selector(".mapped-caveat")
|
39
|
-
end
|
40
|
-
|
41
|
-
# TODO: placeholder spec: #sortAndPerPage > .view-type > .view-type-group
|
42
|
-
# should show active map icon. however, this spec doesn't work because
|
43
|
-
# Blacklight::ConfigurationHelperBehavior#has_alternative_views? returns false,
|
44
|
-
# so catalog/_view_type_group partial renders no content, can't figure out why
|
45
|
-
it "should show the map view icon" #do
|
46
|
-
#expect(page).to have_selector(".view-type-maps.active")
|
47
|
-
#end
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
describe "data attributes" do
|
52
|
-
|
53
|
-
it "maxzoom should be from config" do
|
54
|
-
expect(page).to have_selector("#blacklight-index-map[data-maxzoom='#{CatalogController.blacklight_config.view.maps.maxzoom}']")
|
55
|
-
end
|
56
|
-
|
57
|
-
it "tileurl should be from config" do
|
58
|
-
expect(page).to have_selector("#blacklight-index-map[data-tileurl='#{CatalogController.blacklight_config.view.maps.tileurl}']")
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
describe "marker clusters" do
|
64
|
-
|
65
|
-
before {
|
66
|
-
0.upto(2) { find("a.leaflet-control-zoom-out").click } # zoom out to create cluster
|
67
|
-
}
|
68
|
-
|
69
|
-
it "should have marker cluster div" do
|
70
|
-
expect(page).to have_selector("div.marker-cluster")
|
71
|
-
end
|
72
|
-
|
73
|
-
it "should only have one marker cluster" do
|
74
|
-
expect(page).to have_selector("div.marker-cluster", count: 1)
|
75
|
-
end
|
76
|
-
|
77
|
-
it "should show the result count" do
|
78
|
-
expect(find("div.marker-cluster")).to have_content(4)
|
79
|
-
end
|
80
|
-
|
81
|
-
describe "click marker cluster" do
|
82
|
-
|
83
|
-
before { find("div.marker-cluster").click }
|
84
|
-
|
85
|
-
it "should split into two marker clusters" do
|
86
|
-
expect(page).to have_selector("div.marker-cluster", count: 2)
|
87
|
-
end
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
end
|
92
|
-
|
93
|
-
describe "marker popups" do
|
94
|
-
before do
|
95
|
-
find('.marker-cluster', text: '1', match: :first).click
|
96
|
-
end
|
97
|
-
|
98
|
-
it "should show a popup with correct content" do
|
99
|
-
expect(page).to have_selector("div.leaflet-popup-content-wrapper")
|
100
|
-
expect(page).to have_content("Seoul (Korea)")
|
101
|
-
end
|
102
|
-
|
103
|
-
describe "click search link" do
|
104
|
-
|
105
|
-
before { find("div.leaflet-popup-content a").click }
|
106
|
-
|
107
|
-
it "should run a new search" do
|
108
|
-
expect(page).to have_selector(".constraint-value .filterValue", text: "Seoul (Korea)")
|
109
|
-
end
|
110
|
-
|
111
|
-
it "should use the default view type" do
|
112
|
-
expect(current_url).to include("view=list")
|
113
|
-
end
|
114
|
-
|
115
|
-
end
|
116
|
-
|
117
|
-
end
|
118
|
-
|
119
|
-
describe "map search control" do
|
120
|
-
|
121
|
-
it "should have a search control" do
|
122
|
-
expect(page).to have_selector(".leaflet-control .search-control")
|
123
|
-
end
|
124
|
-
|
125
|
-
describe "search control hover" do
|
126
|
-
|
127
|
-
before { find(".search-control").hover }
|
128
|
-
|
129
|
-
it "should add a border to the map" do
|
130
|
-
expect(page).to have_selector(".leaflet-overlay-pane path")
|
131
|
-
end
|
132
|
-
|
133
|
-
end
|
134
|
-
|
135
|
-
describe "search control click" do
|
136
|
-
|
137
|
-
before { find(".search-control").click }
|
138
|
-
|
139
|
-
it "should run a new search" do
|
140
|
-
expect(page).to have_selector(".constraint.coordinates")
|
141
|
-
expect(current_url).to include("view=list")
|
142
|
-
end
|
143
|
-
|
144
|
-
end
|
145
|
-
|
146
|
-
end
|
147
|
-
|
148
|
-
end
|
149
|
-
|
150
|
-
describe "catalog#map view" do
|
151
|
-
|
152
|
-
before :each do
|
153
|
-
CatalogController.configure_blacklight do |config|
|
154
|
-
# use coordinates_facet facet for blacklight-maps catalog#map view specs
|
155
|
-
config.view.maps.facet_mode = 'coordinates'
|
156
|
-
config.view.maps.coordinates_facet_field = 'coordinates_facet'
|
157
|
-
config.add_facet_field 'coordinates_facet', :limit => -2, :label => 'Coordinates', :show => false
|
158
|
-
config.add_facet_fields_to_solr_request!
|
159
|
-
end
|
160
|
-
visit map_path
|
161
|
-
# print page.html # debugging
|
162
|
-
end
|
163
|
-
|
164
|
-
it "should display map elements" do
|
165
|
-
expect(page).to have_selector("#documents.map")
|
166
|
-
expect(page).to have_selector("#blacklight-index-map")
|
167
|
-
end
|
168
|
-
|
169
|
-
it "should display some markers" do
|
170
|
-
expect(page).to have_selector("div.marker-cluster")
|
171
|
-
end
|
172
|
-
|
173
|
-
describe "marker popups" do
|
174
|
-
|
175
|
-
before :each do
|
176
|
-
0.upto(1) { find("a.leaflet-control-zoom-in").click } # zoom in
|
177
|
-
find(".marker-cluster:first-child").click
|
178
|
-
end
|
179
|
-
|
180
|
-
it "should show a popup with correct content" do
|
181
|
-
expect(page).to have_selector("div.leaflet-popup-content-wrapper")
|
182
|
-
expect(page).to have_content("[35.86166, 104.195397]")
|
183
|
-
end
|
184
|
-
|
185
|
-
describe "click search link" do
|
186
|
-
|
187
|
-
before { find("div.leaflet-popup-content a").click }
|
188
|
-
|
189
|
-
it "should run a new search" do
|
190
|
-
expect(page).to have_selector(".constraint-value .filterValue", text: "35.86166,104.195397")
|
191
|
-
expect(current_url).to include("view=list")
|
192
|
-
end
|
193
|
-
|
194
|
-
end
|
195
|
-
|
196
|
-
end
|
197
|
-
|
198
|
-
end
|
199
|
-
|
200
|
-
end
|
201
|
-
|
202
|
-
end
|