Allow the view_config to be passed into the document_presenter helper and DocumentComponent constructor#3343
Allow the view_config to be passed into the document_presenter helper and DocumentComponent constructor#3343
view_config to be passed into the document_presenter helper and DocumentComponent constructor#3343Conversation
d357cd0 to
06983d0
Compare
| end | ||
|
|
||
| def view_config | ||
| @view_config ||= presenter&.view_config || Blacklight::Configuration::ViewConfig.new |
There was a problem hiding this comment.
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.
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.