Skip to content

Commit

Permalink
Merge pull request #327 from LafayetteCollegeLibraries/develop
Browse files Browse the repository at this point in the history
2019.4 release
  • Loading branch information
rococodogs authored Nov 10, 2019
2 parents 63f0344 + ac7d698 commit f9ec235
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 46 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# changelog

## [2019.4] - 2019-11-10

### features

- adds title_sort_si field to Publication and Collection Solr documents and adds the sort option to the catalog_controller.rb (#328)

### bug fixes 🐞

- use the browse_collections_link in featured collection portion of the homepage (#325)
- use the correct hyrax layout in the contact form (previously was displaying w/o navbar) (#324)
- update the resource_type local authority to match what's listed on the metadata application profile (#326)

### notes 🗒

because of the added solr field, this will require a reindexing.

## [2019.3] - 2019-11-04

### features
Expand Down Expand Up @@ -117,6 +133,7 @@ fixes:

Initial pre-release (live on ldr.stage.lafayette.edu)

[2019.4]: https://github.com/LafayetteCollegeLibraries/spot/releases/tag/2019.4
[2019.3]: https://github.com/LafayetteCollegeLibraries/spot/releases/tag/2019.3
[2019.2]: https://github.com/LafayetteCollegeLibraries/spot/releases/tag/2019.2
[2019.1]: https://github.com/LafayetteCollegeLibraries/spot/releases/tag/2019.1
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ class CatalogController < ApplicationController
config.add_sort_field 'date_issued_sort_dtsi desc', label: "Issue Date \u25BC"
config.add_sort_field 'system_create_dtsi asc', label: "Date Added \u25B2"
config.add_sort_field 'system_create_dtsi desc', label: "Date Added \u25BC"
config.add_sort_field 'title_sort_si asc', label: "Title \u25B2"
config.add_sort_field 'title_sort_si desc', label: "Title \u25BC"

# If there are more than this many search results, no spelling ("did you
# mean") suggestion is offered.
Expand Down
2 changes: 2 additions & 0 deletions app/indexers/publication_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def rdf_service
# @return [Hash]
def generate_solr_document
super.tap do |solr_doc|
solr_doc['title_sort_si'] = object.title.first.to_s.downcase

store_license(solr_doc)
store_years_encompassed(solr_doc)
store_full_text_content(solr_doc)
Expand Down
2 changes: 2 additions & 0 deletions app/indexers/spot/collection_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class CollectionIndexer < Hyrax::CollectionIndexer

def generate_solr_document
super.tap do |doc|
doc['title_sort_si'] = object.title.first.to_s.downcase

if (slug_id = object.identifier.find { |id| id.start_with? 'slug:' })
doc['collection_slug_ssi'] = Spot::Identifier.from_string(slug_id).value
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/spot/homepage/_featured_collections.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% if presenter.featured_collections.present? %>
<div id="featured-collections" class="container-fluid">
<h2><%= t('.title') %></h2>
<p class="lead"><%= t('.browse_html').html_safe %></p>
<h2><%= t(".title_#{presenter.featured_collections.size > 1 ? 'plural' : 'singular'}") %></h2>
<p class="lead"><%= t('.browse_html', url: browse_collections_path).html_safe %></p>
<% presenter.featured_collections.each do |collection| %>
<%= render 'featured_collection_item', collection: collection %>
<% end %>
Expand Down
59 changes: 19 additions & 40 deletions config/authorities/resource_types.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,20 @@
terms:
- id: Article
term: Article
- id: Audio
term: Audio
- id: Book
term: Book
- id: Capstone Project
term: Capstone Project
- id: Conference Proceeding
term: Conference Proceeding
- id: Dataset
term: Dataset
- id: Dissertation
term: Dissertation
- id: Image
term: Image
- id: Journal
term: Journal
- id: Map or Cartographic Material
term: Map or Cartographic Material
- id: Masters Thesis
term: Masters Thesis
- id: Part of Book
term: Part of Book
- id: Poster
term: Poster
- id: Presentation
term: Presentation
- id: Project
term: Project
- id: Report
term: Report
- id: Research Paper
term: Research Paper
- id: Software or Program Code
term: Software or Program Code
- id: Video
term: Video
- id: Other
term: Other
- Article
- Audio
- Book
- Conference Proceedings
- Dataset
- Image
- Periodicial
- Map or Cartographic Material
- Part of Book
- Poster
- Postcard
- Presentation
- Project
- Report
- Research Paper
- Software or Program Code
- Transcript
- Video
- Other
2 changes: 1 addition & 1 deletion config/initializers/hyrax_overrides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
]

# see above
Hyrax::ContactFormController.class_eval { layout 'hyrax' }
Hyrax::ContactFormController.class_eval { layout 'hyrax/1_column' }

# the dashboard/my/collections (+ thus, dashboard/collections) controller defines
# blacklight facets + uses I18n.t to provide a label. as we've found from past experience,
Expand Down
5 changes: 3 additions & 2 deletions config/locales/spot.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ en:
page_title: Welcome to the %{name}

featured_collections:
title: Featured Collections
browse_html: '<a href="https://dss.lafayette.edu/collections" target="_blank">Click here</a> to browse all collections'
title_singular: Featured Collection
title_plural: Featured Collections
browse_html: '<a href="%{url}">Click here</a> to browse all collections'
collection:
view: View Collection
learn_more: Learn More
Expand Down
6 changes: 6 additions & 0 deletions spec/indexers/publication_indexer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,10 @@
expect(solr_doc['extracted_text_tsimv']).to eq expected_results
end
end

describe 'title sort' do
it 'indexes the first title, downcased' do
expect(solr_doc['title_sort_si']).to eq work.title.first.to_s.downcase
end
end
end
8 changes: 7 additions & 1 deletion spec/indexers/spot/collection_indexer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
# shared example requires that variable.
let(:work) { Collection.new(metadata) }
let(:indexer) { described_class.new(work) }
let(:metadata) { {} }
let(:metadata) { { title: ['A Great Collection'] } }

it_behaves_like 'it indexes ISO language and label'

describe 'title sort' do
it 'indexes the first title, downcased' do
expect(solr_doc['title_sort_si']).to eq work.title.first.to_s.downcase
end
end
end

0 comments on commit f9ec235

Please sign in to comment.