geoblacklight 6.0.0.pre.alpha.1 → 6.0.0.pre.alpha.3

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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +2 -1
  3. data/app/components/blacklight/icons/arrow_circle_down_component.rb +1 -1
  4. data/app/components/blacklight/icons/book_component.rb +1 -1
  5. data/app/components/blacklight/icons/cd_rom_component.rb +1 -1
  6. data/app/components/blacklight/icons/child_item_component.rb +1 -1
  7. data/app/components/blacklight/icons/citation_component.rb +1 -1
  8. data/app/components/blacklight/icons/collection_component.rb +1 -1
  9. data/app/components/blacklight/icons/collections_component.rb +1 -1
  10. data/app/components/blacklight/icons/datasets_component.rb +4 -4
  11. data/app/components/blacklight/icons/dvd_rom_component.rb +1 -1
  12. data/app/components/blacklight/icons/email_component.rb +1 -1
  13. data/app/components/blacklight/icons/fire_solid_component.rb +1 -1
  14. data/app/components/blacklight/icons/globe_component.rb +1 -1
  15. data/app/components/blacklight/icons/home_component.rb +1 -1
  16. data/app/components/blacklight/icons/image_component.rb +1 -1
  17. data/app/components/blacklight/icons/imagery_component.rb +1 -1
  18. data/app/components/blacklight/icons/leaf_component.rb +1 -1
  19. data/app/components/blacklight/icons/lightbulb_solid_component.rb +1 -1
  20. data/app/components/blacklight/icons/line_component.rb +2 -2
  21. data/app/components/blacklight/icons/map_component.rb +1 -1
  22. data/app/components/blacklight/icons/map_marker_component.rb +1 -1
  23. data/app/components/blacklight/icons/maps_component.rb +1 -1
  24. data/app/components/blacklight/icons/metadata_component.rb +1 -1
  25. data/app/components/blacklight/icons/mixed_component.rb +3 -3
  26. data/app/components/blacklight/icons/multilinestring_component.rb +4 -4
  27. data/app/components/blacklight/icons/multipoint_component.rb +1 -1
  28. data/app/components/blacklight/icons/multipolygon_component.rb +4 -4
  29. data/app/components/blacklight/icons/pagelines_brands_component.rb +1 -1
  30. data/app/components/blacklight/icons/paper_map_component.rb +1 -1
  31. data/app/components/blacklight/icons/parent_item_component.rb +1 -1
  32. data/app/components/blacklight/icons/point_component.rb +1 -1
  33. data/app/components/blacklight/icons/polygon_component.rb +2 -2
  34. data/app/components/blacklight/icons/polyline_component.rb +4 -4
  35. data/app/components/blacklight/icons/public_component.rb +1 -1
  36. data/app/components/blacklight/icons/raster_component.rb +1 -1
  37. data/app/components/blacklight/icons/restricted_component.rb +1 -1
  38. data/app/components/blacklight/icons/table_component.rb +1 -1
  39. data/app/components/blacklight/icons/tags_component.rb +1 -1
  40. data/app/components/blacklight/icons/triangle_exclamation_solid_component.rb +1 -1
  41. data/app/components/blacklight/icons/web_services_component.rb +1 -1
  42. data/app/components/blacklight/icons/websites_component.rb +1 -1
  43. data/app/components/geoblacklight/attribute_table_component.html.erb +1 -1
  44. data/app/components/geoblacklight/document/relations_container_component.html.erb +1 -0
  45. data/app/components/geoblacklight/document/relations_container_component.rb +12 -0
  46. data/app/components/geoblacklight/document/sidebar_component.html.erb +2 -3
  47. data/app/components/geoblacklight/download_links_component.html.erb +1 -1
  48. data/app/components/geoblacklight/download_links_component.rb +5 -2
  49. data/app/components/geoblacklight/homepage_feature_facet_component.rb +1 -1
  50. data/app/components/geoblacklight/index_map_inspect_component.html.erb +8 -1
  51. data/app/components/geoblacklight/index_map_legend_component.html.erb +6 -6
  52. data/app/components/geoblacklight/location_leaflet_map_component.rb +8 -1
  53. data/app/components/geoblacklight/login_link_component.rb +1 -1
  54. data/app/components/geoblacklight/static_map_component.html.erb +1 -1
  55. data/app/components/geoblacklight/web_services_link_component.rb +1 -1
  56. data/app/controllers/relation_controller.rb +1 -1
  57. data/app/helpers/geoblacklight_helper.rb +5 -2
  58. data/app/javascript/geoblacklight/controllers/downloads_controller.js +3 -3
  59. data/app/javascript/geoblacklight/core.js +0 -2
  60. data/app/javascript/geoblacklight/initializers/truncation.js +5 -3
  61. data/app/javascript/geoblacklight/leaflet/controls/geosearch.js +4 -2
  62. data/app/javascript/geoblacklight/leaflet/inspection.js +10 -5
  63. data/app/javascript/geoblacklight/leaflet/layer_index_map.js +15 -12
  64. data/app/javascript/geoblacklight/leaflet/utils.js +8 -2
  65. data/app/javascript/geoblacklight/openlayers/inspection.js +3 -5
  66. data/app/views/catalog/metadata/_markup.html.erb +1 -1
  67. data/app/views/catalog/metadata.html.erb +1 -1
  68. data/app/views/relation/index.html.erb +4 -2
  69. data/config/locales/geoblacklight.en.yml +31 -0
  70. data/geoblacklight.gemspec +3 -3
  71. data/lib/generators/geoblacklight/templates/settings.yml +285 -270
  72. data/lib/geoblacklight/configuration/case_insensitive_settings.rb +59 -0
  73. data/lib/geoblacklight/configuration/fields_config.rb +33 -33
  74. data/lib/geoblacklight/configuration/layer_config.rb +28 -0
  75. data/lib/geoblacklight/configuration/leaflet_config.rb +24 -25
  76. data/lib/geoblacklight/configuration/leaflet_layers_config.rb +15 -3
  77. data/lib/geoblacklight/configuration/leaflet_sleep_config.rb +1 -1
  78. data/lib/geoblacklight/configuration/relationship_config.rb +15 -0
  79. data/lib/geoblacklight/configuration/relationships_config.rb +123 -0
  80. data/lib/geoblacklight/configuration/settings_builder.rb +118 -0
  81. data/lib/geoblacklight/configuration.rb +7 -2
  82. data/lib/geoblacklight/deprecation.rb +7 -0
  83. data/lib/geoblacklight/engine.rb +1 -0
  84. data/lib/geoblacklight/metadata/base.rb +1 -1
  85. data/lib/geoblacklight/version.rb +1 -1
  86. data/lib/geoblacklight.rb +1 -2
  87. data/solr/conf/schema.xml +8 -7
  88. data/solr/conf/solrconfig.xml +1 -1
  89. data/spec/components/geoblacklight/document/sidebar_component_spec.rb +48 -0
  90. data/spec/components/geoblacklight/download_links_component_spec.rb +4 -1
  91. data/spec/components/geoblacklight/login_link_component_spec.rb +1 -1
  92. data/spec/helpers/geoblacklight_helper_spec.rb +1 -1
  93. data/spec/lib/geoblacklight/configuration/layer_config_spec.rb +71 -0
  94. data/spec/lib/geoblacklight/configuration/leaflet_config_spec.rb +129 -0
  95. data/spec/lib/geoblacklight/configuration/leaflet_layers_config_spec.rb +63 -0
  96. data/spec/lib/geoblacklight/configuration/settings_builder_spec.rb +284 -0
  97. data/spec/lib/geoblacklight/configuration_spec.rb +35 -0
  98. data/spec/lib/geoblacklight/metadata/base_spec.rb +1 -1
  99. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +4 -4
  100. data/spec/spec_helper.rb +5 -0
  101. metadata +32 -24
  102. data/app/javascript/geoblacklight/initializers/relations.js +0 -40
  103. data/app/views/catalog/_relations_container.html.erb +0 -1
  104. data/lib/geoblacklight/configuration/legacy_settings_builder.rb +0 -94
  105. data/lib/geoblacklight/faraday_middleware/follow_redirects.rb +0 -179
  106. data/spec/features/show_page_sidebar_static_map_spec.rb +0 -21
