geoblacklight 2.4.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +152 -64
  3. data/.rubocop.yml +15 -13
  4. data/.rubocop_todo.yml +66 -10
  5. data/README.md +1 -1
  6. data/Rakefile +1 -0
  7. data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +1 -1
  8. data/app/assets/javascripts/geoblacklight/modules/svg_tooltips.js +31 -0
  9. data/app/assets/javascripts/geoblacklight/viewers/esri.js +2 -2
  10. data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +1 -1
  11. data/app/assets/javascripts/geoblacklight/viewers/wms.js +2 -2
  12. data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +2 -0
  13. data/app/assets/stylesheets/geoblacklight/modules/_base.scss +33 -0
  14. data/app/assets/stylesheets/geoblacklight/{_blacklight_overrides.scss → modules/_blacklight_overrides.scss} +0 -0
  15. data/app/assets/stylesheets/geoblacklight/{_styles.scss → modules/_styles.scss} +1 -0
  16. data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +37 -54
  17. data/app/assets/stylesheets/geoblacklight/modules/item.scss +1 -0
  18. data/app/assets/stylesheets/geoblacklight/modules/results.scss +16 -28
  19. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +12 -42
  20. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +17 -59
  21. data/app/controllers/download_controller.rb +12 -12
  22. data/app/controllers/relation_controller.rb +1 -0
  23. data/app/controllers/wms_controller.rb +1 -0
  24. data/app/helpers/arcgis_helper.rb +1 -0
  25. data/app/helpers/blacklight_helper.rb +1 -0
  26. data/app/helpers/carto_helper.rb +1 -0
  27. data/app/helpers/geoblacklight_helper.rb +25 -72
  28. data/app/models/concerns/geoblacklight/solr_document.rb +7 -6
  29. data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +2 -1
  30. data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -13
  31. data/app/models/concerns/geoblacklight/solr_document/citation.rb +1 -0
  32. data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
  33. data/app/models/concerns/geoblacklight/solr_document/inspection.rb +2 -1
  34. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +3 -1
  35. data/app/presenters/geoblacklight/document_presenter.rb +2 -1
  36. data/app/views/catalog/_arcgis.html.erb +4 -0
  37. data/app/views/catalog/_carto.html.erb +4 -0
  38. data/app/views/catalog/_downloads_primary.html.erb +8 -1
  39. data/app/views/catalog/_header_icons.html.erb +3 -3
  40. data/app/views/catalog/_home_text.html.erb +3 -0
  41. data/app/views/catalog/_index_split_default.html.erb +21 -21
  42. data/app/views/relation/_ancestors.html.erb +1 -4
  43. data/app/views/relation/_descendants.html.erb +2 -5
  44. data/app/views/relation/index.html.erb +20 -8
  45. data/app/views/relation/index.json.jbuilder +2 -1
  46. data/app/views/shared/_header_navbar.html.erb +0 -2
  47. data/bin/coverage.rb +36 -0
  48. data/config/initializers/rails_config.rb +1 -0
  49. data/config/locales/geoblacklight.en.yml +3 -2
  50. data/geoblacklight.gemspec +3 -6
  51. data/lib/generators/geoblacklight/assets_generator.rb +46 -0
  52. data/lib/generators/geoblacklight/install_generator.rb +3 -9
  53. data/lib/generators/geoblacklight/templates/assets/_blacklight.scss +1 -0
  54. data/lib/generators/geoblacklight/templates/assets/_customizations.scss +28 -0
  55. data/{app/assets/stylesheets/geoblacklight/application.scss → lib/generators/geoblacklight/templates/assets/_geoblacklight.scss} +0 -1
  56. data/lib/generators/geoblacklight/templates/assets/application.scss +7 -0
  57. data/lib/generators/geoblacklight/templates/{geoblacklight.js → assets/geoblacklight.js} +0 -0
  58. data/lib/generators/geoblacklight/templates/catalog_controller.rb +3 -2
  59. data/lib/generators/geoblacklight/templates/settings.yml +0 -6
  60. data/lib/generators/geoblacklight/webpacker_generator.rb +1 -0
  61. data/lib/geoblacklight.rb +1 -0
  62. data/lib/geoblacklight/bounding_box.rb +1 -0
  63. data/lib/geoblacklight/catalog_helper_override.rb +1 -0
  64. data/lib/geoblacklight/constants.rb +1 -0
  65. data/lib/geoblacklight/download.rb +2 -1
  66. data/lib/geoblacklight/download/geojson_download.rb +1 -0
  67. data/lib/geoblacklight/download/geotiff_download.rb +1 -0
  68. data/lib/geoblacklight/download/hgl_download.rb +1 -0
  69. data/lib/geoblacklight/download/kmz_download.rb +2 -1
  70. data/lib/geoblacklight/download/shapefile_download.rb +1 -0
  71. data/lib/geoblacklight/engine.rb +1 -2
  72. data/lib/geoblacklight/exceptions.rb +1 -0
  73. data/lib/geoblacklight/geoblacklight_helper_behavior.rb +1 -0
  74. data/lib/geoblacklight/item_viewer.rb +1 -0
  75. data/lib/geoblacklight/metadata.rb +1 -0
  76. data/lib/geoblacklight/metadata/base.rb +1 -0
  77. data/lib/geoblacklight/metadata/fgdc.rb +1 -0
  78. data/lib/geoblacklight/metadata/html.rb +2 -2
  79. data/lib/geoblacklight/metadata/iso19139.rb +1 -0
  80. data/lib/geoblacklight/metadata_transformer.rb +1 -0
  81. data/lib/geoblacklight/metadata_transformer/base.rb +1 -0
  82. data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
  83. data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
  84. data/lib/geoblacklight/reference.rb +1 -0
  85. data/lib/geoblacklight/references.rb +7 -3
  86. data/lib/geoblacklight/relation/ancestors.rb +1 -0
  87. data/lib/geoblacklight/relation/descendants.rb +1 -0
  88. data/lib/geoblacklight/relation/relation_response.rb +2 -1
  89. data/lib/geoblacklight/routes.rb +1 -0
  90. data/lib/geoblacklight/routes/downloadable.rb +1 -0
  91. data/lib/geoblacklight/routes/exportable.rb +1 -0
  92. data/lib/geoblacklight/routes/wms.rb +1 -0
  93. data/lib/geoblacklight/version.rb +2 -1
  94. data/lib/geoblacklight/view_helper_override.rb +1 -0
  95. data/lib/geoblacklight/wms_layer.rb +1 -0
  96. data/lib/geoblacklight/wms_layer/feature_info_response.rb +1 -0
  97. data/lib/tasks/geoblacklight.rake +33 -32
  98. data/spec/controllers/catalog_controller_spec.rb +1 -0
  99. data/spec/controllers/download_controller_spec.rb +1 -0
  100. data/spec/controllers/relation_controller_spec.rb +1 -0
  101. data/spec/controllers/wms_controller_spec.rb +1 -0
  102. data/spec/factories/user.rb +1 -0
  103. data/spec/features/bookmarks_spec.rb +1 -0
  104. data/spec/features/configurable_basemap_spec.rb +1 -0
  105. data/spec/features/data_dictionary_download_spec.rb +1 -0
  106. data/spec/features/download_layer_spec.rb +1 -0
  107. data/spec/features/empty_search_spec.rb +1 -0
  108. data/spec/features/esri_viewer_spec.rb +1 -5
  109. data/spec/features/exports_spec.rb +4 -12
  110. data/spec/features/help_text_spec.rb +1 -0
  111. data/spec/features/home_page_spec.rb +6 -0
  112. data/spec/features/iiif_viewer_spec.rb +1 -0
  113. data/spec/features/index_map_spec.rb +1 -0
  114. data/spec/features/layer_inspection_spec.rb +1 -0
  115. data/spec/features/layer_opacity_spec.rb +1 -0
  116. data/spec/features/layer_preview_spec.rb +1 -0
  117. data/spec/features/layer_with_no_references_spec.rb +1 -0
  118. data/spec/features/linkified_attribute_table_spec.rb +1 -0
  119. data/spec/features/metadata_panel_spec.rb +1 -0
  120. data/spec/features/missing_metadata_spec.rb +1 -0
  121. data/spec/features/multiple_downloads_spec.rb +15 -0
  122. data/spec/features/oembed_spec.rb +1 -0
  123. data/spec/features/relations_spec.rb +10 -29
  124. data/spec/features/saved_searches_spec.rb +1 -0
  125. data/spec/features/search_bar_spec.rb +1 -0
  126. data/spec/features/search_results_map_spec.rb +1 -6
  127. data/spec/features/search_results_overlap_ratio_spec.rb +4 -3
  128. data/spec/features/search_spec.rb +1 -0
  129. data/spec/features/show_page_metadata_spec.rb +1 -0
  130. data/spec/features/sms_spec.rb +1 -0
  131. data/spec/features/split_view.html.erb_spec.rb +2 -1
  132. data/spec/features/suppressed_records_spec.rb +1 -0
  133. data/spec/features/web_services_modal_spec.rb +1 -0
  134. data/spec/fixtures/solr_documents/multiple-downloads.json +30 -0
  135. data/spec/helpers/arcgis_helper_spec.rb +1 -0
  136. data/spec/helpers/carto_helper_spec.rb +1 -0
  137. data/spec/helpers/geoblacklight_helper_spec.rb +47 -14
  138. data/spec/javascripts/geoblacklight/viewers/esri/tiled_map_layer_spec.js +12 -0
  139. data/spec/lib/geoblacklight/bounding_box_spec.rb +1 -0
  140. data/spec/lib/geoblacklight/controller_override_spec.rb +1 -0
  141. data/spec/lib/geoblacklight/document_presenter_spec.rb +3 -2
  142. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -0
  143. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -0
  144. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +1 -0
  145. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +1 -0
  146. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -0
  147. data/spec/lib/geoblacklight/download_spec.rb +2 -1
  148. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -0
  149. data/spec/lib/geoblacklight/item_viewer_spec.rb +1 -0
  150. data/spec/lib/geoblacklight/metadata/base_spec.rb +1 -0
  151. data/spec/lib/geoblacklight/metadata/html_spec.rb +1 -0
  152. data/spec/lib/geoblacklight/metadata_spec.rb +1 -0
  153. data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +3 -2
  154. data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +3 -2
  155. data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +3 -2
  156. data/spec/lib/geoblacklight/metadata_transformer_spec.rb +4 -3
  157. data/spec/lib/geoblacklight/reference_spec.rb +1 -0
  158. data/spec/lib/geoblacklight/references_spec.rb +2 -3
  159. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +1 -0
  160. data/spec/lib/geoblacklight/relation/descendants_spec.rb +1 -0
  161. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +1 -0
  162. data/spec/lib/geoblacklight/view_helper_override_spec.rb +1 -0
  163. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +5 -4
  164. data/spec/lib/geoblacklight/wms_layer_spec.rb +1 -0
  165. data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +1 -20
  166. data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +1 -0
  167. data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +1 -0
  168. data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +1 -0
  169. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +1 -0
  170. data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +15 -2
  171. data/spec/routing/catalog_routing_spec.rb +1 -0
  172. data/spec/spec_helper.rb +12 -9
  173. data/spec/support/backport_test_helpers.rb +1 -0
  174. data/spec/support/features.rb +1 -0
  175. data/spec/support/features/session_helpers.rb +1 -0
  176. data/spec/support/fixtures.rb +1 -0
  177. data/spec/tasks/geoblacklight_spec.rb +4 -3
  178. data/spec/teaspoon_env.rb +1 -0
  179. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -0
  180. data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -0
  181. data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -0
  182. data/spec/views/catalog/_results_pagination.html.erb_spec.rb +1 -0
  183. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +1 -0
  184. data/spec/views/catalog/_show_tools.html.erb_spec.rb +2 -4
  185. data/template.rb +1 -0
  186. metadata +42 -68
  187. data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +0 -36
  188. data/app/assets/stylesheets/geoblacklight/modules/relations.scss +0 -15
  189. data/app/views/catalog/_exports.html.erb +0 -3
  190. data/app/views/catalog/_show_tools.html.erb +0 -25
  191. data/lib/generators/geoblacklight/templates/geoblacklight.scss +0 -4
  192. data/vendor/assets/javascripts/readmore.js +0 -0
  193. data/vendor/assets/javascripts/readmore.min.js +0 -0
