Skip to content
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

Release 7.x backports #2841

Merged
merged 6 commits into from
Oct 11, 2022
Merged
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 @@ -3,7 +3,7 @@
url,
id: @id,
class: @link_classes,
data: {}.merge(({ blacklight_modal: "trigger" } if @action.modal != false) || {}) %>
data: {}.merge(({ blacklight_modal: "trigger", turbo: false } if @action.modal != false) || {}) %>
<% else %>
<%= helpers.render(partial: @action.partial || @action.name.to_s, locals: { document: @document, document_action_config: @action }.merge(@options)) %>
<% end %>
5 changes: 5 additions & 0 deletions app/models/search_builder.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

class SearchBuilder < Blacklight::SearchBuilder
include Blacklight::Solr::SearchBuilderBehavior
end
3 changes: 1 addition & 2 deletions app/views/catalog/_search_results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<% end %>

<% content_for(:container_header) do -%>
<h1 class="sr-only visually-hidden top-content-title"><%= t('blacklight.search.header') %></h1>

<%= render 'search_results_header' %>
<%= render 'constraints' %>
<% end %>

Expand Down
1 change: 1 addition & 0 deletions app/views/catalog/_search_results_header.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1 class="sr-only visually-hidden top-content-title"><%= t('blacklight.search.header') %></h1>
12 changes: 6 additions & 6 deletions lib/blacklight.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ def self.default_configuration
end

def self.connection_config
Blacklight::RuntimeRegistry.connection_config ||= begin
raise "The #{::Rails.env} environment settings were not found in the blacklight.yml config" unless blacklight_yml[::Rails.env]

blacklight_yml[::Rails.env].symbolize_keys
end
Blacklight::RuntimeRegistry.connection_config ||= blacklight_yml[::Rails.env]&.symbolize_keys if blacklight_yml?
end

def self.connection_config=(value)
Expand All @@ -86,7 +82,7 @@ def self.blacklight_yml
require 'yaml'

return @blacklight_yml if @blacklight_yml
unless File.exist?(blacklight_config_file)
unless blacklight_yml?
raise "You are missing a configuration file: #{blacklight_config_file}. Have you run \"rails generate blacklight:install\"?"
end

Expand All @@ -113,6 +109,10 @@ def self.blacklight_yml
@blacklight_yml
end

def self.blacklight_yml?
File.exist?(blacklight_config_file)
end

def self.logger
@logger ||= begin
::Rails.logger if defined? Rails && Rails.respond_to?(:logger)
Expand Down
2 changes: 2 additions & 0 deletions lib/generators/blacklight/templates/catalog_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# frozen_string_literal: true

# Blacklight controller that handles searches and document requests
class <%= controller_name.classify %>Controller < ApplicationController

include Blacklight::Catalog
Expand Down
2 changes: 2 additions & 0 deletions lib/generators/blacklight/templates/solr_document.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# frozen_string_literal: true

# Represent a single document returned from Solr
class <%= model_name.classify %>
include Blacklight::Solr::Document

Expand Down