geoblacklight 2.4.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +142 -0
  3. data/.gitignore +8 -0
  4. data/.rubocop.yml +24 -23
  5. data/.rubocop_todo.yml +398 -12
  6. data/README.md +3 -3
  7. data/Rakefile +13 -4
  8. data/app/assets/images/favicon.ico +0 -0
  9. data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +1 -1
  10. data/app/assets/javascripts/geoblacklight/geoblacklight.js +18 -1
  11. data/app/assets/javascripts/geoblacklight/modules/bookmarks.js +43 -0
  12. data/app/assets/javascripts/geoblacklight/modules/metadata_download_button.js +6 -1
  13. data/app/assets/javascripts/geoblacklight/modules/results.js +7 -8
  14. data/app/assets/javascripts/geoblacklight/modules/svg_tooltips.js +31 -0
  15. data/app/assets/javascripts/geoblacklight/modules/util.js +5 -0
  16. data/app/assets/javascripts/geoblacklight/viewers/esri.js +3 -3
  17. data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +1 -1
  18. data/app/assets/javascripts/geoblacklight/viewers/index_map.js +1 -1
  19. data/app/assets/javascripts/geoblacklight/viewers/map.js +12 -2
  20. data/app/assets/javascripts/geoblacklight/viewers/tms.js +10 -0
  21. data/app/assets/javascripts/geoblacklight/viewers/wms.js +3 -3
  22. data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +2 -0
  23. data/app/assets/stylesheets/geoblacklight/modules/_base.scss +33 -0
  24. data/app/assets/stylesheets/geoblacklight/{_blacklight_overrides.scss → modules/_blacklight_overrides.scss} +1 -1
  25. data/app/assets/stylesheets/geoblacklight/{_styles.scss → modules/_styles.scss} +1 -0
  26. data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +37 -54
  27. data/app/assets/stylesheets/geoblacklight/modules/item.scss +1 -0
  28. data/app/assets/stylesheets/geoblacklight/modules/results.scss +17 -29
  29. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +12 -42
  30. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +17 -59
  31. data/app/controllers/download_controller.rb +12 -12
  32. data/app/controllers/relation_controller.rb +1 -0
  33. data/app/controllers/wms_controller.rb +1 -0
  34. data/app/helpers/arcgis_helper.rb +1 -0
  35. data/app/helpers/blacklight_helper.rb +1 -0
  36. data/app/helpers/carto_helper.rb +1 -0
  37. data/app/helpers/geoblacklight_helper.rb +37 -72
  38. data/app/models/concerns/geoblacklight/solr_document.rb +15 -19
  39. data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +2 -1
  40. data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -13
  41. data/app/models/concerns/geoblacklight/solr_document/citation.rb +1 -0
  42. data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
  43. data/app/models/concerns/geoblacklight/solr_document/inspection.rb +2 -1
  44. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +6 -4
  45. data/app/presenters/geoblacklight/document_presenter.rb +2 -1
  46. data/app/views/catalog/_arcgis.html.erb +4 -0
  47. data/app/views/catalog/_carto.html.erb +4 -0
  48. data/app/views/catalog/_document_split.html.erb +1 -1
  49. data/app/views/catalog/_downloads_primary.html.erb +8 -1
  50. data/app/views/catalog/_header_icons.html.erb +3 -3
  51. data/app/views/catalog/_home_text.html.erb +3 -0
  52. data/app/views/catalog/_index_split_default.html.erb +21 -21
  53. data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
  54. data/app/views/download/hgl.html.erb +13 -11
  55. data/app/views/relation/_ancestors.html.erb +3 -6
  56. data/app/views/relation/_descendants.html.erb +4 -7
  57. data/app/views/relation/index.html.erb +20 -8
  58. data/app/views/relation/index.json.jbuilder +2 -1
  59. data/app/views/shared/_header_navbar.html.erb +0 -2
  60. data/babel.config.json +4 -0
  61. data/bin/coverage.rb +36 -0
  62. data/config/initializers/new_gbl_settings_defaults_3_3.yml +10 -0
  63. data/config/initializers/rails_config.rb +5 -0
  64. data/config/locales/geoblacklight.en.yml +7 -2
  65. data/geoblacklight.gemspec +7 -9
  66. data/jest.config.js +25 -0
  67. data/lib/generators/geoblacklight/assets_generator.rb +46 -0
  68. data/lib/generators/geoblacklight/install_generator.rb +4 -10
  69. data/lib/generators/geoblacklight/templates/assets/_blacklight.scss +1 -0
  70. data/lib/generators/geoblacklight/templates/assets/_customizations.scss +28 -0
  71. data/{app/assets/stylesheets/geoblacklight/application.scss → lib/generators/geoblacklight/templates/assets/_geoblacklight.scss} +0 -1
  72. data/lib/generators/geoblacklight/templates/assets/application.scss +7 -0
  73. data/lib/generators/geoblacklight/templates/{geoblacklight.js → assets/geoblacklight.js} +0 -0
  74. data/lib/generators/geoblacklight/templates/catalog_controller.rb +5 -3
  75. data/lib/generators/geoblacklight/templates/settings.yml +20 -17
  76. data/lib/generators/geoblacklight/webpacker_generator.rb +1 -0
  77. data/lib/geoblacklight.rb +2 -2
  78. data/lib/geoblacklight/bounding_box.rb +2 -1
  79. data/lib/geoblacklight/catalog_helper_override.rb +1 -0
  80. data/lib/geoblacklight/constants.rb +2 -0
  81. data/lib/geoblacklight/download.rb +2 -1
  82. data/lib/geoblacklight/download/geojson_download.rb +1 -0
  83. data/lib/geoblacklight/download/geotiff_download.rb +1 -0
  84. data/lib/geoblacklight/download/hgl_download.rb +1 -0
  85. data/lib/geoblacklight/download/kmz_download.rb +3 -2
  86. data/lib/geoblacklight/download/shapefile_download.rb +1 -0
  87. data/lib/geoblacklight/engine.rb +2 -2
  88. data/lib/geoblacklight/exceptions.rb +1 -0
  89. data/lib/geoblacklight/geoblacklight_helper_behavior.rb +1 -0
  90. data/lib/geoblacklight/geometry.rb +70 -0
  91. data/lib/geoblacklight/item_viewer.rb +6 -1
  92. data/lib/geoblacklight/metadata.rb +1 -0
  93. data/lib/geoblacklight/metadata/base.rb +2 -7
  94. data/lib/geoblacklight/metadata/fgdc.rb +1 -0
  95. data/lib/geoblacklight/metadata/html.rb +2 -2
  96. data/lib/geoblacklight/metadata/iso19139.rb +1 -0
  97. data/lib/geoblacklight/metadata_transformer.rb +1 -0
  98. data/lib/geoblacklight/metadata_transformer/base.rb +1 -0
  99. data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
  100. data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
  101. data/lib/geoblacklight/reference.rb +1 -0
  102. data/lib/geoblacklight/references.rb +7 -3
  103. data/lib/geoblacklight/relation/ancestors.rb +3 -2
  104. data/lib/geoblacklight/relation/descendants.rb +2 -1
  105. data/lib/geoblacklight/relation/relation_response.rb +2 -1
  106. data/lib/geoblacklight/routes.rb +1 -0
  107. data/lib/geoblacklight/routes/downloadable.rb +1 -0
  108. data/lib/geoblacklight/routes/exportable.rb +1 -0
  109. data/lib/geoblacklight/routes/wms.rb +1 -0
  110. data/lib/geoblacklight/version.rb +2 -1
  111. data/lib/geoblacklight/view_helper_override.rb +1 -0
  112. data/lib/geoblacklight/wms_layer.rb +2 -4
  113. data/lib/geoblacklight/wms_layer/feature_info_response.rb +1 -0
  114. data/lib/tasks/geoblacklight.rake +38 -32
  115. data/package.json +17 -1
  116. data/setupJest.js +14 -0
  117. data/solr/conf/schema.xml +1 -3
  118. data/spec/config/initializers/rails_config_spec.rb +14 -0
  119. data/spec/controllers/catalog_controller_spec.rb +7 -6
  120. data/spec/controllers/download_controller_spec.rb +1 -0
  121. data/spec/controllers/relation_controller_spec.rb +1 -0
  122. data/spec/controllers/wms_controller_spec.rb +1 -0
  123. data/spec/factories/user.rb +1 -0
  124. data/spec/features/bookmarks_spec.rb +1 -0
  125. data/spec/features/configurable_basemap_spec.rb +1 -0
  126. data/spec/features/data_dictionary_download_spec.rb +1 -0
  127. data/spec/features/download_layer_spec.rb +2 -1
  128. data/spec/features/empty_search_spec.rb +1 -0
  129. data/spec/features/esri_viewer_spec.rb +1 -5
  130. data/spec/features/exports_spec.rb +4 -12
  131. data/spec/features/help_text_spec.rb +1 -0
  132. data/spec/features/home_page_spec.rb +6 -0
  133. data/spec/features/iiif_viewer_spec.rb +1 -0
  134. data/spec/features/index_map_spec.rb +1 -0
  135. data/spec/features/layer_inspection_spec.rb +1 -0
  136. data/spec/features/layer_opacity_spec.rb +1 -0
  137. data/spec/features/layer_preview_spec.rb +1 -0
  138. data/spec/features/layer_with_no_references_spec.rb +1 -0
  139. data/spec/features/linkified_attribute_table_spec.rb +1 -0
  140. data/spec/features/metadata_panel_spec.rb +1 -0
  141. data/spec/features/missing_metadata_spec.rb +1 -0
  142. data/spec/features/multiple_downloads_spec.rb +15 -0
  143. data/spec/features/oembed_spec.rb +1 -0
  144. data/spec/features/relations_spec.rb +10 -29
  145. data/spec/features/saved_searches_spec.rb +1 -0
  146. data/spec/features/search_bar_spec.rb +1 -0
  147. data/spec/features/search_results_map_spec.rb +1 -6
  148. data/spec/features/search_results_overlap_ratio_spec.rb +6 -5
  149. data/spec/features/search_spec.rb +1 -0
  150. data/spec/features/show_page_metadata_spec.rb +1 -0
  151. data/spec/features/sms_spec.rb +1 -0
  152. data/spec/features/split_view.html.erb_spec.rb +3 -2
  153. data/spec/features/suppressed_records_spec.rb +1 -0
  154. data/spec/features/tms_spec.rb +10 -0
  155. data/spec/features/web_services_modal_spec.rb +1 -0
  156. data/spec/fixtures/solr_documents/multiple-downloads.json +30 -0
  157. data/spec/fixtures/solr_documents/public_iiif_princeton.json +1 -1
  158. data/spec/fixtures/solr_documents/tms.json +29 -0
  159. data/spec/helpers/arcgis_helper_spec.rb +1 -0
  160. data/spec/helpers/carto_helper_spec.rb +1 -0
  161. data/spec/helpers/geoblacklight_helper_spec.rb +73 -14
  162. data/spec/javascripts/geoblacklight_spec.js +0 -6
  163. data/spec/javascripts/metadata_download_button_spec.js +5 -3
  164. data/spec/javascripts/util_spec.js +2 -4
  165. data/spec/lib/geoblacklight/bounding_box_spec.rb +1 -0
  166. data/spec/lib/geoblacklight/document_presenter_spec.rb +3 -2
  167. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -0
  168. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -0
  169. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +1 -0
  170. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +3 -2
  171. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -0
  172. data/spec/lib/geoblacklight/download_spec.rb +3 -2
  173. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -0
  174. data/spec/lib/geoblacklight/geometry_spec.rb +48 -0
  175. data/spec/lib/geoblacklight/item_viewer_spec.rb +13 -0
  176. data/spec/lib/geoblacklight/metadata/base_spec.rb +1 -0
  177. data/spec/lib/geoblacklight/metadata/html_spec.rb +1 -0
  178. data/spec/lib/geoblacklight/metadata_spec.rb +1 -0
  179. data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +3 -2
  180. data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +3 -2
  181. data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +3 -2
  182. data/spec/lib/geoblacklight/metadata_transformer_spec.rb +4 -3
  183. data/spec/lib/geoblacklight/reference_spec.rb +1 -0
  184. data/spec/lib/geoblacklight/references_spec.rb +3 -4
  185. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +2 -1
  186. data/spec/lib/geoblacklight/relation/descendants_spec.rb +2 -1
  187. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +1 -0
  188. data/spec/lib/geoblacklight/view_helper_override_spec.rb +1 -0
  189. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +5 -4
  190. data/spec/lib/geoblacklight/wms_layer_spec.rb +1 -0
  191. data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +1 -20
  192. data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +1 -0
  193. data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +1 -0
  194. data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +1 -0
  195. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +1 -0
  196. data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +15 -2
  197. data/spec/routing/catalog_routing_spec.rb +1 -0
  198. data/spec/spec_helper.rb +12 -9
  199. data/spec/support/backport_test_helpers.rb +1 -0
  200. data/spec/support/features.rb +1 -0
  201. data/spec/support/features/session_helpers.rb +1 -0
  202. data/spec/support/fixtures.rb +1 -0
  203. data/spec/tasks/geoblacklight_spec.rb +4 -3
  204. data/spec/test_app_templates/Gemfile.extra +1 -0
  205. data/spec/test_app_templates/lib/generators/test_app_generator.rb +2 -8
  206. data/spec/views/catalog/_document_split.html.erb_spec.rb +2 -1
  207. data/spec/views/catalog/_index_split.html.erb_spec.rb +2 -1
  208. data/spec/views/catalog/_results_pagination.html.erb_spec.rb +1 -0
  209. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +1 -0
  210. data/spec/views/catalog/_show_tools.html.erb_spec.rb +3 -5
  211. data/template.rb +4 -2
  212. metadata +74 -78
  213. data/.circleci/config.yml +0 -164
  214. data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +0 -36
  215. data/app/assets/stylesheets/geoblacklight/modules/relations.scss +0 -15
  216. data/app/views/catalog/_exports.html.erb +0 -3
  217. data/app/views/catalog/_show_tools.html.erb +0 -25
  218. data/lib/generators/geoblacklight/templates/geoblacklight.scss +0 -4
  219. data/spec/javascripts/spec_helper.js +0 -32
  220. data/spec/lib/geoblacklight/controller_override_spec.rb +0 -1
  221. data/spec/teaspoon_env.rb +0 -213
  222. data/vendor/assets/javascripts/readmore.js +0 -0
  223. data/vendor/assets/javascripts/readmore.min.js +0 -0
