Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to geoblacklight 4.0 #963

Merged
merged 18 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ end

gem 'blacklight', '~> 7.33'
gem 'rsolr' # required for Blacklight
gem "geoblacklight", '~> 3.8'
gem "geoblacklight", '~> 4.3.0'
gem 'faraday', '~> 2.0'
gem "devise"
gem "devise-guests", ">= 0.3.3"
Expand All @@ -83,7 +83,9 @@ gem 'newrelic_rpm'
gem 'twitter-typeahead-rails'
gem 'blacklight_range_limit', '~> 7.0'
gem 'redis', '~> 5.0'
gem 'geo_monitor', '~> 0.7', github: 'geoblacklight/geo_monitor'
# Not compatible with GeoBlacklight 4.x
# https://github.com/geoblacklight/geo_monitor/issues/12
# gem 'geo_monitor', '~> 0.7', github: 'geoblacklight/geo_monitor'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is our plan in general for GeoMonitor once this upgrade is in place? Will we need to work out a way later to use it, or will be table this for good? Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this down below geoblacklight/geo_monitor#12 so I think that answers that question : )

gem 'geo_combine', '>= 0.9' # For OpenGeoMetadata indexing
gem 'sidekiq', '~> 7.0'
gem 'whenever', require: false
Expand Down
85 changes: 64 additions & 21 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
GIT
remote: https://github.com/geoblacklight/geo_monitor.git
revision: 28d61996677292730a9285f5686e4f5a193c8fae
specs:
geo_monitor (0.8.0)
faraday
rails (>= 6.1, < 7.2)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -92,8 +84,10 @@ GEM
execjs (~> 2)
base64 (0.2.0)
bcrypt (3.1.20)
bcrypt_pbkdf (1.1.1)
bcrypt_pbkdf (1.1.1-arm64-darwin)
bcrypt_pbkdf (1.1.1-x86_64-darwin)
bigdecimal (3.1.8)
bindex (0.8.1)
blacklight (7.37.0)
deprecation
Expand All @@ -120,7 +114,7 @@ GEM
bundler-audit (0.9.1)
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
capistrano (3.18.1)
capistrano (3.19.0)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
Expand Down Expand Up @@ -191,9 +185,9 @@ GEM
ed25519
docile (1.4.0)
domain_name (0.6.20240107)
ed25519 (1.3.0)
drb (2.2.1)
dry-cli (1.0.0)
ed25519 (1.3.0)
erubi (1.13.0)
execjs (2.9.1)
factory_bot (6.2.1)
Expand All @@ -210,7 +204,16 @@ GEM
net-http-persistent (~> 4.0)
faraday-retry (2.2.1)
faraday (~> 2.0)
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-aarch64-linux-musl)
ffi (1.17.0-arm-linux-gnu)
ffi (1.17.0-arm-linux-musl)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86-linux-gnu)
ffi (1.17.0-x86-linux-musl)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
ffi (1.17.0-x86_64-linux-musl)
ffi-compiler (1.3.2)
ffi (>= 1.15.5)
rake
Expand All @@ -224,17 +227,19 @@ GEM
rsolr
sanitize
thor
geoblacklight (3.8.0)
blacklight (~> 7.8)
geoblacklight (4.3.0)
blacklight (~> 7.0)
coderay
config
deprecation
faraday (>= 1.0)
geo_combine (~> 0.8)
faraday (~> 2.0)
geo_combine (~> 0.9)
handlebars_assets
mime-types
rails (>= 5.2.4, < 7.1)
rails (>= 6.1, < 7.2)
rgeo-geojson
sprockets-rails (~> 3.0)
vite_rails (~> 3.0)
git (2.1.1)
activesupport (>= 5.0)
addressable (~> 2.8)
Expand Down Expand Up @@ -329,8 +334,18 @@ GEM
net-ssh (7.2.3)
newrelic_rpm (9.11.0)
nio4r (2.7.3)
nokogiri (1.16.6-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.6-arm-linux)
racc (~> 1.4)
nokogiri (1.16.6-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.6-x86-linux)
racc (~> 1.4)
nokogiri (1.16.6-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.6-x86_64-linux)
racc (~> 1.4)
okcomputer (1.18.5)
orm_adapter (0.5.0)
ostruct (0.6.0)
Expand All @@ -347,11 +362,15 @@ GEM
puma (6.4.2)
nio4r (~> 2.0)
racc (1.8.0)
rack (3.0.11)
rack (3.1.4)
rack-attack (6.7.0)
rack (>= 1.0, < 4)
rack-mini-profiler (2.3.4)
rack (>= 1.2.0)
rack-proxy (0.7.7)
rack
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rackup (2.1.0)
Expand Down Expand Up @@ -403,7 +422,7 @@ GEM
actionpack (>= 5.2)
railties (>= 5.2)
retriable (3.1.2)
rexml (3.3.0)
rexml (3.3.1)
strscan
rgeo (3.0.1)
rgeo-geojson (2.1.1)
Expand Down Expand Up @@ -500,7 +519,12 @@ GEM
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
sqlite3 (1.7.3-aarch64-linux)
sqlite3 (1.7.3-arm-linux)
sqlite3 (1.7.3-arm64-darwin)
sqlite3 (1.7.3-x86-linux)
sqlite3 (1.7.3-x86_64-darwin)
sqlite3 (1.7.3-x86_64-linux)
sshkit (1.23.0)
base64
net-scp (>= 1.1.2)
Expand All @@ -509,7 +533,7 @@ GEM
stringio (3.1.1)
strscan (3.1.0)
thor (1.3.1)
tilt (2.3.0)
tilt (2.4.0)
timeout (0.4.1)
twitter-typeahead-rails (0.11.1)
actionpack (>= 3.1)
Expand All @@ -523,6 +547,13 @@ GEM
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
vite_rails (3.0.17)
railties (>= 5.1, < 8)
vite_ruby (~> 3.0, >= 3.2.2)
vite_ruby (3.6.0)
dry-cli (>= 0.7, < 2)
rack-proxy (~> 0.6, >= 0.6.1)
zeitwerk (~> 2.2)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.1)
Expand All @@ -542,7 +573,20 @@ GEM
zeitwerk (2.6.16)

