geoblacklight 2.2.1 → 3.1.0

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} +2 -11
  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 +33 -71
  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
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'Suppressed records' do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  feature 'web services tools' do
@@ -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
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "geoblacklight_version": "1.0",
3
+ "dc_identifier_s": "https://cugir.library.cornell.edu/catalog/cugir-007950",
4
+ "dc_title_s": "Test record with additional download formats",
5
+ "dc_description_s": "This is a test record containing new-style references as nested child documents. In addition to the origianl shapefile download, the references section contains additional PDF and KMZ downloads.",
6
+ "dc_rights_s": "Public",
7
+ "dct_provenance_s": "Cornell",
8
+ "dct_references_s": "{\"http:\/\/schema.org\/downloadUrl\":[{\"url\":\"https:\/\/cugir-data.s3.amazonaws.com\/00\/79\/50\/cugir-007950.zip\",\"label\":\"Shapefile\"},{\"url\":\"https:\/\/cugir-data.s3.amazonaws.com\/00\/79\/50\/agBROO.pdf\",\"label\":\"PDF\"},{\"url\":\"https:\/\/cugir-data.s3.amazonaws.com\/00\/79\/50\/agBROO2011.kmz\",\"label\":\"KMZ\"}],\"http:\/\/www.opengis.net\/cat\/csw\/csdgm\":\"https:\/\/cugir-data.s3.amazonaws.com\/00\/79\/50\/fgdc.xml\",\"http:\/\/www.w3.org\/1999\/xhtml\":\"https:\/\/cugir-data.s3.amazonaws.com\/00\/79\/50\/fgdc.html\",\"http:\/\/www.opengis.net\/def\/serviceType\/ogc\/wfs\":\"https:\/\/cugir.library.cornell.edu\/geoserver\/cugir\/wfs\",\"http:\/\/www.opengis.net\/def\/serviceType\/ogc\/wms\":\"https:\/\/cugir.library.cornell.edu\/geoserver\/cugir\/wms\"}",
9
+ "layer_id_s": "cugir007950",
10
+ "layer_slug_s": "cugir-007950",
11
+ "dc_type_s": "Dataset",
12
+ "dc_format_s": "Shapefile",
13
+ "layer_geom_type_s": "Polygon",
14
+ "layer_modified_dt": "2019-05-24T00:00:00Z",
15
+ "dc_creator_sm": [
16
+ "Cornell Institute for Resource Information Sciences (Cornell IRIS)",
17
+ "NYS Department of Agriculture and Markets"
18
+ ],
19
+ "dc_subject_sm": [
20
+ "New York State Agricultural District boundaries",
21
+ "Agriculture and Markets",
22
+ "Agricultural Districts Mapping Program"
23
+ ],
24
+ "dct_spatial_sm": ["Broome County NY"],
25
+ "dct_issued_s": "2011-02-28",
26
+ "dct_temporal_sm": ["2011"],
27
+ "dct_isPartOf_sm": ["Agricultural Districts (NYS Ag and Markets)"],
28
+ "solr_geom": "ENVELOPE(-76.12987, -75.42034, 42.414648, 41.997963)",
29
+ "solr_year_i": 2011
30
+ }
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe ArcgisHelper, type: :helper do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe CartoHelper, type: :helper do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe GeoblacklightHelper, type: :helper do
@@ -8,7 +9,7 @@ describe GeoblacklightHelper, type: :helper do
8
9
  let(:subject_field) { Settings.FIELDS.SUBJECT }
9
10
  it 'contains unique links' do
10
11
  expect(self).to receive(:search_catalog_path).exactly(3).times.and_return("http://example.com/catalog?f[#{subject_field}][]=category")
11
- html = Capybara.string(render_facet_links(subject_field, %w(Test Test Earth Science)))
12
+ html = Capybara.string(render_facet_links(subject_field, %w[Test Test Earth Science]))
12
13
  expect(html).to have_css 'a', count: 3
13
14
  expect(html).to have_css 'a', text: 'Test', count: 1
14
15
  expect(html).to have_css 'a', text: 'Earth', count: 1
@@ -52,6 +53,17 @@ describe GeoblacklightHelper, type: :helper do
52
53
  end
53
54
  end
54
55
 
