geoblacklight 6.0.0.pre.alpha.1 → 6.0.0.pre.alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +1 -0
  3. data/app/components/geoblacklight/document/relations_container_component.html.erb +1 -0
  4. data/app/components/geoblacklight/document/relations_container_component.rb +12 -0
  5. data/app/components/geoblacklight/document/sidebar_component.html.erb +2 -3
  6. data/app/components/geoblacklight/download_links_component.rb +1 -1
  7. data/app/components/geoblacklight/index_map_legend_component.html.erb +6 -6
  8. data/app/components/geoblacklight/login_link_component.rb +1 -1
  9. data/app/components/geoblacklight/static_map_component.html.erb +1 -1
  10. data/app/controllers/relation_controller.rb +1 -1
  11. data/app/helpers/geoblacklight_helper.rb +1 -1
  12. data/app/javascript/geoblacklight/core.js +0 -2
  13. data/app/views/relation/index.html.erb +4 -2
  14. data/lib/generators/geoblacklight/templates/settings.yml +118 -114
  15. data/lib/geoblacklight/configuration/case_insensitive_settings.rb +59 -0
  16. data/lib/geoblacklight/configuration/fields_config.rb +33 -33
  17. data/lib/geoblacklight/configuration/layer_config.rb +28 -0
  18. data/lib/geoblacklight/configuration/leaflet_config.rb +8 -12
  19. data/lib/geoblacklight/configuration/leaflet_layers_config.rb +15 -3
  20. data/lib/geoblacklight/configuration/relationship_config.rb +15 -0
  21. data/lib/geoblacklight/configuration/relationships_config.rb +123 -0
  22. data/lib/geoblacklight/configuration/settings_builder.rb +118 -0
  23. data/lib/geoblacklight/configuration.rb +7 -2
  24. data/lib/geoblacklight/deprecation.rb +7 -0
  25. data/lib/geoblacklight/version.rb +1 -1
  26. data/lib/geoblacklight.rb +1 -1
  27. data/spec/components/geoblacklight/document/sidebar_component_spec.rb +48 -0
  28. data/spec/components/geoblacklight/login_link_component_spec.rb +1 -1
  29. data/spec/lib/geoblacklight/configuration/layer_config_spec.rb +71 -0
  30. data/spec/lib/geoblacklight/configuration/leaflet_layers_config_spec.rb +63 -0
  31. data/spec/lib/geoblacklight/configuration/settings_builder_spec.rb +177 -0
  32. data/spec/lib/geoblacklight/configuration_spec.rb +35 -0
  33. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +4 -4
  34. data/spec/spec_helper.rb +5 -0
  35. metadata +14 -6
  36. data/app/javascript/geoblacklight/initializers/relations.js +0 -40
  37. data/app/views/catalog/_relations_container.html.erb +0 -1
  38. data/lib/geoblacklight/configuration/legacy_settings_builder.rb +0 -94
  39. data/spec/features/show_page_sidebar_static_map_spec.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 667a2a369d04716624d762876de8359effeddac901e1d1f009adbb09791264fb
4
- data.tar.gz: 5872171cbac68976a9219cb812a670a8cf5a2e222e809a31f93103deb4d7ab97
3
+ metadata.gz: 27ebf1180cdf9e04df845da4327b42faffb8ea25d0d413a6c01002de3a76bca7
4
+ data.tar.gz: 35d488fd9c044dc6ad70eb70d2f556d1905a7c409539a873ad03b53170aff318
5
5
  SHA512:
6
- metadata.gz: f4f52fb72f6dad913341e735ece7a4b828886f70b17816f4c7ca497f4ecca97f7effdeb8f2daf4e33ae1f2ecfce2bd9ef0aec958fbe464a4081225b78e103887
7
- data.tar.gz: 0a4d1b12e4a99c47ef0bb253b6bd2c7446c9a960e5f0a2441829dc1cb7c35d261620333ca323520486414e306a300f898e0298af5b0a3a94ea691236e9892bab
6
+ metadata.gz: 5e4bebeecb4d9e4432d2d143a78a8bfecf928ebd531c9ccc1482ca7fd9142582fb0cd1625e3d86fe67c7a3894981c3f2b0ce4b3fd7cd9176e340205abbad80c1
7
+ data.tar.gz: 4ab390333dfa7c877e580a4fe83470fcd04d615e166a3732371a8cc464193a54dc93dc0908bd7a87db70254f1b8193d39d204a3d1646fe35ccb4982e571ac1ca
@@ -72,6 +72,7 @@ jobs:
72
72
  RAILS_VERSION: ${{ matrix.rails_version }}
