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
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  ##
3
4
  # Adds helper behavior logic for GeoBlacklight, to used alongside
4
5
  # BlacklightHelperBehavior
@@ -11,7 +12,7 @@ module Geoblacklight
11
12
  # @param [Symbol, String] presenting_method
12
13
  # @return [String]
13
14
  def geoblacklight_present(presenting_method, document = @document)
14
- document_presenter(document).try(presenting_method.to_sym) || ''
15
+ document_presenter(document).try(presenting_method.to_sym) || ""
15
16
  end
16
17
  end
17
18
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module GeoblacklightHelper
3
4
  def document_available?
4
5
  @document.public? || (@document.same_institution? && user_signed_in?)
@@ -9,17 +10,17 @@ module GeoblacklightHelper
9
10
  end
10
11
 
11
12
  def iiif_jpg_url
12
- @document.references.iiif.endpoint.sub! 'info.json', 'full/full/0/default.jpg'
13
+ @document.references.iiif.endpoint.sub! "info.json", "full/full/0/default.jpg"
13
14
  end
14
15
 
15
16
  def download_link_file(label, id, url)
16
17
  link_to(
17
18
  label,
18
19
  url,
19
- 'contentUrl' => url,
20
- data: {
21
- download: 'trigger',
22
- download_type: 'direct',
20
+ "contentUrl" => url,
21
+ :data => {
22
+ download: "trigger",
23
+ download_type: "direct",
23
24
  download_id: id
24
25
  }
25
26
  )
@@ -30,9 +31,9 @@ module GeoblacklightHelper
30
31
  text,
31
32
  download_hgl_path(id: document),
32
33
  data: {
33
- blacklight_modal: 'trigger',
34
- download: 'trigger',
35
- download_type: 'harvard-hgl',
34
+ blacklight_modal: "trigger",
35
+ download: "trigger",
36
+ download_type: "harvard-hgl",
36
37
  download_id: document.id
37
38
  }
38
39
  )
@@ -42,22 +43,22 @@ module GeoblacklightHelper
42
43
  # @return [String]
43
44
  def download_link_iiif
