geoblacklight 2.2.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (277) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +212 -112
  3. data/.rubocop.yml +16 -14
  4. data/.rubocop_todo.yml +28 -151
  5. data/Gemfile +3 -8
  6. data/README.md +1 -1
  7. data/Rakefile +1 -0
  8. data/app/assets/images/blacklight/arrow-circle-down.svg +1 -2
  9. data/app/assets/images/blacklight/baruch-cuny.svg +1 -4
  10. data/app/assets/images/blacklight/berkeley.svg +1 -4
  11. data/app/assets/images/blacklight/book.svg +1 -4
  12. data/app/assets/images/blacklight/bookmark.svg +1 -4
  13. data/app/assets/images/blacklight/cd-rom.svg +1 -4
  14. data/app/assets/images/blacklight/chicago.svg +1 -4
  15. data/app/assets/images/blacklight/citation.svg +3 -0
  16. data/app/assets/images/blacklight/collection.svg +3 -0
  17. data/app/assets/images/blacklight/columbia.svg +1 -4
  18. data/app/assets/images/blacklight/cornell.svg +1 -4
  19. data/app/assets/images/blacklight/dvd-rom.svg +1 -4
  20. data/app/assets/images/blacklight/email.svg +1 -4
  21. data/app/assets/images/blacklight/esri-globe.svg +1 -4
  22. data/app/assets/images/blacklight/globe.svg +1 -2
  23. data/app/assets/images/blacklight/harvard.svg +1 -4
  24. data/app/assets/images/blacklight/home.svg +1 -2
  25. data/app/assets/images/blacklight/illinois.svg +1 -4
  26. data/app/assets/images/blacklight/image.svg +1 -4
  27. data/app/assets/images/blacklight/indiana.svg +1 -4
  28. data/app/assets/images/blacklight/iowa.svg +1 -4
  29. data/app/assets/images/blacklight/leaf.svg +1 -4
  30. data/app/assets/images/blacklight/lewis-clark.svg +1 -4
  31. data/app/assets/images/blacklight/line.svg +1 -4
  32. data/app/assets/images/blacklight/map-marker.svg +1 -4
  33. data/app/assets/images/blacklight/map.svg +1 -4
  34. data/app/assets/images/blacklight/maryland.svg +1 -4
  35. data/app/assets/images/blacklight/massgis.svg +1 -4
  36. data/app/assets/images/blacklight/metadata.svg +1 -4
  37. data/app/assets/images/blacklight/michigan-state.svg +1 -4
  38. data/app/assets/images/blacklight/michigan.svg +1 -4
  39. data/app/assets/images/blacklight/minnesota.svg +1 -4
  40. data/app/assets/images/blacklight/mit.svg +1 -4
  41. data/app/assets/images/blacklight/mixed.svg +1 -4
  42. data/app/assets/images/blacklight/multilinestring.svg +1 -4
  43. data/app/assets/images/blacklight/multipoint.svg +1 -4
  44. data/app/assets/images/blacklight/multipolygon.svg +1 -4
  45. data/app/assets/images/blacklight/nyu.svg +1 -4
  46. data/app/assets/images/blacklight/ohio-state.svg +1 -4
  47. data/app/assets/images/blacklight/pagelines-brands.svg +1 -4
  48. data/app/assets/images/blacklight/paper-map.svg +1 -4
  49. data/app/assets/images/blacklight/penn-state.svg +1 -4
  50. data/app/assets/images/blacklight/point.svg +1 -4
  51. data/app/assets/images/blacklight/polygon.svg +1 -4
  52. data/app/assets/images/blacklight/polyline.svg +1 -4
  53. data/app/assets/images/blacklight/princeton.svg +1 -4
  54. data/app/assets/images/blacklight/public.svg +1 -4
  55. data/app/assets/images/blacklight/purdue.svg +1 -4
  56. data/app/assets/images/blacklight/raster.svg +1 -4
  57. data/app/assets/images/blacklight/restricted.svg +1 -4
  58. data/app/assets/images/blacklight/sms.svg +1 -4
  59. data/app/assets/images/blacklight/stanford.svg +1 -4
  60. data/app/assets/images/blacklight/table.svg +1 -4
  61. data/app/assets/images/blacklight/tags.svg +1 -2
  62. data/app/assets/images/blacklight/texas.svg +1 -4
  63. data/app/assets/images/blacklight/tufts.svg +1 -4
  64. data/app/assets/images/blacklight/ucla.svg +1 -4
  65. data/app/assets/images/blacklight/uva.svg +1 -4
  66. data/app/assets/images/blacklight/web_services.svg +1 -4
  67. data/app/assets/images/blacklight/wisconsin.svg +1 -4
  68. data/app/assets/javascripts/geoblacklight/basemaps.js +18 -0
  69. data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +1 -1
  70. data/app/assets/javascripts/geoblacklight/modules/geosearch.js +1 -1
  71. data/app/assets/javascripts/geoblacklight/modules/home.js +1 -1
  72. data/app/assets/javascripts/geoblacklight/modules/item.js +20 -1
  73. data/app/assets/javascripts/geoblacklight/modules/results.js +4 -2
  74. data/app/assets/javascripts/geoblacklight/modules/svg_tooltips.js +31 -0
  75. data/app/assets/javascripts/geoblacklight/viewers/esri.js +2 -2
  76. data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +1 -1
  77. data/app/assets/javascripts/geoblacklight/viewers/wms.js +2 -2
  78. data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +2 -0
  79. data/app/assets/stylesheets/geoblacklight/modules/_base.scss +33 -0
  80. data/app/assets/stylesheets/geoblacklight/{_blacklight_overrides.scss → modules/_blacklight_overrides.scss} +1 -10
  81. data/app/assets/stylesheets/geoblacklight/{_styles.scss → modules/_styles.scss} +1 -0
  82. data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +37 -54
  83. data/app/assets/stylesheets/geoblacklight/modules/item.scss +13 -0
  84. data/app/assets/stylesheets/geoblacklight/modules/results.scss +26 -29
  85. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +12 -42
  86. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +17 -59
  87. data/app/controllers/download_controller.rb +12 -12
  88. data/app/controllers/relation_controller.rb +1 -0
  89. data/app/controllers/wms_controller.rb +1 -0
  90. data/app/helpers/arcgis_helper.rb +1 -0
  91. data/app/helpers/blacklight_helper.rb +1 -0
  92. data/app/helpers/carto_helper.rb +1 -0
  93. data/app/helpers/geoblacklight_helper.rb +36 -79
  94. data/app/models/concerns/geoblacklight/solr_document.rb +15 -9
  95. data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +2 -1
  96. data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -13
  97. data/app/models/concerns/geoblacklight/solr_document/citation.rb +29 -0
  98. data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
  99. data/app/models/concerns/geoblacklight/solr_document/inspection.rb +2 -1
  100. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +3 -1
  101. data/app/presenters/geoblacklight/document_presenter.rb +2 -1
  102. data/app/views/catalog/_arcgis.html.erb +4 -0
  103. data/app/views/catalog/_carto.html.erb +4 -0
  104. data/app/views/catalog/_citation.html.erb +11 -0
  105. data/app/views/catalog/_data_dictionary.html.erb +1 -1
  106. data/app/views/catalog/_document_action.html.erb +1 -1
  107. data/app/views/catalog/_document_split.html.erb +1 -1
  108. data/app/views/catalog/_downloads_primary.html.erb +8 -1
  109. data/app/views/catalog/_header_icons.html.erb +3 -3
  110. data/app/views/catalog/_home_text.html.erb +4 -1
  111. data/app/views/catalog/_index_split_default.html.erb +22 -14
  112. data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
  113. data/app/views/catalog/_web_services_wfs.html.erb +3 -3
  114. data/app/views/catalog/_web_services_wms.html.erb +3 -3
  115. data/app/views/catalog/metadata.html.erb +3 -1
  116. data/app/views/catalog/web_services.html.erb +9 -7
  117. data/app/views/relation/_ancestors.html.erb +2 -5
  118. data/app/views/relation/_descendants.html.erb +3 -6
  119. data/app/views/relation/index.html.erb +20 -8
  120. data/app/views/relation/index.json.jbuilder +2 -1
  121. data/app/views/shared/_header_navbar.html.erb +1 -3
  122. data/bin/coverage.rb +36 -0
  123. data/config/initializers/rails_config.rb +1 -0
  124. data/config/locales/geoblacklight.en.yml +46 -61
  125. data/geoblacklight.gemspec +5 -8
  126. data/lib/generators/geoblacklight/assets_generator.rb +46 -0
  127. data/lib/generators/geoblacklight/install_generator.rb +8 -9
  128. data/lib/generators/geoblacklight/templates/assets/_blacklight.scss +1 -0
  129. data/lib/generators/geoblacklight/templates/assets/_customizations.scss +28 -0
  130. data/{app/assets/stylesheets/geoblacklight/application.scss → lib/generators/geoblacklight/templates/assets/_geoblacklight.scss} +0 -1
  131. data/lib/generators/geoblacklight/templates/assets/application.scss +7 -0
  132. data/lib/generators/geoblacklight/templates/{geoblacklight.js → assets/geoblacklight.js} +0 -1
  133. data/lib/generators/geoblacklight/templates/catalog_controller.rb +6 -2
  134. data/lib/generators/geoblacklight/templates/settings.yml +4 -6
  135. data/lib/generators/geoblacklight/webpacker_generator.rb +2 -1
  136. data/lib/geoblacklight.rb +1 -0
  137. data/lib/geoblacklight/bounding_box.rb +1 -0
  138. data/lib/geoblacklight/catalog_helper_override.rb +2 -1
  139. data/lib/geoblacklight/constants.rb +1 -0
  140. data/lib/geoblacklight/download.rb +6 -5
  141. data/lib/geoblacklight/download/geojson_download.rb +1 -0
  142. data/lib/geoblacklight/download/geotiff_download.rb +1 -0
  143. data/lib/geoblacklight/download/hgl_download.rb +1 -0
  144. data/lib/geoblacklight/download/kmz_download.rb +2 -1
  145. data/lib/geoblacklight/download/shapefile_download.rb +1 -0
  146. data/lib/geoblacklight/engine.rb +2 -2
  147. data/lib/geoblacklight/exceptions.rb +1 -0
  148. data/lib/geoblacklight/geoblacklight_helper_behavior.rb +1 -0
  149. data/lib/geoblacklight/item_viewer.rb +1 -0
  150. data/lib/geoblacklight/metadata.rb +1 -0
  151. data/lib/geoblacklight/metadata/base.rb +3 -2
  152. data/lib/geoblacklight/metadata/fgdc.rb +1 -0
  153. data/lib/geoblacklight/metadata/html.rb +2 -2
  154. data/lib/geoblacklight/metadata/iso19139.rb +1 -0
  155. data/lib/geoblacklight/metadata_transformer.rb +1 -0
  156. data/lib/geoblacklight/metadata_transformer/base.rb +1 -0
  157. data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
  158. data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
  159. data/lib/geoblacklight/reference.rb +1 -0
  160. data/lib/geoblacklight/references.rb +7 -3
  161. data/lib/geoblacklight/relation/ancestors.rb +2 -1
  162. data/lib/geoblacklight/relation/descendants.rb +2 -1
  163. data/lib/geoblacklight/relation/relation_response.rb +2 -1
  164. data/lib/geoblacklight/routes.rb +1 -0
  165. data/lib/geoblacklight/routes/downloadable.rb +1 -0
  166. data/lib/geoblacklight/routes/exportable.rb +1 -0
  167. data/lib/geoblacklight/routes/wms.rb +1 -0
  168. data/lib/geoblacklight/version.rb +2 -1
  169. data/lib/geoblacklight/view_helper_override.rb +2 -1
  170. data/lib/geoblacklight/wms_layer.rb +3 -2
  171. data/lib/geoblacklight/wms_layer/feature_info_response.rb +1 -0
  172. data/lib/tasks/geoblacklight.rake +33 -32
  173. data/solr/conf/schema.xml +5 -5
  174. data/spec/controllers/catalog_controller_spec.rb +1 -0
  175. data/spec/controllers/download_controller_spec.rb +2 -1
  176. data/spec/controllers/relation_controller_spec.rb +1 -0
  177. data/spec/controllers/wms_controller_spec.rb +2 -1
  178. data/spec/factories/user.rb +1 -0
  179. data/spec/features/bookmarks_spec.rb +1 -0
  180. data/spec/features/configurable_basemap_spec.rb +10 -0
  181. data/spec/features/data_dictionary_download_spec.rb +1 -0
  182. data/spec/features/download_layer_spec.rb +1 -0
  183. data/spec/features/empty_search_spec.rb +1 -0
  184. data/spec/features/esri_viewer_spec.rb +1 -6
  185. data/spec/features/exports_spec.rb +4 -12
  186. data/spec/features/help_text_spec.rb +1 -0
  187. data/spec/features/home_page_spec.rb +6 -0
  188. data/spec/features/iiif_viewer_spec.rb +1 -0
  189. data/spec/features/index_map_spec.rb +1 -0
  190. data/spec/features/layer_inspection_spec.rb +1 -0
  191. data/spec/features/layer_opacity_spec.rb +1 -0
  192. data/spec/features/layer_preview_spec.rb +1 -0
  193. data/spec/features/layer_with_no_references_spec.rb +1 -0
  194. data/spec/features/linkified_attribute_table_spec.rb +1 -0
  195. data/spec/features/metadata_panel_spec.rb +1 -0
  196. data/spec/features/missing_metadata_spec.rb +13 -0
  197. data/spec/features/multiple_downloads_spec.rb +15 -0
  198. data/spec/features/oembed_spec.rb +1 -0
  199. data/spec/features/relations_spec.rb +10 -28
  200. data/spec/features/saved_searches_spec.rb +1 -0
  201. data/spec/features/search_bar_spec.rb +1 -0
  202. data/spec/features/search_results_map_spec.rb +1 -6
  203. data/spec/features/search_results_overlap_ratio_spec.rb +4 -3
  204. data/spec/features/search_spec.rb +1 -0
  205. data/spec/features/show_page_metadata_spec.rb +1 -0
  206. data/spec/features/sms_spec.rb +1 -0
  207. data/spec/features/split_view.html.erb_spec.rb +4 -3
  208. data/spec/features/suppressed_records_spec.rb +1 -0
  209. data/spec/features/web_services_modal_spec.rb +1 -0
  210. data/spec/fixtures/solr_documents/metadata_no_dct_provenance_s.json +30 -0
  211. data/spec/fixtures/solr_documents/metadata_no_layer_geom_type_s.json +17 -0
  212. data/spec/fixtures/solr_documents/metadata_no_solr_geom.json +23 -0
  213. data/spec/fixtures/solr_documents/multiple-downloads.json +30 -0
  214. data/spec/helpers/arcgis_helper_spec.rb +1 -0
  215. data/spec/helpers/carto_helper_spec.rb +1 -0
  216. data/spec/helpers/geoblacklight_helper_spec.rb +51 -5
  217. data/spec/javascripts/geoblacklight/viewers/esri/tiled_map_layer_spec.js +12 -0
  218. data/spec/javascripts/geoblacklight_spec.js +0 -4
  219. data/spec/lib/geoblacklight/bounding_box_spec.rb +1 -0
  220. data/spec/lib/geoblacklight/controller_override_spec.rb +1 -0
  221. data/spec/lib/geoblacklight/document_presenter_spec.rb +3 -2
  222. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -0
  223. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -0
  224. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +1 -0
  225. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +1 -0
  226. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -0
  227. data/spec/lib/geoblacklight/download_spec.rb +4 -3
  228. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -0
  229. data/spec/lib/geoblacklight/item_viewer_spec.rb +1 -0
  230. data/spec/lib/geoblacklight/metadata/base_spec.rb +4 -3
  231. data/spec/lib/geoblacklight/metadata/html_spec.rb +1 -0
  232. data/spec/lib/geoblacklight/metadata_spec.rb +1 -0
  233. data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +3 -2
  234. data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +3 -2
  235. data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +3 -2
  236. data/spec/lib/geoblacklight/metadata_transformer_spec.rb +4 -3
  237. data/spec/lib/geoblacklight/reference_spec.rb +1 -0
  238. data/spec/lib/geoblacklight/references_spec.rb +2 -3
  239. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +2 -1
  240. data/spec/lib/geoblacklight/relation/descendants_spec.rb +2 -1
  241. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +1 -0
  242. data/spec/lib/geoblacklight/view_helper_override_spec.rb +1 -0
  243. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +5 -4
  244. data/spec/lib/geoblacklight/wms_layer_spec.rb +3 -2
  245. data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +1 -20
  246. data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +14 -0
  247. data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +1 -0
  248. data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +1 -0
  249. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +27 -0
  250. data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +15 -2
  251. data/spec/routing/catalog_routing_spec.rb +1 -0
  252. data/spec/spec_helper.rb +12 -9
  253. data/spec/support/backport_test_helpers.rb +1 -0
  254. data/spec/support/features.rb +1 -0
  255. data/spec/support/features/session_helpers.rb +1 -0
  256. data/spec/support/fixtures.rb +8 -0
  257. data/spec/tasks/geoblacklight_spec.rb +19 -0
  258. data/spec/teaspoon_env.rb +1 -0
  259. data/spec/test_app_templates/Gemfile.extra +1 -0
  260. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -0
  261. data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -0
  262. data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -0
  263. data/spec/views/catalog/_results_pagination.html.erb_spec.rb +1 -0
  264. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +1 -0
  265. data/spec/views/catalog/_show_tools.html.erb_spec.rb +2 -4
  266. data/template.rb +1 -0
  267. data/vendor/assets/stylesheets/leaflet.css +0 -1
  268. metadata +69 -79
  269. data/app/assets/images/blacklight/logo.png +0 -0
  270. data/app/assets/javascripts/geoblacklight/modules/collapse.js +0 -7
  271. data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +0 -36
  272. data/app/assets/stylesheets/geoblacklight/modules/relations.scss +0 -15
  273. data/app/views/catalog/_exports.html.erb +0 -3
  274. data/app/views/catalog/_show_tools.html.erb +0 -25
  275. data/lib/generators/geoblacklight/templates/geoblacklight.scss +0 -4
  276. data/vendor/assets/javascripts/readmore.js +0 -618
  277. data/vendor/assets/javascripts/readmore.js.map +0 -1