73
73
  SOLR_URL: http://solr:SolrRocks@localhost:8983/solr/blacklight-core
74
74
  - name: Upload coverage artifacts
75
+ if: always()
75
76
  uses: actions/upload-artifact@v7
76
77
  with:
77
78
  name: "coverage-${{ matrix.ruby_version }}-${{ matrix.rails_version }}"
@@ -0,0 +1 @@
1
+ <%= helpers.turbo_frame_tag "relations", src: relations_solr_document_path(document.id), target: "_top" %>
@@ -0,0 +1,12 @@
1
+ module Geoblacklight
2
+ module Document
3
+ class RelationsContainerComponent < ViewComponent::Base
4
+ def initialize(document:)
5
+ super()
6
+ @document = document
7
+ end
8
+
9
+ attr_reader :document
10
+ end
11
+ end
12
+ end
@@ -1,12 +1,11 @@
1
1
  <%= render_static_map_component %>
2
2
  <%= render_show_tools %>
3
3
 
4
- <div class="sidebar-buttons">
4
+ <div class="sidebar-buttons mt-3">
5
5
  <% sidebar_buttons.each do | sidebar_button | %>
6
6
  <%= render sidebar_button %>
7
7
  <% end %>
8
8
  </div>
9
9
 
10
10
  <%= render_more_like_this %>
11
-
12
- <%= render "relations_container", document: document %>
11
+ <%= render Geoblacklight::Document::RelationsContainerComponent.new(document: document) %>
@@ -15,7 +15,7 @@ module Geoblacklight
15
15
  end
16
16
 
17
17
  def downloadable?
18
- helpers.document_available? && @document.downloadable?
18
+ helpers.document_available?(@document) && @document.downloadable?
19
19
  end
20
20
 
21
21
  def download_link_file(label, id, url)
@@ -1,14 +1,14 @@
1
1
  <div class="index-map-legend">
2
2
  <div class="index-map-legend-info">
3
- <div class="index-map-legend-swatch" style="background: <%= index_config.dig(:DEFAULT, :color) %>"></div>
4
- <div><span class="visually-hidden"><%= index_config.dig(:DEFAULT, :sr_color_name) %> tile indicates </span>Map held by collection</div>
3
+ <div class="index-map-legend-swatch" style="background: <%= index_config.dig(:DEFAULT).color %>"></div>
4
+ <div><span class="visually-hidden"><%= index_config.dig(:DEFAULT).sr_color_name %> tile indicates </span>Map held by collection</div>
5
5
  </div>
6
6
  <div class="index-map-legend-info">
7
- <div class="index-map-legend-swatch" style="background: <%= index_config.dig(:UNAVAILABLE, :color) %>"></div>
8
- <div><span class="visually-hidden"><%= index_config.dig(:UNAVAILABLE, :sr_color_name) %> tile indicates </span>Map not held by collection</div>
7
+ <div class="index-map-legend-swatch" style="background: <%= index_config.dig(:UNAVAILABLE).color %>"></div>
8
+ <div><span class="visually-hidden"><%= index_config.dig(:UNAVAILABLE).sr_color_name %> tile indicates </span>Map not held by collection</div>
9
9
  </div>
10
10
  <div class="index-map-legend-info">
11
- <div class="index-map-legend-swatch" style="background: <%= index_config.dig(:SELECTED, :color) %>"></div>
12
- <div><span class="visually-hidden"><%= index_config.dig(:SELECTED, :sr_color_name) %> tile indicates </span>Selected map tile</div>
11
+ <div class="index-map-legend-swatch" style="background: <%= index_config.dig(:SELECTED).color %>"></div>
12
+ <div><span class="visually-hidden"><%= index_config.dig(:SELECTED).sr_color_name %> tile indicates </span>Selected map tile</div>
13
13
  </div>
14
14
  </div>
@@ -11,7 +11,7 @@ module Geoblacklight
11
11
  end
12
12
 
13
13
  def render?
14
- document.restricted? && document.same_institution? && !helpers.document_available?
14
+ document.restricted? && document.same_institution? && !helpers.user_signed_in?
15
15
  end
16
16
  end
17
17
  end
@@ -1,4 +1,4 @@
1
- <div class="card">
1
+ <div class="card static-map">
2
2
  <div class="card-header">
3
3
  <%= @label %>
4
4
  </div>
@@ -7,7 +7,7 @@ class RelationController < ApplicationController
7
7
 
8
8
  def index
9
9
  @relations = Geoblacklight::Relation::RelationResponse.new(params[:id], repository)
10
- render layout: !request.xhr?
10
+ render layout: !(request.xhr? || request.headers["Turbo-Frame"].present?)
11
11
  end
12
12
 
13
13
  private
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GeoblacklightHelper
4
- def document_available?(document = @document)
4
+ def document_available?(document)
5
5
  document.public? || (document.same_institution? && user_signed_in?)
6
6
  end
7
7
 
@@ -1,6 +1,5 @@
1
1
  // Initializers
2
2
  import initializePopovers from "geoblacklight/initializers/popovers"
3
- import initializeRelations from "geoblacklight/initializers/relations"
4
3
  import initializeTooltips from "geoblacklight/initializers/tooltips"
5
4
  import initializeTruncation from "geoblacklight/initializers/truncation"
6
5
  import initializeMetadataDownload from "geoblacklight/initializers/metadata_download"
@@ -44,7 +43,6 @@ Geoblacklight.listeners().forEach((listener) =>
44
43
 
45
44
  // Register our initializers
46
45
  Geoblacklight.onLoad(initializePopovers)
47
- Geoblacklight.onLoad(initializeRelations)
48
46
  Geoblacklight.onLoad(initializeTooltips)
49
47
  Geoblacklight.onLoad(initializeTruncation)
50
48
  Geoblacklight.onLoad(initializeMetadataDownload)
@@ -1,3 +1,5 @@
1
- <%- Geoblacklight.configuration.relationships_shown.each do |relationship_type, rel_type_info| %>
2
- <%= render Geoblacklight::RelationsComponent.new(relations: @relations, relationship_type:, rel_type_info:) %>
1
+ <%= turbo_frame_tag "relations" do %>
2
+ <%- Geoblacklight.configuration.relationships_shown.each do |relationship_type, rel_type_info| %>
3
+ <%= render Geoblacklight::RelationsComponent.new(relations: @relations, relationship_type:, rel_type_info:) %>
4
+ <% end %>
3
5
  <% end %>
@@ -1,23 +1,25 @@
1
1
  # ArcGIS Online Base URL
2
- ARCGIS_BASE_URL: "https://www.arcgis.com/apps/mapviewer/index.html"
2
+ arcgis_base_url: "https://www.arcgis.com/apps/mapviewer/index.html"
3
3
 
4
4
  # Download path can be configured using this setting
5
- #DOWNLOAD_PATH: "./tmp/cache/downloads"
5
+ #download_path: "./tmp/cache/downloads"
6
6
 
7
7
  # The bq boost value for spatial search matches within a bounding box
8
- BBOX_WITHIN_BOOST: "10"
8
+ bbox_within_boost: "10"
9
9
 
10
10
  # The bf boost value for overlap ratio
11
- OVERLAP_RATIO_BOOST: "2"
11
+ overlap_ratio_boost: "2"
12
12
 
13
13
  # Homepage Map Geometry
14
14
  # Leave null to default to entire world
15
15
  # Add a stringified GeoJSON object to scope initial render (example from UMass)
16
- HOMEPAGE_MAP_GEOM: null
17
- # HOMEPAGE_MAP_GEOM: '{"type":"Polygon","coordinates":[[[-73.58,42.93],[-73.58,41.20],[-69.90,41.20],[-69.90,42.93]]]}'
16
+ homepage_map_geom: null
17
+ # homepage_map_geom: '{"type":"Polygon","coordinates":[[[-73.58,42.93],[-73.58,41.20],[-69.90,41.20],[-69.90,42.93]]]}'
18
18
 
19
- # Non-search-field GeoBlacklight application permitted params
20
- GBL_PARAMS:
19
+ # Non-search-field GeoBlacklight application permitted params.
20
+ # Values are left mixed-case on purpose: the uppercase symbols are WMS/OGC
21
+ # request parameter names (BBOX, WIDTH, etc.) and must match what clients send.
22
+ gbl_params:
21
23
  - :bbox
22
24
  - :email
23
25
  - :file
@@ -36,71 +38,68 @@ GBL_PARAMS:
36
38
  - :Y
37
39
 
38
40
  # Solr field mappings
39
- FIELDS:
40
- :ACCESS_RIGHTS: "dct_accessRights_s"
41
- :ALTERNATIVE_TITLE: "dct_alternative_sm"
42
- :CENTROID: "dcat_centroid"
43
- :CREATOR: "dct_creator_sm"
44
- :DATE_ISSUED: "dct_issued_s"
45
- :DATE_RANGE: "gbl_dateRange_drsim"
46
- :DESCRIPTION: "dct_description_sm"
47
- :DISPLAY_NOTE: "gbl_displayNote_sm"
48
- :FORMAT: "dct_format_s"
49
- :FILE_SIZE: "gbl_fileSize_s"
50
- :GEOREFERENCED: "gbl_georeferenced_b"
51
- :ID: "id"
52
- :IDENTIFIER: "dct_identifier_sm"
53
- :INDEX_YEAR: "gbl_indexYear_im"
54
- :IS_PART_OF: "dct_isPartOf_sm"
55
- :IS_REPLACED_BY: "dct_isReplacedBy_sm"
56
- :THEME: "dcat_theme_sm"
57
- :KEYWORD: "dcat_keyword_sm"
58
- :LANGUAGE: "dct_language_sm"
59
- :LICENSE: "dct_license_sm"
60
- :MEMBER_OF: "pcdm_memberOf_sm"
61
- :METADATA_VERSION: "gbl_mdVersion_s"
62
- :MODIFIED: "gbl_mdModified_dt"
63
- :OVERLAP_FIELD: "solr_bboxtype"
64
- :PUBLISHER: "dct_publisher_sm"
65
- :PROVIDER: "schema_provider_s"
66
- :REFERENCES: "dct_references_s"
67
- :RELATION: "dct_relation_sm"
68
- :REPLACES: "dct_replaces_sm"
69
- :RESOURCE_CLASS: "gbl_resourceClass_sm"
70
- :RESOURCE_TYPE: "gbl_resourceType_sm"
71
- :RIGHTS: "dct_rights_sm"
72
- :RIGHTS_HOLDER: "dct_rightsHolder_sm"
73
- :SOURCE: "dct_source_sm"
74
- :SPATIAL_COVERAGE: "dct_spatial_sm"
75
- :GEOMETRY: "locn_geometry"
76
- :SUBJECT: "dct_subject_sm"
77
- :SUPPRESSED: "gbl_suppressed_b"
78
- :TEMPORAL_COVERAGE: "dct_temporal_sm"
79
- :TITLE: "dct_title_s"
80
- :VERSION: "dct_isVersionOf_sm"
81
- :WXS_IDENTIFIER: "gbl_wxsIdentifier_s"
41
+ fields:
42
+ access_rights: "dct_accessRights_s"
43
+ alternative_title: "dct_alternative_sm"
44
+ centroid: "dcat_centroid"
45
+ creator: "dct_creator_sm"
46
+ date_issued: "dct_issued_s"
47
+ date_range: "gbl_dateRange_drsim"
48
+ description: "dct_description_sm"
49
+ display_note: "gbl_displayNote_sm"
50
+ format: "dct_format_s"
51
+ file_size: "gbl_fileSize_s"
52
+ georeferenced: "gbl_georeferenced_b"
53
+ id: "id"
54
+ identifier: "dct_identifier_sm"
55
+ index_year: "gbl_indexYear_im"
56
+ is_part_of: "dct_isPartOf_sm"
57
+ is_replaced_by: "dct_isReplacedBy_sm"
58
+ theme: "dcat_theme_sm"
59
+ keyword: "dcat_keyword_sm"
60
+ language: "dct_language_sm"
61
+ license: "dct_license_sm"
62
+ member_of: "pcdm_memberOf_sm"
63
+ metadata_version: "gbl_mdVersion_s"
64
+ modified: "gbl_mdModified_dt"
65
+ overlap_field: "solr_bboxtype"
66
+ publisher: "dct_publisher_sm"
67
+ provider: "schema_provider_s"
68
+ references: "dct_references_s"
69
+ relation: "dct_relation_sm"
70
+ replaces: "dct_replaces_sm"
71
+ resource_class: "gbl_resourceClass_sm"
72
+ resource_type: "gbl_resourceType_sm"
73
+ rights: "dct_rights_sm"
74
+ rights_holder: "dct_rightsHolder_sm"
75
+ source: "dct_source_sm"
76
+ spatial_coverage: "dct_spatial_sm"
77
+ geometry: "locn_geometry"
78
+ subject: "dct_subject_sm"
79
+ suppressed: "gbl_suppressed_b"
80
+ temporal_coverage: "dct_temporal_sm"
81
+ title: "dct_title_s"
82
+ version: "dct_isVersionOf_sm"
83
+ wxs_identifier: "gbl_wxsIdentifier_s"
82
84
 
83
85
  # Institution deployed at
84
- INSTITUTION: "Stanford"
86
+ institution: "Stanford"
85
87
 
86
88
  # Metadata shown in tool panel
87
- METADATA_SHOWN:
89
+ metadata_shown:
88
90
  - "mods"
89
91
  - "fgdc"
90
92
  - "iso19139"
91
93
  - "html"
92
94
 
93
95
  # (For external Download) timeout and open_timeout parameters for Faraday
94
- TIMEOUT_DOWNLOAD: 180
96
+ timeout_download: 180
95
97
 
96
98
  # (For WMS inspection) timeout and open_timeout parameters for Faraday
97
- TIMEOUT_WMS: 4
98
-
99
- # Use the geometry type for the data relations icon
100
- USE_GEOM_FOR_RELATIONS_ICON: false
99
+ timeout_wms: 4
101
100
 
102
101
  # Web services shown in tool panel
103
- WEBSERVICES_SHOWN:
102
+ webservices_shown:
104
103
  - "wms"
105
104
  - "tms"
106
105
  - "wfs"
@@ -116,7 +115,7 @@ WEBSERVICES_SHOWN:
116
115
  - "pmtiles"
117
116
 
118
117
  # Display Notes to display / Non-prefixed default bootstrap class is alert-secondary
119
- DISPLAY_NOTES_SHOWN:
118
+ display_notes_shown:
120
119
  danger:
121
120
  bootstrap_alert_class: alert-danger
122
121
  icon: fire-solid
@@ -135,120 +134,125 @@ DISPLAY_NOTES_SHOWN:
135
134
  note_prefix: "Warning: "
136
135
 
137
136
  # Relationships to display
138
- RELATIONSHIPS_SHOWN:
139
- MEMBER_OF_ANCESTORS:
137
+ relationships_shown:
138
+ member_of_ancestors:
140
139
  field: pcdm_memberOf_sm
141
140
  icon: parent-item
142
- inverse: :MEMBER_OF_DESCENDANTS
141
+ inverse: :member_of_descendants
143
142
  label: geoblacklight.relations.member_of_ancestors
144
143
  query_type: ancestors
145
- MEMBER_OF_DESCENDANTS:
144
+ member_of_descendants:
146
145
  field: pcdm_memberOf_sm
147
146
  icon: child-item
148
- inverse: :MEMBER_OF_ANCESTORS
147
+ inverse: :member_of_ancestors
149
148
  label: geoblacklight.relations.member_of_descendants
150
149
  query_type: descendants
151
- PART_OF_ANCESTORS:
150
+ part_of_ancestors:
152
151
  field: dct_isPartOf_sm
153
152
  icon: parent-item
154
- inverse: :PART_OF_DESCENDANTS
153
+ inverse: :part_of_descendants
155
154
  label: geoblacklight.relations.part_of_ancestors
156
155
  query_type: ancestors
157
- PART_OF_DESCENDANTS:
156
+ part_of_descendants:
158
157
  field: dct_isPartOf_sm
159
158
  icon: child-item
160
- inverse: :PART_OF_ANCESTORS
159
+ inverse: :part_of_ancestors
161
160
  label: geoblacklight.relations.part_of_descendants
162
161
  query_type: descendants
163
- RELATION_ANCESTORS:
162
+ relation_ancestors:
164
163
  field: dct_relation_sm
165
164
  icon: nil
166
- inverse: :RELATION_DESCENDANTS
165
+ inverse: :relation_descendants
167
166
  label: geoblacklight.relations.relation_ancestors
168
167
  query_type: ancestors
169
- RELATION_DESCENDANTS:
168
+ relation_descendants:
170
169
  field: dct_relation_sm
171
170
  icon: nil
172
- inverse: :RELATION_ANCESTORS
171
+ inverse: :relation_ancestors
173
172
  label: geoblacklight.relations.relation_descendants
174
173
  query_type: descendants
175
- REPLACES_ANCESTORS:
174
+ replaces_ancestors:
176
175
  field: dct_replaces_sm
177
176
  icon: nil
178
- inverse: :REPLACES_DESCENDANTS
177
+ inverse: :replaces_descendants
179
178
  label: geoblacklight.relations.replaces_ancestors
180
179
  query_type: ancestors
181
- REPLACES_DESCENDANTS:
180
+ replaces_descendants:
182
181
  field: dct_replaces_sm
183
182
  icon: nil
184
- inverse: :REPLACES_ANCESTORS
183
+ inverse: :replaces_ancestors
185
184
  label: geoblacklight.relations.replaces_descendants
186
185
  query_type: descendants
187
- SOURCE_ANCESTORS:
186
+ source_ancestors:
188
187
  field: dct_source_sm
189
188
  icon: parent-item
190
- inverse: :SOURCE_DESCENDANTS
189
+ inverse: :source_descendants
191
190
  label: geoblacklight.relations.source_ancestors
192
191
  query_type: ancestors
193
- SOURCE_DESCENDANTS:
192
+ source_descendants:
194
193
  field: dct_source_sm
195
194
  icon: child-item
196
- inverse: :SOURCE_ANCESTORS
195
+ inverse: :source_ancestors
197
196
  label: geoblacklight.relations.source_descendants
198
197
  query_type: descendants
199
- VERSION_OF_ANCESTORS:
198
+ version_of_ancestors:
200
199
  field: dct_isVersionOf_sm
201
200
  icon: parent-item
202
- inverse: :VERSION_OF_DESCENDANTS
201
+ inverse: :version_of_descendants
203
202
  label: geoblacklight.relations.version_of_ancestors
204
203
  query_type: ancestors
205
- VERSION_OF_DESCENDANTS:
204
+ version_of_descendants:
206
205
  field: dct_isVersionOf_sm
207
206
  icon: child-item
208
- inverse: :VERSION_OF_ANCESTORS
207
+ inverse: :version_of_ancestors
209
208
  label: geoblacklight.relations.version_of_descendants
210
209
  query_type: descendants
211
210
 
212
211
  # Vector data download formats to be displayed
213
- DOWNLOAD_FORMATS:
214
- VECTOR:
212
+ download_formats:
213
+ vector:
215
214
  - "Shapefile"
216
215
  - "KMZ"
217
216
  - "GeoJSON"
218
217
  - "CSV"
219
218
 
220
- # WMS Parameters
221
- WMS_PARAMS:
222
- :SERVICE: "WMS"
223
- :VERSION: "1.1.1"
224
- :REQUEST: "GetFeatureInfo"
225
- :STYLES: ""
226
- :SRS: "EPSG:4326"
227
- :EXCEPTIONS: "application/json"
228
- :INFO_FORMAT: "application/json"
219
+ # WMS Parameters. Keys are OGC WMS request parameter names and are sent to
220
+ # remote WMS servers, so they are intentionally left uppercase.
221
+ wms_params:
222
+ SERVICE: "WMS"
223
+ VERSION: "1.1.1"
224
+ REQUEST: "GetFeatureInfo"
225
+ STYLES: ""
226
+ SRS: "EPSG:4326"
227
+ EXCEPTIONS: "application/json"
228
+ INFO_FORMAT: "application/json"
229
229
 
230
230
  # Settings for leaflet
231
- LEAFLET:
232
- BOUNDSOVERLAY:
231
+ leaflet:
232
+ # Keys below are consumed by the JS viewer via the page value
233
+ # ("INDEX" / "SHOW" / "STATIC_MAP"), so they are intentionally left uppercase.
234
+ boundsoverlay:
233
235
  INDEX:
234
236
  color: "#3388ff"
235
237
  SHOW:
236
238
  color: "#3388ff"
237
239
  STATIC_MAP:
238
240
  color: "#3388ff"
239
- SELECTED_COLOR: "#2C7FB8"
240
- SLEEP:
241
- SLEEP: true # set to false to disable
242
- MARGIN_DISTANCE: 100 # set to zero / false if you want to disable this check
243
- SLEEPTIME: 750
244
- WAKETIME: 750
245
- HOVERTOWAKE: false
246
- MESSAGE: "Click to Wake"
247
- BACKGROUND: "rgba(214, 214, 214, .7)"
248
- SIDEBAR: false # set to true to display attribute table as sidebar on map
249
- LAYERS:
250
- DETECT_RETINA: true
251
- INDEX:
241
+ selected_color: "#2C7FB8"
242
+ sleep:
243
+ sleep: true # set to false to disable
244
+ margin_distance: 100 # set to zero / false if you want to disable this check
245
+ sleeptime: 750
246
+ waketime: 750
247
+ hovertowake: false
248
+ message: "Click to Wake"
249
+ background: "rgba(214, 214, 214, .7)"
250
+ sidebar: false # set to true to display attribute table as sidebar on map
251
+ layers:
252
+ detect_retina: true
253
+ index:
254
+ # DEFAULT / UNAVAILABLE / SELECTED are consumed by the JS viewer and the
255
+ # index-map legend, so they are intentionally left uppercase.
252
256
  DEFAULT: &default
253
257
  color: "#7FCDBB"
254
258
  weight: 1
@@ -264,7 +268,7 @@ LEAFLET:
264
268
  sr_color_name: "Blue"
265
269
 
266
270
  # Toggle the help text feature that offers users context
267
- HELP_TEXT:
271
+ help_text:
268
272
  viewer_protocol:
269
273
  - "cog"
270
274
  - "dynamic_map_layer"
@@ -283,8 +287,8 @@ HELP_TEXT:
283
287
  - "xyz"
284
288
 
285
289
  # Enable catalog#show sidebar static map for items with the following viewer protocols
286
- SIDEBAR_STATIC_MAP:
290
+ sidebar_static_map:
287
291
  - "iiif"
288
292
  - "iiif_manifest"
289
293
 
290
- IIIF_DRAG_DROP_LINK: "@manifest?manifest=@manifest"
294
+ iiif_drag_drop_link: "@manifest?manifest=@manifest"
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Geoblacklight
4
+ class Configuration
5
+ # Wraps the global +Settings+ object so that its keys can be resolved
6
+ # case-insensitively. When a key exists in both lower- and uppercase forms
7
+ # the lowercase value wins. Nested hash values are wrapped recursively, so
8
+ # chained access (e.g. +settings.fields.access_rights+) resolves regardless
9
+ # of the case used in settings.yml. Missing keys return +nil+, mirroring the
10
+ # behavior of the underlying Config::Options object.
11
+ #
12
+ # When a +deprecation+ (e.g. an ActiveSupport::Deprecation) is provided, a
13
+ # deprecation warning is issued whenever an uppercase key has to be used
14
+ # because no lowercase equivalent is present.
15
+ class CaseInsensitiveSettings
16
+ def initialize(settings, deprecation: nil)
17
+ @hash = settings.to_h
18
+ @deprecation = deprecation
19
+ end
20
+
21
+ def [](key)
22
+ resolve(key)
23
+ end
24
+
25
+ def to_h
26
+ @hash
27
+ end
28
+
29
+ def method_missing(name, *) # rubocop:disable Style/MissingRespondToMissing, Style/MethodMissingSuper
30
+ resolve(name)
31
+ end
32
+
33
+ private
34
+
35
+ def resolve(name)
36
+ target = name.to_s.downcase
37
+ keys = @hash.keys.select { |key| key.to_s.downcase == target }
38
+ return nil if keys.empty?
39
+
40
+ key = keys.find { |candidate| candidate.to_s == candidate.to_s.downcase }
41
+ if key.nil?
42
+ key = keys.first
43
+ warn_deprecated(key)
44
+ end
45
+ value = @hash[key]
46
+ value.is_a?(Hash) ? self.class.new(value, deprecation: @deprecation) : value
47
+ end
48
+
49
+ def warn_deprecated(key)
50
+ return unless @deprecation
51
+
52
+ @deprecation.warn(
53
+ "GeoBlacklight settings.yml key #{key} is uppercase; rename it to #{key.to_s.downcase}. " \
54
+ "Uppercase keys are deprecated and support will be removed in a future version."
55
+ )
56
+ end
57
+ end
58
+ end
59
+ end
@@ -11,41 +11,41 @@ module Geoblacklight
11
11
  attribute :date_issued, :string, default: "dct_issued_s"
12
12
  attribute :date_range, :string, default: "gbl_dateRange_drsim"
13
13
  attribute :description, :string, default: "dct_description_sm"
14
- attribute :display_note, :string, default: "gbl_displayNote_s"
14
+ attribute :display_note, :string, default: "gbl_displayNote_sm"
15
15
  attribute :format, :string, default: "dct_format_s"
16
- attribute :file_size, :string, default: "gbl_fileSize_drsim"
17
- attribute :georeferenced, :string, default: "gbl_georeferenced_drsim"
16
+ attribute :file_size, :string, default: "gbl_fileSize_s"
17
+ attribute :georeferenced, :string, default: "gbl_georeferenced_b"
18
18
  attribute :id, :string, default: "id"
19
- attribute :identifier, :string, default: "dct_identifier_s"
20
- attribute :index_year, :string, default: "gbl_indexYear_drsim"
21
- attribute :is_part_of, :string, default: "gbl_isPartOf_drsim"
22
- attribute :is_replaced_by, :string, default: "gbl_isReplacedBy_drsim"
23
- attribute :theme, :string, default: "gbl_theme_drsim"
24
- attribute :keyword, :string, default: "dct_keyword_sm"
25
- attribute :language, :string, default: "dct_language_s"
26
- attribute :license, :string, default: "dct_license_s"
27
- attribute :member_of, :string, default: "gbl_memberOf_drsim"
28
- attribute :metadata_version, :string, default: "gbl_metadataVersion_drsim"
29
- attribute :modified, :string, default: "gbl_modified_drsim"
30
- attribute :overlap_field, :string, default: "gbl_overlapField_drsim"
31
- attribute :publisher, :string, default: "gbl_publisher_drsim"
32
- attribute :provider, :string, default: "gbl_provider_drsim"
33
- attribute :references, :string, default: "gbl_references_drsim"
34
- attribute :relation, :string, default: "gbl_relation_drsim"
35
- attribute :replaces, :string, default: "gbl_replaces_drsim"
36
- attribute :resource_class, :string, default: "gbl_resourceClass_drsim"
37
- attribute :resource_type, :string, default: "gbl_resourceType_drsim"
38
- attribute :rights, :string, default: "gbl_rights_drsim"
39
- attribute :rights_holder, :string, default: "gbl_rightsHolder_drsim"
40
- attribute :source, :string, default: "gbl_source_drsim"
41
- attribute :spatial_coverage, :string, default: "gbl_spatialCoverage_drsim"
42
- attribute :geometry, :string, default: "gbl_geometry_drsim"
43
- attribute :subject, :string, default: "gbl_subject_drsim"
44
- attribute :suppressed, :string, default: "gbl_suppressed_drsim"
45
- attribute :temporal_coverage, :string, default: "gbl_temporalCoverage_drsim"
46
- attribute :title, :string, default: "gbl_title_drsim"
47
- attribute :version, :string, default: "gbl_version_drsim"
48
- attribute :wxs_identifier, :string, default: "gbl_wxsIdentifier_drsim"
19
+ attribute :identifier, :string, default: "dct_identifier_sm"
20
+ attribute :index_year, :string, default: "gbl_indexYear_im"
21
+ attribute :is_part_of, :string, default: "dct_isPartOf_sm"
22
+ attribute :is_replaced_by, :string, default: "dct_isReplacedBy_sm"
23
+ attribute :theme, :string, default: "dcat_theme_sm"
24
+ attribute :keyword, :string, default: "dcat_keyword_sm"
25
+ attribute :language, :string, default: "dct_language_sm"
26
+ attribute :license, :string, default: "dct_license_sm"
27
+ attribute :member_of, :string, default: "pcdm_memberOf_sm"
28
+ attribute :metadata_version, :string, default: "gbl_mdVersion_s"
29
+ attribute :modified, :string, default: "gbl_mdModified_dt"
30
+ attribute :overlap_field, :string, default: "solr_bboxtype"
31
+ attribute :publisher, :string, default: "dct_publisher_sm"
32
+ attribute :provider, :string, default: "schema_provider_s"
33
+ attribute :references, :string, default: "dct_references_s"
34
+ attribute :relation, :string, default: "dct_relation_sm"
35
+ attribute :replaces, :string, default: "dct_replaces_sm"
36
+ attribute :resource_class, :string, default: "gbl_resourceClass_sm"
37
+ attribute :resource_type, :string, default: "gbl_resourceType_sm"
38
+ attribute :rights, :string, default: "dct_rights_sm"
39
+ attribute :rights_holder, :string, default: "dct_rightsHolder_sm"
40
+ attribute :source, :string, default: "dct_source_sm"
41
+ attribute :spatial_coverage, :string, default: "dct_spatial_sm"
42
+ attribute :geometry, :string, default: "locn_geometry"
43
+ attribute :subject, :string, default: "dct_subject_sm"
44
+ attribute :suppressed, :string, default: "gbl_suppressed_b"
45
+ attribute :temporal_coverage, :string, default: "dct_temporal_sm"
46
+ attribute :title, :string, default: "dct_title_s"
47
+ attribute :version, :string, default: "dct_isVersionOf_sm"
48
+ attribute :wxs_identifier, :string, default: "gbl_wxsIdentifier_s"
49
49
  end
50
50
  end
51
51
  end