geoblacklight 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +21 -6
  3. data/.solr_wrapper +1 -0
  4. data/.standard.yml +1 -0
  5. data/Gemfile +13 -11
  6. data/README.md +1 -1
  7. data/Rakefile +42 -50
  8. data/app/assets/images/blacklight/american-geographical-society-library-uwm-libraries.svg +26 -0
  9. data/app/assets/images/blacklight/arizona.svg +4 -0
  10. data/app/assets/images/blacklight/circle-info-solid.svg +1 -0
  11. data/app/assets/images/blacklight/fire-solid.svg +1 -0
  12. data/app/assets/images/blacklight/lightbulb-solid.svg +1 -0
  13. data/app/assets/images/blacklight/nebraska.svg +4 -0
  14. data/app/assets/images/blacklight/rutgers.svg +5 -0
  15. data/app/assets/images/blacklight/triangle-exclamation-solid.svg +1 -0
  16. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +8 -0
  17. data/app/components/geoblacklight/display_note_component.html.erb +1 -0
  18. data/app/components/geoblacklight/display_note_component.rb +47 -0
  19. data/app/components/geoblacklight/icon_facet_item_component.rb +2 -2
  20. data/app/controllers/download_controller.rb +36 -37
  21. data/app/controllers/relation_controller.rb +1 -0
  22. data/app/controllers/wms_controller.rb +1 -0
  23. data/app/helpers/arcgis_helper.rb +2 -1
  24. data/app/helpers/blacklight_helper.rb +2 -1
  25. data/app/helpers/carto_helper.rb +3 -2
  26. data/app/helpers/geoblacklight/geoblacklight_helper_behavior.rb +2 -1
  27. data/app/helpers/geoblacklight_helper.rb +44 -36
  28. data/app/models/concerns/geoblacklight/bbox_filter_query.rb +1 -1
  29. data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +1 -0
  30. data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -0
  31. data/app/models/concerns/geoblacklight/solr_document/citation.rb +3 -2
  32. data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
  33. data/app/models/concerns/geoblacklight/solr_document/inspection.rb +1 -0
  34. data/app/models/concerns/geoblacklight/solr_document.rb +17 -9
  35. data/app/models/concerns/geoblacklight/suppressed_records_search_behavior.rb +2 -1
  36. data/app/presenters/geoblacklight/document_presenter.rb +3 -2
  37. data/app/views/catalog/_show_default_display_note.html.erb +7 -0
  38. data/app/views/catalog/_show_sidebar.html.erb +1 -0
  39. data/app/views/catalog/_show_sidebar_static_map.html.erb +10 -0
  40. data/app/views/relation/index.json.jbuilder +1 -1
  41. data/config/initializers/new_gbl_settings_defaults_4.1.yml +104 -0
  42. data/config/initializers/rails_config.rb +5 -1
  43. data/config/locales/geoblacklight.en.yml +18 -10
  44. data/geoblacklight.gemspec +36 -40
  45. data/lib/generators/geoblacklight/assets_generator.rb +15 -15
  46. data/lib/generators/geoblacklight/install_generator.rb +24 -23
  47. data/lib/generators/geoblacklight/templates/catalog_controller.rb +66 -71
  48. data/lib/generators/geoblacklight/templates/settings.yml +74 -22
  49. data/lib/geoblacklight/bounding_box.rb +1 -0
  50. data/lib/geoblacklight/constants.rb +26 -25
  51. data/lib/geoblacklight/download/geojson_download.rb +10 -9
  52. data/lib/geoblacklight/download/geotiff_download.rb +6 -5
  53. data/lib/geoblacklight/download/hgl_download.rb +4 -3
  54. data/lib/geoblacklight/download/kmz_download.rb +11 -10
  55. data/lib/geoblacklight/download/shapefile_download.rb +10 -9
  56. data/lib/geoblacklight/download.rb +12 -11
  57. data/lib/geoblacklight/engine.rb +10 -9
  58. data/lib/geoblacklight/exceptions.rb +3 -0
  59. data/lib/geoblacklight/faraday_middleware/follow_redirects.rb +12 -11
  60. data/lib/geoblacklight/geometry.rb +6 -5
  61. data/lib/geoblacklight/item_viewer.rb +4 -3
  62. data/lib/geoblacklight/metadata/base.rb +4 -3
  63. data/lib/geoblacklight/metadata/fgdc.rb +1 -0
  64. data/lib/geoblacklight/metadata/html.rb +5 -4
  65. data/lib/geoblacklight/metadata/iso19139.rb +1 -0
  66. data/lib/geoblacklight/metadata.rb +1 -0
  67. data/lib/geoblacklight/metadata_transformer/base.rb +5 -4
  68. data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
  69. data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
  70. data/lib/geoblacklight/metadata_transformer.rb +6 -2
  71. data/lib/geoblacklight/reference.rb +3 -2
  72. data/lib/geoblacklight/references.rb +11 -6
  73. data/lib/geoblacklight/relation/ancestors.rb +4 -3
  74. data/lib/geoblacklight/relation/descendants.rb +4 -3
  75. data/lib/geoblacklight/relation/relation_response.rb +3 -2
  76. data/lib/geoblacklight/routes/downloadable.rb +3 -2
  77. data/lib/geoblacklight/routes/exportable.rb +4 -3
  78. data/lib/geoblacklight/routes/wms.rb +2 -1
  79. data/lib/geoblacklight/routes.rb +4 -3
  80. data/lib/geoblacklight/version.rb +2 -1
  81. data/lib/geoblacklight/view_helper_override.rb +3 -2
  82. data/lib/geoblacklight/wms_layer/feature_info_response.rb +5 -4
  83. data/lib/geoblacklight/wms_layer.rb +4 -3
  84. data/lib/geoblacklight.rb +32 -31
  85. data/lib/tasks/geoblacklight.rake +45 -44
  86. data/schema/geoblacklight-schema-aardvark.json +6 -0
  87. data/spec/components/geoblacklight/display_note_component_spec.rb +27 -0
  88. data/spec/components/geoblacklight/homepage_feature_facet_component_spec.rb +11 -10
  89. data/spec/components/geoblacklight/icon_facet_item_component_spec.rb +8 -7
  90. data/spec/config/initializers/rails_config_spec.rb +10 -9
  91. data/spec/controllers/catalog_controller_spec.rb +27 -26
  92. data/spec/controllers/download_controller_spec.rb +50 -49
  93. data/spec/controllers/relation_controller_spec.rb +5 -4
  94. data/spec/controllers/wms_controller_spec.rb +10 -9
  95. data/spec/factories/user.rb +3 -2
  96. data/spec/features/bookmarks_spec.rb +7 -6
  97. data/spec/features/configurable_basemap_spec.rb +12 -11
  98. data/spec/features/data_dictionary_download_spec.rb +11 -10
  99. data/spec/features/download_layer_spec.rb +64 -63
  100. data/spec/features/empty_search_spec.rb +6 -5
  101. data/spec/features/esri_viewer_spec.rb +33 -32
  102. data/spec/features/exports_spec.rb +18 -17
  103. data/spec/features/full_screen_controll_spec.rb +8 -8
  104. data/spec/features/help_text_spec.rb +6 -5
  105. data/spec/features/home_page_spec.rb +30 -29
  106. data/spec/features/iiif_viewer_spec.rb +6 -5
  107. data/spec/features/index_map_spec.rb +17 -16
  108. data/spec/features/layer_inspection_spec.rb +8 -7
  109. data/spec/features/layer_opacity_spec.rb +15 -14
  110. data/spec/features/layer_preview_spec.rb +11 -10
  111. data/spec/features/layer_with_no_references_spec.rb +5 -4
  112. data/spec/features/linkified_attribute_table_spec.rb +8 -7
  113. data/spec/features/metadata_panel_spec.rb +32 -31
  114. data/spec/features/missing_metadata_spec.rb +18 -17
  115. data/spec/features/multiple_downloads_spec.rb +11 -10
  116. data/spec/features/oembed_spec.rb +6 -5
  117. data/spec/features/relations_spec.rb +51 -26
  118. data/spec/features/saved_searches_spec.rb +7 -6
  119. data/spec/features/search_bar_spec.rb +9 -8
  120. data/spec/features/search_results_complex_geometry_spec.rb +12 -11
  121. data/spec/features/search_results_icons_spec.rb +10 -9
  122. data/spec/features/search_results_map_spec.rb +21 -20
  123. data/spec/features/search_results_overlap_ratio_spec.rb +17 -16
  124. data/spec/features/search_spec.rb +19 -18
  125. data/spec/features/show_page_download_spec.rb +15 -14
  126. data/spec/features/show_page_metadata_spec.rb +9 -8
  127. data/spec/features/show_page_sidebar_static_map_spec.rb +21 -0
  128. data/spec/features/sms_spec.rb +12 -11
  129. data/spec/features/split_view.html.erb_spec.rb +56 -55
  130. data/spec/features/suppressed_records_spec.rb +10 -9
  131. data/spec/features/tilejson_spec.rb +9 -8
  132. data/spec/features/tms_spec.rb +6 -5
  133. data/spec/features/web_services_modal_spec.rb +37 -36
  134. data/spec/features/wmts_spec.rb +16 -15
  135. data/spec/features/xyz_spec.rb +6 -5
  136. data/spec/fixtures/solr_documents/actual-papermap1.json +1 -1
  137. data/spec/fixtures/solr_documents/actual-point1.json +1 -1
  138. data/spec/fixtures/solr_documents/actual-polygon1.json +1 -1
  139. data/spec/fixtures/solr_documents/actual-raster1.json +1 -1
  140. data/spec/fixtures/solr_documents/baruch_ancestor1.json +1 -1
  141. data/spec/fixtures/solr_documents/baruch_ancestor2.json +1 -1
  142. data/spec/fixtures/solr_documents/baruch_documentation_download.json +2 -2
  143. data/spec/fixtures/solr_documents/cornell_html_metadata.json +1 -1
  144. data/spec/fixtures/solr_documents/display-note.json +52 -0
  145. data/spec/fixtures/solr_documents/esri-dynamic-layer-all-layers.json +1 -1
  146. data/spec/fixtures/solr_documents/esri-dynamic-layer-single-layer.json +1 -1
  147. data/spec/fixtures/solr_documents/esri-feature-layer.json +1 -1
  148. data/spec/fixtures/solr_documents/esri-image-map-layer.json +1 -1
  149. data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +1 -1
  150. data/spec/fixtures/solr_documents/esri-wms-layer.json +1 -1
  151. data/spec/fixtures/solr_documents/harvard_raster.json +1 -1
  152. data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +1 -1
  153. data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +1 -1
  154. data/spec/fixtures/solr_documents/index-map-polygon.json +1 -1
  155. data/spec/fixtures/solr_documents/index-map-stanford.json +1 -1
  156. data/spec/fixtures/solr_documents/index_map_point.json +1 -1
  157. data/spec/fixtures/solr_documents/princeton-parent.json +1 -1
  158. data/spec/fixtures/solr_documents/public_direct_download.json +1 -1
  159. data/spec/fixtures/solr_documents/public_iiif_princeton.json +1 -1
  160. data/spec/fixtures/solr_documents/restricted-line.json +1 -1
  161. data/spec/fixtures/solr_documents/tilejson.json +2 -2
  162. data/spec/fixtures/solr_documents/umn_metro_result1.json +2 -2
  163. data/spec/fixtures/solr_documents/umn_state_result1.json +1 -1
  164. data/spec/fixtures/solr_documents/umn_state_result2.json +1 -1
  165. data/spec/fixtures/solr_documents/uva_slug_colon.json +1 -1
  166. data/spec/fixtures/solr_documents/wmts-multiple.json +1 -1
  167. data/spec/fixtures/solr_documents/wmts-single-layer.json +6 -6
  168. data/spec/fixtures/solr_documents/xyz.json +3 -3
  169. data/spec/helpers/arcgis_helper_spec.rb +8 -7
  170. data/spec/helpers/carto_helper_spec.rb +6 -5
  171. data/spec/helpers/geoblacklight/geoblacklight_helper_behavior_spec.rb +10 -15
  172. data/spec/helpers/geoblacklight_helper_spec.rb +139 -138
  173. data/spec/lib/geoblacklight/bounding_box_spec.rb +14 -13
  174. data/spec/lib/geoblacklight/document_presenter_spec.rb +26 -25
  175. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +8 -7
  176. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +8 -7
  177. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +16 -15
  178. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +9 -8
  179. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +8 -7
  180. data/spec/lib/geoblacklight/download_spec.rb +61 -60
  181. data/spec/lib/geoblacklight/geometry_spec.rb +29 -28
  182. data/spec/lib/geoblacklight/item_viewer_spec.rb +25 -24
  183. data/spec/lib/geoblacklight/metadata/base_spec.rb +44 -43
  184. data/spec/lib/geoblacklight/metadata/html_spec.rb +7 -6
  185. data/spec/lib/geoblacklight/metadata_spec.rb +15 -14
  186. data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +13 -12
  187. data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +8 -7
  188. data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +8 -7
  189. data/spec/lib/geoblacklight/metadata_transformer_spec.rb +15 -14
  190. data/spec/lib/geoblacklight/reference_spec.rb +28 -27
  191. data/spec/lib/geoblacklight/references_spec.rb +89 -76
  192. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +17 -16
  193. data/spec/lib/geoblacklight/relation/descendants_spec.rb +17 -16
  194. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +29 -28
  195. data/spec/lib/geoblacklight/view_helper_override_spec.rb +14 -13
  196. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +19 -18
  197. data/spec/lib/geoblacklight/wms_layer_spec.rb +31 -30
  198. data/spec/models/concerns/geoblacklight/bbox_filter_field_spec.rb +31 -31
  199. data/spec/models/concerns/geoblacklight/bbox_filter_query_spec.rb +32 -32
  200. data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +16 -15
  201. data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +7 -6
  202. data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +16 -17
  203. data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +7 -6
  204. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +121 -107
  205. data/spec/models/concerns/geoblacklight/suppressed_records_search_behavior_spec.rb +8 -7
  206. data/spec/presenters/geoblacklight/bbox_item_presenter_spec.rb +10 -10
  207. data/spec/routing/catalog_routing_spec.rb +4 -3
  208. data/spec/spec_helper.rb +34 -33
  209. data/spec/support/backport_test_helpers.rb +6 -5
  210. data/spec/support/features/session_helpers.rb +8 -7
  211. data/spec/support/features.rb +2 -1
  212. data/spec/support/fixtures.rb +2 -1
  213. data/spec/tasks/geoblacklight_spec.rb +10 -9
  214. data/spec/test_app_templates/lib/generators/test_app_generator.rb +16 -15
  215. data/spec/views/catalog/_document_split.html.erb_spec.rb +3 -2
  216. data/spec/views/catalog/_index_split.html.erb_spec.rb +3 -2
  217. data/spec/views/catalog/_results_pagination.html.erb_spec.rb +5 -4
  218. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +11 -10
  219. data/spec/views/catalog/_show_tools.html.erb_spec.rb +13 -12
  220. data/template.rb +9 -8
  221. metadata +29 -212
  222. data/.gitmodules +0 -0
  223. data/.rubocop.yml +0 -111
  224. data/.rubocop_todo.yml +0 -437
  225. data/config/initializers/new_gbl_settings_defaults_3_4.yml +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19db4be6a3f942cdccdc7d36a079d5b9055c668b0963f57f87f71b4c2ee49356