@@ -1,8 +1,5 @@
1
- <li class="list-group-item relations-ancestors">
2
- <b><%= t('geoblacklight.relations.ancestor') %></b>
3
- </li>
4
1
  <% @relations.ancestors['docs'].each do |ancestor| %>
5
- <li class="list-group-item">
2
+ <li class="list-group-item border-bottom-0">
6
3
  <%= link_to solr_document_path(ancestor['layer_slug_s']) do %>
7
4
  <%= relations_icon(ancestor, 'pagelines-brands') %>
8
5
  <%= ancestor['dc_title_s'] %>
@@ -1,8 +1,5 @@
1
- <li class="list-group-item relations-descendants">
2
- <b><%= t('geoblacklight.relations.descendant', count: @relations.descendants['numFound']) %></b>
3
- </li>
4
1
  <% @relations.descendants['docs'][0..2].each do |descendant| %>
5
- <li class="list-group-item">
2
+ <li class="list-group-item border-bottom-0">
6
3
  <%= link_to solr_document_path(descendant['layer_slug_s']) do %>
7
4
  <%= relations_icon(descendant, 'leaf') %>
8
5
  <%= descendant['dc_title_s'] %>
@@ -10,7 +7,7 @@
10
7
  </li>
11
8
  <% end %>
12
9
  <% unless (@relations.descendants['numFound'].to_i <= 3) %>
13
- <li class="list-group-item">
10
+ <li class="list-group-item border-bottom-0">
14
11
  <%= link_to search_catalog_path({f: {"#{Settings.FIELDS.SOURCE}" => [@relations.link_id]}}) do %>
15
12
  <%= t('geoblacklight.relations.browse_all', count: @relations.descendants['numFound']) %>
16
13
  <% end %>
@@ -1,13 +1,25 @@
1
1
  <% unless @relations.empty? %>
2
- <div class="card relations">
3
- <div class="card-header">
4
- <%= t('geoblacklight.relations.title') %>
2
+ <% unless @relations.ancestors['numFound'].to_i.zero? %>
3
+ <div class="card relations">
4
+ <div class="card-header">
5
+ <h2 class="mb-0 h6"><%= t('geoblacklight.relations.ancestor') %></h2>
6
+ </div>
7
+
8
+ <ul class="list-group list-group-flush">
9
+ <%= render 'ancestors' %>
10
+ </ul>
5
11
  </div>
12
+ <% end %>
6
13
 
7
- <ul class="list-group list-group-flush">
8
- <%= render 'ancestors' unless @relations.ancestors['numFound'].to_i == 0 %>
9
- <%= render 'descendants' unless @relations.descendants['numFound'].to_i == 0 %>
10
- </ul>
14
+ <% unless @relations.descendants['numFound'].to_i.zero? %>
15
+ <div class="card relations">
16
+ <div class="card-header">
17
+ <h2 class="mb-0 h6"><%= t('geoblacklight.relations.descendant') %></h2>
18
+ </div>
11
19
 
