geoblacklight 2.1.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (291) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +214 -108
  3. data/.gitignore +3 -1
  4. data/.rubocop.yml +19 -15
  5. data/.rubocop_todo.yml +28 -159
  6. data/Gemfile +3 -8
  7. data/README.md +6 -7
  8. data/Rakefile +1 -0
  9. data/app/assets/images/blacklight/arrow-circle-down.svg +3 -0
  10. data/app/assets/images/blacklight/baruch-cuny.svg +3 -0
  11. data/app/assets/images/blacklight/berkeley.svg +4 -0
  12. data/app/assets/images/blacklight/book.svg +3 -0
  13. data/app/assets/images/blacklight/bookmark.svg +3 -0
  14. data/app/assets/images/blacklight/cd-rom.svg +3 -0
  15. data/app/assets/images/blacklight/chicago.svg +4 -0
  16. data/app/assets/images/blacklight/citation.svg +3 -0
  17. data/app/assets/images/blacklight/collection.svg +3 -0
  18. data/app/assets/images/blacklight/columbia.svg +3 -0
  19. data/app/assets/images/blacklight/cornell.svg +5 -0
  20. data/app/assets/images/blacklight/dvd-rom.svg +3 -0
  21. data/app/assets/images/blacklight/email.svg +3 -0
  22. data/app/assets/images/blacklight/esri-globe.svg +31 -37
  23. data/app/assets/images/blacklight/geoblacklight-icons.json +2079 -0
  24. data/app/assets/images/blacklight/globe.svg +3 -0
  25. data/app/assets/images/blacklight/harvard.svg +3 -0
  26. data/app/assets/images/blacklight/home.svg +3 -0
  27. data/app/assets/images/blacklight/illinois.svg +4 -0
  28. data/app/assets/images/blacklight/image.svg +3 -0
  29. data/app/assets/images/blacklight/indiana.svg +3 -0
  30. data/app/assets/images/blacklight/iowa.svg +3 -0
  31. data/app/assets/images/blacklight/leaf.svg +3 -0
  32. data/app/assets/images/blacklight/lewis-clark.svg +5 -0
  33. data/app/assets/images/blacklight/line.svg +4 -0
  34. data/app/assets/images/blacklight/logo.svg +1 -0
  35. data/app/assets/images/blacklight/map-marker.svg +3 -0
  36. data/app/assets/images/blacklight/map.svg +3 -0
  37. data/app/assets/images/blacklight/maryland.svg +3 -0
  38. data/app/assets/images/blacklight/massgis.svg +3 -0
  39. data/app/assets/images/blacklight/metadata.svg +3 -0
  40. data/app/assets/images/blacklight/michigan-state.svg +4 -0
  41. data/app/assets/images/blacklight/michigan.svg +3 -0
  42. data/app/assets/images/blacklight/minnesota.svg +3 -0
  43. data/app/assets/images/blacklight/mit.svg +3 -0
  44. data/app/assets/images/blacklight/mixed.svg +5 -0
  45. data/app/assets/images/blacklight/multilinestring.svg +6 -0
  46. data/app/assets/images/blacklight/multipoint.svg +3 -0
  47. data/app/assets/images/blacklight/multipolygon.svg +6 -0
  48. data/app/assets/images/blacklight/nyu.svg +6 -0
  49. data/app/assets/images/blacklight/ohio-state.svg +5 -0
  50. data/app/assets/images/blacklight/pagelines-brands.svg +3 -0
  51. data/app/assets/images/blacklight/paper-map.svg +3 -0
  52. data/app/assets/images/blacklight/penn-state.svg +4 -0
  53. data/app/assets/images/blacklight/point.svg +3 -0
  54. data/app/assets/images/blacklight/polygon.svg +4 -0
  55. data/app/assets/images/blacklight/polyline.svg +6 -0
  56. data/app/assets/images/blacklight/princeton.svg +3 -0
  57. data/app/assets/images/blacklight/public.svg +3 -0
  58. data/app/assets/images/blacklight/purdue.svg +4 -0
  59. data/app/assets/images/blacklight/raster.svg +3 -0
  60. data/app/assets/images/blacklight/restricted.svg +3 -0
  61. data/app/assets/images/blacklight/sms.svg +3 -0
  62. data/app/assets/images/blacklight/stanford.svg +3 -0
  63. data/app/assets/images/blacklight/table.svg +3 -0
  64. data/app/assets/images/blacklight/tags.svg +3 -0
  65. data/app/assets/images/blacklight/texas.svg +3 -0
  66. data/app/assets/images/blacklight/tufts.svg +3 -0
  67. data/app/assets/images/blacklight/ucla.svg +3 -0
  68. data/app/assets/images/blacklight/uva.svg +3 -0
  69. data/app/assets/images/blacklight/web_services.svg +3 -0
  70. data/app/assets/images/blacklight/wisconsin.svg +3 -0
  71. data/app/assets/javascripts/geoblacklight/basemaps.js +18 -0
  72. data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +1 -1
  73. data/app/assets/javascripts/geoblacklight/modules/geosearch.js +1 -1
  74. data/app/assets/javascripts/geoblacklight/modules/help_text.js +7 -0
  75. data/app/assets/javascripts/geoblacklight/modules/home.js +1 -1
  76. data/app/assets/javascripts/geoblacklight/modules/item.js +19 -2
  77. data/app/assets/javascripts/geoblacklight/modules/results.js +4 -2
  78. data/app/assets/javascripts/geoblacklight/modules/svg_tooltips.js +31 -0
  79. data/app/assets/javascripts/geoblacklight/viewers/esri.js +2 -2
  80. data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +1 -1
  81. data/app/assets/javascripts/geoblacklight/viewers/oembed.js +13 -0
  82. data/app/assets/javascripts/geoblacklight/viewers/wms.js +2 -2
  83. data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +2 -0
  84. data/app/assets/stylesheets/geoblacklight/modules/_base.scss +33 -0
  85. data/app/assets/stylesheets/geoblacklight/{_blacklight_overrides.scss → modules/_blacklight_overrides.scss} +8 -9
  86. data/app/assets/stylesheets/geoblacklight/{_styles.scss → modules/_styles.scss} +1 -0
  87. data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +37 -54
  88. data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +49 -59
  89. data/app/assets/stylesheets/geoblacklight/modules/item.scss +17 -0
  90. data/app/assets/stylesheets/geoblacklight/modules/results.scss +47 -28
  91. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +12 -42
  92. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +17 -55
  93. data/app/controllers/download_controller.rb +12 -12
  94. data/app/controllers/relation_controller.rb +1 -0
  95. data/app/controllers/wms_controller.rb +1 -0
  96. data/app/helpers/arcgis_helper.rb +1 -0
  97. data/app/helpers/blacklight_helper.rb +1 -0
  98. data/app/helpers/carto_helper.rb +1 -0
  99. data/app/helpers/geoblacklight_helper.rb +62 -19
  100. data/app/models/concerns/geoblacklight/solr_document.rb +18 -8
  101. data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +2 -1
  102. data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -13
  103. data/app/models/concerns/geoblacklight/solr_document/citation.rb +29 -0
  104. data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
  105. data/app/models/concerns/geoblacklight/solr_document/inspection.rb +2 -1
  106. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +8 -1
  107. data/app/presenters/geoblacklight/document_presenter.rb +2 -1
  108. data/app/views/catalog/_arcgis.html.erb +4 -0
  109. data/app/views/catalog/_carto.html.erb +4 -0
  110. data/app/views/catalog/_citation.html.erb +11 -0
  111. data/app/views/catalog/_data_dictionary.html.erb +3 -2
  112. data/app/views/catalog/_document_action.html.erb +1 -1
  113. data/app/views/catalog/_document_split.html.erb +1 -1
  114. data/app/views/catalog/_downloads_primary.html.erb +8 -1
  115. data/app/views/catalog/_header_icons.html.erb +3 -3
  116. data/app/views/catalog/_home_text.html.erb +8 -5
  117. data/app/views/catalog/_index_split_default.html.erb +22 -14
  118. data/app/views/catalog/_show_default_viewer_container.html.erb +6 -1
  119. data/app/views/catalog/_show_header_default.html.erb +2 -4
  120. data/app/views/catalog/_web_services_wfs.html.erb +3 -3
  121. data/app/views/catalog/_web_services_wms.html.erb +3 -3
  122. data/app/views/catalog/metadata.html.erb +3 -1
  123. data/app/views/catalog/web_services.html.erb +9 -7
  124. data/app/views/relation/_ancestors.html.erb +3 -5
  125. data/app/views/relation/_descendants.html.erb +4 -6
  126. data/app/views/relation/index.html.erb +20 -8
  127. data/app/views/relation/index.json.jbuilder +2 -1
  128. data/app/views/shared/_header_navbar.html.erb +1 -1
  129. data/bin/coverage.rb +36 -0
  130. data/config/initializers/rails_config.rb +1 -0
  131. data/config/locales/geoblacklight.en.yml +75 -2
  132. data/geoblacklight.gemspec +6 -8
  133. data/lib/generators/geoblacklight/assets_generator.rb +46 -0
  134. data/lib/generators/geoblacklight/install_generator.rb +8 -9
  135. data/lib/generators/geoblacklight/templates/assets/_blacklight.scss +1 -0
  136. data/lib/generators/geoblacklight/templates/assets/_customizations.scss +28 -0
  137. data/{app/assets/stylesheets/geoblacklight/application.scss → lib/generators/geoblacklight/templates/assets/_geoblacklight.scss} +0 -1
  138. data/lib/generators/geoblacklight/templates/assets/application.scss +7 -0
  139. data/lib/generators/geoblacklight/templates/{geoblacklight.js → assets/geoblacklight.js} +0 -1
  140. data/lib/generators/geoblacklight/templates/catalog_controller.rb +6 -2
  141. data/lib/generators/geoblacklight/templates/settings.yml +17 -0
  142. data/lib/generators/geoblacklight/webpacker_generator.rb +2 -1
  143. data/lib/geoblacklight.rb +1 -0
  144. data/lib/geoblacklight/bounding_box.rb +1 -0
  145. data/lib/geoblacklight/catalog_helper_override.rb +2 -1
  146. data/lib/geoblacklight/constants.rb +4 -2
  147. data/lib/geoblacklight/download.rb +6 -5
  148. data/lib/geoblacklight/download/geojson_download.rb +1 -0
  149. data/lib/geoblacklight/download/geotiff_download.rb +1 -0
  150. data/lib/geoblacklight/download/hgl_download.rb +1 -0
  151. data/lib/geoblacklight/download/kmz_download.rb +2 -1
  152. data/lib/geoblacklight/download/shapefile_download.rb +1 -0
  153. data/lib/geoblacklight/engine.rb +1 -2
  154. data/lib/geoblacklight/exceptions.rb +1 -0
  155. data/lib/geoblacklight/geoblacklight_helper_behavior.rb +1 -0
  156. data/lib/geoblacklight/item_viewer.rb +6 -1
  157. data/lib/geoblacklight/metadata.rb +1 -0
  158. data/lib/geoblacklight/metadata/base.rb +16 -10
  159. data/lib/geoblacklight/metadata/fgdc.rb +1 -0
  160. data/lib/geoblacklight/metadata/html.rb +2 -2
  161. data/lib/geoblacklight/metadata/iso19139.rb +1 -0
  162. data/lib/geoblacklight/metadata_transformer.rb +1 -0
  163. data/lib/geoblacklight/metadata_transformer/base.rb +1 -0
  164. data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
  165. data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
  166. data/lib/geoblacklight/reference.rb +3 -1
  167. data/lib/geoblacklight/references.rb +7 -3
  168. data/lib/geoblacklight/relation/ancestors.rb +2 -1
  169. data/lib/geoblacklight/relation/descendants.rb +2 -1
  170. data/lib/geoblacklight/relation/relation_response.rb +2 -1
  171. data/lib/geoblacklight/routes.rb +1 -0
  172. data/lib/geoblacklight/routes/downloadable.rb +1 -0
  173. data/lib/geoblacklight/routes/exportable.rb +1 -0
  174. data/lib/geoblacklight/routes/wms.rb +1 -0
  175. data/lib/geoblacklight/version.rb +2 -1
  176. data/lib/geoblacklight/view_helper_override.rb +2 -1
  177. data/lib/geoblacklight/wms_layer.rb +3 -2
  178. data/lib/geoblacklight/wms_layer/feature_info_response.rb +1 -0
  179. data/lib/tasks/geoblacklight.rake +33 -32
  180. data/package.json +4 -0
  181. data/schema/references.md +2 -1
  182. data/solr/conf/schema.xml +5 -5
  183. data/spec/controllers/catalog_controller_spec.rb +1 -0
  184. data/spec/controllers/download_controller_spec.rb +2 -1
  185. data/spec/controllers/relation_controller_spec.rb +1 -0
  186. data/spec/controllers/wms_controller_spec.rb +2 -1
  187. data/spec/factories/user.rb +1 -0
  188. data/spec/features/bookmarks_spec.rb +1 -0
  189. data/spec/features/configurable_basemap_spec.rb +10 -0
  190. data/spec/features/data_dictionary_download_spec.rb +1 -0
  191. data/spec/features/download_layer_spec.rb +1 -0
  192. data/spec/features/empty_search_spec.rb +1 -0
  193. data/spec/features/esri_viewer_spec.rb +1 -6
  194. data/spec/features/exports_spec.rb +4 -3
  195. data/spec/features/help_text_spec.rb +9 -0
  196. data/spec/features/home_page_spec.rb +6 -0
  197. data/spec/features/iiif_viewer_spec.rb +1 -0
  198. data/spec/features/index_map_spec.rb +1 -0
  199. data/spec/features/layer_inspection_spec.rb +1 -0
  200. data/spec/features/layer_opacity_spec.rb +1 -0
  201. data/spec/features/layer_preview_spec.rb +1 -0
  202. data/spec/features/layer_with_no_references_spec.rb +1 -0
  203. data/spec/features/linkified_attribute_table_spec.rb +1 -0
  204. data/spec/features/metadata_panel_spec.rb +52 -8
  205. data/spec/features/missing_metadata_spec.rb +13 -0
  206. data/spec/features/multiple_downloads_spec.rb +15 -0
  207. data/spec/features/oembed_spec.rb +10 -0
  208. data/spec/features/relations_spec.rb +10 -28
  209. data/spec/features/saved_searches_spec.rb +1 -0
  210. data/spec/features/search_bar_spec.rb +1 -0
  211. data/spec/features/search_results_map_spec.rb +2 -7
  212. data/spec/features/search_results_overlap_ratio_spec.rb +4 -3
  213. data/spec/features/search_spec.rb +1 -0
  214. data/spec/features/show_page_metadata_spec.rb +1 -0
  215. data/spec/features/sms_spec.rb +1 -0
  216. data/spec/features/split_view.html.erb_spec.rb +5 -4
  217. data/spec/features/suppressed_records_spec.rb +15 -0
  218. data/spec/features/web_services_modal_spec.rb +1 -0
  219. data/spec/fixtures/fgdc/harvard-g7064-s2-1834-k3.xml +1 -0
  220. data/spec/fixtures/iso19139/stanford-cg357zz0321.xml +581 -0
  221. data/spec/fixtures/mods/fb897vt9938.mods +111 -0
  222. data/spec/fixtures/mods/stanford-cg357zz0321.mods +113 -0
  223. data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +1 -1
  224. data/spec/fixtures/solr_documents/metadata_no_dct_provenance_s.json +30 -0
  225. data/spec/fixtures/solr_documents/metadata_no_layer_geom_type_s.json +17 -0
  226. data/spec/fixtures/solr_documents/metadata_no_solr_geom.json +23 -0
  227. data/spec/fixtures/solr_documents/multiple-downloads.json +30 -0
  228. data/spec/fixtures/solr_documents/oembed.json +24 -0
  229. data/spec/helpers/arcgis_helper_spec.rb +1 -0
  230. data/spec/helpers/carto_helper_spec.rb +1 -0
  231. data/spec/helpers/geoblacklight_helper_spec.rb +81 -12
  232. data/spec/javascripts/geoblacklight/viewers/esri/tiled_map_layer_spec.js +12 -0
  233. data/spec/javascripts/metadata_download_button_spec.js +1 -1
  234. data/spec/lib/geoblacklight/bounding_box_spec.rb +1 -0
  235. data/spec/lib/geoblacklight/controller_override_spec.rb +1 -0
  236. data/spec/lib/geoblacklight/document_presenter_spec.rb +3 -2
  237. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -0
  238. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -0
  239. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +1 -0
  240. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +1 -0
  241. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -0
  242. data/spec/lib/geoblacklight/download_spec.rb +4 -3
  243. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -0
  244. data/spec/lib/geoblacklight/item_viewer_spec.rb +1 -0
  245. data/spec/lib/geoblacklight/metadata/base_spec.rb +22 -7
  246. data/spec/lib/geoblacklight/metadata/html_spec.rb +1 -0
  247. data/spec/lib/geoblacklight/metadata_spec.rb +1 -0
  248. data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +3 -2
  249. data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +3 -2
  250. data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +3 -2
  251. data/spec/lib/geoblacklight/metadata_transformer_spec.rb +4 -3
  252. data/spec/lib/geoblacklight/reference_spec.rb +31 -0
  253. data/spec/lib/geoblacklight/references_spec.rb +2 -3
  254. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +2 -1
  255. data/spec/lib/geoblacklight/relation/descendants_spec.rb +2 -1
  256. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +1 -0
  257. data/spec/lib/geoblacklight/view_helper_override_spec.rb +1 -0
  258. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +5 -4
  259. data/spec/lib/geoblacklight/wms_layer_spec.rb +3 -2
  260. data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +1 -20
  261. data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +14 -0
  262. data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +1 -0
  263. data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +1 -0
  264. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +47 -0
  265. data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +15 -2
  266. data/spec/routing/catalog_routing_spec.rb +1 -0
  267. data/spec/spec_helper.rb +20 -14
  268. data/spec/support/backport_test_helpers.rb +1 -0
  269. data/spec/support/features.rb +1 -0
  270. data/spec/support/features/session_helpers.rb +1 -0
  271. data/spec/support/fixtures.rb +8 -0
  272. data/spec/tasks/geoblacklight_spec.rb +19 -0
  273. data/spec/teaspoon_env.rb +1 -0
  274. data/spec/test_app_templates/Gemfile.extra +1 -0
  275. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -0
  276. data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -0
  277. data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -0
  278. data/spec/views/catalog/_results_pagination.html.erb_spec.rb +1 -0
  279. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +1 -0
  280. data/spec/views/catalog/_show_tools.html.erb_spec.rb +2 -4
  281. data/template.rb +1 -0
  282. data/vendor/assets/stylesheets/leaflet.css +0 -1
  283. metadata +158 -75
  284. data/app/assets/images/blacklight/logo.png +0 -0
  285. data/app/assets/javascripts/geoblacklight/modules/collapse.js +0 -7
  286. data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +0 -36
  287. data/app/assets/stylesheets/geoblacklight/modules/relations.scss +0 -15
  288. data/app/views/catalog/_exports.html.erb +0 -11
  289. data/app/views/catalog/_show_tools.html.erb +0 -25
  290. data/lib/generators/geoblacklight/templates/geoblacklight.scss +0 -4
  291. data/vendor/assets/javascripts/readmore.min.js +0 -11
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Metadata
3
4
  class Fgdc < Base