@@ -1,290 +1,305 @@
1
- # ArcGIS Online Base URL
2
- ARCGIS_BASE_URL: "https://www.arcgis.com/apps/mapviewer/index.html"
1
+ # These settings are used to configure GeoBlacklight.
2
+ # The values you see here are the defaults. If you want to override any of these,
3
+ # uncomment them and make any changes.
4
+ #
5
+ # Alternatively, you can use a config/initializers/geoblacklight.rb file to
6
+ # set these values directly on the GeoBlacklight::Configuration object.
7
+ # example:
8
+ # # config/initializers/geoblacklight.rb
9
+ # config = GeoBlacklight.configuration
10
+ # config.timeout_download = 10
3
11
 
4
- # Download path can be configured using this setting
5
- #DOWNLOAD_PATH: "./tmp/cache/downloads"
12
+ # # ArcGIS Online Base URL
13
+ # arcgis_base_url: "https://www.arcgis.com/apps/mapviewer/index.html"
6
14
 
7
- # The bq boost value for spatial search matches within a bounding box
8
- BBOX_WITHIN_BOOST: "10"
15
+ # # File path for downloads
16
+ # download_path: "<%= Rails.root.join('tmp', 'cache', 'downloads') %>"
9
17
 
10
- # The bf boost value for overlap ratio
11
- OVERLAP_RATIO_BOOST: "2"
18
+ # # The bq boost value for spatial search matches within a bounding box
19
+ # bbox_within_boost: "10"
12
20
 