56
+ describe '#download_link_file' do
57
+ let(:label) { 'Test Link Text' }
58
+ let(:id) { 'test-id' }
59
+ let(:url) { 'http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.TG10USAIANNH/data.zip' }
60
+
61
+ it 'generates a link to download the original file' do
62
+ puts download_link_file(label, id, url)
63
+ expect(download_link_file(label, id, url)).to eq '<a contentUrl="http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.TG10USAIANNH/data.zip" class="btn btn-default download download-original" data-download="trigger" data-download-type="direct" data-download-id="test-id" href="http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.TG10USAIANNH/data.zip">Test Link Text</a>'
64
+ end
65
+ end
66
+
55
67
  describe '#download_link_direct' do
56
68
  let(:text) { 'Test Link Text' }
57
69
  let(:references_field) { Settings.FIELDS.REFERENCES }
@@ -185,7 +197,7 @@ describe GeoblacklightHelper, type: :helper do
185
197
  context 'as a multivalued Array' do
186
198
  let(:document_attributes) do
187
199
  {
188
- value: %w(short description)
200
+ value: %w[short description]
189
201
  }
190
202
  end
191
203
  it 'uses both values' do
@@ -204,9 +216,9 @@ describe GeoblacklightHelper, type: :helper do
204
216
  allow(helper).to receive(:application_name).and_return('GeoBlacklight')
205
217
  end
206
218
 
207
- describe '#cartodb_link' do
219
+ describe '#carto_link' do
208
220
  it 'aliases CartoHelper#carto_link' do
209
- expect(helper.cartodb_link('http://demo.org/wfs/layer.json')).to eq(helper.carto_link('http://demo.org/wfs/layer.json'))
221
+ expect(helper.carto_link('http://demo.org/wfs/layer.json')).to eq(helper.carto_link('http://demo.org/wfs/layer.json'))
210
222
  end
211
223
  end
212
224
  end
@@ -240,7 +252,7 @@ describe GeoblacklightHelper, type: :helper do
240
252
 
241
253
  describe '#render_value_as_truncate_abstract' do
242
254
  context 'with multiple values' do
243
- let(:document) { SolrDocument.new(value: %w(short description)) }
255
+ let(:document) { SolrDocument.new(value: %w[short description]) }
244
256
  it 'wraps in correct DIV class' do
245
257
  expect(helper.render_value_as_truncate_abstract(document)).to eq '<div class="truncate-abstract">short description</div>'
246
258
  end
@@ -326,4 +338,38 @@ describe GeoblacklightHelper, type: :helper do
326
338
  end
327
339
  end
328
340
  end
341
+
342
+ describe '#relations_icon' do
343
+ context 'when configured to use the geometry type' do
344
+ before do
345
+ allow(Settings).to receive(:USE_GEOM_FOR_RELATIONS_ICON).and_return(true)
346
+ end
347
+
348
+ it 'renders a goemetry type as the icon' do
349
+ html = Capybara.string(helper.relations_icon({ 'layer_geom_type_s' => 'polygon' }, 'leaf'))
350
+ expect(html.title.strip).to eq 'Polygon'
351
+ end
352
+
353
+ it 'has the svg_tooltip class so that the Bootstrap tooltip is applied' do
354
+ html = Capybara.string(helper.relations_icon({ 'layer_geom_type_s' => 'polygon' }, 'leaf'))
355
+ expect(html).to have_css('.blacklight-icons.svg_tooltip')
356
+ end
357
+ end
358
+
359
+ context 'when not confiugred to use the geometry type' do
360
+ before do
361
+ allow(Settings).to receive(:USE_GEOM_FOR_RELATIONS_ICON).and_return(false)
362
+ end
363
+
364
+ it 'renders the provided icon' do
365
+ html = Capybara.string(helper.relations_icon({ 'layer_geom_type_s' => 'polygon' }, 'leaf'))
366
+ expect(html.title.strip).to eq 'Leaf'
367
+ end
368
+
369
+ it 'does not have the svg_tooltip class' do
370
+ html = Capybara.string(helper.relations_icon({ 'layer_geom_type_s' => 'polygon' }, 'leaf'))
371
+ expect(html).not_to have_css('.blacklight-icons.svg_tooltip')
372
+ end
373
+ end
374
+ end
329
375
  end
