blacklight 7.16.0 → 7.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -0
  3. data/VERSION +1 -1
  4. data/app/components/blacklight/advanced_search_form_component.html.erb +9 -3
  5. data/app/components/blacklight/advanced_search_form_component.rb +48 -35
  6. data/app/components/blacklight/constraints_component.html.erb +19 -3
  7. data/app/components/blacklight/constraints_component.rb +5 -1
  8. data/app/components/blacklight/content_areas_shim.rb +12 -0
  9. data/app/components/blacklight/document/action_component.rb +4 -0
  10. data/app/components/blacklight/document/actions_component.html.erb +3 -5
  11. data/app/components/blacklight/document/actions_component.rb +14 -1
  12. data/app/components/blacklight/document_component.html.erb +4 -7
  13. data/app/components/blacklight/document_component.rb +73 -73
  14. data/app/components/blacklight/document_metadata_component.html.erb +2 -2
  15. data/app/components/blacklight/document_metadata_component.rb +13 -2
  16. data/app/components/blacklight/document_title_component.html.erb +17 -0
  17. data/app/components/blacklight/document_title_component.rb +59 -0
  18. data/app/components/blacklight/facet_field_checkboxes_component.html.erb +2 -2
  19. data/app/components/blacklight/facet_field_component.rb +4 -1
  20. data/app/components/blacklight/facet_field_list_component.html.erb +2 -2
  21. data/app/components/blacklight/facet_field_no_layout_component.rb +4 -1
  22. data/app/components/blacklight/metadata_field_component.html.erb +2 -2
  23. data/app/components/blacklight/metadata_field_layout_component.html.erb +3 -1
  24. data/app/components/blacklight/metadata_field_layout_component.rb +26 -1
  25. data/app/components/blacklight/response/view_type_button_component.html.erb +4 -0
  26. data/app/components/blacklight/response/view_type_button_component.rb +36 -0
  27. data/app/components/blacklight/response/view_type_component.html.erb +2 -5
  28. data/app/components/blacklight/response/view_type_component.rb +9 -13
  29. data/app/components/blacklight/search_bar_component.rb +4 -1
  30. data/app/components/blacklight/system/dropdown_component.html.erb +4 -7
  31. data/app/components/blacklight/system/dropdown_component.rb +24 -0
  32. data/app/components/blacklight/system/flash_message_component.html.erb +1 -1
  33. data/app/components/blacklight/system/flash_message_component.rb +7 -1
  34. data/app/components/blacklight/system/modal_component.rb +7 -1
  35. data/app/views/catalog/_citation.html.erb +1 -1
  36. data/app/views/catalog/_document.html.erb +2 -2
  37. data/app/views/catalog/_facet_layout.html.erb +2 -2
  38. data/app/views/catalog/_show_main_content.html.erb +3 -3
  39. data/app/views/catalog/email.html.erb +2 -2
  40. data/app/views/catalog/email_success.html.erb +1 -1
  41. data/app/views/catalog/facet.html.erb +3 -3
  42. data/app/views/catalog/sms.html.erb +2 -2
  43. data/app/views/catalog/sms_success.html.erb +1 -1
  44. data/blacklight.gemspec +1 -1
  45. data/config/locales/blacklight.de.yml +2 -2
  46. data/lib/blacklight/engine.rb +3 -1
  47. data/lib/blacklight/solr/facet_paginator.rb +2 -0
  48. data/lib/blacklight/solr/request.rb +31 -0
  49. data/lib/blacklight/solr/response.rb +2 -16
  50. data/lib/blacklight/solr/response/facets.rb +76 -22
  51. data/lib/blacklight/solr/response/params.rb +104 -0
  52. data/lib/blacklight/solr/search_builder_behavior.rb +49 -29
  53. data/lib/generators/blacklight/assets_generator.rb +6 -2
  54. data/lib/generators/blacklight/user_generator.rb +1 -1
  55. data/spec/components/blacklight/document_component_spec.rb +3 -3
  56. data/spec/models/blacklight/solr/facet_paginator_spec.rb +4 -0
  57. data/spec/models/blacklight/solr/request_spec.rb +62 -29
  58. data/spec/models/blacklight/solr/response/facets_spec.rb +109 -0
  59. data/spec/models/blacklight/solr/response_spec.rb +10 -0
  60. data/spec/models/blacklight/solr/search_builder_spec.rb +17 -0
  61. metadata +14 -8
@@ -259,6 +259,23 @@ RSpec.describe Blacklight::Solr::SearchBuilderBehavior, api: true do
259
259
  end