13
- # Homepage Map Geometry
14
- # Leave null to default to entire world
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]]]}'
21
+ # # The bf boost value for overlap ratio
22
+ # overlap_ratio_boost: "2"
18
23
 
19
- # Non-search-field GeoBlacklight application permitted params
20
- GBL_PARAMS:
21
- - :bbox
22
- - :email
23
- - :file
24
- - :format
25
- - :id
26
- - :logo
27
- - :provider
28
- - :type
29
- - :BBOX
30
- - :HEIGHT
31
- - :LAYERS
32
- - :QUERY_LAYERS
33
- - :URL
34
- - :WIDTH
35
- - :X
36
- - :Y
24
+ # # Homepage Map Geometry
25
+ # # Leave null to default to entire world
26
+ # # Add a stringified GeoJSON object to scope initial render (example from UMass)
27
+ # homepage_map_geom: null
28
+ # # homepage_map_geom: '{"type":"Polygon","coordinates":[[[-73.58,42.93],[-73.58,41.20],[-69.90,41.20],[-69.90,42.93]]]}'
37
29
 
38
- # 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"
30
+ # # Non-search-field GeoBlacklight application permitted params.
31
+ # # Values are left mixed-case on purpose: the uppercase symbols are WMS/OGC
32
+ # # request parameter names (BBOX, WIDTH, etc.) and must match what clients send.
33
+ # gbl_params:
34
+ # - :bbox
35
+ # - :email
36
+ # - :file
37
+ # - :format
38
+ # - :id
39
+ # - :logo
40
+ # - :provider
41
+ # - :type
42
+ # - :BBOX
43
+ # - :HEIGHT
44
+ # - :LAYERS
45
+ # - :QUERY_LAYERS
46
+ # - :URL
47
+ # - :WIDTH
48
+ # - :X
49
+ # - :Y
82
50
 
