geoblacklight 5.0.0.pre.alpha.11 → 5.0.1
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/build-demo-app.yml +7 -4
- data/.github/workflows/ruby.yml +12 -15
- data/Rakefile +9 -1
- data/app/assets/stylesheets/geoblacklight/modules/_base.scss +0 -1
- data/app/assets/stylesheets/geoblacklight/modules/geosearch.scss +0 -6
- data/app/assets/stylesheets/geoblacklight/modules/results.scss +4 -0
- data/app/components/geoblacklight/static_map_component.rb +3 -1
- data/app/javascript/geoblacklight/controllers/leaflet_viewer_controller.js +6 -3
- data/app/javascript/geoblacklight/controllers/openlayers_viewer_controller.js +6 -0
- data/app/javascript/geoblacklight/leaflet/controls/layer_opacity.js +1 -1
- data/app/javascript/geoblacklight/leaflet/controls/sleep.js +98 -0
- data/app/javascript/geoblacklight/openlayers/inspection.js +44 -0
- data/app/models/concerns/geoblacklight/solr_document/inspection.rb +1 -1
- data/geoblacklight.gemspec +2 -1
- data/lib/generators/geoblacklight/assets/importmap_generator.rb +0 -5
- data/lib/generators/geoblacklight/assets/vite_generator.rb +23 -21
- data/lib/generators/geoblacklight/templates/base.html.erb +4 -7
- data/lib/generators/geoblacklight/templates/settings.yml +8 -0
- data/lib/geoblacklight/version.rb +1 -1
- data/package.json +3 -3
- data/spec/features/layer_inspection_spec.rb +9 -0
- data/spec/features/relations_spec.rb +1 -1
- data/spec/fixtures/solr_documents/b1g_wabash_child_15.json +27 -33
- data/spec/fixtures/solr_documents/b1g_wabash_child_16.json +28 -36
- data/spec/fixtures/solr_documents/b1g_wabash_child_17.json +27 -33
- data/spec/fixtures/solr_documents/b1g_wabash_child_18.json +27 -33
- data/spec/fixtures/solr_documents/b1g_wabash_parent.json +25 -28
- data/spec/fixtures/solr_documents/esri-image-map-layer.json +25 -26
- data/spec/spec_helper.rb +1 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -10
- data/template.rb +9 -2
- metadata +8 -8
- data/app/assets/stylesheets/geoblacklight/modules/facets.scss +0 -5
- data/lib/generators/geoblacklight/templates/package.json +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b43c78b979a0af3b5429327478ffa766a52566d6f04594ebd6ae62bd30611d3
|
4
|
+
data.tar.gz: 9741a9cc0f6a693f1f1502dc22f718f855cdb6bae45920fcbf915d78f532857c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6f1683e70a2f760a3582315d48c4910af9746aa540165fdedbbd2093e22a89081fb95f37ab3fb8af978e96997b7351dddf24609c001db52a3757f37402d3d73
|
7
|
+
data.tar.gz: 9d1e1e83ffcc5fb48a5e112b55d47314b6d59b01304bdb601ab92a2230634df58460308d18fe8abc25104ee3e396c915e2ec8ec8fd2b43b082a5265cbcc75731
|
@@ -29,13 +29,16 @@ jobs:
|
|
29
29
|
- name: Install dependencies
|
30
30
|
run: bundle install
|
31
31
|
env:
|
32
|
-
RAILS_VERSION: 7.1
|
32
|
+
RAILS_VERSION: "7.2.2.1"
|
33
33
|
|
34
|
-
- name:
|
35
|
-
run:
|
34
|
+
- name: Build frontend package
|
35
|
+
run: |
|
36
|
+
yarn install
|
37
|
+
yarn build
|
38
|
+
yarn link
|
36
39
|
|
37
40
|
- name: Build
|
38
|
-
run: BRANCH=${{ env.BRANCH }} rails new build -m template.rb -a propshaft
|
41
|
+
run: BRANCH=${{ env.BRANCH }} rails new build -m template.rb -a propshaft --css bootstrap --js rollup
|
39
42
|
|
40
43
|
- name: Cleanup
|
41
44
|
run: rm -rf build/node_modules build/Gemfile.lock build/yarn.lock build/tmp
|
data/.github/workflows/ruby.yml
CHANGED
@@ -30,24 +30,17 @@ jobs:
|
|
30
30
|
ruby-version: 3.2
|
31
31
|
- name: Install json schema validator
|
32
32
|
run: gem install json_schemer
|
33
|
-
- name: Run json_schemer against
|
33
|
+
- name: Run json_schemer against aardvark fixtures
|
34
34
|
run: find spec/fixtures/solr_documents -type f -name "*.json" | xargs json_schemer schema/geoblacklight-schema-aardvark.json
|
35
35
|
|
36
36
|
test:
|
37
37
|
runs-on: ubuntu-latest
|
38
38
|
strategy:
|
39
39
|
matrix:
|
40
|
-
ruby_version: ["3.2", "3.3"]
|
41
|
-
rails_version: ["7.
|
40
|
+
ruby_version: ["3.2", "3.3", "3.4"]
|
41
|
+
rails_version: ["7.1.5.1", "7.2.2.1", "8.0.1"]
|
42
42
|
asset_pipeline: ["vite"]
|
43
|
-
additional_engine_cart_rails_options: [""]
|
44
|
-
# this build has failing tests that aren't easy to replicate locally
|
45
|
-
# https://github.com/geoblacklight/geoblacklight/issues/1585
|
46
|
-
# include:
|
47
|
-
# - ruby_version: "3.2"
|
48
|
-
# rails_version: "7.1.3.4"
|
49
|
-
# additional_engine_cart_rails_options: "--css bootstrap"
|
50
|
-
# asset_pipeline: "importmap"
|
43
|
+
additional_engine_cart_rails_options: ["--js rollup"]
|
51
44
|
|
52
45
|
name: test ruby ${{ matrix.ruby_version }} / rails ${{ matrix.rails_version }} / ${{ matrix.asset_pipeline }}
|
53
46
|
steps:
|
@@ -56,18 +49,22 @@ jobs:
|
|
56
49
|
uses: ruby/setup-ruby@v1
|
57
50
|
with:
|
58
51
|
ruby-version: ${{ matrix.ruby_version }}
|
59
|
-
- name: Install dependencies
|
52
|
+
- name: Install Ruby dependencies
|
60
53
|
run: bundle install
|
61
54
|
env:
|
62
55
|
RAILS_VERSION: ${{ matrix.rails_version }}
|
63
|
-
- name:
|
64
|
-
|
56
|
+
- name: Build and link frontend package, if using vite
|
57
|
+
if: matrix.asset_pipeline == 'vite'
|
58
|
+
run: |
|
59
|
+
yarn install
|
60
|
+
yarn build
|
61
|
+
yarn link
|
65
62
|
- name: Run tests
|
66
63
|
run: bundle exec rake ci
|
67
64
|
env:
|
68
65
|
RAILS_VERSION: ${{ matrix.rails_version }}
|
69
66
|
ASSET_PIPELINE: ${{ matrix.asset_pipeline }}
|
70
|
-
ENGINE_CART_RAILS_OPTIONS: "--skip-
|
67
|
+
ENGINE_CART_RAILS_OPTIONS: "--skip-docker --skip-action-cable --skip-rubocop --skip-brakeman --skip-kamal --skip-solid -a propshaft --css bootstrap ${{ matrix.additional_engine_cart_rails_options }}"
|
71
68
|
SOLR_URL: http://solr:SolrRocks@localhost:8983/solr/blacklight-core
|
72
69
|
- name: Upload coverage artifacts
|
73
70
|
uses: actions/upload-artifact@v4
|
data/Rakefile
CHANGED
@@ -14,7 +14,15 @@ require "open3"
|
|
14
14
|
|
15
15
|
# Ensure the app generates with Propshaft; sprockets is no longer supported
|
16
16
|
# https://github.com/geoblacklight/geoblacklight/issues/1265
|
17
|
-
ENV["ENGINE_CART_RAILS_OPTIONS"] = ENV["ENGINE_CART_RAILS_OPTIONS"].to_s + " -a propshaft"
|
17
|
+
ENV["ENGINE_CART_RAILS_OPTIONS"] = ENV["ENGINE_CART_RAILS_OPTIONS"].to_s + " -a propshaft --css bootstrap"
|
18
|
+
|
19
|
+
# Ensure the app generates with the correct javascript pipeline; rollup
|
20
|
+
# (for Vite) is the default
|
21
|
+
ENV["ENGINE_CART_RAILS_OPTIONS"] += if ENV["ASSET_PIPELINE"] == "importmap"
|
22
|
+
" --js importmap"
|
23
|
+
else
|
24
|
+
" --js rollup"
|
25
|
+
end
|
18
26
|
|
19
27
|
def system_with_error_handling(*args)
|
20
28
|
Open3.popen3(*args) do |_stdin, stdout, stderr, thread|
|
@@ -18,6 +18,8 @@ module Geoblacklight
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def viewer_tag
|
21
|
+
leaflet_options = helpers.leaflet_options.deep_dup
|
22
|
+
leaflet_options.SLEEP.SLEEP = false
|
21
23
|
tag.div(nil,
|
22
24
|
id: "static-map",
|
23
25
|
aria: {
|
@@ -28,7 +30,7 @@ module Geoblacklight
|
|
28
30
|
"leaflet-viewer-basemap-value" => helpers.geoblacklight_basemap,
|
29
31
|
"leaflet-viewer-page-value" => "STATIC_MAP",
|
30
32
|
"leaflet-viewer-map-geom-value" => @document.geometry.geojson,
|
31
|
-
"leaflet-viewer-options-value" =>
|
33
|
+
"leaflet-viewer-options-value" => leaflet_options,
|
32
34
|
"leaflet-viewer-draw-initial-bounds-value" => true
|
33
35
|
})
|
34
36
|
end
|
@@ -6,6 +6,7 @@ import { Controller } from "@hotwired/stimulus";
|
|
6
6
|
import basemaps from "geoblacklight/leaflet/basemaps";
|
7
7
|
import LayerOpacityControl from "geoblacklight/leaflet/controls/layer_opacity";
|
8
8
|
import GeoSearchControl from "geoblacklight/leaflet/controls/geosearch";
|
9
|
+
import Sleep from "geoblacklight/leaflet/controls/sleep";
|
9
10
|
import { wmsInspection,
|
10
11
|
tiledMapLayerInspection,
|
11
12
|
featureLayerInspection,
|
@@ -38,8 +39,7 @@ export default class LeafletViewerController extends Controller {
|
|
38
39
|
};
|
39
40
|
|
40
41
|
connect() {
|
41
|
-
//
|
42
|
-
// TODO: figure out why vite @leaftlet_images alias is not working.
|
42
|
+
// Use leaflet icon images from CDN
|
43
43
|
Icon.Default.imagePath = "https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/";
|
44
44
|
|
45
45
|
// Set up layers
|
@@ -65,7 +65,10 @@ export default class LeafletViewerController extends Controller {
|
|
65
65
|
if (this.map) return;
|
66
66
|
|
67
67
|
// Set up the map and fit to bounds
|
68
|
-
|
68
|
+
const sleepSettings = this.optionsValue.SLEEP || { 'SLEEP' : false }
|
69
|
+
this.map = map(this.element, sleepSettings);
|
70
|
+
if (sleepSettings.SLEEP) this.map.addHandler('SLEEP', Sleep);
|
71
|
+
|
69
72
|
this.map.addLayer(this.basemap);
|
70
73
|
this.map.addLayer(this.overlay);
|
71
74
|
this.fitBounds(this.bounds);
|
@@ -6,6 +6,7 @@ import { FullScreen, defaults as defaultControls } from "ol/control";
|
|
6
6
|
import { pmTilesLayer, cogLayer } from "geoblacklight/openlayers/layers";
|
7
7
|
import basemaps from "geoblacklight/openlayers/basemaps";
|
8
8
|
import { Controller } from "@hotwired/stimulus";
|
9
|
+
import { pmTilesInspection } from "geoblacklight/openlayers/inspection";
|
9
10
|
|
10
11
|
export default class OpenlayersViewerController extends Controller {
|
11
12
|
static values = {
|
@@ -33,6 +34,11 @@ export default class OpenlayersViewerController extends Controller {
|
|
33
34
|
layers: [this.basemap, this.overlay],
|
34
35
|
});
|
35
36
|
this.map.getView().fit(this.extent, this.map.getSize());
|
37
|
+
this.addInspection()
|
38
|
+
}
|
39
|
+
|
40
|
+
addInspection() {
|
41
|
+
if (this.protocolValue == "Pmtiles") return pmTilesInspection(this.map);
|
36
42
|
}
|
37
43
|
|
38
44
|
async getBounds() {
|
@@ -0,0 +1,98 @@
|
|
1
|
+
import { DomUtil, DomEvent, Handler } from "leaflet";
|
2
|
+
|
3
|
+
export default class Sleep extends Handler {
|
4
|
+
addHooks() {
|
5
|
+
const container = DomUtil.create("div", "wake-overlay w-100 h-100 position-absolute align-items-center justify-content-center", this._map._container);
|
6
|
+
const button = DomUtil.create("button", "btn btn-primary wake-button", container)
|
7
|
+
|
8
|
+
button.innerHTML = this._map.options.MESSAGE;
|
9
|
+
button.setAttribute("tabindex", "0");
|
10
|
+
button.style.zIndex = 2000;
|
11
|
+
container.style.zIndex = 1999;
|
12
|
+
const background = String(this._map.options.BACKGROUND);
|
13
|
+
container.style.background = background;
|
14
|
+
this.container = container;
|
15
|
+
if (this._map.options.MARGIN_DISTANCE) {
|
16
|
+
this.updateBasedOnSize()
|
17
|
+
} else {
|
18
|
+
this.sleepMap();
|
19
|
+
}
|
20
|
+
this.setListeners()
|
21
|
+
}
|
22
|
+
|
23
|
+
sleepMap() {
|
24
|
+
this._map.dragging.disable();
|
25
|
+
this._map.touchZoom.disable();
|
26
|
+
this._map.scrollWheelZoom.disable();
|
27
|
+
this._map.doubleClickZoom.disable();
|
28
|
+
this._map.boxZoom.disable();
|
29
|
+
this._map.keyboard.disable();
|
30
|
+
this.container.classList.add('d-flex');
|
31
|
+
this.container.classList.remove('d-none');
|
32
|
+
}
|
33
|
+
|
34
|
+
wakeMap() {
|
35
|
+
this._map.dragging.enable();
|
36
|
+
this._map.touchZoom.enable();
|
37
|
+
this._map.scrollWheelZoom.enable();
|
38
|
+
this._map.doubleClickZoom.enable();
|
39
|
+
this._map.boxZoom.enable();
|
40
|
+
this._map.keyboard.enable();
|
41
|
+
this.container.classList.remove('d-flex');
|
42
|
+
this.container.classList.add('d-none');
|
43
|
+
}
|
44
|
+
|
45
|
+
updateBasedOnSize() {
|
46
|
+
const rect = this._map._container.getBoundingClientRect();
|
47
|
+
// sometimes the left/right side has larger margin, so we take an average
|
48
|
+
const calculation = ((window.innerWidth - rect.right) + rect.left) / 2;
|
49
|
+
if (calculation < this._map.options.MARGIN_DISTANCE) {
|
50
|
+
this.sleepMap();
|
51
|
+
} else {
|
52
|
+
this.wakeMap();
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
setListeners() {
|
57
|
+
const _this = this;
|
58
|
+
let timer;
|
59
|
+
let sleeptimer;
|
60
|
+
|
61
|
+
if (_this._map.options.MARGIN_DISTANCE){
|
62
|
+
window.addEventListener("resize", (event) => {
|
63
|
+
_this.updateBasedOnSize();
|
64
|
+
})
|
65
|
+
}
|
66
|
+
|
67
|
+
DomEvent.on(_this.container, "click", (e) => {
|
68
|
+
_this.wakeMap()
|
69
|
+
});
|
70
|
+
|
71
|
+
DomEvent.on(_this.container, "focus", (e) => {
|
72
|
+
_this.wakeMap()
|
73
|
+
});
|
74
|
+
|
75
|
+
if (this._map.options.HOVERTOWAKE) {
|
76
|
+
DomEvent.on(this._map._container, "mouseenter", (e) => {
|
77
|
+
clearTimeout(sleeptimer);
|
78
|
+
|
79
|
+
timer = setTimeout(function() {
|
80
|
+
_this.wakeMap()
|
81
|
+
}, _this._map.options.WAKETIME);
|
82
|
+
|
83
|
+
});
|
84
|
+
|
85
|
+
DomEvent.on(this._map._container, "mouseleave", (e) => {
|
86
|
+
clearTimeout(timer);
|
87
|
+
|
88
|
+
sleeptimer = setTimeout(function() {
|
89
|
+
_this.sleepMap()
|
90
|
+
}, _this._map.options.SLEEPTIME);
|
91
|
+
});
|
92
|
+
}
|
93
|
+
|
94
|
+
DomEvent.on(this.container, "touchstart", (e) => {
|
95
|
+
_this.wakeMap()
|
96
|
+
});
|
97
|
+
}
|
98
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { linkify } from "geoblacklight/leaflet/utils";
|
2
|
+
|
3
|
+
export const pmTilesInspection = (map) => {
|
4
|
+
// add crosshair class for map items
|
5
|
+
map.on('pointermove', function(e){
|
6
|
+
var pixel = map.getEventPixel(e.originalEvent);
|
7
|
+
var hit = map.hasFeatureAtPixel(pixel);
|
8
|
+
map.getViewport().style.cursor = hit ? 'crosshair' : '';
|
9
|
+
});
|
10
|
+
|
11
|
+
map.on('click', (event) => {
|
12
|
+
const spinner = document.createElement("tbody");
|
13
|
+
spinner.className = "attribute-table-body";
|
14
|
+
spinner.innerHTML =
|
15
|
+
'<tr><td colspan="2"><div class="spinner-border" role="status"><span class="visually-hidden">Inspecting</span></div></td></tr>';
|
16
|
+
document.querySelector(".attribute-table-body").replaceWith(spinner);
|
17
|
+
|
18
|
+
const features = map.getFeaturesAtPixel(event.pixel);
|
19
|
+
if (features.length == 0) {
|
20
|
+
document.querySelector(".attribute-table-body").innerHTML =
|
21
|
+
'<tr><td colspan="2">Could not find that feature</td></tr>';
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
|
25
|
+
const properties = features[0].getProperties();
|
26
|
+
populateAttributeTable(properties);
|
27
|
+
});
|
28
|
+
}
|
29
|
+
|
30
|
+
const populateAttributeTable = (properties) => {
|
31
|
+
let html = '<tbody class="attribute-table-body">';
|
32
|
+
|
33
|
+
// Step through properties and append to table
|
34
|
+
Object.keys(properties).forEach((property) => {
|
35
|
+
html += `<tr><td>${property}</td>
|
36
|
+
<td>${linkify(properties[property])}</td></tr>`;
|
37
|
+
});
|
38
|
+
html += "</tbody>";
|
39
|
+
|
40
|
+
const tableBody = document.querySelector(".attribute-table-body");
|
41
|
+
if (tableBody) {
|
42
|
+
tableBody.outerHTML = html; // Replace existing table body with new content
|
43
|
+
}
|
44
|
+
}
|
@@ -9,7 +9,7 @@ module Geoblacklight
|
|
9
9
|
# Returns boolean about whether document viewer protocol is inspectable
|
10
10
|
# @return [Boolean]
|
11
11
|
def inspectable?
|
12
|
-
%w[wms feature_layer dynamic_map_layer tiled_map_layer]
|
12
|
+
%w[wms feature_layer dynamic_map_layer tiled_map_layer pmtiles]
|
13
13
|
.include? viewer_protocol
|
14
14
|
end
|
15
15
|
end
|
data/geoblacklight.gemspec
CHANGED
@@ -15,9 +15,10 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.files = `git ls-files -z`.split(%(\x0))
|
16
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
17
|
spec.require_paths = ["lib"]
|
18
|
+
spec.required_ruby_version = ">= 3.2.0"
|
18
19
|
spec.required_rubygems_version = ">= 2.5.2"
|
19
20
|
|
20
|
-
spec.add_dependency "rails", ">= 6.1", "<
|
21
|
+
spec.add_dependency "rails", ">= 6.1", "< 9"
|
21
22
|
spec.add_dependency "blacklight", "~> 8.0"
|
22
23
|
spec.add_dependency "config"
|
23
24
|
spec.add_dependency "faraday", "~> 2.0"
|
@@ -27,11 +27,6 @@ module Geoblacklight
|
|
27
27
|
run "yarn link @geoblacklight/frontend" if options[:test]
|
28
28
|
end
|
29
29
|
|
30
|
-
# Workaround for https://github.com/projectblacklight/blacklight/pull/3285
|
31
|
-
def update_blacklight_frontend
|
32
|
-
run "yarn add blacklight-frontend@8.3"
|
33
|
-
end
|
34
|
-
|
35
30
|
# Add the customization overrides and insert before bootstrap import
|
36
31
|
def add_customizations
|
37
32
|
copy_file "assets/_customizations.scss", "app/assets/stylesheets/_customizations.scss"
|
@@ -21,7 +21,7 @@ module Geoblacklight
|
|
21
21
|
DESCRIPTION
|
22
22
|
|
23
23
|
# Install Vite
|
24
|
-
def
|
24
|
+
def install_vite_rails
|
25
25
|
gem "vite_rails", "~> 3.0"
|
26
26
|
run "bundle install"
|
27
27
|
end
|
@@ -37,33 +37,16 @@ module Geoblacklight
|
|
37
37
|
copy_file "vite.config.ts", "vite.config.ts"
|
38
38
|
end
|
39
39
|
|
40
|
-
#
|
41
|
-
def
|
42
|
-
copy_file "package.json", "package.json"
|
43
|
-
run "yarn install"
|
44
|
-
end
|
45
|
-
|
46
|
-
# This will write its own package.json if one doesn't exist, causing a
|
47
|
-
# conflict, so it needs to happen after we copy ours
|
48
|
-
def bundle_install
|
40
|
+
# Run the vite install generator (create binstubs, etc.)
|
41
|
+
def setup_vite
|
49
42
|
run "bundle exec vite install"
|
50
43
|
end
|
51
44
|
|
52
45
|
# Pick a version of the frontend asset package and install it.
|
53
46
|
def add_frontend
|
54
|
-
# If in local development or CI, install the version we made linkable in
|
55
|
-
# the test app generator. This will make it so changes made in the outer
|
56
|
-
# directory are picked up automatically, like a symlink. Note that this
|
57
|
-
# does NOT install the dependencies of the package, so we have to make
|
58
|
-
# sure to install those separately. See:
|
59
|
-
# https://classic.yarnpkg.com/lang/en/docs/cli/link/
|
60
|
-
# https://github.com/yarnpkg/yarn/issues/2914
|
61
|
-
if options[:test]
|
62
|
-
run "yarn link @geoblacklight/frontend"
|
63
|
-
|
64
47
|
# If a branch was specified (e.g. you are running a template.rb build
|
65
48
|
# against a test branch), use the latest version available on npm
|
66
|
-
|
49
|
+
if ENV["BRANCH"]
|
67
50
|
run "yarn add @geoblacklight/frontend@latest"
|
68
51
|
|
69
52
|
# Otherwise, pick the version from npm that matches our Geoblacklight
|
@@ -71,6 +54,25 @@ module Geoblacklight
|
|
71
54
|
else
|
72
55
|
run "yarn add @geoblacklight/frontend@#{Geoblacklight::VERSION}"
|
73
56
|
end
|
57
|
+
|
58
|
+
# If in local development or CI, also create a link. This will make it so
|
59
|
+
# changes made in the outer directory are picked up automatically.
|
60
|
+
# `yarn link` has to have already been run in the outer directory first.
|
61
|
+
run "yarn link @geoblacklight/frontend" if options[:test]
|
62
|
+
end
|
63
|
+
|
64
|
+
# The vite_rails gem doesn't currently install the vite-plugin-rails
|
65
|
+
# node package, so we need to do that manually.
|
66
|
+
def install_dev_dependencies
|
67
|
+
run "yarn add --dev vite-plugin-rails"
|
68
|
+
end
|
69
|
+
|
70
|
+
# Remove generated npm scripts from rollup and replace with our own.
|
71
|
+
# Adds a shortcut so that 'yarn build' runs our vite pipeline
|
72
|
+
# No easy way to do this with yarn, so we use `npm pkg`...
|
73
|
+
def setup_npm_scripts
|
74
|
+
run "npm pkg delete scripts"
|
75
|
+
run "npm pkg set scripts.build=\"vite build\""
|
74
76
|
end
|
75
77
|
|
76
78
|
# Add our own stylesheets that reference the versions from npm
|
@@ -24,13 +24,10 @@
|
|
24
24
|
<%= content_for(:head) %>
|
25
25
|
</head>
|
26
26
|
<body class="<%= render_body_class %>">
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
<%= content_for(:skip_links) %>
|
32
|
-
</div>
|
33
|
-
</nav>
|
27
|
+
<%= render blacklight_config.skip_link_component.new do %>
|
28
|
+
<%= content_for(:skip_links) %>
|
29
|
+
<% end %>
|
30
|
+
|
34
31
|
<%= render partial: 'shared/header_navbar' %>
|
35
32
|
|
36
33
|
<main id="main-container" class="<%= container_classes %>" role="main" aria-label="<%= t('blacklight.main.aria.main_container') %>">
|
@@ -239,6 +239,14 @@ LEAFLET:
|
|
239
239
|
STATIC_MAP:
|
240
240
|
color: '#3388ff'
|
241
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)'
|
242
250
|
LAYERS:
|
243
251
|
DETECT_RETINA: true
|
244
252
|
INDEX:
|
data/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@geoblacklight/frontend",
|
3
3
|
"type": "module",
|
4
|
-
"version": "5.0.
|
4
|
+
"version": "5.0.1",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"publishConfig": {
|
7
7
|
"access": "public"
|
@@ -23,12 +23,12 @@
|
|
23
23
|
"@hotwired/stimulus": "^3.2.2",
|
24
24
|
"@popperjs/core": "^2.11.8",
|
25
25
|
"@samvera/clover-iiif": "^2.3.2",
|
26
|
-
"blacklight-frontend": "
|
26
|
+
"blacklight-frontend": "8",
|
27
27
|
"bootstrap": "^5.3.3",
|
28
28
|
"esri-leaflet": "^3.0.12",
|
29
29
|
"leaflet": "^1.9.4",
|
30
|
-
"leaflet-fullscreen": "^1.0.2",
|
31
30
|
"leaflet-iiif": "^3.0.0",
|
31
|
+
"leaflet-fullscreen": "^1.0.2",
|
32
32
|
"ol": "8.1.0",
|
33
33
|
"ol-pmtiles": "^0.3.0",
|
34
34
|
"react": "^18.2.0",
|
@@ -9,4 +9,13 @@ feature "Layer inspection", js: true do
|
|
9
9
|
find("#leaflet-viewer").click
|
10
10
|
expect(page).not_to have_css("td.default-text")
|
11
11
|
end
|
12
|
+
|
13
|
+
context "with a pmtiles layer" do
|
14
|
+
scenario "clicking map should trigger inspection" do
|
15
|
+
visit solr_document_path("princeton-t722hd30j")
|
16
|
+
expect(page).to have_css("th", text: "Attribute")
|
17
|
+
find("#openlayers-viewer").click
|
18
|
+
expect(page).not_to have_css("td.default-text")
|
19
|
+
end
|
20
|
+
end
|
12
21
|
end
|
@@ -34,7 +34,7 @@ feature "Display related documents" do
|
|
34
34
|
|
35
35
|
scenario "Relationship browse link returns relationship-scoped results", js: true do
|
36
36
|
# Wabash Topo parent record
|
37
|
-
visit solr_document_path("
|
37
|
+
visit solr_document_path("eee6150b-ce2f-4837-9d17-ce72a0c1c26f")
|
38
38
|
|
39
39
|
expect(page).to have_content("Has part...")
|
40
40
|
expect(page).to have_link("Browse all 4 records...")
|
@@ -1,9 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
"gbl_mdVersion_s": "Aardvark",
|
4
|
-
"dct_title_s": "Wabash Topo (15): Indiana, 1929",
|
2
|
+
"dct_title_s": "Wabash Aerial (15): Indiana, 1929",
|
5
3
|
"dct_description_sm": [
|
6
|
-
"The
|
4
|
+
"The images represented here are the raster orthophoto set collected by remote sensing of 25 aerial images owned by EAS library. Each aerial image was up to 450MB, 400dpi, grayscale. These images can be viewed and performed in the using either ArcGIS Desktop or QGIS (user choice), referencing against a number of known mapsets like the 2005 Indiana Orthophoto setand USGS DRGs. The geographic coordinate system reference of the maps included are applied in GCS_WGS_1984."
|
7
5
|
],
|
8
6
|
"dct_language_sm": [
|
9
7
|
"eng"
|
@@ -12,51 +10,47 @@
|
|
12
10
|
"Brock & Weymouth Inc.",
|
13
11
|
"United States Engineer Office"
|
14
12
|
],
|
15
|
-
"
|
16
|
-
"Purdue University Libraries"
|
17
|
-
],
|
13
|
+
"schema_provider_s": "Purdue University",
|
18
14
|
"gbl_resourceClass_sm": [
|
19
|
-
"
|
20
|
-
],
|
21
|
-
"dcat_keyword_sm": [
|
22
|
-
"Topography",
|
23
|
-
"Purdue Georeferenced Imagery"
|
15
|
+
"Imagery"
|
24
16
|
],
|
25
17
|
"dcat_theme_sm": [
|
26
|
-
"Imagery
|
18
|
+
"Imagery"
|
19
|
+
],
|
20
|
+
"dcat_keyword_sm": [
|
21
|
+
"Universities",
|
22
|
+
"Campuses"
|
27
23
|
],
|
28
|
-
"dct_issued_s": "2015-10-31",
|
29
24
|
"dct_temporal_sm": [
|
30
25
|
"1929"
|
31
26
|
],
|
32
|
-
"
|
33
|
-
"[1929 TO 1929]"
|
34
|
-
],
|
27
|
+
"dct_issued_s": "2015-11-02",
|
35
28
|
"gbl_indexYear_im": [
|
36
29
|
1929
|
37
30
|
],
|
31
|
+
"gbl_dateRange_drsim": [
|
32
|
+
"[1929 TO 1929]"
|
33
|
+
],
|
38
34
|
"dct_spatial_sm": [
|
39
35
|
"Indiana"
|
40
36
|
],
|
41
|
-
"locn_geometry": "ENVELOPE(-87.
|
42
|
-
"dcat_bbox": "ENVELOPE(-87.
|
43
|
-
"dcat_centroid": "39.
|
37
|
+
"locn_geometry": "ENVELOPE(-87.508,-87.3596,39.5374,39.4628)",
|
38
|
+
"dcat_bbox": "ENVELOPE(-87.508,-87.3596,39.5374,39.4628)",
|
39
|
+
"dcat_centroid": "39.5001,-87.43379999999999",
|
44
40
|
"pcdm_memberOf_sm": [
|
45
|
-
"
|
41
|
+
"dc8c18df-7d64-4ff4-a754-d18d0891187d"
|
46
42
|
],
|
47
|
-
"
|
48
|
-
"
|
43
|
+
"dct_isPartOf_sm": [
|
44
|
+
"09d-01",
|
45
|
+
"eee6150b-ce2f-4837-9d17-ce72a0c1c26f"
|
49
46
|
],
|
47
|
+
"dct_accessRights_s": "Public",
|
50
48
|
"dct_format_s": "GeoTIFF",
|
51
|
-
"dct_references_s": "{\"http://schema.org/downloadUrl\":\"https://mapsweb.lib.purdue.edu/datasets/Wabash1929/
|
49
|
+
"dct_references_s": "{\"http://schema.org/downloadUrl\":\"https://mapsweb.lib.purdue.edu/datasets/Wabash1929/wabashAerial_15.tif.zip\",\"urn:x-esri:serviceType:ArcGIS#ImageMapLayer\":\"https://mapsweb.lib.purdue.edu/arcgis/rest/services/Purdue/wabashaerial/ImageServer\",\"http://schema.org/url\":\"https://mapsweb.lib.purdue.edu/wabashriver/\"}",
|
50
|
+
"id": "757d0f6e-2e04-4ac1-bd28-a5204df46ac1",
|
52
51
|
"dct_identifier_sm": [
|
53
|
-
"
|
52
|
+
"757d0f6e-2e04-4ac1-bd28-a5204df46ac1"
|
54
53
|
],
|
55
|
-
"
|
56
|
-
"
|
57
|
-
|
58
|
-
],
|
59
|
-
"dct_accessRights_s": "Public",
|
60
|
-
"gbl_suppressed_b": true,
|
61
|
-
"gbl_mdModified_dt": "2021-05-07T23:00:10Z"
|
62
|
-
}
|
54
|
+
"gbl_mdModified_dt": "2022-05-31T13:44:06Z",
|
55
|
+
"gbl_mdVersion_s": "Aardvark"
|
56
|
+
}
|