blacklight 7.37.0 → 8.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (400) hide show
  1. checksums.yaml +4 -4
  2. data/.env +2 -3
  3. data/.github/workflows/ruby.yml +33 -133
  4. data/.rubocop.yml +241 -2
  5. data/.rubocop_todo.yml +214 -270
  6. data/Gemfile +7 -10
  7. data/README.md +11 -3
  8. data/VERSION +1 -1
  9. data/app/assets/javascripts/blacklight/blacklight.esm.js +384 -0
  10. data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -0
  11. data/app/assets/javascripts/blacklight/blacklight.js +374 -493
  12. data/app/assets/javascripts/blacklight/blacklight.js.map +1 -0
  13. data/app/assets/stylesheets/blacklight/_autocomplete.scss +25 -0
  14. data/app/assets/stylesheets/blacklight/_blacklight_base.scss +1 -1
  15. data/app/assets/stylesheets/blacklight/_bookmark.scss +16 -0
  16. data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +8 -0
  17. data/app/assets/stylesheets/blacklight/_facets.scss +72 -44
  18. data/app/assets/stylesheets/blacklight/_header.scss +0 -15
  19. data/app/assets/stylesheets/blacklight/_icons.scss +0 -14
  20. data/app/assets/stylesheets/blacklight/_mixins.scss +20 -0
  21. data/app/assets/stylesheets/blacklight/_modal.scss +8 -2
  22. data/app/assets/stylesheets/blacklight/_search_form.scss +30 -3
  23. data/app/assets/stylesheets/blacklight/_search_history.scss +10 -1
  24. data/app/assets/stylesheets/blacklight/_search_results.scss +6 -2
  25. data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +4 -1
  26. data/app/builders/blacklight/action_builder.rb +18 -9
  27. data/app/components/blacklight/advanced_search_form_component.html.erb +2 -2
  28. data/app/components/blacklight/advanced_search_form_component.rb +8 -10
  29. data/app/components/blacklight/constraints_component.rb +27 -37
  30. data/app/components/blacklight/document/action_component.rb +9 -9
  31. data/app/components/blacklight/document/actions_component.rb +2 -2
  32. data/app/components/blacklight/document/bookmark_component.html.erb +9 -0
  33. data/app/components/blacklight/document/bookmark_component.rb +4 -2
  34. data/app/components/blacklight/document/citation_component.rb +5 -3
  35. data/app/components/blacklight/document/group_component.rb +7 -3
  36. data/app/components/blacklight/document/sidebar_component.html.erb +2 -0
  37. data/app/components/blacklight/document/sidebar_component.rb +16 -0
  38. data/app/components/blacklight/document/thumbnail_component.html.erb +2 -7
  39. data/app/components/blacklight/document/thumbnail_component.rb +1 -9
  40. data/app/components/blacklight/document_component.html.erb +4 -0
  41. data/app/components/blacklight/document_component.rb +14 -53
  42. data/app/components/blacklight/document_metadata_component.html.erb +2 -4
  43. data/app/components/blacklight/document_metadata_component.rb +5 -10
  44. data/app/components/blacklight/document_title_component.rb +4 -1
  45. data/app/components/blacklight/facet_component.rb +1 -1
  46. data/app/components/blacklight/facet_field_checkboxes_component.html.erb +3 -3
  47. data/app/components/blacklight/facet_field_checkboxes_component.rb +1 -1
  48. data/app/components/blacklight/facet_field_component.html.erb +4 -5
  49. data/app/components/blacklight/facet_field_component.rb +9 -2
  50. data/app/components/blacklight/facet_field_list_component.html.erb +3 -3
  51. data/app/components/blacklight/facet_field_list_component.rb +37 -5
  52. data/app/components/blacklight/facet_field_no_layout_component.rb +0 -2
  53. data/app/components/blacklight/facet_item_component.rb +1 -43
  54. data/app/components/blacklight/facet_item_pivot_component.rb +21 -23
  55. data/app/components/blacklight/header_component.rb +1 -1
  56. data/app/components/blacklight/hidden_search_state_component.rb +1 -2
  57. data/app/components/blacklight/icons/legacy_icon_component.rb +30 -0
  58. data/app/components/blacklight/icons/list_component.rb +16 -0
  59. data/app/components/blacklight/icons/search_component.rb +16 -0
  60. data/app/components/blacklight/metadata_field_component.html.erb +2 -2
  61. data/app/components/blacklight/metadata_field_component.rb +24 -8
  62. data/app/components/blacklight/metadata_field_layout_component.rb +4 -25
  63. data/app/components/blacklight/response/facet_group_component.html.erb +3 -5
  64. data/app/components/blacklight/response/facet_group_component.rb +29 -8
  65. data/app/components/blacklight/response/pagination_component.html.erb +1 -1
  66. data/app/components/blacklight/response/pagination_component.rb +1 -5
  67. data/app/components/blacklight/response/sort_component.rb +1 -1
  68. data/app/components/blacklight/response/spellcheck_component.rb +17 -6
  69. data/app/components/blacklight/response/view_type_button_component.rb +2 -6
  70. data/app/components/blacklight/response/view_type_component.rb +3 -5
  71. data/app/components/blacklight/search/sidebar_component.html.erb +8 -0
  72. data/app/components/blacklight/search/sidebar_component.rb +17 -0
  73. data/app/components/blacklight/search_bar_component.html.erb +20 -15
  74. data/app/components/blacklight/search_bar_component.rb +2 -16
  75. data/app/components/blacklight/search_button_component.rb +3 -3
  76. data/app/components/blacklight/search_context_component.rb +43 -9
  77. data/app/components/blacklight/search_header_component.html.erb +2 -0
  78. data/app/components/blacklight/search_header_component.rb +6 -0
  79. data/app/components/blacklight/start_over_button_component.rb +5 -3
  80. data/app/components/blacklight/system/dropdown_component.rb +2 -2
  81. data/app/components/blacklight/system/flash_message_component.html.erb +3 -1
  82. data/app/components/blacklight/system/flash_message_component.rb +11 -2
  83. data/app/components/blacklight/system/modal_component.html.erb +1 -1
  84. data/app/components/blacklight/system/modal_component.rb +0 -2
  85. data/app/components/blacklight/top_navbar_component.html.erb +1 -1
  86. data/app/components/blacklight/top_navbar_component.rb +0 -4
  87. data/app/controllers/bookmarks_controller.rb +1 -0
  88. data/app/controllers/catalog_controller.rb +1 -0
  89. data/app/controllers/concerns/blacklight/bookmarks.rb +10 -9
  90. data/app/controllers/concerns/blacklight/catalog.rb +21 -83
  91. data/app/controllers/concerns/blacklight/controller.rb +3 -41
  92. data/app/controllers/concerns/blacklight/search_context.rb +25 -7
  93. data/app/controllers/concerns/blacklight/search_history.rb +2 -0
  94. data/app/controllers/concerns/blacklight/searchable.rb +12 -1
  95. data/app/controllers/concerns/blacklight/token_based_user.rb +13 -1
  96. data/app/controllers/search_history_controller.rb +1 -0
  97. data/app/helpers/blacklight/blacklight_helper_behavior.rb +12 -310
  98. data/app/helpers/blacklight/catalog_helper_behavior.rb +22 -137
  99. data/app/helpers/blacklight/component_helper_behavior.rb +2 -53
  100. data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -117
  101. data/app/helpers/blacklight/facets_helper_behavior.rb +4 -321
  102. data/app/helpers/blacklight/icon_helper_behavior.rb +5 -4
  103. data/app/helpers/blacklight/layout_helper_behavior.rb +1 -0
  104. data/app/helpers/blacklight/render_partials_helper_behavior.rb +11 -31
  105. data/app/helpers/blacklight/url_helper_behavior.rb +13 -97
  106. data/app/helpers/blacklight_helper.rb +1 -0
  107. data/app/helpers/catalog_helper.rb +1 -0
  108. data/app/javascript/blacklight/bookmark_toggle.js +13 -19
  109. data/app/javascript/blacklight/button_focus.js +12 -10
  110. data/app/javascript/blacklight/checkbox_submit.js +68 -123
  111. data/app/javascript/blacklight/core.js +5 -7
  112. data/app/javascript/blacklight/index.js +13 -0
  113. data/app/javascript/blacklight/modal.js +99 -164
  114. data/app/javascript/blacklight/modalForm.js +60 -0
  115. data/app/javascript/blacklight/search_context.js +46 -54
  116. data/app/models/blacklight/facet_paginator.rb +3 -2
  117. data/app/models/blacklight/icon.rb +4 -2
  118. data/app/models/bookmark.rb +0 -2
  119. data/app/models/concerns/blacklight/configurable.rb +5 -4
  120. data/app/models/concerns/blacklight/document/active_model_shim.rb +1 -10
  121. data/app/models/concerns/blacklight/document/cache_key.rb +1 -0
  122. data/app/models/concerns/blacklight/document/dublin_core.rb +2 -1
  123. data/app/models/concerns/blacklight/document/email.rb +1 -0
  124. data/app/models/concerns/blacklight/document/export.rb +2 -1
  125. data/app/models/concerns/blacklight/document/extensions.rb +1 -0
  126. data/app/models/concerns/blacklight/document/schema_org.rb +1 -0
  127. data/app/models/concerns/blacklight/document/semantic_fields.rb +1 -0
  128. data/app/models/concerns/blacklight/document/sms.rb +1 -0
  129. data/app/models/concerns/blacklight/suggest/response.rb +1 -0
  130. data/app/models/concerns/blacklight/user.rb +17 -8
  131. data/app/models/record_mailer.rb +13 -12
  132. data/app/models/search.rb +1 -7
  133. data/app/models/solr_document.rb +1 -0
  134. data/app/presenters/blacklight/clause_presenter.rb +1 -1
  135. data/app/presenters/blacklight/document_presenter.rb +13 -21
  136. data/app/presenters/blacklight/facet_field_presenter.rb +39 -14
  137. data/app/presenters/blacklight/facet_grouped_item_presenter.rb +1 -5
  138. data/app/presenters/blacklight/facet_item_pivot_presenter.rb +60 -0
  139. data/app/presenters/blacklight/facet_item_presenter.rb +3 -9
  140. data/app/presenters/blacklight/field_presenter.rb +1 -0
  141. data/app/presenters/blacklight/index_presenter.rb +2 -40
  142. data/app/presenters/blacklight/json_presenter.rb +7 -5
  143. data/app/presenters/blacklight/rendering/link_to_facet.rb +2 -5
  144. data/app/presenters/blacklight/show_presenter.rb +1 -9
  145. data/app/presenters/blacklight/thumbnail_presenter.rb +1 -1
  146. data/app/services/blacklight/bookmarks_search_builder.rb +22 -0
  147. data/app/services/blacklight/field_retriever.rb +12 -21
  148. data/app/services/blacklight/search_service.rb +8 -7
  149. data/app/values/blacklight/types.rb +0 -18
  150. data/app/views/bookmarks/_clear_bookmarks_widget.html.erb +8 -1
  151. data/app/views/bookmarks/_tools.html.erb +7 -12
  152. data/app/views/catalog/_advanced_search_form.html.erb +0 -1
  153. data/app/views/catalog/_bookmark_control.html.erb +1 -1
  154. data/app/views/catalog/_citation.html.erb +1 -1
  155. data/app/views/catalog/_constraints.html.erb +1 -14
  156. data/app/views/catalog/_document.atom.builder +12 -14
  157. data/app/views/catalog/_document.html.erb +5 -3
  158. data/app/views/catalog/_document.rss.builder +2 -4
  159. data/app/views/catalog/_facet_layout.html.erb +2 -2
  160. data/app/views/catalog/_facets.html.erb +5 -4
  161. data/app/views/catalog/_home_text.html.erb +2 -14
  162. data/app/views/catalog/_search_form.html.erb +2 -2
  163. data/app/views/catalog/_search_header.html.erb +1 -2
  164. data/app/views/catalog/_search_results.html.erb +2 -2
  165. data/app/views/catalog/_search_sidebar.html.erb +5 -1
  166. data/app/views/catalog/_show_main_content.html.erb +11 -16
  167. data/app/views/catalog/_show_sidebar.html.erb +2 -2
  168. data/app/views/catalog/_show_tools.html.erb +8 -14
  169. data/app/views/catalog/_view_type_group.html.erb +1 -1
  170. data/app/views/catalog/email.html.erb +2 -2
  171. data/app/views/catalog/email_success.html.erb +5 -6
  172. data/app/views/catalog/facet.html.erb +7 -5
  173. data/app/views/catalog/index.atom.builder +12 -14
  174. data/app/views/catalog/index.html.erb +4 -1
  175. data/app/views/catalog/index.json.jbuilder +19 -19
  176. data/app/views/catalog/index.rss.builder +1 -1
  177. data/app/views/catalog/opensearch.xml.builder +1 -1
  178. data/app/views/catalog/sms.html.erb +2 -2
  179. data/app/views/catalog/sms_success.html.erb +5 -6
  180. data/app/views/catalog/suggest.html.erb +3 -0
  181. data/app/views/layouts/blacklight/base.html.erb +13 -2
  182. data/app/views/search_history/index.html.erb +6 -2
  183. data/app/views/shared/_modal.html.erb +3 -3
  184. data/blacklight.gemspec +8 -9
  185. data/config/importmap.rb +3 -0
  186. data/config/locales/blacklight.ar.yml +0 -1
  187. data/config/locales/blacklight.ca.yml +0 -1
  188. data/config/locales/blacklight.de.yml +0 -1
  189. data/config/locales/blacklight.en.yml +0 -2
  190. data/config/locales/blacklight.es.yml +0 -1
  191. data/config/locales/blacklight.fr.yml +0 -1
  192. data/config/locales/blacklight.hu.yml +0 -1
  193. data/config/locales/blacklight.it.yml +0 -1
  194. data/config/locales/blacklight.nl.yml +0 -1
  195. data/config/locales/blacklight.pt-BR.yml +0 -1
  196. data/config/locales/blacklight.sq.yml +0 -1
  197. data/config/locales/blacklight.zh.yml +0 -1
  198. data/config/routes.rb +3 -2
  199. data/db/migrate/20140202020201_create_searches.rb +1 -0
  200. data/db/migrate/20140202020202_create_bookmarks.rb +1 -0
  201. data/db/migrate/20140320000000_add_polymorphic_type_to_bookmarks.rb +1 -0
  202. data/docker-compose.yml +0 -1
  203. data/lib/blacklight/abstract_repository.rb +1 -0
  204. data/lib/blacklight/configuration/context.rb +4 -4
  205. data/lib/blacklight/configuration/display_field.rb +7 -9
  206. data/lib/blacklight/configuration/facet_field.rb +17 -11
  207. data/lib/blacklight/configuration/field.rb +1 -0
  208. data/lib/blacklight/configuration/fields.rb +12 -15
  209. data/lib/blacklight/configuration/index_field.rb +1 -0
  210. data/lib/blacklight/configuration/null_display_field.rb +17 -0
  211. data/lib/blacklight/configuration/search_field.rb +1 -0
  212. data/lib/blacklight/configuration/show_field.rb +1 -0
  213. data/lib/blacklight/configuration/sort_field.rb +1 -0
  214. data/lib/blacklight/configuration/tool_config.rb +1 -0
  215. data/lib/blacklight/configuration/view_config.rb +16 -6
  216. data/lib/blacklight/configuration.rb +294 -358
  217. data/lib/blacklight/engine.rb +8 -24
  218. data/lib/blacklight/exceptions.rb +2 -2
  219. data/lib/blacklight/nested_open_struct_with_hash_access.rb +6 -12
  220. data/lib/blacklight/open_struct_with_hash_access.rb +19 -17
  221. data/lib/blacklight/parameters.rb +7 -21
  222. data/lib/blacklight/routes/exportable.rb +1 -0
  223. data/lib/blacklight/routes/searchable.rb +2 -1
  224. data/lib/blacklight/routes.rb +1 -0
  225. data/lib/blacklight/search_builder.rb +10 -10
  226. data/lib/blacklight/search_state/filter_field.rb +8 -25
  227. data/lib/blacklight/search_state/pivot_filter_field.rb +144 -0
  228. data/lib/blacklight/search_state.rb +23 -79
  229. data/lib/blacklight/solr/document.rb +1 -0
  230. data/lib/blacklight/solr/facet_paginator.rb +1 -0
  231. data/lib/blacklight/solr/repository.rb +3 -14
  232. data/lib/blacklight/solr/request.rb +1 -0
  233. data/lib/blacklight/solr/response/facets.rb +21 -5
  234. data/lib/blacklight/solr/response/group.rb +1 -0
  235. data/lib/blacklight/solr/response/group_response.rb +1 -0
  236. data/lib/blacklight/solr/response/more_like_this.rb +1 -0
  237. data/lib/blacklight/solr/response/pagination_methods.rb +4 -3
  238. data/lib/blacklight/solr/response/params.rb +5 -4
  239. data/lib/blacklight/solr/response/response.rb +1 -0
  240. data/lib/blacklight/solr/response/spelling.rb +1 -0
  241. data/lib/blacklight/solr/response.rb +4 -3
  242. data/lib/blacklight/solr/search_builder_behavior.rb +17 -34
  243. data/lib/blacklight/solr.rb +1 -0
  244. data/lib/blacklight/version.rb +1 -0
  245. data/lib/blacklight.rb +7 -10
  246. data/lib/generators/blacklight/assets/importmap_generator.rb +55 -0
  247. data/lib/generators/blacklight/assets/propshaft_generator.rb +25 -0
  248. data/lib/generators/blacklight/assets/sprockets_generator.rb +66 -0
  249. data/lib/generators/blacklight/assets_generator.rb +13 -89
  250. data/lib/generators/blacklight/controller_generator.rb +3 -2
  251. data/lib/generators/blacklight/document_generator.rb +1 -0
  252. data/lib/generators/blacklight/install_generator.rb +4 -3
  253. data/lib/generators/blacklight/models_generator.rb +1 -0
  254. data/lib/generators/blacklight/search_builder_generator.rb +1 -0
  255. data/lib/generators/blacklight/solr_generator.rb +1 -1
  256. data/lib/generators/blacklight/templates/catalog_controller.rb +34 -8
  257. data/lib/generators/blacklight/templates/solr/conf/solrconfig.xml +0 -69
  258. data/lib/generators/blacklight/test_support_generator.rb +4 -2
  259. data/lib/generators/blacklight/user_generator.rb +7 -9
  260. data/lib/railties/blacklight.rake +6 -7
  261. data/package.json +10 -13
  262. data/rollup.config.js +27 -0
  263. data/spec/components/blacklight/constraints_component_spec.rb +17 -13
  264. data/spec/components/blacklight/document_component_spec.rb +23 -82
  265. data/spec/components/blacklight/facet_component_spec.rb +3 -18
  266. data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +1 -2
  267. data/spec/components/blacklight/facet_field_list_component_spec.rb +7 -6
  268. data/spec/components/blacklight/facet_item_pivot_component_spec.rb +10 -9
  269. data/spec/components/blacklight/response/view_type_component_spec.rb +66 -0
  270. data/spec/components/blacklight/search_bar_component_spec.rb +1 -1
  271. data/spec/components/blacklight/search_context_component_spec.rb +40 -0
  272. data/spec/controllers/blacklight/catalog/component_configuration_spec.rb +1 -6
  273. data/spec/controllers/blacklight/{base_spec.rb → catalog_spec.rb} +2 -2
  274. data/spec/controllers/bookmarks_controller_spec.rb +2 -3
  275. data/spec/controllers/catalog_controller_spec.rb +13 -135
  276. data/spec/features/advanced_search_spec.rb +0 -56
  277. data/spec/features/autocomplete_spec.rb +1 -1
  278. data/spec/features/axe_spec.rb +1 -6
  279. data/spec/features/bookmarks_spec.rb +1 -1
  280. data/spec/features/facets_spec.rb +1 -1
  281. data/spec/features/search_context_spec.rb +4 -10
  282. data/spec/features/search_results_spec.rb +0 -33
  283. data/spec/features/sitelinks_search_box.rb +13 -0
  284. data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +2 -138
  285. data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +0 -387
  286. data/spec/helpers/blacklight/icon_helper_behavior_spec.rb +8 -0
  287. data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +5 -7
  288. data/spec/helpers/blacklight/url_helper_behavior_spec.rb +9 -131
  289. data/spec/helpers/blacklight_helper_spec.rb +8 -252
  290. data/spec/helpers/catalog_helper_spec.rb +7 -118
  291. data/spec/i18n_spec.rb +1 -0
  292. data/spec/integration/generators/blacklight/solr_generator_spec.rb +1 -1
  293. data/spec/lib/blacklight/configuration/facet_field_spec.rb +27 -16
  294. data/spec/lib/blacklight/configuration/field_spec.rb +1 -1
  295. data/spec/lib/blacklight/configuration/view_config_spec.rb +1 -1
  296. data/spec/lib/blacklight/open_struct_with_hash_access_spec.rb +2 -2
  297. data/spec/lib/blacklight/parameters_spec.rb +1 -4
  298. data/spec/lib/blacklight/search_state/filter_field_spec.rb +4 -4
  299. data/spec/lib/blacklight/search_state/pivot_filter_field_spec.rb +117 -0
  300. data/spec/lib/blacklight/search_state_spec.rb +80 -198
  301. data/spec/lib/tasks/blacklight_task_spec.rb +1 -0
  302. data/spec/models/blacklight/configuration_spec.rb +17 -51
  303. data/spec/models/blacklight/document/active_model_shim_spec.rb +2 -2
  304. data/spec/models/blacklight/icon_spec.rb +31 -15
  305. data/spec/models/blacklight/search_builder_spec.rb +9 -9
  306. data/spec/models/blacklight/solr/document_spec.rb +3 -3
  307. data/spec/models/blacklight/solr/repository_spec.rb +0 -27
  308. data/spec/models/blacklight/solr/response/facets_spec.rb +27 -27
  309. data/spec/models/blacklight/solr/response/group_response_spec.rb +1 -0
  310. data/spec/models/blacklight/solr/response/group_spec.rb +1 -0
  311. data/spec/models/blacklight/solr/response_spec.rb +9 -2
  312. data/spec/models/blacklight/solr/search_builder_spec.rb +24 -31
  313. data/spec/models/blacklight/user_spec.rb +22 -0
  314. data/spec/models/solr_document_spec.rb +2 -6
  315. data/spec/presenters/blacklight/clause_presenter_spec.rb +1 -0
  316. data/spec/presenters/blacklight/document_presenter_spec.rb +2 -2
  317. data/spec/presenters/blacklight/facet_field_presenter_spec.rb +85 -12
  318. data/spec/presenters/blacklight/facet_grouped_item_presenter_spec.rb +1 -0
  319. data/spec/presenters/blacklight/facet_item_presenter_spec.rb +14 -13
  320. data/spec/presenters/blacklight/field_presenter_spec.rb +0 -14
  321. data/spec/presenters/blacklight/index_presenter_spec.rb +2 -4
  322. data/spec/presenters/blacklight/json_presenter_spec.rb +1 -0
  323. data/spec/presenters/blacklight/link_alternate_presenter_spec.rb +3 -2
  324. data/spec/presenters/blacklight/show_presenter_spec.rb +20 -29
  325. data/spec/presenters/thumbnail_presenter_spec.rb +1 -1
  326. data/spec/requests/load_suggestions_spec.rb +16 -0
  327. data/spec/routing/catalog_routing_spec.rb +2 -1
  328. data/spec/services/blacklight/search_service_spec.rb +31 -68
  329. data/spec/spec_helper.rb +6 -32
  330. data/spec/support/controller_level_helpers.rb +1 -2
  331. data/spec/support/features/search_helpers.rb +39 -0
  332. data/spec/support/features/session_helpers.rb +1 -0
  333. data/spec/support/features.rb +3 -0
  334. data/spec/support/view_component_capybara_test_helpers.rb +8 -0
  335. data/spec/test_app_templates/lib/generators/test_app_generator.rb +9 -2
  336. data/spec/views/catalog/_document.html.erb_spec.rb +3 -34
  337. data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +1 -1
  338. data/spec/views/catalog/_search_header.erb_spec.rb +1 -0
  339. data/spec/views/catalog/_show_sidebar.erb_spec.rb +1 -0
  340. data/spec/views/catalog/_show_tools.html.erb_spec.rb +5 -66
  341. data/spec/views/catalog/_view_type_group.html.erb_spec.rb +17 -9
  342. data/spec/views/catalog/email_success.html.erb_spec.rb +2 -2
  343. data/spec/views/catalog/facet.html.erb_spec.rb +6 -3
  344. data/spec/views/catalog/index.atom.builder_spec.rb +18 -11
  345. data/spec/views/catalog/index.html.erb_spec.rb +5 -6
  346. data/spec/views/catalog/index.json.jbuilder_spec.rb +2 -2
  347. data/spec/views/catalog/show.html.erb_spec.rb +3 -25
  348. data/spec/views/catalog/sms_success.html.erb_spec.rb +2 -2
  349. data/tasks/blacklight.rake +6 -4
  350. metadata +81 -134
  351. data/.babelrc +0 -11
  352. data/app/assets/images/blacklight/list.svg +0 -1
  353. data/app/assets/images/blacklight/search.svg +0 -1
  354. data/app/assets/stylesheets/blacklight/_twitter_typeahead.scss +0 -37
  355. data/app/components/blacklight/content_areas_shim.rb +0 -13
  356. data/app/controllers/concerns/blacklight/base.rb +0 -12
  357. data/app/controllers/concerns/blacklight/default_component_configuration.rb +0 -64
  358. data/app/controllers/concerns/blacklight/facet.rb +0 -69
  359. data/app/controllers/concerns/blacklight/search_fields.rb +0 -46
  360. data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +0 -27
  361. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +0 -188
  362. data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +0 -97
  363. data/app/helpers/blacklight/suggest_helper_behavior.rb +0 -13
  364. data/app/javascript/blacklight/autocomplete.js +0 -36
  365. data/app/javascript/blacklight/facet_load.js +0 -22
  366. data/app/presenters/blacklight/search_bar_presenter.rb +0 -47
  367. data/app/views/catalog/_constraints_element.html.erb +0 -14
  368. data/app/views/catalog/_document_action.html.erb +0 -5
  369. data/app/views/catalog/_facet_group.html.erb +0 -5
  370. data/app/views/catalog/_facet_limit.html.erb +0 -3
  371. data/app/views/catalog/_index.html.erb +0 -1
  372. data/app/views/catalog/_index_header.html.erb +0 -22
  373. data/app/views/catalog/_previous_next_doc.html.erb +0 -2
  374. data/app/views/catalog/_show.html.erb +0 -6
  375. data/app/views/catalog/_show_header.html.erb +0 -2
  376. data/app/views/catalog/_thumbnail.html.erb +0 -1
  377. data/lib/blacklight/deprecations/engine_configuration.rb +0 -66
  378. data/lib/blacklight/deprecations/search_state_normalization.rb +0 -52
  379. data/spec/components/blacklight/header_component_spec.rb +0 -20
  380. data/spec/controllers/blacklight/facet_spec.rb +0 -33
  381. data/spec/controllers/blacklight/search_fields_spec.rb +0 -62
  382. data/spec/features/citation_spec.rb +0 -10
  383. data/spec/features/sitelinks_search_box_spec.rb +0 -13
  384. data/spec/features/sms_spec.rb +0 -12
  385. data/spec/helpers/blacklight/hash_as_hidden_fields_behavior_spec.rb +0 -26
  386. data/spec/helpers/blacklight/render_constraints_helper_behavior_spec.rb +0 -92
  387. data/spec/helpers/blacklight/search_history_constraints_helper_behavior_spec.rb +0 -101
  388. data/spec/helpers/blacklight/suggest_helper_behavior_spec.rb +0 -48
  389. data/spec/lib/blacklight/engine_spec.rb +0 -41
  390. data/spec/presenters/blacklight/search_bar_presenter_spec.rb +0 -94
  391. data/spec/services/blacklight/field_retriever_spec.rb +0 -17
  392. data/spec/support/view_component_test_helpers.rb +0 -35
  393. data/spec/views/catalog/_constraints.html.erb_spec.rb +0 -33
  394. data/spec/views/catalog/_facet_group.html.erb_spec.rb +0 -84
  395. data/spec/views/catalog/_facets.html.erb_spec.rb +0 -15
  396. data/spec/views/catalog/_index.html.erb_spec.rb +0 -62
  397. data/spec/views/catalog/_index_header.html.erb_spec.rb +0 -35
  398. data/spec/views/catalog/_previous_next_doc.html.erb_spec.rb +0 -22
  399. data/spec/views/catalog/_show.html.erb_spec.rb +0 -62
  400. data/spec/views/catalog/_thumbnail.html.erb_spec.rb +0 -38
