blacklight 8.13.0 → 9.0.0.beta1

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 (242) hide show
  1. checksums.yaml +4 -4
  2. data/.env +3 -3
  3. data/.github/pull_request_template.md +7 -0
  4. data/.github/workflows/ruby.yml +98 -0
  5. data/.rubocop.yml +8 -151
  6. data/.rubocop_todo.yml +53 -74
  7. data/.solr_wrapper.yml +0 -2
  8. data/README.md +30 -8
  9. data/VERSION +1 -1
  10. data/app/assets/builds/blacklight.css +448 -0
  11. data/app/assets/javascripts/blacklight/blacklight.esm.js +8 -51
  12. data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
  13. data/app/assets/javascripts/blacklight/blacklight.js +8 -51
  14. data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
  15. data/app/assets/stylesheets/blacklight/_balanced_list.scss +1 -4
  16. data/app/assets/stylesheets/blacklight/_blacklight_base.scss +1 -3
  17. data/app/assets/stylesheets/blacklight/_bookmark.scss +44 -41
  18. data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +0 -29
  19. data/app/assets/stylesheets/blacklight/_constraints.scss +15 -24
  20. data/app/assets/stylesheets/blacklight/_controls.scss +2 -18
  21. data/app/assets/stylesheets/blacklight/_facets.scss +15 -82
  22. data/app/assets/stylesheets/blacklight/_group.scss +2 -5
  23. data/app/assets/stylesheets/blacklight/_header.scss +4 -11
  24. data/app/assets/stylesheets/blacklight/_icons.scss +0 -8
  25. data/app/assets/stylesheets/blacklight/_modal.scss +9 -10
  26. data/app/assets/stylesheets/blacklight/_pagination.scss +3 -5
  27. data/app/assets/stylesheets/blacklight/_search_form.scss +0 -1
  28. data/app/assets/stylesheets/blacklight/_search_history.scss +0 -4
  29. data/app/assets/stylesheets/blacklight/_search_results.scss +1 -15
  30. data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +9 -17
  31. data/app/assets/stylesheets/blacklight/build.scss +4 -0
  32. data/app/components/blacklight/advanced_search_form_component.rb +3 -3
  33. data/app/components/blacklight/constraint_component.rb +1 -1
  34. data/app/components/blacklight/constraint_layout_component.html.erb +2 -2
  35. data/app/components/blacklight/constraints_component.html.erb +2 -2
  36. data/app/components/blacklight/constraints_component.rb +3 -3
  37. data/app/components/blacklight/document/action_component.rb +3 -1
  38. data/app/components/blacklight/document/bookmark_component.html.erb +3 -3
  39. data/app/components/blacklight/document/bookmark_component.rb +2 -3
  40. data/app/components/blacklight/document/group_component.html.erb +1 -1
  41. data/app/components/blacklight/document/more_like_this_component.rb +2 -2
  42. data/app/components/blacklight/document/page_header_component.rb +3 -3
  43. data/app/components/blacklight/document/sidebar_component.rb +5 -5
  44. data/app/components/blacklight/document_component.rb +14 -20
  45. data/app/components/blacklight/document_title_component.rb +3 -2
  46. data/app/components/blacklight/facet_field_component.html.erb +5 -5
  47. data/app/components/blacklight/facet_field_list_component.rb +4 -22
  48. data/app/components/blacklight/facet_field_pagination_component.html.erb +2 -2
  49. data/app/components/blacklight/facet_item_component.rb +2 -2
  50. data/app/components/blacklight/facet_item_pivot_component.rb +2 -2
  51. data/app/components/blacklight/header_component.rb +2 -2
  52. data/app/components/blacklight/metadata_field_plain_text_layout_component.rb +2 -2
  53. data/app/components/blacklight/response/facet_group_component.html.erb +3 -18
  54. data/app/components/blacklight/response/facet_group_component.rb +7 -23
  55. data/app/components/blacklight/response/facet_toggle_button_component.html.erb +16 -0
  56. data/app/components/blacklight/response/facet_toggle_button_component.rb +14 -0
  57. data/app/components/blacklight/response/pagination_component.html.erb +1 -1
  58. data/app/components/blacklight/response/pagination_component.rb +2 -1
  59. data/app/components/blacklight/response/sort_component.rb +1 -0
  60. data/app/components/blacklight/response/view_type_button_component.html.erb +1 -1
  61. data/app/components/blacklight/response/view_type_component.html.erb +1 -1
  62. data/app/components/blacklight/search/facet_suggest_input.html.erb +7 -10
  63. data/app/components/blacklight/search/facet_suggest_input.rb +0 -4
  64. data/app/components/blacklight/search/per_page_component.html.erb +1 -1
  65. data/app/components/blacklight/search/per_page_component.rb +1 -0
  66. data/app/components/blacklight/search/sidebar_component.html.erb +1 -1
  67. data/app/components/blacklight/search/sidebar_component.rb +1 -1
  68. data/app/components/blacklight/search_bar_component.html.erb +3 -3
  69. data/app/components/blacklight/search_bar_component.rb +2 -2
  70. data/app/components/blacklight/search_button_component.rb +2 -2
  71. data/app/components/blacklight/search_context/server_applied_params_component.html.erb +2 -2
  72. data/app/components/blacklight/search_context/server_applied_params_component.rb +9 -0
  73. data/app/components/blacklight/skip_link_component.html.erb +1 -1
  74. data/app/components/blacklight/skip_link_component.rb +2 -1
  75. data/app/components/blacklight/system/dropdown_component.html.erb +1 -1
  76. data/app/components/blacklight/system/dropdown_component.rb +1 -1
  77. data/app/components/blacklight/top_navbar_component.html.erb +1 -1
  78. data/app/controllers/concerns/blacklight/bookmarks.rb +5 -5
  79. data/app/controllers/concerns/blacklight/catalog.rb +3 -2
  80. data/app/controllers/concerns/blacklight/search_context.rb +2 -14
  81. data/app/controllers/concerns/blacklight/search_history.rb +1 -1
  82. data/app/helpers/blacklight/blacklight_helper_behavior.rb +0 -6
  83. data/app/helpers/blacklight/catalog_helper_behavior.rb +0 -10
  84. data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -14
  85. data/app/helpers/blacklight/document_helper_behavior.rb +0 -26
  86. data/app/helpers/blacklight/icon_helper_behavior.rb +3 -11
  87. data/app/helpers/blacklight/render_partials_helper_behavior.rb +0 -14
  88. data/app/helpers/blacklight/url_helper_behavior.rb +1 -1
  89. data/app/javascript/{blacklight → blacklight-frontend}/bookmark_toggle.js +1 -1
  90. data/app/javascript/{blacklight → blacklight-frontend}/core.js +2 -10
  91. data/app/javascript/{blacklight → blacklight-frontend}/debounce.js +1 -1
  92. data/app/javascript/blacklight-frontend/facet_suggest.js +26 -0
  93. data/app/javascript/blacklight-frontend/index.js +18 -0
  94. data/app/javascript/{blacklight → blacklight-frontend}/modal.js +2 -14
  95. data/app/javascript/{blacklight → blacklight-frontend}/search_context.js +2 -3
  96. data/app/models/blacklight/icon.rb +2 -3
  97. data/app/models/concerns/blacklight/document.rb +0 -11
  98. data/app/models/concerns/blacklight/user.rb +1 -2
  99. data/app/presenters/blacklight/json_presenter.rb +3 -1
  100. data/app/presenters/blacklight/rendering/helper_method.rb +4 -4
  101. data/app/presenters/blacklight/rendering/join.rb +2 -2
  102. data/app/presenters/blacklight/rendering/microdata.rb +0 -1
  103. data/app/services/blacklight/search_params_yaml_coder.rb +0 -2
  104. data/app/values/blacklight/types.rb +2 -2
  105. data/app/views/bookmarks/_clear_bookmarks_widget.html.erb +0 -2
  106. data/app/views/bookmarks/index.html.erb +1 -1
  107. data/app/views/catalog/_document.atom.builder +1 -1
  108. data/app/views/catalog/_document.html.erb +1 -1
  109. data/app/views/catalog/_email_form.html.erb +2 -2
  110. data/app/views/catalog/_results_pagination.html.erb +2 -5
  111. data/app/views/catalog/_search_results.html.erb +3 -3
  112. data/app/views/catalog/_search_results_header.html.erb +1 -1
  113. data/app/views/catalog/_show_main_content.html.erb +1 -1
  114. data/app/views/catalog/_sms_form.html.erb +2 -2
  115. data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
  116. data/app/views/catalog/_sort_widget.html.erb +1 -0
  117. data/app/views/catalog/facet.html.erb +9 -9
  118. data/app/views/catalog/show.html.erb +2 -3
  119. data/app/views/kaminari/blacklight/_paginator.html.erb +1 -2
  120. data/app/views/layouts/blacklight/base.html.erb +3 -7
  121. data/app/views/search_history/index.html.erb +0 -2
  122. data/blacklight.gemspec +5 -5
  123. data/config/importmap.rb +1 -1
  124. data/config/locales/blacklight.ar.yml +4 -4
  125. data/config/locales/blacklight.ca.yml +124 -124
  126. data/config/locales/blacklight.de.yml +2 -2
  127. data/config/locales/blacklight.en.yml +14 -14
  128. data/config/locales/blacklight.es.yml +4 -4
  129. data/config/locales/blacklight.fr.yml +4 -4
  130. data/config/locales/blacklight.hu.yml +4 -4
  131. data/config/locales/blacklight.it.yml +3 -3
  132. data/config/locales/blacklight.nl.yml +3 -3
  133. data/config/locales/blacklight.pt-BR.yml +3 -3
  134. data/config/locales/blacklight.sq.yml +4 -4
  135. data/config/locales/blacklight.zh.yml +4 -4
  136. data/lib/blacklight/abstract_repository.rb +2 -2
  137. data/lib/blacklight/component.rb +1 -4
  138. data/lib/blacklight/configuration/context.rb +3 -3
  139. data/lib/blacklight/configuration/field.rb +10 -10
  140. data/lib/blacklight/configuration/sort_field.rb +2 -2
  141. data/lib/blacklight/configuration/view_config.rb +2 -4
  142. data/lib/blacklight/configuration.rb +4 -10
  143. data/lib/blacklight/engine.rb +0 -6
  144. data/lib/blacklight/nested_open_struct_with_hash_access.rb +1 -1
  145. data/lib/blacklight/open_struct_with_hash_access.rb +2 -2
  146. data/lib/blacklight/parameters.rb +1 -1
  147. data/lib/blacklight/search_state/filter_field.rb +4 -4
  148. data/lib/blacklight/search_state/pivot_filter_field.rb +1 -1
  149. data/lib/blacklight/solr/request.rb +2 -8
  150. data/lib/blacklight/solr/response/facets.rb +2 -2
  151. data/lib/blacklight/solr/response.rb +1 -4
  152. data/lib/generators/blacklight/assets/importmap_generator.rb +10 -51
  153. data/lib/generators/blacklight/assets/propshaft_generator.rb +1 -1
  154. data/lib/generators/blacklight/assets_generator.rb +3 -3
  155. data/lib/generators/blacklight/controller_generator.rb +3 -3
  156. data/lib/generators/blacklight/search_builder_generator.rb +1 -1
  157. data/lib/generators/blacklight/templates/.solr_wrapper.yml +0 -2
  158. data/lib/generators/blacklight/templates/solr/conf/schema.xml +178 -264
  159. data/lib/generators/blacklight/templates/solr/conf/solrconfig.xml +18 -6
  160. data/lib/generators/blacklight/user_generator.rb +9 -10
  161. data/package.json +14 -4
  162. data/rollup.config.js +1 -1
  163. data/spec/components/blacklight/document/action_component_spec.rb +2 -6
  164. data/spec/components/blacklight/document/group_component_spec.rb +1 -1
  165. data/spec/components/blacklight/document/sidebar_component_spec.rb +5 -20
  166. data/spec/components/blacklight/document_component_spec.rb +19 -24
  167. data/spec/components/blacklight/facet_component_spec.rb +2 -2
  168. data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +2 -2
  169. data/spec/components/blacklight/facet_field_list_component_spec.rb +3 -3
  170. data/spec/components/blacklight/search/facet_suggest_input_spec.rb +3 -27
  171. data/spec/components/blacklight/search_bar_component_spec.rb +1 -1
  172. data/spec/controllers/blacklight/catalog_spec.rb +1 -1
  173. data/spec/controllers/catalog_controller_spec.rb +3 -3
  174. data/spec/features/advanced_search_spec.rb +12 -12
  175. data/spec/features/axe_spec.rb +6 -11
  176. data/spec/features/bookmarks_spec.rb +60 -23
  177. data/spec/features/did_you_mean_spec.rb +17 -17
  178. data/spec/features/facet_missing_spec.rb +3 -3
  179. data/spec/features/facets_spec.rb +22 -90
  180. data/spec/features/modal_spec.rb +1 -1
  181. data/spec/features/record_view_spec.rb +14 -14
  182. data/spec/features/search_context_spec.rb +8 -9
  183. data/spec/features/search_filters_spec.rb +18 -18
  184. data/spec/features/search_formats_spec.rb +2 -2
  185. data/spec/features/search_history_spec.rb +11 -11
  186. data/spec/features/search_pagination_spec.rb +9 -9
  187. data/spec/features/search_results_spec.rb +3 -3
  188. data/spec/features/search_sort_spec.rb +4 -4
  189. data/spec/features/search_spec.rb +15 -15
  190. data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +0 -9
  191. data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +1 -1
  192. data/spec/helpers/blacklight/url_helper_behavior_spec.rb +14 -14
  193. data/spec/helpers/blacklight_helper_spec.rb +0 -6
  194. data/spec/helpers/catalog_helper_spec.rb +6 -6
  195. data/spec/lib/blacklight/open_struct_with_hash_access_spec.rb +0 -7
  196. data/spec/lib/blacklight/parameters_spec.rb +1 -12
  197. data/spec/lib/blacklight/search_state/filter_field_spec.rb +0 -18
  198. data/spec/lib/blacklight/search_state/pivot_filter_field_spec.rb +1 -1
  199. data/spec/models/blacklight/solr/request_spec.rb +7 -0
  200. data/spec/models/record_mailer_spec.rb +5 -5
  201. data/spec/models/solr_document_spec.rb +1 -5
  202. data/spec/presenters/blacklight/index_presenter_spec.rb +0 -1
  203. data/spec/presenters/blacklight/rendering/pipeline_spec.rb +0 -1
  204. data/spec/presenters/blacklight/show_presenter_spec.rb +0 -1
  205. data/spec/presenters/blacklight/thumbnail_presenter_spec.rb +0 -1
  206. data/spec/services/blacklight/search_service_spec.rb +1 -1
  207. data/spec/support/presenter_test_helpers.rb +1 -1
  208. data/spec/views/catalog/_document.html.erb_spec.rb +4 -4
  209. data/spec/views/catalog/_facet_layout.html.erb_spec.rb +3 -3
  210. data/spec/views/catalog/_sort_and_per_page.html.erb_spec.rb +5 -5
  211. data/spec/views/catalog/facet.html.erb_spec.rb +1 -9
  212. data/spec/views/catalog/index.atom.builder_spec.rb +0 -2
  213. data/spec/views/catalog/index.html.erb_spec.rb +7 -4
  214. data/spec/views/catalog/show.html.erb_spec.rb +4 -3
  215. data/tasks/blacklight.rake +8 -5
  216. metadata +34 -65
  217. data/.github/matrix.json +0 -109
  218. data/.github/workflows/build.yml +0 -16
  219. data/.github/workflows/lint.yml +0 -25
  220. data/.github/workflows/main.yml +0 -24
  221. data/.github/workflows/test.yml +0 -57
  222. data/app/assets/stylesheets/blacklight/_autocomplete.scss +0 -25
  223. data/app/assets/stylesheets/blacklight/_mixins.scss +0 -20
  224. data/app/components/blacklight/icons/legacy_icon_component.rb +0 -30
  225. data/app/javascript/blacklight/facet_suggest.js +0 -48
  226. data/app/javascript/blacklight/index.js +0 -18
  227. data/app/views/catalog/_constraints.html.erb +0 -1
  228. data/app/views/catalog/_facets.html.erb +0 -5
  229. data/app/views/catalog/_search_form.html.erb +0 -7
  230. data/app/views/catalog/_search_header.html.erb +0 -1
  231. data/app/views/catalog/_show_sidebar.html.erb +0 -3
  232. data/app/views/catalog/_show_tools.html.erb +0 -2
  233. data/app/views/catalog/_start_over.html.erb +0 -1
  234. data/app/views/shared/_header_navbar.html.erb +0 -1
  235. data/lib/generators/blacklight/assets/sprockets_generator.rb +0 -68
  236. data/spec/components/blacklight/system/dropdown_component_spec.rb +0 -26
  237. data/spec/views/catalog/_search_header.erb_spec.rb +0 -14
  238. data/spec/views/catalog/_show_sidebar.erb_spec.rb +0 -24
  239. data/spec/views/catalog/_show_tools.html.erb_spec.rb +0 -37
  240. /data/app/javascript/{blacklight → blacklight-frontend}/button_focus.js +0 -0
  241. /data/app/javascript/{blacklight → blacklight-frontend}/checkbox_submit.js +0 -0
  242. /data/app/javascript/{blacklight → blacklight-frontend}/modalForm.js +0 -0
@@ -2,7 +2,7 @@
2
2
  en:
3
3
  blacklight:
4
4
  advanced_search:
5
- any_of: 'Any of:'
5
+ any_of: "Any of:"
6
6
  form:
7
7
  limit_criteria_heading_html: "<strong>AND</strong> have these attributes"
8
8
  query_criteria_heading_html: Match %{select_menu} of the fields below
@@ -49,25 +49,25 @@ en:
49
49
  apa: APA
50
50
  chicago: Chicago
51
51
  mla: MLA
52
- did_you_mean: 'Did you mean to type: %{options}?'
52
+ did_you_mean: "Did you mean to type: %{options}?"
53
53
  email:
54
54
  errors:
55
55
  to:
56
56
  blank: You must enter a recipient in order to send this message
57
57
  invalid: You must enter a valid email address
58
58
  form:
59
- message: 'Message:'
59
+ message: "Message:"
60
60
  submit: Send
61
61
  title: Email This
62
- to: 'Email:'
62
+ to: "Email:"
63
63
  success: Email Sent
64
64
  text:
65
65
  default_title: N/A
66
- message: 'Message: %{message}'
66
+ message: "Message: %{message}"
67
67
  subject:
68
- one: 'Item Record: %{title}'
68
+ one: "Item Record: %{title}"
69
69
  other: Item records
