From 18cc87b843226cee20521ead6f028cadfee58350 Mon Sep 17 00:00:00 2001 From: Charlie Morris Date: Tue, 16 Oct 2018 11:38:55 -0400 Subject: [PATCH] fixes #96 I had to update cdmo/blacklight-marc in order to address this deprecation issue. There is an existing PR on the blacklight-marc repo for this issue. --- Gemfile | 2 +- Gemfile.lock | 13 +++++++------ app/controllers/catalog_controller.rb | 20 +++++++++++++++++++- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 54f04896..1b99a016 100644 --- a/Gemfile +++ b/Gemfile @@ -20,7 +20,7 @@ gem 'rsolr', '>= 1.0' gem 'webpacker', '~> 3.5' gem 'blacklight', '>= 7.0.0.rc1', github: 'projectblacklight/blacklight' -gem 'blacklight-marc', github: 'cdmo/blacklight-marc' +gem 'blacklight-marc', github: 'cdmo/blacklight-marc', ref: 'd3b36e69ab' group :development do gem 'foreman', '~> 0.63.0' diff --git a/Gemfile.lock b/Gemfile.lock index b970db12..7e8844ba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,8 @@ GIT GIT remote: https://github.com/cdmo/blacklight-marc.git - revision: 4d8807c728ecf601fa15eea04c19759c60c95e9f + revision: d3b36e69ab0199bc73efb7f83969fde1f6a3a838 + ref: d3b36e69ab specs: blacklight-marc (7.0.0.alpha) blacklight (> 7.0.0.a, < 8.a) @@ -23,7 +24,7 @@ GIT GIT remote: https://github.com/projectblacklight/blacklight.git - revision: dabb2e75e9ef991b0d0d34b743c4949fcb4d1254 + revision: bc8a8b8235e293187eb2adff7ec172cc79f9361f specs: blacklight (7.0.0.rc1) deprecation @@ -31,7 +32,7 @@ GIT jbuilder (~> 2.7) kaminari (>= 0.15) nokogiri (~> 1.6) - rails (~> 5.0) + rails (~> 5.1) GEM remote: https://rubygems.org/ @@ -146,7 +147,7 @@ GEM http-cookie (1.0.3) domain_name (~> 0.5) httpclient (2.8.3) - i18n (1.1.0) + i18n (1.1.1) concurrent-ruby (~> 1.0) jbuilder (2.7.0) activesupport (>= 4.2.0) @@ -176,7 +177,7 @@ GEM loofah (2.2.2) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.0) + mail (2.7.1) mini_mime (>= 0.1.1) marc (1.0.2) scrub_rb (>= 1.0.1, < 2) @@ -204,7 +205,7 @@ GEM rubocop-rspec (~> 1.22, <= 1.22.2) scss_lint (~> 0.55) nio4r (2.3.1) - nokogiri (1.8.4) + nokogiri (1.8.5) mini_portile2 (~> 2.3.0) orm_adapter (0.5.0) parallel (1.12.1) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index cb9f372d..78cb1450 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -2,10 +2,28 @@ class CatalogController < ApplicationController include Blacklight::Catalog - include Blacklight::DefaultComponentConfiguration include Blacklight::Marc::Catalog configure_blacklight do |config| + config.add_results_document_tool(:bookmark, partial: 'bookmark_control', if: :render_bookmarks_control?) + + config.add_results_collection_tool(:sort_widget) + config.add_results_collection_tool(:per_page_widget) + config.add_results_collection_tool(:view_type_group) + + config.add_show_tools_partial(:bookmark, partial: 'bookmark_control', if: :render_bookmarks_control?) + config.add_show_tools_partial(:email, callback: :email_action, validator: :validate_email_params) + config.add_show_tools_partial(:sms, if: :render_sms_action?, callback: :sms_action, validator: :validate_sms_params) + config.add_show_tools_partial(:citation) + + config.add_nav_action(:bookmark, partial: 'blacklight/nav/bookmark', if: :render_bookmarks_control?) + config.add_nav_action(:search_history, partial: 'blacklight/nav/search_history') + + # From blacklight-marc + config.add_show_tools_partial(:librarian_view, if: :render_librarian_view_control?, define_method: false) + config.add_show_tools_partial(:refworks, if: :render_refworks_action?, modal: false) + config.add_show_tools_partial(:endnote, if: :render_endnote_action?, modal: false, path: :single_endnote_catalog_path, define_method: false) + ## Class for sending and receiving requests from a search index # config.repository_class = Blacklight::Solr::Repository #