data/.rubocop_todo.yml CHANGED
@@ -1,164 +1,36 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-09-24 02:12:21 UTC using RuboCop version 0.91.1.
3
+ # on 2022-06-27 19:52:51 UTC using RuboCop version 1.31.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 4
10
- # Cop supports --auto-correct.
11
- Capybara/CurrentPathExpectation:
12
- Exclude:
13
- - 'spec/features/alternate_controller_spec.rb'
14
-
15
- # Offense count: 20
16
- Capybara/VisibilityMatcher:
17
- Exclude:
18
- - 'spec/features/facets_spec.rb'
19
- - 'spec/features/search_filters_spec.rb'
20
- - 'spec/helpers/blacklight/hash_as_hidden_fields_behavior_spec.rb'
21
- - 'spec/helpers/blacklight_helper_spec.rb'
22
-
23
- # Offense count: 8
24
- # Cop supports --auto-correct.
25
- # Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth.
26
- # SupportedStyles: case, end
27
- Layout/CaseIndentation:
28
- Exclude:
29
- - 'app/helpers/blacklight/catalog_helper_behavior.rb'
30
- - 'app/presenters/blacklight/index_presenter.rb'
31
- - 'lib/blacklight/configuration/fields.rb'
32
-
33
- # Offense count: 2
34
- # Cop supports --auto-correct.
35
- Layout/ClosingParenthesisIndentation:
36
- Exclude:
37
- - 'app/views/catalog/index.atom.builder'
38
-
39
- # Offense count: 111
40
- # Cop supports --auto-correct.
41
- Layout/EmptyLineAfterMagicComment:
42
- Enabled: false
43
-
44
- # Offense count: 1
45
- # Cop supports --auto-correct.
46
- # Configuration parameters: AllowAliasSyntax, AllowedMethods.
47
- # AllowedMethods: alias_method, public, protected, private
48
- Layout/EmptyLinesAroundAttributeAccessor:
49
- Exclude:
50
- - 'app/presenters/blacklight/field_presenter.rb'
51
-
52
- # Offense count: 7
53
- # Cop supports --auto-correct.
54
- # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
55
- Layout/ExtraSpacing:
56
- Exclude:
57
- - 'app/models/concerns/blacklight/document/dublin_core.rb'
58
- - 'app/models/record_mailer.rb'
59
- - 'app/views/catalog/index.atom.builder'
60
- - 'config/routes.rb'
61
-
62
- # Offense count: 2
63
- # Cop supports --auto-correct.
64
- # Configuration parameters: EnforcedStyle, IndentationWidth.
65
- # SupportedStyles: special_inside_parentheses, consistent, align_braces
66
- Layout/FirstHashElementIndentation:
67
- Exclude:
68
- - 'lib/blacklight/configuration.rb'
69
-
70
- # Offense count: 6
71
- # Cop supports --auto-correct.
72
- # Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
73
- Layout/LeadingCommentSpace:
74
- Exclude:
75
- - 'app/models/blacklight/facet_paginator.rb'
76
- - 'app/models/concerns/blacklight/configurable.rb'
77
- - 'app/models/concerns/blacklight/document/export.rb'
78
- - 'app/views/catalog/_document.atom.builder'
79
-
80
- # Offense count: 1
81
- # Cop supports --auto-correct.
82
- Layout/MultilineBlockLayout:
83
- Exclude:
84
- - 'lib/generators/blacklight/test_support_generator.rb'
85
-
86
- # Offense count: 2
87
- # Cop supports --auto-correct.
88
- # Configuration parameters: EnforcedStyle.
89
- # SupportedStyles: symmetrical, new_line, same_line
90
- Layout/MultilineMethodCallBraceLayout:
91
- Exclude:
92
- - 'app/views/catalog/index.atom.builder'
93
-
94
- # Offense count: 9
95
- # Cop supports --auto-correct.
96
- # Configuration parameters: EnforcedStyle, IndentationWidth.
97
- # SupportedStyles: aligned, indented, indented_relative_to_receiver
98
- Layout/MultilineMethodCallIndentation:
99
- Exclude:
100
- - 'lib/blacklight/search_builder.rb'
101
-
102
- # Offense count: 9
103
- # Cop supports --auto-correct.
104
- # Configuration parameters: EnforcedStyle, IndentationWidth.
105
- # SupportedStyles: aligned, indented
106
- Layout/MultilineOperationIndentation:
107
- Exclude:
108
- - 'app/helpers/blacklight/search_history_constraints_helper_behavior.rb'
109
- - 'lib/blacklight/configuration/context.rb'
110
- - 'lib/blacklight/search_state.rb'
111
- - 'lib/blacklight/solr/search_builder_behavior.rb'
112
-
113
- # Offense count: 2
114
- # Cop supports --auto-correct.
115
- Layout/SpaceAfterComma:
116
- Exclude:
117
- - 'app/views/catalog/index.atom.builder'
118
- - 'app/views/catalog/opensearch.xml.builder'
119
-
120
- # Offense count: 1
121
- # Cop supports --auto-correct.
122
- # Configuration parameters: AllowForAlignment.
123
- Layout/SpaceBeforeFirstArg:
124
- Exclude:
125
- - 'app/views/catalog/index.atom.builder'
126
-
127
- # Offense count: 7
128
- # Cop supports --auto-correct.
129
- # Configuration parameters: EnforcedStyle.
130
- # SupportedStyles: space, no_space
131
- Layout/SpaceInsideParens:
132
- Exclude:
133
- - 'app/views/catalog/_document.rss.builder'
134
- - 'app/views/catalog/index.atom.builder'
135
-
136
- # Offense count: 1
137
- # Cop supports --auto-correct.
138
- # Configuration parameters: AllowInHeredoc.
139
- Layout/TrailingWhitespace:
9
+ # Offense count: 5
10
+ # Configuration parameters: AutoCorrect.
11
+ Layout/LineContinuationLeadingSpace:
140
12
  Exclude:
