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 %>
-
@@ -28,5 +28,5 @@
<% end %>
<% else %>
<%# there aren't enough to bother paginating, so load them all at once %>
- <%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path %>
+ <%= helpers.turbo_frame_tag "al-hierarchy-#{@document.id}-sidebar", loading: ('lazy' unless @target_index >= 0), src: hierarchy_path(key: '-sidebar') %>
<% end %>
diff --git a/spec/features/aeon_web_ead_request_spec.rb b/spec/features/aeon_web_ead_request_spec.rb
index f22b520cc..e5b254c99 100644
--- a/spec/features/aeon_web_ead_request_spec.rb
+++ b/spec/features/aeon_web_ead_request_spec.rb
@@ -7,7 +7,7 @@
it 'creates a request link' do
visit solr_document_path 'm0198-xml'
- within '#m0198-xmlaspace_ref11_d0s' do
+ within '#m0198-xmlaspace_ref11_d0s-hierarchy-item' do
click_link 'Pages 1-78'
end
expect(page).to have_css(
diff --git a/spec/features/collection_page_spec.rb b/spec/features/collection_page_spec.rb
index 0cf3778a2..91c3ed16c 100644
--- a/spec/features/collection_page_spec.rb
+++ b/spec/features/collection_page_spec.rb
@@ -191,20 +191,20 @@
it 'sub components are viewable and expandable' do
within '#collection-context' do
- within '#aoa271aspace_563a320bb37d24a9e1e6f7bf95b52671' do
+ within '#aoa271aspace_563a320bb37d24a9e1e6f7bf95b52671-hierarchy-item' do
click_link 'View'
- within '#aoa271aspace_dc2aaf83625280ae2e193beb3f4aea78.al-collection-context' do
+ within '#aoa271aspace_dc2aaf83625280ae2e193beb3f4aea78-hierarchy-item.al-collection-context' do
expect(page).to have_link 'Constitution and by-laws'
end
click_link 'Expand'
expect(page).to have_link 'Reports'
- el = find_by_id('aoa271aspace_238a0567431f36f49acea49ef576d408')
+ el = find_by_id('aoa271aspace_238a0567431f36f49acea49ef576d408-hierarchy-item')
evaluate_script "window.scrollTo(0,#{el.rect.y - 100})"
sleep 1
- within '#aoa271aspace_238a0567431f36f49acea49ef576d408' do
+ within '#aoa271aspace_238a0567431f36f49acea49ef576d408-hierarchy-item' do
click_link 'View'
expect(page).to have_link 'Expansion Plan'
- within '#aoa271aspace_f934f1add34289f28bd0feb478e68275' do
+ within '#aoa271aspace_f934f1add34289f28bd0feb478e68275-hierarchy-item' do
click_link 'View'
expect(page).to have_link 'Initial Phase'
expect(page).to have_link 'Phase II: Expansion'
@@ -215,7 +215,7 @@
end
it 'includes the number of direct children of the component' do
- within '#aoa271aspace_563a320bb37d24a9e1e6f7bf95b52671' do
+ within '#aoa271aspace_563a320bb37d24a9e1e6f7bf95b52671-hierarchy-item' do
expect(page).to have_css(
'.al-number-of-children-badge',
text: /25/
diff --git a/spec/features/component_page_spec.rb b/spec/features/component_page_spec.rb
index f3cd04316..8f63a115f 100644
--- a/spec/features/component_page_spec.rb
+++ b/spec/features/component_page_spec.rb
@@ -182,7 +182,7 @@
it 'enables expanding nodes outside of own ancestor tree' do
within '#collection-context' do
- find('#aoa271aspace_01daa89087641f7fc9dbd7a10d3f2da9 .al-toggle-view-children').click
+ find('#aoa271aspace_01daa89087641f7fc9dbd7a10d3f2da9-hierarchy-item .al-toggle-view-children').click
expect(page).to have_css '.document-title-heading', text: 'Miscellaneous 1999'
end
end
@@ -202,7 +202,7 @@
it 'expands child nodes when clicked' do
within '#collection-context' do
- find('#pc0170-xmlaspace_ref5_edi .al-toggle-view-children').click
+ find('#pc0170-xmlaspace_ref5_edi-hierarchy-item .al-toggle-view-children').click
expect(page).to have_css '.document-title-heading', text: 'Restricted images, 1979-2000'
end
end