12
- </div>
20
+ <ul class="list-group list-group-flush">
21
+ <%= render 'descendants' %>
22
+ </ul>
23
+ </div>
24
+ <% end %>
13
25
  <% end %>
@@ -1,3 +1,4 @@
1
- json.ancestors@relations.ancestors
1
+ # frozen_string_literal: true
2
+ json.ancestors @relations.ancestors
2
3
  json.descendants @relations.descendants
3
4
  json.current_doc @relations.search_id
@@ -1,5 +1,3 @@
1
- <%= render_aria_labels(@aria_labels) %>
2
-
3
1
  <nav class="navbar navbar-expand-md navbar-dark bg-dark topbar" role="navigation">
4
2
  <div class="<%= container_classes %>">
5
3
  <%= link_to application_name, root_path, class: 'mb-0 navbar-logo' %>
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+ # Borrowed from https://github.com/pulibrary/figgy/blob/master/scripts/combine_coverage.rb
3
+ require 'active_support/inflector'
4
+ require 'simplecov'
5
+
6
+ class SimpleCovHelper
7
+ def self.report_coverage(base_dir: './coverage_results')
8
+ min_cov = ENV['MINIMUM_COVERAGE'] || 100
9
+ SimpleCov.configure do
10
+ minimum_coverage(min_cov.to_i)
11
+ end
12
+ new(base_dir: base_dir).merge_results
13
+ end
14
+
15
+ attr_reader :base_dir
16
+
17
+ def initialize(base_dir:)
18
+ @base_dir = base_dir
19
+ end
20
+
21
+ def all_results
22
+ Dir["#{base_dir}/.resultset*.json"]
23
+ end
24
+
25
+ def merge_results
26
+ results = all_results.map { |file| SimpleCov::Result.from_hash(JSON.parse(File.read(file))) }
27
+ results = SimpleCov::ResultMerger.merge_results(*results)
28
+ results.format!
29
+ covered_percent = results.covered_percent.round(2)
30
+ return unless covered_percent < SimpleCov.minimum_coverage[:line]
31
+ $stderr.printf("Coverage (%.2f%%) is below the expected minimum coverage (%.2f%%).\n", covered_percent, SimpleCov.minimum_coverage[:line])
32
+ Kernel.exit SimpleCov::ExitCodes::MINIMUM_COVERAGE
33
+ end
34
+ end
35
+
36
+ SimpleCovHelper.report_coverage
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  Config.setup do |config|
2
3
  config.const_name = 'Settings'
