blacklight 9.0.0.beta1 → 9.0.0.beta3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. checksums.yaml +4 -4
  2. data/.github/matrix.json +47 -0
  3. data/.github/workflows/build.yml +16 -0
  4. data/.github/workflows/lint.yml +25 -0
  5. data/.github/workflows/main.yml +22 -0
  6. data/.github/workflows/release_7_x_scheduled.yml +39 -0
  7. data/.github/workflows/release_8_x_scheduled.yml +39 -0
  8. data/.github/workflows/test.yml +53 -0
  9. data/.rubocop.yml +81 -3
  10. data/.rubocop_todo.yml +43 -67
  11. data/.solr_wrapper.yml +2 -0
  12. data/VERSION +1 -1
  13. data/app/assets/builds/blacklight.css +17 -18
  14. data/app/assets/javascripts/blacklight/blacklight.esm.js +43 -73
  15. data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
  16. data/app/assets/javascripts/blacklight/blacklight.js +43 -73
  17. data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
  18. data/app/assets/stylesheets/blacklight/_blacklight_base.scss +0 -1
  19. data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +4 -0
  20. data/app/assets/stylesheets/blacklight/_facets.scss +2 -2
  21. data/app/assets/stylesheets/blacklight/_header.scss +4 -0
  22. data/app/assets/stylesheets/blacklight/_modal.scss +9 -8
  23. data/app/assets/stylesheets/blacklight/_pagination.scss +1 -3
  24. data/app/assets/stylesheets/blacklight/_search_history.scss +0 -4
  25. data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +3 -0
  26. data/app/components/blacklight/advanced_search_form_component.rb +2 -2
  27. data/app/components/blacklight/constraint_layout_component.html.erb +1 -6
  28. data/app/components/blacklight/constraint_layout_component.rb +9 -0
  29. data/app/components/blacklight/constraints_component.rb +2 -2
  30. data/app/components/blacklight/document/action_component.rb +1 -3
  31. data/app/components/blacklight/document/bookmark_component.html.erb +2 -2
  32. data/app/components/blacklight/document/bookmark_component.rb +2 -2
  33. data/app/components/blacklight/document/more_like_this_component.rb +2 -2
  34. data/app/components/blacklight/document/page_header_component.rb +2 -2
  35. data/app/components/blacklight/document/thumbnail_component.html.erb +3 -7
  36. data/app/components/blacklight/document/thumbnail_component.rb +7 -6
  37. data/app/components/blacklight/document_component.html.erb +3 -3
  38. data/app/components/blacklight/document_component.rb +5 -5
  39. data/app/components/blacklight/document_title_component.rb +6 -10
  40. data/app/components/blacklight/facet_field_checkboxes_component.rb +4 -18
  41. data/app/components/blacklight/facet_field_component.rb +4 -15
  42. data/app/components/blacklight/facet_field_filter_component.rb +4 -19
  43. data/app/components/blacklight/facet_field_inclusive_constraint_component.rb +4 -23
  44. data/app/components/blacklight/facet_field_list_component.rb +4 -30
  45. data/app/components/blacklight/facet_field_no_layout_component.rb +4 -8
  46. data/app/components/blacklight/facet_field_pagination_component.html.erb +2 -2
  47. data/app/components/blacklight/facet_item_component.rb +4 -72
  48. data/app/components/blacklight/facet_item_pivot_component.rb +1 -1
  49. data/app/components/blacklight/facets/checkboxes_component.rb +26 -0
  50. data/app/components/blacklight/facets/count_component.rb +23 -0
  51. data/app/components/blacklight/{facet_field_component.html.erb → facets/field_component.html.erb} +1 -1
  52. data/app/components/blacklight/facets/field_component.rb +23 -0
  53. data/app/components/blacklight/facets/filters_component.html.erb +4 -0
  54. data/app/components/blacklight/facets/filters_component.rb +39 -0
  55. data/app/components/blacklight/{facet_field_inclusive_constraint_component.html.erb → facets/inclusive_constraint_component.html.erb} +1 -1
  56. data/app/components/blacklight/facets/inclusive_constraint_component.rb +31 -0
  57. data/app/components/blacklight/{facet_field_filter_component.html.erb → facets/index_navigation_component.html.erb} +1 -1
  58. data/app/components/blacklight/facets/index_navigation_component.rb +32 -0
  59. data/app/components/blacklight/facets/item_component.rb +73 -0
  60. data/app/components/blacklight/facets/list_component.html.erb +11 -0
  61. data/app/components/blacklight/facets/list_component.rb +40 -0
  62. data/app/components/blacklight/facets/no_layout_component.rb +16 -0
  63. data/app/components/blacklight/facets/selected_value_component.rb +29 -0
  64. data/app/components/blacklight/facets/suggest_component.html.erb +12 -0
  65. data/app/components/blacklight/facets/suggest_component.rb +22 -0
  66. data/app/components/blacklight/icons/remove_component.rb +2 -2
  67. data/app/components/blacklight/metadata_field_plain_text_layout_component.rb +2 -2
  68. data/app/components/blacklight/response/facet_group_component.html.erb +3 -3
  69. data/app/components/blacklight/response/facet_group_component.rb +9 -1
  70. data/app/components/blacklight/system/dropdown_component.html.erb +1 -1
  71. data/app/components/blacklight/system/dropdown_component.rb +1 -1
  72. data/app/components/blacklight/system/flash_message_component.html.erb +1 -1
  73. data/app/components/blacklight/system/flash_message_component.rb +0 -9
  74. data/app/components/blacklight/system/modal_component.html.erb +1 -2
  75. data/app/components/blacklight/top_navbar_component.html.erb +1 -1
  76. data/app/controllers/concerns/blacklight/bookmarks.rb +3 -3
  77. data/app/controllers/concerns/blacklight/catalog.rb +16 -27
  78. data/app/controllers/concerns/blacklight/controller.rb +1 -1
  79. data/app/controllers/concerns/blacklight/facetable.rb +34 -0
  80. data/app/controllers/concerns/blacklight/search_context.rb +1 -1
  81. data/app/controllers/concerns/blacklight/searchable.rb +1 -1
  82. data/app/helpers/blacklight/catalog_helper_behavior.rb +1 -1
  83. data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -2
  84. data/app/helpers/blacklight/document_helper_behavior.rb +3 -1
  85. data/app/helpers/blacklight/facets_helper_behavior.rb +9 -0
  86. data/app/helpers/blacklight/icon_helper_behavior.rb +2 -2
  87. data/app/javascript/blacklight-frontend/bookmark_toggle.js +7 -2
  88. data/app/javascript/blacklight-frontend/checkbox_submit.js +8 -1
  89. data/app/javascript/blacklight-frontend/debounce.js +1 -1
  90. data/app/javascript/blacklight-frontend/facet_suggest.js +23 -3
  91. data/app/javascript/blacklight-frontend/index.js +0 -2
  92. data/app/javascript/blacklight-frontend/modal.js +2 -6
  93. data/app/javascript/blacklight-frontend/search_context.js +3 -2
  94. data/app/models/facet_search_builder.rb +5 -0
  95. data/app/presenters/blacklight/facet_field_presenter.rb +1 -1
  96. data/app/presenters/blacklight/json_presenter.rb +8 -4
  97. data/app/presenters/blacklight/rendering/helper_method.rb +4 -4
  98. data/app/presenters/blacklight/rendering/join.rb +2 -2
  99. data/app/services/blacklight/facet_search_service.rb +44 -0
  100. data/app/services/blacklight/field_retriever.rb +1 -1
  101. data/app/services/blacklight/search_service.rb +6 -6
  102. data/app/values/blacklight/types.rb +2 -2
  103. data/app/views/catalog/_facet_pivot.html.erb +1 -1
  104. data/app/views/catalog/_home_text.html.erb +2 -2
  105. data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
  106. data/app/views/catalog/facet.html.erb +8 -10
  107. data/config/locales/blacklight.ar.yml +14 -13
  108. data/config/locales/blacklight.ca.yml +1 -0
  109. data/config/locales/blacklight.de.yml +13 -12
  110. data/config/locales/blacklight.en.yml +1 -0
  111. data/config/locales/blacklight.es.yml +13 -12
  112. data/config/locales/blacklight.fr.yml +14 -13
  113. data/config/locales/blacklight.hu.yml +15 -14
  114. data/config/locales/blacklight.it.yml +15 -14
  115. data/config/locales/blacklight.nl.yml +13 -12
  116. data/config/locales/blacklight.pt-BR.yml +15 -14
  117. data/config/locales/blacklight.sq.yml +14 -13
  118. data/config/locales/blacklight.zh.yml +11 -10
  119. data/lib/blacklight/abstract_repository.rb +2 -2
  120. data/lib/blacklight/abstract_search_builder.rb +154 -0
  121. data/lib/blacklight/configuration/context.rb +3 -3
  122. data/lib/blacklight/configuration/facet_field.rb +6 -6
  123. data/lib/blacklight/configuration/field.rb +4 -4
  124. data/lib/blacklight/configuration/fields.rb +0 -1
  125. data/lib/blacklight/configuration/search_field.rb +1 -1
  126. data/lib/blacklight/configuration/view_config.rb +2 -2
  127. data/lib/blacklight/configuration.rb +9 -4
  128. data/lib/blacklight/facet_search_builder.rb +18 -0
  129. data/lib/blacklight/nested_open_struct_with_hash_access.rb +1 -1
  130. data/lib/blacklight/open_struct_with_hash_access.rb +2 -2
  131. data/lib/blacklight/search_builder.rb +1 -159
  132. data/lib/blacklight/search_state/filter_field.rb +4 -4
  133. data/lib/blacklight/search_state/pivot_filter_field.rb +4 -4
  134. data/lib/blacklight/solr/abstract_filter_query_builder.rb +77 -0
  135. data/lib/blacklight/solr/default_filter_query_builder.rb +20 -0
  136. data/lib/blacklight/solr/facet_search_builder_behavior.rb +62 -0
  137. data/lib/blacklight/solr/repository.rb +12 -10
  138. data/lib/blacklight/solr/response/facets.rb +2 -2
  139. data/lib/blacklight/solr/response/params.rb +0 -4
  140. data/lib/blacklight/solr/response.rb +5 -1
  141. data/lib/blacklight/solr/search_builder_behavior.rb +17 -132
  142. data/lib/blacklight.rb +6 -4
  143. data/lib/generators/blacklight/assets/importmap_generator.rb +3 -5
  144. data/lib/generators/blacklight/assets_generator.rb +1 -1
  145. data/lib/generators/blacklight/search_builder_generator.rb +1 -1
  146. data/lib/generators/blacklight/templates/.solr_wrapper.yml +2 -0
  147. data/lib/generators/blacklight/templates/catalog_controller.rb +5 -3
  148. data/lib/generators/blacklight/templates/solr/conf/solrconfig.xml +0 -4
  149. data/package.json +3 -3
  150. data/spec/components/blacklight/advanced_search_form_component_spec.rb +18 -22
  151. data/spec/components/blacklight/constraint_layout_component_spec.rb +8 -8
  152. data/spec/components/blacklight/constraints_component_spec.rb +11 -11
  153. data/spec/components/blacklight/document/action_component_spec.rb +23 -15
  154. data/spec/components/blacklight/document/group_component_spec.rb +10 -15
  155. data/spec/components/blacklight/document/page_header_component_spec.rb +35 -28
  156. data/spec/components/blacklight/document/sidebar_component_spec.rb +5 -11
  157. data/spec/components/blacklight/document_component_spec.rb +98 -65
  158. data/spec/components/blacklight/facet_component_spec.rb +12 -8
  159. data/spec/components/blacklight/facet_item_pivot_component_spec.rb +12 -12
  160. data/spec/components/blacklight/{facet_field_checkboxes_component_spec.rb → facets/checkboxes_component_spec.rb} +13 -13
  161. data/spec/components/blacklight/facets/filters_component_spec.rb +36 -0
  162. data/spec/components/blacklight/facets/index_navigation_component_spec.rb +40 -0
  163. data/spec/components/blacklight/{facet_item_component_spec.rb → facets/item_component_spec.rb} +10 -10
  164. data/spec/components/blacklight/{facet_field_list_component_spec.rb → facets/list_component_spec.rb} +23 -23
  165. data/spec/components/blacklight/facets/suggest_component_spec.rb +68 -0
  166. data/spec/components/blacklight/header_component_spec.rb +2 -4
  167. data/spec/components/blacklight/hidden_search_state_component_spec.rb +7 -7
  168. data/spec/components/blacklight/metadata_field_component_spec.rb +17 -15
  169. data/spec/components/blacklight/response/facet_group_component_spec.rb +37 -0
  170. data/spec/components/blacklight/response/pagination_component_spec.rb +1 -1
  171. data/spec/components/blacklight/response/spellcheck_component_spec.rb +1 -1
  172. data/spec/components/blacklight/search_bar_component_spec.rb +4 -4
  173. data/spec/components/blacklight/search_context/server_applied_params_component_spec.rb +2 -2
  174. data/spec/components/blacklight/search_context/server_item_pagination_component_spec.rb +3 -5
  175. data/spec/components/blacklight/skip_link_component_spec.rb +8 -11
  176. data/spec/components/blacklight/start_over_button_component_spec.rb +4 -4
  177. data/spec/components/blacklight/system/dropdown_component_spec.rb +26 -0
  178. data/spec/components/blacklight/system/flash_message_component_spec.rb +7 -11
  179. data/spec/controllers/catalog_controller_spec.rb +12 -20
  180. data/spec/features/facets_spec.rb +70 -7
  181. data/spec/features/modal_spec.rb +1 -1
  182. data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +10 -0
  183. data/spec/lib/blacklight/configuration/facet_field_spec.rb +2 -2
  184. data/spec/lib/blacklight/parameters_spec.rb +12 -1
  185. data/spec/lib/blacklight/search_state/filter_field_spec.rb +18 -0
  186. data/spec/models/blacklight/configuration_spec.rb +52 -28
  187. data/spec/models/blacklight/facet_search_builder_spec.rb +19 -0
  188. data/spec/models/blacklight/search_builder_spec.rb +1 -11
  189. data/spec/models/blacklight/solr/default_filter_query_builder_spec.rb +72 -0
  190. data/spec/models/blacklight/solr/document_spec.rb +0 -4
  191. data/spec/models/blacklight/solr/facet_search_builder_behavior_spec.rb +929 -0
  192. data/spec/models/blacklight/solr/repository_spec.rb +31 -29
  193. data/spec/models/blacklight/solr/response/facets_spec.rb +86 -40
  194. data/spec/models/blacklight/solr/response/group_response_spec.rb +8 -5
  195. data/spec/models/blacklight/solr/response/group_spec.rb +9 -5
  196. data/spec/models/blacklight/solr/response_spec.rb +96 -64
  197. data/spec/models/blacklight/solr/search_builder_behavior_spec.rb +2 -227
  198. data/spec/models/solr_document_spec.rb +5 -1
  199. data/spec/presenters/blacklight/json_presenter_spec.rb +17 -0
  200. data/spec/services/blacklight/search_service_spec.rb +6 -27
  201. data/spec/spec_helper.rb +0 -1
  202. data/spec/support/view_component_test_helpers.rb +0 -18
  203. data/spec/views/catalog/facet.html.erb_spec.rb +10 -3
  204. data/spec/views/catalog/index.atom.builder_spec.rb +6 -3
  205. data/spec/views/catalog/index.html.erb_spec.rb +3 -1
  206. metadata +57 -29
  207. data/.github/workflows/ruby.yml +0 -98
  208. data/app/assets/stylesheets/blacklight/_icons.scss +0 -4
  209. data/app/components/blacklight/facet_field_list_component.html.erb +0 -19
  210. data/app/components/blacklight/search/facet_suggest_input.html.erb +0 -9
  211. data/app/components/blacklight/search/facet_suggest_input.rb +0 -16
  212. data/app/javascript/blacklight-frontend/modalForm.js +0 -60
  213. data/app/views/catalog/_facet_index_navigation.html.erb +0 -1
  214. data/app/views/catalog/_facet_layout.html.erb +0 -8
  215. data/app/views/catalog/_facet_pagination.html.erb +0 -1
  216. data/spec/components/blacklight/document_metadata_component_spec.rb +0 -0
  217. data/spec/components/blacklight/search/facet_suggest_input_spec.rb +0 -33
  218. data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +0 -43
  219. data/spec/views/catalog/_facet_layout.html.erb_spec.rb +0 -41
  220. /data/app/components/blacklight/{facet_field_checkboxes_component.html.erb → facets/checkboxes_component.html.erb} +0 -0
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: 9.0.0.beta1
4
+ version: 9.0.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -16,7 +16,7 @@ authors:
16
16
  - Justin Coyne
