@@ -4,6 +4,7 @@ class CatalogController < ApplicationController
44 include Blacklight ::Catalog
55
66 helper ArgoHelper
7+ helper ItemsHelper
78 include DateFacetConfigurations
89
910 before_action :limit_facets_on_home_page , only : [ :index ]
@@ -91,28 +92,27 @@ class CatalogController < ApplicationController
9192 config . add_facet_field SolrDocument ::FIELD_EXPLODED_NONPROJECT_TAG , label : 'Tag' , limit : 100_000 ,
9293 component : LazyNonprojectTagFacetComponent ,
9394 unless : -> ( controller , _config , _response ) { controller . params [ :no_tags ] }
94- config . add_facet_field SolrDocument ::FIELD_TICKET_TAG , label : 'Ticket' , component : true , limit : 100_000 , sort : 'index'
95- config . add_facet_field 'exclude_google_books' , label : 'Exclude Google Books' , component : true , query : {
95+ config . add_facet_field SolrDocument ::FIELD_TICKET_TAG , label : 'Ticket' , limit : 100_000 , sort : 'index'
96+ config . add_facet_field 'exclude_google_books' , label : 'Exclude Google Books' , query : {
9697 yes : {
9798 label : 'Yes' ,
9899 fq : "-#{ SolrDocument ::FIELD_APO_ID } :\" #{ Settings . google_books_apo } \" "
99100 }
100101 }
101- config . add_facet_field SolrDocument ::FIELD_OBJECT_TYPE , label : 'Object Type' , component : true , limit : 10
102- config . add_facet_field SolrDocument ::FIELD_CONTENT_TYPE , label : 'Content Type' , component : true , limit : 10
103- config . add_facet_field SolrDocument ::FIELD_CONTENT_FILE_MIMETYPES , label : 'MIME Types' , component : true , limit : 10
104- config . add_facet_field SolrDocument ::FIELD_CONTENT_FILE_ROLES , label : 'File Role' , component : true , limit : 10
105- config . add_facet_field SolrDocument ::FIELD_ACCESS_RIGHTS , label : 'Access Rights' , component : true , limit : 1000 ,
102+ config . add_facet_field SolrDocument ::FIELD_OBJECT_TYPE , label : 'Object Type' , limit : 10
103+ config . add_facet_field SolrDocument ::FIELD_CONTENT_TYPE , label : 'Content Type' , limit : 10
104+ config . add_facet_field SolrDocument ::FIELD_CONTENT_FILE_MIMETYPES , label : 'MIME Types' , limit : 10
105+ config . add_facet_field SolrDocument ::FIELD_CONTENT_FILE_ROLES , label : 'File Role' , limit : 10
106+ config . add_facet_field SolrDocument ::FIELD_ACCESS_RIGHTS , label : 'Access Rights' , limit : 1000 ,
106107 sort : 'index'
107- config . add_facet_field SolrDocument ::FIELD_LICENSE , label : 'License' , component : true , limit : 10
108- config . add_facet_field SolrDocument ::FIELD_COLLECTION_TITLE , label : 'Collection' , component : true , limit : 10 ,
108+ config . add_facet_field SolrDocument ::FIELD_LICENSE , label : 'License' , limit : 10
109+ config . add_facet_field SolrDocument ::FIELD_COLLECTION_TITLE , label : 'Collection' , limit : 10 ,
109110 more_limit : 9999 , sort : 'index'
110- config . add_facet_field SolrDocument ::FIELD_APO_TITLE , label : 'Admin Policy' , component : true , limit : 10 ,
111+ config . add_facet_field SolrDocument ::FIELD_APO_TITLE , label : 'Admin Policy' , limit : 10 ,
111112 more_limit : 9999 , sort : 'index'
112- config . add_facet_field SolrDocument ::FIELD_CURRENT_VERSION , label : 'Version' , component : true , limit : 10
113- config . add_facet_field SolrDocument ::FIELD_PROCESSING_STATUS , label : 'Processing Status' , component : true , limit : 10
113+ config . add_facet_field SolrDocument ::FIELD_CURRENT_VERSION , label : 'Version' , limit : 10
114+ config . add_facet_field SolrDocument ::FIELD_PROCESSING_STATUS , label : 'Processing Status' , limit : 10
114115 config . add_facet_field 'released_to_earthworks' ,
115- component : true ,
116116 query : {
117117 week : {
118118 label : 'Last week' ,
@@ -136,7 +136,6 @@ class CatalogController < ApplicationController
136136 }
137137 }
138138 config . add_facet_field 'released_to_purl_sitemap' ,
139- component : true ,
140139 query : {
141140 week : {
142141 label : 'Last week' ,
@@ -160,7 +159,6 @@ class CatalogController < ApplicationController
160159 }
161160 }
162161 config . add_facet_field 'released_to_searchworks' ,
163- component : true ,
164162 query : {
165163 week : {
166164 label : 'Last week' ,
@@ -185,42 +183,41 @@ class CatalogController < ApplicationController
185183 }
186184 config . add_facet_field SolrDocument ::FIELD_WORKFLOW_WPS , label : 'Workflows (WPS)' , limit : 9999 ,
187185 component : LazyWpsWorkflowFacetComponent
188- config . add_facet_field SolrDocument ::FIELD_METADATA_SOURCE , label : 'Metadata Source' , component : true
186+ config . add_facet_field SolrDocument ::FIELD_METADATA_SOURCE , label : 'Metadata Source'
189187
190188 # common method since search results and reports all do the same configuration
191189 add_common_date_facet_fields_to_config! config
192190
193191 config . add_facet_field 'identifiers' , label : 'Identifiers' ,
194- component : true ,
195192 query : {
196193 has_orcids : { label : 'Has contributor ORCIDs' ,
197194 fq : "+#{ SolrDocument ::FIELD_ORCIDS } :*" } ,
198195 has_doi : { label : 'Has DOI' , fq : "+#{ SolrDocument ::FIELD_DOI } :*" } ,
199196 has_barcode : { label : 'Has barcode' , fq : "+#{ SolrDocument ::FIELD_BARCODE_ID } :*" }
200197 }
201198
202- config . add_facet_field 'empties' , label : 'Empty Fields' , component : true ,
199+ config . add_facet_field 'empties' , label : 'Empty Fields' ,
203200 query : {
204201 no_mods_typeOfResource_ssim : { label : 'No MODS typeOfResource' ,
205202 fq : "-#{ SolrDocument ::FIELD_MODS_TYPE_OF_RESOURCE } :*" } ,
206203 no_sw_format : { label : 'No SW Format' , fq : "-#{ SolrDocument ::FIELD_SW_FORMAT } :*" }
207204 }
208205
209206 config . add_facet_field SolrDocument ::FIELD_SW_FORMAT , label : 'SW Format' , limit : -1 , sort : :index , component : Blacklight ::Hierarchy ::FacetFieldListComponent
210- config . add_facet_field SolrDocument ::FIELD_PUBLICATION_DATE , label : 'Date' , component : true , limit : 10
211- config . add_facet_field SolrDocument ::FIELD_TOPIC , label : 'Topic' , component : true , limit : 10
212- config . add_facet_field SolrDocument ::FIELD_SUBJECT_GEOGRAPHIC , label : 'Region' , component : true , limit : 10
213- config . add_facet_field SolrDocument ::FIELD_GENRE , label : 'Genre' , component : true , limit : 10
214- config . add_facet_field SolrDocument ::FIELD_SW_LANGUAGE , label : 'Language' , component : true , limit : 10
207+ config . add_facet_field SolrDocument ::FIELD_PUBLICATION_DATE , label : 'Date' , limit : 10
208+ config . add_facet_field SolrDocument ::FIELD_TOPIC , label : 'Topic' , limit : 10
209+ config . add_facet_field SolrDocument ::FIELD_SUBJECT_GEOGRAPHIC , label : 'Region' , limit : 10
210+ config . add_facet_field SolrDocument ::FIELD_GENRE , label : 'Genre' , limit : 10
211+ config . add_facet_field SolrDocument ::FIELD_SW_LANGUAGE , label : 'Language' , limit : 10
215212
216- config . add_facet_field SolrDocument ::FIELD_MODS_TYPE_OF_RESOURCE , label : 'MODS Resource Type' , component : true , limit : 10
213+ config . add_facet_field SolrDocument ::FIELD_MODS_TYPE_OF_RESOURCE , label : 'MODS Resource Type' , limit : 10
217214 # Adding the facet field allows it to be queried (e.g., from value_helper)
218215 config . add_facet_field SolrDocument ::FIELD_APO_ID , if : false
219216 config . add_facet_field SolrDocument ::FIELD_COLLECTION_ID , if : false
220217 config . add_facet_field 'tag_ssim' , if : false
221218 config . add_facet_field 'project_tag_ssim' , if : false
222219
223- config . add_facet_fields_to_solr_request! # deprecated in newer Blacklights
220+ config . add_facet_fields_to_solr_request!
224221
225222 config . add_search_field 'text' , label : 'All Fields'
226223 config . add_sort_field 'score desc, id asc' , label : 'Relevance' , default : true
@@ -249,6 +246,7 @@ class CatalogController < ApplicationController
249246 # Configure document actions framework
250247 config . index . document_actions . delete ( :bookmark )
251248
249+ config . index . sidebar_component = SidebarComponent
252250 config . show . document_component = DocumentComponent
253251 end
254252
@@ -323,17 +321,17 @@ def index
323321
324322 def lazy_nonproject_tag_facet
325323 limit_facets_to ( [ SolrDocument ::FIELD_EXPLODED_NONPROJECT_TAG ] )
326- ( response , ) = search_service . search_results
327- facet_config = facet_configuration_for_field ( SolrDocument ::FIELD_EXPLODED_NONPROJECT_TAG )
324+ response = search_service . search_results
325+ facet_config = blacklight_config . facet_configuration_for_field ( SolrDocument ::FIELD_EXPLODED_NONPROJECT_TAG )
328326 display_facet = response . aggregations [ facet_config . field ]
329327 @facet_field_presenter = facet_config . presenter . new ( facet_config , display_facet , view_context )
330328 render partial : 'lazy_nonproject_tag_facet'
331329 end
332330
333331 def lazy_project_tag_facet
334332 limit_facets_to ( [ SolrDocument ::FIELD_EXPLODED_PROJECT_TAG ] )
335- ( response , ) = search_service . search_results
336- facet_config = facet_configuration_for_field ( SolrDocument ::FIELD_EXPLODED_PROJECT_TAG )
333+ response = search_service . search_results
334+ facet_config = blacklight_config . facet_configuration_for_field ( SolrDocument ::FIELD_EXPLODED_PROJECT_TAG )
337335 display_facet = response . aggregations [ facet_config . field ]
338336 @facet_field_presenter = facet_config . presenter . new ( facet_config , display_facet , view_context )
339337 render partial : 'lazy_project_tag_facet'
@@ -342,8 +340,8 @@ def lazy_project_tag_facet
342340 def lazy_wps_workflow_facet
343341 limit_facets_to ( [ SolrDocument ::FIELD_WORKFLOW_WPS ] )
344342
345- ( response , ) = search_service . search_results
346- facet_config = facet_configuration_for_field ( SolrDocument ::FIELD_WORKFLOW_WPS )
343+ response = search_service . search_results
344+ facet_config = blacklight_config . facet_configuration_for_field ( SolrDocument ::FIELD_WORKFLOW_WPS )
347345 display_facet = response . aggregations [ facet_config . field ]
348346 @facet_field_presenter = facet_config . presenter . new ( facet_config , display_facet , view_context )
349347 render partial : 'lazy_wps_workflow_facet'
@@ -359,7 +357,7 @@ def show
359357 # Skip validating the Cocina underlying the Solr representation
360358 @document = SolrDocument . new ( object_client . version . solr ( version_param , validate : false ) )
361359 else
362- _deprecated_response , @document = search_service . fetch ( druid_param )
360+ @document = search_service . fetch ( druid_param )
363361 @cocina = Repository . find_lite ( druid_param , structural : false )
364362 end
365363
0 commit comments