141
- - 'lib/blacklight/configuration.rb'
13
+ - 'lib/generators/blacklight/controller_generator.rb'
14
+ - 'lib/generators/blacklight/user_generator.rb'
142
15
 
143
16
  # Offense count: 1
17
+ # Configuration parameters: IgnoredMethods.
144
18
  Lint/AmbiguousBlockAssociation:
145
19
  Exclude:
146
20
  - 'lib/blacklight/solr/search_builder_behavior.rb'
147
21
 
148
- # Offense count: 8
149
- # Cop supports --auto-correct.
22
+ # Offense count: 5
23
+ # This cop supports safe autocorrection (--autocorrect).
150
24
  Lint/AmbiguousOperator:
151
25
  Exclude:
152
- - 'spec/helpers/blacklight/facets_helper_behavior_spec.rb'
153
- - 'spec/helpers/blacklight/render_constraints_helper_behavior_spec.rb'
154
26
  - 'spec/helpers/blacklight/url_helper_behavior_spec.rb'
155
27
  - 'spec/helpers/blacklight_helper_spec.rb'
156
28
  - 'spec/models/blacklight/facet_paginator_spec.rb'
157
29
  - 'spec/models/blacklight/solr/search_builder_spec.rb'
158
30
  - 'spec/services/blacklight/search_service_spec.rb'