17
17
  bindir: exe
18
18
  cert_chain: []
19
- date: 2025-02-06 00:00:00.000000000 Z
19
+ date: 2025-06-27 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rails
@@ -409,8 +409,14 @@ files:
409
409
  - ".docker/app/entrypoint.sh"
410
410
  - ".dockerignore"
411
411
  - ".env"
412
+ - ".github/matrix.json"
412
413
  - ".github/pull_request_template.md"
413
- - ".github/workflows/ruby.yml"
414
+ - ".github/workflows/build.yml"
415
+ - ".github/workflows/lint.yml"
416
+ - ".github/workflows/main.yml"
417
+ - ".github/workflows/release_7_x_scheduled.yml"
418
+ - ".github/workflows/release_8_x_scheduled.yml"
419
+ - ".github/workflows/test.yml"
414
420
  - ".gitignore"
415
421
  - ".hound.yml"
416
422
  - ".jshintrc"
@@ -442,7 +448,6 @@ files:
442
448
  - app/assets/stylesheets/blacklight/_facets.scss
443
449
  - app/assets/stylesheets/blacklight/_group.scss
444
450
  - app/assets/stylesheets/blacklight/_header.scss
445
- - app/assets/stylesheets/blacklight/_icons.scss
446
451
  - app/assets/stylesheets/blacklight/_layout.scss