4
- data.tar.gz: a000aaa1cbb8691207e150e5e4e6a70c3a4d1bcac2d07b3134e353329b043f1f
3
+ metadata.gz: c26827784f59e0d846384c2bfc37023df7b49a1d15166c727be785966ee4b651
4
+ data.tar.gz: daa3337fee9b870746d6a6dec960105e8c0ce0717134f4c0c72de4ace2f7a3d2
5
5
  SHA512:
6
- metadata.gz: 52f9c326cd02d416cdc266d3456a8fc14f57d801fbca546c63e8d065a64c99bf3af3554a3343ba6eca0b6501290a5eb59e3abc81b34c45074084402140e0bc1e
7
- data.tar.gz: 38fa50f6e96c57bdb7c988faa60021551ec951446512f077801bfdf57174ea3d7af55ff9fccc05930b52be8dc1895be8b49d732e36971cea88982abe7c99e886
6
+ metadata.gz: 8fc7061cae6dad0d571274626d5329be5d651caf93efaae0403eb3d50527c7d641f814018438bb2f839b4a8a34d7eae247e8b9c1a4356b75c8bdc5c38ed69993
7
+ data.tar.gz: 9e8eaad05028d743875646e0b3e35bba917c350a9bdfc79b37ae94fc4c7117e6916bfbcba1a1f6de5c9b725b11b003c8e8ea6d4923eabc8323651e612ed45c9d
@@ -7,7 +7,7 @@ on:
7
7
  pull_request:
8
8
 
9
9
  jobs:
10
- rubocop:
10
+ linter:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: actions/checkout@v2
@@ -18,7 +18,20 @@ jobs:
18
18
  - name: Install dependencies
19
19
  run: bundle install
20
20
  - name: Run linter
21
- run: bundle exec rake rubocop
21
+ run: bundle exec standardrb
22
+
23
+ aardvark-fixture-linter:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v2
27
+ - name: Set up Ruby
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: 2.7
31
+ - name: Install json schema validator
32
+ run: gem install json_schemer
33
+ - name: Run json_schemer against aarkvark fixtures
34
+ run: find spec/fixtures/solr_documents -type f -name "*.json" | xargs json_schemer schema/geoblacklight-schema-aardvark.json
22
35
 
23
36
  test:
24
37
  runs-on: ubuntu-latest
@@ -26,7 +39,6 @@ jobs:
26
39
  matrix:
27
40
  ruby_version: ['3.0', 2.7]
28
41
  rails_version: [7.0.2.2, 6.1]
29
- bundler_version: [2.1.1]
30
42
  faraday_version: ['>= 2', '~> 1.0']
31
43
 
32
44
  name: test ruby ${{ matrix.ruby_version }} / rails ${{ matrix.rails_version }} / faraday ${{ matrix.faraday_version }}
@@ -36,12 +48,15 @@ jobs:
36
48
  uses: ruby/setup-ruby@v1
37
49
  with:
38
50
  ruby-version: ${{ matrix.ruby_version }}
51
+ # required to avoid https://github.com/actions/runner-images/issues/37
52
+ # because faraday depends on patron, which requires curl headers to build
53
+ - name: Install cURL Headers
54
+ run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev
55
+ if: matrix.faraday_version == '~> 1.0'
39
56
  - name: Create Solr container
40
57
  run: docker run -d -p 8983:8983 geoblacklight/solr:8.9-v1.0.0 server/scripts/ci-start.sh
