blacklight 7.19.0 → 7.19.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/app/assets/javascripts/blacklight/blacklight.js +1 -2
  4. data/app/assets/stylesheets/blacklight/_balanced_list.scss +2 -2
  5. data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +1 -1
  6. data/app/assets/stylesheets/blacklight/_constraints.scss +2 -2
  7. data/app/assets/stylesheets/blacklight/_controls.scss +2 -1
  8. data/app/assets/stylesheets/blacklight/_facets.scss +3 -1
  9. data/app/assets/stylesheets/blacklight/_header.scss +6 -1
  10. data/app/components/blacklight/constraint_layout_component.html.erb +1 -1
  11. data/app/components/blacklight/constraints_component.html.erb +2 -2
  12. data/app/components/blacklight/facet_field_component.html.erb +3 -1
  13. data/app/components/blacklight/facet_item_component.rb +1 -1
  14. data/app/components/blacklight/facet_item_pivot_component.rb +2 -2
  15. data/app/components/blacklight/response/facet_group_component.html.erb +2 -0
  16. data/app/components/blacklight/response/view_type_component.html.erb +1 -1
  17. data/app/components/blacklight/search_bar_component.html.erb +3 -3
  18. data/app/components/blacklight/system/dropdown_component.rb +1 -1
  19. data/app/components/blacklight/system/flash_message_component.html.erb +1 -1
  20. data/app/components/blacklight/system/modal_component.html.erb +1 -1
  21. data/app/helpers/blacklight/component_helper_behavior.rb +1 -1
  22. data/app/javascript/blacklight/modal.js +1 -1
  23. data/app/views/blacklight/nav/_bookmark.html.erb +1 -1
  24. data/app/views/bookmarks/index.html.erb +1 -1
  25. data/app/views/catalog/_constraints.html.erb +2 -2
  26. data/app/views/catalog/_home_text.html.erb +1 -1
  27. data/app/views/catalog/_per_page_widget.html.erb +1 -1
  28. data/app/views/catalog/_search_results.html.erb +2 -2
  29. data/app/views/search_history/index.html.erb +1 -1
  30. data/app/views/shared/_header_navbar.html.erb +1 -1
  31. data/config/locales/blacklight.ar.yml +2 -2
  32. data/config/locales/blacklight.ca.yml +2 -2
  33. data/config/locales/blacklight.de.yml +2 -2
  34. data/config/locales/blacklight.en.yml +2 -2
  35. data/config/locales/blacklight.es.yml +2 -2
  36. data/config/locales/blacklight.fr.yml +2 -2
  37. data/config/locales/blacklight.hu.yml +2 -2
  38. data/config/locales/blacklight.it.yml +2 -2
  39. data/config/locales/blacklight.nl.yml +2 -2
  40. data/config/locales/blacklight.pt-BR.yml +1 -1
  41. data/config/locales/blacklight.sq.yml +2 -2
  42. data/config/locales/blacklight.zh.yml +2 -2
  43. data/lib/blacklight/solr/request.rb +10 -7
  44. data/lib/blacklight/solr/search_builder_behavior.rb +23 -17
  45. data/spec/components/blacklight/constraint_layout_component_spec.rb +1 -1
  46. data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +1 -1
  47. data/spec/components/blacklight/facet_field_list_component_spec.rb +1 -1
  48. data/spec/features/facets_spec.rb +2 -2
  49. data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +3 -3
  50. data/spec/models/blacklight/solr/request_spec.rb +0 -1
  51. data/spec/models/blacklight/solr/search_builder_spec.rb +14 -1
  52. data/spec/views/catalog/_facet_layout.html.erb_spec.rb +2 -2
  53. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b17640ea1dd81a41048bfbb2362bf692300e228045fac8f0d42aa0fbd281a63
4
- data.tar.gz: 6956aa4b0fd67802b24d04b0f27677ca9f84d5692bdf8a34cd21b043d3fe8df9
3
+ metadata.gz: 924afe1d564ba4e2a2fdf2f2959fb85a6245dd48b4be4eabbe9c1298b6d96e9b
4
+ data.tar.gz: e1574d78f4ac42092f73d68f0f5cb76a3e5eeb116ca98a8a017a82e883110486
5
5
  SHA512:
6
- metadata.gz: bc71e8e6c0ee060b4303052caf0b9341c58a42c71e5f9badfe03f8013c6e3b96ba43f66d0d477c525edb58263a1993b9d9da143cf3f5f1c7fdb032568df5db87
7
- data.tar.gz: e31975c219b1b709bdc6b765f123ffbf13978f56a26936f75d08cc7796e38703f163dc459e735f37bc36da3338e43f481d24b57d8308052509f6d19c0864bb7c
6
+ metadata.gz: 268ddf30836b4c0f4b9a4b00b6bc7b1779ca2eb88568190ca344bbce72e5a5eb1c7bccc13a0339f224f1f468c6a972d4d9ce0198af284fe4c361cc0f671e2913
7
+ data.tar.gz: 20d21c6e2f5b86c0383124af0d7862f0ef7b2d8fadd475257b4e150e36e488e5025e4c2f2fd96ad399d7472a613edfa069d04d50693a2ded20f1d29d02c039b3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.19.0
1
+ 7.19.1
@@ -352,7 +352,7 @@ Blacklight.modal.modalCloseSelector = '[data-blacklight-modal~=close]'; // Calle
352
352
 
353
353
  Blacklight.modal.onFailure = function (jqXHR, textStatus, errorThrown) {
354
354
  console.error('Server error:', this.url, jqXHR.status, errorThrown);
355
- var contents = '<div class="modal-header">' + '<div class="modal-title">There was a problem with your request.</div>' + '<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="Close">' + ' <span aria-hidden="true">&times;</span>' + '</button></div>' + ' <div class="modal-body"><p>Expected a successful response from the server, but got an error</p>' + '<pre>' + this.type + ' ' + this.url + "\n" + jqXHR.status + ': ' + errorThrown + '</pre></div>';
355
+ var contents = '<div class="modal-header">' + '<div class="modal-title">There was a problem with your request.</div>' + '<button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" aria-label="Close">' + ' <span aria-hidden="true">&times;</span>' + '</button></div>' + ' <div class="modal-body"><p>Expected a successful response from the server, but got an error</p>' + '<pre>' + this.type + ' ' + this.url + "\n" + jqXHR.status + ': ' + errorThrown + '</pre></div>';
356
356
  $(Blacklight.modal.modalSelector).find('.modal-content').html(contents);
357
357
  $(Blacklight.modal.modalSelector).modal('show');
358
358
  };