3
4
  end
@@ -29,6 +29,7 @@ en:
29
29
  data_type: 'Data type'
30
30
  placename: 'Placename'
31
31
  subject: 'Subject'
32
+ version: 'GeoBlacklight version %{version}'
32
33
  tools:
33
34
  login_to_view: 'Login to View and Download'
34
35
  open_carto: 'Open in Carto'
@@ -65,10 +66,10 @@ en:
65
66
  services_close: 'Close'
66
67
  relations:
67
68
  ancestor: 'Source Datasets'
68
- descendant: 'Derived Datasets (%{count})'
69
+ descendant: 'Derived Datasets'
69
70
  browse_all: "Browse all %{count} records..."
70
- title: 'Data Relations'
71
71
  metadata:
72
+ toggle_summary: 'Toggle summary'
72
73
  view_metadata: 'View Metadata'
73
74
  more_details: 'More details at'
74
75
  metadata_error: 'The metadata view for selected schema is not available'
@@ -19,30 +19,27 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
  spec.required_rubygems_version = '>= 2.5.2'
21
21
 
22
- spec.add_dependency 'rails', '~> 5.0'
22
+ spec.add_dependency 'rails', '>= 5.2.4', '< 6.1'
23
23
  spec.add_dependency 'blacklight', '~> 7.0'
24
- spec.add_dependency 'font-awesome-rails'
25
24
  spec.add_dependency 'config'
26
25
  spec.add_dependency 'faraday', '~> 1.0'
27
26
  spec.add_dependency 'faraday_middleware', '~> 1.0.0.rc1'
28
27
  spec.add_dependency 'coderay'
29
- spec.add_dependency 'geoblacklight-icons', '>= 0.2'
30
28
  spec.add_dependency 'deprecation'
31
29
  spec.add_dependency 'geo_combine', '~> 0.4'
32
30
  spec.add_dependency 'mime-types'
33
31
  spec.add_dependency 'handlebars_assets'
34
- spec.add_dependency 'webpacker'
32
+ spec.add_dependency 'webpacker', '~> 4.0'
35
33
 
36
34
  spec.add_development_dependency 'solr_wrapper'
37
35
  spec.add_development_dependency 'rails-controller-testing'
38
- spec.add_development_dependency 'rspec-rails', '~> 3.1'
36
+ spec.add_development_dependency 'rspec-rails'
39
37
  spec.add_development_dependency 'engine_cart', '~> 2.0'
40
38
  spec.add_development_dependency 'capybara', '>= 2.5.0'
41
39
  spec.add_development_dependency 'webdrivers'
42
40
  spec.add_development_dependency 'factory_bot_rails'
43
41
  spec.add_development_dependency 'database_cleaner', '~> 1.3'
44
42
  spec.add_development_dependency 'bixby'
45
- spec.add_development_dependency 'coveralls'
46
43
  spec.add_development_dependency 'simplecov', '~> 0.16'
47
44
  spec.add_development_dependency 'foreman'
