Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TD-1419 Use DocumentComponent subclasses everywhere #505

Merged
merged 8 commits into from
Feb 24, 2025

Conversation

adjam
Copy link
Contributor

@adjam adjam commented Feb 21, 2025

Previously, we were only using a subclass of Blacklight::DocumentComponent on the "index" (results) page; this PR adds a new subclass TrlnArgon::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 sample app/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.
  • renamed TrlnArgon::DocumentComponent to TrlnArgon::DocumentIndexComponent to harmonize its naming with the new sublclass.
  • added configuration in 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 set classes: and this caused errors when using the component with the default template.

@seanaery seanaery merged commit 04724b9 into main Feb 24, 2025
8 checks passed
@seanaery seanaery deleted the TD-1419-document-component branch February 24, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants