blacklight 9.0.0.beta1 → 9.0.0.beta2

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 (203) hide show
  1. checksums.yaml +4 -4
  2. data/.github/matrix.json +47 -0
  3. data/.github/workflows/build.yml +16 -0
  4. data/.github/workflows/lint.yml +25 -0
  5. data/.github/workflows/main.yml +22 -0
  6. data/.github/workflows/release_7_x_scheduled.yml +39 -0
  7. data/.github/workflows/release_8_x_scheduled.yml +39 -0
  8. data/.github/workflows/test.yml +53 -0
  9. data/.rubocop.yml +70 -2
  10. data/.rubocop_todo.yml +43 -67
  11. data/.solr_wrapper.yml +2 -0
  12. data/VERSION +1 -1
  13. data/app/assets/builds/blacklight.css +19 -15
  14. data/app/assets/javascripts/blacklight/blacklight.esm.js +31 -69
  15. data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
  16. data/app/assets/javascripts/blacklight/blacklight.js +31 -69
  17. data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
  18. data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +4 -0
  19. data/app/assets/stylesheets/blacklight/_facets.scss +2 -2
  20. data/app/assets/stylesheets/blacklight/_header.scss +4 -0
  21. data/app/assets/stylesheets/blacklight/_modal.scss +9 -8
  22. data/app/assets/stylesheets/blacklight/_pagination.scss +1 -3
  23. data/app/assets/stylesheets/blacklight/_search_history.scss +0 -4
  24. data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +3 -0
  25. data/app/components/blacklight/advanced_search_form_component.rb +2 -2
  26. data/app/components/blacklight/constraints_component.rb +2 -2
  27. data/app/components/blacklight/document/action_component.rb +1 -3
  28. data/app/components/blacklight/document/bookmark_component.rb +2 -2
  29. data/app/components/blacklight/document/more_like_this_component.rb +2 -2
  30. data/app/components/blacklight/document/page_header_component.rb +2 -2
  31. data/app/components/blacklight/document/thumbnail_component.html.erb +3 -7
  32. data/app/components/blacklight/document/thumbnail_component.rb +7 -6
  33. data/app/components/blacklight/document_component.rb +3 -3
  34. data/app/components/blacklight/document_title_component.rb +3 -10
  35. data/app/components/blacklight/facet_field_checkboxes_component.rb +2 -20
  36. data/app/components/blacklight/facet_field_component.rb +2 -17
  37. data/app/components/blacklight/facet_field_filter_component.rb +2 -21
  38. data/app/components/blacklight/facet_field_inclusive_constraint_component.rb +4 -25
  39. data/app/components/blacklight/facet_field_list_component.rb +2 -32
  40. data/app/components/blacklight/facet_field_no_layout_component.rb +2 -10
  41. data/app/components/blacklight/facet_field_pagination_component.html.erb +2 -2
  42. data/app/components/blacklight/facet_item_component.rb +2 -74
  43. data/app/components/blacklight/facet_item_pivot_component.rb +1 -1
  44. data/app/components/blacklight/facets/checkboxes_component.rb +26 -0
  45. data/app/components/blacklight/facets/count_component.rb +23 -0
  46. data/app/components/blacklight/{facet_field_component.html.erb → facets/field_component.html.erb} +1 -1
  47. data/app/components/blacklight/facets/field_component.rb +23 -0
  48. data/app/components/blacklight/facets/filters_component.html.erb +4 -0
  49. data/app/components/blacklight/facets/filters_component.rb +27 -0
  50. data/app/components/blacklight/{facet_field_inclusive_constraint_component.html.erb → facets/inclusive_constraint_component.html.erb} +1 -1
  51. data/app/components/blacklight/facets/inclusive_constraint_component.rb +31 -0
  52. data/app/components/blacklight/{facet_field_filter_component.html.erb → facets/index_navigation_component.html.erb} +1 -1
  53. data/app/components/blacklight/facets/index_navigation_component.rb +32 -0
  54. data/app/components/blacklight/facets/item_component.rb +73 -0
  55. data/app/components/blacklight/facets/list_component.html.erb +11 -0
  56. data/app/components/blacklight/facets/list_component.rb +38 -0
  57. data/app/components/blacklight/facets/no_layout_component.rb +16 -0
  58. data/app/components/blacklight/facets/selected_value_component.rb +29 -0
  59. data/app/components/blacklight/facets/suggest_component.html.erb +12 -0
  60. data/app/components/blacklight/facets/suggest_component.rb +22 -0
  61. data/app/components/blacklight/metadata_field_plain_text_layout_component.rb +2 -2
  62. data/app/components/blacklight/response/facet_group_component.html.erb +1 -1
  63. data/app/components/blacklight/response/facet_group_component.rb +5 -1
  64. data/app/components/blacklight/system/dropdown_component.html.erb +1 -1
  65. data/app/components/blacklight/system/dropdown_component.rb +1 -1
  66. data/app/components/blacklight/top_navbar_component.html.erb +1 -1
  67. data/app/controllers/concerns/blacklight/bookmarks.rb +3 -3
  68. data/app/controllers/concerns/blacklight/catalog.rb +10 -25
  69. data/app/controllers/concerns/blacklight/controller.rb +1 -1
  70. data/app/controllers/concerns/blacklight/facetable.rb +34 -0
  71. data/app/controllers/concerns/blacklight/search_context.rb +1 -1
  72. data/app/controllers/concerns/blacklight/searchable.rb +1 -1
  73. data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -2
  74. data/app/helpers/blacklight/document_helper_behavior.rb +3 -1
  75. data/app/helpers/blacklight/facets_helper_behavior.rb +9 -0
  76. data/app/helpers/blacklight/icon_helper_behavior.rb +2 -2
  77. data/app/javascript/blacklight-frontend/checkbox_submit.js +3 -0
  78. data/app/javascript/blacklight-frontend/debounce.js +1 -1
  79. data/app/javascript/blacklight-frontend/facet_suggest.js +23 -3
  80. data/app/javascript/blacklight-frontend/index.js +0 -2
  81. data/app/javascript/blacklight-frontend/modal.js +1 -4
  82. data/app/javascript/blacklight-frontend/search_context.js +3 -2
  83. data/app/models/facet_search_builder.rb +5 -0
  84. data/app/presenters/blacklight/facet_field_presenter.rb +1 -1
  85. data/app/presenters/blacklight/json_presenter.rb +1 -3
  86. data/app/presenters/blacklight/rendering/helper_method.rb +4 -4
  87. data/app/presenters/blacklight/rendering/join.rb +2 -2
  88. data/app/services/blacklight/facet_search_service.rb +44 -0
  89. data/app/services/blacklight/field_retriever.rb +1 -1
  90. data/app/services/blacklight/search_service.rb +6 -6
  91. data/app/values/blacklight/types.rb +2 -2
  92. data/app/views/catalog/_facet_pivot.html.erb +1 -1
  93. data/app/views/catalog/_home_text.html.erb +2 -2
  94. data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
  95. data/app/views/catalog/facet.html.erb +8 -10
  96. data/config/locales/blacklight.ar.yml +2 -2
  97. data/config/locales/blacklight.es.yml +2 -2
  98. data/config/locales/blacklight.fr.yml +2 -2
  99. data/config/locales/blacklight.hu.yml +2 -2
  100. data/config/locales/blacklight.it.yml +2 -2
  101. data/config/locales/blacklight.nl.yml +1 -1
  102. data/config/locales/blacklight.pt-BR.yml +2 -2
  103. data/config/locales/blacklight.sq.yml +2 -2
  104. data/config/locales/blacklight.zh.yml +2 -2
  105. data/lib/blacklight/abstract_repository.rb +2 -2
  106. data/lib/blacklight/abstract_search_builder.rb +154 -0
  107. data/lib/blacklight/configuration/context.rb +3 -3
  108. data/lib/blacklight/configuration/facet_field.rb +6 -6
  109. data/lib/blacklight/configuration/field.rb +4 -4
  110. data/lib/blacklight/configuration/fields.rb +0 -1
  111. data/lib/blacklight/configuration/search_field.rb +1 -1
  112. data/lib/blacklight/configuration/view_config.rb +2 -2
  113. data/lib/blacklight/configuration.rb +6 -7
  114. data/lib/blacklight/facet_search_builder.rb +18 -0
  115. data/lib/blacklight/nested_open_struct_with_hash_access.rb +1 -1
  116. data/lib/blacklight/open_struct_with_hash_access.rb +2 -2
  117. data/lib/blacklight/search_builder.rb +1 -159
  118. data/lib/blacklight/search_state/filter_field.rb +4 -4
  119. data/lib/blacklight/search_state/pivot_filter_field.rb +4 -4
  120. data/lib/blacklight/solr/abstract_filter_query_builder.rb +77 -0
  121. data/lib/blacklight/solr/default_filter_query_builder.rb +20 -0
  122. data/lib/blacklight/solr/facet_search_builder_behavior.rb +62 -0
  123. data/lib/blacklight/solr/repository.rb +8 -9
  124. data/lib/blacklight/solr/response/facets.rb +2 -2
  125. data/lib/blacklight/solr/response/params.rb +0 -4
  126. data/lib/blacklight/solr/response.rb +5 -1
  127. data/lib/blacklight/solr/search_builder_behavior.rb +17 -132
  128. data/lib/blacklight.rb +1 -1
  129. data/lib/generators/blacklight/assets/importmap_generator.rb +3 -5
  130. data/lib/generators/blacklight/assets_generator.rb +1 -1
  131. data/lib/generators/blacklight/search_builder_generator.rb +1 -1
  132. data/lib/generators/blacklight/templates/.solr_wrapper.yml +2 -0
  133. data/lib/generators/blacklight/templates/catalog_controller.rb +3 -1
  134. data/lib/generators/blacklight/templates/solr/conf/solrconfig.xml +0 -4
  135. data/package.json +3 -3
  136. data/spec/components/blacklight/advanced_search_form_component_spec.rb +18 -22
  137. data/spec/components/blacklight/constraint_layout_component_spec.rb +8 -8
  138. data/spec/components/blacklight/constraints_component_spec.rb +11 -11
  139. data/spec/components/blacklight/document/action_component_spec.rb +23 -15
  140. data/spec/components/blacklight/document/group_component_spec.rb +10 -15
  141. data/spec/components/blacklight/document/page_header_component_spec.rb +35 -28
  142. data/spec/components/blacklight/document/sidebar_component_spec.rb +5 -11
  143. data/spec/components/blacklight/document_component_spec.rb +98 -65
  144. data/spec/components/blacklight/facet_component_spec.rb +12 -8
  145. data/spec/components/blacklight/facet_item_pivot_component_spec.rb +12 -12
  146. data/spec/components/blacklight/{facet_field_checkboxes_component_spec.rb → facets/checkboxes_component_spec.rb} +13 -13
  147. data/spec/components/blacklight/facets/filters_component_spec.rb +36 -0
  148. data/spec/components/blacklight/facets/index_navigation_component_spec.rb +40 -0
  149. data/spec/components/blacklight/{facet_item_component_spec.rb → facets/item_component_spec.rb} +10 -10
  150. data/spec/components/blacklight/{facet_field_list_component_spec.rb → facets/list_component_spec.rb} +23 -23
  151. data/spec/components/blacklight/facets/suggest_component_spec.rb +68 -0
  152. data/spec/components/blacklight/header_component_spec.rb +2 -4
  153. data/spec/components/blacklight/hidden_search_state_component_spec.rb +7 -7
  154. data/spec/components/blacklight/metadata_field_component_spec.rb +17 -15
  155. data/spec/components/blacklight/response/facet_group_component_spec.rb +37 -0
  156. data/spec/components/blacklight/response/pagination_component_spec.rb +1 -1
  157. data/spec/components/blacklight/response/spellcheck_component_spec.rb +1 -1
  158. data/spec/components/blacklight/search_bar_component_spec.rb +4 -4
  159. data/spec/components/blacklight/search_context/server_applied_params_component_spec.rb +2 -2
  160. data/spec/components/blacklight/search_context/server_item_pagination_component_spec.rb +3 -5
  161. data/spec/components/blacklight/skip_link_component_spec.rb +8 -11
  162. data/spec/components/blacklight/start_over_button_component_spec.rb +4 -4
  163. data/spec/components/blacklight/system/dropdown_component_spec.rb +26 -0
  164. data/spec/components/blacklight/system/flash_message_component_spec.rb +7 -11
  165. data/spec/controllers/catalog_controller_spec.rb +12 -20
  166. data/spec/features/facets_spec.rb +70 -7
  167. data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +10 -0
  168. data/spec/lib/blacklight/configuration/facet_field_spec.rb +2 -2
  169. data/spec/lib/blacklight/parameters_spec.rb +12 -1
  170. data/spec/lib/blacklight/search_state/filter_field_spec.rb +18 -0
  171. data/spec/models/blacklight/configuration_spec.rb +32 -28
  172. data/spec/models/blacklight/facet_search_builder_spec.rb +19 -0
  173. data/spec/models/blacklight/search_builder_spec.rb +1 -11
  174. data/spec/models/blacklight/solr/default_filter_query_builder_spec.rb +72 -0
  175. data/spec/models/blacklight/solr/document_spec.rb +0 -4
  176. data/spec/models/blacklight/solr/facet_search_builder_behavior_spec.rb +929 -0
  177. data/spec/models/blacklight/solr/repository_spec.rb +31 -29
  178. data/spec/models/blacklight/solr/response/facets_spec.rb +86 -40
  179. data/spec/models/blacklight/solr/response/group_response_spec.rb +8 -5
  180. data/spec/models/blacklight/solr/response/group_spec.rb +9 -5
  181. data/spec/models/blacklight/solr/response_spec.rb +96 -64
  182. data/spec/models/blacklight/solr/search_builder_behavior_spec.rb +2 -227
  183. data/spec/models/solr_document_spec.rb +5 -1
  184. data/spec/services/blacklight/search_service_spec.rb +6 -27
  185. data/spec/spec_helper.rb +0 -1
  186. data/spec/support/view_component_test_helpers.rb +0 -18
  187. data/spec/views/catalog/facet.html.erb_spec.rb +10 -3
  188. data/spec/views/catalog/index.atom.builder_spec.rb +6 -3
  189. data/spec/views/catalog/index.html.erb_spec.rb +3 -1
  190. metadata +58 -29
  191. data/.github/workflows/ruby.yml +0 -98
  192. data/app/components/blacklight/facet_field_list_component.html.erb +0 -19
  193. data/app/components/blacklight/search/facet_suggest_input.html.erb +0 -9
  194. data/app/components/blacklight/search/facet_suggest_input.rb +0 -16
  195. data/app/javascript/blacklight-frontend/modalForm.js +0 -60
  196. data/app/views/catalog/_facet_index_navigation.html.erb +0 -1
  197. data/app/views/catalog/_facet_layout.html.erb +0 -8
  198. data/app/views/catalog/_facet_pagination.html.erb +0 -1
  199. data/spec/components/blacklight/document_metadata_component_spec.rb +0 -0
  200. data/spec/components/blacklight/search/facet_suggest_input_spec.rb +0 -33
  201. data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +0 -43
  202. data/spec/views/catalog/_facet_layout.html.erb_spec.rb +0 -41
  203. /data/app/components/blacklight/{facet_field_checkboxes_component.html.erb → facets/checkboxes_component.html.erb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4ffba1fbfab58e820f1953e4c0b1ff8d3bbcd57da645c10a44aa2f0a09f4a7a
4
- data.tar.gz: 323b2afff4d4a8b308486ad81978b64f3a88aa8414e890ea5563bd3ae7820d0e
3
+ metadata.gz: 35ec893efb2a95e7a708691df6c41db2053379f1f5fa770a658f8ad39ecb9ce5
4
+ data.tar.gz: 8f9995385332ea84fcf62a67c7b0e41cc43273e23f81f3cc586e6a7203aa46e9
5
5
  SHA512:
6
- metadata.gz: 8d3bbad62d2d7ecfa2b19657d43dab0186e6a945dbd6093c120f2fa5ba833be91b78f75ccd73379008bfb20e199a44702ce49000ce5561203baae41029a5cd3f
7
- data.tar.gz: 6a2837ca8deb3fd6650b947197d8dd5c5320631a339ac04a3e804aa1cc930050c50ed097f6fbff27ad3e50aab1c84b0bfe2817e91a466926dc0d0fd0202945b8
6
+ metadata.gz: 7b884477b1f809caf3046b28bf7ac118a50affd078566a068f716472f0fbdb95ac7f3c7f48a7afa5239daaded752d014ea5d1fb34e34fda5653610cea71385b1
7
+ data.tar.gz: e0ff913bafcfbd0c47db8f6f184a511525343178b857cd02a3f5b9661dc7533542841eb9f1510900eb5f6ed27715e48f47789e33e950780c37ea7a7cc01fb089
@@ -0,0 +1,47 @@
1
+ {
2
+ "ruby": ["3.4"],
3
+ "rails_version": ["7.1.5.1", "7.2.2.1"],
4
+ "bootstrap_version": [null],
5
+ "view_component_version": ["~> 3.12"],
6
+ "api": [null],
7
+ "additional_engine_cart_rails_options": [""],
8
+ "additional_name": [""],
9
+ "include": [
10
+ {
11
+ "ruby": "3.3",
12
+ "rails_version": "8.0.2",
13
+ "additional_engine_cart_rails_options": "--css=bootstrap"
14
+ },
15
+ {
16
+ "ruby": "3.3",
17
+ "rails_version": "8.0.2",
18
+ "additional_engine_cart_rails_options": "--css=bootstrap --js=esbuild",
19
+ "additional_name": "| esbuild"
20
+ },
21
+ {
22
+ "ruby": "3.2",
23
+ "rails_version": "7.1.5.1",
24
+ "solr_version": "8.11.2",
25
+ "additional_name": "| Solr 8.11.2"
26
+ },
27
+ {
28
+ "ruby": "3.3",
29
+ "rails_version": "7.1.5.1",
30
+ "additional_name": "| Propshaft",
31
+ "additional_engine_cart_rails_options": "-a propshaft --css=bootstrap"
32
+ },
33
+ {
34
+ "ruby": "3.3",
35
+ "rails_version": "7.1.5.1",
36
+ "api": "true",
37
+ "additional_engine_cart_rails_options": "--api --skip-yarn",
38
+ "additional_name": "| API"
39
+ },
40
+ {
41
+ "ruby": "3.3",
42
+ "rails_version": "7.2.2.1",
43
+ "additional_engine_cart_rails_options": "-a propshaft --css=bootstrap --js=esbuild",
44
+ "additional_name": "| Propshaft, esbuild"
45
+ }
46
+ ]
47
+ }
@@ -0,0 +1,16 @@
1
+ on:
2
+ workflow_call:
3
+ inputs:
4
+ ref:
5
+ required: false
6
+ type: string
7
+ default: ''
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ with:
14
+ ref: ${{ inputs.ref }}
15
+ - name: Build docker image
16
+ run: docker compose build app
@@ -0,0 +1,25 @@
1
+ on:
2
+ workflow_call:
3
+ inputs:
4
+ ref:
5
+ required: false
6
+ type: string
7
+ default: ''
8
+ jobs:
9
+ lint:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ with:
14
+ ref: ${{ inputs.ref }}
15
+ - name: Set up Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: 3.2
19
+ bundler: "latest"
20
+ - name: Change permissions
21
+ run: "chmod -f -R o-w /opt/hostedtoolcache/Ruby/3.2.5/x64/lib/ruby/gems/3.2.0/gems | :"
22
+ - name: Install dependencies
23
+ run: bundle install
24
+ - name: Run linter
25
+ run: bundle exec rake rubocop
@@ -0,0 +1,22 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: CI
9
+
10
+ on:
11
+ push:
12
+ branches:
13
+ - main
14
+ - "release-*"
15
+ pull_request:
16
+ jobs:
17
+ lint:
18
+ uses: ./.github/workflows/lint.yml
19
+ test:
20
+ uses: ./.github/workflows/test.yml
21
+ docker_build:
22
+ uses: ./.github/workflows/build.yml
@@ -0,0 +1,39 @@
1
+ # If there are failures running this workflow, please resolve them on the release-7.x branch
2
+ # and then port any necessary changes to this branch.
3
+
4
+ name: release-7.x scheduled
5
+
6
+ on:
7
+ workflow_dispatch:
8
+ schedule:
9
+ # Weekly at 9:35 on Friday
10
+ # Somewhat weird timing so that it isn't delayed too much
11
+ - cron: '35 9 * * 5'
12
+ jobs:
13
+ lint:
14
+ uses: projectblacklight/blacklight/.github/workflows/lint.yml@release-7.x
15
+ with:
16
+ ref: release-7.x
17
+ test:
18
+ uses: projectblacklight/blacklight/.github/workflows/test.yml@release-7.x
19
+ with:
20
+ ref: release-7.x
21
+ docker_build:
22
+ uses: projectblacklight/blacklight/.github/workflows/build.yml@release-7.x
23
+ with:
24
+ ref: release-7.x
25
+ report:
26
+ runs-on: ubuntu-latest
27
+ if: ${{ always() && contains(join(needs.*.result, ','), 'failure') }}
28
+ needs: [lint, test, docker_build]
29
+ steps:
30
+ - name: Report on failure of any dependent job
31
+ env:
32
+ NEEDS: ${{ toJSON(needs) }}
33
+ uses: slackapi/slack-github-action@v2.0.0
34
+ with:
35
+ method: chat.postMessage
36
+ token: ${{ secrets.SLACK_BOT_TOKEN }}
37
+ payload: |
38
+ channel: ${{ secrets.SLACK_CHANNEL_ID }}
39
+ text: "The weekly CI run of the release-7.x branch has failed"
@@ -0,0 +1,39 @@
1
+ # If there are failures running this workflow, please resolve them on the release-8.x branch
2
+ # and then port any necessary changes to this branch.
3
+
4
+ name: release-8.x scheduled
5
+
6
+ on:
7
+ workflow_dispatch:
8
+ schedule:
9
+ # Weekly at 9:35 on Friday
10
+ # Somewhat weird timing so that it isn't delayed too much
11
+ - cron: '35 9 * * 5'
12
+ jobs:
13
+ lint:
14
+ uses: projectblacklight/blacklight/.github/workflows/lint.yml@release-8.x
15
+ with:
16
+ ref: release-8.x
17
+ test:
18
+ uses: projectblacklight/blacklight/.github/workflows/test.yml@release-8.x
19
+ with:
20
+ ref: release-8.x
21
+ docker_build:
22
+ uses: projectblacklight/blacklight/.github/workflows/build.yml@release-8.x
23
+ with:
24
+ ref: release-8.x
25
+ report:
26
+ runs-on: ubuntu-latest
27
+ if: ${{ always() && contains(join(needs.*.result, ','), 'failure') }}
28
+ needs: [lint, test, docker_build]
29
+ steps:
30
+ - name: Report on failure of any dependent job
31
+ env:
32
+ NEEDS: ${{ toJSON(needs) }}
33
+ uses: slackapi/slack-github-action@v2.0.0
34
+ with:
35
+ method: chat.postMessage
36
+ token: ${{ secrets.SLACK_BOT_TOKEN }}
37
+ payload: |
38
+ channel: ${{ secrets.SLACK_CHANNEL_ID }}
39
+ text: "The weekly CI run of the release-8.x branch has failed"
@@ -0,0 +1,53 @@
1
+ on:
2
+ workflow_call:
3
+ inputs:
4
+ ref:
5
+ required: false
6
+ type: string
7
+ default: ''
8
+ description: The branch or reference to run the workflow against
9
+ jobs:
10
+ set_matrix:
11
+ runs-on: ubuntu-latest
12
+ outputs:
13
+ matrix: ${{ steps.matrix.outputs.matrix }}
14
+ steps:
15
+ - name: Checkout repository
16
+ uses: actions/checkout@v3
17
+ with:
18
+ ref: ${{ inputs.ref }}
19
+ - name: Echo ./.github/matrix.json
20
+ id: matrix
21
+ run: |
22
+ echo "matrix<<EOF" >> $GITHUB_OUTPUT
23
+ cat ./.github/matrix.json >> $GITHUB_OUTPUT
24
+ echo "EOF" >> $GITHUB_OUTPUT
25
+ test:
26
+ needs: set_matrix
27
+ runs-on: ubuntu-latest
28
+ name: ruby ${{ matrix.ruby }} | rails ${{ matrix.rails_version }} ${{ matrix.additional_name }}
29
+ strategy:
30
+ fail-fast: false
31
+ matrix: ${{fromJson(needs.set_matrix.outputs.matrix)}}
32
+ env:
33
+ RAILS_VERSION: ${{ matrix.rails_version }}
34
+ SOLR_VERSION: ${{ matrix.solr_version || 'latest' }}
35
+ VIEW_COMPONENT_VERSION: ${{ matrix.view_component_version }}
36
+ BOOTSTRAP_VERSION: ${{ matrix.bootstrap_version }}
37
+ BLACKLIGHT_API_TEST: ${{ matrix.api }}
38
+ ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-kamal --skip-solid --skip-coffee --skip-test ${{ matrix.additional_engine_cart_rails_options }}"
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+ with:
42
+ ref: ${{ inputs.ref }}
43
+ - name: Set up Ruby
44
+ uses: ruby/setup-ruby@v1
45
+ with:
46
+ bundler: "latest"
47
+ ruby-version: ${{ matrix.ruby }}
48
+ - name: Change permissions
49
+ run: "chmod -f -R o-w /opt/hostedtoolcache/Ruby/3.2.5/x64/lib/ruby/gems/3.2.0/gems | :"
50
+ - name: Install dependencies
51
+ run: bundle install
52
+ - name: Run tests
53
+ run: bundle exec rake ci
data/.rubocop.yml CHANGED
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-capybara
3
3
  - rubocop-rspec
4
4
  - rubocop-rspec_rails
@@ -10,7 +10,7 @@ inherit_from:
10
10
 
11
11
  AllCops:
12
12
  DisplayCopNames: true
13
- TargetRubyVersion: 3.1
13
+ TargetRubyVersion: 3.2
14
14
  TargetRailsVersion: 7.0
15
15
  Exclude:
16
16
  - "lib/generators/blacklight/templates/**/*"
@@ -585,3 +585,71 @@ Rails/WhereRange: # new in 2.25
585
585
  Enabled: true
586
586
  Gemspec/AddRuntimeDependency: # new in 1.65
587
587
  Enabled: true
588
+ Lint/ArrayLiteralInRegexp: # new in 1.71
589
+ Enabled: true
590
+ Lint/ConstantReassignment: # new in 1.70
591
+ Enabled: true
592
+ Lint/DuplicateSetElement: # new in 1.67
593
+ Enabled: true
594
+ Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69
595
+ Enabled: true
596
+ Lint/NumericOperationWithConstantResult: # new in 1.69
597
+ Enabled: true
598
+ Lint/SharedMutableDefault: # new in 1.70
599
+ Enabled: true
600
+ Lint/UnescapedBracketInRegexp: # new in 1.68
601
+ Enabled: true
602
+ Lint/UselessDefined: # new in 1.69
603
+ Enabled: true
604
+ Lint/UselessNumericOperation: # new in 1.66
605
+ Enabled: true
606
+ Style/AmbiguousEndlessMethodDefinition: # new in 1.68
607
+ Enabled: true
608
+ Style/BitwisePredicate: # new in 1.68
609
+ Enabled: true
610
+ Style/CombinableDefined: # new in 1.68
611
+ Enabled: true
612
+ Style/DigChain: # new in 1.69
613
+ Enabled: true
614
+ Style/FileNull: # new in 1.69
615
+ Enabled: true
616
+ Style/FileTouch: # new in 1.69
617
+ Enabled: true
618
+ Style/HashSlice: # new in 1.71
619
+ Enabled: true
620
+ Style/ItAssignment: # new in 1.70
621
+ Enabled: true
622
+ Style/KeywordArgumentsMerging: # new in 1.68
623
+ Enabled: true
624
+ Style/RedundantInterpolationUnfreeze: # new in 1.66
625
+ Enabled: true
626
+ Style/SafeNavigationChainLength: # new in 1.68
627
+ Enabled: true
628
+ Rails/EnumSyntax: # new in 2.26
629
+ Enabled: true
630
+ Rails/MultipleRoutePaths: # new in 2.29
631
+ Enabled: true
632
+ Rails/StrongParametersExpect: # new in 2.29
633
+ Enabled: true
634
+ Lint/CopDirectiveSyntax: # new in 1.72
635
+ Enabled: true
636
+ Lint/RedundantTypeConversion: # new in 1.72
637
+ Enabled: true
638
+ Lint/SuppressedExceptionInNumberConversion: # new in 1.72
639
+ Enabled: true
640
+ Lint/UselessConstantScoping: # new in 1.72
641
+ Enabled: true
642
+ Style/ComparableBetween: # new in 1.74
643
+ Enabled: true
644
+ Style/HashFetchChain: # new in 1.75
645
+ Enabled: true
646
+ Style/ItBlockParameter: # new in 1.75
647
+ Enabled: true
648
+ Style/RedundantFormat: # new in 1.72
649
+ Enabled: true
650
+ Capybara/FindAllFirst: # new in 2.22
651
+ Enabled: true
652
+ Capybara/NegationMatcherAfterVisit: # new in 2.22
653
+ Enabled: true
654
+ RSpec/IncludeExamples: # new in 3.6
655
+ Enabled: true
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2024-09-03 14:22:19 UTC using RuboCop version 1.66.0.
3
+ # on 2025-05-09 14:34:28 UTC using RuboCop version 1.75.5.
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
@@ -12,6 +12,16 @@ Capybara/CurrentPathExpectation:
12
12
  Exclude:
13
13
  - 'spec/features/alternate_controller_spec.rb'
14
14
 
15
+ # Offense count: 7
16
+ Capybara/NegationMatcherAfterVisit:
17
+ Exclude:
18
+ - 'spec/features/bookmarks_spec.rb'
19
+ - 'spec/features/facets_spec.rb'
20
+ - 'spec/features/modal_spec.rb'
21
+ - 'spec/features/record_view_spec.rb'
22
+ - 'spec/features/search_context_spec.rb'
23
+ - 'spec/features/sitelinks_search_box_spec.rb'
24
+
15
25
  # Offense count: 13
16
26
  Capybara/VisibilityMatcher:
17
27
  Exclude:
@@ -35,7 +45,7 @@ Lint/AmbiguousOperator:
35
45
  - 'spec/models/blacklight/facet_paginator_spec.rb'
36
46
  - 'spec/services/blacklight/search_service_spec.rb'
37
47
 
38
- # Offense count: 45
48
+ # Offense count: 43
39
49
  # This cop supports safe autocorrection (--autocorrect).
40
50
  Lint/AmbiguousRegexpLiteral:
41
51
  Exclude:
@@ -45,7 +55,6 @@ Lint/AmbiguousRegexpLiteral:
45
55
  - 'spec/helpers/catalog_helper_spec.rb'
46
56
  - 'spec/models/record_mailer_spec.rb'
47
57
  - 'spec/views/catalog/_document.html.erb_spec.rb'
48
- - 'spec/views/catalog/_search_header.erb_spec.rb'
49
58
  - 'spec/views/catalog/_sort_and_per_page.html.erb_spec.rb'
50
59
  - 'spec/views/catalog/index.html.erb_spec.rb'
51
60
  - 'spec/views/catalog/show.html.erb_spec.rb'
@@ -75,13 +84,7 @@ Lint/EmptyBlock:
75
84
  - 'app/controllers/concerns/blacklight/bookmarks.rb'
76
85
  - 'lib/blacklight/solr/search_builder_behavior.rb'
77
86
 
78
- # Offense count: 1
79
- # Configuration parameters: AllowComments.
80
- Lint/EmptyFile:
81
- Exclude:
82
- - 'spec/components/blacklight/document_metadata_component_spec.rb'
83
-
84
- # Offense count: 48
87
+ # Offense count: 50
85
88
  # Configuration parameters: AllowedParentClasses.
86
89
  Lint/MissingSuper:
87
90
  Enabled: false
@@ -96,12 +99,7 @@ Lint/ParenthesesAsGroupedExpression:
96
99
  - 'spec/features/search_spec.rb'
97
100
  - 'spec/models/blacklight/solr/repository_spec.rb'
98
101
 
99
- # Offense count: 2
100
- Lint/ShadowingOuterLocalVariable:
101
- Exclude:
102
- - 'spec/models/blacklight/configuration_spec.rb'
103
-
104
- # Offense count: 83
102
+ # Offense count: 81
105
103
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
106
104
  Metrics/AbcSize:
107
105
  Max: 46
@@ -112,27 +110,27 @@ Metrics/AbcSize:
112
110
  Metrics/BlockLength:
113
111
  Max: 26
114
112
 
115
- # Offense count: 42
113
+ # Offense count: 40
116
114
  # Configuration parameters: AllowedMethods, AllowedPatterns.
117
115
  Metrics/CyclomaticComplexity:
118
- Max: 14
116
+ Max: 13
119
117
 
120
- # Offense count: 78
118
+ # Offense count: 77
121
119
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
122
120
  Metrics/MethodLength:
123
121
  Max: 27
124
122
 
125
- # Offense count: 4
123
+ # Offense count: 3
126
124
  # Configuration parameters: CountComments, CountAsOne.
127
125
  Metrics/ModuleLength:
128
- Max: 124
126
+ Max: 114
129
127
 
130
- # Offense count: 8
128
+ # Offense count: 7
131
129
  # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
132
130
  Metrics/ParameterLists:
133
131
  Max: 6
134
132
 
135
- # Offense count: 36
133
+ # Offense count: 33
136
134
  # Configuration parameters: AllowedMethods, AllowedPatterns.
137
135
  Metrics/PerceivedComplexity:
138
136
  Max: 14
@@ -161,7 +159,7 @@ Naming/MethodParameterName:
161
159
  # Offense count: 9
162
160
  # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
163
161
  # SupportedStyles: snake_case, normalcase, non_integer
164
- # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
162
+ # AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
165
163
  Naming/VariableNumber:
166
164
  Exclude:
167
165
  - 'spec/lib/blacklight/search_state_spec.rb'
@@ -181,7 +179,7 @@ RSpec/BeforeAfterAll:
181
179
  RSpec/ContextWording:
182
180
  Enabled: false
183
181
 
184
- # Offense count: 138
182
+ # Offense count: 146
185
183
  # Configuration parameters: CountAsOne.
186
184
  RSpec/ExampleLength:
187
185
  Max: 33
@@ -232,7 +230,7 @@ RSpec/MessageChain:
232
230
  - 'spec/presenters/blacklight/field_presenter_spec.rb'
233
231
  - 'spec/views/shared/_user_util_links.html.erb_spec.rb'
234
232
 
235
- # Offense count: 28
233
+ # Offense count: 27
236
234
  # Configuration parameters: EnforcedStyle.
237
235
  # SupportedStyles: have_received, receive
238
236
  RSpec/MessageSpies:
@@ -246,22 +244,22 @@ RSpec/MessageSpies:
246
244
  - 'spec/models/blacklight/suggest_search_spec.rb'
247
245
  - 'spec/presenters/blacklight/field_presenter_spec.rb'
248
246
 
249
- # Offense count: 390
247
+ # Offense count: 401
250
248
  RSpec/MultipleExpectations:
251
249
  Max: 16
252
250
 
253
- # Offense count: 292
251
+ # Offense count: 294
254
252
  # Configuration parameters: AllowSubject.
255
253
  RSpec/MultipleMemoizedHelpers:
256
254
  Max: 14
257
255
 
258
- # Offense count: 399
256
+ # Offense count: 431
259
257
  # Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
260
258
  # SupportedStyles: always, named_only
261
259
  RSpec/NamedSubject:
262
260
  Enabled: false
263
261
 
264
- # Offense count: 60
262
+ # Offense count: 62
265
263
  # Configuration parameters: AllowedGroups.
266
264
  RSpec/NestedGroups:
267
265
  Max: 5
@@ -289,7 +287,7 @@ RSpec/ScatteredLet:
289
287
  Exclude:
290
288
  - 'spec/views/catalog/index.atom.builder_spec.rb'
291
289
 
292
- # Offense count: 20
290
+ # Offense count: 19
293
291
  RSpec/StubbedMock:
294
292
  Exclude:
295
293
  - 'spec/controllers/catalog_controller_spec.rb'
@@ -315,7 +313,7 @@ RSpec/SubjectStub:
315
313
  - 'spec/presenters/blacklight/document_presenter_spec.rb'
316
314
  - 'spec/services/blacklight/search_service_spec.rb'
317
315
 
318
- # Offense count: 80
316
+ # Offense count: 79
319
317
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
320
318
  RSpec/VerifiedDoubles:
321
319
  Enabled: false
@@ -328,7 +326,7 @@ Rails/Date:
328
326
  Exclude:
329
327
  - 'spec/models/search_spec.rb'
330
328
 
331
- # Offense count: 20
329
+ # Offense count: 17
332
330
  # Configuration parameters: Include.
333
331
  # Include: app/helpers/**/*.rb
334
332
  Rails/HelperInstanceVariable:
@@ -351,7 +349,7 @@ Rails/OutputSafety:
351
349
  Exclude:
352
350
  - 'app/presenters/blacklight/rendering/join.rb'
353
351
 
354
- # Offense count: 14
352
+ # Offense count: 15
355
353
  Security/Eval:
356
354
  Exclude:
357
355
  - 'spec/models/blacklight/solr/response_spec.rb'
@@ -383,8 +381,10 @@ Style/BlockDelimiters:
383
381
 
384
382
  # Offense count: 52
385
383
  # This cop supports unsafe autocorrection (--autocorrect-all).
386
- # Configuration parameters: EnforcedStyle.
384
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules.
387
385
  # SupportedStyles: nested, compact
386
+ # SupportedStylesForClasses: , nested, compact
387
+ # SupportedStylesForModules: , nested, compact
388
388
  Style/ClassAndModuleChildren:
389
389
  Enabled: false
390
390
 
@@ -409,7 +409,7 @@ Style/DocumentDynamicEvalDefinition:
409
409
  - 'app/builders/blacklight/action_builder.rb'
410
410
  - 'lib/blacklight/configuration/fields.rb'
411
411
 
412
- # Offense count: 133
412
+ # Offense count: 131
413
413
  # Configuration parameters: AllowedConstants.
414
414
  Style/Documentation:
415
415
  Enabled: false
@@ -428,9 +428,9 @@ Style/ExpandPathArguments:
428
428
  - 'lib/generators/blacklight/test_support_generator.rb'
429
429
  - 'lib/generators/blacklight/user_generator.rb'
430
430
 
431
- # Offense count: 16
431
+ # Offense count: 17
432
432
  # This cop supports safe autocorrection (--autocorrect).
433
- # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns.
433
+ # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, Mode, AllowedMethods, AllowedPatterns.
434
434
  # SupportedStyles: annotated, template, unannotated
435
435
  # AllowedMethods: redirect
436
436
  Style/FormatStringToken:
@@ -447,18 +447,17 @@ Style/GuardClause:
447
447
  - 'app/helpers/blacklight/catalog_helper_behavior.rb'
448
448
  - 'lib/blacklight/solr/search_builder_behavior.rb'
449
449
 
450
- # Offense count: 29
450
+ # Offense count: 30
451
451
  # This cop supports safe autocorrection (--autocorrect).
452
452
  Style/IfUnlessModifier:
453
453
  Enabled: false
454
454
 
455
- # Offense count: 6
455
+ # Offense count: 4
456
456
  # This cop supports safe autocorrection (--autocorrect).
457
457
  Style/MultilineIfModifier:
458
458
  Exclude:
459
459
  - 'app/views/catalog/index.atom.builder'
460
460
  - 'lib/blacklight/solr/response/facets.rb'
461
- - 'lib/blacklight/solr/search_builder_behavior.rb'
462
461
 
463
462
  # Offense count: 1
464
463
  # This cop supports safe autocorrection (--autocorrect).
@@ -467,15 +466,7 @@ Style/MultipleComparison:
467
466
  Exclude:
468
467
  - 'lib/blacklight/configuration/context.rb'
469
468
 
470
- # Offense count: 2
471
- # This cop supports unsafe autocorrection (--autocorrect-all).
472
- # Configuration parameters: EnforcedStyle.
473
- # SupportedStyles: literals, strict
474
- Style/MutableConstant:
475
- Exclude:
476
- - 'lib/blacklight/solr/request.rb'
477
-
478
- # Offense count: 9
469
+ # Offense count: 8
479
470
  # This cop supports unsafe autocorrection (--autocorrect-all).
480
471
  # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
481
472
  # SupportedStyles: predicate, comparison
@@ -507,13 +498,12 @@ Style/ParenthesesAroundCondition:
507
498
  Exclude:
508
499
  - 'app/views/catalog/_document.atom.builder'
509
500
 
510
- # Offense count: 3
501
+ # Offense count: 1
511
502
  # This cop supports safe autocorrection (--autocorrect).
512
503
  # Configuration parameters: PreferredDelimiters.
513
504
  Style/PercentLiteralDelimiters:
514
505
  Exclude:
515
506
  - 'lib/blacklight/engine.rb'
516
- - 'lib/blacklight/solr/request.rb'
517
507
 
518
508
  # Offense count: 2
519
509
  # This cop supports safe autocorrection (--autocorrect).
@@ -532,20 +522,6 @@ Style/RescueStandardError:
532
522
  - 'lib/blacklight/configuration/fields.rb'
533
523
  - 'lib/railties/blacklight.rake'
534
524
 
535
- # Offense count: 11
536
- # This cop supports unsafe autocorrection (--autocorrect-all).
537
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
538
- # AllowedMethods: present?, blank?, presence, try, try!
539
- Style/SafeNavigation:
540
- Exclude:
541
- - 'app/controllers/concerns/blacklight/bookmarks.rb'
542
- - 'app/controllers/concerns/blacklight/controller.rb'
543
- - 'app/services/blacklight/field_retriever.rb'
544
- - 'lib/blacklight.rb'
545
- - 'lib/blacklight/configuration/facet_field.rb'
546
- - 'lib/blacklight/configuration/search_field.rb'
547
- - 'lib/blacklight/solr/search_builder_behavior.rb'
548
-
549
525
  # Offense count: 6
550
526
  # This cop supports safe autocorrection (--autocorrect).
551
527
  # Configuration parameters: AllowAsExpressionSeparator.
@@ -561,7 +537,7 @@ Style/SoleNestedConditional:
561
537
  Exclude:
562
538
  - 'app/controllers/concerns/blacklight/controller.rb'
563
539
 
564
- # Offense count: 32
540
+ # Offense count: 31
565
541
  # This cop supports safe autocorrection (--autocorrect).
566
542
  # Configuration parameters: MinSize.
567
543
  # SupportedStyles: percent, brackets
data/.solr_wrapper.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  # Place any default configuration for solr_wrapper here
2
2
  # port: 8983
3
+ env:
4
+ SOLR_MODULES: analysis-extras
3
5
  collection:
4
6
  dir: lib/generators/blacklight/templates/solr/conf
5
7
  name: blacklight-core
data/VERSION CHANGED
@@ -1 +1 @@
1
- 9.0.0.beta1
1
+ 9.0.0.beta2