44
45
  link_to(
45
- download_text('JPG'),
46
+ download_text("JPG"),
46
47
  iiif_jpg_url,
47
- 'contentUrl' => iiif_jpg_url,
48
- data: {
49
- download: 'trigger'
48
+ "contentUrl" => iiif_jpg_url,
49
+ :data => {
50
+ download: "trigger"
50
51
  }
51
52
  )
52
53
  end
53
54
 
54
55
  def download_link_generated(download_type, document)
55
56
  link_to(
56
- t('geoblacklight.download.export_link', download_format: export_format_label(download_type)),
57
- '',
57
+ t("geoblacklight.download.export_link", download_format: export_format_label(download_type)),
58
+ "",
58
59
  data: {
59
60
  download_path: download_path(document.id, type: download_type),
60
- download: 'trigger',
61
+ download: "trigger",
61
62
  download_type: download_type,
62
63
  download_id: document.id
63
64
  }
@@ -69,18 +70,18 @@ module GeoblacklightHelper
69
70
  # @param [SolrDocument] args
70
71
  # @return [String]
71
72
  def snippit(args)
72
- truncate(Array(args[:value]).flatten.join(' '), length: 150)
73
+ truncate(Array(args[:value]).flatten.join(" "), length: 150)
73
74
  end
74
75
 
75
76
  ##
76
77
  # Returns an SVG icon or empty HTML span element
77
78
  # @return [SVG or HTML tag]
78
79
  def geoblacklight_icon(name, **args)
79
- icon_name = name ? name.to_s.parameterize : 'none'
80
+ icon_name = name ? name.to_s.parameterize : "none"
80
81
  begin
81
82
  blacklight_icon(icon_name, **args)
82
83
  rescue Blacklight::Exceptions::IconNotFound
83
- tag.span class: 'icon-missing geoblacklight-none'
84
+ tag.span class: "icon-missing geoblacklight-none"
84
85
  end
85
86
  end
86
87
 
@@ -88,12 +89,12 @@ module GeoblacklightHelper
88
89
  # Looks up properly formatted names for formats
89
90
  #
90
91
  def proper_case_format(format)
91
- t("geoblacklight.formats.#{format.to_s.parameterize(separator: '_')}")
92
+ t("geoblacklight.formats.#{format.to_s.parameterize(separator: "_")}")
92
93
  end
93
94
 
94
95
  # Format labels are customized for exports - look up the appropriate key.
95
96
  def export_format_label(format)
96
- t("geoblacklight.download.export_#{format.to_s.parameterize(separator: '_')}_link")
97
+ t("geoblacklight.download.export_#{format.to_s.parameterize(separator: "_")}_link")
97
98
  end
98
99
 
99
100
  ##
@@ -109,7 +110,7 @@ module GeoblacklightHelper
109
110
  #
110
111
  def download_text(format)
111
112
  download_format = proper_case_format(format)
112
- value = t('geoblacklight.download.download_link', download_format: download_format)
113
+ value = t("geoblacklight.download.download_link", download_format: download_format)
113
114
  value.html_safe
114
115
  end
115
116
 
@@ -126,16 +127,23 @@ module GeoblacklightHelper
126
127
  def render_help_text_entry(feature, key)
127
128
  if I18n.exists?("geoblacklight.help_text.#{feature}.#{key}", locale)
128
129
  help_text = I18n.t("geoblacklight.help_text.#{feature}.#{key}")
129
- tag.h3 class: 'help-text viewer_protocol h6' do
130
- tag.a data: { toggle: 'popover', title: help_text[:title], content: help_text[:content] } do
130
+ tag.h3 class: "help-text viewer_protocol h6" do
131
+ tag.a data: {toggle: "popover", title: help_text[:title], content: help_text[:content]} do
131
132
  help_text[:title]
132
133
  end
133
134
  end
134
135
  else
135
- tag.span class: 'help-text translation-missing'
136
+ tag.span class: "help-text translation-missing"
136
137
  end
137
138
  end
138
139
 
140
+ ##
141
+ # Determines if item view should render the sidebar static map
142
+ # @return [Boolean]
143
+ def render_sidebar_map?(document)
144
+ Settings.SIDEBAR_STATIC_MAP&.any? { |vp| document.viewer_protocol == vp }
145
+ end
146
+
139
147
  ##
140
148
  # Deteremines if item view should include attribute table
141
149
  # @return [Boolean]
@@ -149,8 +157,8 @@ module GeoblacklightHelper
149
157
  # get_field_values method
150
158
  # @param [Hash] args from get_field_values
151
159
  def render_value_as_truncate_abstract(args)
152
- tag.div class: 'truncate-abstract' do
153
- Array(args[:value]).flatten.join(' ')
160
+ tag.div class: "truncate-abstract" do
161
+ Array(args[:value]).flatten.join(" ")
154
162
  end
155
163
  end
156
164
 
@@ -158,7 +166,7 @@ module GeoblacklightHelper
158
166
  # Selects the basemap used for map displays
159
167
  # @return [String]
160
168
  def geoblacklight_basemap
161
- blacklight_config.basemap_provider || 'positron'
169
+ blacklight_config.basemap_provider || "positron"
162
170
  end
163
171
 
164
172
  ##
@@ -168,10 +176,10 @@ module GeoblacklightHelper
168
176
  def render_web_services(reference)
169
177
  render(
170
178
  partial: "web_services_#{reference.type}",
171
- locals: { reference: reference }
179
+ locals: {reference: reference}
172
180
  )
173
181
  rescue ActionView::MissingTemplate
174
- render partial: 'web_services_default', locals: { reference: reference }
182
+ render partial: "web_services_default", locals: {reference: reference}
175
183
  end
176
184
 
177
185
  ##
@@ -187,13 +195,13 @@ module GeoblacklightHelper
187
195
  # @param [Geoblacklight::Metadata::Base] metadata the metadata object
188
196
  # @return [String]
189
197
  def render_transformed_metadata(metadata)
190
- render partial: 'catalog/metadata/content', locals: { content: metadata.transform.html_safe }
198
+ render partial: "catalog/metadata/content", locals: {content: metadata.transform.html_safe}
191
199
  rescue Geoblacklight::MetadataTransformer::TransformError => transform_err
192
200
  Geoblacklight.logger.warn transform_err.message
193
- render partial: 'catalog/metadata/markup', locals: { content: metadata.to_xml }
201
+ render partial: "catalog/metadata/markup", locals: {content: metadata.to_xml}
194
202
  rescue => err
195
203
  Geoblacklight.logger.warn err.message
196
- render partial: 'catalog/metadata/missing'
204
+ render partial: "catalog/metadata/missing"
197
205
  end
198
206
 
199
207
  ##
@@ -221,17 +229,17 @@ module GeoblacklightHelper
221
229
  icon_name = document[Settings.FIELDS.GEOM_TYPE] if Settings.USE_GEOM_FOR_RELATIONS_ICON
222
230
  icon_name = icon if icon_name.blank?
223
231
  icon_options = {}
224
- icon_options = { classes: 'svg_tooltip' } if Settings.USE_GEOM_FOR_RELATIONS_ICON
232
+ icon_options = {classes: "svg_tooltip"} if Settings.USE_GEOM_FOR_RELATIONS_ICON
225
233
  geoblacklight_icon(icon_name, **icon_options)
226
234
  end
227
235
 
228
236
  ## Returns the data-map attribute value used as the JS map selector
229
237
  def results_js_map_selector(controller_name)
230
238
  case controller_name
231
- when 'bookmarks'
232
- 'bookmarks'
239
+ when "bookmarks"
240
+ "bookmarks"
233
241
  else
234
- 'index'
242
+ "index"
235
243
  end
236
244
  end
237
245
  end
@@ -38,7 +38,7 @@ module Geoblacklight
38
38
  end
39
39
 
40
40
  def boost
41
- "^#{field_config.within_boost || '10'}"
41
+ "^#{field_config.within_boost || "10"}"
42
42
  end
43
43
 
44
44
  private
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Geoblacklight
3
4
  module SolrDocument
4
5
  module Arcgis
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Geoblacklight
3
4
  module SolrDocument
4
5
  ##
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Geoblacklight
3
4
  module SolrDocument
4
5
  module Citation
@@ -11,8 +12,8 @@ module Geoblacklight
11
12
  fetch(Settings.FIELDS.TITLE, nil),
12
13
  ("[#{format}]" if format),
13
14
  fetch(Settings.FIELDS.PUBLISHER, nil),
14
- I18n.t('geoblacklight.citation.retrieved_from', document_url: solr_document_url)
15
- ].flatten.compact.join('. ')
15
+ I18n.t("geoblacklight.citation.retrieved_from", document_url: solr_document_url)
16
+ ].flatten.compact.join(". ")
16
17
  end
17
18
 
18
19
  private
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Geoblacklight
3
4
  module SolrDocument
4
5
  ##
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Geoblacklight
3
4
  module SolrDocument
4
5
  ##
@@ -20,11 +20,11 @@ module Geoblacklight
20
20
  end
21
21
 
22
22
  def public?
23
- rights_field_data.present? && rights_field_data.casecmp('public').zero?
23
+ rights_field_data.present? && rights_field_data.casecmp("public").zero?
24
24
  end
25
25
 
26
26
  def restricted?
27
- rights_field_data.blank? || rights_field_data.casecmp('restricted').zero?
27
+ rights_field_data.blank? || rights_field_data.casecmp("restricted").zero?
28
28
  end
29
29
 
30
30
  def downloadable?
@@ -39,6 +39,10 @@ module Geoblacklight
39
39
  references.download.to_hash if references.download.present?
40
40
  end
41
41
 
42
+ def display_note
43
+ fetch(Settings.FIELDS.DISPLAY_NOTE, "")
44
+ end
45
+
42
46
  def hgl_download
43
47
  references.hgl.to_hash if references.hgl.present?
44
48
  end
@@ -48,7 +52,7 @@ module Geoblacklight
48
52
  end
49
53
 
50
54
  def same_institution?
51
- fetch(Settings.FIELDS.PROVIDER, '').casecmp(Settings.INSTITUTION.downcase).zero?
55
+ fetch(Settings.FIELDS.PROVIDER, "").casecmp(Settings.INSTITUTION.downcase).zero?
52
56
  end
53
57
 
54
58
  def iiif_download
@@ -60,7 +64,7 @@ module Geoblacklight
60
64
  end
61
65
 
62
66
  def external_url
