geoblacklight 5.2.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/.github/workflows/ruby.yml +4 -4
- data/app/assets/stylesheets/geoblacklight/modules/item.scss +20 -3
- data/app/components/geoblacklight/accordion_component.html.erb +16 -0
- data/app/components/geoblacklight/accordion_component.rb +11 -0
- data/app/components/geoblacklight/attribute_table_component.html.erb +15 -17
- 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/index_map_inspect_component.html.erb +4 -3
- 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 +35 -6
- 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/controls/sidebar.js +47 -0
- 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/config/importmap.rb +4 -10
- data/config/locales/geoblacklight.en.yml +1 -0
- data/geoblacklight.gemspec +2 -2
- data/lib/generators/geoblacklight/assets/importmap_generator.rb +10 -7
- data/lib/generators/geoblacklight/assets/vite_generator.rb +9 -2
- data/lib/generators/geoblacklight/assets_generator.rb +2 -2
- data/lib/generators/geoblacklight/templates/assets/application.scss +1 -1
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +4 -5
- data/lib/generators/geoblacklight/templates/settings.yml +20 -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 +4 -7
- data/schema/geoblacklight-schema-aardvark.json +2 -2
- data/solr/conf/solrconfig.xml +10 -10
- data/spec/features/configurable_basemap_spec.rb +68 -0
- data/spec/features/full_screen_control_spec.rb +4 -6
- data/spec/features/relations_spec.rb +2 -3
- data/spec/features/saved_searches_spec.rb +1 -8
- 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
- data/vite.config.ts +0 -3
- metadata +15 -10
- data/test/leaflet/layers.test.js +0 -17
|
@@ -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
|
|
data/vite.config.ts
CHANGED
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
|
|
@@ -483,6 +483,8 @@ files:
|
|
|
483
483
|
- app/components/blacklight/icons/uva_component.rb
|
|
484
484
|
- app/components/blacklight/icons/web_services_component.rb
|
|
485
485
|
- app/components/blacklight/icons/websites_component.rb
|
|
486
|
+
- app/components/geoblacklight/accordion_component.html.erb
|
|
487
|
+
- app/components/geoblacklight/accordion_component.rb
|
|
486
488
|
- app/components/geoblacklight/arcgis_component.html.erb
|
|
487
489
|
- app/components/geoblacklight/arcgis_component.rb
|
|
488
490
|
- app/components/geoblacklight/attribute_table_component.html.erb
|
|
@@ -557,6 +559,7 @@ files:
|
|
|
557
559
|
- app/javascript/geoblacklight/leaflet/constants.js
|
|
558
560
|
- app/javascript/geoblacklight/leaflet/controls/geosearch.js
|
|
559
561
|
- app/javascript/geoblacklight/leaflet/controls/layer_opacity.js
|
|
562
|
+
- app/javascript/geoblacklight/leaflet/controls/sidebar.js
|
|
560
563
|
- app/javascript/geoblacklight/leaflet/controls/sleep.js
|
|
561
564
|
- app/javascript/geoblacklight/leaflet/inspection.js
|
|
562
565
|
- app/javascript/geoblacklight/leaflet/layer_index_map.js
|
|
@@ -611,6 +614,7 @@ files:
|
|
|
611
614
|
- lib/geoblacklight.rb
|
|
612
615
|
- lib/geoblacklight/bounding_box.rb
|
|
613
616
|
- lib/geoblacklight/constants.rb
|
|
617
|
+
- lib/geoblacklight/deprecated_configuration.rb
|
|
614
618
|
- lib/geoblacklight/download.rb
|
|
615
619
|
- lib/geoblacklight/download/csv_download.rb
|
|
616
620
|
- lib/geoblacklight/download/geojson_download.rb
|
|
@@ -887,6 +891,7 @@ files:
|
|
|
887
891
|
- spec/javascripts/geoblacklight_spec.js
|
|
888
892
|
- spec/javascripts/metadata_download_button_spec.js
|
|
889
893
|
- spec/lib/geoblacklight/bounding_box_spec.rb
|
|
894
|
+
- spec/lib/geoblacklight/deprecated_configuration_spec.rb
|
|
890
895
|
- spec/lib/geoblacklight/download/csv_download_spec.rb
|
|
891
896
|
- spec/lib/geoblacklight/download/geojson_download_spec.rb
|
|
892
897
|
- spec/lib/geoblacklight/download/geotiff_download_spec.rb
|
|
@@ -918,6 +923,7 @@ files:
|
|
|
918
923
|
- spec/models/concerns/geoblacklight/suppressed_records_search_behavior_spec.rb
|
|
919
924
|
- spec/presenters/geoblacklight/bbox_item_presenter_spec.rb
|
|
920
925
|
- spec/routing/catalog_routing_spec.rb
|
|
926
|
+
- spec/solr_config_spec.rb
|
|
921
927
|
- spec/spec_helper.rb
|
|
922
928
|
- spec/support/backport_test_helpers.rb
|
|
923
929
|
- spec/support/features.rb
|
|
@@ -927,7 +933,6 @@ files:
|
|
|
927
933
|
- spec/tasks/geoblacklight_spec.rb
|
|
928
934
|
- spec/test_app_templates/lib/generators/test_app_generator.rb
|
|
929
935
|
- template.rb
|
|
930
|
-
- test/leaflet/layers.test.js
|
|
931
936
|
- vite.config.ts
|
|
932
937
|
homepage: http://github.com/geoblacklight/geoblacklight
|
|
933
938
|
licenses:
|
data/test/leaflet/layers.test.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { wmsLayer, wmtsLayer } from "../../app/javascript/leaflet/layers";
|
|
2
|
-
import { describe, expect, it } from "vitest";
|
|
3
|
-
|
|
4
|
-
describe("leaflet/layers", () => {
|
|
5
|
-
describe("wmsLayer", () => {
|
|
6
|
-
it("returns a WMS tile layer", () => {
|
|
7
|
-
const url = "http://example.com/wms";
|
|
8
|
-
const layerId = "layerId";
|
|
9
|
-
const opacity = 0.5;
|
|
10
|
-
const detectRetina = true;
|
|
11
|
-
const layer = wmsLayer(url, { layerId, opacity, detectRetina });
|
|
12
|
-
expect(layer.options.layers).toEqual(layerId);
|
|
13
|
-
expect(layer.options.opacity).toEqual(opacity);
|
|
14
|
-
expect(layer.options.detectRetina).toEqual(detectRetina);
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
});
|