48
45
  spec.add_development_dependency 'teaspoon'
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails/generators'
4
+
5
+ module Geoblacklight
6
+ class AssetsGenerator < Rails::Generators::Base
7
+ source_root File.expand_path('templates', __dir__)
8
+
9
+ desc <<-DESCRIPTION
10
+ This generator makes the following changes to your application:
11
+ 1. Copies GBL javascript into the application
12
+ 2. Removes stock Rails and Blacklight stylesheets from the application
13
+ 3. Copies GBL stylesheets into the local application
14
+ 4. Sets asset initializer values into the local application
15
+ DESCRIPTION
16
+
17
+ def add_javascript
18
+ copy_file 'assets/geoblacklight.js', 'app/assets/javascripts/geoblacklight.js'
19
+
20
+ if Rails.version.to_i == 6
21
+ append_to_file 'app/assets/javascripts/application.js',
22
+ "\n// Required by GeoBlacklight\n//= require geoblacklight"
23
+ end
24
+ end
25
+
26
+ def remove_stylesheets
27
+ remove_file 'app/assets/stylesheets/application.css'
28
+ remove_file 'app/assets/stylesheets/blacklight.scss'
29
+ end
30
+
31
+ def add_stylesheets
32
+ copy_file 'assets/application.scss', 'app/assets/stylesheets/application.scss'
33
+ copy_file 'assets/_blacklight.scss', 'app/assets/stylesheets/_blacklight.scss'
34
+ copy_file 'assets/_customizations.scss', 'app/assets/stylesheets/_customizations.scss'
35
+ copy_file 'assets/_geoblacklight.scss', 'app/assets/stylesheets/_geoblacklight.scss'
36
+ end
37
+
38
+ def add_initializers
39
+ append_to_file 'config/initializers/assets.rb',
40
+ "\nRails.application.config.assets.precompile += %w( favicon.ico )\n"
41
+
42
+ append_to_file 'config/initializers/assets.rb',
43
+ "\nRails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'images')\n"
44
+ end
45
+ end
46
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rails/generators'
2
3
 
3
4
  module Geoblacklight
@@ -30,15 +31,8 @@ module Geoblacklight
30
31
  inject_into_file 'config/routes.rb', routes, before: /^end/
31
32
  end
32
33
 
33
- def assets
34
- copy_file 'geoblacklight.scss', 'app/assets/stylesheets/geoblacklight.scss'
35
- copy_file 'geoblacklight.js', 'app/assets/javascripts/geoblacklight.js'
36
-
37
- append_to_file 'config/initializers/assets.rb',
38
- "\nRails.application.config.assets.precompile += %w( favicon.ico )\n"
39
-
40
- append_to_file 'config/initializers/assets.rb',
41
- "\nRails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'images')\n"
34
+ def generate_assets
35
+ generate 'geoblacklight:assets'
42
36
  end
43
37
 
44
38
  def create_blacklight_catalog
@@ -0,0 +1 @@
1
+ @import 'blacklight/blacklight';
@@ -0,0 +1,28 @@
1
+ // Local Application Customizations
2
+
3
+ // Set Header Logo
4
+ $logo-image: image_url('blacklight/logo.svg') !default;
5
+
6
+ .navbar-brand { /* The main logo image for the Blacklight instance */
7
+ @if $logo-image {
8
+ background: transparent $logo-image no-repeat top left;
9
+ }
10
+ }
11
+
12
+ // Optional
13
+ // Override default Bootstrap variables here
14
+
15
+ // Example: Bootstrap Colors
16
+ $blue: #007bff !default;
17
+ $indigo: #6610f2 !default;
18
+ $purple: #6f42c1 !default;
19
+ $pink: #e83e8c !default;
20
+ $red: #dc3545 !default;
21
+ $orange: #fd7e14 !default;
22
+ $yellow: #ffc107 !default;
23
+ $green: #28a745 !default;
24
+ $teal: #20c997 !default;
25
+ $cyan: #17a2b8 !default;
26
+
27
+ // Example: Bootstrap Link color
28
+ $link-color: $blue;
@@ -0,0 +1,7 @@
1
+ /*
2
+ *= require leaflet-label
3
+ */
4
+ @import 'customizations';
5
+ @import 'bootstrap';
6
+ @import 'blacklight';
7
+ @import 'geoblacklight';
@@ -245,8 +245,9 @@ class CatalogController < ApplicationController
245
245
  # Custom tools for GeoBlacklight