41
- - name: Install bundler
42
- run: gem install bundler -v ${{ matrix.bundler_version }}
43
58
  - name: Install dependencies
44
- run: bundle _${{ matrix.bundler_version }}_ install
59
+ run: bundle install
45
60
  env:
46
61
  RAILS_VERSION: ${{ matrix.rails_version }}
47
62
  FARADAY_VERSION: ${{ matrix.faraday_version }}
data/.solr_wrapper CHANGED
@@ -1,3 +1,4 @@
1
+ url: https://archive.apache.org/dist/lucene/solr/8.11.2/solr-8.11.2.tgz
1
2
  validate: false
2
3
  instance_dir: tmp/solr
3
4
  download_dir: tmp/solr
data/.standard.yml ADDED
@@ -0,0 +1 @@
1
+ format: progress
data/Gemfile CHANGED
@@ -1,39 +1,41 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in geoblacklight.gemspec
4
4
  gemspec
5
5
 
6
6
  group :development, :test do
7
7
  # See https://github.com/rails/rails/issues/32955
8
- gem 'thor', '>= 0.19.0'
8
+ gem "thor", ">= 0.19.0"
9
9
  end
10
10
 
11
11
  # BEGIN ENGINE_CART BLOCK
12
12
  # engine_cart: 0.10.0
13
13
  # engine_cart stanza: 0.10.0
14
14
  # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
15
- file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
15
+ file = File.expand_path("Gemfile", ENV["ENGINE_CART_DESTINATION"] || ENV["RAILS_ROOT"] || File.expand_path(".internal_test_app", File.dirname(__FILE__)))
16
16
  if File.exist?(file)
17
17
  begin
18
18
  eval_gemfile file
19
19
  rescue Bundler::GemfileError => e
20
- Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
20
+ Bundler.ui.warn "[EngineCart] Skipping Rails application dependencies:"
21
21
  Bundler.ui.warn e.message
22
22
  end
23
23
  else
24
24
  Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
25
25
 
26
- if ENV['RAILS_VERSION']
27
- if ENV['RAILS_VERSION'] == 'edge'
28
- gem 'rails', github: 'rails/rails'
29
- ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
26
+ if ENV["RAILS_VERSION"]
27
+ if ENV["RAILS_VERSION"] == "edge"
28
+ gem "rails", github: "rails/rails"
29
+ ENV["ENGINE_CART_RAILS_OPTIONS"] = "--edge --skip-turbolinks"
30
30
  else
31
- gem 'rails', ENV['RAILS_VERSION']
31
+ gem "rails", ENV["RAILS_VERSION"]
32
32
  end
33
33
  end
34
34
  end
35
35
 
36
- if File.exists?('spec/test_app_templates/Gemfile.extra')
37
- eval File.read('spec/test_app_templates/Gemfile.extra'), nil, 'spec/test_app_templates/Gemfile.extra'
36
+ if File.exist?("spec/test_app_templates/Gemfile.extra")
37
+ # rubocop:disable Security/Eval
38
+ eval File.read("spec/test_app_templates/Gemfile.extra"), nil, "spec/test_app_templates/Gemfile.extra"
39
+ # rubocop:enable Security/Eval
38
40
  end
39
41
  # END ENGINE_CART BLOCK
data/README.md CHANGED
@@ -10,7 +10,7 @@ communities. We're actively looking for community input and development partners
10
10
 
11
11
  ### Installation
12
12
 
13
- Bootstrap a new GeoBlacklight Ruby on Rails application using the template script:
13
+ Use Ruby v3.2 and Rails v7 to bootstrap a new GeoBlacklight application using the template script:
14
14
 