data/package.json CHANGED
@@ -1,4 +1,20 @@
1
1
  {
2
2
  "name": "geoblacklight",
3
- "version": "2.1.2"
3
+ "version": "2.1.2",
4
+ "private": true,
5
+ "license": "Apache-2.0",
6
+ "private": true,
7
+ "scripts": {
8
+ "test": "jest -c jest.config.js"
9
+ },
10
+ "devDependencies": {
11
+ "@babel/cli": "^7.12.16",
12
+ "@babel/core": "^7.12.16",
13
+ "@babel/plugin-transform-runtime": "^7.12.15",
14
+ "@babel/preset-env": "^7.12.16",
15
+ "@testing-library/dom": "^7.29.4",
16
+ "@testing-library/jest-dom": "^5.11.9",
17
+ "jest": "^26.6.3",
18
+ "jest-fixtures": "^0.6.0"
19
+ }
4
20
  }
data/setupJest.js ADDED
@@ -0,0 +1,14 @@
1
+ import { JSDOM } from 'jsdom';
2
+ import $ from 'jquery';
3
+ const GeoBlacklight = require('./app/assets/javascripts/geoblacklight/geoblacklight');
4
+
5
+ const jsdom = new JSDOM('<html></html>', { pretendToBeVisual: true });
6
+ const { window } = jsdom;
7
+
8
+ global.GeoBlacklight = GeoBlacklight;
9
+ global.window = window;
10
+ global.jQuery = $;
11
+ global.$ = global.jQuery;
12
+
13
+ import * as L from 'leaflet.js.erb';
14
+ global.leaflet = L;
data/solr/conf/schema.xml CHANGED
@@ -143,13 +143,11 @@
143
143
  <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_d"/>
144
144
 
145
145
  <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
146
- geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers"/>
146
+ geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />
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
150
  <fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>
151
-
152
-
153
151
  </types>
154
152
 
155
153
  <!-- for scoring formula -->
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helper'
3
+
4
+ describe 'Config' do
5
+ it 'Loads new v3.3 Settings.FIELDS defaults' do
6
+ expect(Settings.FIELDS.IDENTIFIER).to eq 'dc_identifier_s'
7
+ expect(Settings.FIELDS.LANGUAGE).to eq 'dc_language_s'
8
+ expect(Settings.FIELDS.LAYER_MODIFIED).to eq 'layer_modified_dt'
9
+ expect(Settings.FIELDS.SOURCE).to eq 'dc_source_sm'
10
+ expect(Settings.FIELDS.SUPPRESSED).to eq 'suppressed_b'
11
+ expect(Settings.FIELDS.TYPE).to eq 'dc_type_s'
12
+ expect(Settings.FIELDS.UNIQUE_KEY).to eq 'layer_slug_s'
13
+ end
14
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe CatalogController, type: :controller do
@@ -71,12 +72,12 @@ describe CatalogController, type: :controller do
71
72
  expect(response.body).not_to be_empty
72
73
  response_values = JSON.parse(response.body)
73
74
  expect(response_values).to include 'geoblacklight_version' => '1.0'
74
- expect(response_values).to include 'dc_title_s' => '100 Foot Grid Cambridge MA 2004'
75
- expect(response_values).to include 'dc_identifier_s' => 'urn:geodata.tufts.edu:Tufts.CambridgeGrid100_04'
76
- expect(response_values).to include 'dc_rights_s' => 'Public'
77
- expect(response_values).to include 'dct_provenance_s' => 'Tufts'
78
- expect(response_values).to include 'layer_slug_s' => 'tufts-cambridgegrid100-04'
79
- expect(response_values).to include 'solr_geom' => 'ENVELOPE(-71.163984, -71.052581, 42.408316, 42.34757)'
75
+ expect(response_values).to include Settings.FIELDS.TITLE => '100 Foot Grid Cambridge MA 2004'
76
+ expect(response_values).to include Settings.FIELDS.IDENTIFIER => 'urn:geodata.tufts.edu:Tufts.CambridgeGrid100_04'
77
+ expect(response_values).to include Settings.FIELDS.RIGHTS => 'Public'
78
+ expect(response_values).to include Settings.FIELDS.PROVENANCE => 'Tufts'
79
+ expect(response_values).to include Settings.FIELDS.UNIQUE_KEY => 'tufts-cambridgegrid100-04'
80
+ expect(response_values).to include Settings.FIELDS.GEOMETRY => 'ENVELOPE(-71.163984, -71.052581, 42.408316, 42.34757)'
80
81
  end
81
82
  end
82
83
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe DownloadController, type: :controller 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,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe WmsController, type: :controller 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
@@ -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
@@ -40,7 +41,7 @@ feature 'Download layer' do
40
41
  end
41
42
  scenario 'clicking jpg download button should redirect to external image' do
42
43
  visit solr_document_path('princeton-02870w62c')
43
- expect(page).to have_css("a.btn.btn-default[href='https://libimages.princeton.edu/loris/pudl0076/map_pownall/00000001.jp2/full/full/0/default.jpg']", text: 'Original JPG')
44
+ expect(page).to have_css("a.btn.btn-default[href='https://iiif-cloud.princeton.edu/iiif/2/6c%2F52%2F12%2F6c5212e81bc845f59bb1cdc740a88bad%2Fintermediate_file/full/full/0/default.jpg']", text: 'Original JPG')
44
45
  end
45
46
  scenario 'options should be available under toggle' do
46
47
  visit solr_document_path('mit-f6rqs4ucovjk2')
@@ -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
@@ -24,11 +25,6 @@ feature 'feature_layer reference', js: true do
24
25
  expect(Nokogiri::HTML.parse(page.body).css('g').length).to eq 23
25
26
  fail
26
27
  end
27
- scenario 'displays image map layer' do
28
- visit solr_document_path '32653ed6-8d83-4692-8a06-bf13ffe2c018'
29
- expect(page).to have_css '.leaflet-control-zoom', visible: true
30
- expect(page).to have_css 'img.leaflet-image-layer', visible: true
31
- end
32
28
  scenario 'displays tiled map layer' do
