diff --git a/Gemfile b/Gemfile
index 60435d35c..086ad9dae 100644
--- a/Gemfile
+++ b/Gemfile
@@ -74,7 +74,7 @@ gem "zip_tricks", "5.3.1" # 5.3.1 is required as 5.4+ breaks the download all fe
gem "openapi_parser", "< 1.0"
# Stanford related gems
-gem "blacklight", "~> 7.25"
+gem "blacklight", "~> 8.0"
gem "blacklight-hierarchy", "~> 6.1"
gem "dor-services-client", "~> 12.5"
gem "dor-workflow-client", "~> 4.0"
diff --git a/Gemfile.lock b/Gemfile.lock
index 7f844e5ae..ac4ab014f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -83,16 +83,14 @@ GEM
parser (>= 2.4)
smart_properties
bindex (0.8.1)
- blacklight (7.33.1)
- deprecation
+ blacklight (8.0.0)
globalid
- hashdiff
i18n (>= 1.7.0)
jbuilder (~> 2.7)
kaminari (>= 0.15)
ostruct (>= 0.3.2)
- rails (>= 5.1, < 7.1)
- view_component (~> 2.66)
+ rails (>= 6.1, < 8)
+ view_component (>= 2.66, < 3.1)
blacklight-hierarchy (6.1.2)
blacklight (>= 7.18, < 9)
deprecation
@@ -613,7 +611,7 @@ PLATFORMS
DEPENDENCIES
barby
- blacklight (~> 7.25)
+ blacklight (~> 8.0)
blacklight-hierarchy (~> 6.1)
bootsnap (>= 1.4.2)
byebug
diff --git a/app/components/blacklight_modal_component.html.erb b/app/components/blacklight_modal_component.html.erb
index b2a68645a..007ecc5ff 100644
--- a/app/components/blacklight_modal_component.html.erb
+++ b/app/components/blacklight_modal_component.html.erb
@@ -1,6 +1,6 @@
@@ -9,5 +9,5 @@
diff --git a/app/components/search/sidebar_component.html.erb b/app/components/search/sidebar_component.html.erb
new file mode 100644
index 000000000..e8521501e
--- /dev/null
+++ b/app/components/search/sidebar_component.html.erb
@@ -0,0 +1,6 @@
+<%= render Blacklight::Search::SidebarComponent.new(blacklight_config: blacklight_config,
+ response: response,
+ view_config: view_config) %>
+<% unless helpers.has_search_parameters? || params[:all] %>
+ <%= link_to 'Show more facets', root_path(all: true), class: 'btn btn-primary' %>
+<% end %>
diff --git a/app/components/search/sidebar_component.rb b/app/components/search/sidebar_component.rb
new file mode 100644
index 000000000..fc9b26743
--- /dev/null
+++ b/app/components/search/sidebar_component.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class Search::SidebarComponent < Blacklight::Component
+ def initialize(blacklight_config:, response:, view_config:)
+ @blacklight_config = blacklight_config
+ @response = response
+ @view_config = view_config
+ end
+
+ attr_reader :blacklight_config, :response, :view_config
+end
diff --git a/app/controllers/bulk_jobs_controller.rb b/app/controllers/bulk_jobs_controller.rb
index 53129a9e7..c230073b5 100644
--- a/app/controllers/bulk_jobs_controller.rb
+++ b/app/controllers/bulk_jobs_controller.rb
@@ -60,7 +60,7 @@ def self.local_prefixes
private
def find(id)
- search_service.fetch(id).last
+ search_service.fetch(id)
end
# Given a DRUID, loads any metadata bulk upload information associated with that DRUID into a hash.
diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb
index c19ae8b73..f09b38281 100644
--- a/app/controllers/catalog_controller.rb
+++ b/app/controllers/catalog_controller.rb
@@ -26,6 +26,8 @@ class CatalogController < ApplicationController
# When we test with solr 6 we can have:
# config.document_solr_path = 'get'
config.index.document_presenter_class = ArgoIndexPresenter
+ config.index.sidebar_component = Search::SidebarComponent
+
config.show.document_presenter_class = ArgoShowPresenter
config.index.display_type_field = SolrDocument::FIELD_CONTENT_TYPE
@@ -59,19 +61,18 @@ class CatalogController < ApplicationController
config.add_facet_field "exploded_tag_ssim", label: "Tag", limit: 9999,
component: LazyTagFacetComponent,
unless: ->(controller, _config, _response) { controller.params[:no_tags] }
- config.add_facet_field "objectType_ssim", label: "Object Type", component: true, limit: 10
- config.add_facet_field SolrDocument::FIELD_CONTENT_TYPE, label: "Content Type", component: true, limit: 10
- config.add_facet_field "content_file_mimetypes_ssim", label: "MIME Types", component: true, limit: 10, home: false
- config.add_facet_field "content_file_roles_ssim", label: "File Role", component: true, limit: 10, home: false
- config.add_facet_field "rights_descriptions_ssim", label: "Access Rights", component: true, limit: 1000, sort: "index", home: false
- config.add_facet_field SolrDocument::FIELD_LICENSE, label: "License", component: true, limit: 10, home: false
- config.add_facet_field SolrDocument::FIELD_COLLECTION_TITLE, label: "Collection", component: true, limit: 10, more_limit: 9999, sort: "index"
- config.add_facet_field "nonhydrus_apo_title_ssim", label: "Admin Policy", component: true, limit: 10, more_limit: 9999, sort: "index"
- config.add_facet_field "hydrus_apo_title_ssim", label: "Hydrus Admin Policy", component: true, limit: 10, more_limit: 9999, sort: "index", home: false
- config.add_facet_field SolrDocument::FIELD_CURRENT_VERSION, label: "Version", component: true, limit: 10, home: false
- config.add_facet_field "processing_status_text_ssi", label: "Processing Status", component: true, limit: 10, home: false
+ config.add_facet_field "objectType_ssim", label: "Object Type", limit: 10
+ config.add_facet_field SolrDocument::FIELD_CONTENT_TYPE, label: "Content Type", limit: 10
+ config.add_facet_field "content_file_mimetypes_ssim", label: "MIME Types", limit: 10, home: false
+ config.add_facet_field "content_file_roles_ssim", label: "File Role", limit: 10, home: false
+ config.add_facet_field "rights_descriptions_ssim", label: "Access Rights", limit: 1000, sort: "index", home: false
+ config.add_facet_field SolrDocument::FIELD_LICENSE, label: "License", limit: 10, home: false
+ config.add_facet_field SolrDocument::FIELD_COLLECTION_TITLE, label: "Collection", limit: 10, more_limit: 9999, sort: "index"
+ config.add_facet_field "nonhydrus_apo_title_ssim", label: "Admin Policy", limit: 10, more_limit: 9999, sort: "index"
+ config.add_facet_field "hydrus_apo_title_ssim", label: "Hydrus Admin Policy", limit: 10, more_limit: 9999, sort: "index", home: false
+ config.add_facet_field SolrDocument::FIELD_CURRENT_VERSION, label: "Version", limit: 10, home: false
+ config.add_facet_field "processing_status_text_ssi", label: "Processing Status", limit: 10, home: false
config.add_facet_field "released_to_earthworks",
- component: true,
query: {
week: {
label: "Last week",
@@ -95,7 +96,6 @@ class CatalogController < ApplicationController
}
}
config.add_facet_field "released_to_searchworks",
- component: true,
query: {
week: {
label: "Last week",
@@ -130,8 +130,7 @@ class CatalogController < ApplicationController
limit: 9999,
home: false
- config.add_facet_field "metadata_source_ssi", label: "Metadata Source", home: false,
- component: true
+ config.add_facet_field "metadata_source_ssi", label: "Metadata Source", home: false
if Settings.enabled_features.multivalued_metadata_sources
config.add_facet_field "metadata_source_ssim", label: "Metadata Source (Multi)", home: false,
@@ -142,16 +141,14 @@ class CatalogController < ApplicationController
add_common_date_facet_fields_to_config! config
config.add_facet_field SolrDocument::FIELD_CONSTITUENTS, label: "Virtual Objects", home: false,
- component: true,
query: {
has_constituents: {label: "Virtual Objects", fq: "#{SolrDocument::FIELD_CONSTITUENTS}:*"}
}
# This will help us find records that need to be fixed before we can move to cocina.
- config.add_facet_field "data_quality_ssim", label: "Data Quality", home: false, component: true
+ config.add_facet_field "data_quality_ssim", label: "Data Quality", home: false
config.add_facet_field "empties", label: "Empty Fields", home: false,
- component: true,
query: {
no_source_id: {label: "No Source ID", fq: "-source_id_ssim:*"},
no_rights_characteristics: {label: "No Rights Characteristics", fq: "-rights_characteristics_ssim:*"},
@@ -173,14 +170,14 @@ class CatalogController < ApplicationController
no_use_statement: {label: "No Use & Reproduction Statement", fq: "-#{SolrDocument::FIELD_USE_STATEMENT}:*"}
}
- config.add_facet_field "sw_format_ssim", label: "SW Resource Type", component: true, limit: 10, home: false
- config.add_facet_field "sw_pub_date_facet_ssi", label: "SW Date", component: true, limit: 10, home: false
- config.add_facet_field "topic_ssim", label: "SW Topic", component: true, limit: 10, home: false
- config.add_facet_field "sw_subject_geographic_ssim", label: "SW Region", component: true, limit: 10, home: false
- config.add_facet_field "sw_subject_temporal_ssim", label: "SW Era", component: true, limit: 10, home: false
- config.add_facet_field "sw_genre_ssim", label: "SW Genre", component: true, limit: 10, home: false
- config.add_facet_field "sw_language_ssim", label: "SW Language", component: true, limit: 10, home: false
- config.add_facet_field "mods_typeOfResource_ssim", label: "MODS Resource Type", component: true, limit: 10, home: false
+ config.add_facet_field "sw_format_ssim", label: "SW Resource Type", limit: 10, home: false
+ config.add_facet_field "sw_pub_date_facet_ssi", label: "SW Date", limit: 10, home: false
+ config.add_facet_field "topic_ssim", label: "SW Topic", limit: 10, home: false
+ config.add_facet_field "sw_subject_geographic_ssim", label: "SW Region", limit: 10, home: false
+ config.add_facet_field "sw_subject_temporal_ssim", label: "SW Era", limit: 10, home: false
+ config.add_facet_field "sw_genre_ssim", label: "SW Genre", limit: 10, home: false
+ config.add_facet_field "sw_language_ssim", label: "SW Language", limit: 10, home: false
+ config.add_facet_field "mods_typeOfResource_ssim", label: "MODS Resource Type", limit: 10, home: false
# Adding the facet field allows it to be queried (e.g., from value_helper)
config.add_facet_field "is_governed_by_ssim", if: false
config.add_facet_field "is_member_of_collection_ssim", if: false
@@ -224,7 +221,7 @@ def index
def lazy_tag_facet
(response,) = search_service.search_results
- facet_config = facet_configuration_for_field("exploded_tag_ssim")
+ facet_config = helpers.facet_configuration_for_field("exploded_tag_ssim")
display_facet = response.aggregations[facet_config.field]
@facet_field_presenter = facet_config.presenter.new(facet_config, display_facet, view_context)
render partial: "lazy_tag_facet"
@@ -232,7 +229,7 @@ def lazy_tag_facet
def show
params[:id] = Druid.new(params[:id]).with_namespace
- _deprecated_response, @document = search_service.fetch(params[:id])
+ @document = search_service.fetch(params[:id])
@cocina = Repository.find(params[:id])
flash[:alert] = "Warning: this object cannot currently be represented in the Cocina model." if @cocina.instance_of?(NilModel)
@@ -271,7 +268,7 @@ def limit_facets_on_home_page
end
# do not add the druids_only search param to the blacklight search history (used in bulk actions only)
- def blacklisted_search_session_params
+ def nonpersisted_search_session_params
super << :druids_only
end
diff --git a/app/controllers/manage_releases_controller.rb b/app/controllers/manage_releases_controller.rb
index c0f06f1cd..b0f28bf78 100644
--- a/app/controllers/manage_releases_controller.rb
+++ b/app/controllers/manage_releases_controller.rb
@@ -7,7 +7,7 @@ class ManageReleasesController < ApplicationController
def show
cocina = Repository.find(params[:item_id])
authorize! :update, cocina
- _, @document = search_service.fetch params[:item_id]
+ @document = search_service.fetch params[:item_id]
@bulk_action = BulkAction.new
respond_to do |format|
diff --git a/app/controllers/workflows_controller.rb b/app/controllers/workflows_controller.rb
index 114f26e27..5d55780d0 100644
--- a/app/controllers/workflows_controller.rb
+++ b/app/controllers/workflows_controller.rb
@@ -8,7 +8,7 @@ def show
respond_to do |format|
format.html do
@presenter = build_show_presenter(workflow)
- render "show", layout: !request.xhr?
+ render "show", layout: false
end
format.xml { render xml: }
end
diff --git a/app/forms/apo_form.rb b/app/forms/apo_form.rb
index 33d01e06c..b0cd371f9 100644
--- a/app/forms/apo_form.rb
+++ b/app/forms/apo_form.rb
@@ -71,7 +71,6 @@ def default_collection_objects
@default_collection_objects ||=
@search_service
.fetch(default_collections, rows: default_collections.size)
- .last
.sort_by do |solr_doc|
solr_doc.label.downcase
end
diff --git a/app/javascript/application.js b/app/javascript/application.js
index fa0a8aa99..50a61dd18 100644
--- a/app/javascript/application.js
+++ b/app/javascript/application.js
@@ -4,7 +4,7 @@ import 'jquery'
import bootstrap from "bootstrap/dist/js/bootstrap"
global.bootstrap = bootstrap // Required for Blacklight 7 so it can manage the modals
-import 'blacklight-frontend/app/assets/javascripts/blacklight/blacklight'
+import Blacklight from 'blacklight-frontend/app/assets/javascripts/blacklight/blacklight'
import "./controllers"
import Argo from './argo'
@@ -15,4 +15,4 @@ document.addEventListener("turbo:load", async () => {
// Start argo after free-jqgrid has been loaded
new Argo().initialize()
})
-import '@hotwired/turbo-rails'
+import '@hotwired/turbo-rails'
\ No newline at end of file
diff --git a/app/javascript/argo.js b/app/javascript/argo.js
index 3b456101b..647036791 100644
--- a/app/javascript/argo.js
+++ b/app/javascript/argo.js
@@ -10,13 +10,6 @@ export default class Argo {
this.tagsAutocomplete()
this.projectAutocomplete()
this.report()
- this.blacklight()
- }
-
- // Because blacklight doesn't yet support turbo, we need to manually initialize
- // the features we care about.
- blacklight() {
- Blacklight.activate()
}
report() {
diff --git a/app/javascript/controllers/tokens.js b/app/javascript/controllers/tokens.js
index 6825d152c..b76de0332 100644
--- a/app/javascript/controllers/tokens.js
+++ b/app/javascript/controllers/tokens.js
@@ -1,4 +1,5 @@
import { Controller } from '@hotwired/stimulus'
+import Blacklight from 'blacklight-frontend/app/assets/javascripts/blacklight/blacklight'
export default class extends Controller {
static targets = [ "output", "result", "button" ]
@@ -7,7 +8,7 @@ export default class extends Controller {
fetch(this.data.get("url"), {
method: 'POST',
headers: {
- "X-CSRF-Token": Blacklight.csrfToken(),
+ "X-CSRF-Token": Blacklight.Core.csrfToken(),
}
}).then(response => response.text())
.then(token => {
diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb
index d5fd657e7..b67a699ee 100644
--- a/app/models/solr_document.rb
+++ b/app/models/solr_document.rb
@@ -62,7 +62,7 @@ class SolrDocument
attribute :modified_date, Blacklight::Types::Array, FIELD_LAST_MODIFIED_DATE
attribute :created_date, Blacklight::Types::Date, FIELD_CREATED_DATE
attribute :opened_date, Blacklight::Types::Array, FIELD_LAST_OPENED_DATE
- attribute :preservation_size, Blacklight::Types::String, FIELD_PRESERVATION_SIZE
+ attribute :preservation_size, :value, FIELD_PRESERVATION_SIZE
attribute :released_to, Blacklight::Types::Array, FIELD_RELEASED_TO
attribute :label, Blacklight::Types::String, FIELD_LABEL
diff --git a/app/views/bulk_jobs/_bulk_index_table.html.erb b/app/views/bulk_jobs/_bulk_index_table.html.erb
index c745cbfc0..036976d7a 100644
--- a/app/views/bulk_jobs/_bulk_index_table.html.erb
+++ b/app/views/bulk_jobs/_bulk_index_table.html.erb
@@ -43,7 +43,7 @@
<% end %>
-
+
+
diff --git a/app/views/catalog/_search_sidebar.html.erb b/app/views/catalog/_search_sidebar.html.erb
deleted file mode 100644
index 8d72e1cde..000000000
--- a/app/views/catalog/_search_sidebar.html.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-<%= render 'facets' %>
-
-<% unless has_search_parameters? || params[:all] %>
- <%= link_to 'Show more facets', root_path(all: true), class: 'btn btn-primary' %>
-<% end %>
diff --git a/app/views/catalog/facet.html.erb b/app/views/catalog/facet.html.erb
index 4f41e0e70..f2e531378 100644
--- a/app/views/catalog/facet.html.erb
+++ b/app/views/catalog/facet.html.erb
@@ -1,18 +1,23 @@
-
-
- <%= render BlacklightModalComponent.new do |component| %>
- <% component.header { facet_field_label(@facet.key) } %>
- <% component.body do %>
- <%= render 'facet_index_navigation' if @facet.index_range && @display_facet.index? %>
-
- <%= render_facet_limit(@display_facet, layout: false) %>
+ <%= render Blacklight::System::ModalComponent.new do |component| %>
+ <% component.prefix do %>
+
<% end %>
+
+ <% component.title { facet_field_label(@facet.key) } %>
+
+ <%= render 'facet_index_navigation' if @facet.index_range && @display_facet.index? %>
+
+
+ <%= render Blacklight::FacetComponent.new(display_facet: @display_facet,
+ blacklight_config: blacklight_config,
+ layout: false) %>
+
+
<% component.footer do %>
-