447
452
  - app/assets/stylesheets/blacklight/_modal.scss
448
453
  - app/assets/stylesheets/blacklight/_pagination.scss
@@ -488,21 +493,34 @@ files:
488
493
  - app/components/blacklight/document_title_component.html.erb
489
494
  - app/components/blacklight/document_title_component.rb
490
495
  - app/components/blacklight/facet_component.rb
491
- - app/components/blacklight/facet_field_checkboxes_component.html.erb
492
496
  - app/components/blacklight/facet_field_checkboxes_component.rb
493
- - app/components/blacklight/facet_field_component.html.erb
494
497
  - app/components/blacklight/facet_field_component.rb
495
- - app/components/blacklight/facet_field_filter_component.html.erb
496
498
  - app/components/blacklight/facet_field_filter_component.rb
497
- - app/components/blacklight/facet_field_inclusive_constraint_component.html.erb
498
499
  - app/components/blacklight/facet_field_inclusive_constraint_component.rb
499
- - app/components/blacklight/facet_field_list_component.html.erb
500
500
  - app/components/blacklight/facet_field_list_component.rb
501
501
  - app/components/blacklight/facet_field_no_layout_component.rb
502
502
  - app/components/blacklight/facet_field_pagination_component.html.erb
503
503
  - app/components/blacklight/facet_field_pagination_component.rb
504
504
  - app/components/blacklight/facet_item_component.rb
505
505
  - app/components/blacklight/facet_item_pivot_component.rb
506
+ - app/components/blacklight/facets/checkboxes_component.html.erb
507
+ - app/components/blacklight/facets/checkboxes_component.rb
508
+ - app/components/blacklight/facets/count_component.rb
509
+ - app/components/blacklight/facets/field_component.html.erb
510
+ - app/components/blacklight/facets/field_component.rb
511
+ - app/components/blacklight/facets/filters_component.html.erb
512
+ - app/components/blacklight/facets/filters_component.rb
513
+ - app/components/blacklight/facets/inclusive_constraint_component.html.erb
514
+ - app/components/blacklight/facets/inclusive_constraint_component.rb
515
+ - app/components/blacklight/facets/index_navigation_component.html.erb
516
+ - app/components/blacklight/facets/index_navigation_component.rb
517
+ - app/components/blacklight/facets/item_component.rb
518
+ - app/components/blacklight/facets/list_component.html.erb
519
+ - app/components/blacklight/facets/list_component.rb
520
+ - app/components/blacklight/facets/no_layout_component.rb
521
+ - app/components/blacklight/facets/selected_value_component.rb
522
+ - app/components/blacklight/facets/suggest_component.html.erb
523
+ - app/components/blacklight/facets/suggest_component.rb
506
524
  - app/components/blacklight/header_component.html.erb
507
525
  - app/components/blacklight/header_component.rb
508
526
  - app/components/blacklight/hidden_search_state_component.rb
@@ -530,8 +548,6 @@ files:
530
548
  - app/components/blacklight/response/view_type_button_component.rb
531
549
  - app/components/blacklight/response/view_type_component.html.erb
532
550
  - app/components/blacklight/response/view_type_component.rb
533
- - app/components/blacklight/search/facet_suggest_input.html.erb
534
- - app/components/blacklight/search/facet_suggest_input.rb
535
551
  - app/components/blacklight/search/per_page_component.html.erb
536
552
  - app/components/blacklight/search/per_page_component.rb
537
553
  - app/components/blacklight/search/sidebar_component.html.erb
@@ -566,6 +582,7 @@ files:
566
582
  - app/controllers/concerns/blacklight/bookmarks.rb
567
583
  - app/controllers/concerns/blacklight/catalog.rb
568
584
  - app/controllers/concerns/blacklight/controller.rb
585
+ - app/controllers/concerns/blacklight/facetable.rb
569
586
  - app/controllers/concerns/blacklight/search_context.rb
570
587
  - app/controllers/concerns/blacklight/search_history.rb
571
588
  - app/controllers/concerns/blacklight/searchable.rb
@@ -591,7 +608,6 @@ files:
591
608
  - app/javascript/blacklight-frontend/facet_suggest.js
592
609
  - app/javascript/blacklight-frontend/index.js
593
610
  - app/javascript/blacklight-frontend/modal.js
594
- - app/javascript/blacklight-frontend/modalForm.js
595
611
  - app/javascript/blacklight-frontend/search_context.js
596
612
  - app/models/blacklight/facet_paginator.rb
597
613
  - app/models/blacklight/icon.rb
@@ -609,6 +625,7 @@ files:
609
625
  - app/models/concerns/blacklight/document/semantic_fields.rb
610
626
  - app/models/concerns/blacklight/suggest/response.rb
611
627
  - app/models/concerns/blacklight/user.rb
628
+ - app/models/facet_search_builder.rb
612
629
  - app/models/record_mailer.rb
613
630
  - app/models/search.rb
614
631
  - app/models/search_builder.rb
@@ -636,6 +653,7 @@ files:
636
653
  - app/presenters/blacklight/thumbnail_presenter.rb
637
654
  - app/services/blacklight/bookmarks_search_builder.rb
638
655
  - app/services/blacklight/document_factory.rb
656
+ - app/services/blacklight/facet_search_service.rb
639
657
  - app/services/blacklight/field_retriever.rb
640
658
  - app/services/blacklight/search_params_yaml_coder.rb
641
659
  - app/services/blacklight/search_service.rb
@@ -655,9 +673,6 @@ files:
655
673
  - app/views/catalog/_document.rss.builder
656
674
  - app/views/catalog/_document_list.html.erb
657
675
  - app/views/catalog/_email_form.html.erb
658
- - app/views/catalog/_facet_index_navigation.html.erb
659
- - app/views/catalog/_facet_layout.html.erb
660
- - app/views/catalog/_facet_pagination.html.erb
661
676
  - app/views/catalog/_facet_pivot.html.erb
662
677
  - app/views/catalog/_field.json.jbuilder
