scientist-softserv / adventist_knapsack

Apache License 2.0
2 stars 0 forks source link

🐛 Ensure we pass query to IIIF viewer #64

Closed jeremyf closed 11 months ago

jeremyf commented 12 months ago

In the pre-knapsack Adventist, the IIIF Print gem overwrote : app/views/catalog/_index_header_list_default.html.erb and the Adventist Hyku instance did not have that view.

However with the upgrade to the latest Hyku version via Knapsack, that Hyku overrided Hyrax's view. And due to view_path issues, we favor the Hyku instance.

Below is a diff of the files in Knapsack's Hyku and IIIF Print. I have not resolved all of these things but am close:

Note that when 'q' is present AND document.any_highlighting? is true we want to pass the param as "parent_query". If just 'q' is present, we want to pass "query". So this is only a partial fix.

diff of the files in Knapsack's Hyku and IIIF Print ``` ❯ diff hyrax-webapp/app/views/catalog/_index_header_list_default.html.erb ../iiif_print/app/views/catalog/_index_header_list_default.html.erb 1,2c1,2 < <%# OVERRIDE Hyrax 3.4.0 to support shared search %> < <% model = document.hydra_model %> --- > <%# OVERRIDE Hyrax 2.9.6 to show parent_query params if metadata is found in parent record %> > 4,9c4,12 < <% if model == Hyrax::PcdmCollection || model < Hyrax::PcdmCollection %> <

<%= link_to document.title_or_label, generate_work_url(document, request) %>

< <%= Hyrax::CollectionPresenter.new(document, current_ability).collection_type_badge %> < <% else %> <

<%= link_to document.title_or_label, generate_work_url(document, request) %>

< <% end %> --- >

> <% if params['q'].present? && document.any_highlighting? %> > <%= link_to document.title_or_label, [document, { parent_query: params['q'] }] %>

> <% elsif params['q'].present? %> > <%= link_to document.title_or_label, [document, { query: params['q'] }] %> > <% else %> > <%= link_to document.title_or_label, document %> > <% end %> > ```

Snippet highlighting:

image

Clicking on the result automatically searches the UV for that query term: image

jeremyf commented 11 months ago

I'm closing this pull request as the approach method of having IIIF Print supersede the Hyku application is not something we're going to do.