15
15
  ```bash
16
16
  DISABLE_SPRING=1 rails new app-name -m https://raw.githubusercontent.com/geoblacklight/geoblacklight/main/template.rb
data/Rakefile CHANGED
@@ -1,130 +1,122 @@
1
- # encoding: UTF-8
2
1
  # frozen_string_literal: true
3
- require 'rails'
2
+
3
+ require "rails"
4
4
  begin
5
- require 'bundler/setup'
6
- require 'bundler/gem_tasks'
5
+ require "bundler/setup"
6
+ require "bundler/gem_tasks"
7
7
  rescue LoadError
8
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
8
+ puts "You must `gem install bundler` and `bundle install` to run rake tasks"
9
9
  end
10
10
 
11
- require 'solr_wrapper'
12
- require 'solr_wrapper/rake_task'
13
- require 'engine_cart/rake_task'
14
- require 'rspec/core/rake_task'
15
- require 'rubocop/rake_task'
16
- require 'solr_wrapper/rake_task'
17
-
18
- desc 'Run RuboCop style checker'
19
- RuboCop::RakeTask.new(:rubocop) do |task|
20
- task.requires << 'rubocop-rspec'
21
- task.fail_on_error = true
22
- end
11
+ require "solr_wrapper"
12
+ require "solr_wrapper/rake_task"
13
+ require "engine_cart/rake_task"
14
+ require "rspec/core/rake_task"
23
15
 
24
16
  task(:spec).clear
25
17
  RSpec::Core::RakeTask.new(:spec) do |t|
26
18
  t.verbose = false
27
19
  end
28
20
 
29
- desc 'Run JavaScript unit tests'
21
+ desc "Run JavaScript unit tests"
30
22
  task :javascript_tests do
31
- system '/bin/bash -c yarn test'
23
+ system "/bin/bash -c yarn test"
32
24
  end
33
25
 
34
- desc 'Run test suite'
35
- task ci: ['geoblacklight:generate'] do
26
+ desc "Run test suite"
27
+ task ci: ["geoblacklight:generate"] do
36
28
  within_test_app do
37
- system 'RAILS_ENV=test rake geoblacklight:index:seed'
29
+ system "RAILS_ENV=test rake geoblacklight:index:seed"
38
30
  end
39
31
 
40
32
  # Run RSpec tests with Coverage
41
- Rake::Task['geoblacklight:coverage'].invoke
33
+ Rake::Task["geoblacklight:coverage"].invoke
42
34
 
43
35
  # Run JavaScript tests
44
- Rake::Task['javascript_tests'].invoke
36
+ Rake::Task["javascript_tests"].invoke
45
37
  end
46
38
 
47
39
  namespace :geoblacklight do
48
- desc 'Run tests with coverage'
40
+ desc "Run tests with coverage"
49
41
  task :coverage do
50
- ENV['COVERAGE'] = 'true'
51
- Rake::Task['spec'].invoke
42
+ ENV["COVERAGE"] = "true"
43
+ Rake::Task["spec"].invoke
52
44
  end
53
45
 
54
- desc 'Create the test rails app'
55
- task generate: ['engine_cart:generate'] do
46
+ desc "Create the test rails app"
47
+ task generate: ["engine_cart:generate"] do
56
48
  # Intentionally Empty Block
57
49
  end
58
50
 
59
51
  namespace :internal do
60
- task seed: ['engine_cart:generate'] do
52
+ task seed: ["engine_cart:generate"] do
61
53
  within_test_app do
62
- system 'bundle exec rake geoblacklight:index:seed'
63
- system 'bundle exec rake geoblacklight:downloads:mkdir'
54
+ system "bundle exec rake geoblacklight:index:seed"
55
+ system "bundle exec rake geoblacklight:downloads:mkdir"
64
56
  end
65
57
  end
66
58
  end
67
59
 
68
- desc 'Run Solr and GeoBlacklight for interactive development'
60
+ desc "Run Solr and GeoBlacklight for interactive development"
69
61
  task :server, [:rails_server_args] do |_t, args|
70
62
  if File.exist? EngineCart.destination
71
63
  within_test_app do
72
- system 'bundle update'
64
+ system "bundle update"
73
65
  end
74
66
  else
75
- Rake::Task['engine_cart:generate'].invoke
67
+ Rake::Task["engine_cart:generate"].invoke
76
68
  end
77
69
 
78
- SolrWrapper.wrap(port: '8983') do |solr|
79
- solr.with_collection(name: 'blacklight-core', dir: File.join(File.expand_path('.', File.dirname(__FILE__)), 'solr', 'conf')) do
80
- Rake::Task['geoblacklight:internal:seed'].invoke
70
+ SolrWrapper.wrap(port: "8983") do |solr|
71
+ solr.with_collection(name: "blacklight-core", dir: File.join(File.expand_path(".", File.dirname(__FILE__)), "solr", "conf")) do
72
+ Rake::Task["geoblacklight:internal:seed"].invoke
81
73
 
82
74
  within_test_app do
83
75
  puts "\nSolr server running: http://localhost:#{solr.port}/solr/#/blacklight-core"
84
76
  puts "\n^C to stop"
85
- puts ' '
77
+ puts " "
86
78
  begin
87
79
  system "bundle exec rails s #{args[:rails_server_args]}"
88
80
  rescue Interrupt
89
- puts 'Shutting down...'
81
+ puts "Shutting down..."
90
82
  end
91
83
  end
92
84
  end
93
85
  end
94
86
  end
95
87
 
96
- desc 'Run Solr and seed with sample data'
88
+ desc "Run Solr and seed with sample data"
97
89
  task :solr do
98
90
  if File.exist? EngineCart.destination
99
91
  within_test_app do
100
- system 'bundle update'
92
+ system "bundle update"
101
93
  end
102
94
  else
103
- Rake::Task['engine_cart:generate'].invoke
95
+ Rake::Task["engine_cart:generate"].invoke
104
96
  end
105
97
 
106
- SolrWrapper.wrap(port: '8983') do |solr|
107
- solr.with_collection(name: 'blacklight-core', dir: File.join(File.expand_path('.', File.dirname(__FILE__)), 'solr', 'conf')) do
108
- Rake::Task['geoblacklight:internal:seed'].invoke
98
+ SolrWrapper.wrap(port: "8983") do |solr|
99
+ solr.with_collection(name: "blacklight-core", dir: File.join(File.expand_path(".", File.dirname(__FILE__)), "solr", "conf")) do
100
+ Rake::Task["geoblacklight:internal:seed"].invoke
109
101
 
110
102
  within_test_app do
111
103
  puts "\nSolr server running: http://localhost:#{solr.port}/solr/#/blacklight-core"
112
104
  puts "\n^C to stop"
113
- puts ' '
105
+ puts " "
114
106
  begin
115
107
  sleep
116
108
  rescue Interrupt
117
- puts 'Shutting down...'
109
+ puts "Shutting down..."
118
110
  end
119
111
  end
120
112
  end
121
113
  end
122
114
  end
123
115
 
124
- desc 'Stdout output asset paths'
116
+ desc "Stdout output asset paths"
125
117
  task :asset_paths do
126
118
  within_test_app do
127
- system 'bundle exec rake geoblacklight:application_asset_paths'
119
+ system "bundle exec rake geoblacklight:application_asset_paths"
128
120
  end
129
121
  end
130
122
  end
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 27.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 201 141.2" style="enable-background:new 0 0 201 141.2;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill-rule:evenodd;clip-rule:evenodd;fill:#6c757d;}
7
+ .st1{fill-rule:evenodd;clip-rule:evenodd;stroke:#6c757d;stroke-width:0.1;fill:#6c757d;}
8
+ .st2{fill:#6c757d;}
9
+ </style>
10
+ <path class="st0" d="M115.7,69.9h21.1l2.6-29.6c0.2-2.8,0.4-5.6,0.6-8.4h0.7c0.2,2.9,0.7,5.7,1.4,8.6l7.8,29.3h12.7l8.7-31
11
+ c0.6-2.2,1-4.6,1.4-6.9h0.4L176,70h21.1l-9.9-69.3H165l-6.8,27.2c-0.7,2.9-1.1,6.2-1.5,9.2h-0.6l-8.3-36.4h-22.5L115.7,69.9z"/>
12
+ <path class="st1" d="M197.1,98.5c-5-1.7-11-2.7-17.5-2.7c-23.3,0-37.2,15.4-65.7,13.3c-1.8,0-3.3-1.5-3.3-3.3c0-0.3,0-0.6,0.1-0.9
13
+ l-1.1,7.5c-0.1,0.3-0.1,0.6-0.1,0.9c0,1.8,1.5,3.3,3.3,3.3c28.5,2.1,43.4-13.3,66.8-13.3c6.5,0,12.5,1,17.5,2.7v20.8
14
+ c-5-1.7-11-2.7-17.5-2.7c-23.3,0-39.3,15.2-67.8,13.1c-2.6,0-4.8-2.1-4.8-4.8c0-0.3,0-0.6,0.1-0.8l1.9-13.1L5,130.2v-21.1l106.5-7.7
15
+ l0.8-5.7L5,99.9V78.8h104c2.6,0,4.7,2.1,4.7,4.8l-0.1,0.8c-0.1,0.3-0.1,0.6-0.1,0.9c0,1.8,1.5,3.3,3.3,3.3
16
+ c28.5,2.1,39.4-13.1,62.8-13.1c6.5,0,12.5,1,17.5,2.7L197.1,98.5L197.1,98.5z"/>
17
+ <path class="st2" d="M78.2,0.7C78.9,0.7,79,1,79,1.6v3.3c0,0.3-0.1,0.6-0.1,0.7c-0.1,0.1-2.2,0.2-2.4,0.2c-1.9,0.1-4,0.8-4,3.7
18
+ c0,1.6,0.3,2.8,1.6,8l8.3,34.8c5-19,10.9-44,13-51.3c0.3-0.3,0.4-0.3,0.7-0.3c1.9,0,2.7-0.2,2.9,0.4l15,54.8c0,0-1.4,9.8-1.9,13.2
19
+ c-0.1,0.8-0.4,0.8-1,0.8h-4.4c-0.6,0-0.7-0.2-0.9-0.9c-1.6-7.7-2.2-10.4-4.7-19.4c-2.6-9.5-5-20.5-6.8-28.8
20
+ c-2.4,10.3-2.9,12.6-8.3,33.5c-1.9,7.2-2.4,9.5-3.7,14.9c-0.2,0.6-0.3,0.7-0.9,0.7H76c-0.5,0-0.6-0.3-0.7-1
21
+ c-1.5-6.1-12.6-49.3-12.9-50.6C60.9,12.4,60,6.6,56.6,6.6c-2,0-2.4,2.7-2.4,6.4v28.1c-0.1,6.5-0.1,16.1-6.3,23.5
22
+ c-1.7,2.1-7.1,7.7-18,7.7C25,72.4,18.7,71,14,66.1c-5.9-6.2-6.2-13.9-6.3-20.9V14.6c0-7-0.7-9-6.2-9C1.1,5.6,1.1,5.5,1,4.9V1.6
23
+ c0-0.7,0-1.1,0.8-1.1c1.8,0,19.2,0.1,23.5,0c0.2,0,0.5,0.1,0.5,0.7v3.7c-0.1,0.7-0.2,0.7-1.1,0.7c-6.1,0-5.8,2.5-5.8,9.7v22.1
24
+ l0.1,7.9c0.2,4,0.5,7.7,2.2,11.7c1.2,2.7,4.9,8.4,12.2,8.4c4,0,7.9-1.7,10.8-5.1c4.3-5.1,4.9-12,5-19.5V14.3c0-6.9-0.6-8.6-7.5-9
25
+ c-0.5,0-0.6-0.1-0.6-0.6V1.4c0-0.6,0-0.7,0.5-0.7C41.8,0.7,77.2,0.7,78.2,0.7z"/>
26
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 32">
2
+ <path fill="#6c757d" d="M 17.03125 3.980469 L 23.546875 3.980469 L 23.546875 6.632812 L 20.839844 6.632812 L 27.957031 25.300781 L 30.058594 25.300781 L 30.058594 28.046875 L 21.242188 28.046875 L 21.242188 25.375 L 18.765625 25.375 L 18.765625 30.613281 L 32.683594 30.613281 L 32.683594 22.800781 L 29.558594 22.808594 L 24.546875 9.210938 L 26.121094 9.210938 L 26.121094 1.402344 L 7.941406 1.402344 L 7.941406 9.210938 L 9.515625 9.210938 L 4.503906 22.789062 L 1.378906 22.800781 L 1.378906 30.613281 L 15.300781 30.613281 L 15.300781 25.375 L 12.824219 25.375 L 12.824219 28.046875 L 4.003906 28.046875 L 4.003906 25.300781 L 6.109375 25.300781 L 13.222656 6.632812 L 10.515625 6.632812 L 10.515625 3.980469 Z M 17.03125 3.980469"/>
3
+ <path fill="#6c757d" d="M 17.027344 4.003906 L 24.25 23.074219 C 24.25 23.074219 25.175781 25.394531 26.679688 25.394531 L 21.417969 25.394531 C 21.417969 25.394531 21.683594 25.433594 21.945312 24.988281 C 22.097656 24.734375 21.96875 24.351562 21.96875 24.351562 L 20.34375 20.09375 L 13.722656 20.09375 L 12.09375 24.351562 C 12.09375 24.351562 11.96875 24.734375 12.117188 24.988281 C 12.378906 25.433594 12.644531 25.394531 12.644531 25.394531 L 7.382812 25.394531 C 8.886719 25.394531 9.8125 23.074219 9.8125 23.074219 L 17.027344 4.003906 M 17.019531 18.070312 L 19.566406 18.070312 L 17.070312 11.382812 L 14.488281 18.070312 Z M 17.019531 18.070312"/>
4
+ </svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="#6c757d" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="#6c757d" d="M159.3 5.4c7.8-7.3 19.9-7.2 27.7 .1c27.6 25.9 53.5 53.8 77.7 84c11-14.4 23.5-30.1 37-42.9c7.9-7.4 20.1-7.4 28 .1c34.6 33 63.9 76.6 84.5 118c20.3 40.8 33.8 82.5 33.8 111.9C448 404.2 348.2 512 224 512C98.4 512 0 404.1 0 276.5c0-38.4 17.8-85.3 45.4-131.7C73.3 97.7 112.7 48.6 159.3 5.4zM225.7 416c25.3 0 47.7-7 68.8-21c42.1-29.4 53.4-88.2 28.1-134.4c-4.5-9-16-9.6-22.5-2l-25.2 29.3c-6.6 7.6-18.5 7.4-24.7-.5c-16.5-21-46-58.5-62.8-79.8c-6.3-8-18.3-8.1-24.7-.1c-33.8 42.5-50.8 69.3-50.8 99.4C112 375.4 162.6 416 225.7 416z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="#6c757d" d="M272 384c9.6-31.9 29.5-59.1 49.2-86.2l0 0c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C368 78.8 289.2 0 192 0S16 78.8 16 176c0 37.3 11.6 71.9 31.4 100.3c5 7.2 10.2 14.3 15.4 21.4l0 0c19.8 27.1 39.7 54.4 49.2 86.2H272zM192 512c44.2 0 80-35.8 80-80V416H112v16c0 44.2 35.8 80 80 80zM112 176c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-61.9 50.1-112 112-112c8.8 0 16 7.2 16 16s-7.2 16-16 16c-44.2 0-80 35.8-80 80z"/></svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 152 152">
2
+ <path d="M89.818,3.455v38h10.364V76L53.545,3.455H3.455v38H13.818v69.091H3.455v38H62.182v-38H51.818V76l46.636,72.545h50.091v-38H138.182V41.455h10.364v-38ZM58.727,114v31.091H6.909V114H17.273V38H6.909V6.909H51.818l51.818,79.455V38H93.273V6.909h51.818V38H134.727v76h10.364v31.091H100.182L48.364,65.636V114Z" fill="#6c757d"></path>
3
+ <path d="M147.008,0H86.364V44.909H96.727V65.636L55.273,0H0V44.909H10.364v62.182H0V152H65.636V107.091H55.273V86.364L96.727,152H152V107.091H141.636V44.909H152V0Zm1.537,41.455H138.182v69.091h10.364v38H98.455L51.818,76v34.545H62.182v38H3.455v-38H13.818V41.455H3.455v-38H53.545L100.182,76V41.455H89.818v-38h58.727ZM103.636,86.364,51.818,6.909H6.909V38H17.273v76H6.909v31.091H58.727V114H48.364V65.636l51.818,79.455h44.909V114H134.727V38h10.364V6.909H93.273V38h10.364Z" fill="#6c757d"></path>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 246.005 217.375">
2
+ <path fill="#6c757d" d="m223.76,176.25l-39.62-60.16c28.72-11.67,43.32-29.88,43.32-54.14,0-17.61-6.99-31.95-21.43-43.84C191.2,6.08,171.06,0,146.13,0H0v41.14h16.35v135.11H0v41.13h107.09v-41.13h-16.9v-51.74h25.93l32.59,51.74h-17.74v41.13h115.03v-41.13h-22.24Zm16.57,35.45h-103.71v-29.8h22.29l-39.71-63.09h-34.71v63.09h16.94v29.8H5.67v-29.8h16.35V35.47H5.67V5.61h140.43c23.59,0,42.54,5.66,56.32,16.84,13.01,10.72,19.33,23.62,19.33,39.44,0,22.86-13.98,39.25-42.73,50.08l-3.47,1.3,45.17,68.63h19.61v29.8Z"/>
3
+ <path fill="#6c757d" d="m220.72,181.9l-45.17-68.63,3.47-1.3c28.75-10.83,42.73-27.22,42.73-50.08,0-15.82-6.32-28.72-19.33-39.44-13.78-11.18-32.73-16.84-56.32-16.84H5.67v29.86h16.35v146.43H5.67v29.8h95.76v-29.8h-16.94v-63.09h34.71l39.71,63.09h-22.29v29.8h103.71v-29.8h-19.61Zm-72.53-100.13l-.07.06c-7.4,5.78-18.3,8.71-32.43,8.71h-31.2v-55.07h38.5c12.04,0,21.34,3.36,27.68,9.94,2.28,2.24,4.09,4.93,5.29,7.9,1.21,2.97,1.79,6.16,1.71,9.36-.01,7.39-3.2,13.82-9.48,19.1Z"/>
4
+ <path fill="#6c757d" d="m155.96,53.31c-1.2-2.97-3.01-5.66-5.29-7.9-6.34-6.58-15.64-9.94-27.68-9.94h-38.5v55.07h31.2c14.13,0,25.03-2.93,32.43-8.71l.07-.06c6.28-5.28,9.47-11.71,9.48-19.1.08-3.2-.5-6.39-1.71-9.36Zm-11.32,24.07c-6.36,4.98-16.09,7.51-28.87,7.51h-25.58v-43.75h32.8c10.39,0,18.35,2.77,23.63,8.22l.08.08c1.76,1.72,3.13,3.79,4.05,6.06.91,2.28,1.35,4.73,1.27,7.18-.03,5.68-2.44,10.48-7.38,14.7Z"/>
5
+ </svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="#6c757d" d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/></svg>
@@ -32,3 +32,11 @@
32
32
  .card.relations {
33
33
  margin-bottom: 20px;
34
34
  }
35
+
36
+ .page-sidebar [data-map="item"] {
37
+ height: 280px;
38
+
39
+ .leaflet-control-attribution {
40
+ display: none;
41
+ }
42
+ }
@@ -0,0 +1 @@
1
+ <%= @display_note %>
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Geoblacklight
4
+ class DisplayNoteComponent < ViewComponent::Base
5
+ include Blacklight::IconHelperBehavior
6
+
7
+ def initialize(display_note:)
8
+ @display_note = display_note
9
+ super
10
+ end
11
+
12
+ def before_render
13
+ @display_note = decorated_note
14
+ super
15
+ end
16
+
17
+ private
18
+
19
+ def decorated_note
20
+ @note = ""
21
+ prefixed = false
22
+ prefixes.each do |prefix, value|
23
+ if @display_note.include?(prefix)
24
+ prefixed = true
25
+ @note = tag.div class: "gbl-display-note alert #{value.first}", role: "alert" do
26
+ capture do
27
+ "#{blacklight_icon(value.second)}
28
+ #{@display_note}".html_safe
29
+ end
30
+ end
31
+ end
32
+ end
33
+
34
+ if prefixed == false
35
+ @note = tag.div class: "gbl-display-note alert alert-secondary", role: "alert" do
36
+ @display_note
37
+ end
38
+ end
39
+
40
+ @note
41
+ end
42
+
43
+ def prefixes
44
+ Settings.DISPLAY_NOTES_SHOWN.map { |key, value| [value.note_prefix, [value.bootstrap_alert_class, value.icon]] }.to_h
45
+ end
46
+ end
47
+ end
@@ -25,9 +25,9 @@ module Geoblacklight
25
25
  private
26
26
 
27
27
  def decorated_label
28
- icon = geoblacklight_icon(@facet_item.value, aria_hidden: true, classes: 'svg_tooltip')
28
+ icon = geoblacklight_icon(@facet_item.value, aria_hidden: true, classes: "svg_tooltip")
29
29
 
30
- safe_join([icon, @undecorated_label], ' ')
30
+ safe_join([icon, @undecorated_label], " ")
31
31
  end
32
32
  end
33
33
  end
@@ -1,17 +1,18 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class DownloadController < ApplicationController
3
4
  # include Blacklight::SearchHelper
4
5
  include Blacklight::Catalog
5
6
 
6
7
  rescue_from Geoblacklight::Exceptions::ExternalDownloadFailed do |exception|
7
- Geoblacklight.logger.error exception.message + ' ' + exception.url
8
+ Geoblacklight.logger.error exception.message + " " + exception.url
8
9
  flash[:danger] = view_context
9
- .tag.span(flash_error_message(exception),
10
- data: {
11
- download: 'error',
12
- download_id: params[:id],
13
- download_type: "generated-#{params[:type]}"
14
- })
10
+ .tag.span(flash_error_message(exception),
11
+ data: {
12
+ download: "error",
13
+ download_id: params[:id],
14
+ download_type: "generated-#{params[:type]}"
15
+ })
15
16
  respond_to do |format|
16
17
  format.json { render json: flash, response: response }
17
18
  format.html { render json: flash, response: response }
@@ -41,9 +42,9 @@ class DownloadController < ApplicationController
41
42
  if params[:email]
42
43
  response = Geoblacklight::HglDownload.new(@document, params[:email]).get
43
44
  if response.nil?
44
- flash[:danger] = t 'geoblacklight.download.error'
45
+ flash[:danger] = t "geoblacklight.download.error"
45
46
  else
46
- flash[:success] = t 'geoblacklight.download.hgl_success'
47
+ flash[:success] = t "geoblacklight.download.hgl_success"
47
48
  end
48
49
  respond_to do |format|
49
50
  format.json { render json: flash, response: response }
@@ -62,17 +63,16 @@ class DownloadController < ApplicationController
62
63
  # exception
63
64
  # @return [String] error message to display in flash
64
65
  def flash_error_message(exception)
65
- message = if exception.url.present?
66
- t('geoblacklight.download.error_with_url',
67
- link: view_context
68
- .link_to(exception.url,
69
- exception.url,
70
- target: 'blank'))
71
- .html_safe
72
- else
73
- t('geoblacklight.download.error')
74
- end
75
- message
66
+ if exception.url.present?
67
+ t("geoblacklight.download.error_with_url",
68
+ link: view_context
69
+ .link_to(exception.url,
70
+ exception.url,
71
+ target: "blank"))
72
+ .html_safe
73
+ else
74
+ t("geoblacklight.download.error")
75
+ end
76
76
  end
77
77
 
78
78
  private
@@ -82,25 +82,24 @@ class DownloadController < ApplicationController
82
82
  end
83
83
 
84
84
  def check_type
85
- response = case params[:type]
86
- when 'shapefile'
87
- Geoblacklight::ShapefileDownload.new(@document).get
88
- when 'kmz'
89
- Geoblacklight::KmzDownload.new(@document).get
90
- when 'geojson'
91
- Geoblacklight::GeojsonDownload.new(@document).get
92
- when 'geotiff'
93
- Geoblacklight::GeotiffDownload.new(@document).get
94
- end
95
- response
85
+ case params[:type]
86
+ when "shapefile"
87
+ Geoblacklight::ShapefileDownload.new(@document).get
88
+ when "kmz"
89
+ Geoblacklight::KmzDownload.new(@document).get
90
+ when "geojson"
91
+ Geoblacklight::GeojsonDownload.new(@document).get
92
+ when "geotiff"
93
+ Geoblacklight::GeotiffDownload.new(@document).get
94
+ end
96
95
  end
97
96
 
98
97
  def validate(response)
99
- flash[:success] = view_context.link_to(t('geoblacklight.download.success', title: response),
100
- download_file_path(response),
101
- data: { download: 'trigger',
102
- download_id: params[:id],
103
- download_type: "generated-#{params[:type]}" })
98
+ flash[:success] = view_context.link_to(t("geoblacklight.download.success", title: response),
99
+ download_file_path(response),
100
+ data: {download: "trigger",
101
+ download_id: params[:id],
102
+ download_type: "generated-#{params[:type]}"})
104
103
  end
105
104
 
106
105
  # Checks whether a document is public, if not require user to authenticate
@@ -109,6 +108,6 @@ class DownloadController < ApplicationController
109
108
  end
110
109
 
111
110
  def file_name_to_id(file_name)
112
- file_name.split('-')[0..-2].join('-')
111
+ file_name.split("-")[0..-2].join("-")
113
112
  end
114
113
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class RelationController < ApplicationController
3
4
  include Blacklight::Configurable
4
5
  # include Blacklight::SearchHelper
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class WmsController < ApplicationController
3
4
  def handle
4
5
  response = Geoblacklight::WmsLayer.new(wms_params).feature_info
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ArcgisHelper
3
4
  ##
4
5
  # Generates an ArcGIS.com viewer url with params that can open content
@@ -8,6 +9,6 @@ module ArcgisHelper
8
9
  params = URI.encode_www_form(
9
10
  urls: arcgis_urls
10
11
  )
11
- Settings.ARCGIS_BASE_URL + '?' + params
12
+ Settings.ARCGIS_BASE_URL + "?" + params
12
13
  end
13
14
  end
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module BlacklightHelper
3
4
  include Blacklight::BlacklightHelperBehavior
4
5
  include Geoblacklight::GeoblacklightHelperBehavior
5
6
  include Blacklight::CatalogHelperBehavior
6
7
 
7
8
  def render_document_sidebar_partial(document = @document)
8
- super(document) + (render 'relations_container', document: document)
9
+ super(document) + (render "relations_container", document: document)
9
10
  end
10
11
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module CartoHelper
3
4
  ##
4
5
  # Creates a Carto OneClick link, using the configuration link
@@ -10,14 +11,14 @@ module CartoHelper
10
11
  provider: carto_provider,
11
12
  logo: Settings.APPLICATION_LOGO_URL
12
13
  )
13
- carto_oneclick_host + '?' + params
14
+ carto_oneclick_host + "?" + params
14
15
  end
15
16
 
16
17
  ##
17
18
  # Removes blank space from provider to accomodate Carto OneClick
18
19
  #
19
20
  def carto_provider
20
- application_name.delete(' ')
21
+ application_name.delete(" ")
21
22
  end
22
23
 
23
24
  private