83
- # Institution deployed at
84
- INSTITUTION: "Stanford"
51
+ # # Solr field mappings
52
+ # fields:
53
+ # access_rights: "dct_accessRights_s"
54
+ # alternative_title: "dct_alternative_sm"
55
+ # centroid: "dcat_centroid"
56
+ # creator: "dct_creator_sm"
57
+ # date_issued: "dct_issued_s"
58
+ # date_range: "gbl_dateRange_drsim"
59
+ # description: "dct_description_sm"
60
+ # display_note: "gbl_displayNote_sm"
61
+ # format: "dct_format_s"
62
+ # file_size: "gbl_fileSize_s"
63
+ # georeferenced: "gbl_georeferenced_b"
64
+ # id: "id"
65
+ # identifier: "dct_identifier_sm"
66
+ # index_year: "gbl_indexYear_im"
67
+ # is_part_of: "dct_isPartOf_sm"
68
+ # is_replaced_by: "dct_isReplacedBy_sm"
69
+ # theme: "dcat_theme_sm"
70
+ # keyword: "dcat_keyword_sm"
71
+ # language: "dct_language_sm"
72
+ # license: "dct_license_sm"
73
+ # member_of: "pcdm_memberOf_sm"
74
+ # metadata_version: "gbl_mdVersion_s"
75
+ # modified: "gbl_mdModified_dt"
76
+ # overlap_field: "solr_bboxtype"
77
+ # publisher: "dct_publisher_sm"
78
+ # provider: "schema_provider_s"
79
+ # references: "dct_references_s"
80
+ # relation: "dct_relation_sm"
81
+ # replaces: "dct_replaces_sm"
82
+ # resource_class: "gbl_resourceClass_sm"
83
+ # resource_type: "gbl_resourceType_sm"
84
+ # rights: "dct_rights_sm"
85
+ # rights_holder: "dct_rightsHolder_sm"
86
+ # source: "dct_source_sm"
87
+ # spatial_coverage: "dct_spatial_sm"
88
+ # geometry: "locn_geometry"
89
+ # subject: "dct_subject_sm"
90
+ # suppressed: "gbl_suppressed_b"
91
+ # temporal_coverage: "dct_temporal_sm"
92
+ # title: "dct_title_s"
93
+ # version: "dct_isVersionOf_sm"
94
+ # wxs_identifier: "gbl_wxsIdentifier_s"
85
95
 
86
- # Metadata shown in tool panel
87
- METADATA_SHOWN:
88
- - "mods"
89
- - "fgdc"
90
- - "iso19139"
91
- - "html"
96
+ # # Institution deployed at
97
+ # institution: "Stanford"
92
98
 
93
- # (For external Download) timeout and open_timeout parameters for Faraday
94
- TIMEOUT_DOWNLOAD: 180
99
+ # # Metadata shown in tool panel
100
+ # metadata_shown:
101
+ # - "mods"
102
+ # - "fgdc"
103
+ # - "iso19139"
104
+ # - "html"
95
105
 
96
- # (For WMS inspection) timeout and open_timeout parameters for Faraday
97
- TIMEOUT_WMS: 4
106
+ # # (For external Download) timeout and open_timeout parameters for Faraday
107
+ # timeout_download: 180
98
108
 
99
- # Use the geometry type for the data relations icon
100
- USE_GEOM_FOR_RELATIONS_ICON: false
109
+ # # (For WMS inspection) timeout and open_timeout parameters for Faraday
110
+ # timeout_wms: 4
101
111
 
102
- # Web services shown in tool panel
103
- WEBSERVICES_SHOWN:
104
- - "wms"
105
- - "tms"
106
- - "wfs"
107
- - "xyz"
108
- - "wmts"
109
- - "tilejson"
110
- - "iiif"
111
- - "feature_layer"
112
- - "tiled_map_layer"
113
- - "dynamic_map_layer"
114
- - "image_map_layer"
115
- - "cog"
116
- - "pmtiles"
112
+ # # Web services shown in tool panel
113
+ # webservices_shown:
114
+ # - "wms"
115
+ # - "tms"
116
+ # - "wfs"
117
+ # - "xyz"
118
+ # - "wmts"
119
+ # - "tilejson"
120
+ # - "iiif"
121
+ # - "feature_layer"
122
+ # - "tiled_map_layer"
123
+ # - "dynamic_map_layer"
124
+ # - "image_map_layer"
125
+ # - "cog"
126
+ # - "pmtiles"
117
127
 