@@ -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="*_ti" dest="text" />
173
- <copyField source="*_tmi" dest="text" />
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,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe CatalogController, type: :controller do
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
- describe Geoblacklight::DownloadController, type: :controller do
4
+ describe DownloadController, type: :controller do
4
5
  describe '#file' do
5
6
  describe 'restricted file' do
6
7
  it 'redirects to login for authentication' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe RelationController, type: :controller do
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
- describe Geoblacklight::WmsController, type: :controller do
4
+ describe WmsController, type: :controller do
4
5
  let(:wms_layer) { instance_double('Geoblacklight::WmsLayer') }
5
6
  let(:feature_info) { { values: ['fid', 'layer:example'] } }
6
7
  let(:params) do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  FactoryBot.define do
2
3
  factory :user do
3
4
  sequence(:email) { |n| "user#{n}@example.com" }
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Blacklight Bookmarks' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Configurable basemap', js: true do
@@ -23,4 +24,13 @@ feature 'Configurable basemap', js: true do
23
24
  expect(page).to have_css "img[src*='dark_all']"
24
25
  end
25
26
  end
27
+ feature 'using openstreetmapHot' do
28
+ before do
29
+ CatalogController.blacklight_config.basemap_provider = 'openstreetmapHot'
30
+ end
31
+ scenario 'has openstreetmapHot map' do
32
+ visit root_path
33
+ expect(page).to have_css "img[src*='hot']"
34
+ end
35
+ end
26
36
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Data dictionary download tool' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Download layer' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Empty search' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'feature_layer reference', js: true do
@@ -13,7 +14,6 @@ feature 'feature_layer reference', js: true do
13
14
  expect(page).to have_css 'img.leaflet-image-layer', visible: true