159
31
 
160
- # Offense count: 55
161
- # Cop supports --auto-correct.
32
+ # Offense count: 44
33
+ # This cop supports safe autocorrection (--autocorrect).
162
34
  Lint/AmbiguousRegexpLiteral:
163
35
  Exclude:
164
36
  - 'spec/controllers/catalog_controller_spec.rb'
@@ -169,19 +41,52 @@ Lint/AmbiguousRegexpLiteral:
169
41
  - 'spec/views/catalog/_document.html.erb_spec.rb'
170
42
  - 'spec/views/catalog/_search_header.erb_spec.rb'
171
43
  - 'spec/views/catalog/_sort_and_per_page.html.erb_spec.rb'
172
- - 'spec/views/catalog/_thumbnail.html.erb_spec.rb'
173
44
  - 'spec/views/catalog/index.html.erb_spec.rb'
174
45
  - 'spec/views/catalog/show.html.erb_spec.rb'
175
46
 
47
+ # Offense count: 1
48
+ Lint/BinaryOperatorWithIdenticalOperands:
49
+ Exclude:
50
+ - 'spec/models/blacklight/document/active_model_shim_spec.rb'
51
+
52
+ # Offense count: 14
53
+ # Configuration parameters: AllowedMethods.
54
+ # AllowedMethods: enums
55
+ Lint/ConstantDefinitionInBlock:
56
+ Exclude:
57
+ - 'spec/controllers/bookmarks_controller_spec.rb'
58
+ - 'spec/controllers/catalog_controller_spec.rb'
59
+ - 'spec/models/blacklight/configurable_spec.rb'
60
+ - 'spec/models/blacklight/document/active_model_shim_spec.rb'
61
+ - 'spec/models/blacklight/document_spec.rb'
62
+ - 'spec/models/blacklight/solr/document_spec.rb'
63
+ - 'spec/presenters/blacklight/show_presenter_spec.rb'
64
+
65
+ # Offense count: 2
66
+ # Configuration parameters: AllowComments, AllowEmptyLambdas.
67
+ Lint/EmptyBlock:
68
+ Exclude:
69
+ - 'app/controllers/concerns/blacklight/bookmarks.rb'
70
+ - 'lib/blacklight/solr/search_builder_behavior.rb'
71
+
72
+ # Offense count: 1
73
+ # Configuration parameters: AllowComments.
74
+ Lint/EmptyFile:
75
+ Exclude:
76
+ - 'spec/components/blacklight/document_metadata_component_spec.rb'
77
+
78
+ # Offense count: 38
79
+ Lint/MissingSuper:
80
+ Enabled: false
81
+
176
82
  # Offense count: 29
