Skip to content

Update for Blacklight 8.12.0 #3532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Analytics
# Display Analytics aggregations as table
class AggregationComponent < ViewComponent::Base
def initialize(data:, exclude_fields: nil)
super
super()
@exclude_fields = exclude_fields
@data = data
end
Expand Down
2 changes: 1 addition & 1 deletion app/components/spotlight/analytics/dashboard_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class DashboardComponent < ViewComponent::Base
attr_reader :current_exhibit, :dates

def initialize(current_exhibit:)
super
super()
@current_exhibit = current_exhibit
@default_start_date = [min_date, 1.year.ago].max
@default_end_date = [max_date, Time.zone.today].min
Expand Down
2 changes: 1 addition & 1 deletion app/components/spotlight/breadcrumbs_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class BreadcrumbsComponent < ViewComponent::Base

def initialize(breadcrumbs: [])
@breadcrumbs = breadcrumbs
super
super()
end

def render?
Expand Down
2 changes: 1 addition & 1 deletion app/components/spotlight/bulk_action_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class BulkActionComponent < ViewComponent::Base
def initialize(bulk_actions:, button_classes: 'btn btn-primary dropdown-toggle')
@bulk_actions = bulk_actions
@button_classes = button_classes
super
super()
end

attr_reader :button_classes, :bulk_actions
Expand Down
2 changes: 1 addition & 1 deletion app/components/spotlight/edit_view_links_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class EditViewLinksComponent < ViewComponent::Base
attr_reader :page, :classes, :delete_link

def initialize(page:, classes: 'page-links', delete_link: false)
super
super()

@page = page
@classes = classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def initialize(path:, active:, label:)
@path = path
@active = active
@label = label
super
super()
end
end
end
2 changes: 1 addition & 1 deletion app/components/spotlight/save_search_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Spotlight
class SaveSearchComponent < ViewComponent::Base
def initialize(button_classes: 'btn btn-outline-primary')
@button_classes = button_classes
super
super()
end

attr_reader :button_classes
Expand Down
2 changes: 1 addition & 1 deletion app/components/spotlight/select_image_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Spotlight
# Component to select section of image
class SelectImageComponent < ViewComponent::Base
def initialize(index_id, block_item_id)
super
super()
@index_id = index_id
@block_item_id = block_item_id
end
Expand Down
2 changes: 1 addition & 1 deletion app/components/spotlight/skip_link_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class SkipLinkComponent < Blacklight::SkipLinkComponent
def initialize(render_search_link: true)
@render_search_link = render_search_link

super
super()
end

def link_to_search
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ class SolrDocumentLegacyEmbedComponent < Blacklight::DocumentComponent
attr_reader :block_context

def initialize(*args, block: nil, **kwargs)
super
super(*args, **kwargs)

@block_context = block
end

def before_render
set_slot(:embed, nil, block_context:) unless embed
with_embed(block_context) unless embed

super
end
Expand Down
2 changes: 1 addition & 1 deletion app/components/spotlight/tag_list_form_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class TagListFormComponent < ViewComponent::Base

def initialize(form:)
@form = form
super
super()
end
end
end
2 changes: 1 addition & 1 deletion app/components/spotlight/tag_selector_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(field_name:, all_tags:, selected_tags_value: nil, form: nil)
@selected_tags_value = selected_tags_value || ''
@all_tags = all_tags&.sort_by { |tag| (tag.respond_to?(:name) ? tag.name : tag).downcase }

super
super()
end

def selected_tags
Expand Down
2 changes: 1 addition & 1 deletion app/components/spotlight/title_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class TitleComponent < ViewComponent::Base
def initialize(title:, subtitle:)
@title = title
@subtitle = subtitle
super
super()
end

def title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Translations
class SubheadingComponent < ViewComponent::Base
def initialize(key:)
@key = key
super
super()
end

def text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class UneditableNonDefaultLanguageComponent < ViewComponent::Base
def initialize(current_exhibit:, current_language:)
@current_exhibit = current_exhibit
@current_language = current_language
super
super()
end

def edit_translations_button
Expand Down
2 changes: 1 addition & 1 deletion app/models/sir_trevor_rails/blocks/browse_block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def with_solr_helper(solr_helper)
end

def search_options(id)
(items.detect { |x| x[:id] == id }) || {}
items.detect { |x| x[:id] == id } || {}
end

def searches
Expand Down
2 changes: 1 addition & 1 deletion app/models/sir_trevor_rails/blocks/featured_pages_block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FeaturedPagesBlock < SirTrevorRails::Block
include Displayable

def page_options(id)
(items.detect { |x| x[:id] == id }) || {}
items.detect { |x| x[:id] == id } || {}
end

def pages
Expand Down
2 changes: 2 additions & 0 deletions app/models/spotlight/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Spotlight
##
# Exhibit resources
class Resource < ActiveRecord::Base
# rubocop:disable Style/RedundantParentheses
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason not to remove the redundant parenthesis?

Copy link
Contributor Author

@taylor-steve taylor-steve Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it changes the behavior (in the way rubocop wants to remove them)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like a bug in rubocop. Have you filed an issue? They are usually responsive to fixing these sorts of things.

class_attribute :indexing_pipeline, default: (Spotlight::Etl::Pipeline.new do |pipeline|
pipeline.sources = [Spotlight::Etl::Sources::IdentitySource]
pipeline.transforms = [
Expand All @@ -15,6 +16,7 @@ class Resource < ActiveRecord::Base
]
pipeline.loaders = [Spotlight::Etl::SolrLoader]
end)
# rubocop:enable Style/RedundantParentheses

extend ActiveModel::Callbacks
define_model_callbacks :index
Expand Down
2 changes: 1 addition & 1 deletion app/views/spotlight/catalog/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="container">
<div class="row">
<%- view_config = blacklight_config.view_config(action_name: :edit) %>
<%= render (view_config.document_component || Blacklight::DocumentComponent).new((Blacklight.version > '8.0' ? :document : :presenter) => document_presenter(@document), classes: ['col-md-8'], component: :div, show: true, actions: false, partials: view_config.partials) do |component| %>
<%= render (view_config.document_component || Blacklight::DocumentComponent).new((Blacklight.version > '8.0' ? :document : :presenter) => document_presenter(@document), classes: ['col-md-8'], component: :div, show: true, partials: view_config.partials) do |component| %>
<% component.with_title(as: 'h1', classes: '', link_to_document: false) %>
<% component.with_body do %>
<% view_config.partials.each do |view_partial| %>
Expand Down