14
15
  end
15
16
  scenario 'displays dynamic layer (single layer)' do
16
- pending 'external service disabled cors access'
17
17
  visit solr_document_path '4669301e-b4b2-4c8b-bf40-01b968a2865b'
18
18
  expect(page).to have_css '.leaflet-control-zoom', visible: true
19
19
  expect(page).to have_css 'img.leaflet-image-layer', visible: true
@@ -25,11 +25,6 @@ feature 'feature_layer reference', js: true do
25
25
  expect(Nokogiri::HTML.parse(page.body).css('g').length).to eq 23
26
26
  fail
27
27
  end
28
- scenario 'displays image map layer' do
29
- visit solr_document_path '32653ed6-8d83-4692-8a06-bf13ffe2c018'
30
- expect(page).to have_css '.leaflet-control-zoom', visible: true
31
- expect(page).to have_css 'img.leaflet-image-layer', visible: true
32
- end
33
28
  scenario 'displays tiled map layer' do
34
29
  visit solr_document_path 'nyu-test-soil-survey-map'
35
30
  expect(page).to have_css '.leaflet-control-zoom', visible: true
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Export features' do
@@ -5,7 +6,7 @@ feature 'Export features' do
5
6
  feature 'Open in Carto' do
6
7
  scenario 'shows up in tools' do