177
- # Cop supports --auto-correct.
83
+ # This cop supports safe autocorrection (--autocorrect).
178
84
  Lint/ParenthesesAsGroupedExpression:
179
85
  Exclude:
180
86
  - 'spec/features/did_you_mean_spec.rb'
181
87
  - 'spec/features/search_filters_spec.rb'
182
88
  - 'spec/features/search_pagination_spec.rb'
183
89
  - 'spec/features/search_spec.rb'
184
- - 'spec/lib/blacklight/search_state_spec.rb'
185
90
  - 'spec/models/blacklight/solr/repository_spec.rb'
186
91
 
187
92
  # Offense count: 2
@@ -189,63 +94,57 @@ Lint/ShadowingOuterLocalVariable:
189
94
  Exclude:
190
95
  - 'spec/models/blacklight/configuration_spec.rb'
191
96
 
192
- # Offense count: 57
193
- # Configuration parameters: IgnoredMethods.
97
+ # Offense count: 74
98
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
194
99
  Metrics/AbcSize:
195
- Max: 59
100
+ Max: 46
196
101
 
197
- # Offense count: 2
198
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
199
- # ExcludedMethods: refine
102
+ # Offense count: 1
103
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods, inherit_mode.
104
+ # IgnoredMethods: refine
200
105
  Metrics/BlockLength:
201
- Max: 30
106
+ Max: 26
202
107
 
203
108
  # Offense count: 1
204
109
  # Configuration parameters: CountBlocks.
205
110
  Metrics/BlockNesting:
206
111
  Max: 4
207
112
 
208
- # Offense count: 2
209
- # Configuration parameters: CountComments, CountAsOne.
210
- Metrics/ClassLength:
211
- Max: 169
212
-
213
- # Offense count: 26
113
+ # Offense count: 43
214
114
  # Configuration parameters: IgnoredMethods.
215
115
  Metrics/CyclomaticComplexity:
216
116
  Max: 14
217
117
 
218
- # Offense count: 61
219
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
118
+ # Offense count: 69
119
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
220
120
  Metrics/MethodLength:
221
- Max: 30
121
+ Max: 29
222
122
 
223
- # Offense count: 8
123
+ # Offense count: 3
224
124
  # Configuration parameters: CountComments, CountAsOne.
225
125
  Metrics/ModuleLength:
226
- Max: 213
126
+ Max: 126
227
127
 
228
- # Offense count: 3
229
- # Configuration parameters: CountKeywordArgs.
128
+ # Offense count: 8
129
+ # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
230
130
  Metrics/ParameterLists:
231
131
  Max: 6
232
132
 
233
- # Offense count: 22
133
+ # Offense count: 36
234
134
  # Configuration parameters: IgnoredMethods.
235
135
  Metrics/PerceivedComplexity:
236
- Max: 16
136
+ Max: 14
237
137
 
238
- # Offense count: 4
138
+ # Offense count: 3
239
139
  # Configuration parameters: EnforcedStyleForLeadingUnderscores.
240
140
  # SupportedStylesForLeadingUnderscores: disallowed, required, optional
241
141
  Naming/MemoizedInstanceVariableName:
242
142
  Exclude:
243
- - 'app/helpers/blacklight/blacklight_helper_behavior.rb'
244
143
  - 'app/helpers/blacklight/render_partials_helper_behavior.rb'
245
144
  - 'app/models/concerns/blacklight/document/semantic_fields.rb'
246
145
  - 'lib/blacklight/solr/response.rb'
247
146
 
248
- # Offense count: 13
147
+ # Offense count: 9
249
148
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
250
149
  # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