63
- references.url.endpoint if references.url
67
+ references.url&.endpoint
64
68
  end
65
69
 
66
70
  def item_viewer
@@ -68,11 +72,11 @@ module Geoblacklight
68
72
  end
69
73
 
70
74
  def itemtype
71
- 'http://schema.org/Dataset'
75
+ "http://schema.org/Dataset"
72
76
  end
73
77
 
74
78
  def geom_field
75
- fetch(Settings.FIELDS.GEOMETRY, '')
79
+ fetch(Settings.FIELDS.GEOMETRY, "")
76
80
  end
77
81
 
78
82
  def geometry
@@ -80,7 +84,7 @@ module Geoblacklight
80
84
  end
81
85
 
82
86
  def wxs_identifier
83
- fetch(Settings.FIELDS.WXS_IDENTIFIER, '')
87
+ fetch(Settings.FIELDS.WXS_IDENTIFIER, "")
84
88
  end
85
89
 
86
90
  def file_format
@@ -100,15 +104,19 @@ module Geoblacklight
100
104
  private
101
105
 
102
106
  def rights_field_data
103
- fetch(Settings.FIELDS.ACCESS_RIGHTS, '')
107
+ fetch(Settings.FIELDS.ACCESS_RIGHTS, "")
104
108
  end
105
109
 
106
110
  def method_missing(method, *args, &block)
107
111
  if /.*_url$/.match?(method.to_s)
108
- checked_endpoint(method.to_s.gsub('_url', ''))
112
+ checked_endpoint(method.to_s.gsub("_url", ""))
109
113
  else
110
114
  super
111
115
  end
112
116
  end
117
+
118
+ def respond_to_missing?(method, *args, &block)
119
+ /.*_url$/.match?(method.to_s) || super
120
+ end
113
121
  end
114
122
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Geoblacklight
3
4
  module SuppressedRecordsSearchBehavior
4
5
  extend ActiveSupport::Concern
@@ -14,7 +15,7 @@ module Geoblacklight
14
15
  def hide_suppressed_records(solr_params)
15
16
  # Show suppressed records when searching relationships
16
17
  return if blacklight_params.fetch(:f,
17
- {}).keys.any? do |field|
18
+ {}).keys.any? do |field|
18
19
  Settings.RELATIONSHIPS_SHOWN.map do |_key, value|
19
20
  value.field
20
21
  end.include?(field)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Geoblacklight
3
4
  ##
4
5
  # Adds custom functionality for Geoblacklight document presentation
@@ -14,11 +15,11 @@ module Geoblacklight
14
15
  @configuration.index_fields.each do |_field_name, field_config|
15
16
  val = field_value(field_config)
16
17
  if val.present?
17
- val += '.' unless val.end_with?('.')
18
+ val += "." unless val.end_with?(".")
18
19
  fields_values << val
19
20
  end
20
21
  end
21
- safe_join(fields_values, ' ')
22
+ safe_join(fields_values, " ")
22
23
  end
23
24
  end
24
25
  end
@@ -0,0 +1,7 @@
1
+ <% document ||= @document %>
2
+
3
+ <% if document.display_note.present? %>
4
+ <% document.display_note.each do |display_note| %>
5
+ <%= render(Geoblacklight::DisplayNoteComponent.new(display_note: display_note)) %>
6
+ <% end %>
7
+ <% end %>
@@ -1,3 +1,4 @@
1
+ <%= render :partial => 'show_sidebar_static_map' if render_sidebar_map?(@document) %>
1
2
  <%= render :partial => 'show_tools' %>
2
3
 
3
4
  <div class="sidebar-buttons">
@@ -0,0 +1,10 @@
1
+ <div class="card">
2
+ <div class="card-header">
3
+ <%= I18n.t('geoblacklight.location') %>
4
+ </div>
5
+
6
+ <div class="card-body">
7
+ <%= content_tag :div, id: 'static-map', aria: { label: t('geoblacklight.map.label') }, data: { map: 'item', protocol: 'Map', url: @document.viewer_endpoint, 'layer-id' => @document.wxs_identifier, 'map-geom' => @document.geometry.geojson, 'catalog-path'=> blacklight_path, available: document_available?, inspect: show_attribute_table?, basemap: geoblacklight_basemap, leaflet_options: leaflet_options } do %>
8
+ <% end %>
9
+ </div>
10
+ </div>
@@ -3,6 +3,6 @@
3
3
  json.current_doc @relations.search_id
