From 465917e0cc42a72904a126b4bced1a011188fd41 Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Wed, 21 Apr 2021 16:46:43 -0700 Subject: [PATCH] Pass the icon key to the render_view_type_group_icon helper --- .../blacklight/response/view_type_button_component.rb | 2 +- lib/blacklight/configuration/view_config.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/blacklight/response/view_type_button_component.rb b/app/components/blacklight/response/view_type_button_component.rb index 0bc7ad0034..5d283e6118 100644 --- a/app/components/blacklight/response/view_type_button_component.rb +++ b/app/components/blacklight/response/view_type_button_component.rb @@ -15,7 +15,7 @@ def initialize(view:, key: nil, selected: false, search_state: nil, classes: 'bt end def icon - @view_context.render_view_type_group_icon(@view) + @view_context.render_view_type_group_icon(@view.icon || @key) end def label diff --git a/lib/blacklight/configuration/view_config.rb b/lib/blacklight/configuration/view_config.rb index 8072222bff..bb2f424f97 100644 --- a/lib/blacklight/configuration/view_config.rb +++ b/lib/blacklight/configuration/view_config.rb @@ -11,6 +11,8 @@ class ViewConfig < Blacklight::OpenStructWithHashAccess # @return [String, Symbol] solr field to use to render a document title # @!attribute display_type_field # @return [String, Symbol] solr field to use to render format-specific partials + # @!attribute icon + # @return [String, Symbol] icon file to use in the view picker # @!attribute document_actions # @return [NestedOpenStructWithHashAccess{Symbol => Blacklight::Configuration::ToolConfig}] 'tools' to render for each document def search_bar_presenter_class