118
- # Display Notes to display / Non-prefixed default bootstrap class is alert-secondary
119
- DISPLAY_NOTES_SHOWN:
120
- danger:
121
- bootstrap_alert_class: alert-danger
122
- icon: fire-solid
123
- note_prefix: "Danger: "
124
- info:
125
- bootstrap_alert_class: alert-info
126
- icon: circle-info-solid
127
- note_prefix: "Info: "
128
- tip:
129
- bootstrap_alert_class: alert-success
130
- icon: lightbulb-solid
131
- note_prefix: "Tip: "
132
- warning:
133
- bootstrap_alert_class: alert-warning
134
- icon: triangle-exclamation-solid
135
- note_prefix: "Warning: "
128
+ # # Display Notes to display / Non-prefixed default bootstrap class is alert-secondary
129
+ # display_notes_shown:
130
+ # danger:
131
+ # bootstrap_alert_class: alert-danger
132
+ # icon: fire-solid
133
+ # note_prefix: "Danger: "
134
+ # info:
135
+ # bootstrap_alert_class: alert-info
136
+ # icon: circle-info-solid
137
+ # note_prefix: "Info: "
138
+ # tip:
139
+ # bootstrap_alert_class: alert-success
140
+ # icon: lightbulb-solid
141
+ # note_prefix: "Tip: "
142
+ # warning:
143
+ # bootstrap_alert_class: alert-warning
144
+ # icon: triangle-exclamation-solid
145
+ # note_prefix: "Warning: "
136
146
 
137
- # Relationships to display
138
- RELATIONSHIPS_SHOWN:
139
- MEMBER_OF_ANCESTORS:
140
- field: pcdm_memberOf_sm
141
- icon: parent-item
142
- inverse: :MEMBER_OF_DESCENDANTS
143
- label: geoblacklight.relations.member_of_ancestors
144
- query_type: ancestors
145
- MEMBER_OF_DESCENDANTS:
146
- field: pcdm_memberOf_sm
147
- icon: child-item
148
- inverse: :MEMBER_OF_ANCESTORS
149
- label: geoblacklight.relations.member_of_descendants
150
- query_type: descendants
151
- PART_OF_ANCESTORS:
152
- field: dct_isPartOf_sm
153
- icon: parent-item
154
- inverse: :PART_OF_DESCENDANTS
155
- label: geoblacklight.relations.part_of_ancestors
156
- query_type: ancestors
157
- PART_OF_DESCENDANTS:
158
- field: dct_isPartOf_sm
159
- icon: child-item
160
- inverse: :PART_OF_ANCESTORS
161
- label: geoblacklight.relations.part_of_descendants
162
- query_type: descendants
163
- RELATION_ANCESTORS:
164
- field: dct_relation_sm
165
- icon: nil
166
- inverse: :RELATION_DESCENDANTS
167
- label: geoblacklight.relations.relation_ancestors
168
- query_type: ancestors
169
- RELATION_DESCENDANTS:
170
- field: dct_relation_sm
171
- icon: nil
172
- inverse: :RELATION_ANCESTORS
173
- label: geoblacklight.relations.relation_descendants
174
- query_type: descendants
175
- REPLACES_ANCESTORS:
176
- field: dct_replaces_sm
177
- icon: nil
178
- inverse: :REPLACES_DESCENDANTS
179
- label: geoblacklight.relations.replaces_ancestors
180
- query_type: ancestors
181
- REPLACES_DESCENDANTS:
182
- field: dct_replaces_sm
183
- icon: nil
184
- inverse: :REPLACES_ANCESTORS
185
- label: geoblacklight.relations.replaces_descendants
186
- query_type: descendants
187
- SOURCE_ANCESTORS:
188
- field: dct_source_sm
189
- icon: parent-item
190
- inverse: :SOURCE_DESCENDANTS
191
- label: geoblacklight.relations.source_ancestors
192
- query_type: ancestors
193
- SOURCE_DESCENDANTS:
194
- field: dct_source_sm
195
- icon: child-item
196
- inverse: :SOURCE_ANCESTORS
197
- label: geoblacklight.relations.source_descendants
198
- query_type: descendants
199
- VERSION_OF_ANCESTORS:
200
- field: dct_isVersionOf_sm
201
- icon: parent-item
202
- inverse: :VERSION_OF_DESCENDANTS
203
- label: geoblacklight.relations.version_of_ancestors
204
- query_type: ancestors
205
- VERSION_OF_DESCENDANTS:
206
- field: dct_isVersionOf_sm
207
- icon: child-item
208
- inverse: :VERSION_OF_ANCESTORS
209
- label: geoblacklight.relations.version_of_descendants
210
- query_type: descendants
147
+ # # Relationships to display
148
+ # relationships_shown:
149
+ # member_of_ancestors:
150
+ # field: pcdm_memberOf_sm
151
+ # icon: parent-item
152
+ # inverse: :member_of_descendants
153
+ # label: geoblacklight.relations.member_of_ancestors
154
+ # query_type: ancestors
155
+ # member_of_descendants:
156
+ # field: pcdm_memberOf_sm
157
+ # icon: child-item
158
+ # inverse: :member_of_ancestors
159
+ # label: geoblacklight.relations.member_of_descendants
160
+ # query_type: descendants
161
+ # part_of_ancestors:
162
+ # field: dct_isPartOf_sm
163
+ # icon: parent-item
164
+ # inverse: :part_of_descendants
165
+ # label: geoblacklight.relations.part_of_ancestors
166
+ # query_type: ancestors
167
+ # part_of_descendants:
168
+ # field: dct_isPartOf_sm
169
+ # icon: child-item
170
+ # inverse: :part_of_ancestors
171
+ # label: geoblacklight.relations.part_of_descendants
172
+ # query_type: descendants
173
+ # relation_ancestors:
174
+ # field: dct_relation_sm
175
+ # icon: nil
176
+ # inverse: :relation_descendants
177
+ # label: geoblacklight.relations.relation_ancestors
178
+ # query_type: ancestors
179
+ # relation_descendants:
180
+ # field: dct_relation_sm
181
+ # icon: nil
182
+ # inverse: :relation_ancestors
183
+ # label: geoblacklight.relations.relation_descendants
184
+ # query_type: descendants
185
+ # replaces_ancestors:
186
+ # field: dct_replaces_sm
187
+ # icon: nil
188
+ # inverse: :replaces_descendants
189
+ # label: geoblacklight.relations.replaces_ancestors
190
+ # query_type: ancestors
191
+ # replaces_descendants:
192
+ # field: dct_replaces_sm
193
+ # icon: nil
194
+ # inverse: :replaces_ancestors
195
+ # label: geoblacklight.relations.replaces_descendants
196
+ # query_type: descendants
197
+ # source_ancestors:
198
+ # field: dct_source_sm
199
+ # icon: parent-item
200
+ # inverse: :source_descendants
201
+ # label: geoblacklight.relations.source_ancestors
202
+ # query_type: ancestors
203
+ # source_descendants:
204
+ # field: dct_source_sm
205
+ # icon: child-item
206
+ # inverse: :source_ancestors
207
+ # label: geoblacklight.relations.source_descendants
208
+ # query_type: descendants
209
+ # version_of_ancestors:
210
+ # field: dct_isVersionOf_sm
211
+ # icon: parent-item
212
+ # inverse: :version_of_descendants
213
+ # label: geoblacklight.relations.version_of_ancestors
214
+ # query_type: ancestors
215
+ # version_of_descendants:
216
+ # field: dct_isVersionOf_sm
217
+ # icon: child-item
218
+ # inverse: :version_of_ancestors
219
+ # label: geoblacklight.relations.version_of_descendants
220
+ # query_type: descendants
211
221
 
212
- # Vector data download formats to be displayed
213
- DOWNLOAD_FORMATS:
214
- VECTOR:
215
- - "Shapefile"
216
- - "KMZ"
217
- - "GeoJSON"
218
- - "CSV"
222
+ # # Vector data download formats to be displayed
223
+ # download_formats:
224
+ # vector:
225
+ # - "Shapefile"
226
+ # - "KMZ"
227
+ # - "GeoJSON"
228
+ # - "CSV"
219
229
 
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"
230
+ # # WMS Parameters. Keys are OGC WMS request parameter names and are sent to
231
+ # # remote WMS servers, so they are intentionally left uppercase.
232
+ # wms_params:
233
+ # SERVICE: "WMS"
234
+ # VERSION: "1.1.1"
235
+ # REQUEST: "GetFeatureInfo"
236
+ # STYLES: ""
237
+ # SRS: "EPSG:4326"
238
+ # EXCEPTIONS: "application/json"
239
+ # INFO_FORMAT: "application/json"
229
240
 
230
- # Settings for leaflet
231
- LEAFLET:
232
- BOUNDSOVERLAY:
233
- INDEX:
234
- color: "#3388ff"
235
- SHOW:
236
- color: "#3388ff"
237
- STATIC_MAP:
238
- 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:
252
- DEFAULT: &default
253
- color: "#7FCDBB"
254
- weight: 1
255
- radius: 4
256
- sr_color_name: "Green"
257
- UNAVAILABLE:
258
- <<: *default
259
- color: "#EDF8B1"
260
- sr_color_name: "Yellow"
261
- SELECTED:
262
- <<: *default
263
- color: "#2C7FB8"
264
- sr_color_name: "Blue"
241
+ # # Settings for leaflet
242
+ # leaflet:
243
+ # # Keys below are consumed by the JS viewer via the page value
244
+ # # ("INDEX" / "SHOW" / "STATIC_MAP"), so they are intentionally left uppercase.
245
+ # boundsoverlay:
246
+ # INDEX:
247
+ # color: "#3388ff"
248
+ # SHOW:
249
+ # color: "#3388ff"
250
+ # STATIC_MAP:
251
+ # color: "#3388ff"
252
+ # selected_color: "#2C7FB8"
253
+ # sleep:
254
+ # sleep: true # set to false to disable
255
+ # margin_distance: 100 # set to zero / false if you want to disable this check
256
+ # sleeptime: 750
257
+ # waketime: 750
258
+ # hovertowake: false
259
+ # message: "Click to Wake"
260
+ # background: "rgba(214, 214, 214, .7)"
261
+ # sidebar: false # set to true to display attribute table as sidebar on map
262
+ # layers:
263
+ # detect_retina: true
264
+ # index:
265
+ # # DEFAULT / UNAVAILABLE / SELECTED are consumed by the JS viewer and the
266
+ # # index-map legend, so they are intentionally left uppercase.
267
+ # DEFAULT: &default
268
+ # color: "#7FCDBB"
269
+ # weight: 1
270
+ # radius: 4
271
+ # sr_color_name: "Green"
272
+ # UNAVAILABLE:
273
+ # <<: *default
274
+ # color: "#EDF8B1"
275
+ # sr_color_name: "Yellow"
276
+ # SELECTED:
277
+ # <<: *default
278
+ # color: "#2C7FB8"
279
+ # sr_color_name: "Blue"
265
280
 
266
- # Toggle the help text feature that offers users context
267
- HELP_TEXT:
268
- viewer_protocol:
269
- - "cog"
270
- - "dynamic_map_layer"
271
- - "feature_layer"
272
- - "iiif"
273
- - "iiif_manifest"
274
- - "image_map_layer"
275
- - "index_map"
276
- - "oembed"
277
- - "pmtiles"
278
- - "tiled_map_layer"
279
- - "tilejson"
280
- - "tms"
281
- - "wms"
282
- - "wmts"
283
- - "xyz"
281
+ # # Toggle the help text feature that offers users context
282
+ # help_text:
283
+ # viewer_protocol:
284
+ # - "cog"
285
+ # - "dynamic_map_layer"
286
+ # - "feature_layer"
287
+ # - "iiif"
288
+ # - "iiif_manifest"
289
+ # - "image_map_layer"
290
+ # - "index_map"
291
+ # - "oembed"
292
+ # - "pmtiles"
293
+ # - "tiled_map_layer"
294
+ # - "tilejson"
295
+ # - "tms"
296
+ # - "wms"
297
+ # - "wmts"
298
+ # - "xyz"
284
299
 
285
- # Enable catalog#show sidebar static map for items with the following viewer protocols
286
- SIDEBAR_STATIC_MAP:
287
- - "iiif"
288
- - "iiif_manifest"
300
+ # # Enable catalog#show sidebar static map for items with the following viewer protocols
301
+ # sidebar_static_map:
302
+ # - "iiif"
303
+ # - "iiif_manifest"
289
304
 
290
- IIIF_DRAG_DROP_LINK: "@manifest?manifest=@manifest"
305
+ # 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