@@ -1,9 +1,9 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Metadata
3
4
  class Html < Base
4
5
  def transform
5
- ActionController::Base.helpers.content_tag(:iframe,
6
- '',
6
+ ActionController::Base.helpers.tag.iframe('',
7
7
  src: @reference.endpoint,
8
8
  scrolling: 'yes',
9
9
  frameborder: 0)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Metadata
3
4
  class Iso19139 < Base
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'geo_combine'
2
3
 
3
4
  module Geoblacklight
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module MetadataTransformer
3
4
  ##
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module MetadataTransformer
3
4
  ##
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module MetadataTransformer
3
4
  ##
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  ##
3
4
  # Parses an array of dct_references to create useful reference information
@@ -36,9 +37,10 @@ module Geoblacklight
36
37
 
37
38
  ##
38
39
  # The URI used for this instance's creation
40
+ # Remove any trailing slashes
39
41
  # @return [String]
40
42
  def uri
41
- @reference[0]
43
+ @reference[0].sub(/(\/)+$/, '') if @reference[0].present?
42
44
  end
43
45
  end
44
46
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  # References is a geoblacklight-schema dct:references parser
3
4
  class References
@@ -43,7 +44,7 @@ module Geoblacklight
43
44
  # Preferred download (should be a file download)
44
45
  # @return [Hash, nil]
45
46
  def preferred_download
46
- return file_download unless download.blank?
47
+ return file_download if download.present?
47
48
  end
48
49
 
49
50
  ##
@@ -100,9 +101,12 @@ module Geoblacklight
100
101
  # present
101
102
  # @return (see #downloads_by_format)
102
103
  def vector_download_formats
103
- { shapefile: wfs.to_hash,
104
+ return unless wms.present? && wfs.present?
105
+ {
106
+ shapefile: wfs.to_hash,
104
107
  kmz: wms.to_hash,
105
- geojson: wfs.to_hash } if wms.present? && wfs.present?
108
+ geojson: wfs.to_hash
109
+ }
106
110
  end
107
111
 
108
112
  ##
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Relation
3
4
  class Ancestors
@@ -8,7 +9,7 @@ module Geoblacklight
8
9
 
9
10
  def create_search_params
10
11
  { fq: ["{!join from=#{Settings.FIELDS.SOURCE} to=layer_slug_s}layer_slug_s:#{@search_id}"],
11
- fl: [Settings.FIELDS.TITLE, 'layer_slug_s'] }
12
+ fl: [Settings.FIELDS.TITLE, 'layer_slug_s', Settings.FIELDS.GEOM_TYPE] }
12
13
  end
13
14
 
14
15
  def execute_query
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Relation
3
4
  class Descendants
@@ -8,7 +9,7 @@ module Geoblacklight
8
9
 
9
10
  def create_search_params
10
11
  { fq: "#{Settings.FIELDS.SOURCE}:#{@search_id}",
11
- fl: [Settings.FIELDS.TITLE, 'layer_slug_s'] }
12
+ fl: [Settings.FIELDS.TITLE, 'layer_slug_s', Settings.FIELDS.GEOM_TYPE] }
12
13
  end
13
14
 
14
15
  def execute_query
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Relation
3
4
  class RelationResponse
@@ -17,7 +18,7 @@ module Geoblacklight
17
18
  end
18
19
 
19
20
  def empty?
20
- !(ancestors['numFound'] > 0 || descendants['numFound'] > 0)
21
+ !(ancestors['numFound'].positive? || descendants['numFound'].positive?)
21
22
  end
22
23
  end
23
24
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Routes
3
4
  require 'geoblacklight/routes/exportable'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Routes
3
4
  class Downloadable
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Routes
3
4
  class Exportable
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Routes
3
4
  class Wms
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
- VERSION = '2.1.2'.freeze
3
+ VERSION = '3.0.0'
3
4
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module ViewHelperOverride
3
4
  include CatalogHelperOverride
@@ -26,7 +27,7 @@ module Geoblacklight
26
27
 
27
28
  def render_constraints_filters(localized_params = params)
28
29
  content = super(localized_params)
29
- localized_params = localized_params.to_unsafe_h unless localized_params.is_a?(Hash)
30
+ localized_params = localized_params.to_unsafe_h if localized_params.respond_to?(:to_unsafe_h)
30
31
 
31
32
  if localized_params[:bbox]
32
33
  path = search_action_path(remove_spatial_filter_group(:bbox, localized_params))
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  class WmsLayer
3
4
  def initialize(params)
@@ -24,10 +25,10 @@ module Geoblacklight
24
25
  request.options.timeout = Settings.TIMEOUT_WMS
25
26
  request.options.open_timeout = Settings.TIMEOUT_WMS
26
27
  end
27
- rescue Faraday::Error::ConnectionFailed => error
28
+ rescue Faraday::ConnectionFailed => error
28
29
  Geoblacklight.logger.error error.inspect
29
30
  { error: error.inspect }
30
- rescue Faraday::Error::TimeoutError => error
31
+ rescue Faraday::TimeoutError => error
31
32
  Geoblacklight.logger.error error.inspect
32
33
  { error: error.inspect }
33
34
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  class FeatureInfoResponse
3
4
  def initialize(response)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rails/generators'
2
3
  require 'generators/geoblacklight/install_generator'
3
4
 
@@ -7,15 +8,15 @@ namespace :geoblacklight do
7
8
  require 'solr_wrapper'
8
9
  SolrWrapper.wrap(port: '8983') do |solr|
9
10
  solr.with_collection(name: 'blacklight-core', dir: File.join(File.expand_path('../../', File.dirname(__FILE__)), 'solr', 'conf')) do
10
- puts "\nSolr server running: http://localhost:#{solr.port}/solr/#/blacklight-core"
11
- puts "\n^C to stop"
12
- puts ' '
13
- begin
14
- Rake::Task['geoblacklight:solr:seed'].invoke
15
- system "bundle exec rails s #{args[:rails_server_args]}"
16
- rescue Interrupt
17
- puts 'Shutting down...'
18
- end
11
+ puts "\nSolr server running: http://localhost:#{solr.port}/solr/#/blacklight-core"
12
+ puts "\n^C to stop"
13
+ puts ' '
14
+ begin
15
+ Rake::Task['geoblacklight:solr:seed'].invoke
16
+ system "bundle exec rails s #{args[:rails_server_args]}"
17
+ rescue Interrupt
18
+ puts 'Shutting down...'
19
+ end
19
20
  end
20
21
  end
21
22
  end
@@ -30,7 +31,7 @@ namespace :geoblacklight do
30
31
  puts ' '
31
32
  begin
32
33
  Rake::Task['geoblacklight:solr:seed'].invoke
33
- system "foreman start"
34
+ system 'foreman start'
34
35
  rescue Interrupt
35
36
  puts 'Shutting down...'
36
37
  end
@@ -39,23 +40,23 @@ namespace :geoblacklight do
39
40
  end
40
41
 
41
42
  namespace :index do
42
- desc "Put sample data into solr"
43
+ desc 'Put sample data into solr'
43
44
  task :seed => :environment do
44
45
  docs = Dir['spec/fixtures/solr_documents/*.json'].map { |f| JSON.parse File.read(f) }.flatten
45
46
  Blacklight.default_index.connection.add docs
46
47
  Blacklight.default_index.connection.commit
47
48
  end
48
49
 
49
- desc "Ingests a GeoHydra transformed.json"
50
+ desc 'Ingests a GeoHydra transformed.json'
50
51
  task :ingest_all => :environment do
51
- docs = JSON::parse(File.read("#{Rails.root}/tmp/transformed.json"))
52
+ docs = JSON.parse(File.read(Rails.root.join('tmp', 'transformed.json')))
52
53
  docs.each do |doc|
53
54
  Blacklight.default_index.connection.add doc
54
55
  Blacklight.default_index.connection.commit
55
56
  end
56
57
  end
57
58
 
58
- desc "Ingests a directory of geoblacklight.json files"
59
+ desc 'Ingests a directory of geoblacklight.json files'
59
60
  task :ingest, [:directory] => :environment do |_t, args|
60
61
  args.with_defaults(directory: 'data')
61
62
  Dir.glob(File.join(args[:directory], '**', 'geoblacklight.json')).each do |fn|
@@ -66,7 +67,7 @@ namespace :geoblacklight do
66
67
  puts "Failed to ingest #{fn}: #{e.inspect}"
67
68
  end
68
69
  end
69
- puts "Committing changes to Solr"
70
+ puts 'Committing changes to Solr'
70
71
  Blacklight.default_index.connection.commit
71
72
  end
72
73
  end
@@ -74,33 +75,33 @@ namespace :geoblacklight do
74
75
  namespace :downloads do
75
76
  desc 'Delete all cached downloads'
76
77
  task delete: :environment do
77
- FileUtils.rm_rf Dir.glob("#{Rails.root}/tmp/cache/downloads/*")
78
+ FileUtils.rm_rf Dir.glob(Rails.root.join('tmp', 'cache', 'downloads', '*'))
78
79
  end
79
80
  desc 'Create download directory'
80
81
  task mkdir: :environment do
81
- FileUtils.mkdir_p Dir.glob("#{Rails.root}/tmp/cache/downloads")
82
+ FileUtils.mkdir_p(Rails.root.join('tmp', 'cache', 'downloads'), verbose: true)
82
83
  end
83
84
  desc 'Precaches a download'