260
260
  end
261
261
 
262
+ describe 'with a json facet' do
263
+ let(:user_params) { { f: { json_facet: ['value'] } }.with_indifferent_access }
264
+
265
+ before do
266
+ blacklight_config.add_facet_field 'json_facet', field: 'foo', json: { bar: 'baz' }
267
+ end
268
+
269
+ it "has proper solr parameters" do
270
+ expect(subject[:fq]).to include('{!term f=foo}value')
271
+ expect(subject.dig(:json, :facet, 'json_facet')).to include(
272
+ field: 'foo',
273
+ type: 'terms',
274
+ bar: 'baz'
275
+ )
276
+ end
277
+ end
278
+
262
279
  describe 'with multi-valued facets' do
263
280
  let(:user_params) { { f_inclusive: { format: %w[Book Movie CD] } } }
264
281
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.16.0
4
+ version: 7.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -14,10 +14,10 @@ authors:
14
14
  - Dan Funk
15
15
  - Naomi Dushay
16
16
  - Justin Coyne
17
- autorequire:
17
+ autorequire:
18
18
  bindir: exe
19
19
  cert_chain: []
20
- date: 2021-03-30 00:00:00.000000000 Z
20
+ date: 2021-04-21 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails
@@ -129,14 +129,14 @@ dependencies:
129
129
  requirements:
130
130
  - - ">="
131
131
  - !ruby/object:Gem::Version
132
- version: 2.23.0
132
+ version: 2.28.0
133
133
  type: :runtime
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - ">="
138
138
  - !ruby/object:Gem::Version
139
- version: 2.23.0
139
+ version: 2.28.0
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: rsolr
142
142
  requirement: !ruby/object:Gem::Requirement
@@ -402,6 +402,7 @@ files:
402
402
  - app/components/blacklight/constraint_layout_component.rb
403
403
  - app/components/blacklight/constraints_component.html.erb
404
404
  - app/components/blacklight/constraints_component.rb
405
+ - app/components/blacklight/content_areas_shim.rb
405
406
  - app/components/blacklight/document/action_component.html.erb
406
407
  - app/components/blacklight/document/action_component.rb
407
408
  - app/components/blacklight/document/actions_component.html.erb
@@ -420,6 +421,8 @@ files:
420
421
  - app/components/blacklight/document_component.rb
421
422
  - app/components/blacklight/document_metadata_component.html.erb
422
423
  - app/components/blacklight/document_metadata_component.rb
424
+ - app/components/blacklight/document_title_component.html.erb
425
+ - app/components/blacklight/document_title_component.rb
423
426
  - app/components/blacklight/facet_field_checkboxes_component.html.erb
424
427
  - app/components/blacklight/facet_field_checkboxes_component.rb
425
428
  - app/components/blacklight/facet_field_component.html.erb
@@ -448,6 +451,8 @@ files:
448
451
  - app/components/blacklight/response/sort_component.rb
449
452
  - app/components/blacklight/response/spellcheck_component.html.erb
450
453
  - app/components/blacklight/response/spellcheck_component.rb
454
+ - app/components/blacklight/response/view_type_button_component.html.erb
455
+ - app/components/blacklight/response/view_type_button_component.rb
451
456
  - app/components/blacklight/response/view_type_component.html.erb
452
457
  - app/components/blacklight/response/view_type_component.rb
453
458
  - app/components/blacklight/search_bar_component.html.erb
@@ -691,6 +696,7 @@ files:
691
696
  - lib/blacklight/solr/response/group_response.rb
692
697
  - lib/blacklight/solr/response/more_like_this.rb
693
698
  - lib/blacklight/solr/response/pagination_methods.rb
699
+ - lib/blacklight/solr/response/params.rb
694
700
  - lib/blacklight/solr/response/response.rb
695
701
  - lib/blacklight/solr/response/spelling.rb
696
702
  - lib/blacklight/solr/search_builder_behavior.rb
@@ -881,7 +887,7 @@ homepage: http://projectblacklight.org/
881
887
  licenses:
882
888
  - Apache 2.0
883
889
  metadata: {}
884
- post_install_message:
890
+ post_install_message:
885
891
  rdoc_options: []
886
892
  require_paths:
887
893
  - lib
@@ -896,8 +902,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
896
902
  - !ruby/object:Gem::Version
897
903
  version: '0'
898
904
  requirements: []
899
- rubygems_version: 3.1.4
900
- signing_key:
905
+ rubygems_version: 3.2.3
906
+ signing_key:
901
907
  specification_version: 4
902
908
  summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
903
909
  index.