@@ -0,0 +1,12 @@
1
+ //= require geoblacklight
2
+
3
+ describe('setupInspection', function() {
4
+ describe('Inspect attribute on the map', function() {
5
+ it('identifyFeatures is defined', function() {
6
+ expect(L.esri.identifyFeatures).toBeDefined();
7
+ });
8
+ it('Tasks is not defined', function() {
9
+ expect(L.esri.Tasks).toBeUndefined();
10
+ });
11
+ });
12
+ });
@@ -13,9 +13,5 @@ describe('GeoBlacklight', function() {
13
13
  it('MetadataDownloadButton is defined', function() {
14
14
  expect(GeoBlacklight.MetadataDownloadButton).toBeDefined();
15
15
  });
16
-
17
- it ('Readmore is defined', function() {
18
- expect(Readmore).toBeDefined();
19
- });
20
16
  });
21
17
  });
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::BoundingBox do
@@ -1 +1,2 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::DocumentPresenter do
4
5
  # Please see https://github.com/projectblacklight/blacklight/blob/v6.15.0/spec/presenters/index_presenter_spec.rb#L4
6
+ subject { presenter }
5
7
  let(:request_context) { double(document_index_view_type: 'list') }
6
8
  let(:blacklight_config) do
7
9
  Blacklight::Configuration.new.configure do |config|
@@ -12,7 +14,6 @@ describe Geoblacklight::DocumentPresenter do
12
14
  end
13
15
  end
14
16
  let(:solr_fields) { Settings.FIELDS }
15
- subject { presenter }
16
17
  let(:presenter) do
17
18
  described_class.new(document, request_context, blacklight_config)
18
19
  end
@@ -23,7 +24,7 @@ describe Geoblacklight::DocumentPresenter do
23
24
  layer_id_s: 'druid:abc123',
24
25
  non_index_field: 'do not render',
25
26
  period: 'Ends with period.',
26
- multi_display: %w(blue blah)
27
+ multi_display: %w[blue blah]
27
28
  )
28
29
  end
29
30
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::GeojsonDownload do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::GeotiffDownload do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::HglDownload do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::KmzDownload do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::ShapefileDownload do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::Download do
@@ -31,7 +32,7 @@ describe Geoblacklight::Download do
31
32
  end
32
33
  describe '#file_path' do
33
34
  it 'returns the path with name and extension' do
34
- expect(download.class.file_path).to eq "#{Rails.root}/tmp/cache/downloads"
35
+ expect(download.class.file_path).to eq Rails.root.join('tmp', 'cache', 'downloads')
35
36
  end
36
37
  it 'is configurable' do
37
38
  expect(Settings).to receive(:DOWNLOAD_PATH).and_return('configured/path')
@@ -141,14 +142,14 @@ describe Geoblacklight::Download do
141
142
 
142
143
  it 'raises Geoblacklight::Exceptions::ExternalDownloadFailed with a connection failure' do
143
144
  expect(faraday_connection).to receive(:url_prefix).and_return 'http://www.example.com/wms'
144
- expect(faraday_connection).to receive(:get).and_raise(Faraday::Error::ConnectionFailed.new('Failed'))
145
+ expect(faraday_connection).to receive(:get).and_raise(Faraday::ConnectionFailed.new('Failed'))
145
146
  expect(Faraday).to receive(:new).with(url: 'http://www.example.com/wms').and_return(faraday_connection)
146
147
  expect { download.initiate_download }.to raise_error(Geoblacklight::Exceptions::ExternalDownloadFailed)
147
148
  end
148
149
 
149
150
  it 'raises Geoblacklight::Exceptions::ExternalDownloadFailed with a connection timout' do
150
151
  expect(faraday_connection).to receive(:url_prefix).and_return 'http://www.example.com/wms'
151
- expect(faraday_connection).to receive(:get).and_raise(Faraday::Error::TimeoutError)
152
+ expect(faraday_connection).to receive(:get).and_raise(Faraday::TimeoutError)
152
153
  expect(Faraday).to receive(:new).with(url: 'http://www.example.com/wms').and_return(faraday_connection)
153
154
  expect { download.initiate_download }.to raise_error(Geoblacklight::Exceptions::ExternalDownloadFailed)
154
155
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::GeoblacklightHelperBehavior do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::ItemViewer do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::Metadata::Base do
@@ -30,7 +31,7 @@ describe Geoblacklight::Metadata::Base do
30
31
  subject { metadata.document }
31
32
 
32
33
  before do
33
- allow(connection).to receive(:get).and_raise(Faraday::Error::ConnectionFailed, 'test connection failures')
34
+ allow(connection).to receive(:get).and_raise(Faraday::ConnectionFailed, 'test connection failures')
34
35
  end
35
36
 
36
37
  it 'returns nil when a connection error' do
@@ -73,7 +74,7 @@ describe Geoblacklight::Metadata::Base do
73
74
 
74
75
  context 'when attempts to connect to an endpoint URL fail' do
75
76
  before do
76
- allow(connection).to receive(:get).and_raise(Faraday::Error::ConnectionFailed, 'test connection failures')
77
+ allow(connection).to receive(:get).and_raise(Faraday::ConnectionFailed, 'test connection failures')
77
78
  end
78
79
 
79
80
  it 'returns true' do
@@ -144,7 +145,7 @@ describe Geoblacklight::Metadata::Base do
144
145
  context 'when requesting the metadata resource times out' do
145
146
  before do
146
147
  allow(geocombine_metadata).to receive(:to_html).and_return('')
147
- allow(connection).to receive(:get).and_raise(Faraday::Error::TimeoutError)
148
+ allow(connection).to receive(:get).and_raise(Faraday::TimeoutError)
148
149
  allow(Geoblacklight.logger).to receive(:error).with('#<Faraday::TimeoutError #<Faraday::TimeoutError: timeout>>')
149
150
  end
150
151
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::Metadata::Html do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::Metadata do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::MetadataTransformer::Base do
@@ -8,8 +9,8 @@ describe Geoblacklight::MetadataTransformer::Base do
8
9
  end
9
10
 
10
11
  context 'with metadata types without XSL Stylesheets' do
11
- let(:metadata) { instance_double(GeoCombine::Metadata) }
12
12
  subject { described_class.new(metadata) }
13
+ let(:metadata) { instance_double(GeoCombine::Metadata) }
13
14
  describe '#transform' do
14
15
  before do
15
16
  allow(metadata).to receive(:to_html).and_raise(NoMethodError, 'undefined method `to_html\'')
@@ -21,8 +22,8 @@ describe Geoblacklight::MetadataTransformer::Base do
21
22
  end
22
23
 
23
24
  context 'with metadata types with XSL Stylesheets but invalid HTML' do
24
- let(:metadata) { instance_double(GeoCombine::Metadata) }
25
25
  subject { described_class.new(metadata) }
26
+ let(:metadata) { instance_double(GeoCombine::Metadata) }
26
27
  describe '#transform' do
27
28
  before do
28
29
  allow(metadata).to receive(:to_html).and_return('<invalid-html></invalid-html>')
@@ -1,11 +1,12 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::MetadataTransformer::Fgdc do
4
- let(:fgdc_html) { File.read(File.join(Rails.root, 'spec', 'fixtures', 'metadata', 'fgdc.html')) }
5
- let(:metadata) { instance_double('Geoblacklight::Metadata::Fgdc') }
6
5
  subject do
7
6
  described_class.new(metadata)
8
7
  end
8
+ let(:fgdc_html) { File.read(Rails.root.join('spec', 'fixtures', 'metadata', 'fgdc.html')) }
9
+ let(:metadata) { instance_double('Geoblacklight::Metadata::Fgdc') }
9
10
 
10
11
  describe '#transform' do
11
12
  before do
@@ -1,11 +1,12 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Geoblacklight::MetadataTransformer::Iso19139 do
4
- let(:iso_html) { File.read(File.join(Rails.root, 'spec', 'fixtures', 'metadata', 'iso.html')) }
5
- let(:metadata) { instance_double('Geoblacklight::Metadata::Iso19139') }
6
5
  subject do
7
6
  described_class.new(metadata)
8
7
  end
8
+ let(:iso_html) { File.read(Rails.root.join('spec', 'fixtures', 'metadata', 'iso.html')) }
9
+ let(:metadata) { instance_double('Geoblacklight::Metadata::Iso19139') }
9
10
 
10
11
  describe '#transform' do
11
12
  before do