7
8
  visit solr_document_path 'tufts-cambridgegrid100-04'
8
- expect(page).to have_css 'li.exports a', text: 'Open in Carto'
9
+ expect(page).to have_css 'li.carto a', text: 'Open in Carto'
9
10
  click_link 'Open in Carto'
10
11
  end
11
12
  end
@@ -14,23 +15,14 @@ feature 'Export features' do
14
15
  feature 'Open in ArcGIS Online' do
15
16
  scenario 'shows up in tools' do
16
17
  visit solr_document_path '90f14ff4-1359-4beb-b931-5cb41d20ab90'
17
- expect(page).to have_css 'li.exports a', text: 'Open in ArcGIS Online'
18
+ expect(page).to have_css 'li.arcgis a', text: 'Open in ArcGIS Online'
18
19
  end
19
20
  end
20
21
  end
21
22
  feature 'when restricted or no wfs' do
22
23
  scenario 'is not in tools' do
23
24
  visit solr_document_path 'princeton-02870w62c'
24
- expect(page).not_to have_css 'li.exports a', text: 'Open in Carto'
25
- end
26
- end
27
- context 'when carto is configured not to display' do
28
- before do
29
- allow(Settings).to receive(:CARTO_HIDE).and_return(true)
30
- end
31
- it 'will not display the carto link' do
32
- visit solr_document_path 'tufts-cambridgegrid100-04'
33
- expect(page).not_to have_css 'li.exports a', text: 'Open in Carto'
25
+ expect(page).not_to have_css 'li.carto a', text: 'Open in Carto'
34
26
  end