70
- url: 'URL: %{url}'
70
+ url: "URL: %{url}"
71
71
  entry_name:
72
72
  default:
73
73
  one: entry
@@ -111,7 +111,7 @@ en:
111
111
  close: Hide facets
112
112
  open: Show facets
113
113
  missing: "[Missing]"
114
- more_html: more <span class="sr-only visually-hidden">%{field_name}</span> »
114
+ more_html: more <span class="visually-hidden">%{field_name}</span> »
115
115
  pivot:
116
116
  hide: Hide
117
117
  show: Show
@@ -127,9 +127,9 @@ en:
127
127
  filters:
128
128
  label: "%{label}:"
129
129
  remove:
130
- label_value: 'Remove constraint %{label}: %{value}'
130
+ label_value: "Remove constraint %{label}: %{value}"
131
131
  value: Remove constraint %{value}
132
- title: 'You searched for:'
132
+ title: "You searched for:"
133
133
  form:
134
134
  search:
135
135
  label: search for
@@ -160,7 +160,7 @@ en:
160
160
  aria_label: Results navigation
161
161
  button_label: "%{count} per page"
162
162
  button_label_html: '%{count}<span class="d-none d-sm-inline"> per page</span>'
163
- label: '%{count}<span class="sr-only visually-hidden"> per page</span>'
163
+ label: '%{count}<span class="visually-hidden"> per page</span>'
164
164
  submit: Update
