geoblacklight 5.3.0 → 5.4.0
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.
- checksums.yaml +4 -4
- data/app/components/geoblacklight/document/sidebar_component.html.erb +3 -0
- data/app/components/geoblacklight/document/sidebar_component.rb +7 -0
- data/app/components/geoblacklight/download_links_component.html.erb +3 -0
- data/app/components/geoblacklight/download_links_component.rb +1 -1
- data/app/components/geoblacklight/item_map_viewer_component.rb +2 -2
- data/app/components/geoblacklight/location_leaflet_map_component.rb +2 -2
- data/app/components/geoblacklight/relations_component.html.erb +1 -1
- data/app/components/geoblacklight/static_map_component.rb +2 -2
- data/app/controllers/download_controller.rb +6 -0
- data/app/controllers/relation_controller.rb +1 -1
- data/app/helpers/geoblacklight_helper.rb +31 -3
- data/app/javascript/geoblacklight/controllers/leaflet_viewer_controller.js +18 -3
- data/app/javascript/geoblacklight/controllers/openlayers_viewer_controller.js +33 -2
- data/app/javascript/geoblacklight/leaflet/basemaps.js +0 -32
- data/app/javascript/geoblacklight/leaflet/inspection.js +5 -4
- data/app/javascript/geoblacklight/openlayers/basemaps.js +0 -20
- data/app/javascript/geoblacklight/openlayers/layers.js +1 -1
- data/app/models/concerns/geoblacklight/solr_document.rb +19 -2
- data/app/views/catalog/_metadata.html.erb +3 -0
- data/geoblacklight.gemspec +2 -2
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +4 -5
- data/lib/generators/geoblacklight/templates/settings.yml +19 -0
- data/lib/geoblacklight/deprecated_configuration.rb +665 -0
- data/lib/geoblacklight/download.rb +3 -0
- data/lib/geoblacklight/engine.rb +13 -0
- data/lib/geoblacklight/references.rb +6 -1
- data/lib/geoblacklight/relation/ancestors.rb +3 -0
- data/lib/geoblacklight/relation/descendants.rb +3 -0
- data/lib/geoblacklight/relation/relation_response.rb +4 -1
- data/lib/geoblacklight/version.rb +1 -1
- data/lib/geoblacklight.rb +16 -0
- data/lib/tasks/geoblacklight.rake +9 -0
- data/package.json +1 -1
- data/solr/conf/solrconfig.xml +10 -10
- data/spec/features/configurable_basemap_spec.rb +68 -0
- data/spec/features/relations_spec.rb +2 -3
- data/spec/lib/geoblacklight/deprecated_configuration_spec.rb +680 -0
- data/spec/solr_config_spec.rb +41 -0
- data/spec/spec_helper.rb +24 -1
- metadata +12 -9
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "spec_helper"
|
|
4
|
+
|
|
5
|
+
RSpec.describe "Solr configuration" do
|
|
6
|
+
def parse(name)
|
|
7
|
+
Nokogiri::XML(File.read(File.expand_path("../solr/conf/#{name}", __dir__)))
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
let(:schema) { parse("schema.xml") }
|
|
11
|
+
let(:solrconfig) { parse("solrconfig.xml") }
|
|
12
|
+
|
|
13
|
+
# Every *_ti and *_tmi name matches a dynamicField, so boosting a field that no
|
|
14
|
+
# copyField populates is legal, queryable, and always empty -- Solr never
|
|
15
|
+
# complains, the boost just silently contributes nothing to scoring. That has
|
|
16
|
+
# happened twice now: renaming a copyField destination from *_ti to *_tmi
|
|
17
|
+
# (multiValued sources need multiValued destinations) left the matching qf/pf
|
|
18
|
+
# entry behind. Deliberately ignores dynamicFields, since resolving through one
|
|
19
|
+
# is exactly the bug being guarded against.
|
|
20
|
+
def populated_fields
|
|
21
|
+
schema.xpath("//fields/field/@name").map(&:value) +
|
|
22
|
+
schema.xpath("//copyField/@dest").map(&:value)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Reads the /text() children rather than the <str> node's own text, so the XML
|
|
26
|
+
# comment inside <str name="pf"> cannot leak words into the field list.
|
|
27
|
+
def boosted_fields(param)
|
|
28
|
+
solrconfig.xpath("//requestHandler[@name='/select']//str[@name='#{param}']/text()")
|
|
29
|
+
.map(&:text).join(" ")
|
|
30
|
+
.split.map { |entry| entry.split("^").first }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
%w[qf pf].each do |param|
|
|
34
|
+
it "only boosts #{param} fields that something populates" do
|
|
35
|
+
dead = boosted_fields(param) - populated_fields
|
|
36
|
+
|
|
37
|
+
expect(dead).to be_empty,
|
|
38
|
+
"#{param} boosts fields no copyField or <field> populates: #{dead.join(", ")}"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -36,7 +36,30 @@ require "selenium-webdriver"
|
|
|
36
36
|
require "webmock/rspec"
|
|
37
37
|
WebMock.allow_net_connect!(net_http_connect_on_start: true)
|
|
38
38
|
|
|
39
|
-
Capybara.
|
|
39
|
+
Capybara.register_driver :chrome_headless do |app|
|
|
40
|
+
# Set up Chrome options
|
|
41
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
|
42
|
+
options.add_argument("--headless")
|
|
43
|
+
options.add_argument("--disable-gpu")
|
|
44
|
+
options.add_argument("--no-sandbox")
|
|
45
|
+
options.add_argument("--window-size=1280,1024")
|
|
46
|
+
# Return from #visit at DOMContentLoaded instead of waiting for the full
|
|
47
|
+
# window `load` event. GeoBlacklight pages pull basemap tiles and WMS/TMS
|
|
48
|
+
# layers from external hosts; in CI those requests can hang and prevent
|
|
49
|
+
# `load` from ever firing, causing Net::ReadTimeout on #visit.
|
|
50
|
+
options.page_load_strategy = :eager
|
|
51
|
+
|
|
52
|
+
# Allow longer TCP reads to prevent timeout in the case of loading fixture
|
|
53
|
+
# eee6150b-ce2f-4837-9d17-ce72a0c1c26f, as part of relations_spec.rb
|
|
54
|
+
client = Selenium::WebDriver::Remote::Http::Default.new
|
|
55
|
+
client.read_timeout = 120 # seconds
|
|
56
|
+
|
|
57
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options, http_client: client)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
Capybara.javascript_driver = :chrome_headless
|
|
61
|
+
|
|
62
|
+
Capybara.default_max_wait_time = ENV["CI"] ? 10 : 2
|
|
40
63
|
|
|
41
64
|
require "geoblacklight"
|
|
42
65
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: geoblacklight
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mike Graves
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
- Jack Reed
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2026-
|
|
13
|
+
date: 2026-09-15 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rails
|
|
@@ -248,14 +248,14 @@ dependencies:
|
|
|
248
248
|
requirements:
|
|
249
249
|
- - ">="
|
|
250
250
|
- !ruby/object:Gem::Version
|
|
251
|
-
version: '
|
|
251
|
+
version: '4.11'
|
|
252
252
|
type: :development
|
|
253
253
|
prerelease: false
|
|
254
254
|
version_requirements: !ruby/object:Gem::Requirement
|
|
255
255
|
requirements:
|
|
256
256
|
- - ">="
|
|
257
257
|
- !ruby/object:Gem::Version
|
|
258
|
-
version: '
|
|
258
|
+
version: '4.11'
|
|
259
259
|
- !ruby/object:Gem::Dependency
|
|
260
260
|
name: factory_bot_rails
|
|
261
261
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -299,19 +299,19 @@ dependencies:
|
|
|
299
299
|
- !ruby/object:Gem::Version
|
|
300
300
|
version: '0'
|
|
301
301
|
- !ruby/object:Gem::Dependency
|
|
302
|
-
name:
|
|
302
|
+
name: standard
|
|
303
303
|
requirement: !ruby/object:Gem::Requirement
|
|
304
304
|
requirements:
|
|
305
|
-
- -
|
|
305
|
+
- - "~>"
|
|
306
306
|
- !ruby/object:Gem::Version
|
|
307
|
-
version: 1.0
|
|
307
|
+
version: 1.56.0
|
|
308
308
|
type: :development
|
|
309
309
|
prerelease: false
|
|
310
310
|
version_requirements: !ruby/object:Gem::Requirement
|
|
311
311
|
requirements:
|
|
312
|
-
- -
|
|
312
|
+
- - "~>"
|
|
313
313
|
- !ruby/object:Gem::Version
|
|
314
|
-
version: 1.0
|
|
314
|
+
version: 1.56.0
|
|
315
315
|
- !ruby/object:Gem::Dependency
|
|
316
316
|
name: webmock
|
|
317
317
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -614,6 +614,7 @@ files:
|
|
|
614
614
|
- lib/geoblacklight.rb
|
|
615
615
|
- lib/geoblacklight/bounding_box.rb
|
|
616
616
|
- lib/geoblacklight/constants.rb
|
|
617
|
+
- lib/geoblacklight/deprecated_configuration.rb
|
|
617
618
|
- lib/geoblacklight/download.rb
|
|
618
619
|
- lib/geoblacklight/download/csv_download.rb
|
|
619
620
|
- lib/geoblacklight/download/geojson_download.rb
|
|
@@ -890,6 +891,7 @@ files:
|
|
|
890
891
|
- spec/javascripts/geoblacklight_spec.js
|
|
891
892
|
- spec/javascripts/metadata_download_button_spec.js
|
|
892
893
|
- spec/lib/geoblacklight/bounding_box_spec.rb
|
|
894
|
+
- spec/lib/geoblacklight/deprecated_configuration_spec.rb
|
|
893
895
|
- spec/lib/geoblacklight/download/csv_download_spec.rb
|
|
894
896
|
- spec/lib/geoblacklight/download/geojson_download_spec.rb
|
|
895
897
|
- spec/lib/geoblacklight/download/geotiff_download_spec.rb
|
|
@@ -921,6 +923,7 @@ files:
|
|
|
921
923
|
- spec/models/concerns/geoblacklight/suppressed_records_search_behavior_spec.rb
|
|
922
924
|
- spec/presenters/geoblacklight/bbox_item_presenter_spec.rb
|
|
923
925
|
- spec/routing/catalog_routing_spec.rb
|
|
926
|
+
- spec/solr_config_spec.rb
|
|
924
927
|
- spec/spec_helper.rb
|
|
925
928
|
- spec/support/backport_test_helpers.rb
|
|
926
929
|
- spec/support/features.rb
|