35
27
  end
36
28
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Help Text' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Home page', js: true do # use js: true for tests which require js, but it slows things down
@@ -37,4 +38,9 @@ feature 'Home page', js: true do # use js: true for tests which require js, but
37
38
  end
38
39
  expect(page).to have_css '#documents'
39
40
  end
41
+ scenario 'can search by placename' do
42
+ click_link 'Minnesota, United States'
43
+ results = page.all(:css, 'article.document')
44
+ expect(results.count).to equal(3)
45
+ end
40
46
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'iiif reference' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Index map' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Layer inspection', js: true do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Layer opacity', js: true do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Layer preview', js: true do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'layer with no wms or iiif' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Attribute table values', js: true do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Metadata tools' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Missing metadata', js: true do
@@ -9,4 +10,16 @@ feature 'Missing metadata', js: true do
9
10
  visit solr_document_path('aster-global-emissivity-dataset-1-kilometer-v003-ag1kmcad20')
10
11
  expect(page).to have_css('#map')
11
12
  end
13
+ scenario 'Yields error free show page for no layer_geom_type_s' do
14
+ visit solr_document_path('05d-03-noGeomType')
15
+ expect(page).to have_css('#map')
16
+ end
17
+ scenario 'Yields error free show page for no dct_provenance_s' do
18
+ visit solr_document_path('99-0001-noProvenance')
19
+ expect(page).to have_css('#map')
20
+ end
21
+ scenario 'Yields error free show page for no solr_geom' do
22
+ visit solr_document_path('05d-p16022coll246-noGeo')
23
+ expect(page).to have_css('#map')
24
+ end
12
25
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helper'
3
+
4
+ feature 'Multiple downloads' do
5
+ feature 'when item has multiple downloads in dct_references_s' do
6
+ scenario 'downloads are listed in download card' do
7
+ visit solr_document_path 'cugir-007950'
8
+ within '.card.downloads' do
9
+ expect(page).to have_link 'Shapefile', href: 'https://cugir-data.s3.amazonaws.com/00/79/50/cugir-007950.zip'
10
+ expect(page).to have_link 'PDF', href: 'https://cugir-data.s3.amazonaws.com/00/79/50/agBROO.pdf'
11
+ expect(page).to have_link 'KMZ', href: 'https://cugir-data.s3.amazonaws.com/00/79/50/agBROO2011.kmz'
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Oembed layer' do
@@ -1,51 +1,33 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Display related documents' do
4
- let(:expected_json_resp) do
5
- {
6
- 'ancestors' =>
7
- {
8
- 'numFound' => 0,
9
- 'start' => 0,
10
- 'docs' => []
11
- },
12
- 'descendants' =>
13
- {
14
- 'numFound' => 1,
15
- 'start' => 0,
16
- 'docs' =>
17
- [
18
- {
19
- 'dc_title_s' => '2015 New York City Subway Complexes and Ridership',
20
- 'layer_slug_s' => 'nyu_2451_34502'
21
- }
22
- ]
23
- },
24
- 'current_doc' => 'nyu_2451_34635'
25
- }
26
- end
27
5
  scenario 'Record with dc_source_sm value(s) should have parent(s)' do
28
6
  visit relations_solr_document_path('nyu_2451_34502')
29
- expect(page).to have_css('ul b', text: 'Source Datasets')
7
+ expect(page).to have_css('.relations .card-header h2', text: 'Source Datasets')
30
8
  end
31
9
 
32
10
  scenario 'Record that is pointed to by others should have children' do
33
11
  visit relations_solr_document_path('nyu_2451_34635')
34
- expect(page).to have_css('ul b', text: 'Derived Datasets')
12
+ expect(page).to have_css('.relations .card-header h2', text: 'Derived Datasets')
35
13
  end
36
14
 
37
15
  scenario 'Relations should respond to json' do
38
16
  visit relations_solr_document_path('nyu_2451_34635', format: 'json')
39
- expect(page.body).to eq(expected_json_resp.to_json)
17
+ response = JSON.parse(page.body)
18
+ expect(response['ancestors']['numFound']).to eq 0
19
+ expect(response['descendants']['docs'].first['layer_slug_s']).to eq 'nyu_2451_34502'
20
+ expect(response['current_doc']).to eq 'nyu_2451_34635'
40
21
  end
41
22
 
42
23
  scenario 'Record with relations should render widget in catalog#show', js: true do
43
24
  visit solr_document_path('nyu_2451_34635')
44
- expect(page).to have_css('div.card-header', text: 'Data Relations')
25
+ expect(page).to have_css('.card.relations')
26
+ expect(page).to have_css('div.card-header', text: 'Derived Datasets')
45
27
  end