@@ -495,4 +495,3 @@ Blacklight.handleSearchContextMethod = function (event) {
495
495
  Blacklight.onLoad(function () {
496
496
  Blacklight.doSearchContextBehavior();
497
497
  });
498
-
@@ -2,11 +2,11 @@
2
2
  dt {
3
3
  font-weight: normal;
4
4
  color: $field_name_color;
5
- @media (max-width: breakpoint-max(sm)) {
5
+ @media (max-width: breakpoint-min(md)) {
6
6
  text-align: left;
7
7
  }
8
8
 
9
- @media (min-width: breakpoint-max(sm)) {
9
+ @media (min-width: breakpoint-min(md)) {
10
10
  text-align: right;
11
11
  }
12
12
  }
@@ -5,7 +5,7 @@
5
5
  // Facet field headings and buttons
6
6
  .facet-field-heading {
7
7
  border-bottom: 0;
8
-
8
+
9
9
  button {
10
10
  font-weight: $headings-font-weight;
11
11
 
@@ -8,8 +8,8 @@
8
8
  text-overflow: ellipsis;
9
9
  overflow: hidden;
10
10
 
11
- @media (max-width: breakpoint-max(xs)) {
12
- max-width: breakpoint-max(xs) / 2;
11
+ @media (max-width: breakpoint-min(sm)) {
12
+ max-width: breakpoint-min(sm) / 2;
13
13
  }
14
14
 
15
15
  @media (min-width: breakpoint-min(sm)) and (max-width: breakpoint-max(sm)) {
@@ -34,7 +34,8 @@
34
34
  display: inline-block;
35
35
 
36
36
  .caption {
37
- @extend .sr-only;
37
+ @extend .sr-only !optional;
38
+ @extend .visually-hidden !optional;
38
39
  }
39
40
  }
40
41
 
@@ -3,7 +3,8 @@
3
3
  border-color: $navbar-light-toggler-border-color;
4
4
  color: $navbar-light-active-color;
5
5
 
6
- @include hover-focus {
6
+ &:hover,
7
+ &:focus {
7
8
  color: $navbar-light-active-color;
8
9
  }
9
10
  }
@@ -83,6 +84,7 @@
83
84
  color: $text-muted;
84
85
  font-weight: bold;
85
86
  padding-left: $spacer / 2;
87
+ text-decoration: none;
86
88
 
87
89
  &:hover {
88
90
  color: theme-color("danger");
@@ -44,7 +44,12 @@
44
44
  .submit-search-text {
45
45
  // hide 'search' label at very small screens
46
46
  @media screen and (max-width: breakpoint-max(xs)) {
47
- @include sr-only();
47
+ @if mixin-exists(sr-only) {
48
+ @include sr-only();
49
+ }
50
+ @if mixin-exists(visually-hidden) {
51
+ @include visually-hidden();
52
+ }
48
53
  }
49
54
  }
50
55
  }
@@ -10,7 +10,7 @@
10
10
  <% if @remove_path.present? %>
11
11
  <%= link_to(@remove_path, class: 'btn btn-outline-secondary remove') do %>
12
12
  <span class="remove-icon" aria-hidden="true">✖</span>
13
- <span class="sr-only">
13
+ <span class="sr-only visually-hidden">
14
14
  <%= if @label.blank?
15
15
  t('blacklight.search.filters.remove.value', value: @value)
16
16
  else
@@ -1,9 +1,9 @@
1
1
  <%= content_tag :div, id: @id, class: @classes do %>
2
- <h2 class="sr-only"><%= t('blacklight.search.search_constraints_header') %></h2>
2
+ <h2 class="sr-only visually-hidden"><%= t('blacklight.search.search_constraints_header') %></h2>
3
3
 
4
4
  <%= link_to t('blacklight.search.start_over'), start_over_path, class: "catalog_startOverLink btn btn-primary" %>
5
5
 
6
- <span class="constraints-label sr-only"><%= t('blacklight.search.filters.title') %></span>
6
+ <span class="constraints-label sr-only visually-hidden"><%= t('blacklight.search.filters.title') %></span>
7
7
  <% if query_constraints_area.present? %>
8
8
  <% query_constraints_area.each do |constraint| %>
9
9
  <%= constraint %>
@@ -2,9 +2,11 @@
2
2
  <h3 class="card-header p-0 facet-field-heading" id="<%= @facet_field.html_id %>-header">
3
3
  <button
4
4
  type="button"
5
- class="btn btn-block p-2 text-left collapse-toggle <%= "collapsed" if @facet_field.collapsed? %>"
5
+ class="btn w-100 d-block btn-block p-2 text-start text-left collapse-toggle <%= "collapsed" if @facet_field.collapsed? %>"
6
6
  data-toggle="collapse"
7
+ data-bs-toggle="collapse"
7
8
  data-target="#<%= @facet_field.html_id %>"
9
+ data-bs-target="#<%= @facet_field.html_id %>"
8
10
  aria-expanded="<%= @facet_field.collapsed? ? 'false' : 'true' %>"
9
11
  >
10
12
  <%= label %>
@@ -87,7 +87,7 @@ module Blacklight
87
87
  # remove link
88
88
  link_to(@href, class: "remove") do
89
89
  tag.span('✖', class: "remove-icon", aria: { hidden: true }) +
90
- tag.span(@view_context.t(:'blacklight.search.facets.selected.remove'), class: 'sr-only')
90
+ tag.span(@view_context.t(:'blacklight.search.facets.selected.remove'), class: 'sr-only visually-hidden')
91
91
  end
92
92
  end + render_facet_count(classes: ["selected"])
93
93
  end
@@ -56,7 +56,7 @@ module Blacklight
56
56
 
57
57
  def facet_toggle_button(id)
58
58
  content_tag 'button', class: 'btn facet-toggle-handle collapsed',
59
- data: { toggle: 'collapse', target: "##{id}" },
59
+ data: { toggle: 'collapse', 'bs-toggle': 'collapse', target: "##{id}", 'bs-target': "##{id}" },
60
60
  aria: { expanded: false, controls: id, describedby: "#{id}_label" } do
61
61
  concat toggle_icon(:show)
62
62
  concat toggle_icon(:hide)
@@ -66,7 +66,7 @@ module Blacklight
66
66
  def toggle_icon(type)
67
67
  content_tag 'span', class: type do
68
68
  concat @icons[type]
69
- concat content_tag('span', t(type, scope: 'blacklight.search.facets.pivot'), class: 'sr-only')
69
+ concat content_tag('span', t(type, scope: 'blacklight.search.facets.pivot'), class: 'sr-only visually-hidden')
70
70
  end
71
71
  end
72
72
 
@@ -9,6 +9,8 @@
9
9
  data: {
10
10
  toggle: 'collapse',
11
11
  target: "##{@panel_id}",
12
+ 'bs-toggle': 'collapse',
13
+ 'bs-target': "##{@panel_id}"
12
14
  },
13
15
  aria: {
14
16
  controls: @panel_id,
@@ -1,5 +1,5 @@
1
1
  <div class="view-type">
2
- <span class="sr-only"><%= t('blacklight.search.view_title') %></span>
2
+ <span class="sr-only visually-hidden"><%= t('blacklight.search.view_title') %></span>
3
3
  <div class="view-type-group btn-group">
4
4
  <% views.each do |view| %>
5
5
  <%= view %>
@@ -1,7 +1,7 @@
1
1
  <%= form_tag @url, method: @method, class: @classes.join(' '), role: 'search', 'aria-label' => scoped_t('submit') do %>
2
2
  <%= render_hash_as_hidden_fields(@params) %>
3
3
  <% if @search_fields.length > 1 %>
4
- <label for="search_field" class="sr-only"><%= scoped_t('search_field.label') %></label>
4
+ <label for="search_field" class="sr-only visually-hidden"><%= scoped_t('search_field.label') %></label>
5
5
  <% end %>
6
6
  <div class="input-group">
7
7
  <%= prepend %>
@@ -11,12 +11,12 @@
11
11
  options_for_select(@search_fields, h(@search_field)),
12
12
  title: scoped_t('search_field.title'),
13
13
  id: "#{@prefix}search_field",
14
- class: "custom-select search-field") %>
14
+ class: "custom-select form-select search-field") %>
15
15
  <% elsif @search_fields.length == 1 %>
16
16
  <%= hidden_field_tag :search_field, @search_fields.first.last %>
17
17
  <% end %>
18
18
 
19
- <label for="<%= @prefix %><%= @query_param %>" class="sr-only"><%= scoped_t('search.label') %></label>
19
+ <label for="<%= @prefix %><%= @query_param %>" class="sr-only visually-hidden"><%= scoped_t('search.label') %></label>
20
20
  <%= text_field_tag @query_param, @q, placeholder: scoped_t('search.placeholder'), class: "search-q q form-control rounded-#{@search_fields.length > 1 ? '0' : 'left'}", id: "#{@prefix}q", autocomplete: autocomplete_path.present? ? "off" : "", autofocus: @autofocus, data: { autocomplete_enabled: autocomplete_path.present?, autocomplete_path: autocomplete_path } %>
21
21
 
22
22
  <span class="input-group-append">
@@ -4,7 +4,7 @@ module Blacklight
4
4
  module System
5
5
  class DropdownComponent < ViewComponent::Base
6
6
  renders_one :button, (lambda do |classes:, label:|
7
- button_tag class: classes, aria: { expanded: false }, data: { toggle: 'dropdown' } do
7
+ button_tag class: classes, aria: { expanded: false }, data: { toggle: 'dropdown', 'bs-toggle': 'dropdown' } do
8
8
  safe_join([label, content_tag(:span, '', class: 'caret')])
9
9
  end
10
10
  end)
@@ -1,4 +1,4 @@
1
1
  <div class="alert <%= @classes %>">
2
2
  <%= message %>
3
- <a class="close" data-dismiss="alert" href="#">&times;</a>
3
+ <a class="btn-close close" data-dismiss="alert" href="#">&times;</a>
4
4
  </div>
@@ -6,7 +6,7 @@
6
6
  <h1 class="modal-title"><%= title %></h1>
7
7
  <% end) %>
8
8
 
9
- <button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
9
+ <button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
10
10
  <span aria-hidden="true">&times;</span>
11
11
  </button>
12
12
  </div>
@@ -14,7 +14,7 @@ module Blacklight
14
14
  if action_opts.path
15
15
  send(action_opts.path, url_opts)
16
16
  elsif url_opts[:id].class.respond_to?(:model_name)
17
- url_for([action_opts.key, url_opts[:id]])
17
+ url_for([action_opts.key.to_sym, url_opts[:id]])
18
18
  else
19
19
  send("#{action_opts.key}_#{controller_name}_path", url_opts)
20
20
  end
@@ -106,7 +106,7 @@ Blacklight.modal.onFailure = function(jqXHR, textStatus, errorThrown) {
106
106
 
107
107
  var contents = '<div class="modal-header">' +
108
108
  '<div class="modal-title">There was a problem with your request.</div>' +
109
- '<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="Close">' +
109
+ '<button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" aria-label="Close">' +
110
110
  ' <span aria-hidden="true">&times;</span>' +
111
111
  '</button></div>' +
112
112
  ' <div class="modal-body"><p>Expected a successful response from the server, but got an error</p>' +
@@ -1,4 +1,4 @@
1
1
  <%= link_to bookmarks_path, id:'bookmarks_nav', class: 'nav-link' do %>
2
2
  <%= t('blacklight.header_links.bookmarks') %>
3
- <span class="badge badge-secondary" data-role='bookmark-counter'><%= current_or_guest_user.bookmarks.count %></span>
3
+ <span class="badge badge-secondary bg-secondary" data-role='bookmark-counter'><%= current_or_guest_user.bookmarks.count %></span>
4
4
  <% end %>
@@ -13,7 +13,7 @@
13
13
  <% else %>
14
14
  <%= render 'sort_and_per_page' %>
15
15
  <%= render partial: 'tools', locals: { document_list: @response.documents } %>
16
- <h2 class='section-heading sr-only'><%= t('blacklight.bookmarks.list_title') %></h2>
16
+ <h2 class='section-heading sr-only visually-hidden'><%= t('blacklight.bookmarks.list_title') %></h2>
17
17
  <%= render_document_index %>
18
18
  <%= render 'results_pagination' %>
19
19
  <% end %>
@@ -4,10 +4,10 @@
4
4
  <% Deprecation.warn(Blacklight::RenderConstraintsHelperBehavior, 'Constraints helpers or partials were overridden; not using components') %>
5
5
  <% if Deprecation.silence(Blacklight::RenderConstraintsHelperBehavior) { query_has_constraints? } %>
6
6
  <div id="appliedParams" class="clearfix constraints-container">
7
- <h2 class="sr-only"><%= t('blacklight.search.search_constraints_header') %></h2>
7
+ <h2 class="sr-only visually-hidden"><%= t('blacklight.search.search_constraints_header') %></h2>
8
8
 
9
9
  <%= render 'start_over' %>
10
- <span class="constraints-label sr-only"><%= t('blacklight.search.filters.title') %></span>
10
+ <span class="constraints-label sr-only visually-hidden"><%= t('blacklight.search.filters.title') %></span>
11
11
  <%= render_constraints(controller.params != params ? params : search_state) %>
12
12
  </div>
13
13
  <% end %>
@@ -31,7 +31,7 @@
31
31
 
32
32
  <%# This is the same panel shown in the Rails welcome template %>
33
33
  <div id="about" class="card">
34
- <h2 class='card-header collapsed collapse-toggle' data-toggle="collapse" data-target="#about-content"><a href="/rails/info/properties">About your application&rsquo;s environment</a></h2>
34
+ <h2 class='card-header collapsed collapse-toggle' data-toggle="collapse" data-bs-toggle="collapse" data-bs-target="#about-content" data-target="#about-content"><a href="/rails/info/properties">About your application&rsquo;s environment</a></h2>
35
35
  <div id="about-content" class="card-body collapse"></div>
36
36
  </div>
37
37
 
@@ -1,5 +1,5 @@
1
1
  <% if show_sort_and_per_page? %>
2
- <span class="sr-only"><%= t('blacklight.search.per_page.title') %></span>
2
+ <span class="sr-only visually-hidden"><%= t('blacklight.search.per_page.title') %></span>
3
3
  <%= render(Blacklight::System::DropdownComponent.new(
4
4
  param: :per_page,
5
5
  choices: per_page_options_for_select,
@@ -12,14 +12,14 @@
12
12
  <% end %>
13
13
 
14
14
  <% content_for(:container_header) do -%>
15
- <h1 class="sr-only top-content-title"><%= t('blacklight.search.header') %></h1>
15
+ <h1 class="sr-only visually-hidden top-content-title"><%= t('blacklight.search.header') %></h1>
16
16
 
17
17
  <%= render 'constraints' %>
18
18
  <% end %>
19
19
 
20
20
  <%= render 'search_header' %>
21
21
 
22
- <h2 class="sr-only"><%= t('blacklight.search.search_results') %></h2>
22
+ <h2 class="sr-only visually-hidden"><%= t('blacklight.search.search_results') %></h2>
23
23
 
24
24
  <%- if @response.empty? %>
25
25
  <%= render "zero_results" %>
@@ -9,7 +9,7 @@
9
9
  blacklight.clear_search_history_path,
10
10
  method: :delete,
11
11
  data: { confirm: t('blacklight.search_history.clear.action_confirm') },
12
- class: 'btn btn-danger float-md-right' %>
12
+ class: 'btn btn-danger float-md-right float-md-end' %>
13
13
  <h2 class='section-heading'><%= t('blacklight.search_history.recent') %></h2>
14
14
  <table class="table table-striped search-history">
15
15
  <% @searches.each_with_index do |search,index| %>
@@ -1,7 +1,7 @@
1
1
  <nav class="navbar navbar-expand-md navbar-dark bg-dark topbar" role="navigation">
2
2
  <div class="<%= container_classes %>">
3
3
  <%= link_to application_name, root_path, class: 'mb-0 navbar-brand navbar-logo' %>
4
- <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#user-util-collapse" aria-controls="user-util-collapse" aria-expanded="false" aria-label="Toggle navigation">
4
+ <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-bs-toggle="collapse" data-target="#user-util-collapse" data-bs-target="#user-util-collapse" aria-controls="user-util-collapse" aria-expanded="false" aria-label="Toggle navigation">
5
5
  <span class="navbar-toggler-icon"></span>
6
6
  </button>
7
7
 
@@ -157,7 +157,7 @@ ar:
157
157
  request_error: "معذرة، لم أفهم ما تبحث عنه."
158
158
  invalid_solr_id: "معذرة! لقد طلبت سجلًا غير موجود."
159
159
  per_page:
160
- label: '%{count}<span class="sr-only"> لكل صفحة</span>'
160
+ label: '%{count}<span class="sr-only visually-hidden"> لكل صفحة</span>'
161
161
  button_label: '%{count} لكل صفحة' # TODO: Remove during major release
162
162
  button_label_html: '%{count}<span class="d-none d-sm-inline"> لكل صفحة</span>'
163
163
  title: 'عدد النتائج المعروضة في الصفحة'
@@ -209,7 +209,7 @@ ar:
209
209
  count: 'ترتيب رقمي'
210
210
  index: 'ترتيب أبجدي'
211
211
  count: '%{number}'
212
- more_html: 'المزيد <span class="sr-only">%{field_name}</span> »'
212
+ more_html: 'المزيد <span class="sr-only visually-hidden">%{field_name}</span> »'
213
213
  selected:
214
214
  remove: '[إزالة]'
215
215
  missing: "[غير موجود]"
@@ -147,7 +147,7 @@ ca:
147
147
  request_error: "No ha estat possible entendre la cerca"
148
148
  invalid_solr_id: "El registre que heu sol·licitat no existeix."
149
149
  per_page:
150
- label: '%{count}<span class="sr-only"> per pàgina</span>'
150
+ label: '%{count}<span class="sr-only visually-hidden"> per pàgina</span>'
151
151
  button_label: '%{count} per pàgina' # TODO: Remove during major release
152
152
  button_label_html: '%{count}<span class="d-none d-sm-inline"> per pàgina</span>'
153
153
  title: 'Nombre de resultats a mostrar per pàgina'
@@ -189,7 +189,7 @@ ca:
189
189
  count: 'Numèricament'
190
190
  index: 'Alfabèticament'
191
191
  count: '%{number}'
192
- more_html: 'més <span class="sr-only">%{field_name}</span> »'
192
+ more_html: 'més <span class="sr-only visually-hidden">%{field_name}</span> »'
193
193
  selected:
194
194
  remove: '[eliminar]'
195
195
  missing: "[Desaparegut]"
@@ -147,7 +147,7 @@ de:
147
147
  request_error: "Entschuldigung, ich habe Ihre Suche nicht verstanden."
148
148
  invalid_solr_id: "Entschuldigung, Sie haben einen nicht vorhandenen Datensatz angefordert."
149
149
  per_page:
150
- label: '%{count}<span class="sr-only"> pro Seite</span>'
150
+ label: '%{count}<span class="sr-only visually-hidden"> pro Seite</span>'
151
151
  button_label: '%{count} pro Seite' # TODO: Remove during major release
152
152
  button_label_html: '%{count}<span class="d-none d-sm-inline"> pro Seite</span>'
153
153
  title: 'Anzahl der Ergebnisse, die pro Seite angezeigt werden'
@@ -190,7 +190,7 @@ de:
190
190
  count: 'Numerisch ordnen'
191
191
  index: 'A-Z Ordnen'
192
192
  count: '%{number}'
193
- more_html: 'mehr <span class="sr-only">%{field_name}</span> »'
193
+ more_html: 'mehr <span class="sr-only visually-hidden">%{field_name}</span> »'
194
194
  selected:
195
195
  remove: '[entfernen]'
196
196
  missing: [fehlt]
@@ -147,7 +147,7 @@ en:
147
147
  request_error: "Sorry, I don't understand your search."
148
148
  invalid_solr_id: "Sorry, you have requested a record that doesn't exist."
149
149
  per_page:
150
- label: '%{count}<span class="sr-only"> per page</span>'
150
+ label: '%{count}<span class="sr-only visually-hidden"> per page</span>'
151
151
  button_label: '%{count} per page' # TODO: Remove during major release
152
152
  button_label_html: '%{count}<span class="d-none d-sm-inline"> per page</span>'
153
153
  title: 'Number of results to display per page'
@@ -189,7 +189,7 @@ en:
189
189
  count: 'Numerical Sort'
190
190
  index: 'A-Z Sort'
191
191
  count: '%{number}'
192
- more_html: 'more <span class="sr-only">%{field_name}</span> »'
192
+ more_html: 'more <span class="sr-only visually-hidden">%{field_name}</span> »'
193
193
  selected:
194
194
  remove: '[remove]'
195
195
  missing: "[Missing]"
@@ -147,7 +147,7 @@ es:
147
147
  request_error: "Lo siento, no entiendo esta búsqueda"
148
148
  invalid_solr_id: "Lo sentimos, usted ha solicitado un registro que no existe."
149
149
  per_page:
150
- label: '%{count}<span class="sr-only"> por página</span>'
150
+ label: '%{count}<span class="sr-only visually-hidden"> por página</span>'
151
151
  button_label: '%{count} por página' # TODO: Remove during major release
152
152
  button_label_html: '%{count}<span class="d-none d-sm-inline"> por página</span>'
153
153
  title: 'El número de resultados a mostrar por página'
@@ -190,7 +190,7 @@ es:
190
190
  count: 'Ordenación numérica'
191
191
  index: 'Ordenación A-Z'
192
192
  count: '%{number}'
193
- more_html: 'más <span class="sr-only">%{field_name}</span> »'
193
+ more_html: 'más <span class="sr-only visually-hidden">%{field_name}</span> »'
194
194
  selected:
195
195
  remove: '[borrar]'
196
196
  missing: '[Falta]'
@@ -150,7 +150,7 @@ fr:
150
150
  request_error: "Pardon, nous n'avons pas compris votre recherche."
151
151
  invalid_solr_id: "Vous avez demandé une notice qui n'existe pas."
152
152
  per_page:
153
- label: '%{count}<span class="sr-only"> par page</span>'
153
+ label: '%{count}<span class="sr-only visually-hidden"> par page</span>'
154
154
  button_label: '%{count} par page' # TODO: Remove during major release
155
155
  button_label_html: '%{count}<span class="d-none d-sm-inline"> par page</span>'
156
156
  title: 'Nombre de résultats à afficher par page'
@@ -193,7 +193,7 @@ fr:
193
193
  count: 'Du + au - fréquent'
194
194
  index: 'Tri de A à Z'
195
195
  count: '%{number}'
196
- more_html: 'plus <span class="sr-only">%{field_name}</span> »'
196
+ more_html: 'plus <span class="sr-only visually-hidden">%{field_name}</span> »'
197
197
  selected:
198
198
  remove: '[ X ]'
199
199
  missing: '[manquante]'
@@ -147,7 +147,7 @@ hu:
147
147
  request_error: "Elnézést, nem tudom értelmezni a keresést."
148
148
  invalid_solr_id: "Elnézést, de az Ön által kért rekord nem létezik."
149
149
  per_page:
150
- label: '%{count}<span class="sr-only"> oldalanként</span>'
150
+ label: '%{count}<span class="sr-only visually-hidden"> oldalanként</span>'
151
151
  button_label: '%{count} oldalanként' # TODO: Remove during major release
152
152
  button_label_html: '%{count}<span class="d-none d-sm-inline"> oldalanként</span>'
153
153
  title: 'Az eredmények száma oldalanként'
@@ -190,7 +190,7 @@ hu:
190
190
  count: 'Numerikus rendezés'
191
191
  index: 'A-Z rendezés'
192
192
  count: '%{number}'
193
- more_html: 'több <span class="sr-only">%{field_name}</span> »'
193
+ more_html: 'több <span class="sr-only visually-hidden">%{field_name}</span> »'
194
194
  selected:
195
195
  remove: '[eltávolítás]'
196
196
  missing: "[Hiányzó]"
@@ -147,7 +147,7 @@ it:
147
147
  request_error: "La richiesta non è comprensibile."
148
148
  invalid_solr_id: "Il numero di scheda richiesto non esiste."
149
149
  per_page:
150
- label: '%{count}<span class="sr-only"> per pagina</span>'
150
+ label: '%{count}<span class="sr-only visually-hidden"> per pagina</span>'
151
151
  button_label: '%{count} per pagina' # TODO: Remove during major release
152
152
  button_label_html: '%{count}<span class="d-none d-sm-inline"> per pagina</span>'
153
153
  title: 'Risultati per pagina'
@@ -190,7 +190,7 @@ it:
190
190
  count: 'Ordina per numero'
191
191
  index: 'Ordina A-Z'
192
192
  count: '%{number}'
193
- more_html: 'altri <span class="sr-only">%{field_name}</span> »'
193
+ more_html: 'altri <span class="sr-only visually-hidden">%{field_name}</span> »'
194
194
  selected:
195
195
  remove: '[cancella]'
196
196
  missing: [Mancante]
@@ -147,7 +147,7 @@ nl:
147
147
  request_error: "Sorry, ik kon uw zoekopdracht niet begrijpen."
148
148
  invalid_solr_id: "Sorry, u vroeg een onbestaande record op."
149
149
  per_page:
150
- label: '%{count}<span class="sr-only"> per pagina</span>'
150
+ label: '%{count}<span class="sr-only visually-hidden"> per pagina</span>'
151
151
  button_label: '%{count} per pagina' # TODO: Remove during major release
152
152
  button_label_html: '%{count}<span class="d-none d-sm-inline"> per pagina</span>'
153
153
  title: 'Toon aantal zoekresultaten per pagina'
@@ -190,7 +190,7 @@ nl:
190
190
  count: 'Numeriek sorteren'
191
191
  index: 'A-Z Sorteren'
192
192
  count: '%{number}'
193
- more_html: 'Meer <span class="sr-only">%{field_name}</span> »'
193
+ more_html: 'Meer <span class="sr-only visually-hidden">%{field_name}</span> »'
194
194
  selected:
195
195
  remove: '[verwijder]'
196
196
  missing: "[Ontbrekend]"
@@ -191,7 +191,7 @@ pt-BR:
191
191
  count: 'Ordenar por Número'
192
192
  index: 'Ordem Alfabética A-Z'
193
193
  count: '%{number}'
194
- more_html: 'mais <span class="sr-only">%{field_name}</span> »'
194
+ more_html: 'mais <span class="sr-only visually-hidden">%{field_name}</span> »'
195
195
  selected:
196
196
  remove: '[remover]'
197
197
  missing: [Ausência]
@@ -147,7 +147,7 @@ sq:
147
147
  request_error: "Na vjen keq, unë nuk e kuptoj kërkimin tuaj."
148
148
  invalid_solr_id: "Na vjen keq, ju keni kërkuar një të dhënë që nuk ekziston."
149
149
  per_page:
150
- label: '%{count}<span class="sr-only"> për faqe</span>'
150
+ label: '%{count}<span class="sr-only visually-hidden"> për faqe</span>'
151
151
  button_label: '%{count} për faqe' # TODO: Remove during major release
152
152
  button_label_html: '%{count}<span class="d-none d-sm-inline"> për faqe</span>'
153
153
  title: 'Numri i rezultateve që do të shfaqen për faqe'
@@ -190,7 +190,7 @@ sq:
190
190
  count: 'Renditja numerike'
191
191
  index: 'A-Z Renditja'
192
192
  count: '%{number}'
193
- more_html: 'Më shumë <span class="sr-only">%{field_name}</span> »'
193
+ more_html: 'Më shumë <span class="sr-only visually-hidden">%{field_name}</span> »'
194
194
  selected:
195
195
  remove: '[fshije]'
196
196
  missing: "[Mungon]"
@@ -147,7 +147,7 @@ zh:
147
147
  request_error: "抱歉,我不明白你要找什么。"
148
148
  invalid_solr_id: "抱歉,你要找的结果不存在。"
149
149
  per_page:
150
- label: '%{count}<span class="sr-only"> 每页</span>'
150
+ label: '%{count}<span class="sr-only visually-hidden"> 每页</span>'
151
151
  button_label: '%{count} 每页' # TODO: Remove during major release
152
152
  button_label_html: '%{count}<span class="d-none d-sm-inline"> 每页</span>'
153
153
  title: '每页显示结果数'
@@ -190,7 +190,7 @@ zh:
190
190
  count: '按数量排序'
191
191
  index: '按字母排序'
192
192
  count: '%{number}'
193
- more_html: '更多 <span class="sr-only">%{field_name}</span> »'
193
+ more_html: '更多 <span class="sr-only visually-hidden">%{field_name}</span> »'
194
194
  selected:
195
195
  remove: '[删除]'
196
196
  missing: "[未找到]"
@@ -2,7 +2,10 @@
2
2
  class Blacklight::Solr::InvalidParameter < ArgumentError; end
3
3
 
4
4
  class Blacklight::Solr::Request < ActiveSupport::HashWithIndifferentAccess
5
+ # @deprecated
5
6
  SINGULAR_KEYS = %w(facet fl q qt rows start spellcheck spellcheck.q sort per_page wt hl group defType)
7
+
8
+ # @deprecated
6
9
  ARRAY_KEYS = %w(facet.field facet.query facet.pivot fq hl.fl)
7
10
 
8
11
  def initialize(constructor = {})
@@ -12,9 +15,6 @@ class Blacklight::Solr::Request < ActiveSupport::HashWithIndifferentAccess
12
15
  else
13
16
  super(constructor)
14
17
  end
15
- ARRAY_KEYS.each do |key|
16
- self[key] ||= []
17
- end
18
18
  end
19
19
 
20
20
  def append_query(query)
@@ -49,26 +49,29 @@ class Blacklight::Solr::Request < ActiveSupport::HashWithIndifferentAccess
49
49
  end
50
50
 
51
51
  def append_filter_query(query)
52
+ self['fq'] ||= []
53
+ self['fq'] = Array(self['fq']) if self['fq'].is_a? String
54
+
52
55
  self['fq'] << query
53
56
  end
54
57
 
55
58
  def append_facet_fields(values)
59
+ self['facet.field'] ||= []
56
60
  self['facet.field'] += Array(values)
57
61
  end
58
62
 
59
63
  def append_facet_query(values)
64
+ self['facet.query'] ||= []
60
65
  self['facet.query'] += Array(values)
61
66
  end
62
67
 
63
68
  def append_facet_pivot(query)
69
+ self['facet.pivot'] ||= []
64
70
  self['facet.pivot'] << query
65
71
  end
66
72
 
67
73
  def append_highlight_field(query)
74
+ self['hl.fl'] ||= []
68
75
  self['hl.fl'] << query
69
76
  end
70
-
71
- def to_hash
72
- reject { |key, value| ARRAY_KEYS.include?(key) && value.blank? }
73
- end
74
77
  end
@@ -5,7 +5,8 @@ module Blacklight::Solr
5
5
 
6
6
  included do
7
7
  self.default_processor_chain = [
8
- :default_solr_parameters, :add_query_to_solr, :add_facet_fq_to_solr,
8
+ :default_solr_parameters, :add_search_field_default_parameters,
9
+ :add_query_to_solr, :add_facet_fq_to_solr,
9
10
  :add_facetting_to_solr, :add_solr_fields_to_query, :add_paging_to_solr,
10
11
  :add_sorting_to_solr, :add_group_config_to_solr,
11
12
  :add_facet_paging_to_solr, :add_adv_search_clauses,
@@ -18,22 +19,17 @@ module Blacklight::Solr
18
19
  # merge to dup values, to avoid later mutating the original by mistake.
19
20
  def default_solr_parameters(solr_parameters)
20
21
  blacklight_config.default_solr_params.each do |key, value|
21
- solr_parameters[key] = if value.respond_to? :deep_dup
22
- value.deep_dup
23
- elsif value.respond_to?(:dup) && value.duplicable?
24
- value.dup
25
- else
26
- value
27
- end
22
+ solr_parameters[key] ||= if value.respond_to? :deep_dup
23
+ value.deep_dup
24
+ elsif value.respond_to?(:dup) && value.duplicable?
25
+ value.dup
26
+ else
27
+ value
28
+ end
28
29
  end
29
30
  end
30
31
 
31
- ##
32
- # Take the user-entered query, and put it in the solr params,
33
- # including config's "search field" params for current search field.
34
- # also include setting spellcheck.q.
35
- # rubocop:disable Metrics/CyclomaticComplexity
36
- def add_query_to_solr(solr_parameters)
32
+ def add_search_field_default_parameters(solr_parameters)
37
33
  ###
38
34
  # legacy behavior of user param :qt is passed through, but over-ridden
39
35
  # by actual search field config if present. We might want to remove
@@ -47,10 +43,21 @@ module Blacklight::Solr
47
43
  ###
48
44
  # Merge in search field configured values, if present, over-writing general
49
45
  # defaults
50
-
51
46
  if search_field
52
47
  solr_parameters[:qt] = search_field.qt if search_field.qt
53
- solr_parameters.merge!(search_field.solr_parameters) if search_field.solr_parameters
48
+
49
+ solr_parameters.deep_merge!(search_field.solr_parameters) if search_field.solr_parameters
50
+ end
51
+ end
52
+
53
+ ##
54
+ # Take the user-entered query, and put it in the solr params,
55
+ # including config's "search field" params for current search field.
56
+ # also include setting spellcheck.q.
57
+ def add_query_to_solr(solr_parameters)
58
+ unless processor_chain.include?(:add_search_field_default_parameters)
59
+ Deprecation.warn(Blacklight::Solr::SearchBuilderBehavior, 'Please include :add_search_field_default_parameters in your process chain')
60
+ add_search_field_default_parameters(solr_parameters)
54
61
  end
55
62
 
56
63
  ##
@@ -73,7 +80,6 @@ module Blacklight::Solr
73
80
  solr_parameters.append_query search_state.query_param
74
81
  end
75
82
  end
76
- # rubocop:enable Metrics/CyclomaticComplexity
77
83
 
78
84
  def add_additional_filters(solr_parameters, additional_filters = nil)
79
85
  q = additional_filters || @additional_filters
@@ -39,7 +39,7 @@ RSpec.describe Blacklight::ConstraintLayoutComponent, type: :component do
39
39
 
40
40
  it "has an accessible remove label" do
41
41
  expect(rendered).to have_selector(".remove") do |s|
42
- expect(s).to have_selector('.sr-only', text: 'Remove constraint my label: my value')
42
+ expect(s).to have_selector('.visually-hidden', text: 'Remove constraint my label: my value')
43
43
  end
44
44
  end
45
45
  end
@@ -40,7 +40,7 @@ RSpec.describe Blacklight::FacetFieldCheckboxesComponent, type: :component do
40
40
  it 'renders a collapsible card' do
41
41
  expect(rendered).to have_selector '.card'
42
42
  expect(rendered).to have_button 'Field'
43
- expect(rendered).to have_selector 'button[data-target="#facet-field"]'
43
+ expect(rendered).to have_selector 'button[data-bs-target="#facet-field"]'
44
44
  expect(rendered).to have_selector '#facet-field.collapse.show'
45
45
  end
46
46
 
@@ -35,7 +35,7 @@ RSpec.describe Blacklight::FacetFieldListComponent, type: :component do
35
35
  it 'renders a collapsible card' do
36
36
  expect(rendered).to have_selector '.card'
37
37
  expect(rendered).to have_button 'Field'
38
- expect(rendered).to have_selector 'button[data-target="#facet-field"]'
38
+ expect(rendered).to have_selector 'button[data-bs-target="#facet-field"]'
39
39
  expect(rendered).to have_selector '#facet-field.collapse.show'
40
40
  end
41
41
 
@@ -84,13 +84,13 @@ RSpec.describe "Facets" do
84
84
  pending 'Capybara::NotSupportedByDriverError: Capybara::Driver::Base#evaluate_script'
85
85
  visit root_path
86
86
  page.find('h3.facet-field-heading button', text: 'Format').click
87
- focused_element_data_target = page.evaluate_script("document.activeElement")['data-target']
87
+ focused_element_data_target = page.evaluate_script("document.activeElement")['data-bs-target']
88
88
  expect(focused_element_data_target).to eq '#facet-format'
89
89
  end
90
90
  end
91
91
 
92
92
  describe '"More" links' do
93
- it 'has default more link with sr-only text' do
93
+ it 'has default more link with visually-hidden text' do
94
94
  visit root_path
95
95
  within '#facet-language_ssim' do
96
96
  expect(page).to have_css 'div.more_facets', text: 'more Language'
@@ -194,9 +194,9 @@ RSpec.describe Blacklight::ConfigurationHelperBehavior do
194
194
  describe "#per_page_options_for_select" do
195
195
  it "is the per-page values formatted as options_for_select" do
196
196
  allow(helper).to receive_messages(blacklight_config: double(per_page: [11, 22, 33]))
197
- expect(helper.per_page_options_for_select).to include ["11<span class=\"sr-only\"> per page</span>", 11]
198
- expect(helper.per_page_options_for_select).to include ["22<span class=\"sr-only\"> per page</span>", 22]
199
- expect(helper.per_page_options_for_select).to include ["33<span class=\"sr-only\"> per page</span>", 33]
197
+ expect(helper.per_page_options_for_select).to include ["11<span class=\"sr-only visually-hidden\"> per page</span>", 11]
198
+ expect(helper.per_page_options_for_select).to include ["22<span class=\"sr-only visually-hidden\"> per page</span>", 22]
199
+ expect(helper.per_page_options_for_select).to include ["33<span class=\"sr-only visually-hidden\"> per page</span>", 33]
200
200
  end
201
201
  end
202
202
 
@@ -16,7 +16,6 @@ RSpec.describe Blacklight::Solr::Request, api: true do
16
16
  subject['spellcheck'] = "a"
17
17
  subject['spellcheck.q'] = "fleece"
18
18
  subject['f.title_facet.facet.limit'] = "vest"
19
- subject['facet.field'] = []
20
19
  end
21
20
 
22
21
  it "accepts valid parameters" do
@@ -29,6 +29,20 @@ RSpec.describe Blacklight::Solr::SearchBuilderBehavior, api: true do
29
29
  end
30
30
  end
31
31
 
32
+ context 'with merged parameters from the defaults + the search field' do
33
+ before do
34
+ blacklight_config.default_solr_params = { json: { whatever: [1, 2, 3] } }
35
+ blacklight_config.search_fields['all_fields'].solr_parameters = { json: { and_also: [4, 5, 6] } }
36
+ end
37
+
38
+ let(:user_params) { { search_field: 'all_fields' } }
39
+
40
+ it 'deep merges hash values' do
41
+ expect(subject.to_hash.dig(:json, :whatever)).to eq [1, 2, 3]
42
+ expect(subject.to_hash.dig(:json, :and_also)).to eq [4, 5, 6]
43
+ end
44
+ end
45
+
32
46
  context "with a complex parameter environment" do
33
47
  subject { search_builder.with(user_params).processed_parameters }
34
48
 
@@ -304,7 +318,6 @@ RSpec.describe Blacklight::Solr::SearchBuilderBehavior, api: true do
304
318
 
305
319
  it "does not include weird keys not in field definition" do
306
320
  expect(subject[:phrase_filters]).to be_nil
307
- expect(subject[:fq]).to eq []
308
321
  expect(subject[:commit]).to be_nil
309
322
  expect(subject[:action]).to be_nil
310
323
  expect(subject[:controller]).to be_nil
@@ -27,14 +27,14 @@ RSpec.describe "catalog/facet_layout" do
27
27
 
28
28
  it "is collapsable" do
29
29
  render partial: 'catalog/facet_layout', locals: { facet_field: facet_field }
30
- expect(rendered).to have_selector 'button.collapsed[data-toggle="collapse"][aria-expanded="false"]'
30
+ expect(rendered).to have_selector 'button.collapsed[data-toggle="collapse"][data-bs-toggle="collapse"][aria-expanded="false"]'
31
31
  expect(rendered).to have_selector '.collapse .card-body'
32
32
  end
33
33
 
34
34
  it "is configured to be open by default" do
35
35
  allow(facet_field).to receive_messages(collapse: false)
36
36
  render partial: 'catalog/facet_layout', locals: { facet_field: facet_field }
37
- expect(rendered).to have_selector 'button[data-toggle="collapse"][aria-expanded="true"]'
37
+ expect(rendered).to have_selector 'button[data-toggle="collapse"][data-bs-toggle="collapse"][aria-expanded="true"]'
38
38
  expect(rendered).not_to have_selector '.card-header.collapsed'
39
39
  expect(rendered).to have_selector '.collapse.show .card-body'
40
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.19.0
4
+ version: 7.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -17,7 +17,7 @@ authors:
17
17
  autorequire:
18
18
  bindir: exe
19
19
  cert_chain: []
20
- date: 2021-05-01 00:00:00.000000000 Z
20
+ date: 2021-05-11 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails