TD-1419 Use DocumentComponent subclasses everywhere #505
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, we were only using a subclass of
Blacklight::DocumentComponent
on the "index" (results) page; this PR adds a new subclassTrlnArgon::DocumentShowComponent
for use on the "show" (full record) page.The new "show" subclass adds a
sub_header
slot for the basic Imprint/ resource type/ format subheader; the sampleapp/views/catalog/_show_main_content.html.erb
template shows how to add this subheader to the output.To support this change:
app/views/catalog/_show_main_content.html.rb
has been reworked to use the new component class; since we are all overriding this template anyway (based on a quick Slack survey 2025-02-20), in order to use the component we'll have to edit our overrides. This version of th` e template is thus more of a "how to" or basic starting point. Downstream applications that do not change their version of this template will not be using the new component class to render the full record page.TrlnArgon::DocumentComponent
toTrlnArgon::DocumentIndexComponent
to harmonize its naming with the new sublclass.lib/trln_argon/controller_override.rb
to use the new components.Additionally, added a default value for the
TrlnArgon::StartOverButtonComponent#initialize
method; the default template for this component did not setclasses:
and this caused errors when using the component with the default template.