From 33a952ad25df32b983643bf681918dc001a3b89b Mon Sep 17 00:00:00 2001 From: lfarrell Date: Tue, 5 Dec 2023 09:00:37 -0500 Subject: [PATCH 1/2] Fix issues with duplicate item ids between the collection sidebar and the collection contents display. --- .../arclight/document_collection_hierarchy_component.html.erb | 2 +- app/components/arclight/document_component.html.erb | 2 +- .../arclight/document_components_hierarchy_component.html.erb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/arclight/document_collection_hierarchy_component.html.erb b/app/components/arclight/document_collection_hierarchy_component.html.erb index 40537fbe4..59c6f7181 100644 --- a/app/components/arclight/document_collection_hierarchy_component.html.erb +++ b/app/components/arclight/document_collection_hierarchy_component.html.erb @@ -1,5 +1,5 @@ <%= content_tag :li, - id: @document.id, + id: "#{@document.id}-hierarchy-item", data: { 'document-id': @document.id.to_s.parameterize, 'document-counter': @counter, diff --git a/app/components/arclight/document_component.html.erb b/app/components/arclight/document_component.html.erb index 193067acc..55d47ead3 100644 --- a/app/components/arclight/document_component.html.erb +++ b/app/components/arclight/document_component.html.erb @@ -32,7 +32,7 @@ <% elsif document.children? %>

<%= t 'arclight.views.show.contents' %>

- <%= helpers.turbo_frame_tag "al-hierarchy-#{document.id}", loading: 'lazy', src: helpers.hierarchy_solr_document_path(id: document.id, paginate: true, per_page: 50) %> + <%= helpers.turbo_frame_tag "al-hierarchy-#{document.id}-document", loading: 'lazy', src: helpers.hierarchy_solr_document_path(id: document.id, paginate: true, key: '-document', per_page: 50) %>
<% end %> diff --git a/app/components/arclight/document_components_hierarchy_component.html.erb b/app/components/arclight/document_components_hierarchy_component.html.erb index af6c485ab..a42663205 100644 --- a/app/components/arclight/document_components_hierarchy_component.html.erb +++ b/app/components/arclight/document_components_hierarchy_component.html.erb @@ -18,7 +18,7 @@ <% end %> <% elsif paginate? %> <%# render the first N documents, and let the user expand the remaining if desired %> - <%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(limit: @maximum_left_gap) %> + <%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-sidebar", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(limit: @maximum_left_gap, key: '-sidebar') %> <%= tag.turbo_frame id: "al-hierarchy-#{@document.id}-right" do %>