Skip to content

Commit

Permalink
🎁 make facet options match adventist-dl proper (#104)
Browse files Browse the repository at this point in the history
Deletes the default hyku proper facets and use the[ adventist proper's
settings](https://github.com/scientist-softserv/adventist-dl/blob/main/app/controllers/catalog_controller.rb#L103-L132)
instead, for feature parity with the original application.

Issue:
- https://github.com/scientist-softserv/adventist-dl/issues/659

# ADVENTIST PROPER


![image](https://github.com/scientist-softserv/adventist_knapsack/assets/10081604/735412a2-7967-4c51-853a-60de8f7d867a)

# ADVENTIST KNAPSACK
## BEFORE


![image](https://github.com/scientist-softserv/adventist_knapsack/assets/10081604/176f4e80-38dc-4e36-9895-1666e9f50f62)

## AFTER

![image](https://github.com/scientist-softserv/adventist_knapsack/assets/10081604/9847079c-c96a-4e9f-9b60-8fec040f6589)

## NOTE

The carot icon to collapse/expand the facet is broken because of the
[bootstrap version
change](https://getbootstrap.com/docs/4.1/migration/). I'd argue that
should be a separate ticket.
  • Loading branch information
Shana Moore authored Nov 22, 2023
2 parents 330d2e9 + bfdb613 commit 137cd3e
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions app/controllers/catalog_controller_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
# Use locally customized AdvSearchBuilder so we can enable blacklight_advanced_search
config.search_builder_class = AdvSearchBuilder

# Delete Hyku's default settings
config.facet_fields.clear

# solr fields that will be treated as facets by the blacklight application
# The ordering of the field names is the order of the display
config.add_facet_field 'source_sim', label: 'Source', limit: 5, collapse: false, helper_method: :iconify_auto_link
config.add_facet_field 'human_readable_type_sim', label: "Type", limit: 5, collapse: false
config.add_facet_field(
'sorted_year_isi',
label: 'Date Range',
Expand All @@ -22,17 +26,18 @@
},
facet_field_label: 'Date Range'
)

# Delete Hyku version so we can add the Author label
config.facet_fields.delete('creator_sim')
config.add_facet_field 'resource_type_sim', label: "Resource Type", limit: 5
config.add_facet_field 'creator_sim', label: "Author", limit: 5

# Delete default Hyku facets that are no applicable for this Knapsack
config.facet_fields.delete('contributor_sim')
config.facet_fields.delete('file_format_sim')

config.add_facet_field 'publisher_sim', limit: 5
config.add_facet_field 'keyword_sim', limit: 5
config.add_facet_field 'subject_sim', limit: 5
config.add_facet_field 'language_sim', limit: 5
config.add_facet_field 'based_near_label_sim', limit: 5
config.add_facet_field 'part_sim', limit: 5, label: 'Part'
config.add_facet_field 'part_of_sim', limit: 5
# config.add_facet_field 'file_format_sim', limit: 5
# config.add_facet_field 'contributor_sim', label: "Contributor", limit: 5
config.add_facet_field 'member_of_collections_ssim', limit: 5, label: 'Collections'
config.add_facet_field 'refereed_sim', limit: 5

# Clobber all existing index and show fields that come from Hyku base but skip
Expand Down

0 comments on commit 137cd3e

Please sign in to comment.