PLATFORMS
arm64-darwin-23
aarch64-linux
aarch64-linux-gnu
aarch64-linux-musl
arm-linux
arm-linux-gnu
arm-linux-musl
arm64-darwin
x86-linux
x86-linux-gnu
x86-linux-musl
x86_64-darwin
x86_64-linux
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
bcrypt_pbkdf (~> 1.1)
Expand All @@ -568,8 +612,7 @@ DEPENDENCIES
factory_bot_rails (~> 6.2.0)
faraday (~> 2.0)
geo_combine (>= 0.9)
geo_monitor (~> 0.7)!
geoblacklight (~> 3.8)
geoblacklight (~> 4.3.0)
honeybadger
http
jbuilder (~> 2.5)
Expand Down
63 changes: 63 additions & 0 deletions app/assets/javascripts/modules/mirador.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Borrowed from:
// https://github.com/sul-dlss/sul-embed/blob/main/app/javascript/src/modules/m3_viewer.js
const setupViewer = function () {
const target = document.getElementById("mirador");
if (target) {
Mirador.viewer({
id: "mirador",
selectedTheme: "sul",
themes: {
sul: {
palette: {
type: "light",
primary: {
main: "#8c1515",
},
secondary: {
main: "#8c1515",
},
shades: {
dark: "#2e2d29",
main: "#ffffff",
light: "#f4f4f4",
},
notification: {
main: "#e98300",
},
},
},
},
windows: [
{
id: "main",
loadedManifest: target.dataset.manifestUrl,
},
],
window: {
allowClose: false,
allowFullscreen: true,
allowMaximize: false,
authNewWindowCenter: "screen",
hideWindowTitle: true,
sidebarPanel: "attribution",
views: [
{ key: "single", behaviors: [null, "individuals"] },
{ key: "book", behaviors: [null, "paged"] },
{ key: "scroll", behaviors: ["continuous"] },
{ key: "gallery" },
],
},
workspace: {
showZoomControls: true,
type: "single",
},
workspaceControlPanel: {
enabled: false,
},
});
}
};

// Load the viewer on page load and Turbolinks page change
document.addEventListener("DOMContentLoaded", setupViewer);
document.addEventListener("turbolinks:load", setupViewer);
1 change: 0 additions & 1 deletion app/assets/stylesheets/geoblacklight.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
@import 'geoblacklight/geoblacklight';
@import 'leaflet-label';
20 changes: 20 additions & 0 deletions app/assets/stylesheets/modules/show.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,23 @@ dd[itemprop='url'] a {
padding-top: 0;
}
}

// Paragraph margins for description field
.blacklight-dct_description_sm p {
margin-bottom: 0.5rem;

&:last-of-type {
margin-bottom: 0;
}
}

// Move the index map legend to make space for "Embedded Content" text
.index-map-legend {
left: unset;
}

// Styles for Mirador viewer (non-stanford IIIF content)
#mirador {
width: 100%;
min-height: 493px;
}
7 changes: 7 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class ApplicationController < ActionController::Base
# Please be sure to impelement current_user and user_session. Blacklight depends on
# these methods in order to perform user specific actions.

before_action :allow_geoblacklight_params

layout :determine_layout if respond_to? :layout

# Prevent CSRF attacks by raising an exception.
Expand All @@ -14,4 +16,9 @@ class ApplicationController < ActionController::Base
def after_sign_out_path_for(_resource_or_scope)
'/Shibboleth.sso/Logout'
end

def allow_geoblacklight_params
# Blacklight::Parameters will pass these to params.permit
blacklight_config.search_state_fields.append(Settings.GBL_PARAMS)
end
end
Loading