663
678
  - app/views/catalog/_group.html.erb
@@ -740,6 +755,7 @@ files:
740
755
  - db/migrate/20140320000000_add_polymorphic_type_to_bookmarks.rb
741
756
  - lib/blacklight.rb
742
757
  - lib/blacklight/abstract_repository.rb
758
+ - lib/blacklight/abstract_search_builder.rb
743
759
  - lib/blacklight/component.rb
744
760
  - lib/blacklight/configuration.rb
745
761
  - lib/blacklight/configuration/context.rb
@@ -758,6 +774,7 @@ files:
758
774
  - lib/blacklight/configuration/view_config.rb
759
775
  - lib/blacklight/engine.rb
760
776
  - lib/blacklight/exceptions.rb
777
+ - lib/blacklight/facet_search_builder.rb
761
778
  - lib/blacklight/nested_open_struct_with_hash_access.rb
762
779
  - lib/blacklight/open_struct_with_hash_access.rb
763
780
  - lib/blacklight/parameters.rb
@@ -770,8 +787,11 @@ files:
770
787
  - lib/blacklight/search_state/filter_field.rb
771
788
  - lib/blacklight/search_state/pivot_filter_field.rb
772
789
  - lib/blacklight/solr.rb
790
+ - lib/blacklight/solr/abstract_filter_query_builder.rb
791
+ - lib/blacklight/solr/default_filter_query_builder.rb
773
792
  - lib/blacklight/solr/document.rb
774
793
  - lib/blacklight/solr/facet_paginator.rb
794
+ - lib/blacklight/solr/facet_search_builder_behavior.rb
775
795
  - lib/blacklight/solr/repository.rb
776
796
  - lib/blacklight/solr/request.rb
777
797
  - lib/blacklight/solr/response.rb
@@ -832,25 +852,28 @@ files:
832
852
  - spec/components/blacklight/document/page_header_component_spec.rb
833
853
  - spec/components/blacklight/document/sidebar_component_spec.rb
834
854
  - spec/components/blacklight/document_component_spec.rb
835
- - spec/components/blacklight/document_metadata_component_spec.rb
836
855
  - spec/components/blacklight/facet_component_spec.rb
837
- - spec/components/blacklight/facet_field_checkboxes_component_spec.rb
838
- - spec/components/blacklight/facet_field_list_component_spec.rb
839
- - spec/components/blacklight/facet_item_component_spec.rb
840
856
  - spec/components/blacklight/facet_item_pivot_component_spec.rb
857
+ - spec/components/blacklight/facets/checkboxes_component_spec.rb
858
+ - spec/components/blacklight/facets/filters_component_spec.rb
859
+ - spec/components/blacklight/facets/index_navigation_component_spec.rb
860
+ - spec/components/blacklight/facets/item_component_spec.rb
861
+ - spec/components/blacklight/facets/list_component_spec.rb
862
+ - spec/components/blacklight/facets/suggest_component_spec.rb
841
863
  - spec/components/blacklight/header_component_spec.rb
842
864
  - spec/components/blacklight/hidden_search_state_component_spec.rb
843
865
  - spec/components/blacklight/icons/icon_component_spec.rb
844
866
  - spec/components/blacklight/metadata_field_component_spec.rb
867
+ - spec/components/blacklight/response/facet_group_component_spec.rb
845
868
  - spec/components/blacklight/response/pagination_component_spec.rb
846
869
  - spec/components/blacklight/response/spellcheck_component_spec.rb
847
870
  - spec/components/blacklight/response/view_type_component_spec.rb
848
- - spec/components/blacklight/search/facet_suggest_input_spec.rb
849
871
  - spec/components/blacklight/search_bar_component_spec.rb
850
872
  - spec/components/blacklight/search_context/server_applied_params_component_spec.rb
851
873
  - spec/components/blacklight/search_context/server_item_pagination_component_spec.rb
852
874
  - spec/components/blacklight/skip_link_component_spec.rb
853
875
  - spec/components/blacklight/start_over_button_component_spec.rb
876
+ - spec/components/blacklight/system/dropdown_component_spec.rb
854
877
  - spec/components/blacklight/system/flash_message_component_spec.rb
855
878
  - spec/controllers/alternate_controller_spec.rb
856
879
  - spec/controllers/application_controller_spec.rb
@@ -914,10 +937,13 @@ files:
914
937
  - spec/models/blacklight/document/dublin_core_spec.rb
915
938
  - spec/models/blacklight/document_spec.rb
916
939
  - spec/models/blacklight/facet_paginator_spec.rb
940
+ - spec/models/blacklight/facet_search_builder_spec.rb
917
941
  - spec/models/blacklight/icon_spec.rb
918
942
  - spec/models/blacklight/search_builder_spec.rb
943
+ - spec/models/blacklight/solr/default_filter_query_builder_spec.rb
919
944
  - spec/models/blacklight/solr/document_spec.rb
920
945
  - spec/models/blacklight/solr/facet_paginator_spec.rb
946
+ - spec/models/blacklight/solr/facet_search_builder_behavior_spec.rb
921
947
  - spec/models/blacklight/solr/repository_spec.rb
922
948
  - spec/models/blacklight/solr/request_spec.rb
923
949
  - spec/models/blacklight/solr/response/facets_spec.rb
@@ -961,8 +987,6 @@ files:
961
987
  - spec/test_app_templates/lib/generators/test_app_generator.rb
962
988
  - spec/views/catalog/_document.html.erb_spec.rb
963
989
  - spec/views/catalog/_document_list.html.erb_spec.rb
964
- - spec/views/catalog/_facet_index_navigation.html.erb_spec.rb
965
- - spec/views/catalog/_facet_layout.html.erb_spec.rb
966
990
  - spec/views/catalog/_paginate_compact.html.erb_spec.rb
967
991
  - spec/views/catalog/_sort_and_per_page.html.erb_spec.rb
968
992
  - spec/views/catalog/_sort_widget.html.erb_spec.rb
@@ -1011,25 +1035,28 @@ test_files:
1011
1035
  - spec/components/blacklight/document/page_header_component_spec.rb
1012
1036
  - spec/components/blacklight/document/sidebar_component_spec.rb
1013
1037
  - spec/components/blacklight/document_component_spec.rb
1014
- - spec/components/blacklight/document_metadata_component_spec.rb
1015
1038
  - spec/components/blacklight/facet_component_spec.rb
1016
- - spec/components/blacklight/facet_field_checkboxes_component_spec.rb
1017
- - spec/components/blacklight/facet_field_list_component_spec.rb
1018
- - spec/components/blacklight/facet_item_component_spec.rb
1019
1039
  - spec/components/blacklight/facet_item_pivot_component_spec.rb
1040
+ - spec/components/blacklight/facets/checkboxes_component_spec.rb
1041
+ - spec/components/blacklight/facets/filters_component_spec.rb
1042
+ - spec/components/blacklight/facets/index_navigation_component_spec.rb
1043
+ - spec/components/blacklight/facets/item_component_spec.rb
1044
+ - spec/components/blacklight/facets/list_component_spec.rb
1045
+ - spec/components/blacklight/facets/suggest_component_spec.rb
1020
1046
  - spec/components/blacklight/header_component_spec.rb
1021
1047
  - spec/components/blacklight/hidden_search_state_component_spec.rb
1022
1048
  - spec/components/blacklight/icons/icon_component_spec.rb
1023
1049
  - spec/components/blacklight/metadata_field_component_spec.rb
1050
+ - spec/components/blacklight/response/facet_group_component_spec.rb
1024
1051
  - spec/components/blacklight/response/pagination_component_spec.rb
1025
1052
  - spec/components/blacklight/response/spellcheck_component_spec.rb
1026
1053
  - spec/components/blacklight/response/view_type_component_spec.rb
1027
- - spec/components/blacklight/search/facet_suggest_input_spec.rb
1028
1054
  - spec/components/blacklight/search_bar_component_spec.rb
1029
1055
  - spec/components/blacklight/search_context/server_applied_params_component_spec.rb
1030
1056
  - spec/components/blacklight/search_context/server_item_pagination_component_spec.rb
1031
1057
  - spec/components/blacklight/skip_link_component_spec.rb
1032
1058
  - spec/components/blacklight/start_over_button_component_spec.rb
1059
+ - spec/components/blacklight/system/dropdown_component_spec.rb
1033
1060
  - spec/components/blacklight/system/flash_message_component_spec.rb
1034
1061
  - spec/controllers/alternate_controller_spec.rb
1035
1062
  - spec/controllers/application_controller_spec.rb
@@ -1093,10 +1120,13 @@ test_files:
1093
1120
  - spec/models/blacklight/document/dublin_core_spec.rb
1094
1121
  - spec/models/blacklight/document_spec.rb
1095
1122
  - spec/models/blacklight/facet_paginator_spec.rb
1123
+ - spec/models/blacklight/facet_search_builder_spec.rb
1096
1124
  - spec/models/blacklight/icon_spec.rb
1097
1125
  - spec/models/blacklight/search_builder_spec.rb
1126
+ - spec/models/blacklight/solr/default_filter_query_builder_spec.rb
1098
1127
  - spec/models/blacklight/solr/document_spec.rb
1099
1128
  - spec/models/blacklight/solr/facet_paginator_spec.rb
1129
+ - spec/models/blacklight/solr/facet_search_builder_behavior_spec.rb
1100
1130
  - spec/models/blacklight/solr/repository_spec.rb
1101
1131
  - spec/models/blacklight/solr/request_spec.rb
1102
1132
  - spec/models/blacklight/solr/response/facets_spec.rb
@@ -1140,8 +1170,6 @@ test_files:
1140
1170
  - spec/test_app_templates/lib/generators/test_app_generator.rb
1141
1171
  - spec/views/catalog/_document.html.erb_spec.rb
1142
1172
  - spec/views/catalog/_document_list.html.erb_spec.rb
1143
- - spec/views/catalog/_facet_index_navigation.html.erb_spec.rb
1144
- - spec/views/catalog/_facet_layout.html.erb_spec.rb
1145
1173
  - spec/views/catalog/_paginate_compact.html.erb_spec.rb
1146
1174
  - spec/views/catalog/_sort_and_per_page.html.erb_spec.rb
1147
1175
  - spec/views/catalog/_sort_widget.html.erb_spec.rb
