From 97be31bffc172cee8cff6fda72c8688270a80e8a Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Fri, 17 Jan 2025 11:07:48 -0600 Subject: [PATCH] CatalogController: set better check for displaying the data dict show tool --- Gemfile | 2 +- Gemfile.lock | 74 ++++++++++++--------------- app/controllers/catalog_controller.rb | 2 +- 3 files changed, 36 insertions(+), 42 deletions(-) diff --git a/Gemfile b/Gemfile index 52f8850f4..5537c00f2 100644 --- a/Gemfile +++ b/Gemfile @@ -83,7 +83,7 @@ gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript' gem 'geoblacklight', '4.4' # GBL Admin -gem 'geoblacklight_admin', git: "https://github.com/geobtaa/geoblacklight_admin.git", branch: "feature/data-dictionaries" +gem 'geoblacklight_admin', '~> 0.7.0' gem 'git', ">= 1.13" gem "rubyzip", ">= 1.3.0" gem "awesome_print" diff --git a/Gemfile.lock b/Gemfile.lock index 37376f5ad..5ec8ed379 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -41,45 +41,6 @@ GIT rails (>= 5.2, < 8.0) statesman (>= 3.4) -GIT - remote: https://github.com/geobtaa/geoblacklight_admin.git - revision: 664bb7948112a131ca45cc0a4f9f62f9ebb9cbd3 - branch: feature/data-dictionaries - specs: - geoblacklight_admin (0.6.3) - active_storage_validations (~> 1.0) - amazing_print - blacklight (~> 7.33) - blacklight_advanced_search - blacklight_range_limit - bootstrap (~> 4.0) - chosen-rails (~> 1.10) - cocoon (~> 1.2) - config (~> 4.0) - devise (~> 4.7) - devise-bootstrap-views (~> 1.0) - dotenv-rails (~> 2.8) - geoblacklight (~> 4.4) - haml (~> 5.2) - httparty (~> 0.21) - inline_svg (~> 1.9) - jquery-rails (~> 4.4) - kithe (~> 2.0) - mutex_m (~> 0.2.0) - noticed (~> 1.6) - pagy (~> 6.0) - paper_trail (~> 15.0) - pg (~> 1.4) - qa (~> 5.0) - rails (~> 7.0, < 7.3) - ruby-progressbar - simple_form (~> 5.0) - sprockets (~> 3.0) - statesman (~> 12.0) - vite_rails (~> 3.0) - vite_ruby (>= 3.5) - zeitwerk (~> 2.6) - GEM remote: https://rubygems.org/ specs: @@ -405,6 +366,39 @@ GEM rgeo-geojson sprockets-rails (~> 3.0) vite_rails (~> 3.0) + geoblacklight_admin (0.7.0) + active_storage_validations (~> 1.0) + amazing_print + blacklight (~> 7.33) + blacklight_advanced_search + blacklight_range_limit + bootstrap (~> 4.0) + chosen-rails (~> 1.10) + cocoon (~> 1.2) + config (~> 4.0) + devise (~> 4.7) + devise-bootstrap-views (~> 1.0) + dotenv-rails (~> 2.8) + geoblacklight (~> 4.4) + haml (~> 5.2) + httparty (~> 0.21) + inline_svg (~> 1.9) + jquery-rails (~> 4.4) + kithe (~> 2.0) + mutex_m (~> 0.2.0) + noticed (~> 1.6) + pagy (~> 6.0) + paper_trail (~> 15.0) + pg (~> 1.4) + qa (~> 5.0) + rails (~> 7.0, < 7.3) + ruby-progressbar + simple_form (~> 5.0) + sprockets (~> 3.0) + statesman (~> 12.0) + vite_rails (~> 3.0) + vite_ruby (>= 3.5) + zeitwerk (~> 2.6) geocoder (1.8.5) base64 (>= 0.1.0) csv (>= 3.0.0) @@ -884,7 +878,7 @@ DEPENDENCIES foreman geoblacklight (= 4.4) geoblacklight-icons! - geoblacklight_admin! + geoblacklight_admin (~> 0.7.0) geoblacklight_sidecar_images! git (>= 1.13) haml diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index c505fdf20..eec62cd29 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -326,9 +326,9 @@ class CatalogController < ApplicationController config.spell_max = 5 # Custom tools for GeoBlacklight - config.add_show_tools_partial :gbl_admin_data_dictionaries, partial: 'gbl_admin_data_dictionaries' config.add_show_tools_partial :more_details, partial: 'more_details', if: proc { |_context, _config, options| options[:document] && (!options[:document].references.nil? & !options[:document].references.url.nil?)} config.add_show_tools_partial :metadata, if: proc { |_context, _config, options| options[:document] && (Settings.METADATA_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any? } + config.add_show_tools_partial :gbl_admin_data_dictionaries, partial: 'gbl_admin_data_dictionaries', if: proc { |_context, _config, options| options[:document] && options[:document]&.kithe_model&.document_data_dictionaries&.present? } config.add_show_tools_partial :arcgis, partial: 'arcgis', if: proc { |_context, _config, options| options[:document] && options[:document].arcgis_urls.present? } config.add_show_tools_partial :data_dictionary, partial: 'data_dictionary', if: proc { |_context, _config, options| options[:document] && options[:document].data_dictionary_download.present? } config.add_show_tools_partial(:citation, if: proc { |_context, _config, options| options[:document] && (options[:document].resource_class != 'Collections')})