165
165
  title: Number of results to display per page
166
166
  rss_feed: RSS for results
@@ -176,7 +176,7 @@ en:
176
176
  start_over: Start Over
177
177
  view:
178
178
  list: List
179
- view_title: 'View results as: '
179
+ view_title: "View results as: "
180
180
  zero_results:
181
181
  modify_search: Try modifying your search
182
182
  search_everything: try searching everything
@@ -213,10 +213,10 @@ en:
213
213
  carrier_prompt: Please select your carrier
214
214
  submit: Send
215
215
  title: SMS This
216
- to: 'Phone Number:'
216
+ to: "Phone Number:"
217
217
  success: SMS Sent
218
218
  text:
219
- url: 'Link: %{url}'
219
+ url: "Link: %{url}"
220
220
  tools:
221
221
  citation: Cite
222
222
  clear: Clear
@@ -92,7 +92,7 @@ es:
92
92
  close: Ocultar facetas
93
93
  open: Mostrar facetas
94
94
  missing: "[Falta]"
95
- more_html: más <span class="sr-only visually-hidden">%{field_name}</span> »
95
+ more_html: más <span class="visually-hidden">%{field_name}</span> »
96
96
  pivot:
97
97
  hide: Cerrar
98
98
  show: Abierto
@@ -102,8 +102,8 @@ es:
102
102
  count: Ordenación numérica
103
103
  index: Ordenación A-Z
104
104
  suggest:
105
- label: Filtro %{field_label}
106
- placeholder: Filtrar...
105
+ label: Filter %{field_label}
106
+ placeholder: Filter...
107
107
  title: Limite su búsqueda
108
108
  filters:
109
109
  label: "%{label}:"
@@ -141,7 +141,7 @@ es:
141
141
  aria_label: Navegación de resultados
142
142
  button_label: "%{count} por página"
143
143
  button_label_html: '%{count}<span class="d-none d-sm-inline"> por página</span>'
144
- label: '%{count}<span class="sr-only visually-hidden"> por página</span>'
144
+ label: '%{count}<span class="visually-hidden"> por página</span>'
145
145
  submit: Actualización
146
146
  title: El número de resultados a mostrar por página
147
147
  rss_feed: RSS de los resultados
@@ -92,7 +92,7 @@ fr:
92
92
  close: Masquer les facettes
93
93
  open: Afficher les facettes
94
94
  missing: "[manquante]"
95
- more_html: plus <span class="sr-only visually-hidden">%{field_name}</span> »
95
+ more_html: plus <span class="visually-hidden">%{field_name}</span> »
96
96
  pivot:
97
97
  hide: Fermer
98
98
  show: Ouvrir
@@ -102,8 +102,8 @@ fr:
102
102
  count: Du + au - fréquent
103
103
  index: Tri de A à Z
104
104
  suggest:
105
- label: Filtre %{field_label}
106
- placeholder: Filtre...
105
+ label: Filter %{field_label}
106
+ placeholder: Filter...
107
107
  title: Limiter votre recherche
108
108
  filters:
109
109
  label: "%{label}:"
@@ -141,7 +141,7 @@ fr:
141
141
  aria_label: Navigation dans les résultats
142
142
  button_label: "%{count} par page"
143
143
  button_label_html: '%{count}<span class="d-none d-sm-inline"> par page</span>'
144
- label: '%{count}<span class="sr-only visually-hidden"> par page</span>'
144
+ label: '%{count}<span class="visually-hidden"> par page</span>'
145
145
  submit: mettre à jour
146
146
  title: Nombre de résultats à afficher par page
147
147
  rss_feed: RSS pour les résultats
@@ -90,7 +90,7 @@ hu:
90
90
  close: Fazetek elrejtése
91
91
  open: Szempontok megjelenítése
92
92
  missing: "[Hiányzó]"
93
- more_html: több <span class="sr-only visually-hidden">%{field_name}</span> »
93
+ more_html: több <span class="visually-hidden">%{field_name}</span> »
94
94
  pivot:
95
95
  hide: Bezárás
96
96
  show: Megnyitás
@@ -100,8 +100,8 @@ hu:
100
100
  count: Numerikus rendezés
101
101
  index: A-Z rendezés
102
102
  suggest:
103
- label: Szűrő %{field_label}
104
- placeholder: Szűrő...
103
+ label: Filter %{field_label}
104
+ placeholder: Filter...
105
105
  title: Szűrje tovább a keresését
106
106
  filters:
107
107
  label: "%{label}:"
@@ -139,7 +139,7 @@ hu:
139
139
  aria_label: Eredmények navigáció
140
140
  button_label: "%{count} oldalanként"
141
141
  button_label_html: '%{count}<span class="d-none d-sm-inline"> oldalanként</span>'
142
- label: '%{count}<span class="sr-only visually-hidden"> oldalanként</span>'
142
+ label: '%{count}<span class="visually-hidden"> oldalanként</span>'
143
143
  submit: Frissítés
144
144
  title: Az eredmények száma oldalanként
145
145
  rss_feed: Eredmények RSS-ként
@@ -103,8 +103,8 @@ it:
103
103
  count: Ordina per numero
104
104
  index: Ordina A-Z
105
105
  suggest:
106
- label: Filtro %{field_label}
107
- placeholder: Filtro...
106
+ label: Filter %{field_label}
107
+ placeholder: Filter...
108
108
  title: Affina la ricerca
109
109
  filters:
110
110
  label: "%{label}:"
@@ -142,7 +142,7 @@ it:
142
142
  aria_label: Navigazione dei risultati
143
143
  button_label: "%{count} per pagina"
144
144
  button_label_html: '%{count}<span class="d-none d-sm-inline"> per pagina</span>'
145
- label: '%{count}<span class="sr-only visually-hidden"> per pagina</span>'
145
+ label: '%{count}<span class="visually-hidden"> per pagina</span>'
146
146
  submit: Aggiorna
147
147
  title: Risultati per pagina
148
148
  rss_feed: RSS per i risultati
@@ -90,7 +90,7 @@ nl:
90
90
  close: Verberg facetten
91
91
  open: Toon facetten
92
92
  missing: "[Ontbrekend]"
93
- more_html: Meer <span class="sr-only visually-hidden">%{field_name}</span> »
93
+ more_html: Meer <span class="visually-hidden">%{field_name}</span> »
94
94
  pivot:
95
95
  hide: Sluiten
96
96
  show: Openen
@@ -100,7 +100,7 @@ nl:
100
100
  count: Numeriek sorteren
101
101
  index: A-Z Sorteren
102
102
  suggest:
103
- label: Filteren %{field_label}
103
+ label: Filter %{field_label}
104
104
  placeholder: Filter...
105
105
  title: Verfijn uw zoekopdracht
106
106
  filters:
@@ -139,7 +139,7 @@ nl:
139
139
  aria_label: Resultaten navigatie
140
140
  button_label: "%{count} per pagina"
141
141
  button_label_html: '%{count}<span class="d-none d-sm-inline"> per pagina</span>'
142
- label: '%{count}<span class="sr-only visually-hidden"> per pagina</span>'
142
+ label: '%{count}<span class="visually-hidden"> per pagina</span>'
143
143
  submit: Update
144
144
  title: Toon aantal zoekresultaten per pagina
145
145
  rss_feed: RSS voor zoekresultaten
@@ -91,7 +91,7 @@ pt-BR:
91
91
  open: Mostrar facetas
92
92
  missing:
93
93
  - Ausência
94
- more_html: mais <span class="sr-only visually-hidden">%{field_name}</span> »
94
+ more_html: mais <span class="visually-hidden">%{field_name}</span> »
95
95
  pivot:
96
96
  hide: Fechar
97
97
  show: Abrir
@@ -101,8 +101,8 @@ pt-BR:
101
101
  count: Ordenar por Número
102
102
  index: Ordem Alfabética A-Z
103
103
  suggest:
104
- label: Filtro %{field_label}
105
- placeholder: Filtro...
104
+ label: Filter %{field_label}
105
+ placeholder: Filter...
106
106
  title: Filtre sua busca
107
107
  filters:
108
108
  label: "%{label}:"
@@ -90,7 +90,7 @@ sq:
90
90
  close: Fshih aspektet
91
91
  open: Trego aspektet
92
92
  missing: "[Mungon]"
93
- more_html: Më shumë <span class="sr-only visually-hidden">%{field_name}</span> »
93
+ more_html: Më shumë <span class="visually-hidden">%{field_name}</span> »
94
94
  pivot:
95
95
  hide: Mbylle
96
96
  show: Hape
@@ -100,8 +100,8 @@ sq:
100
100
  count: Renditja numerike
101
101
  index: A-Z Renditja
102
102
  suggest:
103
- label: Filtri %{field_label}
104
- placeholder: Filtro...
103
+ label: Filter %{field_label}
104
+ placeholder: Filter...
105
105
  title: Kufizo këkimin
106
106
  filters:
107
107
  label: "%{label}:"
@@ -139,7 +139,7 @@ sq:
139
139
  aria_label: Rezultatet e lundrimit
140
140
  button_label: "%{count} për faqe"
141
141
  button_label_html: '%{count}<span class="d-none d-sm-inline"> për faqe</span>'
142
- label: '%{count}<span class="sr-only visually-hidden"> për faqe</span>'
142
+ label: '%{count}<span class="visually-hidden"> për faqe</span>'
143
143
  submit: Përditëso
144
144
  title: Numri i rezultateve që do të shfaqen për faqe
145
145
  rss_feed: RSS për rezultatet
@@ -90,7 +90,7 @@ zh:
90
90
  close: 隐藏方面
91
91
  open: 显示方面
92
92
  missing: "[未找到]"
93
- more_html: 更多 <span class="sr-only visually-hidden">%{field_name}</span> »
93
+ more_html: 更多 <span class="visually-hidden">%{field_name}</span> »
94
94
  pivot:
95
95
  hide: 关
96
96
  show: 打开
@@ -100,8 +100,8 @@ zh:
100
100
  count: 按数量排序
101
101
  index: 按字母排序
102
102
  suggest:
103
- label: 过滤器 %{field_label}
104
- placeholder: 筛选...
103
+ label: Filter %{field_label}
104
+ placeholder: Filter...
105
105
  title: 限定搜索
106
106
  filters:
107
107
  label: "%{label}:"
@@ -139,7 +139,7 @@ zh:
139
139
  aria_label: 结果导航
140
140
  button_label: "%{count} 每页"
141
141
  button_label_html: '%{count}<span class="d-none d-sm-inline"> 每页</span>'
142
- label: '%{count}<span class="sr-only visually-hidden"> 每页</span>'
142
+ label: '%{count}<span class="visually-hidden"> 每页</span>'
143
143
  submit: 更新
144
144
  title: 每页显示结果数
145
145
  rss_feed: 搜索结果RSS
@@ -37,8 +37,8 @@ module Blacklight
37
37
 
38
38
  # Find multiple documents by their ids
39
39
  # @param [Hash] _params query parameters
40
- def find_many(params, **)
41
- search(params, **)
40
+ def find_many(params, **kwargs)
41
+ search(params, **kwargs)
42
42
  end
43
43
 
44
44
  ##
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'view_component/version'
4
-
5
3
  module Blacklight
6
4
  class Component < ViewComponent::Base
7
5
  class << self
@@ -13,8 +11,7 @@ module Blacklight
13
11
 
14
12
  def sidecar_files(*args, **kwargs)
15
13
  upstream_sidecar_files(*args, **kwargs).map do |path|
16
- components_path = ViewComponent::VERSION::MAJOR < 4 ? view_component_path : config.generate.path
17
- app_path = Rails.root.join(path.slice(path.index(components_path)..-1).to_s).to_s
14
+ app_path = Rails.root.join(path.slice(path.index(view_component_path)..-1).to_s).to_s
18
15
 
19
16
  if File.exist?(app_path)
20
17
  app_path
@@ -24,16 +24,16 @@ module Blacklight
24
24
  #
25
25
  # @param [#if,#unless] config an object that responds to if/unless
26
26
  # @return [Boolean]
27
- def evaluate_if_unless_configuration(config, *)
27
+ def evaluate_if_unless_configuration(config, *args)
28
28
  return config if config == true || config == false
29
29
 
30
30
  if_value = !config.respond_to?(:if) ||
31
31
  config.if.nil? ||
32
- evaluate_configuration_conditional(config.if, config, *)
32
+ evaluate_configuration_conditional(config.if, config, *args)
33
33
 
34
34
  unless_value = !config.respond_to?(:unless) ||
35
35
  config.unless.nil? ||
36
- !evaluate_configuration_conditional(config.unless, config, *)
36
+ !evaluate_configuration_conditional(config.unless, config, *args)
37
37
 
38
38
  if_value && unless_value
39
39
  end
@@ -17,37 +17,37 @@ module Blacklight
17
17
 
18
18
  def normalize! _blacklight_config = nil
19
19
  self.field ||= key
20
- self.key ||= field
20
+ self.key ||= self.field
21
21
 
22
22
  self.label ||= default_label
23
23
 
24
24
  self.if = true if self.if.nil?
25
25
  self.unless = false if self.unless.nil?
26
26
 
27
- self.field &&= field.to_s
27
+ self.field &&= self.field.to_s
28
28
 
29
29
  self
30
30
  end
31
31
 
32
32
  def validate!
33
- raise ArgumentError, "Must supply a field name" if field.nil?
33
+ raise ArgumentError, "Must supply a field name" if self.field.nil?
34
34
  end
35
35
 
36
- def display_label(context = nil, **)
36
+ def display_label(context = nil, **options)
37
37
  field_label(
38
38
  (:"blacklight.search.fields.#{context}.#{key}" if context),
39
39
  :"blacklight.search.fields.#{key}",
40
40
  label,
41
41
  default_label,
42
- **
42
+ **options
43
43
  )
44
44
  end
45
45
 
46
46
  def default_label
47
- if key.respond_to?(:titleize)
48
- key.titleize
47
+ if self.key.respond_to?(:titleize)
48
+ self.key.titleize
49
49
  else
50
- key.to_s.titleize
50
+ self.key.to_s.titleize
51
51
  end
52
52
  end
53
53
 
@@ -65,10 +65,10 @@ module Blacklight
65
65
  # before falling back to the label
66
66
  # @param [Symbol] any number of additional keys
67
67
  # @param [Symbol] ...
68
- def field_label(*i18n_keys, **)
68
+ def field_label *i18n_keys, **options
69
69
  first, *rest = i18n_keys.compact
70
70
 
71
- I18n.t(first, default: rest, **)
71
+ I18n.t(first, default: rest, **options)
72
72
  end
73
73
  end
74
74
  end
@@ -10,13 +10,13 @@ module Blacklight
10
10
  self.field ||= label&.parameterize
11
11
  self.field ||= sort
12
12
 
13
- self.sort ||= field
13
+ self.sort ||= self.field
14
14
 
15
15
  self
16
16
  end
17
17
 
18
18
  def validate!
19
- raise ArgumentError.new, "Must supply a sort string" if sort.nil?
19
+ raise ArgumentError.new, "Must supply a sort string" if self.sort.nil?
20
20
  end
21
21
  end
22
22
  end
@@ -4,8 +4,6 @@ class Blacklight::Configuration
4
4
  class ViewConfig < Blacklight::OpenStructWithHashAccess
5
5
  # @!attribute template
6
6
  # @return [String] partial to render around the documents
7
- # @!attribute partials
8
- # @return [Array<String>] partials to render for each document(see #render_document_partials)
9
7
  # @!attribute document_presenter_class
10
8
  # @return [Class] document presenter class used by helpers and views
11
9
  # @!attribute document_component
@@ -26,7 +24,7 @@ class Blacklight::Configuration
26
24
  # @return [Class] component class used to render the search bar
27
25
  # @!attribute search_header_component
28
26
  # @return [Class] component class used to render the header above the documents
29
- def display_label(**)
27
+ def display_label(**options)
30
28
  I18n.t(
31
29
  :"blacklight.search.view_title.#{key}",
32
30
  default: [
@@ -35,7 +33,7 @@ class Blacklight::Configuration
35
33
  title,
36
34
  key.to_s.humanize
37
35
  ],
38
- **
36
+ **options
39
37
  )
40
38
  end
41
39
 
@@ -138,8 +138,8 @@ module Blacklight
138
138
  # @!attribute bookmark_icon_component
139
139
  # @since v8.3.1
140
140
  # component class used to render a document
141
- # set to Blacklight::Icons::BookmarkIconComponent to replace checkbox with icon
142
- property :bookmark_icon_component, default: nil
141
+ # set to nil if a checkbox is prefered to the icon
142
+ property :bookmark_icon_component, default: Blacklight::Icons::BookmarkIconComponent
143
143
 
144
144
  # @!attribute index
145
145
  # General configuration for all views
@@ -157,8 +157,6 @@ module Blacklight
157
157
  display_type_field: nil,
158
158
  # the "field access" key to use to look up the document display fields
159
159
  document_fields_key: :index_fields,
160
- # partials to render for each document(see #render_document_partials)
161
- partials: [],
162
160
  document_actions: NestedOpenStructWithHashAccess.new(ToolConfig),
163
161
  collection_actions: NestedOpenStructWithHashAccess.new(ToolConfig),
164
162
  # what field, if any, to use to render grouped results
@@ -166,7 +164,7 @@ module Blacklight
166
164
  # additional response formats for search results
167
165
  respond_to: OpenStructWithHashAccess.new,
168
166
  # component class used to render the facet grouping
169
- facet_group_component: nil,
167
+ facet_group_component: Blacklight::Response::FacetGroupComponent,
170
168
  # component class used to render search constraints
171
169
  constraints_component: Blacklight::ConstraintsComponent,
172
170
  # component class used to render the search bar
@@ -184,9 +182,7 @@ module Blacklight
184
182
  # document presenter class used by helpers and views
185
183
  document_presenter_class: nil,
186
184
  document_component: Blacklight::DocumentComponent,
187
- # in Blacklight 9, the default show_tools_component configuration will
188
- # be Blacklight::Document::ShowToolsComponent
189
- show_tools_component: nil,
185
+ show_tools_component: Blacklight::Document::ShowToolsComponent,
190
186
  show_header_tools_component: nil,
191
187
  document_header_component: Blacklight::Document::PageHeaderComponent,
192
188
  sidebar_component: Blacklight::Document::SidebarComponent,
@@ -197,8 +193,6 @@ module Blacklight
197
193
  # Set this to a hash with additional arguments to merge into the route,
198
194
  # or set `controller: :current` to route to the current controller.
199
195
  route: nil,
200
- # partials to render for each document(see #render_document_partials)
201
- partials: [],
202
196
  document_actions: NestedOpenStructWithHashAccess.new(ToolConfig),
203
197
  header_actions: NestedOpenStructWithHashAccess.new(ToolConfig)
204
198
  )
@@ -72,12 +72,6 @@ module Blacklight
72
72
  outer_window: 2
73
73
  }
74
74
 
75
- # Blacklight 9 moves the next button after the page numbers. This behavior can be configured
76
- # in Blacklight 8 by setting the next_button_position to :after
77
- bl_global_config.paginator = {
78
- next_button_position: :before
79
- }
80
-
81
75
  bl_global_config.search_params_permitted_classes = [ActiveSupport::HashWithIndifferentAccess, Symbol]
82
76
 
83
77
  # Anything that goes into Blacklight::Engine.config is stored as a class
@@ -114,7 +114,7 @@ module Blacklight
114
114
 
115
115
  def set_default_proc!
116
116
  self.default_proc = lambda do |hash, key|
117
- hash[key] = nested_class.new({ key: key })
117
+ hash[key] = nested_class.new(key: key)
118
118
  end
119
119
  end
120
120
  end
@@ -57,7 +57,7 @@ module Blacklight
57
57
  self.class.new @table.deep_transform_values(&)
58
58
  end
59
59
 
60
- def try(method_name = nil, *, &)
60
+ def try(method_name = nil, *args, &)
61
61
  if method_name.nil? && block_given?
62
62
  if b.arity.zero?
63
63
  instance_eval(&)
@@ -65,7 +65,7 @@ module Blacklight
65
65
  yield self
66
66
  end
67
67
  elsif respond_to?(method_name)
68
- public_send(method_name, *, &)
68
+ public_send(method_name, *args, &b)
69
69
  end
70
70
  end
71
71
  end
@@ -79,7 +79,7 @@ module Blacklight
79
79
  # Facebook's crawler turns array query parameters into a hash with numeric keys. Once we know
80
80
  # the expected parameter structure, we can unmangle those parameters to match our expected values.
81
81
  def deep_unmangle_params!(params, permitted_params)
82
- permitted_params.grep(Hash).each do |permission|
82
+ permitted_params.select { |p| p.is_a?(Hash) }.each do |permission|
83
83
  permission.each do |key, permitted_value|
84
84
  next unless params[key].is_a?(ActionController::Parameters)
85
85
 
@@ -120,8 +120,8 @@ module Blacklight
120
120
  delegate :any?, to: :values
121
121
 
122
122
  # Appease rubocop rules by implementing #each_value
123
- def each_value(except: [], &)
124
- values(except: except).each(&)
123
+ def each_value(except: [], &block)
124
+ values(except: except).each(&block)
125
125
  end
126
126
 
127
127
  # @param [String,#value] item a filter to remove from the url
@@ -145,8 +145,8 @@ module Blacklight
145
145
  def permitted_params
146
146
  if config.pivot
147
147
  {
148
- filters_key => config.pivot.each_with_object({}) { |key, filter| filter.merge!(key => [], "-#{key}" => []) },
149
- inclusive_filters_key => config.pivot.each_with_object({}) { |key, filter| filter.merge!(key => []) }
148
+ filters_key => config.pivot.each_with_object({}) { |key, filter| filter.merge(key => [], "-#{key}" => []) },
149
+ inclusive_filters_key => config.pivot.each_with_object({}) { |key, filter| filter.merge(key => []) }
150
150
  }
151
151
  else
152
152
  {
@@ -102,7 +102,7 @@ module Blacklight
102
102
  end
103
103
  queries.uniq!
104
104
  end
105
- [queries - existing]
105
+ [(queries - existing)]
106
106
  end
107
107
  end
108
108
 
@@ -2,13 +2,7 @@
2
2
 
3
3
  class Blacklight::Solr::InvalidParameter < ArgumentError; end
4
4
 
5
- class Blacklight::Solr::Request < ActiveSupport::HashWithIndifferentAccess # rubocop:disable Style/OneClassPerFile
6
- # @deprecated
7
- SINGULAR_KEYS = %w(facet fl q qt rows start spellcheck spellcheck.q sort per_page wt hl group defType)
8
-
9
- # @deprecated
10
- ARRAY_KEYS = %w(facet.field facet.query facet.pivot fq hl.fl)
11
-
5
+ class Blacklight::Solr::Request < ActiveSupport::HashWithIndifferentAccess
12
6
  def initialize(constructor = {})
13
7
  if constructor.is_a?(Hash)
14
8
  super()
@@ -42,7 +36,7 @@ class Blacklight::Solr::Request < ActiveSupport::HashWithIndifferentAccess # rub
42
36
  self[:json][:query] ||= { bool: { bool_operator => [] } }
43
37
  self[:json][:query][:bool][bool_operator] ||= []
44
38
 
45
- if self['q']
39
+ if self['q'].present?
46
40
  self[:json][:query][:bool][:must] ||= []
47
41
  self[:json][:query][:bool][:must] << self['q']
48
42
  delete 'q'
@@ -229,7 +229,7 @@ module Blacklight::Solr::Response::Facets
229
229
 
230
230
  blacklight_config.facet_fields.select { |_k, v| v.query }.each_with_object({}) do |(field_name, facet_field), hash|
231
231
  salient_facet_queries = facet_field.query.map { |_k, x| x[:fq] }
232
- items = facet_queries.slice(*salient_facet_queries).reject { |_value, hits| hits.zero? }.map do |value, hits|
232
+ items = facet_queries.select { |k, _v| salient_facet_queries.include?(k) }.reject { |_value, hits| hits.zero? }.map do |value, hits|
233
233
  salient_fields = facet_field.query.select { |_key, val| val[:fq] == value }
234
234
  key = ((salient_fields.keys if salient_fields.respond_to? :keys) || salient_fields.first).first
235
235
  Blacklight::Solr::Response::Facets::FacetItem.new(value: key, hits: hits, label: facet_field.query[key][:label])
@@ -250,7 +250,7 @@ module Blacklight::Solr::Response::Facets
250
250
 
251
251
  salient_facet_queries = facet_field.query.map { |_k, x| x[:fq] }
252
252
 
253
- relevant_facet_data = self['facets'].slice(*salient_facet_queries).reject { |_key, data| data['count'].zero? }
253
+ relevant_facet_data = self['facets'].select { |k, _v| salient_facet_queries.include?(k) }.reject { |_key, data| data['count'].zero? }
254
254
 
255
255
  relevant_facet_data.map do |key, data|
256
256
  salient_fields = facet_field.query.select { |_key, val| val[:fq] == key }
@@ -64,10 +64,8 @@ class Blacklight::Solr::Response < ActiveSupport::HashWithIndifferentAccess
64
64
  case value
65
65
  when Hash
66
66
  value.each { |k, v| value[k] = force_to_utf8(v) }
67
- value
68
67
  when Array
69
68
  value.each { |v| force_to_utf8(v) }
70
- value
71
69
  when String
72
70
  if value.encoding == Encoding::UTF_8
73
71
  value
@@ -75,8 +73,7 @@ class Blacklight::Solr::Response < ActiveSupport::HashWithIndifferentAccess
75
73
  Blacklight.logger&.warn "Found a non utf-8 value in Blacklight::Solr::Response. \"#{value}\" Encoding is #{value.encoding}"
76
74
  value.dup.force_encoding('UTF-8')
77
75
  end
78
- else
79
- value
80
76
  end
77
+ value
81
78
  end
82
79
  end