-
Notifications
You must be signed in to change notification settings - Fork 256
Pass document + presenter through to DocumentMetadataComponent. #3587
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
base: main
Are you sure you want to change the base?
Conversation
@@ -9,8 +9,10 @@ class DocumentMetadataComponent < Blacklight::Component | |||
|
|||
# @param fields [Enumerable<Blacklight::FieldPresenter>] Document field presenters | |||
# rubocop:disable Metrics/ParameterLists | |||
def initialize(fields: [], tag: 'dl', classes: %w[document-metadata dl-invert row], show: false, view_type: nil, field_layout: nil, **component_args) | |||
def initialize(fields: [], document: nil, presenter: nil, tag: 'dl', classes: %w[document-metadata dl-invert row], show: false, view_type: nil, field_layout: nil, **component_args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need both document + presenter? Wouldn't presenter be sufficient as it's a wrapper around the document and thus we can get the document via presenter.document
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷 we pass both to all the other subcomponents.
e976bdf
to
8622844
Compare
+1 to this change. I recently found myself having to subclass |
This needs #3586 to be merged first I believe. |
8622844
to
ea02c7a
Compare
This makes
DocumentMetadataComponent
similar to the other document sub-components.