-
Notifications
You must be signed in to change notification settings - Fork 257
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
Allow the view_config
to be passed into the document_presenter
helper and DocumentComponent
constructor
#3343
base: main
Are you sure you want to change the base?
Conversation
d357cd0
to
06983d0
Compare
@@ -137,6 +138,12 @@ def before_render | |||
end | |||
end | |||
|
|||
def view_config | |||
@view_config ||= presenter&.view_config || Blacklight::Configuration::ViewConfig.new |
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.
Is there really a case where presenter is nil
? Wouldn't we also need to deal with that in the delegate :field_presenters
?
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.
I don't know. Someone thought so in all the renders_one
blocks above, but not in the before_render
.
Can you explain why downstream apps need more flexibility? In order to do what? It seems that this would allow the presenter.view_config to be different than |
Spotlight is a good example where its use of document presenters and components doesn't neatly align with Blacklight's limited notion of search results and single document pages, and where blacklight/app/helpers/blacklight/document_helper_behavior.rb Lines 68 to 74 in 023c1b0
|
@cbeer It seems like what Spotlight has right now is working... so what do you want it to look like? |
Yes, spotlight, blacklight-gallery and who-knows-what-else could all provide their own |
So the main thing here is the addition of |
This allows downstream applications (and e.g. gems like spotlight) a little more flexibility in how they use these.