Skip to content
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
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
Expand Up @@ -2,7 +2,7 @@
<%= tag.dt @field.label, class: 'visually-hidden' %>
<% if truncate? %>
<%= tag.dd(class: @classes + ['truncator'], data: { controller: 'arclight-truncate' }) do %>
<%= tag.div @field.render, class: 'content', data: { arclight_truncate_target: 'content' } %>
<%= tag.div helpers.safe_join(@field.render), class: 'content', data: { arclight_truncate_target: 'content' } %>
<%= button_tag(type: :button, class: 'btn btn-sm btn-link px-0',
data: { action: 'click->arclight-truncate#trigger' }) do %>
<%= tag.span t('arclight.truncation.view_more'), class: 'view-more' %>
Expand All @@ -11,6 +11,6 @@
<% end %>
<% end %>
<% else %>
<%= tag.dd @field.render, class: @classes %>
<%= tag.dd helpers.safe_join(@field.render), class: @classes %>
<% end %>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% 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
2 changes: 1 addition & 1 deletion arclight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_dependency 'blacklight', '>= 8.0.0', '< 9'
spec.add_dependency 'blacklight', '>= 9.0.0', '< 10'
spec.add_dependency 'gretel'
spec.add_dependency 'rails', '>= 7.1', '< 9'
spec.add_dependency 'traject', '~> 3.0'
Expand Down
2 changes: 1 addition & 1 deletion spec/components/arclight/search_bar_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
end

let(:params) { {} }
let(:component) { described_class.new(url: '/', params: params) }
let(:component) { described_class.new(url: '/', params: params, advanced_search_url: '/advanced') }

describe 'within collection dropdown' do
context 'when in a collection context on the search results page' do
Expand Down