251
150
  Naming/MethodParameterName:
@@ -253,80 +152,89 @@ Naming/MethodParameterName:
253
152
  - 'app/models/concerns/blacklight/document.rb'
254
153
  - 'app/presenters/blacklight/rendering/link_to_facet.rb'
255
154
  - 'lib/blacklight/nested_open_struct_with_hash_access.rb'
256
- - 'lib/blacklight/search_state.rb'
257
155
  - 'lib/blacklight/solr/document.rb'
258
156
  - 'lib/blacklight/solr/search_builder_behavior.rb'
259
- - 'spec/features/search_context_spec.rb'
260
- - 'spec/features/search_results_spec.rb'
261
157
 
262
- # Offense count: 14
263
- # Configuration parameters: EnforcedStyle.
158
+ # Offense count: 9
159
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
264
160
  # SupportedStyles: snake_case, normalcase, non_integer
161
+ # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
265
162
  Naming/VariableNumber:
266
163
  Exclude:
267
- - 'spec/views/catalog/_index.html.erb_spec.rb'
268
- - 'spec/views/catalog/_show.html.erb_spec.rb'
164
+ - 'spec/lib/blacklight/search_state_spec.rb'
165
+ - 'spec/models/blacklight/search_builder_spec.rb'
269
166
 
270
- # Offense count: 9
167
+ # Offense count: 7
271
168
  RSpec/BeforeAfterAll:
272
169
  Exclude:
273
- - 'spec/spec_helper.rb'
274
- - 'spec/rails_helper.rb'
275
- - 'spec/support/**/*.rb'
276
- - 'spec/controllers/blacklight/search_fields_spec.rb'
277
170
  - 'spec/controllers/search_history_controller_spec.rb'
278
- - 'spec/helpers/blacklight/search_history_constraints_helper_behavior_spec.rb'
279
171
  - 'spec/models/blacklight/configurable_spec.rb'
280
172
  - 'spec/models/blacklight/document/dublin_core_spec.rb'
281
173
  - 'spec/models/blacklight/document/email_spec.rb'
282
174
  - 'spec/models/blacklight/document/sms_spec.rb'
283
175
  - 'spec/models/blacklight/solr/document_spec.rb'
284
176
 
285
- # Offense count: 81
177
+ # Offense count: 4
178
+ # This cop supports safe autocorrection (--autocorrect).
179
+ RSpec/Capybara/CurrentPathExpectation:
180
+ Exclude:
181
+ - 'spec/features/alternate_controller_spec.rb'
182
+
183
+ # Offense count: 13
184
+ RSpec/Capybara/VisibilityMatcher:
185
+ Exclude:
186
+ - 'spec/features/facets_spec.rb'
187
+ - 'spec/features/search_filters_spec.rb'
188
+ - 'spec/helpers/blacklight_helper_spec.rb'
189
+
190
+ # Offense count: 98
286
191
  # Configuration parameters: Prefixes.
287
192
  # Prefixes: when, with, without
288
193
  RSpec/ContextWording:
289
194
  Enabled: false
290
195
 
291
- # Offense count: 42
292
- RSpec/DescribeClass:
293
- Enabled: false
294
-
295
- # Offense count: 2
296
- # Configuration parameters: CustomIncludeMethods.
196
+ # Offense count: 1
297
197
  RSpec/EmptyExampleGroup:
298
198
  Exclude:
299
- - 'spec/helpers/blacklight_helper_spec.rb'
300
199
  - 'spec/models/blacklight/solr/search_builder_spec.rb'
301
200
 
302
- # Offense count: 134
303
- # Configuration parameters: Max.
201
+ # Offense count: 128
202
+ # Configuration parameters: CountAsOne.
304
203
  RSpec/ExampleLength:
305
- Enabled: false
204
+ Max: 33
306
205
 
307
- # Offense count: 15
206
+ # Offense count: 8
308
207
  RSpec/ExpectInHook:
309
208
  Exclude:
310
209
  - 'spec/controllers/catalog_controller_spec.rb'
311
- - 'spec/helpers/blacklight/configuration_helper_behavior_spec.rb'
312
- - 'spec/helpers/blacklight/render_constraints_helper_behavior_spec.rb'
313
- - 'spec/helpers/blacklight/suggest_helper_behavior_spec.rb'
314
- - 'spec/helpers/catalog_helper_spec.rb'
315
210
 
316
211
  # Offense count: 5
317
- # Configuration parameters: CustomTransform, IgnoreMethods, SpecSuffixOnly.
212
+ # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
213
+ # Include: **/*_spec*rb*, **/spec/**/*
318
214
  RSpec/FilePath:
319
215
  Exclude:
320
216
  - 'spec/controllers/blacklight/catalog/component_configuration_spec.rb'
321
- - 'spec/helpers/blacklight/hash_as_hidden_fields_behavior_spec.rb'
217
+ - 'spec/features/sitelinks_search_box.rb'
322
218
  - 'spec/models/blacklight/solr/search_builder_spec.rb'
323
219
  - 'spec/presenters/pipeline_spec.rb'
324
220
  - 'spec/presenters/thumbnail_presenter_spec.rb'
325
221
 
326
- # Offense count: 191
222
+ # Offense count: 128
327
223
  # Configuration parameters: AssignmentOnly.
328
224
  RSpec/InstanceVariable:
329
- Enabled: false
225
+ Exclude:
226
+ - 'spec/controllers/bookmarks_controller_spec.rb'
227
+ - 'spec/controllers/search_history_controller_spec.rb'
228
+ - 'spec/helpers/catalog_helper_spec.rb'
229
+ - 'spec/lib/blacklight/open_struct_with_hash_access_spec.rb'
230
+ - 'spec/lib/tasks/blacklight_task_spec.rb'
231
+ - 'spec/models/blacklight/configuration_spec.rb'
232
+ - 'spec/models/blacklight/document/dublin_core_spec.rb'
233
+ - 'spec/models/blacklight/solr/document_spec.rb'
234
+ - 'spec/models/record_mailer_spec.rb'
235
+ - 'spec/models/search_spec.rb'
236
+ - 'spec/services/blacklight/search_service_spec.rb'
237
+ - 'spec/views/catalog/index.atom.builder_spec.rb'
330
238
 
331
239
  # Offense count: 4
332
240
  RSpec/IteratedExpectation:
@@ -335,10 +243,9 @@ RSpec/IteratedExpectation:
335
243
  - 'spec/models/blacklight/solr/response/group_spec.rb'
336
244
  - 'spec/models/blacklight/solr/response_spec.rb'
337
245
 
338
- # Offense count: 17
246
+ # Offense count: 16
339
247
  RSpec/LeakyConstantDeclaration:
340
248
  Exclude:
341
- - 'spec/controllers/blacklight/search_fields_spec.rb'
342
249
  - 'spec/controllers/bookmarks_controller_spec.rb'
343
250
  - 'spec/controllers/catalog_controller_spec.rb'
344
251
  - 'spec/models/blacklight/configurable_spec.rb'
@@ -347,55 +254,50 @@ RSpec/LeakyConstantDeclaration:
347
254
  - 'spec/models/blacklight/solr/document_spec.rb'
348
255
  - 'spec/presenters/blacklight/show_presenter_spec.rb'
349
256
 
350
- # Offense count: 8
257
+ # Offense count: 9
351
258
  RSpec/MessageChain:
352
259
  Exclude:
353
260
  - 'spec/controllers/bookmarks_controller_spec.rb'
354
261
  - 'spec/presenters/blacklight/field_presenter_spec.rb'
355
262
  - 'spec/views/shared/_user_util_links.html.erb_spec.rb'
356
263
 
357
- # Offense count: 61
264
+ # Offense count: 30
358
265
  # Configuration parameters: EnforcedStyle.
359
266
  # SupportedStyles: have_received, receive
360
267
  RSpec/MessageSpies:
361
268
  Exclude:
362
269
  - 'spec/controllers/catalog_controller_spec.rb'
363
270
  - 'spec/helpers/blacklight/configuration_helper_behavior_spec.rb'
364
- - 'spec/helpers/blacklight/facets_helper_behavior_spec.rb'
365
- - 'spec/helpers/blacklight/render_constraints_helper_behavior_spec.rb'
366
- - 'spec/helpers/blacklight/suggest_helper_behavior_spec.rb'
367
271
  - 'spec/helpers/blacklight/url_helper_behavior_spec.rb'
368
272
  - 'spec/helpers/blacklight_helper_spec.rb'
369
273
  - 'spec/helpers/catalog_helper_spec.rb'
