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

Fix Based Near functionality #855

Merged
merged 3 commits into from
Oct 25, 2024
Merged

Fix Based Near functionality #855

merged 3 commits into from
Oct 25, 2024

Conversation

laritakr
Copy link
Contributor

Story

Refs #851

Expected Behavior Before Changes

Using based near crashes the app.

Expected Behavior After Changes

Based Near attributes save, display, and edit appropriately

Screenshots / Video

Notes

@laritakr
Copy link
Contributor Author

laritakr commented Oct 21, 2024

Current status of work

Changes to this point fix it in Hyrax, Hyku, and for the knapsack resource models.
Generic Work Resource, Image Resource, and Collection Resource all remain broken in the knapsack.
In addition, Hyku (and probably hyrax) display the URI string rather than the based_near_label for Collection.

index_props = DogBiscuits.config.index_properties.collect do |prop|
{ prop => CatalogController.send(:index_options, prop, DogBiscuits.config.property_mappings[prop]) }
end
CatalogController.send(:add_index_field, config, index_props)
config.add_index_field 'all_text_tsimv', label: "Item contents", highlight: true, helper_method: :render_ocr_snippets, if: :query_present?
config.add_index_field 'based_near_label_tesim', itemprop: 'contentLocation', link_to_facet: 'based_near_label_sim'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the form so you don't have to hit + to open the location before searching

@@ -7,7 +7,7 @@
<%= presenter.attribute_to_html(:identifier, render_as: :linked, search_field: 'identifier_tesim') %>
<% end %>
<%= presenter.attribute_to_html(:keyword, render_as: :faceted) %>
<%= presenter.attribute_to_html(:based_near_label, render_as: :faceted) %>
<%= presenter.attribute_to_html(:based_near_label) %>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rendering the text as faceted resulted in an empty search so I removed the facet.

@orangewolf orangewolf marked this pull request as ready for review October 23, 2024 21:27
@@ -3,23 +3,14 @@

Rails.application.config.after_initialize do
# Add all concerns that are migrating from ActiveFedora here
CONCERNS = [ConferenceItem, Dataset, ExamPaper, GenericWork, Image, JournalArticle, PublishedWork, Thesis].freeze
CONCERNS = [ConferenceItem, Dataset, Etd, ExamPaper, GenericWork, Image, JournalArticle, PublishedWork, Thesis].freeze
Copy link
Contributor

@ShanaLMoore ShanaLMoore Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laritakr Should Oer need to be in here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, we should leave OER and ETD out because those two work types aren't functioning right for adventist and that's a separate ticket to fix them

@laritakr laritakr merged commit 3560ec0 into main Oct 25, 2024
8 checks passed
@laritakr laritakr deleted the i851-based-near branch October 25, 2024 17:22
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.

3 participants