Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- ruby: "3.2"
rails_version: 7.1.5.1
- ruby: "3.4"
rails_version: "8.0.1"
blacklight_version: 9.0.0.beta1
rails_version: "8.0.4"
blacklight_version: 9.0.0.beta8
additional_name: "/ Blacklight 9"
env:
RAILS_VERSION: ${{ matrix.rails_version }}
Expand Down
4 changes: 2 additions & 2 deletions app/components/arclight/embed_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
module Arclight
# Render digital object links for a document
class EmbedComponent < ViewComponent::Base
def initialize(document:, presenter:, **kwargs) # rubocop:disable Lint/UnusedMethodArgument
def initialize(presenter:, document_counter: nil, **kwargs) # rubocop:disable Lint/UnusedMethodArgument
super()

@document = document
@document = presenter.document
@presenter = presenter
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<%= render(@layout.new(field: @field)) do |component| %>
<%= render(@layout.new(field: @field, index: 0)) do |component| %>
<% component.with_label do %>
<%= label %>
<% end %>
<% component.with_value do %>
<% component.with_value(index: 0) do %>
<div class='al-in-person-repository-name'>
<% if repository.thumbnail_url %>
<%= image_tag repository.thumbnail_url, alt: '', class: 'img-fluid float-left' %>
Expand Down
6 changes: 3 additions & 3 deletions app/components/arclight/search_result_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<%= content_tag @component,
id: @id,
data: {
'document-id': @document.id.to_s.parameterize,
'document-id': presenter.document.id.to_s.parameterize,
'document-counter': @counter,
},
itemscope: true,
itemtype: @document.itemtype,
itemtype: presenter.document.itemtype,
class: classes.flatten.join(' ') do %>
<div class="px-2 document-type-icon">
<%= icon %>
</div>
<div class="container">
<%= render Arclight::SearchResultTitleComponent.new(document: document, compact: compact?) %>
<%= render Arclight::SearchResultTitleComponent.new(presenter: presenter, compact: compact?) %>

<div class="row">
<%= metadata %>
Expand Down
10 changes: 5 additions & 5 deletions app/components/arclight/search_result_title_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<header class="documentHeader row" data-document-id="<%= @document.id %>">
<header class="documentHeader row" data-document-id="<%= presenter.document.id %>">
<h3 class="index_title document-title-heading col">
<%= helpers.link_to_document @document, counter: @counter %>
<% @document.extent.each do |extent| %>
<%= helpers.link_to_document presenter.document, counter: @counter %>
<% presenter.document.extent.each do |extent| %>
<%= tag.span extent, class: 'al-document-extent badge' unless compact? %>
<% end %>
<%= tag.span class: 'al-document-container text-muted' do %>
<%= @document.containers.join(', ') %>
<% end if @document.containers.present? %>
<%= presenter.document.containers.join(', ') %>
<% end if presenter.document.containers.present? %>
</h3>

<% actions.each do |action| %>
Expand Down
5 changes: 3 additions & 2 deletions app/components/arclight/upper_metadata_layout_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
module Arclight
# Override upstream to add an offset bootstrap column class
class UpperMetadataLayoutComponent < Blacklight::MetadataFieldLayoutComponent
def initialize(field:, label_class: 'col-md-3 offset-md-1', value_class: 'col-md-8')
super
def initialize(field:, index: 0, label_class: 'col-md-3 offset-md-1', value_class: 'col-md-8')
@index = index
super(field: field, label_class: label_class, value_class: value_class)
end
end
end
3 changes: 2 additions & 1 deletion lib/generators/arclight/templates/arclight.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
}

// Arclight, imported from arclight frontend package
@import 'arclight/app/assets/stylesheets/arclight/application';
//@import 'arclight/app/assets/stylesheets/arclight/application';
@import '../../../arclight/app/assets/stylesheets/arclight/application';
17 changes: 17 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@
end

require 'engine_cart'

# Rails 7.1.3+ freezes certain internal arrays for
# performance and safety. Rails::Engine.paths["app"] is frozen
# but EngineCart tries to modify it, leading to errors like:
# Failure/Error: EngineCart.load_application!
# FrozenError: can't modify frozen Array
# We need to patch Rails::Engine to prevent path freezing during EngineCart loading
module Rails
class Engine
def freeze_config
# Override to prevent freezing of config arrays that EngineCart needs to modify
# This is a temporary workaround for EngineCart compatibility with Rails 7.1.3+
@config.freeze unless defined?(EngineCart)
end
end
end

EngineCart.load_application!

require 'rspec/rails'
Expand Down
Loading