@@ -1,98 +0,0 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support
4
- # documentation.
5
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
-
8
- name: CI
9
-
10
- on:
11
- push:
12
- branches:
13
- - main
14
- - "release-*"
15
- pull_request:
16
-
17
- jobs:
18
- lint:
19
- runs-on: ubuntu-latest
20
- steps:
21
- - uses: actions/checkout@v4
22
- - name: Set up Ruby
23
- uses: ruby/setup-ruby@v1
24
- with:
25
- ruby-version: 3.2
26
- bundler: "latest"
27
- - name: Change permissions
28
- run: "chmod -f -R o-w /opt/hostedtoolcache/Ruby/3.2.5/x64/lib/ruby/gems/3.2.0/gems | :"
29
- - name: Install dependencies
30
- run: bundle install
31
- - name: Run linter
32
- run: bundle exec rake rubocop
33
- test:
34
- runs-on: ubuntu-latest
35
- name: test (ruby ${{ matrix.ruby }} / rails ${{ matrix.rails_version }} ${{ matrix.additional_name }})
36
- strategy:
37
- fail-fast: false
38
- matrix:
39
- ruby: ["3.3"]
40
- rails_version: ["7.1.5.1", "7.2.2.1"]
41
- bootstrap_version: [null]
42
- view_component_version: ["~> 3.12"]
43
- api: [null]
44
- additional_engine_cart_rails_options: [""]
45
- additional_name: [""]
46
- include:
47
- - ruby: "3.3"
48
- rails_version: "8.0.1"
49
- additional_engine_cart_rails_options: --css=bootstrap
50
- - ruby: "3.3"
51
- rails_version: "8.0.1"
52
- additional_engine_cart_rails_options: --css=bootstrap --js=esbuild
53
- additional_name: "/ esbuild"
54
- - ruby: "3.2"
55
- rails_version: "7.1.5.1"
56
- solr_version: "8.11.2"
57
- additional_name: "Solr 8.11.2"
58
- - ruby: "3.1"
59
- rails_version: "7.1.5.1"
60
- - ruby: "3.3"
61
- rails_version: "7.1.5.1"
62
- additional_name: "/ Propshaft"
63
- additional_engine_cart_rails_options: -a propshaft --css=bootstrap
64
- - ruby: "3.3"
65
- rails_version: "7.1.5.1"
66
- api: "true"
67
- additional_engine_cart_rails_options: --api --skip-yarn
68
- additional_name: "/ API"
69
- - ruby: "3.3"
70
- rails_version: "7.2.2.1"
71
- additional_engine_cart_rails_options: -a propshaft --css=bootstrap --js=esbuild
72
- additional_name: "/ Propshaft, esbuild"
73
- env:
74
- RAILS_VERSION: ${{ matrix.rails_version }}
75
- SOLR_VERSION: ${{ matrix.solr_version || 'latest' }}
76
- VIEW_COMPONENT_VERSION: ${{ matrix.view_component_version }}
77
- BOOTSTRAP_VERSION: ${{ matrix.bootstrap_version }}
78
- BLACKLIGHT_API_TEST: ${{ matrix.api }}
79
- ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-kamal --skip-solid --skip-coffee --skip-test ${{ matrix.additional_engine_cart_rails_options }}"
80
- steps:
81
- - uses: actions/checkout@v4
82
- - name: Set up Ruby
83
- uses: ruby/setup-ruby@v1
84
- with:
85
- bundler: "latest"
86
- ruby-version: ${{ matrix.ruby }}
87
- - name: Change permissions
88
- run: "chmod -f -R o-w /opt/hostedtoolcache/Ruby/3.2.5/x64/lib/ruby/gems/3.2.0/gems | :"
89
- - name: Install dependencies
90
- run: bundle install
91
- - name: Run tests
92
- run: bundle exec rake ci
93
- docker_build:
94
- runs-on: ubuntu-latest
95
- steps:
96
- - uses: actions/checkout@v4
97
- - name: Build docker image
98
- run: docker compose build app
@@ -1,4 +0,0 @@
1
- .remove .bi {
2
- height: 1em;
3
- width: 1em;
4
- }
@@ -1,19 +0,0 @@
1
- <%= render(@layout.new(facet_field: @facet_field)) do |component| %>
2
- <% component.with_label do %>
3
- <%= @facet_field.label %>
4
- <% end %>
5
- <% component.with_body do %>
6
- <%= render(Blacklight::FacetFieldInclusiveConstraintComponent.new(facet_field: @facet_field)) %>
7
- <ul class="facet-values list-unstyled">
8
- <%= render facet_items %>
9
- </ul>
10
- <%# backwards compatibility, ugh %>
11
- <% if @layout == Blacklight::FacetFieldNoLayoutComponent && !@facet_field.in_modal? && @facet_field.modal_path %>
12
- <div class="more_facets">
13
- <%= link_to t("more_#{@facet_field.key}_html", scope: 'blacklight.search.facets', default: :more_html, field_name: @facet_field.label),
14
- @facet_field.modal_path,
15
- data: { blacklight_modal: 'trigger' } %>
16
- </div>
17
- <% end %>
18
- <% end %>
19
- <% end %>
@@ -1,9 +0,0 @@
1
- <label for="facet-suggest-<%= facet.key %>">
2
- <%= I18n.t('blacklight.search.facets.suggest.label', field_label: presenter&.label) %>
3
- </label>
4
- <input class="facet-suggest form-control"
5
- id="facet-suggest-<%= facet.key %>"
6
- data-facet-field="<%= facet.key %>"
7
- name="facet_suggest_<%= facet.key %>"
8
- placeholder="<%= I18n.t('blacklight.search.form.search.placeholder') %>">
9
- </input>
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Blacklight
4
- module Search
5
- class FacetSuggestInput < Blacklight::Component
6
- def initialize(facet:, presenter:)
7
- @facet = facet
8
- @presenter = presenter
9
- end
10
-
11
- private
12
-
13
- attr_accessor :facet, :presenter
14
- end
15
- end
16
- end
@@ -1,60 +0,0 @@
1
- // The email and sms forms are displayed inside a modal. When the form is submitted,
2
- // this script closes the modal and puts the output on the main part of the page.
3
- // By default it is rendering catalog/sms_success and catalog/email_succcess.
4
- // These templates deliver a payload of the format used by turbo-streams.
5
- // See https://turbo.hotwired.dev/handbook/streams
6
- // That format allows a downstream application to override the template to define
7
- // multiple customizable areas of the page to get updated.
8
- export default class {
9
- constructor(errorHandler, badRequestHandler, hideModal) {
10
- this.errorHandler = errorHandler
11
- this.badRequestHandler = badRequestHandler
12
- this.hideModal = hideModal
13
- }
14
-
15
- get triggerFormSelector() {
16
- return 'form[data-blacklight-modal~=trigger]'
17
- }
18
-
19
- bind() {
20
- document.addEventListener('submit', (e) => {
21
- if (e.target.matches(this.triggerFormSelector))
22
- this.onSubmit(e)
23
- })
24
- }
25
-
26
- // This is like a light-weight version of turbo that only supports append presently.
27
- updateTurboStream(data) {
28
- this.hideModal()
29
- const domparser = new DOMParser();
30
- const dom = domparser.parseFromString(data, "text/html")
31
- dom.querySelectorAll("turbo-stream[action='append']").forEach((node) => {
32
- const target = node.getAttribute('target')
33
- const element = document.getElementById(target)
34
- if (element)
35
- element.append(node.querySelector('template').content.cloneNode(true))
36
- else
37
- console.error(`Unable to find an element on the page with and ID of "${target}""`)
38
- })
39
- }
40
-
41
- onSubmit(e) {
42
- e.preventDefault();
43
- const form = e.target
44
- fetch(form.action, {
45
- body: new FormData(form),
46
- headers: { "X-Requested-With": "XMLHttpRequest" }, // Ensures rails will return true when checking request.xhr?
47
- method: form.method,
48
- })
49
- .then(response => {
50
- if (response.status === 422) {
51
- return response.text().then(content => this.badRequestHandler(content) )
52
- }
53
- if (!response.ok) {
54
- throw new TypeError("Request failed");
55
- }
56
- response.text().then(content => this.updateTurboStream(content))
57
- })
58
- .catch(error => this.errorHandler(error))
59
- }
60
- }
@@ -1 +0,0 @@
1
- <%= render(Blacklight::FacetFieldFilterComponent.new(facet_field: facet_field_presenter(@facet, @display_facet))) %>
@@ -1,8 +0,0 @@
1
- <%= render(Blacklight::FacetFieldComponent.new(facet_field: facet_field_presenter(facet_field, nil))) do |component| %>
2
- <% component.with_label do %>
3
- <%= facet_field_label(facet_field.key) %>
4
- <% end %>
5
- <% component.with_body do %>
6
- <%= yield %>
7
- <% end %>
8
- <% end %>
@@ -1 +0,0 @@
1
- <%= render(Blacklight::FacetFieldPaginationComponent.new(facet_field: facet_field_presenter(@facet, @display_facet))) %>
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- RSpec.describe Blacklight::Search::FacetSuggestInput, type: :component do
6
- let(:facet) { Blacklight::Configuration::FacetField.new key: 'language_facet' }
7
- let(:presenter) { instance_double(Blacklight::FacetFieldPresenter) }
8
-
9
- before do
10
- allow(presenter).to receive(:label).and_return 'Language'
11
- end
12
-
13
- it 'has an input with the facet-suggest class, which the javascript needs to find it' do
14
- rendered = render_inline(described_class.new(facet: facet, presenter: presenter))
15
- expect(rendered.css("input.facet-suggest").count).to eq 1
16
- end
17
-
18
- it 'has an input with the data-facet-field attribute, which the javascript needs to determine the correct query' do
19
- rendered = render_inline(described_class.new(facet: facet, presenter: presenter))
20
- expect(rendered.css('input[data-facet-field="language_facet"]').count).to eq 1
21
- end
22
-
23
- it 'has a visible label that is associated with the input' do
24
- rendered = render_inline(described_class.new(facet: facet, presenter: presenter))
25
- label = rendered.css('label').first
26
- expect(label.text.strip).to eq 'Filter Language'
27
-
28
- id_in_label_for = label.attribute('for').text
29
- expect(id_in_label_for).to eq('facet-suggest-language_facet')
30
-
31
- expect(rendered.css('input').first.attribute('id').text).to eq id_in_label_for
32
- end
33
- end
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe 'catalog/_facet_index_navigation.html.erb' do
4
- let(:pagination) { Blacklight::Solr::FacetPaginator.new([]) }
5
- let(:facet) { Blacklight::Configuration::FacetField.new(index_range: '0'..'9', presenter: Blacklight::FacetFieldPresenter) }
6
- let(:display_facet) { double(items: [], offset: 0, prefix: '', sort: 'index') }
7
- let(:blacklight_config) { Blacklight::Configuration.new }
8
-
9
- before do
10
- assign(:display_facet, display_facet)
11
- assign(:facet, facet)
12
- allow(view).to receive_messages(blacklight_config: blacklight_config, facet_limit_for: 10)
13
- controller.request.path_parameters[:action] = 'index'
14
- end
15
-
16
- it 'renders the facet index navigation range' do
17
- render
18
- expect(rendered).to have_css '.pagination'
19
- expect(rendered).to have_link '0', href: '/?facet.prefix=0&facet.sort=index'
20
- expect(rendered).to have_link '1'
21
- expect(rendered).to have_link '8'
22
- expect(rendered).to have_link '9'
23
- end
24
-
25
- it 'renders an "all" button' do
26
- render
27
- expect(rendered).to have_css '.page-link', text: 'All'
28
- end
29
-
30
- context 'with a selected index' do
31
- let(:display_facet) { double(items: [], offset: 0, prefix: '5', sort: 'index') }
32
-
33
- it 'highlights the selected index' do
34
- render
35
- expect(rendered).to have_css '.active', text: '5'
36
- end
37
-
38
- it 'enables the clear facets button' do
39
- render
40
- expect(rendered).to have_link 'All'
41
- end
42
- end
43
- end
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe "catalog/facet_layout" do
4
- let :blacklight_config do
5
- Blacklight::Configuration.new do |config|
6
- config.facet_fields[facet_field.field] = facet_field
7
- end
8
- end
9
-
10
- let :facet_field do
11
- Blacklight::Configuration::FacetField.new(field: 'some_field').normalize!
12
- end
13
-
14
- before do
15
- allow(view).to receive_messages(blacklight_config: blacklight_config)
16
- end
17
-
18
- it "has a facet-specific class" do
19
- render partial: 'catalog/facet_layout', locals: { facet_field: facet_field }
20
- expect(rendered).to have_css '.blacklight-some_field'
21
- end
22
-
23
- it "has a title with a link for a11y" do
24
- render partial: 'catalog/facet_layout', locals: { facet_field: facet_field }
25
- expect(rendered).to have_css 'h3', text: 'Some Field'
26
- end
27
-
28
- it "is collapsable" do
29
- render partial: 'catalog/facet_layout', locals: { facet_field: facet_field }
30
- expect(rendered).to have_css 'button.collapsed[data-toggle="collapse"][data-bs-toggle="collapse"][aria-expanded="false"]'
31
- expect(rendered).to have_css '.collapse .accordion-body'
32
- end
33
-
34
- it "is configured to be open by default" do
35
- allow(facet_field).to receive_messages(collapse: false)
36
- render partial: 'catalog/facet_layout', locals: { facet_field: facet_field }
37
- expect(rendered).to have_css 'button[data-toggle="collapse"][data-bs-toggle="collapse"][aria-expanded="true"]'
38
- expect(rendered).to have_no_css '.accordion-header.collapsed'
39
- expect(rendered).to have_css '.collapse.show .accordion-body'
40
- end
41
- end