46
28
 
47
29
  scenario 'Record without relations should not render widget in catalog#show', js: true do
48
30
  visit solr_document_path('harvard-g7064-s2-1834-k3')
49
- expect(page).to have_no_css('div.panel-heading', text: 'Data Relations')
31
+ expect(page).to have_no_css('.card.relations')
50
32
  end
51
33
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'saved searches' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'search bar' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'search results map', js: true do
@@ -5,12 +6,6 @@ feature 'search results map', js: true do
5
6
  visit search_catalog_path(q: 'Minnesota')
6
7
  expect(page).to have_css '#map'
7
8
  end
8
- scenario 'present on a search result page' do
9
- visit root_path
10
- click_link 'Minnesota, United States'
11
- results = page.all(:css, 'article.document')
12
- expect(results.count).to equal(3)
13
- end
14
9
  scenario 'view is scoped to Minnesota' do
15
10
  visit root_path
16
11
  click_link 'Minnesota, United States'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'spatial search results overlap ratio' do
@@ -34,15 +35,15 @@ feature 'spatial search results overlap ratio' do
34
35
 
35
36
  # NY State result
36
37
  # Bigger bbox / result bbox overlaps bbox param best
37
- expect(position_in_result_page(page, 'cugir-008186')).to be < 3
38
+ expect(position_in_result_page(page, 'cugir-008186')).to be < 4
38
39
 