246
246
  config.add_show_tools_partial :web_services, if: proc { |_context, _config, options| options[:document] && (Settings.WEBSERVICES_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any? }
247
247
  config.add_show_tools_partial :metadata, if: proc { |_context, _config, options| options[:document] && (Settings.METADATA_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any? }
248
- config.add_show_tools_partial :exports, partial: 'exports', if: proc { |_context, _config, options| options[:document] }
249
- config.add_show_tools_partial :data_dictionary, partial: 'data_dictionary', if: proc { |_context, _config, options| options[:document] }
248
+ config.add_show_tools_partial :carto, partial: 'carto', if: proc { |_context, _config, options| options[:document] && options[:document].carto_reference.present? }
249
+ config.add_show_tools_partial :arcgis, partial: 'arcgis', if: proc { |_context, _config, options| options[:document] && options[:document].arcgis_urls.present? }
250
+ config.add_show_tools_partial :data_dictionary, partial: 'data_dictionary', if: proc { |_context, _config, options| options[:document] && options[:document].data_dictionary_download.present? }
250
251
 
251
252
  # Configure basemap provider for GeoBlacklight maps (uses https only basemap
252
253
  # providers with open licenses)
@@ -4,12 +4,6 @@ APPLICATION_LOGO_URL: 'http://geoblacklight.org/images/geoblacklight-logo.png'
4
4
  # Carto OneClick Service https://carto.com/engine/open-in-carto/
5
5
  CARTO_ONECLICK_LINK: 'http://oneclick.carto.com/'
6
6
 
7
- # Hide Carto export link
8
- # CARTO_HIDE: true
9
-
10
- # Hide ArcGIS export link
11
- # ARCGIS_HIDE: true
12
-
13
7
  # ArcGIS Online Base URL
14
8
  ARCGIS_BASE_URL: 'https://www.arcgis.com/home/webmap/viewer.html'
15
9
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rails/generators'
2
3
 
3
4
  module Geoblacklight
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'active_support/dependencies'
2
3
  require 'geoblacklight/engine'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  ##
3
4
  # Transforms and parses a bounding box for various formats
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module CatalogHelperOverride
3
4
  ##
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  # Module to declare application level constants and lookup hash
3
4
  module Constants
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  class Download
3
4
  def initialize(document, options = {})
@@ -14,7 +15,7 @@ module Geoblacklight
14
15
  end
15
16
 
16
17
  def self.file_path
17
- Settings.DOWNLOAD_PATH || "#{Rails.root}/tmp/cache/downloads"
18
+ Settings.DOWNLOAD_PATH || Rails.root.join('tmp', 'cache', 'downloads')
18
19
  end
19
20
 
20
21
  def file_path_and_name
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  class GeojsonDownload < Geoblacklight::Download
3
4
  GEOJSON_DOWNLOAD_PARAMS = {
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  class GeotiffDownload < Geoblacklight::Download
3
4
  GEOTIFF_DOWNLOAD_PARAMS = {
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  class HglDownload < Geoblacklight::Download
3
4
  def initialize(document, email, options = {})
@@ -1,9 +1,10 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  class KmzDownload < Geoblacklight::Download
3
4
  KMZ_DOWNLOAD_PARAMS = { service: 'wms',
4
5
  version: '1.1.0',
5
6
  request: 'GetMap',
6
- srsName: 'EPSG:900913',
7
+ srsName: 'EPSG:3857',
7
8
  format: 'application/vnd.google-earth.kmz',
8
9
  width: 2000, height: 2000 }.freeze
9
10
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  class ShapefileDownload < Geoblacklight::Download
3
4
  SHAPEFILE_DOWNLOAD_PARAMS = { service: 'wfs',
@@ -1,11 +1,10 @@
1
+ # frozen_string_literal: true
1
2
  require 'blacklight'
2
- require 'font-awesome-rails'
3
3
  require 'coderay'
4
4
  require 'config'
5
5
  require 'faraday'
6
6
  require 'faraday_middleware'
7
7
  require 'nokogiri'
8
- require 'geoblacklight-icons'
9
8
  require 'mime/types'
10
9
  require 'handlebars_assets'
11
10
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Exceptions
3
4
  class ExternalDownloadFailed < StandardError
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  ##
3
4
  # Adds helper behavior logic for GeoBlacklight, to used alongside
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  class ItemViewer
3
4
  def initialize(references)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Metadata
3
4
  ##
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Geoblacklight
2
3
  module Metadata
3
4
  ##