370
- - 'spec/lib/blacklight/configuration/facet_field_spec.rb'
371
274
  - 'spec/models/blacklight/search_builder_spec.rb'
372
275
  - 'spec/models/blacklight/suggest_search_spec.rb'
373
276
  - 'spec/presenters/blacklight/field_presenter_spec.rb'
374
277
  - 'spec/presenters/thumbnail_presenter_spec.rb'
375
278
 
376
- # Offense count: 363
279
+ # Offense count: 364
377
280
  RSpec/MultipleExpectations:
378
281
  Max: 16
379
282
 
380
- # Offense count: 160
283
+ # Offense count: 258
381
284
  # Configuration parameters: AllowSubject.
382
285
  RSpec/MultipleMemoizedHelpers:
383
286
  Max: 14
384
287
 
385
- # Offense count: 337
288
+ # Offense count: 388
386
289
  # Configuration parameters: IgnoreSharedExamples.
387
290
  RSpec/NamedSubject:
388
291
  Enabled: false
389
292
 
390
- # Offense count: 40
293
+ # Offense count: 55
391
294
  RSpec/NestedGroups:
392
295
  Max: 5
393
296
 
394
- # Offense count: 11
297
+ # Offense count: 6
395
298
  RSpec/RepeatedDescription:
396
299
  Exclude:
397
300
  - 'spec/features/search_results_spec.rb'
398
- - 'spec/helpers/blacklight/facets_helper_behavior_spec.rb'
399
301
  - 'spec/helpers/catalog_helper_spec.rb'
400
302
  - 'spec/models/blacklight/solr/search_builder_spec.rb'
401
303
 
@@ -404,54 +306,65 @@ RSpec/RepeatedExample:
404
306
  Exclude:
405
307
  - 'spec/models/blacklight/solr/document_spec.rb'
406
308
 
407
- # Offense count: 4
309
+ # Offense count: 2
408
310
  RSpec/RepeatedExampleGroupDescription:
409
311
  Exclude:
410
- - 'spec/helpers/blacklight/facets_helper_behavior_spec.rb'
411
312
  - 'spec/services/blacklight/search_service_spec.rb'
412
313
 
413
- # Offense count: 4
414
- # Cop supports --auto-correct.
314
+ # Offense count: 3
315
+ # This cop supports safe autocorrection (--autocorrect).
415
316
  RSpec/ScatteredLet:
416
317
  Exclude:
417
- - 'spec/helpers/catalog_helper_spec.rb'
418
318
  - 'spec/models/blacklight/solr/search_builder_spec.rb'
419
319
  - 'spec/views/catalog/index.atom.builder_spec.rb'
420
320
 
421
- # Offense count: 13
321
+ # Offense count: 22
322
+ RSpec/StubbedMock:
323
+ Exclude:
324
+ - 'spec/controllers/catalog_controller_spec.rb'
325
+ - 'spec/helpers/blacklight/configuration_helper_behavior_spec.rb'
326
+ - 'spec/helpers/blacklight/url_helper_behavior_spec.rb'
327
+ - 'spec/helpers/blacklight_helper_spec.rb'
328
+ - 'spec/helpers/catalog_helper_spec.rb'
329
+ - 'spec/models/blacklight/suggest_search_spec.rb'
330
+ - 'spec/presenters/blacklight/field_presenter_spec.rb'
331
+ - 'spec/presenters/thumbnail_presenter_spec.rb'
332
+
333
+ # Offense count: 1
334
+ RSpec/SubjectDeclaration:
335
+ Exclude:
336
+ - 'spec/models/blacklight/document/cache_key_spec.rb'
337
+
338
+ # Offense count: 15
422
339
  RSpec/SubjectStub:
423
340
  Exclude:
424
341
  - 'spec/controllers/catalog_controller_spec.rb'
425
342
  - 'spec/lib/blacklight/search_state_spec.rb'
426
343
  - 'spec/models/blacklight/document/cache_key_spec.rb'
427
344
  - 'spec/models/blacklight/search_builder_spec.rb'
345
+ - 'spec/presenters/blacklight/document_presenter_spec.rb'
428
346
  - 'spec/services/blacklight/search_service_spec.rb'
429
347
 
430
- # Offense count: 121
348
+ # Offense count: 77
431
349
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
432
350
  RSpec/VerifiedDoubles:
433
351
  Enabled: false
434
352
 
435
- # Offense count: 1
436
- RSpec/VoidExpect:
437
- Exclude:
438
- - 'spec/lib/blacklight/configuration/facet_field_spec.rb'
439
-
440
- # Offense count: 8
441
- # Cop supports --auto-correct.
442
- Rails/ContentTag:
443
- Exclude:
444
- - 'app/components/blacklight/document_component.rb'
445
- - 'app/components/blacklight/facet_item_pivot_component.rb'
446
-
447
353
  # Offense count: 4
448
- # Configuration parameters: EnforcedStyle.
354
+ # Configuration parameters: EnforcedStyle, AllowToTime.
449
355
  # SupportedStyles: strict, flexible
450
356
  Rails/Date:
451
357
  Exclude:
452
358
  - 'spec/models/search_spec.rb'
453
359
 
454
- # Offense count: 31
360
+ # Offense count: 1
361
+ # Configuration parameters: EnforcedStyle.
362
+ # SupportedStyles: slashes, arguments
363
+ Rails/FilePath:
364
+ Exclude:
365
+ - 'lib/railties/blacklight.rake'
366
+
367
+ # Offense count: 20
455
368
  # Configuration parameters: Include.
456
369
  # Include: app/helpers/**/*.rb
457
370
  Rails/HelperInstanceVariable:
@@ -459,25 +372,30 @@ Rails/HelperInstanceVariable:
459
372
  - 'app/helpers/blacklight/blacklight_helper_behavior.rb'
460
373
  - 'app/helpers/blacklight/catalog_helper_behavior.rb'
461
374
  - 'app/helpers/blacklight/component_helper_behavior.rb'
462
- - 'app/helpers/blacklight/facets_helper_behavior.rb'
463
375
  - 'app/helpers/blacklight/render_partials_helper_behavior.rb'
464
376
 
465
- # Offense count: 11
377
+ # Offense count: 2
378
+ # Configuration parameters: Include.
379
+ # Include: spec/**/*.rb, test/**/*.rb
380
+ Rails/I18nLocaleAssignment:
381
+ Exclude:
382
+ - 'spec/helpers/blacklight_helper_spec.rb'
383
+
384
+ # Offense count: 10
466
385
  Rails/OutputSafety:
467
386
  Exclude:
387
+ - 'app/components/blacklight/search_context_component.rb'
468
388
  - 'app/helpers/blacklight/catalog_helper_behavior.rb'
469
389
  - 'app/helpers/blacklight/configuration_helper_behavior.rb'
470
- - 'app/helpers/blacklight/icon_helper_behavior.rb'
471
- - 'app/helpers/blacklight/url_helper_behavior.rb'
472
390
  - 'app/presenters/blacklight/rendering/join.rb'
473
391
 
474
- # Offense count: 13
392
+ # Offense count: 14
475
393
  Security/Eval:
476
394
  Exclude:
477
395
  - 'spec/models/blacklight/solr/response_spec.rb'
478
396
 
479
397
  # Offense count: 9
480
- # Cop supports --auto-correct.
398
+ # This cop supports safe autocorrection (--autocorrect).
481
399
  # Configuration parameters: EnforcedStyle.
482
400
  # SupportedStyles: prefer_alias, prefer_alias_method
483
401
  Style/Alias:
@@ -490,7 +408,7 @@ Style/Alias:
490
408
  - 'lib/blacklight/solr/response/group_response.rb'
491
409
 
492
410
  # Offense count: 3
493
- # Cop supports --auto-correct.
411
+ # This cop supports safe autocorrection (--autocorrect).
494
412
  # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
495
413
  # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
496
414
  # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
@@ -501,33 +419,41 @@ Style/BlockDelimiters:
501
419
  - 'app/views/catalog/index.rss.builder'
502
420
  - 'app/views/catalog/opensearch.xml.builder'
503
421
 
504
- # Offense count: 51
505
- # Cop supports --auto-correct.
422
+ # Offense count: 52
423
+ # This cop supports unsafe autocorrection (--autocorrect-all).
506
424
  # Configuration parameters: EnforcedStyle.
507
425
  # SupportedStyles: nested, compact
508
426
  Style/ClassAndModuleChildren:
509
427
  Enabled: false
510
428
 
511
429
  # Offense count: 6
