blacklight 8.2.2 → 8.4.0

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 (225) hide show
  1. checksums.yaml +4 -4
  2. data/.env +1 -1
  3. data/.github/workflows/ruby.yml +60 -62
  4. data/.rubocop.yml +229 -21
  5. data/.rubocop_todo.yml +22 -55
  6. data/Gemfile +2 -10
  7. data/README.md +2 -2
  8. data/VERSION +1 -1
  9. data/app/assets/javascripts/blacklight/blacklight.esm.js +5 -1
  10. data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
  11. data/app/assets/javascripts/blacklight/blacklight.js +5 -1
  12. data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
  13. data/app/assets/stylesheets/blacklight/_balanced_list.scss +1 -1
  14. data/app/assets/stylesheets/blacklight/_bookmark.scss +30 -0
  15. data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +0 -4
  16. data/app/assets/stylesheets/blacklight/_constraints.scss +15 -9
  17. data/app/assets/stylesheets/blacklight/_controls.scss +0 -1
  18. data/app/assets/stylesheets/blacklight/_facets.scss +33 -37
  19. data/app/assets/stylesheets/blacklight/_header.scss +2 -35
  20. data/app/assets/stylesheets/blacklight/_icons.scss +3 -2
  21. data/app/assets/stylesheets/blacklight/_layout.scss +3 -0
  22. data/app/assets/stylesheets/blacklight/_mixins.scss +6 -21
  23. data/app/assets/stylesheets/blacklight/_search_form.scss +3 -8
  24. data/app/assets/stylesheets/blacklight/_search_history.scss +5 -5
  25. data/app/assets/stylesheets/blacklight/_search_results.scss +5 -2
  26. data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +16 -10
  27. data/app/components/blacklight/advanced_search_form_component.html.erb +1 -1
  28. data/app/components/blacklight/advanced_search_form_component.rb +6 -0
  29. data/app/components/blacklight/constraint_layout_component.html.erb +2 -9
  30. data/app/components/blacklight/constraint_layout_component.rb +8 -0
  31. data/app/components/blacklight/constraints_component.rb +3 -3
  32. data/app/components/blacklight/document/action_component.rb +2 -1
  33. data/app/components/blacklight/document/bookmark_component.html.erb +2 -1
  34. data/app/components/blacklight/document/bookmark_component.rb +6 -0
  35. data/app/components/blacklight/document/page_header_component.html.erb +7 -0
  36. data/app/components/blacklight/document/page_header_component.rb +85 -0
  37. data/app/components/blacklight/document_component.rb +1 -1
  38. data/app/components/blacklight/facet_component.rb +1 -1
  39. data/app/components/blacklight/facet_field_checkboxes_component.html.erb +1 -1
  40. data/app/components/blacklight/facet_field_checkboxes_component.rb +1 -1
  41. data/app/components/blacklight/facet_field_inclusive_constraint_component.html.erb +1 -1
  42. data/app/components/blacklight/facet_field_list_component.html.erb +1 -1
  43. data/app/components/blacklight/facet_item_component.rb +1 -1
  44. data/app/components/blacklight/facet_item_pivot_component.rb +2 -2
  45. data/app/components/blacklight/icons/bookmark_icon_component.rb +17 -0
  46. data/app/components/blacklight/icons/icon_component.rb +9 -4
  47. data/app/components/blacklight/icons/remove_component.rb +16 -0
  48. data/app/components/blacklight/metadata_field_component.html.erb +1 -1
  49. data/app/components/blacklight/metadata_field_component.rb +5 -0
  50. data/app/components/blacklight/response/facet_group_component.rb +1 -1
  51. data/app/components/blacklight/response/pagination_component.html.erb +1 -1
  52. data/app/components/blacklight/response/sort_component.html.erb +1 -6
  53. data/app/components/blacklight/response/sort_component.rb +15 -0
  54. data/app/components/blacklight/search/per_page_component.html.erb +2 -0
  55. data/app/components/blacklight/search/per_page_component.rb +50 -0
  56. data/app/components/blacklight/search_bar_component.html.erb +1 -1
  57. data/app/components/blacklight/search_context/server_item_pagination_component.html.erb +4 -7
  58. data/app/components/blacklight/skip_link_component.html.erb +7 -0
  59. data/app/components/blacklight/skip_link_component.rb +17 -0
  60. data/app/components/blacklight/system/dropdown_button_component.rb +18 -0
  61. data/app/components/blacklight/system/dropdown_component.rb +4 -7
  62. data/app/components/blacklight/system/flash_message_component.html.erb +1 -1
  63. data/app/components/blacklight/top_navbar_component.html.erb +2 -2
  64. data/app/components/blacklight/top_navbar_component.rb +4 -0
  65. data/app/helpers/blacklight/catalog_helper_behavior.rb +3 -5
  66. data/app/helpers/blacklight/component_helper_behavior.rb +4 -4
  67. data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -0
  68. data/app/helpers/blacklight/layout_helper_behavior.rb +3 -3
  69. data/app/javascript/blacklight/checkbox_submit.js +5 -1
  70. data/app/models/concerns/blacklight/document/semantic_fields.rb +1 -1
  71. data/app/presenters/blacklight/facet_checkbox_item_presenter.rb +11 -0
  72. data/app/presenters/blacklight/facet_field_presenter.rb +9 -1
  73. data/app/services/blacklight/search_service.rb +9 -1
  74. data/app/views/catalog/_per_page_widget.html.erb +1 -10
  75. data/app/views/catalog/_search_results.html.erb +1 -1
  76. data/app/views/catalog/_show_main_content.html.erb +1 -1
  77. data/app/views/catalog/show.html.erb +0 -2
  78. data/app/views/catalog/suggest.html.erb +1 -1
  79. data/app/views/kaminari/blacklight/_page.html.erb +14 -8
  80. data/app/views/layouts/blacklight/base.html.erb +3 -4
  81. data/app/views/shared/_flash_messages.html.erb +1 -1
  82. data/blacklight.gemspec +4 -0
  83. data/{docker-compose.yml → compose.yaml} +1 -1
  84. data/config/locales/blacklight.ar.yml +3 -0
  85. data/config/locales/blacklight.de.yml +3 -0
  86. data/config/locales/blacklight.en.yml +216 -229
  87. data/config/locales/blacklight.es.yml +3 -0
  88. data/config/locales/blacklight.fr.yml +3 -0
  89. data/config/locales/blacklight.hu.yml +3 -0
  90. data/config/locales/blacklight.it.yml +3 -0
  91. data/config/locales/blacklight.nl.yml +3 -0
  92. data/config/locales/blacklight.pt-BR.yml +3 -0
  93. data/config/locales/blacklight.sq.yml +3 -0
  94. data/config/locales/blacklight.zh.yml +3 -0
  95. data/lib/blacklight/abstract_repository.rb +6 -0
  96. data/lib/blacklight/configuration.rb +33 -19
  97. data/lib/blacklight/nested_open_struct_with_hash_access.rb +2 -2
  98. data/lib/blacklight/parameters.rb +1 -1
  99. data/lib/blacklight/solr/repository.rb +11 -4
  100. data/lib/blacklight/solr/request.rb +1 -1
  101. data/lib/blacklight/solr/response/facets.rb +1 -1
  102. data/lib/blacklight/solr/response/params.rb +1 -1
  103. data/lib/blacklight/solr/response.rb +0 -12
  104. data/lib/blacklight/solr/search_builder_behavior.rb +2 -2
  105. data/lib/blacklight/solr.rb +0 -6
  106. data/lib/blacklight.rb +4 -14
  107. data/lib/generators/blacklight/assets/propshaft_generator.rb +2 -2
  108. data/lib/generators/blacklight/models_generator.rb +1 -1
  109. data/package.json +1 -1
  110. data/spec/components/blacklight/advanced_search_form_component_spec.rb +2 -2
  111. data/spec/components/blacklight/constraint_layout_component_spec.rb +11 -11
  112. data/spec/components/blacklight/constraints_component_spec.rb +9 -9
  113. data/spec/components/blacklight/document/action_component_spec.rb +1 -1
  114. data/spec/components/blacklight/document/group_component_spec.rb +3 -3
  115. data/spec/components/blacklight/document/page_header_component_spec.rb +92 -0
  116. data/spec/components/blacklight/document/sidebar_component_spec.rb +3 -4
  117. data/spec/components/blacklight/document_component_spec.rb +41 -25
  118. data/spec/components/blacklight/facet_component_spec.rb +2 -2
  119. data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +5 -5
  120. data/spec/components/blacklight/facet_field_list_component_spec.rb +13 -13
  121. data/spec/components/blacklight/facet_item_component_spec.rb +5 -5
  122. data/spec/components/blacklight/facet_item_pivot_component_spec.rb +6 -6
  123. data/spec/components/blacklight/header_component_spec.rb +1 -2
  124. data/spec/components/blacklight/hidden_search_state_component_spec.rb +6 -6
  125. data/spec/components/blacklight/icons/icon_component_spec.rb +42 -0
  126. data/spec/components/blacklight/metadata_field_component_spec.rb +3 -3
  127. data/spec/components/blacklight/response/pagination_component_spec.rb +4 -4
  128. data/spec/components/blacklight/search_context/server_applied_params_component_spec.rb +1 -1
  129. data/spec/components/blacklight/search_context/server_item_pagination_component_spec.rb +2 -4
  130. data/spec/components/blacklight/system/flash_message_component_spec.rb +5 -5
  131. data/spec/controllers/blacklight/catalog_spec.rb +2 -2
  132. data/spec/controllers/blacklight/{catalog/component_configuration_spec.rb → configurable_spec.rb} +1 -1
  133. data/spec/controllers/bookmarks_controller_spec.rb +10 -10
  134. data/spec/controllers/catalog_controller_spec.rb +29 -31
  135. data/spec/features/advanced_search_spec.rb +30 -16
  136. data/spec/features/alternate_controller_spec.rb +9 -9
  137. data/spec/features/axe_spec.rb +4 -4
  138. data/spec/features/bookmarks_spec.rb +34 -19
  139. data/spec/features/citation_spec.rb +1 -1
  140. data/spec/features/did_you_mean_spec.rb +23 -23
  141. data/spec/features/facet_missing_spec.rb +9 -9
  142. data/spec/features/facets_spec.rb +21 -20
  143. data/spec/features/modal_spec.rb +4 -4
  144. data/spec/features/record_view_spec.rb +2 -2
  145. data/spec/features/search_context_spec.rb +6 -6
  146. data/spec/features/search_crawler_spec.rb +5 -5
  147. data/spec/features/search_filters_spec.rb +65 -65
  148. data/spec/features/search_history_spec.rb +12 -12
  149. data/spec/features/search_pagination_spec.rb +10 -10
  150. data/spec/features/search_results_spec.rb +1 -1
  151. data/spec/features/search_sort_spec.rb +4 -4
  152. data/spec/features/search_spec.rb +25 -25
  153. data/spec/features/sitelinks_search_box_spec.rb +2 -2
  154. data/spec/features/sms_spec.rb +1 -1
  155. data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +2 -2
  156. data/spec/helpers/blacklight/layout_helper_behavior_spec.rb +20 -3
  157. data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +2 -1
  158. data/spec/helpers/blacklight/url_helper_behavior_spec.rb +7 -8
  159. data/spec/helpers/blacklight_helper_spec.rb +13 -15
  160. data/spec/helpers/catalog_helper_spec.rb +3 -6
  161. data/spec/i18n_spec.rb +2 -1
  162. data/spec/lib/blacklight/nested_open_struct_with_hash_access_spec.rb +1 -1
  163. data/spec/lib/blacklight/open_struct_with_hash_access_spec.rb +1 -1
  164. data/spec/lib/blacklight/search_state_spec.rb +4 -4
  165. data/spec/lib/tasks/blacklight_task_spec.rb +2 -1
  166. data/spec/models/blacklight/configurable_spec.rb +1 -1
  167. data/spec/models/blacklight/configuration/context_spec.rb +1 -1
  168. data/spec/models/blacklight/configuration_spec.rb +14 -14
  169. data/spec/models/blacklight/document/active_model_shim_spec.rb +1 -1
  170. data/spec/models/blacklight/document/cache_key_spec.rb +1 -1
  171. data/spec/models/blacklight/document_spec.rb +1 -1
  172. data/spec/models/blacklight/facet_paginator_spec.rb +14 -14
  173. data/spec/models/blacklight/icon_spec.rb +1 -1
  174. data/spec/models/blacklight/search_builder_spec.rb +1 -1
  175. data/spec/models/blacklight/solr/document_spec.rb +3 -3
  176. data/spec/models/blacklight/solr/facet_paginator_spec.rb +1 -1
  177. data/spec/models/blacklight/solr/repository_spec.rb +33 -15
  178. data/spec/models/blacklight/solr/request_spec.rb +1 -1
  179. data/spec/models/blacklight/solr/response/facets_spec.rb +3 -3
  180. data/spec/models/blacklight/solr/response/group_response_spec.rb +1 -1
  181. data/spec/models/blacklight/solr/response/group_spec.rb +2 -2
  182. data/spec/models/blacklight/solr/response_spec.rb +3 -3
  183. data/spec/models/blacklight/solr/{search_builder_spec.rb → search_builder_behavior_spec.rb} +10 -20
  184. data/spec/models/blacklight/suggest/response_spec.rb +1 -1
  185. data/spec/models/blacklight/suggest_search_spec.rb +1 -1
  186. data/spec/models/blacklight/user_spec.rb +1 -1
  187. data/spec/models/bookmark_spec.rb +1 -1
  188. data/spec/models/solr_document_spec.rb +1 -1
  189. data/spec/presenters/blacklight/document_presenter_spec.rb +3 -4
  190. data/spec/presenters/blacklight/facet_checkbox_item_presenter_spec.rb +42 -0
  191. data/spec/presenters/blacklight/facet_field_presenter_spec.rb +14 -0
  192. data/spec/presenters/blacklight/field_presenter_spec.rb +1 -1
  193. data/spec/presenters/blacklight/index_presenter_spec.rb +2 -3
  194. data/spec/presenters/blacklight/json_presenter_spec.rb +1 -1
  195. data/spec/presenters/{pipeline_spec.rb → blacklight/rendering/pipeline_spec.rb} +1 -1
  196. data/spec/presenters/blacklight/show_presenter_spec.rb +5 -6
  197. data/spec/presenters/{thumbnail_presenter_spec.rb → blacklight/thumbnail_presenter_spec.rb} +5 -3
  198. data/spec/requests/load_suggestions_spec.rb +5 -5
  199. data/spec/routing/catalog_routing_spec.rb +1 -1
  200. data/spec/services/blacklight/field_retriever_spec.rb +1 -1
  201. data/spec/services/blacklight/search_service_spec.rb +11 -11
  202. data/spec/spec_helper.rb +2 -2
  203. data/spec/support/features/search_helpers.rb +2 -2
  204. data/spec/support/features/session_helpers.rb +3 -3
  205. data/spec/test_app_templates/lib/generators/test_app_generator.rb +3 -3
  206. data/spec/views/catalog/_document.html.erb_spec.rb +1 -4
  207. data/spec/views/catalog/_document_list.html.erb_spec.rb +2 -2
  208. data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +5 -6
  209. data/spec/views/catalog/_facet_layout.html.erb_spec.rb +7 -7
  210. data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +4 -4
  211. data/spec/views/catalog/_show_sidebar.erb_spec.rb +1 -4
  212. data/spec/views/catalog/_show_tools.html.erb_spec.rb +1 -2
  213. data/spec/views/catalog/_view_type_group.html.erb_spec.rb +7 -7
  214. data/spec/views/catalog/email_success.html.erb_spec.rb +1 -1
  215. data/spec/views/catalog/facet.html.erb_spec.rb +1 -1
  216. data/spec/views/catalog/facet.json.jbuilder_spec.rb +1 -1
  217. data/spec/views/catalog/index.atom.builder_spec.rb +18 -19
  218. data/spec/views/catalog/index.html.erb_spec.rb +2 -4
  219. data/spec/views/catalog/index.json.jbuilder_spec.rb +5 -8
  220. data/spec/views/catalog/show.html.erb_spec.rb +3 -5
  221. data/spec/views/catalog/show.json.jbuilder_spec.rb +1 -2
  222. data/spec/views/catalog/sms_success.html.erb_spec.rb +1 -1
  223. data/spec/views/shared/_user_util_links.html.erb_spec.rb +2 -3
  224. data/tasks/blacklight.rake +5 -5
  225. metadata +84 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b852f9b5c0e06c9c807400bb9449ced0e192137d62bdabfcb09b7eed2314262
4
- data.tar.gz: b3a1f6285c858b9acdb74d7200da29dd426ef61b1cdf0a843424c6670f5fca80
3
+ metadata.gz: ed7bb8769dafa656d12efa7f107916ecb197565cd087f1ca27d9258b3675e2ae
4
+ data.tar.gz: 741b5ce19a49e5fea14c9333b65a19e3311de8d5f92408e694f6d32564990f61
5
5
  SHA512:
6
- metadata.gz: f8059481dee8d4a30b3497cccde70d195112840870f08e8a732e11ca22e0fe985e8cfb52d202e5d2ecce06289710bff4ed2a7c98cef97ae32977c2064a8361b2
7
- data.tar.gz: d5b6d82af1332ccdf0e18cbe7ceb66bdb9a189db77ad7885cb4e16b8c05a82a52e16b9499ab018a9d43681bc02144f010f4bd343926363a5e093d0bac3ad477c
6
+ metadata.gz: 3fee605369adf52543eef812de930d0bd02bddd0f365ea295872aa6c6ad74fe420eaf8bade375630052e187b04020201812925bd55e5fecc83b2ac48df9098e8
7
+ data.tar.gz: 5d2f88d223b9e36c21972b8b1bae41625d5148b1a39f32b39e676fb8b6f9a3f5d31cf803dcada6e7b0f5f6927c32723eada6ebcac3c5598a45f4168b38dcf4d7
data/.env CHANGED
@@ -1,6 +1,6 @@
1
1
  ALPINE_RUBY_VERSION=3.0.3
2
2
  RAILS_VERSION=6.1.4.6
3
- VIEW_COMPONENT_VERSION=2.66.0
3
+ VIEW_COMPONENT_VERSION=3.12.1
4
4
  SOLR_PORT=8983
5
5
  SOLR_URL=http://solr:8983/solr/blacklight-core
6
6
  SOLR_VERSION=latest
@@ -11,69 +11,65 @@ on:
11
11
  push:
12
12
  branches:
13
13
  - main
14
- - 'release-*'
14
+ - "release-*"
15
15
  pull_request:
16
16
 
17
17
  jobs:
18
18
  lint:
19
19
  runs-on: ubuntu-latest
20
20
  steps:
21
- - uses: actions/checkout@v3
22
- - name: Set up Ruby
23
- uses: ruby/setup-ruby@v1
24
- with:
25
- ruby-version: 3.2
26
- bundler: 'latest'
27
- - name: Install dependencies
28
- run: bundle install
29
- - name: Run linter
30
- run: bundle exec rake rubocop
21
+ - uses: actions/checkout@v4
22
+ - name: Set up Ruby
23
+ uses: ruby/setup-ruby@v1
24
+ with:
25
+ ruby-version: 3.2
26
+ bundler: "latest"
27
+ - name: Change permissions
28
+ run: "chmod -f -R o-w /opt/hostedtoolcache/Ruby/3.2.5/x64/lib/ruby/gems/3.2.0/gems | :"
29
+ - name: Install dependencies
30
+ run: bundle install
31
+ - name: Run linter
32
+ run: bundle exec rake rubocop
31
33
  test:
32
34
  runs-on: ubuntu-latest
33
35
  name: test (ruby ${{ matrix.ruby }} / rails ${{ matrix.rails_version }} ${{ matrix.additional_name }})
34
36
  strategy:
35
37
  matrix:
36
- ruby: ['3.0']
37
- rails_version: ['6.1.7', '7.0.4']
38
+ ruby: ["3.3"]
39
+ rails_version: ["7.0.8.4", "7.1.3.4", "7.2.0"]
38
40
  bootstrap_version: [null]
39
- view_component_version: ['~> 2.66']
41
+ view_component_version: ["~> 3.12"]
40
42
  api: [null]
41
- additional_engine_cart_rails_options: ['']
42
- additional_name: ['']
43
+ additional_engine_cart_rails_options: [""]
44
+ additional_name: [""]
43
45
  include:
44
- - ruby: '3.3.0'
45
- rails_version: '7.1.1'
46
- - ruby: '3.2.2'
47
- rails_version: '7.1.1'
48
- - ruby: '3.2.2'
49
- rails_version: '7.0.4'
50
- - ruby: '3.2.2'
51
- rails_version: '7.0.4'
52
- solr_version: '9.3.0'
53
- additional_name: 'Solr 9.3.0'
54
- - ruby: '3.2.2'
55
- rails_version: '7.0.4'
56
- solr_version: '8.11.2'
57
- additional_name: 'Solr 8.11.2'
58
- - ruby: '3.1'
59
- rails_version: '7.0.4'
60
- - ruby: '3.1'
61
- rails_version: '7.0.4'
62
- view_component_version: '~> 3.0.0.rc1'
63
- additional_name: '/ ViewComponent 3'
64
- - ruby: '3.1'
65
- rails_version: '7.0.4'
66
- additional_name: '/ Propshaft'
67
- additional_engine_cart_rails_options: -a propshaft --css=bootstrap
68
- - ruby: '3.0'
69
- rails_version: '7.0.4'
70
- bootstrap_version: '~> 4.0'
71
- additional_name: '/ Bootstrap 4'
72
- - ruby: '3.0'
73
- rails_version: '7.0.4'
74
- api: 'true'
75
- additional_engine_cart_rails_options: --api --skip-yarn
76
- additional_name: '/ API'
46
+ - ruby: "3.2"
47
+ rails_version: "6.1.7.8"
48
+ - ruby: "3.2"
49
+ rails_version: "7.0.8.4"
50
+ - ruby: "3.2"
51
+ rails_version: "7.1.3.4"
52
+ solr_version: "8.11.2"
53
+ additional_name: "Solr 8.11.2"
54
+ - ruby: "3.1"
55
+ rails_version: "7.1.3.4"
56
+ - ruby: "3.1"
57
+ rails_version: "7.1.3.4"
58
+ view_component_version: "~> 2.66"
59
+ additional_name: "/ ViewComponent 2"
60
+ - ruby: "3.1"
61
+ rails_version: "7.0.8.4"
62
+ additional_name: "/ Propshaft"
63
+ additional_engine_cart_rails_options: -a propshaft --css=bootstrap
64
+ - ruby: "3.1"
65
+ rails_version: "7.0.8.4"
66
+ bootstrap_version: "~> 4.0"
67
+ additional_name: "/ Bootstrap 4"
68
+ - ruby: "3.3"
69
+ rails_version: "7.1.3.4"
70
+ api: "true"
71
+ additional_engine_cart_rails_options: --api --skip-yarn
72
+ additional_name: "/ API"
77
73
  env:
78
74
  RAILS_VERSION: ${{ matrix.rails_version }}
79
75
  SOLR_VERSION: ${{ matrix.solr_version || 'latest' }}
@@ -82,19 +78,21 @@ jobs:
82
78
  BLACKLIGHT_API_TEST: ${{ matrix.api }}
83
79
  ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-coffee --skip-test ${{ matrix.additional_engine_cart_rails_options }}"
84
80
  steps:
85
- - uses: actions/checkout@v3
86
- - name: Set up Ruby
87
- uses: ruby/setup-ruby@v1
88
- with:
89
- bundler: 'latest'
90
- ruby-version: ${{ matrix.ruby }}
91
- - name: Install dependencies
92
- run: bundle install
93
- - name: Run tests
94
- run: bundle exec rake ci
81
+ - uses: actions/checkout@v4
82
+ - name: Set up Ruby
83
+ uses: ruby/setup-ruby@v1
84
+ with:
85
+ bundler: "latest"
86
+ ruby-version: ${{ matrix.ruby }}
87
+ - name: Change permissions
88
+ run: "chmod -f -R o-w /opt/hostedtoolcache/Ruby/3.2.5/x64/lib/ruby/gems/3.2.0/gems | :"
89
+ - name: Install dependencies
90
+ run: bundle install
91
+ - name: Run tests
92
+ run: bundle exec rake ci
95
93
  docker_build:
96
94
  runs-on: ubuntu-latest
97
95
  steps:
98
- - uses: actions/checkout@v3
99
- - name: Build docker image
100
- run: docker-compose build app
96
+ - uses: actions/checkout@v4
97
+ - name: Build docker image
98
+ run: docker compose build app
data/.rubocop.yml CHANGED
@@ -1,34 +1,34 @@
1
1
  require:
2
2
  - rubocop-capybara
3
3
  - rubocop-rspec
4
+ - rubocop-rspec_rails
4
5
  - rubocop-rails
6
+ - rubocop-factory_bot
5
7
 
6
8
  inherit_from:
7
9
  - .rubocop_todo.yml
8
10
 
9
11
  AllCops:
10
12
  DisplayCopNames: true
11
- TargetRubyVersion: 2.7
13
+ TargetRubyVersion: 3.0
12
14
  TargetRailsVersion: 6.1
13
15
  Exclude:
14
- - "lib/generators/blacklight/templates/**/*"
15
- - "blacklight.gemspec"
16
-
16
+ - "lib/generators/blacklight/templates/**/*"
17
+ - "blacklight.gemspec"
17
18
 
18
19
  Lint/UselessAssignment:
19
20
  Exclude:
20
21
  - app/presenters/blacklight/facet_item_pivot_presenter.rb # https://github.com/rubocop/rubocop/issues/11124
21
22
 
22
-
23
23
  # engine_cart block includes conditional, not duplication
24
24
  Bundler/DuplicatedGem:
25
25
  Exclude:
26
- - 'Gemfile'
26
+ - "Gemfile"
27
27
 
28
28
  # engine_cart block is following default Rails order
29
29
  Bundler/OrderedGems:
30
30
  Exclude:
31
- - 'Gemfile'
31
+ - "Gemfile"
32
32
 
33
33
  Layout/IndentationConsistency:
34
34
  EnforcedStyle: normal
@@ -51,13 +51,13 @@ Metrics/ClassLength:
51
51
  Layout/LineLength:
52
52
  Max: 200
53
53
  Exclude:
54
- - 'spec/**/*'
54
+ - "spec/**/*"
55
55
 
56
56
  Metrics/ModuleLength:
57
57
  Exclude:
58
- - 'app/controllers/concerns/blacklight/catalog.rb'
59
- - 'lib/blacklight/solr/search_builder_behavior.rb'
60
- - 'lib/blacklight/solr/response/facets.rb'
58
+ - "app/controllers/concerns/blacklight/catalog.rb"
59
+ - "lib/blacklight/solr/search_builder_behavior.rb"
60
+ - "lib/blacklight/solr/response/facets.rb"
61
61
 
62
62
  Metrics/AbcSize:
63
63
  Exclude:
@@ -90,7 +90,7 @@ Style/AccessModifierDeclarations:
90
90
 
91
91
  Style/MissingRespondToMissing:
92
92
  Exclude:
93
- - 'lib/blacklight/nested_open_struct_with_hash_access.rb'
93
+ - "lib/blacklight/nested_open_struct_with_hash_access.rb"
94
94
 
95
95
  Style/StringLiterals:
96
96
  Enabled: false
@@ -122,7 +122,7 @@ Style/ExponentialNotation:
122
122
  Style/HashEachMethods:
123
123
  Enabled: true
124
124
  Exclude:
125
- - 'spec/services/blacklight/search_service_spec.rb'
125
+ - "spec/services/blacklight/search_service_spec.rb"
126
126
 
127
127
  Style/HashTransformKeys:
128
128
  Enabled: true
@@ -200,7 +200,7 @@ Style/ArgumentsForwarding: # new in 1.1
200
200
  Enabled: true
201
201
  Exclude:
202
202
  # This cop includes some checks specific to Ruby 3.2
203
- - 'lib/blacklight/solr/response/group_response.rb'
203
+ - "lib/blacklight/solr/response/group_response.rb"
204
204
  Style/CollectionCompact: # new in 1.2
205
205
  Enabled: true
206
206
  Style/DocumentDynamicEvalDefinition: # new in 1.1
@@ -241,18 +241,18 @@ Style/SwapValues: # new in 1.1
241
241
  Enabled: true
242
242
  RSpec/DescribeClass:
243
243
  Exclude:
244
- - 'spec/lib/tasks/blacklight_task_spec.rb'
245
- - 'spec/features/**/*'
246
- - 'spec/requests/**/*'
247
- - 'spec/routing/**/*'
248
- - 'spec/views/**/*'
244
+ - "spec/lib/tasks/blacklight_task_spec.rb"
245
+ - "spec/features/**/*"
246
+ - "spec/requests/**/*"
247
+ - "spec/routing/**/*"
248
+ - "spec/views/**/*"
249
249
  RSpec/ExcessiveDocstringSpacing: # new in 2.5
250
250
  Enabled: true
251
251
  RSpec/IdenticalEqualityAssertion: # new in 2.4
252
252
  Enabled: true
253
253
  RSpec/SubjectDeclaration: # new in 2.5
254
254
  Enabled: true
255
- RSpec/Rails/AvoidSetupHook: # new in 2.4
255
+ RSpecRails/AvoidSetupHook: # new in 2.4
256
256
  Enabled: true
257
257
  Rails/ActiveRecordCallbacksOrder: # new in 2.7
258
258
  Enabled: true
@@ -320,7 +320,7 @@ RSpec/BeEq: # new in 2.9.0
320
320
  Enabled: true
321
321
  RSpec/BeNil: # new in 2.9.0
322
322
  Enabled: true
323
- RSpec/FactoryBot/SyntaxMethods: # new in 2.7
323
+ FactoryBot/SyntaxMethods: # new in 2.7
324
324
  Enabled: true
325
325
  Rails/ActionControllerTestCase: # new in 2.14
326
326
  Enabled: true
@@ -376,3 +376,211 @@ Rails/StripHeredoc: # new in 2.15
376
376
  Enabled: true
377
377
  Rails/ToFormattedS: # new in 2.15
378
378
  Enabled: true
379
+ Gemspec/DevelopmentDependencies: # new in 1.44
380
+ Enabled: true
381
+ Lint/DuplicateMagicComment: # new in 1.37
382
+ Enabled: true
383
+ Lint/DuplicateMatchPattern: # new in 1.50
384
+ Enabled: true
385
+ Lint/ItWithoutArgumentsInBlock: # new in 1.59
386
+ Enabled: true
387
+ Lint/LiteralAssignmentInCondition: # new in 1.58
388
+ Enabled: true
389
+ Lint/MixedCaseRange: # new in 1.53
390
+ Enabled: true
391
+ Lint/RedundantRegexpQuantifiers: # new in 1.53
392
+ Enabled: true
393
+ Lint/RequireRangeParentheses: # new in 1.32
394
+ Enabled: true
395
+ Lint/UselessRescue: # new in 1.43
396
+ Enabled: true
397
+ Metrics/CollectionLiteralLength: # new in 1.47
398
+ Enabled: true
399
+ Style/ArrayIntersect: # new in 1.40
400
+ Enabled: true
401
+ Style/ComparableClamp: # new in 1.44
402
+ Enabled: true
403
+ Style/ConcatArrayLiterals: # new in 1.41
404
+ Enabled: true
405
+ Style/DataInheritance: # new in 1.49
406
+ Enabled: true
407
+ Style/DirEmpty: # new in 1.48
408
+ Enabled: true
409
+ Style/EmptyHeredoc: # new in 1.32
410
+ Enabled: true
411
+ Style/ExactRegexpMatch: # new in 1.51
412
+ Enabled: true
413
+ Style/FileEmpty: # new in 1.48
414
+ Enabled: true
415
+ Style/MagicCommentFormat: # new in 1.35
416
+ Enabled: true
417
+ Style/MapIntoArray: # new in 1.63
418
+ Enabled: true
419
+ Style/MapToSet: # new in 1.42
420
+ Enabled: true
421
+ Style/MinMaxComparison: # new in 1.42
422
+ Enabled: true
423
+ Style/OperatorMethodCall: # new in 1.37
424
+ Enabled: true
425
+ Style/RedundantArrayConstructor: # new in 1.52
426
+ Enabled: true
427
+ Style/RedundantConstantBase: # new in 1.40
428
+ Enabled: true
429
+ Style/RedundantCurrentDirectoryInPath: # new in 1.53
430
+ Enabled: true
431
+ Style/RedundantDoubleSplatHashBraces: # new in 1.41
432
+ Enabled: true
433
+ Style/RedundantEach: # new in 1.38
434
+ Enabled: true
435
+ Style/RedundantFilterChain: # new in 1.52
436
+ Enabled: true
437
+ Style/RedundantHeredocDelimiterQuotes: # new in 1.45
438
+ Enabled: true
439
+ Style/RedundantLineContinuation: # new in 1.49
440
+ Enabled: true
441
+ Style/RedundantRegexpArgument: # new in 1.53
442
+ Enabled: true
443
+ Style/RedundantRegexpConstructor: # new in 1.52
444
+ Enabled: true
445
+ Style/RedundantStringEscape: # new in 1.37
446
+ Enabled: true
447
+ Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
448
+ Enabled: true
449
+ Style/SendWithLiteralMethodName: # new in 1.64
450
+ Enabled: true
451
+ Style/SingleLineDoEndBlock: # new in 1.57
452
+ Enabled: true
453
+ Style/SuperArguments: # new in 1.64
454
+ Enabled: true
455
+ Style/SuperWithArgsParentheses: # new in 1.58
456
+ Enabled: true
457
+ Style/YAMLFileRead: # new in 1.53
458
+ Enabled: true
459
+ Capybara/ClickLinkOrButtonStyle: # new in 2.19
460
+ Enabled: true
461
+ Capybara/MatchStyle: # new in 2.17
462
+ Enabled: true
463
+ Capybara/NegationMatcher: # new in 2.14
464
+ Enabled: true
465
+ Exclude:
466
+ - "spec/models/**/*"
467
+ Capybara/RedundantWithinFind: # new in 2.20
468
+ Enabled: true
469
+ Capybara/SpecificActions: # new in 2.14
470
+ Enabled: true
471
+ Capybara/SpecificFinders: # new in 2.13
472
+ Enabled: true
473
+ Capybara/SpecificMatcher: # new in 2.12
474
+ Enabled: true
475
+ Capybara/RSpec/HaveSelector: # new in 2.19
476
+ Enabled: true
477
+ Capybara/RSpec/PredicateMatcher: # new in 2.19
478
+ Enabled: true
479
+ FactoryBot/AssociationStyle: # new in 2.23
480
+ Enabled: true
481
+ FactoryBot/ConsistentParenthesesStyle: # new in 2.14
482
+ Enabled: true
483
+ FactoryBot/ExcessiveCreateList: # new in 2.25
484
+ Enabled: true
485
+ FactoryBot/FactoryAssociationWithStrategy: # new in 2.23
486
+ Enabled: true
487
+ FactoryBot/FactoryNameStyle: # new in 2.16
488
+ Enabled: true
489
+ FactoryBot/IdSequence: # new in 2.24
490
+ Enabled: true
491
+ FactoryBot/RedundantFactoryOption: # new in 2.23
492
+ Enabled: true
493
+ RSpecRails/HaveHttpStatus: # new in 2.12
494
+ Enabled: true
495
+ RSpecRails/InferredSpecType: # new in 2.14
496
+ Enabled: true
497
+ RSpecRails/MinitestAssertions: # new in 2.17
498
+ Enabled: true
499
+ RSpecRails/NegationBeValid: # new in 2.23
500
+ Enabled: true
501
+ RSpecRails/TravelAround: # new in 2.19
502
+ Enabled: true
503
+ RSpec/BeEmpty: # new in 2.20
504
+ Enabled: true
505
+ RSpec/ContainExactly: # new in 2.19
506
+ Enabled: true
507
+ RSpec/DuplicatedMetadata: # new in 2.16
508
+ Enabled: true
509
+ RSpec/EmptyMetadata: # new in 2.24
510
+ Enabled: true
511
+ RSpec/EmptyOutput: # new in 2.29
512
+ Enabled: true
513
+ RSpec/Eq: # new in 2.24
514
+ Enabled: true
515
+ RSpec/ExpectInLet: # new in 2.30
516
+ Enabled: true
517
+ RSpec/IndexedLet: # new in 2.20
518
+ Enabled: true
519
+ RSpec/IsExpectedSpecify: # new in 2.27
520
+ Enabled: true
521
+ RSpec/MatchArray: # new in 2.19
522
+ Enabled: true
523
+ RSpec/MetadataStyle: # new in 2.24
524
+ Enabled: true
525
+ RSpec/NoExpectationExample: # new in 2.13
526
+ Enabled: true
527
+ RSpec/PendingWithoutReason: # new in 2.16
528
+ Enabled: true
529
+ RSpec/ReceiveMessages: # new in 2.23
530
+ Enabled: true
531
+ RSpec/RedundantAround: # new in 2.19
532
+ Enabled: true
533
+ RSpec/RedundantPredicateMatcher: # new in 2.26
534
+ Enabled: true
535
+ RSpec/RemoveConst: # new in 2.26
536
+ Enabled: true
537
+ RSpec/RepeatedSubjectCall: # new in 2.27
538
+ Enabled: true
539
+ RSpec/SkipBlockInsideExample: # new in 2.19
540
+ Enabled: true
541
+ RSpec/SortMetadata: # new in 2.14
542
+ Enabled: true
543
+ RSpec/SpecFilePathFormat: # new in 2.24
544
+ Enabled: true
545
+ RSpec/SpecFilePathSuffix: # new in 2.24
546
+ Enabled: true
547
+ RSpec/UndescriptiveLiteralsDescription: # new in 2.29
548
+ Enabled: true
549
+ Rails/ActionControllerFlashBeforeRender: # new in 2.16
550
+ Enabled: true
551
+ Rails/ActionOrder: # new in 2.17
552
+ Enabled: true
553
+ Rails/ActiveSupportOnLoad: # new in 2.16
554
+ Enabled: true
555
+ Rails/DangerousColumnNames: # new in 2.21
556
+ Enabled: true
557
+ Rails/EnvLocal: # new in 2.22
558
+ Enabled: true
559
+ Rails/FreezeTime: # new in 2.16
560
+ Enabled: true
561
+ Rails/IgnoredColumnsAssignment: # new in 2.17
562
+ Enabled: true
563
+ Rails/RedundantActiveRecordAllMethod: # new in 2.21
564
+ Enabled: true
565
+ Rails/ResponseParsedBody: # new in 2.18
566
+ Enabled: true
567
+ Rails/RootPathnameMethods: # new in 2.16
568
+ Enabled: true
569
+ Rails/SelectMap: # new in 2.21
570
+ Enabled: true
571
+ Rails/ThreeStateBooleanColumn: # new in 2.19
572
+ Enabled: true
573
+ Rails/ToSWithArgument: # new in 2.16
574
+ Enabled: true
575
+ Rails/TopLevelHashWithIndifferentAccess: # new in 2.16
576
+ Enabled: true
577
+ Rails/UnusedRenderContent: # new in 2.21
578
+ Enabled: true
579
+ Rails/WhereMissing: # new in 2.16
580
+ Enabled: true
581
+ Rails/WhereNotWithMultipleConditions: # new in 2.17
582
+ Enabled: true
583
+ Rails/WhereRange: # new in 2.25
584
+ Enabled: true
585
+ Gemspec/AddRuntimeDependency: # new in 1.65
586
+ Enabled: true