Add contents hierarchy to collection display (ARC-149) - #67
Conversation
34f8449 to
e36a141
Compare
…use blended; tidy up a couple things
… in contents hierarchy; add container_types to component EAD config; add needed methods to SolrDocument
…her event listener method
…tmap and applications.js, not via manifest.js
…g SolrDocument methods
… using document actions, for now); make extent data look more like it does in search results
b450e1b to
a343356
Compare
| class NokogiriXpathExtensions | ||
| def is_component(node_set) | ||
| node_set.find_all do |node| | ||
| component_elements = (1..12).map { |i| "c#{'%02d' % i}" } | ||
| component_elements.push "c" | ||
| component_elements.include? node.name | ||
| end | ||
| end | ||
| end | ||
|
|
||
| to_field "child_component_count_isi" do |record, accumulator| | ||
| accumulator << record.xpath("/ead/archdesc/dsc/*[is_component(.)]", NokogiriXpathExtensions.new).count | ||
| end |
There was a problem hiding this comment.
We needed to add this for the root document, but the ead_component_config has something similar for components using | between all the possible cX values. I wonder if it's possible to do something like that here, but not going to worry about it right now.
…n, parses EAD ID from data-document-id= string value before _aspace
… format matching umich-arclight
…lected count in aeonform
There was a problem hiding this comment.
Pull request overview
Adds a navigable collection contents hierarchy with Aeon item-request selection and updated collection-page navigation.
Changes:
- Adds expandable contents hierarchy, breadcrumbs, and sidebar links.
- Indexes child counts and container types for hierarchy behavior.
- Adds session-persisted Aeon selections and request metadata.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
lib/um_arclight/traject/ead2_config.rb |
Indexes top-level child counts. |
lib/um_arclight/traject/ead2_component_config.rb |
Indexes component container types. |
config/importmap.rb |
Pins Aeon and truncation JavaScript. |
app/views/catalog/hierarchy.html.erb |
Selects the contents hierarchy renderer. |
app/views/arclight/requests/_aeon_hidden_form_request.html.erb |
Adds Aeon JavaScript hooks. |
app/models/solr_document.rb |
Adds hierarchy and Aeon metadata helpers. |
app/javascript/arclight/truncate_controller.js |
Detects whether content is truncated. |
app/javascript/application.js |
Loads Aeon functionality. |
app/javascript/aeonform.js |
Persists and submits Aeon selections. |
app/helpers/um_arclight_helper.rb |
Determines component linkability. |
app/controllers/catalog_controller.rb |
Configures breadcrumbs and metadata. |
app/components/um_document_component.html.erb |
Adds breadcrumbs and contents hierarchy. |
app/components/um_contents_document_collection_hierarchy_component.rb |
Defines hierarchy presentation behavior. |
app/components/um_contents_document_collection_hierarchy_component.html.erb |
Renders hierarchy entries and controls. |
app/components/um_collection_sidebar_component.html.erb |
Adds Contents and Access navigation. |
app/components/um_breadcrumbs_hierarchy_component.rb |
Limits breadcrumbs to components. |
app/components/um_breadcrumbs_hierarchy_component.html.erb |
Renders component ancestry. |
app/components/um_aeon_request_checkbox_component.rb |
Defines Aeon checkbox component. |
app/components/um_aeon_request_checkbox_component.html.erb |
Renders request metadata inputs. |
app/assets/stylesheets/application.scss |
Loads contents styling. |
app/assets/stylesheets/_search_results.scss |
Removes obsolete truncator styling. |
app/assets/stylesheets/_contents.scss |
Styles hierarchy and request controls. |
app/assets/stylesheets/_collection.scss |
Updates toolbar and breadcrumb styling. |
app/assets/stylesheets/_base.scss |
Adds sticky toolbar positioning. |
Suppressed comments (1)
app/models/solr_document.rb:108
- This returns the raw multivalued Solr array, so interpolation into the hidden input serializes it with Ruby array syntax (for example,
["Restricted"]) rather than as usable Aeon item information. Join the values before exposing them as a form value.
def aeon_item_info_1_value
accessrestrict
end
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| <input type="hidden" name="ItemSubTitle_<%= document.id %>" value="<%= document.aeon_item_sub_title_value %>"> | ||
| <input type="hidden" name="ItemVolume_<%= document.id %>" value="<%= document.aeon_item_volume_value %>"> | ||
| <input type="hidden" name="ItemCitation_<%= document.id %>" value="<%= document.aeon_item_citation_value %>"> | ||
| <input type="hidden" name="ItemInfo1" value="<%= document.aeon_item_info_1_value %>"> |
There was a problem hiding this comment.
We copied line 8 as it was in original from umich-arclight.
<input type="hidden" name="ItemInfo1" value="<%= document.aeon_item_info_1_value %>">
| <li class="nav-item"> | ||
| <%= link_to "Contents", | ||
| "#{document_path}#contents", | ||
| class: 'nav-link pl-0 ps-0 py-1', | ||
| data: { turbolinks: 'false' } | ||
| %> | ||
| </li> |
There was a problem hiding this comment.
This made sense on first glance, but on testing, things are still working, i.e. they send the user back to the Contents of the root document. This seems to be because of the logic in the sidebar component here: https://github.com/projectblacklight/arclight/blob/105af73da603b337b1f8fa54d76103f34e98350a/app/components/arclight/collection_sidebar_component.rb#L32
…ierarchy; join extent chunks in aeon field
…tch and console message in case of storage write errors
…s with field_config field names
To Do
umich, especiallyaeonform.jshttps://mlit.atlassian.net/browse/ARC-161search_service. The log message will go away in production.)According to the Claude analysis
is_interestingitems are linked. Counter is not enabled on label-only items.Blacklight uses the
counteroption inlink_to_documentfor search session tracking. When it's supplied:- The generated link includes tracking data with the counter value
- Clicking through to a record lets Blacklight record which position in the results the user clicked.
- It powers features on the show page like "« Previous | 123 of 456 | Next »" navigation