39
40
  # NY State result
40
41
  # Bigger bbox / result bbox overlaps bbox param best (score tie)
41
- expect(position_in_result_page(page, 'cugir-008186-no-downloadurl')).to be < 3
42
+ expect(position_in_result_page(page, 'cugir-008186-no-downloadurl')).to be < 4
42
43
 
43
44
  # NY Adirondak Region result
44
45
  # Smaller bbox / result bbox overlaps bbox param the least
45
- expect(position_in_result_page(page, 'cugir-007741')).to eq 3
46
+ expect(position_in_result_page(page, 'cugir-007741')).to eq 4
46
47
  end
47
48
  end
48
49
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Search' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Metadata display on show page' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'SMS tool', js: true do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Index view', js: true do
@@ -30,7 +31,7 @@ feature 'Index view', js: true do
30
31
  expect(page).to have_css('div.card.facet-limit', text: 'Data type')
31
32
  expect(page).to have_css('div.card.facet-limit', text: 'Format')
32
33
  end
33
- click_link 'Institution'
34
+ click_button 'Institution'
34
35
  using_wait_time 120 do
35
36
  expect(page).to have_css('a.facet-select', text: 'Minnesota', visible: true)
36
37
  expect(page).to have_css('a.facet-select', text: 'MIT', visible: true)
@@ -51,9 +52,9 @@ feature 'Index view', js: true do
51
52
  end
52
53
 
53
54
  scenario 'click on a record area to expand collapse' do
54
- within('.documentHeader', match: :first) do
55
+ within('article', match: :first) do
55
56
  expect(page).not_to have_css('.collapse')
56
- find('.status-icons').click
57
+ find('button').click
57
58
  expect(page).to have_css('.collapse', visible: true)
58
59
  end
59
60
  end