From 02fb21891de4a5ca72040504c156077809bd7e5a Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Wed, 25 Sep 2024 09:17:01 -0700 Subject: [PATCH] Add a default document component for the admin table + blacklight 7. --- app/controllers/spotlight/catalog_controller.rb | 2 ++ app/views/spotlight/catalog/_document_admin_table.html.erb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/spotlight/catalog_controller.rb b/app/controllers/spotlight/catalog_controller.rb index 265d40c5e..3e82a4b4c 100644 --- a/app/controllers/spotlight/catalog_controller.rb +++ b/app/controllers/spotlight/catalog_controller.rb @@ -42,6 +42,8 @@ class CatalogController < ::CatalogController partials: [:index_compact], document_actions: []) end + blacklight_config.view.admin_table.document_component ||= Spotlight::DocumentAdminTableComponent + if Blacklight::VERSION > '8' blacklight_config.track_search_session.storage = false else diff --git a/app/views/spotlight/catalog/_document_admin_table.html.erb b/app/views/spotlight/catalog/_document_admin_table.html.erb index 9bff143e5..6d5e6aeed 100644 --- a/app/views/spotlight/catalog/_document_admin_table.html.erb +++ b/app/views/spotlight/catalog/_document_admin_table.html.erb @@ -11,7 +11,7 @@ <% if Blacklight.version < '8.0' %> - <%= render view_config.document_component.with_collection(documents) %> + <%= render (view_config.document_component || Spotlight::DocumentAdminTableComponent).with_collection(documents) %> <% else %> <% document_presenters = documents.map { |doc| document_presenter(doc) } -%> <%= render view_config.document_component.with_collection(document_presenters) %>