4
4
  json.relations do
5
5
  Settings.RELATIONSHIPS_SHOWN.each do |key, _value|
6
- json.set! key.downcase.to_s, @relations.send(key) unless @relations.send(key)['numFound'].to_i.zero?
6
+ json.set! key.downcase.to_s, @relations.send(key) unless @relations.send(key)["numFound"].to_i.zero?
7
7
  end
8
8
  end
@@ -0,0 +1,104 @@
1
+ # New GeoBlacklight v4.1 Settings
2
+
3
+ # Display Notes to display / Non-prefixed default bootstrap class is alert-secondary
4
+ DISPLAY_NOTES_SHOWN:
5
+ danger:
6
+ bootstrap_alert_class: alert-danger
7
+ icon: fire-solid
8
+ note_prefix: "Danger: "
9
+ info:
10
+ bootstrap_alert_class: alert-info
11
+ icon: circle-info-solid
12
+ note_prefix: "Info: "
13
+ tip:
14
+ bootstrap_alert_class: alert-success
15
+ icon: lightbulb-solid
16
+ note_prefix: "Tip: "
17
+ warning:
18
+ bootstrap_alert_class: alert-warning
19
+ icon: triangle-exclamation-solid
20
+ note_prefix: "Warning: "
21
+
22
+ # Solr field mappings (Added DISPLAY_NOTE)
23
+ FIELDS:
24
+ :DISPLAY_NOTE: 'gbl_displayNote_sm'
25
+
26
+ # Relationships to display
27
+ RELATIONSHIPS_SHOWN:
28
+ MEMBER_OF_ANCESTORS:
29
+ field: pcdm_memberOf_sm
30
+ icon: parent-item
31
+ inverse: :MEMBER_OF_DESCENDANTS
32
+ label: geoblacklight.relations.member_of_ancestors
33
+ query_type: ancestors
34
+ MEMBER_OF_DESCENDANTS:
35
+ field: pcdm_memberOf_sm
36
+ icon: child-item
37
+ inverse: :MEMBER_OF_ANCESTORS
38
+ label: geoblacklight.relations.member_of_descendants
39
+ query_type: descendants
40
+ PART_OF_ANCESTORS:
41
+ field: dct_isPartOf_sm
42
+ icon: parent-item
43
+ inverse: :PART_OF_DESCENDANTS
44
+ label: geoblacklight.relations.part_of_ancestors
45
+ query_type: ancestors
46
+ PART_OF_DESCENDANTS:
47
+ field: dct_isPartOf_sm
48
+ icon: child-item
49
+ inverse: :PART_OF_ANCESTORS
50
+ label: geoblacklight.relations.part_of_descendants
51
+ query_type: descendants
52
+ RELATION_ANCESTORS:
53
+ field: dct_relation_sm
54
+ icon: nil
55
+ inverse: :RELATION_DESCENDANTS
56
+ label: geoblacklight.relations.relation_ancestors
57
+ query_type: ancestors
58
+ RELATION_DESCENDANTS:
59
+ field: dct_relation_sm
60
+ icon: nil
61
+ inverse: :RELATION_ANCESTORS
62
+ label: geoblacklight.relations.relation_descendants
63
+ query_type: descendants
64
+ REPLACES_ANCESTORS:
65
+ field: dct_replaces_sm
66
+ icon: nil
67
+ inverse: :REPLACES_DESCENDANTS
68
+ label: geoblacklight.relations.replaces_ancestors
69
+ query_type: ancestors
70
+ REPLACES_DESCENDANTS:
71
+ field: dct_replaces_sm
72
+ icon: nil
73
+ inverse: :REPLACES_ANCESTORS
74
+ label: geoblacklight.relations.replaces_descendants
75
+ query_type: descendants
76
+ SOURCE_ANCESTORS:
77
+ field: dct_source_sm
78
+ icon: parent-item
79
+ inverse: :SOURCE_DESCENDANTS
80
+ label: geoblacklight.relations.source_ancestors
81
+ query_type: ancestors
82
+ SOURCE_DESCENDANTS:
83
+ field: dct_source_sm
84
+ icon: child-item
85
+ inverse: :SOURCE_ANCESTORS
86
+ label: geoblacklight.relations.source_descendants
87
+ query_type: descendants
88
+ VERSION_OF_ANCESTORS:
89
+ field: dct_isVersionOf_sm
90
+ icon: parent-item
91
+ inverse: :VERSION_OF_DESCENDANTS
92
+ label: geoblacklight.relations.version_of_ancestors
93
+ query_type: ancestors
94
+ VERSION_OF_DESCENDANTS:
95
+ field: dct_isVersionOf_sm
96
+ icon: child-item
97
+ inverse: :VERSION_OF_ANCESTORS
98
+ label: geoblacklight.relations.version_of_descendants
99
+ query_type: descendants
100
+
101
+ # Enable catalog#show sidebar static map for items with the following viewer protocols
102
+ SIDEBAR_STATIC_MAP:
103
+ - 'iiif'
104
+ - 'iiif_manifest'
@@ -1,4 +1,8 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Config.setup do |config|
3
- config.const_name = 'Settings'
4
+ config.const_name = "Settings"
4
5
  end