84
- task :precache, [:doc_id, :download_type, :timeout] => [:environment] do |t, args|
85
- begin
86
- fail 'Please supply required arguments [document_id, download_type and timeout]' unless args[:doc_id] && args[:download_type] && args[:timeout]
87
- document = Geoblacklight::SolrDocument.find(args[:doc_id])
88
- fail Blacklight::Exceptions::RecordNotFound if document[:layer_slug_s] != args[:doc_id]
89
- download = "Geoblacklight::#{args[:download_type].capitalize}Download"
90
- .constantize.new(document, timeout: args[:timeout].to_i)
91
- download.get
92
- Rails.logger.info "Successfully downloaded #{download.file_name}"
93
- Rails.logger.info "#{Geoblacklight::ShapefileDownload.file_path}"
94
- rescue Geoblacklight::Exceptions::ExternalDownloadFailed => error
95
- Rails.logger.error error.message + ' ' + error.url
96
- rescue NameError
97
- Rails.logger.error "Could not find that download type \"#{args[:download_type]}\""
85
+ task :precache, [:doc_id, :download_type, :timeout] => [:environment] do |_t, args|
86
+ unless args[:doc_id] && args[:download_type] && args[:timeout]
87
+ fail 'Please supply required arguments [document_id, download_type and timeout]'
98
88
  end
89
+ document = Geoblacklight::SolrDocument.find(args[:doc_id])
90
+ fail Blacklight::Exceptions::RecordNotFound if document[:layer_slug_s] != args[:doc_id]
91
+ download = "Geoblacklight::#{args[:download_type].capitalize}Download"
92
+ .constantize.new(document, timeout: args[:timeout].to_i)
93
+ download.get
94
+ Rails.logger.info "Successfully downloaded #{download.file_name}"
95
+ Rails.logger.info Geoblacklight::ShapefileDownload.file_path.to_s
96
+ rescue Geoblacklight::Exceptions::ExternalDownloadFailed => error
97
+ Rails.logger.error error.message + ' ' + error.url
98
+ rescue NameError
99
+ Rails.logger.error "Could not find that download type \"#{args[:download_type]}\""
99
100
  end
100
101
  end
101
102
 
102
103
  namespace :solr do
103
- desc "Put sample data into solr"
104
+ desc 'Put sample data into solr'
104
105
  task :seed => :environment do
105
106
  Rake::Task['geoblacklight:index:seed'].invoke
106
107
  end
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "geoblacklight",
3
+ "version": "2.1.2"
4
+ }
@@ -11,7 +11,7 @@ Direct download file | `http://schema.org/downloadUrl` | Direct file download fe
11
11
  Data dictionary / documentation download | `http://lccn.loc.gov/sh85035852` | Direct documentation download link|
12
12
  Full layer description | `http://schema.org/url` | Further descriptive information about layer|
13
13
  Metadata in ISO 19139 | `http://www.isotc211.org/schemas/2005/gmd/` | Structured metadata in ISO standard expressed as XML|
14
- Metadata in FGDC | `http://www.opengis.net/cat/csw/csdgm/` | Structured metadata in FGDC standard expressed as XML|
14
+ Metadata in FGDC | `http://www.opengis.net/cat/csw/csdgm` | Structured metadata in FGDC standard expressed as XML|
15
15
  Metadata in MODS | `http://www.loc.gov/mods/v3` | Structured metadata in MODS format|
16
16
  Metadata in HTML | `http://www.w3.org/1999/xhtml` | Structured metadata in any standard expressed as HTML|
17
17
  ArcGIS FeatureLayer | `urn:x-esri:serviceType:ArcGIS#FeatureLayer` | Previewing of ArcGIS FeatureLayer Service|
@@ -20,3 +20,4 @@ ArcGIS DynamicMapLayer | `urn:x-esri:serviceType:ArcGIS#DynamicMapLayer` | Previ
20
20
  ArcGIS ImageMapLayer | `urn:x-esri:serviceType:ArcGIS#ImageMapLayer` | Previewing of ArcGIS ImageMapLayer Service|
21
21
  Harvard Geospatial Library Email Download | `http://schema.org/DownloadAction` | Retrieve a file via email from the Harvard Geospatial Library|
22
22
  OpenIndexMap | `https://openindexmaps.org` | Provide an index map preview|
23
+ oEmbed | `https://oembed.com` | Provide an object that is embeddable through an oEmbed service
@@ -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