33
29
  visit solr_document_path 'nyu-test-soil-survey-map'
34
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
@@ -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,52 +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
- 'layer_geom_type_s' => 'Point'
22
- }
23
- ]
24
- },
25
- 'current_doc' => 'nyu_2451_34635'
26
- }
27
- end
28
5
  scenario 'Record with dc_source_sm value(s) should have parent(s)' do
29
6
  visit relations_solr_document_path('nyu_2451_34502')
30
- expect(page).to have_css('ul b', text: 'Source Datasets')
7
+ expect(page).to have_css('.relations .card-header h2', text: 'Source Datasets')
31
8
  end
32
9
 
33
10
  scenario 'Record that is pointed to by others should have children' do
34
11
  visit relations_solr_document_path('nyu_2451_34635')
35
- expect(page).to have_css('ul b', text: 'Derived Datasets')
12
+ expect(page).to have_css('.relations .card-header h2', text: 'Derived Datasets')
36
13
  end
37
14
 
38
15
  scenario 'Relations should respond to json' do
39
16
  visit relations_solr_document_path('nyu_2451_34635', format: 'json')
40
- 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[Settings.FIELDS.UNIQUE_KEY]).to eq 'nyu_2451_34502'
20
+ expect(response['current_doc']).to eq 'nyu_2451_34635'
41
21
  end
42
22
 
43
23
  scenario 'Record with relations should render widget in catalog#show', js: true do
44
24
  visit solr_document_path('nyu_2451_34635')
45
- 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')
46
27
  end
47
28
 
48
29
  scenario 'Record without relations should not render widget in catalog#show', js: true do
49
30
  visit solr_document_path('harvard-g7064-s2-1834-k3')
50
- expect(page).to have_no_css('div.panel-heading', text: 'Data Relations')
31
+ expect(page).to have_no_css('.card.relations')
51
32
  end
52
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
@@ -7,7 +8,7 @@ feature 'spatial search results overlap ratio' do
7
8
  # BBox param is the US upper midwest and Canada, roughly centered on the state of Minnesota
8
9
  visit search_catalog_path(
9
10
  bbox: '-103.196521 39.21962 -84.431873 53.63497',
10
- 'f[dct_provenance_s][]': 'Minnesota'
11
+ "f[#{Settings.FIELDS.PROVENANCE}][]": 'Minnesota'
11
12
  )
12
13
 
13
14
  # MN State result
@@ -29,20 +30,20 @@ feature 'spatial search results overlap ratio' do
29
30
  # BBox param is the center to western edge of New York state and Canada, roughly centered on Lake Ontario
30
31
  visit search_catalog_path(
31
32
  bbox: '-83.750499 40.41709 -74.368175 47.963663',
32
- 'f[dct_provenance_s][]': 'Cornell'
33
+ "f[#{Settings.FIELDS.PROVENANCE}][]": 'Cornell'
33
34
  )
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