6
+
7
+ Settings.prepend_source!(File.expand_path("new_gbl_settings_defaults_4_1.yml", __dir__))
8
+ Settings.reload!
@@ -1,6 +1,7 @@
1
1
  en:
2
2
  geoblacklight:
3
3
  bbox_label: 'Bounding Box'
4
+ location: 'Location'
4
5
  citation:
5
6
  retrieved_from: 'Retrieved from %{document_url}'
6
7
  download:
@@ -70,18 +71,21 @@ en:
70
71
  xyz: 'XYZ Tiles'
71
72
  wmts: 'Web Map Tile Service'
72
73
  relations:
73
- ancestor: 'Source Datasets'
74
- descendant: 'Derived Datasets'
75
- member_of: 'Belongs to collection...'
76
- part_of: 'Is part of...'
74
+ member_of_ancestors: 'Belongs to collection...'
75
+ member_of_descendants: 'Collection records...'
76
+ part_of_ancestors: 'Is part of...'
77
77
  part_of_descendants: 'Has part...'
78
- relation: 'Related Records'
79
- replaces: 'Item replaces...'
80
- replaced_by: 'Item replaced by...'
81
- source: 'Source Datasets'
82
- version_of: 'Version of...'
83
-
78
+ relation_ancestors: 'Related records...'
79
+ relation_descendants: 'Related records...'
80
+ replaces_ancestors: 'Replaces...'
81
+ replaces_descendants: 'Is replaced by...'
82
+ source_ancestors: 'Source records...'
83
+ source_descendants: 'Derived records...'
84
+ version_of_ancestors: 'Is version of...'
85
+ version_of_descendants: 'Has version...'
86
+ browse_all_no_count: "Browse all records..."
84
87
  browse_all: "Browse all %{count} records..."
88
+
85
89
  metadata:
86
90
  toggle_summary: 'Toggle summary'
87
91
  view_metadata: 'View Metadata'
@@ -126,6 +130,8 @@ en:
126
130
  content: A Web Map Service displays a geospatial dataset as map images.
127
131
  blacklight:
128
132
  icon:
133
+ american-geographical-society-library-uwm-libraries: American Geographical Society Library - UWM Libraries
134
+ arizona: The University of Arizona
129
135
  arrow-circle-down: Arrow within a circle, pointing down
130
136
  baruch-cuny: Baruch College
131
137
  berkeley: University of California, Berkeley
@@ -150,6 +156,7 @@ en:
150
156
  multilinestring: Multi-line string
151
157
  multipoint: Multi-point
152
158
  multipolygon: Multi-polygon
159
+ nebraska: University of Nebraska
153
160
  nyu: New York University
154
161
  ohio-state: The Ohio State University
155
162
  penn-state: Penn State University
@@ -157,6 +164,7 @@ en:
157
164
  public: Public content
158
165
  purdue: Purdue University
159
166
  restricted: Restricted content
167
+ rutgers: Rutgers University
160
168
  sms: SMS
161
169
  stanford: Stanford University
162
170
  texas: The University of Texas at Austin