430
+ # This cop supports unsafe autocorrection (--autocorrect-all).
512
431
  Style/CommentedKeyword:
513
432
  Exclude:
514
433
  - 'spec/controllers/catalog_controller_spec.rb'
515
434
  - 'spec/services/blacklight/search_service_spec.rb'
516
435
 
517
436
  # Offense count: 1
518
- # Cop supports --auto-correct.
437
+ # This cop supports safe autocorrection (--autocorrect).
519
438
  # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
520
439
  # SupportedStyles: assign_to_condition, assign_inside_condition
521
440
  Style/ConditionalAssignment:
522
441
  Exclude:
523
442
  - 'lib/blacklight/solr/response/spelling.rb'
524
443
 
444
+ # Offense count: 2
445
+ Style/DocumentDynamicEvalDefinition:
446
+ Exclude:
447
+ - 'app/builders/blacklight/action_builder.rb'
448
+ - 'lib/blacklight/configuration/fields.rb'
449
+
525
450
  # Offense count: 105
451
+ # Configuration parameters: AllowedConstants.
526
452
  Style/Documentation:
527
453
  Enabled: false
528
454
 
529
455
  # Offense count: 10
530
- # Cop supports --auto-correct.
456
+ # This cop supports safe autocorrection (--autocorrect).
531
457
  Style/ExpandPathArguments:
532
458
  Exclude:
533
459
  - 'Gemfile'
@@ -542,14 +468,14 @@ Style/ExpandPathArguments:
542
468
  - 'lib/generators/blacklight/user_generator.rb'
543
469
 
544
470
  # Offense count: 16
545
- # Configuration parameters: EnforcedStyle.
471
+ # This cop supports safe autocorrection (--autocorrect).
472
+ # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, IgnoredMethods.
546
473
  # SupportedStyles: annotated, template, unannotated
547
474
  Style/FormatStringToken:
548
- Exclude:
549
- - 'app/helpers/blacklight/render_partials_helper_behavior.rb'
475
+ EnforcedStyle: template
550
476
 
551
- # Offense count: 8
552
- # Configuration parameters: MinBodyLength.
477
+ # Offense count: 6
478
+ # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
553
479
  Style/GuardClause:
554
480
  Exclude:
555
481
  - 'app/controllers/concerns/blacklight/bookmarks.rb'
@@ -558,13 +484,13 @@ Style/GuardClause:
558
484
  - 'app/helpers/blacklight/catalog_helper_behavior.rb'
559
485
  - 'lib/blacklight/solr/search_builder_behavior.rb'
560
486
 
561
- # Offense count: 39
562
- # Cop supports --auto-correct.
487
+ # Offense count: 30
488
+ # This cop supports safe autocorrection (--autocorrect).
563
489
  Style/IfUnlessModifier:
564
490
  Enabled: false
565
491
 
566
- # Offense count: 5
567
- # Cop supports --auto-correct.
492
+ # Offense count: 6
493
+ # This cop supports safe autocorrection (--autocorrect).
568
494
  Style/MultilineIfModifier:
569
495
  Exclude:
570
496
  - 'app/views/catalog/index.atom.builder'
@@ -572,12 +498,14 @@ Style/MultilineIfModifier:
572
498
  - 'lib/blacklight/solr/search_builder_behavior.rb'
573
499
 
574
500
  # Offense count: 1
501
+ # This cop supports safe autocorrection (--autocorrect).
502
+ # Configuration parameters: AllowMethodComparison.
575
503
  Style/MultipleComparison:
576
504
  Exclude:
577
505
  - 'lib/blacklight/configuration/context.rb'
578
506
 
579
507
  # Offense count: 2
580
- # Cop supports --auto-correct.
508
+ # This cop supports unsafe autocorrection (--autocorrect-all).
581
509
  # Configuration parameters: EnforcedStyle.
582
510
  # SupportedStyles: literals, strict
583
511
  Style/MutableConstant:
@@ -585,12 +513,11 @@ Style/MutableConstant:
585
513
  - 'lib/blacklight/solr/request.rb'
586
514
 
587
515
  # Offense count: 9
588
- # Cop supports --auto-correct.
516
+ # This cop supports unsafe autocorrection (--autocorrect-all).
589
517
  # Configuration parameters: EnforcedStyle, IgnoredMethods.
590
518
  # SupportedStyles: predicate, comparison
591
519
  Style/NumericPredicate:
592
520
  Exclude:
593
- - 'spec/**/*'
594
521
  - 'app/helpers/blacklight/catalog_helper_behavior.rb'
595
522
  - 'app/services/blacklight/search_service.rb'
596
523
  - 'lib/blacklight/search_builder.rb'
@@ -599,15 +526,26 @@ Style/NumericPredicate:
599
526
  - 'lib/blacklight/solr/search_builder_behavior.rb'
600
527
  - 'lib/railties/blacklight.rake'
601
528
 
602
- # Offense count: 3
603
- # Cop supports --auto-correct.
529
+ # Offense count: 15
530
+ Style/OpenStructUse:
531
+ Exclude:
532
+ - 'lib/blacklight/configuration.rb'
533
+ - 'lib/blacklight/open_struct_with_hash_access.rb'
534
+ - 'lib/blacklight/solr/response/facets.rb'
535
+ - 'spec/components/blacklight/facet_item_pivot_component_spec.rb'
536
+ - 'spec/lib/blacklight/search_state/filter_field_spec.rb'
537
+ - 'spec/models/blacklight/configuration_spec.rb'
538
+ - 'spec/models/blacklight/solr/response_spec.rb'
539
+
540
+ # Offense count: 1
541
+ # This cop supports safe autocorrection (--autocorrect).
604
542
  # Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions.
605
543
  Style/ParenthesesAroundCondition:
606
544
  Exclude:
607
545
  - 'app/views/catalog/_document.atom.builder'
608
546
 
609
547
  # Offense count: 3
610
- # Cop supports --auto-correct.
548
+ # This cop supports safe autocorrection (--autocorrect).
611
549
  # Configuration parameters: PreferredDelimiters.
612
550
  Style/PercentLiteralDelimiters:
613
551
  Exclude:
@@ -615,7 +553,7 @@ Style/PercentLiteralDelimiters:
615
553
  - 'lib/blacklight/solr/request.rb'
616
554
 
617
555
  # Offense count: 7
618
- # Cop supports --auto-correct.
556
+ # This cop supports safe autocorrection (--autocorrect).
619
557
  # Configuration parameters: EnforcedStyle.
620
558
  # SupportedStyles: implicit, explicit
621
559
  Style/RescueStandardError:
@@ -625,9 +563,9 @@ Style/RescueStandardError:
625
563
  - 'lib/blacklight/configuration/fields.rb'
626
564
  - 'lib/railties/blacklight.rake'
627
565
 
628
- # Offense count: 12
629
- # Cop supports --auto-correct.
630
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
566
+ # Offense count: 11
567
+ # This cop supports unsafe autocorrection (--autocorrect-all).
568
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
631
569
  # AllowedMethods: present?, blank?, presence, try, try!
632
570
  Style/SafeNavigation:
633
571
  Exclude:
@@ -637,19 +575,25 @@ Style/SafeNavigation:
637
575
  - 'lib/blacklight.rb'
638
576
  - 'lib/blacklight/configuration/facet_field.rb'
639
577
  - 'lib/blacklight/configuration/search_field.rb'
640
- - 'lib/blacklight/search_state.rb'
641
578
  - 'lib/blacklight/solr/search_builder_behavior.rb'
642
579
 
643
- # Offense count: 3
644
- # Cop supports --auto-correct.
580
+ # Offense count: 6
581
+ # This cop supports safe autocorrection (--autocorrect).
645
582
  # Configuration parameters: AllowAsExpressionSeparator.
646
583
  Style/Semicolon:
647
584
  Exclude:
648
585
  - 'spec/models/blacklight/solr/repository_spec.rb'
649
586
  - 'spec/views/catalog/_paginate_compact.html.erb_spec.rb'
650
587
 
651
- # Offense count: 31
652
- # Cop supports --auto-correct.
588
+ # Offense count: 1
589
+ # This cop supports safe autocorrection (--autocorrect).
590
+ # Configuration parameters: AllowModifier.
591
+ Style/SoleNestedConditional:
592
+ Exclude:
593
+ - 'app/controllers/concerns/blacklight/controller.rb'
594
+
595
+ # Offense count: 34
596
+ # This cop supports safe autocorrection (--autocorrect).
653
597
  # Configuration parameters: MinSize.
654
598
  # SupportedStyles: percent, brackets
655
599
  Style/SymbolArray: