blacklight 8.13.0 → 9.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.env +3 -3
- data/.github/pull_request_template.md +7 -0
- data/.github/workflows/ruby.yml +98 -0
- data/.rubocop.yml +8 -151
- data/.rubocop_todo.yml +53 -74
- data/.solr_wrapper.yml +0 -2
- data/README.md +30 -8
- data/VERSION +1 -1
- data/app/assets/builds/blacklight.css +448 -0
- data/app/assets/javascripts/blacklight/blacklight.esm.js +8 -51
- data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +8 -51
- data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
- data/app/assets/stylesheets/blacklight/_balanced_list.scss +1 -4
- data/app/assets/stylesheets/blacklight/_blacklight_base.scss +1 -3
- data/app/assets/stylesheets/blacklight/_bookmark.scss +44 -41
- data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +0 -29
- data/app/assets/stylesheets/blacklight/_constraints.scss +15 -24
- data/app/assets/stylesheets/blacklight/_controls.scss +2 -18
- data/app/assets/stylesheets/blacklight/_facets.scss +15 -82
- data/app/assets/stylesheets/blacklight/_group.scss +2 -5
- data/app/assets/stylesheets/blacklight/_header.scss +4 -11
- data/app/assets/stylesheets/blacklight/_icons.scss +0 -8
- data/app/assets/stylesheets/blacklight/_modal.scss +9 -10
- data/app/assets/stylesheets/blacklight/_pagination.scss +3 -5
- data/app/assets/stylesheets/blacklight/_search_form.scss +0 -1
- data/app/assets/stylesheets/blacklight/_search_history.scss +0 -4
- data/app/assets/stylesheets/blacklight/_search_results.scss +1 -15
- data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +9 -17
- data/app/assets/stylesheets/blacklight/build.scss +4 -0
- data/app/components/blacklight/advanced_search_form_component.rb +3 -3
- data/app/components/blacklight/constraint_component.rb +1 -1
- data/app/components/blacklight/constraint_layout_component.html.erb +2 -2
- data/app/components/blacklight/constraints_component.html.erb +2 -2
- data/app/components/blacklight/constraints_component.rb +3 -3
- data/app/components/blacklight/document/action_component.rb +3 -1
- data/app/components/blacklight/document/bookmark_component.html.erb +3 -3
- data/app/components/blacklight/document/bookmark_component.rb +2 -3
- data/app/components/blacklight/document/group_component.html.erb +1 -1
- data/app/components/blacklight/document/more_like_this_component.rb +2 -2
- data/app/components/blacklight/document/page_header_component.rb +3 -3
- data/app/components/blacklight/document/sidebar_component.rb +5 -5
- data/app/components/blacklight/document_component.rb +14 -20
- data/app/components/blacklight/document_title_component.rb +3 -2
- data/app/components/blacklight/facet_field_component.html.erb +5 -5
- data/app/components/blacklight/facet_field_list_component.rb +4 -22
- data/app/components/blacklight/facet_field_pagination_component.html.erb +2 -2
- data/app/components/blacklight/facet_item_component.rb +2 -2
- data/app/components/blacklight/facet_item_pivot_component.rb +2 -2
- data/app/components/blacklight/header_component.rb +2 -2
- data/app/components/blacklight/metadata_field_plain_text_layout_component.rb +2 -2
- data/app/components/blacklight/response/facet_group_component.html.erb +3 -18
- data/app/components/blacklight/response/facet_group_component.rb +7 -23
- data/app/components/blacklight/response/facet_toggle_button_component.html.erb +16 -0
- data/app/components/blacklight/response/facet_toggle_button_component.rb +14 -0
- data/app/components/blacklight/response/pagination_component.html.erb +1 -1
- data/app/components/blacklight/response/pagination_component.rb +2 -1
- data/app/components/blacklight/response/sort_component.rb +1 -0
- data/app/components/blacklight/response/view_type_button_component.html.erb +1 -1
- data/app/components/blacklight/response/view_type_component.html.erb +1 -1
- data/app/components/blacklight/search/facet_suggest_input.html.erb +7 -10
- data/app/components/blacklight/search/facet_suggest_input.rb +0 -4
- data/app/components/blacklight/search/per_page_component.html.erb +1 -1
- data/app/components/blacklight/search/per_page_component.rb +1 -0
- data/app/components/blacklight/search/sidebar_component.html.erb +1 -1
- data/app/components/blacklight/search/sidebar_component.rb +1 -1
- data/app/components/blacklight/search_bar_component.html.erb +3 -3
- data/app/components/blacklight/search_bar_component.rb +2 -2
- data/app/components/blacklight/search_button_component.rb +2 -2
- data/app/components/blacklight/search_context/server_applied_params_component.html.erb +2 -2
- data/app/components/blacklight/search_context/server_applied_params_component.rb +9 -0
- data/app/components/blacklight/skip_link_component.html.erb +1 -1
- data/app/components/blacklight/skip_link_component.rb +2 -1
- data/app/components/blacklight/system/dropdown_component.html.erb +1 -1
- data/app/components/blacklight/system/dropdown_component.rb +1 -1
- data/app/components/blacklight/top_navbar_component.html.erb +1 -1
- data/app/controllers/concerns/blacklight/bookmarks.rb +5 -5
- data/app/controllers/concerns/blacklight/catalog.rb +3 -2
- data/app/controllers/concerns/blacklight/search_context.rb +2 -14
- data/app/controllers/concerns/blacklight/search_history.rb +1 -1
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +0 -6
- data/app/helpers/blacklight/catalog_helper_behavior.rb +0 -10
- data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -14
- data/app/helpers/blacklight/document_helper_behavior.rb +0 -26
- data/app/helpers/blacklight/icon_helper_behavior.rb +3 -11
- data/app/helpers/blacklight/render_partials_helper_behavior.rb +0 -14
- data/app/helpers/blacklight/url_helper_behavior.rb +1 -1
- data/app/javascript/{blacklight → blacklight-frontend}/bookmark_toggle.js +1 -1
- data/app/javascript/{blacklight → blacklight-frontend}/core.js +2 -10
- data/app/javascript/{blacklight → blacklight-frontend}/debounce.js +1 -1
- data/app/javascript/blacklight-frontend/facet_suggest.js +26 -0
- data/app/javascript/blacklight-frontend/index.js +18 -0
- data/app/javascript/{blacklight → blacklight-frontend}/modal.js +2 -14
- data/app/javascript/{blacklight → blacklight-frontend}/search_context.js +2 -3
- data/app/models/blacklight/icon.rb +2 -3
- data/app/models/concerns/blacklight/document.rb +0 -11
- data/app/models/concerns/blacklight/user.rb +1 -2
- data/app/presenters/blacklight/json_presenter.rb +3 -1
- data/app/presenters/blacklight/rendering/helper_method.rb +4 -4
- data/app/presenters/blacklight/rendering/join.rb +2 -2
- data/app/presenters/blacklight/rendering/microdata.rb +0 -1
- data/app/services/blacklight/search_params_yaml_coder.rb +0 -2
- data/app/values/blacklight/types.rb +2 -2
- data/app/views/bookmarks/_clear_bookmarks_widget.html.erb +0 -2
- data/app/views/bookmarks/index.html.erb +1 -1
- data/app/views/catalog/_document.atom.builder +1 -1
- data/app/views/catalog/_document.html.erb +1 -1
- data/app/views/catalog/_email_form.html.erb +2 -2
- data/app/views/catalog/_results_pagination.html.erb +2 -5
- data/app/views/catalog/_search_results.html.erb +3 -3
- data/app/views/catalog/_search_results_header.html.erb +1 -1
- data/app/views/catalog/_show_main_content.html.erb +1 -1
- data/app/views/catalog/_sms_form.html.erb +2 -2
- data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
- data/app/views/catalog/_sort_widget.html.erb +1 -0
- data/app/views/catalog/facet.html.erb +9 -9
- data/app/views/catalog/show.html.erb +2 -3
- data/app/views/kaminari/blacklight/_paginator.html.erb +1 -2
- data/app/views/layouts/blacklight/base.html.erb +3 -7
- data/app/views/search_history/index.html.erb +0 -2
- data/blacklight.gemspec +5 -5
- data/config/importmap.rb +1 -1
- data/config/locales/blacklight.ar.yml +4 -4
- data/config/locales/blacklight.ca.yml +124 -124
- data/config/locales/blacklight.de.yml +2 -2
- data/config/locales/blacklight.en.yml +14 -14
- data/config/locales/blacklight.es.yml +4 -4
- data/config/locales/blacklight.fr.yml +4 -4
- data/config/locales/blacklight.hu.yml +4 -4
- data/config/locales/blacklight.it.yml +3 -3
- data/config/locales/blacklight.nl.yml +3 -3
- data/config/locales/blacklight.pt-BR.yml +3 -3
- data/config/locales/blacklight.sq.yml +4 -4
- data/config/locales/blacklight.zh.yml +4 -4
- data/lib/blacklight/abstract_repository.rb +2 -2
- data/lib/blacklight/component.rb +1 -4
- data/lib/blacklight/configuration/context.rb +3 -3
- data/lib/blacklight/configuration/field.rb +10 -10
- data/lib/blacklight/configuration/sort_field.rb +2 -2
- data/lib/blacklight/configuration/view_config.rb +2 -4
- data/lib/blacklight/configuration.rb +4 -10
- data/lib/blacklight/engine.rb +0 -6
- data/lib/blacklight/nested_open_struct_with_hash_access.rb +1 -1
- data/lib/blacklight/open_struct_with_hash_access.rb +2 -2
- data/lib/blacklight/parameters.rb +1 -1
- data/lib/blacklight/search_state/filter_field.rb +4 -4
- data/lib/blacklight/search_state/pivot_filter_field.rb +1 -1
- data/lib/blacklight/solr/request.rb +2 -8
- data/lib/blacklight/solr/response/facets.rb +2 -2
- data/lib/blacklight/solr/response.rb +1 -4
- data/lib/generators/blacklight/assets/importmap_generator.rb +10 -51
- data/lib/generators/blacklight/assets/propshaft_generator.rb +1 -1
- data/lib/generators/blacklight/assets_generator.rb +3 -3
- data/lib/generators/blacklight/controller_generator.rb +3 -3
- data/lib/generators/blacklight/search_builder_generator.rb +1 -1
- data/lib/generators/blacklight/templates/.solr_wrapper.yml +0 -2
- data/lib/generators/blacklight/templates/solr/conf/schema.xml +178 -264
- data/lib/generators/blacklight/templates/solr/conf/solrconfig.xml +18 -6
- data/lib/generators/blacklight/user_generator.rb +9 -10
- data/package.json +14 -4
- data/rollup.config.js +1 -1
- data/spec/components/blacklight/document/action_component_spec.rb +2 -6
- data/spec/components/blacklight/document/group_component_spec.rb +1 -1
- data/spec/components/blacklight/document/sidebar_component_spec.rb +5 -20
- data/spec/components/blacklight/document_component_spec.rb +19 -24
- data/spec/components/blacklight/facet_component_spec.rb +2 -2
- data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +2 -2
- data/spec/components/blacklight/facet_field_list_component_spec.rb +3 -3
- data/spec/components/blacklight/search/facet_suggest_input_spec.rb +3 -27
- data/spec/components/blacklight/search_bar_component_spec.rb +1 -1
- data/spec/controllers/blacklight/catalog_spec.rb +1 -1
- data/spec/controllers/catalog_controller_spec.rb +3 -3
- data/spec/features/advanced_search_spec.rb +12 -12
- data/spec/features/axe_spec.rb +6 -11
- data/spec/features/bookmarks_spec.rb +60 -23
- data/spec/features/did_you_mean_spec.rb +17 -17
- data/spec/features/facet_missing_spec.rb +3 -3
- data/spec/features/facets_spec.rb +22 -90
- data/spec/features/modal_spec.rb +1 -1
- data/spec/features/record_view_spec.rb +14 -14
- data/spec/features/search_context_spec.rb +8 -9
- data/spec/features/search_filters_spec.rb +18 -18
- data/spec/features/search_formats_spec.rb +2 -2
- data/spec/features/search_history_spec.rb +11 -11
- data/spec/features/search_pagination_spec.rb +9 -9
- data/spec/features/search_results_spec.rb +3 -3
- data/spec/features/search_sort_spec.rb +4 -4
- data/spec/features/search_spec.rb +15 -15
- data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +0 -9
- data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +1 -1
- data/spec/helpers/blacklight/url_helper_behavior_spec.rb +14 -14
- data/spec/helpers/blacklight_helper_spec.rb +0 -6
- data/spec/helpers/catalog_helper_spec.rb +6 -6
- data/spec/lib/blacklight/open_struct_with_hash_access_spec.rb +0 -7
- data/spec/lib/blacklight/parameters_spec.rb +1 -12
- data/spec/lib/blacklight/search_state/filter_field_spec.rb +0 -18
- data/spec/lib/blacklight/search_state/pivot_filter_field_spec.rb +1 -1
- data/spec/models/blacklight/solr/request_spec.rb +7 -0
- data/spec/models/record_mailer_spec.rb +5 -5
- data/spec/models/solr_document_spec.rb +1 -5
- data/spec/presenters/blacklight/index_presenter_spec.rb +0 -1
- data/spec/presenters/blacklight/rendering/pipeline_spec.rb +0 -1
- data/spec/presenters/blacklight/show_presenter_spec.rb +0 -1
- data/spec/presenters/blacklight/thumbnail_presenter_spec.rb +0 -1
- data/spec/services/blacklight/search_service_spec.rb +1 -1
- data/spec/support/presenter_test_helpers.rb +1 -1
- data/spec/views/catalog/_document.html.erb_spec.rb +4 -4
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +3 -3
- data/spec/views/catalog/_sort_and_per_page.html.erb_spec.rb +5 -5
- data/spec/views/catalog/facet.html.erb_spec.rb +1 -9
- data/spec/views/catalog/index.atom.builder_spec.rb +0 -2
- data/spec/views/catalog/index.html.erb_spec.rb +7 -4
- data/spec/views/catalog/show.html.erb_spec.rb +4 -3
- data/tasks/blacklight.rake +8 -5
- metadata +34 -65
- data/.github/matrix.json +0 -109
- data/.github/workflows/build.yml +0 -16
- data/.github/workflows/lint.yml +0 -25
- data/.github/workflows/main.yml +0 -24
- data/.github/workflows/test.yml +0 -57
- data/app/assets/stylesheets/blacklight/_autocomplete.scss +0 -25
- data/app/assets/stylesheets/blacklight/_mixins.scss +0 -20
- data/app/components/blacklight/icons/legacy_icon_component.rb +0 -30
- data/app/javascript/blacklight/facet_suggest.js +0 -48
- data/app/javascript/blacklight/index.js +0 -18
- data/app/views/catalog/_constraints.html.erb +0 -1
- data/app/views/catalog/_facets.html.erb +0 -5
- data/app/views/catalog/_search_form.html.erb +0 -7
- data/app/views/catalog/_search_header.html.erb +0 -1
- data/app/views/catalog/_show_sidebar.html.erb +0 -3
- data/app/views/catalog/_show_tools.html.erb +0 -2
- data/app/views/catalog/_start_over.html.erb +0 -1
- data/app/views/shared/_header_navbar.html.erb +0 -1
- data/lib/generators/blacklight/assets/sprockets_generator.rb +0 -68
- data/spec/components/blacklight/system/dropdown_component_spec.rb +0 -26
- data/spec/views/catalog/_search_header.erb_spec.rb +0 -14
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +0 -24
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +0 -37
- /data/app/javascript/{blacklight → blacklight-frontend}/button_focus.js +0 -0
- /data/app/javascript/{blacklight → blacklight-frontend}/checkbox_submit.js +0 -0
- /data/app/javascript/{blacklight → blacklight-frontend}/modalForm.js +0 -0
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
from this file. Please refer to http://wiki.apache.org/solr/SolrConfigXml,
|
|
5
5
|
as well as the default solrconfig file included with Solr -->
|
|
6
6
|
|
|
7
|
-
<
|
|
7
|
+
<abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
|
|
8
8
|
|
|
9
|
-
<
|
|
9
|
+
<luceneMatchVersion>6.1.0</luceneMatchVersion>
|
|
10
|
+
|
|
11
|
+
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
|
|
10
12
|
|
|
11
13
|
<updateHandler class="solr.DirectUpdateHandler2">
|
|
12
14
|
<updateLog>
|
|
@@ -14,11 +16,17 @@
|
|
|
14
16
|
</updateLog>
|
|
15
17
|
</updateHandler>
|
|
16
18
|
|
|
19
|
+
<!-- solr lib dirs, which are needed for Solr 8 compatibility but ignored in solr 9.8 and above -->
|
|
17
20
|
<lib dir="${solr.install.dir:../../../..}/modules/analysis-extras/lib" />
|
|
21
|
+
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
|
|
22
|
+
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />
|
|
18
23
|
|
|
19
24
|
<dataDir>${solr.data.dir:}</dataDir>
|
|
20
25
|
|
|
21
|
-
<requestHandler name="
|
|
26
|
+
<requestHandler name="search" class="solr.SearchHandler" default="true">
|
|
27
|
+
<!-- default values for query parameters can be specified, these
|
|
28
|
+
will be overridden by parameters in the request
|
|
29
|
+
-->
|
|
22
30
|
<lst name="defaults">
|
|
23
31
|
<str name="defType">edismax</str>
|
|
24
32
|
<str name="echoParams">explicit</str>
|
|
@@ -39,6 +47,7 @@
|
|
|
39
47
|
full_title_tsim
|
|
40
48
|
short_title_tsim
|
|
41
49
|
alternative_title_tsim
|
|
50
|
+
active_fedora_model_ssi
|
|
42
51
|
title_tsim
|
|
43
52
|
author_tsim
|
|
44
53
|
subject_tsim
|
|
@@ -75,6 +84,7 @@
|
|
|
75
84
|
<str name="facet">true</str>
|
|
76
85
|
<str name="facet.mincount">1</str>
|
|
77
86
|
<str name="facet.limit">10</str>
|
|
87
|
+
<str name="facet.field">active_fedora_model_ssi</str>
|
|
78
88
|
<str name="facet.field">subject_ssim</str>
|
|
79
89
|
|
|
80
90
|
<str name="spellcheck">true</str>
|
|
@@ -106,6 +116,7 @@
|
|
|
106
116
|
full_title_tsim
|
|
107
117
|
short_title_tsim
|
|
108
118
|
alternative_title_tsim
|
|
119
|
+
active_fedora_model_ssi
|
|
109
120
|
title_tsim
|
|
110
121
|
author_tsim
|
|
111
122
|
subject_tsim
|
|
@@ -142,6 +153,7 @@
|
|
|
142
153
|
<str name="facet">true</str>
|
|
143
154
|
<str name="facet.mincount">1</str>
|
|
144
155
|
<str name="facet.limit">10</str>
|
|
156
|
+
<str name="facet.field">active_fedora_model_ssi</str>
|
|
145
157
|
<str name="facet.field">subject_ssim</str>
|
|
146
158
|
|
|
147
159
|
<str name="spellcheck">true</str>
|
|
@@ -157,7 +169,7 @@
|
|
|
157
169
|
</arr>
|
|
158
170
|
</requestHandler>
|
|
159
171
|
|
|
160
|
-
<requestHandler name="permissions" class="solr.SearchHandler">
|
|
172
|
+
<requestHandler name="permissions" class="solr.SearchHandler" >
|
|
161
173
|
<lst name="defaults">
|
|
162
174
|
<str name="facet">off</str>
|
|
163
175
|
<str name="echoParams">all</str>
|
|
@@ -245,8 +257,8 @@
|
|
|
245
257
|
|
|
246
258
|
<requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
|
|
247
259
|
|
|
248
|
-
<requestDispatcher>
|
|
249
|
-
<requestParsers multipartUploadLimitInKB="2048" />
|
|
260
|
+
<requestDispatcher handleSelect="true" >
|
|
261
|
+
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048" />
|
|
250
262
|
</requestDispatcher>
|
|
251
263
|
|
|
252
264
|
<requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
|
|
@@ -34,13 +34,6 @@ module Blacklight
|
|
|
34
34
|
generate "devise", model_name.classify
|
|
35
35
|
generate "devise_guests", model_name.classify
|
|
36
36
|
|
|
37
|
-
# add the #to_s to the model.
|
|
38
|
-
insert_into_file("app/models/#{model_name}.rb", before: /end(\n| )*$/) do
|
|
39
|
-
"\n # Configuration added by Blacklight; Blacklight::User uses a method key on your\n" \
|
|
40
|
-
" # user class to get a user-displayable login/identifier for\n" \
|
|
41
|
-
" # the account.\n" \
|
|
42
|
-
" self.string_display_key ||= :email\n"
|
|
43
|
-
end
|
|
44
37
|
gsub_file("config/initializers/devise.rb", "config.sign_out_via = :delete", "config.sign_out_via = :get")
|
|
45
38
|
# Work around for https://github.com/heartcombo/devise/issues/5720
|
|
46
39
|
gsub_file("config/initializers/devise.rb", "# config.reload_routes = true", "config.reload_routes = false")
|
|
@@ -51,13 +44,19 @@ module Blacklight
|
|
|
51
44
|
file_path = "app/models/#{model_name.underscore}.rb"
|
|
52
45
|
if File.exist?(File.expand_path(file_path, destination_root))
|
|
53
46
|
inject_into_class file_path, model_name.classify do
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
<<~EOS
|
|
48
|
+
# Connects this user object to Blacklights Bookmarks.
|
|
49
|
+
include Blacklight::User
|
|
50
|
+
|
|
51
|
+
# Blacklight::User uses a method on your User class to get a user-displayable
|
|
52
|
+
# label (e.g. login or identifier) for the account. Blacklight uses `email' by default.
|
|
53
|
+
# self.string_display_key = :email
|
|
54
|
+
EOS
|
|
56
55
|
end
|
|
57
56
|
else
|
|
58
57
|
say_status "warning", <<~EOS, :yellow
|
|
59
58
|
Blacklight authenticated user functionality not installed, as a user model
|
|
60
|
-
could not be found at
|
|
59
|
+
could not be found at #{file_path}. If you used a different name,
|
|
61
60
|
please re-run the migration and provide that name as an argument. E.g.:
|
|
62
61
|
|
|
63
62
|
`rails -g blacklight:user client`
|
data/package.json
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blacklight-frontend",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-beta1",
|
|
4
4
|
"description": "The frontend code and styles for Blacklight",
|
|
5
|
-
"
|
|
5
|
+
"exports": {
|
|
6
|
+
"./blacklight.esm.js": "./app/assets/javascripts/blacklight/blacklight.esm.js",
|
|
7
|
+
"./stylesheets/*": "./app/assets/stylesheets/blacklight/*",
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./app/javascript/blacklight-frontend/index.js",
|
|
10
|
+
"require": "./app/assets/javascripts/blacklight.js"
|
|
11
|
+
},
|
|
12
|
+
"./*": "./app/javascript/blacklight-frontend/*.js"
|
|
13
|
+
},
|
|
6
14
|
"type": "module",
|
|
7
|
-
"module": "app/assets/javascripts/blacklight/blacklight.esm.js",
|
|
8
15
|
"scripts": {
|
|
16
|
+
"build": "sass ./app/assets/stylesheets/blacklight/build.scss:./app/assets/builds/blacklight.css --no-source-map --load-path=node_modules --quiet-deps",
|
|
9
17
|
"prepare": "rollup --config rollup.config.js --sourcemap && ESM=true rollup --config rollup.config.js --sourcemap"
|
|
10
18
|
},
|
|
11
19
|
"repository": {
|
|
@@ -24,7 +32,9 @@
|
|
|
24
32
|
"homepage": "https://github.com/projectblacklight/blacklight#readme",
|
|
25
33
|
"devDependencies": {
|
|
26
34
|
"rollup": "^4.24.0",
|
|
27
|
-
"rollup-plugin-includepaths": "^0.2.4"
|
|
35
|
+
"rollup-plugin-includepaths": "^0.2.4",
|
|
36
|
+
"sass": "^1.80.3",
|
|
37
|
+
"bootstrap": "^5.3.3"
|
|
28
38
|
},
|
|
29
39
|
"browserslist": [
|
|
30
40
|
"defaults",
|
data/rollup.config.js
CHANGED
|
@@ -16,7 +16,7 @@ let includePathOptions = {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
const rollupConfig = {
|
|
19
|
-
input: 'app/javascript/blacklight/index.js',
|
|
19
|
+
input: 'app/javascript/blacklight-frontend/index.js',
|
|
20
20
|
output: {
|
|
21
21
|
file: `app/assets/javascripts/blacklight/${fileDest}.js`,
|
|
22
22
|
format: ESM ? 'es' : 'umd',
|
|
@@ -23,11 +23,7 @@ RSpec.describe Blacklight::Document::ActionComponent, type: :component do
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
it 'renders an action link' do
|
|
26
|
-
|
|
27
|
-
allow(view_context).to receive(:some_tool_solr_document_path).with(document, { only_path: true }).and_return('/asdf')
|
|
28
|
-
else
|
|
29
|
-
allow(view_context).to receive(:some_tool_solr_document_path).with(document).and_return('/asdf')
|
|
30
|
-
end
|
|
26
|
+
allow(view_context).to receive(:some_tool_solr_document_path).with(document, { only_path: true }).and_return('/asdf')
|
|
31
27
|
|
|
32
28
|
expect(rendered).to have_link 'Some tool', href: '/asdf'
|
|
33
29
|
end
|
|
@@ -38,7 +34,7 @@ RSpec.describe Blacklight::Document::ActionComponent, type: :component do
|
|
|
38
34
|
it 'render the partial' do
|
|
39
35
|
allow(view_context).to receive(:render).with(hash_including(partial: '/some/tool'), {}).and_return('tool')
|
|
40
36
|
|
|
41
|
-
expect(rendered).to
|
|
37
|
+
expect(rendered).to have_content 'tool'
|
|
42
38
|
end
|
|
43
39
|
end
|
|
44
40
|
end
|
|
@@ -33,29 +33,14 @@ RSpec.describe Blacklight::Document::SidebarComponent, type: :component do
|
|
|
33
33
|
# rubocop:disable RSpec/SubjectStub
|
|
34
34
|
before do
|
|
35
35
|
allow(component).to receive(:render).with(an_instance_of(Blacklight::Document::MoreLikeThisComponent)).and_return("")
|
|
36
|
+
blacklight_config.show.show_tools_component = show_tools_component
|
|
37
|
+
allow(component).to receive(:render).with(an_instance_of(show_tools_component)).and_return(expected_html)
|
|
36
38
|
end
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
before do
|
|
40
|
-
allow(component).to receive(:render).with('show_tools', document: presented_document, silence_deprecation: false).and_return(expected_html)
|
|
41
|
-
end
|
|
40
|
+
let(:show_tools_component) { Class.new(Blacklight::Document::ShowToolsComponent) }
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
context "with a configured ShowTools component" do
|
|
49
|
-
let(:show_tools_component) { Class.new(Blacklight::Document::ShowToolsComponent) }
|
|
50
|
-
|
|
51
|
-
before do
|
|
52
|
-
blacklight_config.show.show_tools_component = show_tools_component
|
|
53
|
-
allow(component).to receive(:render).with(an_instance_of(show_tools_component)).and_return(expected_html)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
it 'renders configured show_tools component' do
|
|
57
|
-
expect(rendered).to have_css 'div[@class="expected-show_tools"]'
|
|
58
|
-
end
|
|
42
|
+
it 'renders configured show_tools component' do
|
|
43
|
+
expect(rendered).to have_css 'div[@class="expected-show_tools"]'
|
|
59
44
|
end
|
|
60
45
|
# rubocop:enable RSpec/SubjectStub
|
|
61
46
|
end
|
|
@@ -41,23 +41,21 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
it 'has some defined content areas' do
|
|
44
|
-
component.
|
|
45
|
-
component.
|
|
46
|
-
component.
|
|
47
|
-
component.
|
|
48
|
-
component.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
expect(rendered).to
|
|
52
|
-
expect(rendered).to
|
|
53
|
-
expect(rendered).to
|
|
54
|
-
expect(rendered).to
|
|
55
|
-
expect(rendered).to have_text 'Actions'
|
|
44
|
+
component.set_slot(:title) { 'Title' }
|
|
45
|
+
component.set_slot(:embed, nil, 'Embed')
|
|
46
|
+
component.set_slot(:metadata, nil, 'Metadata')
|
|
47
|
+
component.set_slot(:thumbnail, nil, 'Thumbnail')
|
|
48
|
+
component.set_slot(:actions) { 'Actions' }
|
|
49
|
+
|
|
50
|
+
expect(rendered).to have_content 'Title'
|
|
51
|
+
expect(rendered).to have_content 'Embed'
|
|
52
|
+
expect(rendered).to have_content 'Metadata'
|
|
53
|
+
expect(rendered).to have_content 'Thumbnail'
|
|
54
|
+
expect(rendered).to have_content 'Actions'
|
|
56
55
|
end
|
|
57
56
|
|
|
58
57
|
it 'has schema.org properties' do
|
|
59
|
-
component.
|
|
60
|
-
render_inline component
|
|
58
|
+
component.set_slot(:body) { '-' }
|
|
61
59
|
|
|
62
60
|
expect(rendered).to have_css 'article[@itemtype="http://schema.org/Thing"]'
|
|
63
61
|
expect(rendered).to have_css 'article[@itemscope]'
|
|
@@ -65,10 +63,9 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
|
65
63
|
|
|
66
64
|
context 'with a provided body' do
|
|
67
65
|
it 'opts-out of normal component content' do
|
|
68
|
-
component.
|
|
69
|
-
render_inline component
|
|
66
|
+
component.set_slot(:body) { 'Body content' }
|
|
70
67
|
|
|
71
|
-
expect(rendered).to
|
|
68
|
+
expect(rendered).to have_content 'Body content'
|
|
72
69
|
expect(rendered).to have_no_css 'header'
|
|
73
70
|
expect(rendered).to have_no_css 'dl'
|
|
74
71
|
end
|
|
@@ -82,8 +79,7 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
|
82
79
|
let(:attr) { { counter: 5 } }
|
|
83
80
|
|
|
84
81
|
it 'has data properties' do
|
|
85
|
-
component.
|
|
86
|
-
render_inline component
|
|
82
|
+
component.set_slot(:body) { '-' }
|
|
87
83
|
|
|
88
84
|
expect(rendered).to have_css 'article[@data-document-id="x"]'
|
|
89
85
|
expect(rendered).to have_css 'article[@data-document-counter="5"]'
|
|
@@ -134,8 +130,7 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
|
134
130
|
end
|
|
135
131
|
|
|
136
132
|
it 'renders with an id' do
|
|
137
|
-
component.
|
|
138
|
-
render_inline component
|
|
133
|
+
component.set_slot(:body) { '-' }
|
|
139
134
|
|
|
140
135
|
expect(rendered).to have_css 'article#document'
|
|
141
136
|
end
|
|
@@ -160,7 +155,7 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
|
160
155
|
end)
|
|
161
156
|
|
|
162
157
|
blacklight_config.show.embed_component = StubComponent
|
|
163
|
-
expect(rendered).to
|
|
158
|
+
expect(rendered).to have_content 'embed'
|
|
164
159
|
end
|
|
165
160
|
|
|
166
161
|
context 'show view with custom translation' do
|
|
@@ -226,7 +221,7 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
|
226
221
|
|
|
227
222
|
it 'renders partials' do
|
|
228
223
|
component.with_partial { 'Partials' }
|
|
229
|
-
expect(rendered).to
|
|
224
|
+
expect(rendered).to have_content 'Partials'
|
|
230
225
|
end
|
|
231
226
|
|
|
232
227
|
it 'has no partials by default' do
|
|
@@ -245,7 +240,7 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
|
245
240
|
end
|
|
246
241
|
|
|
247
242
|
it 'shows the prefix' do
|
|
248
|
-
expect(rendered).to
|
|
243
|
+
expect(rendered).to have_content "Prefix!"
|
|
249
244
|
end
|
|
250
245
|
end
|
|
251
246
|
end
|
|
@@ -36,7 +36,7 @@ RSpec.describe Blacklight::FacetComponent, type: :component do
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
it 'renders the provided component' do
|
|
39
|
-
expect(rendered).to
|
|
39
|
+
expect(rendered).to have_content 'Custom facet rendering'
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
|
|
@@ -60,7 +60,7 @@ RSpec.describe Blacklight::FacetComponent, type: :component do
|
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
it 'renders the partial' do
|
|
63
|
-
expect(rendered).to
|
|
63
|
+
expect(rendered).to have_content 'facet partial'
|
|
64
64
|
end
|
|
65
65
|
end
|
|
66
66
|
|
|
@@ -32,8 +32,8 @@ RSpec.describe Blacklight::FacetFieldCheckboxesComponent, type: :component do
|
|
|
32
32
|
let(:search_state) { Blacklight::SearchState.new(params.with_indifferent_access, Blacklight::Configuration.new) }
|
|
33
33
|
let(:params) { { f: { field: ['a'] } } }
|
|
34
34
|
|
|
35
|
-
it 'renders
|
|
36
|
-
expect(rendered).to have_css '.
|
|
35
|
+
it 'renders an accordion item' do
|
|
36
|
+
expect(rendered).to have_css '.accordion-item'
|
|
37
37
|
expect(rendered).to have_button 'Field'
|
|
38
38
|
expect(rendered).to have_css 'button[data-bs-target="#facet-field"]'
|
|
39
39
|
expect(rendered).to have_css '#facet-field.collapse.show'
|
|
@@ -30,8 +30,8 @@ RSpec.describe Blacklight::FacetFieldListComponent, type: :component do
|
|
|
30
30
|
])
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
it 'renders
|
|
34
|
-
expect(rendered).to have_css '.
|
|
33
|
+
it 'renders an accordion item' do
|
|
34
|
+
expect(rendered).to have_css '.accordion-item'
|
|
35
35
|
expect(rendered).to have_button 'Field'
|
|
36
36
|
expect(rendered).to have_css 'button[data-bs-target="#facet-field"]'
|
|
37
37
|
expect(rendered).to have_css '#facet-field.collapse.show'
|
|
@@ -133,7 +133,7 @@ RSpec.describe Blacklight::FacetFieldListComponent, type: :component do
|
|
|
133
133
|
let(:params) { { f_inclusive: { field: %w[a b c] } } }
|
|
134
134
|
|
|
135
135
|
it 'displays the constraint above the list' do
|
|
136
|
-
expect(rendered).to
|
|
136
|
+
expect(rendered).to have_content 'Any of:'
|
|
137
137
|
expect(rendered).to have_css '.inclusive_or .facet-label', text: 'a'
|
|
138
138
|
expect(rendered).to have_link '[remove]', href: 'http://test.host/catalog?f_inclusive%5Bfield%5D%5B%5D=b&f_inclusive%5Bfield%5D%5B%5D=c'
|
|
139
139
|
expect(rendered).to have_css '.inclusive_or .facet-label', text: 'b'
|
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
require 'spec_helper'
|
|
4
4
|
|
|
5
5
|
RSpec.describe Blacklight::Search::FacetSuggestInput, type: :component do
|
|
6
|
-
let(:facet) { Blacklight::Configuration::FacetField.new key: 'language_facet'
|
|
6
|
+
let(:facet) { Blacklight::Configuration::FacetField.new key: 'language_facet' }
|
|
7
7
|
let(:presenter) { instance_double(Blacklight::FacetFieldPresenter) }
|
|
8
|
-
let(:view_context) { double(ActionView::Base) }
|
|
9
8
|
|
|
10
9
|
before do
|
|
11
|
-
allow(presenter).to
|
|
12
|
-
allow(view_context).to receive(:search_facet_path).and_return('/catalog/facet/language_facet')
|
|
10
|
+
allow(presenter).to receive(:label).and_return 'Language'
|
|
13
11
|
end
|
|
14
12
|
|
|
15
13
|
it 'has an input with the facet-suggest class, which the javascript needs to find it' do
|
|
@@ -22,36 +20,14 @@ RSpec.describe Blacklight::Search::FacetSuggestInput, type: :component do
|
|
|
22
20
|
expect(rendered.css('input[data-facet-field="language_facet"]').count).to eq 1
|
|
23
21
|
end
|
|
24
22
|
|
|
25
|
-
it 'has an input with the data-facet-search-context attribute, which the javascript needs to determine the current search context' do
|
|
26
|
-
allow(view_context).to receive(:search_facet_path).and_return('/catalog/facet/language_facet?f%5Bformat%5D%5B%5D=Book&facet.prefix=R&facet.sort=index&q=tibet&search_field=all_fields')
|
|
27
|
-
rendered = render_inline(described_class.new(facet: facet, presenter: presenter))
|
|
28
|
-
expect(rendered.css('input[data-facet-search-context="/catalog/facet/language_facet?f%5Bformat%5D%5B%5D=Book&facet.prefix=R&facet.sort=index&q=tibet&search_field=all_fields"]').count).to eq 1
|
|
29
|
-
end
|
|
30
|
-
|
|
31
23
|
it 'has a visible label that is associated with the input' do
|
|
32
24
|
rendered = render_inline(described_class.new(facet: facet, presenter: presenter))
|
|
33
25
|
label = rendered.css('label').first
|
|
34
26
|
expect(label.text.strip).to eq 'Filter Language'
|
|
35
27
|
|
|
36
28
|
id_in_label_for = label.attribute('for').text
|
|
37
|
-
expect(id_in_label_for).to eq('
|
|
29
|
+
expect(id_in_label_for).to eq('facet-suggest-language_facet')
|
|
38
30
|
|
|
39
31
|
expect(rendered.css('input').first.attribute('id').text).to eq id_in_label_for
|
|
40
32
|
end
|
|
41
|
-
|
|
42
|
-
context 'when the facet is explicitly configured to suggest: false' do
|
|
43
|
-
let(:facet) { Blacklight::Configuration::FacetField.new key: 'language_facet', suggest: false }
|
|
44
|
-
|
|
45
|
-
it 'does not display' do
|
|
46
|
-
expect(render_inline(described_class.new(facet: facet, presenter: presenter)).to_s).to eq ''
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
context 'when the facet is not explicitly configured with a suggest key' do
|
|
51
|
-
let(:facet) { Blacklight::Configuration::FacetField.new key: 'language_facet' }
|
|
52
|
-
|
|
53
|
-
it 'does not display' do
|
|
54
|
-
expect(render_inline(described_class.new(facet: facet, presenter: presenter)).to_s).to eq ''
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
33
|
end
|
|
@@ -85,7 +85,7 @@ RSpec.describe Blacklight::SearchBarComponent, type: :component do
|
|
|
85
85
|
subject(:render) { render_inline(instance) }
|
|
86
86
|
|
|
87
87
|
it 'sets the rounded border class' do
|
|
88
|
-
expect(render.css('.rounded-
|
|
88
|
+
expect(render.css('.rounded-start')).to be_present
|
|
89
89
|
end
|
|
90
90
|
end
|
|
91
91
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
RSpec.describe Blacklight::Catalog do
|
|
4
4
|
subject { controller }
|
|
5
5
|
|
|
6
|
-
let(:controller) { Class.new(ApplicationController) { include Blacklight::Catalog }.new }
|
|
6
|
+
let(:controller) { (Class.new(ApplicationController) { include Blacklight::Catalog }).new }
|
|
7
7
|
|
|
8
8
|
describe "#search_state" do
|
|
9
9
|
subject { controller.send(:search_state) }
|
|
@@ -440,7 +440,7 @@ RSpec.describe CatalogController, :api do
|
|
|
440
440
|
it "responds to an extension-registered format properly" do
|
|
441
441
|
get :show, params: { id: doc_id, format: 'mock' }
|
|
442
442
|
expect(response).to be_successful
|
|
443
|
-
expect(response.body).to
|
|
443
|
+
expect(response.body).to match /mock_export/
|
|
444
444
|
end
|
|
445
445
|
end # dynamic export formats
|
|
446
446
|
end # describe show action
|
|
@@ -595,7 +595,7 @@ RSpec.describe CatalogController, :api do
|
|
|
595
595
|
|
|
596
596
|
it "does not show user util links" do
|
|
597
597
|
get :index
|
|
598
|
-
expect(response.body).not_to
|
|
598
|
+
expect(response.body).not_to match /Login/
|
|
599
599
|
end
|
|
600
600
|
end
|
|
601
601
|
|
|
@@ -803,7 +803,7 @@ RSpec.describe CatalogController, :api do
|
|
|
803
803
|
end
|
|
804
804
|
|
|
805
805
|
it "is empty for empty result sets", :integration do
|
|
806
|
-
get :page_links, params: { f: { "format" =>
|
|
806
|
+
get :page_links, params: { f: { "format" => 'empty-result-set' }, counter: 1 }
|
|
807
807
|
expect(assigns(:page_link_data)).to be_empty
|
|
808
808
|
end
|
|
809
809
|
end
|
|
@@ -53,7 +53,7 @@ RSpec.describe "Blacklight Advanced Search Form" do
|
|
|
53
53
|
expect(page).to have_css('.blacklight-language_ssim')
|
|
54
54
|
|
|
55
55
|
within('.blacklight-language_ssim') do
|
|
56
|
-
expect(page).to
|
|
56
|
+
expect(page).to have_content 'Language'
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
59
|
end
|
|
@@ -61,8 +61,8 @@ RSpec.describe "Blacklight Advanced Search Form" do
|
|
|
61
61
|
it 'scopes searches to fields' do
|
|
62
62
|
fill_in 'Title', with: 'Medicine'
|
|
63
63
|
click_on 'advanced-search-submit'
|
|
64
|
-
expect(page).to
|
|
65
|
-
expect(page).to
|
|
64
|
+
expect(page).to have_content 'Remove constraint Title: Medicine'
|
|
65
|
+
expect(page).to have_content 'Strong Medicine speaks'
|
|
66
66
|
expect(page).to have_css('article.document', count: 1)
|
|
67
67
|
end
|
|
68
68
|
|
|
@@ -71,16 +71,16 @@ RSpec.describe "Blacklight Advanced Search Form" do
|
|
|
71
71
|
click_on 'Language'
|
|
72
72
|
check 'Urdu 3'
|
|
73
73
|
click_on 'advanced-search-submit'
|
|
74
|
-
expect(page).to
|
|
75
|
-
expect(page).to
|
|
74
|
+
expect(page).to have_content 'Pākistānī ʻaurat dorāhe par'
|
|
75
|
+
expect(page).to have_no_content 'Ajikto kŭrŏk chŏrŏk sasimnikka : and 아직도 그럭 저럭 사십니까'
|
|
76
76
|
expect(page).to have_css('article.document', count: 1)
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
it 'handles boolean queries' do
|
|
80
80
|
fill_in 'All Fields', with: 'history NOT strong'
|
|
81
81
|
click_on 'advanced-search-submit'
|
|
82
|
-
expect(page).to
|
|
83
|
-
expect(page).to
|
|
82
|
+
expect(page).to have_content('Ci an zhou bian')
|
|
83
|
+
expect(page).to have_no_content('Strong Medicine speaks')
|
|
84
84
|
expect(page).to have_css('article.document', count: 10)
|
|
85
85
|
end
|
|
86
86
|
|
|
@@ -88,7 +88,7 @@ RSpec.describe "Blacklight Advanced Search Form" do
|
|
|
88
88
|
fill_in 'All Fields', with: 'history'
|
|
89
89
|
fill_in 'Author', with: 'hearth'
|
|
90
90
|
click_on 'advanced-search-submit'
|
|
91
|
-
expect(page).to
|
|
91
|
+
expect(page).to have_content('Strong Medicine speaks')
|
|
92
92
|
expect(page).to have_css('article.document', count: 1)
|
|
93
93
|
end
|
|
94
94
|
|
|
@@ -97,8 +97,8 @@ RSpec.describe "Blacklight Advanced Search Form" do
|
|
|
97
97
|
fill_in 'All Fields', with: 'history'
|
|
98
98
|
fill_in 'Subject', with: 'women'
|
|
99
99
|
click_on 'advanced-search-submit'
|
|
100
|
-
expect(page).to
|
|
101
|
-
expect(page).to
|
|
100
|
+
expect(page).to have_content('Ci an zhou bian')
|
|
101
|
+
expect(page).to have_content('Pākistānī ʻaurat dorāhe par')
|
|
102
102
|
expect(page).to have_css('article.document', count: 10)
|
|
103
103
|
end
|
|
104
104
|
end
|
|
@@ -127,8 +127,8 @@ RSpec.describe "Blacklight Advanced Search Form" do
|
|
|
127
127
|
it "does not have multiple parameters for a search field" do
|
|
128
128
|
fill_in 'Title', with: 'bread'
|
|
129
129
|
click_on 'advanced-search-submit'
|
|
130
|
-
expect(page.current_url).to
|
|
131
|
-
expect(page.current_url).not_to
|
|
130
|
+
expect(page.current_url).to match(/bread/)
|
|
131
|
+
expect(page.current_url).not_to match(/medicine/)
|
|
132
132
|
end
|
|
133
133
|
|
|
134
134
|
it "clears the prepopulated fields when the Start Over button is pressed" do
|
data/spec/features/axe_spec.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
RSpec.describe 'Accessibility testing', :js, api: false do
|
|
4
4
|
it 'validates the home page' do
|
|
5
5
|
visit root_path
|
|
6
|
-
expect(page).to
|
|
6
|
+
expect(page).to be_axe_clean
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
it 'validates the catalog page' do
|
|
@@ -11,28 +11,23 @@ RSpec.describe 'Accessibility testing', :js, api: false do
|
|
|
11
11
|
fill_in "q", with: 'history'
|
|
12
12
|
click_on 'search'
|
|
13
13
|
|
|
14
|
-
expect(page).to
|
|
14
|
+
expect(page).to be_axe_clean
|
|
15
15
|
|
|
16
|
-
within '.
|
|
16
|
+
within '.accordion-item.blacklight-language_ssim' do
|
|
17
17
|
click_on 'Language'
|
|
18
18
|
click_on "Tibetan"
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
expect(page).to
|
|
21
|
+
expect(page).to be_axe_clean
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
it 'validates the advanced search form' do
|
|
25
25
|
visit advanced_search_catalog_path
|
|
26
|
-
expect(page).to
|
|
26
|
+
expect(page).to be_axe_clean
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
it 'validates the single results page' do
|
|
30
30
|
visit solr_document_path('2007020969')
|
|
31
|
-
expect(page).to
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def be_accessible(skipping: [])
|
|
35
|
-
# typeahead does funny things with the search bar
|
|
36
|
-
be_axe_clean.excluding('.tt-hint').skipping(skipping + [('color-contrast' if defined?(Bootstrap) && Bootstrap::VERSION < '5')].compact)
|
|
31
|
+
expect(page).to be_axe_clean
|
|
37
32
|
end
|
|
38
33
|
end
|