Skip to content

Commit

Permalink
Merge pull request #2678 from projectblacklight/7x-backports
Browse files Browse the repository at this point in the history
Release 7.x backports
  • Loading branch information
jcoyne committed Apr 13, 2022
2 parents 8d32422 + 080b22d commit e6c7c72
Show file tree
Hide file tree
Showing 19 changed files with 374 additions and 214 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [2.7, '3.0']
ruby: [2.7, '3.0', 3.1]
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
RAILS_VERSION: 5.2.4.6
ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'

test_rails7_0:
test_rails6_1:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -117,11 +117,11 @@ jobs:
- name: Install dependencies
run: bundle install
env:
RAILS_VERSION: 7.0.0
RAILS_VERSION: 6.1.5
- name: Run tests
run: bundle exec rake ci
env:
RAILS_VERSION: 7.0.0
RAILS_VERSION: 6.1.5
ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-keeps --skip-action-cable --skip-test'
api_test:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion app/components/blacklight/document/citation_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CitationComponent < ::ViewComponent::Base
with_collection_parameter :document

# @param [Blacklight::Document] document
# @param [Hash<String => Symbol>] map of citation format names (suspiciously, i18n keys
# @param [Hash<String => Symbol>] formats map of citation format names (suspiciously, i18n keys
# for them) to document methods that return the formatted citation.
def initialize(document:, formats: DEFAULT_FORMATS)
@document = document
Expand Down
3 changes: 2 additions & 1 deletion app/components/blacklight/document/group_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module Document
class GroupComponent < ::ViewComponent::Base
with_collection_parameter :group

# @param [Blacklight::Document] document
# @param [Blacklight::Solr::Response::Group] group
# @param [Integer] group_limit
def initialize(group:, group_limit: -1)
@group = group
@group_limit = group_limit
Expand Down
1 change: 0 additions & 1 deletion app/components/blacklight/document_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class DocumentComponent < ::ViewComponent::Base
# @param classes [Array, String] additional HTML classes for the root element
# @param component [Symbol, String] HTML tag type to use for the root element
# @param title_component [Symbol, String] HTML tag type to use for the title element
# @param metadata_component [Blacklight::DocumentMetadataComponent]
# @param counter [Number, nil] a pre-computed counter for the position of this document in a search result set
# @param document_counter [Number, nil] alternatively, the document's position in a collection and,
# @param counter_offset [Number] with `document_counter`, the offset of the start of that collection counter to the overall result set
Expand Down
2 changes: 1 addition & 1 deletion app/components/blacklight/hidden_search_state_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Blacklight
# representing a hash passed in using Rails-style request parameters
# for hashes nested with arrays and other hashes.
class HiddenSearchStateComponent < ::ViewComponent::Base
# @param [Hash] hash
# @param [Hash] params
def initialize(params:)
Deprecation.warn(self, "Passing page as a parameter to HiddenSearchStateComponent is deprecated and will not be supported in Blacklight 8") if params.key?(:page)
@params = params.except(:utf8)
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/blacklight/blacklight_helper_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def index_presenter(document)

##
# Override this method if you want to use a differnet presenter for your documents
# @param [Blacklight::Document] optional, here for extension + backwards compatibility only
# @param [Blacklight::Document] document optional, here for extension + backwards compatibility only
def document_presenter_class(document = nil)
Deprecation.silence(Blacklight::BlacklightHelperBehavior) do
case action_name
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/blacklight/catalog_helper_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def render_search_to_page_title_filter(facet, values)
end

# Render an html <title> appropriate string for a set of search parameters
# @param [ActionController::Parameters] params2
# @param [ActionController::Parameters] params
# @return [String]
def render_search_to_page_title(search_state_or_params)
search_state = if search_state_or_params.is_a? Blacklight::SearchState
Expand Down
2 changes: 1 addition & 1 deletion app/services/blacklight/field_retriever.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Blacklight
class FieldRetriever
# @param [Blacklight::Document] document
# @param [Blacklight::Configuration::Field] field_config solr field configuration
# @param [ActionView::Base] Rails rendering context
# @param [ActionView::Base] view_context Rails rendering context
def initialize(document, field_config, view_context = nil)
@document = document
@field_config = field_config
Expand Down
4 changes: 2 additions & 2 deletions app/views/catalog/_constraints.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if constraints_helpers_and_partials_from_blacklight? %>
<%= render(Blacklight::ConstraintsComponent.new(search_state: convert_to_search_state(controller.params != params ? params : search_state))) %>
<% if constraints_helpers_and_partials_from_blacklight? || blacklight_config&.view_config(document_index_view_type)&.constraints_component %>
<%= render((blacklight_config&.view_config(document_index_view_type)&.constraints_component || Blacklight::ConstraintsComponent).new(search_state: convert_to_search_state(controller.params != params ? params : search_state))) %>
<% else %>
<% Deprecation.warn(Blacklight::RenderConstraintsHelperBehavior, 'Constraints helpers or partials were overridden; not using components') %>
<% if Deprecation.silence(Blacklight::RenderConstraintsHelperBehavior) { query_has_constraints? } %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_facet_group.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= render Blacklight::Response::FacetGroupComponent.new(
<%= render (blacklight_config&.view_config(document_index_view_type)&.facet_group_component || Blacklight::Response::FacetGroupComponent).new(
response: @response,
id: groupname,
fields: facet_field_names(groupname),
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_search_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= render(Blacklight::SearchBarComponent.new(
<%= render((blacklight_config&.view_config(document_index_view_type)&.search_bar_component || Blacklight::SearchBarComponent).new(
url: search_action_url,
advanced_search_url: search_action_url(action: 'advanced_search'),
params: search_state.params_for_search.except(:qt),
Expand Down
Loading

0 comments on commit e6c7c72

Please sign in to comment.