blacklight-spotlight 4.5.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/spotlight/blocks/sir-trevor-icons.svg +1 -1
  3. data/app/assets/javascripts/spotlight/spotlight.esm.js +19 -22
  4. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  5. data/app/assets/javascripts/spotlight/spotlight.js +19 -22
  6. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  7. data/app/assets/stylesheets/spotlight/_blacklight_configuration.scss +5 -4
  8. data/app/components/spotlight/bulk_action_component.html.erb +8 -0
  9. data/app/components/spotlight/bulk_action_component.rb +20 -0
  10. data/app/components/spotlight/header_navigation_link_component.html.erb +1 -0
  11. data/app/components/spotlight/header_navigation_link_component.rb +14 -0
  12. data/app/components/spotlight/save_search_component.html.erb +25 -0
  13. data/app/components/spotlight/save_search_component.rb +25 -0
  14. data/app/components/spotlight/translations/subheading_component.html.erb +3 -0
  15. data/app/components/spotlight/translations/subheading_component.rb +17 -0
  16. data/app/controllers/spotlight/accessibility_controller.rb +1 -3
  17. data/app/helpers/spotlight/application_helper.rb +6 -7
  18. data/app/helpers/spotlight/main_app_helpers.rb +1 -1
  19. data/app/javascript/spotlight/admin/blacklight_configuration.js +18 -21
  20. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +2 -2
  21. data/app/models/spotlight/page_configurations.rb +2 -1
  22. data/app/views/catalog/_bulk_actions.html.erb +1 -10
  23. data/app/views/catalog/_save_search.html.erb +1 -25
  24. data/app/views/shared/_about_navbar.html.erb +1 -1
  25. data/app/views/shared/_browse_navbar.html.erb +1 -1
  26. data/app/views/shared/_curated_features_navbar.html.erb +4 -1
  27. data/app/views/spotlight/accessibility/alt_text.html.erb +1 -7
  28. data/app/views/spotlight/admin_users/index.html.erb +2 -2
  29. data/app/views/spotlight/metadata_configurations/edit.html.erb +12 -2
  30. data/app/views/spotlight/translations/_general.html.erb +2 -6
  31. data/app/views/spotlight/translations/_metadata.html.erb +1 -3
  32. data/app/views/spotlight/translations/_pages.html.erb +4 -9
  33. data/app/views/spotlight/translations/_search_fields.html.erb +3 -9
  34. data/config/locales/spotlight.en.yml +1 -1
  35. data/lib/generators/spotlight/templates/spotlight.scss +0 -1
  36. data/lib/spotlight/engine.rb +7 -0
  37. data/lib/spotlight/version.rb +1 -1
  38. metadata +10 -3
  39. data/app/assets/stylesheets/spotlight/_variables_bootstrap.scss +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e81518a3e626b78dc9b2c1e12f76deffb597018f8346e646068ae5533a9088fd
4
- data.tar.gz: 713b5118b8d18e0a611927af250597c855a18607224851b21fd69b4620d259dc
3
+ metadata.gz: cf4c6e80e6610969a1f0c37a27cb1c3e67ada96d4e22b63ef92a84a32d1e4946
4
+ data.tar.gz: e03d10a0a4db7fcdab708987cf5be0a50966ed831ece6037a9d3eb8b5fddb022
5
5
  SHA512:
6
- metadata.gz: c28398ba6f1b73939288ea0e3320259581ae0ff06903499d1120c9518c0506e2274f4d7c15d9c0e9d9ed0cf3c6fdd1f8ed31dd3cc93e2401324940215be3235b
7
- data.tar.gz: 1017fd63630a575d362cd6b675df840477d5eb3fefc706372283b1499c77952632a48582379162dde287eb360aff5c84c4ffeaaf95ec7fd545b659dbfdfcf61a
6
+ metadata.gz: a00ff7e056f1839c65c4656b636c5c29fccf1d293ff8d14ba2fc383d5485d12e08f0bf54c57a35d8100533180e61c68df01cce5e2a4461cf6124e98a47b6f566
7
+ data.tar.gz: 192e740e4f9fc8d6d08ff5119ecb174789f2f974f07f520b2077f86d4be4af402167b8a82634372f412e3732f16feb87f9b34716017c4cb0c9e6ae725781f633
@@ -34,7 +34,7 @@
34
34
  </symbol>
35
35
  <symbol id="fmt-heading" viewBox="0 0 1024 1024">
36
36
  <title>fmt-heading</title>
37
- <path class="path1" d="M566.9 737.28h-105.943v-216.343h-198.514v216.343h-106.286v-501.257h106.286v196.457h198.514v-196.457h105.943v501.257zM847.871 737.28h-79.457v-217.543l0.771-35.743 1.286-39.086c-13.2 13.2-22.371 21.857-27.514 25.971l-43.2 34.714-38.314-47.829 121.114-96.429h65.314v375.943z"></path>
37
+ <path class="path1" d="M760 737.28h-105.943v-216.343h-198.514v216.343h-106.286v-501.257h106.286v196.457h198.514v-196.457h105.943v501.257zM847.871"></path>
38
38
  </symbol>
39
39
  <symbol id="fmt-quote2" viewBox="0 0 1024 1024">
40
40
  <title>fmt-quote2</title>
@@ -4052,54 +4052,51 @@ class AddNewButton {
4052
4052
 
4053
4053
  class BlacklightConfiguration {
4054
4054
  connect() {
4055
- // Add Select/Deselect all button behavior
4055
+ // Add Select/Deselect all input behavior
4056
4056
  this.addCheckboxToggleBehavior();
4057
4057
  this.addEnableToggleBehavior();
4058
4058
  }
4059
4059
 
4060
- // Add Select/Deselect all button behavior
4060
+ // Add Select/Deselect all behavior for metadata field names for a given view e.g. Item details.
4061
4061
  addCheckboxToggleBehavior() {
4062
4062
  $("[data-behavior='metadata-select']").each(function(){
4063
- var button = $(this);
4064
- var parentCell = button.parents("th");
4063
+ var selectCheckbox = $(this);
4064
+ var parentCell = selectCheckbox.parents("th");
4065
4065
  var table = parentCell.closest("table");
4066
4066
  var columnRows = $("tr td:nth-child(" + (parentCell.index() + 1) + ")", table);
4067
4067
  var checkboxes = $("input[type='checkbox']", columnRows);
4068
- swapSelectAllButtonText(button, columnRows);
4069
- // Add the check/uncheck behavior to the button
4070
- // and swap the button text if necessary
4071
- button.on('click', function(e){
4072
- e.preventDefault();
4068
+ updateSelectAllInput(selectCheckbox, columnRows);
4069
+ // Add the check/uncheck behavior to the select/deselect all checkbox
4070
+ selectCheckbox.on('click', function(e){
4073
4071
  var allChecked = allCheckboxesChecked(columnRows);
4074
4072
  columnRows.each(function(){
4075
4073
  $("input[type='checkbox']", $(this)).prop('checked', !allChecked);
4076
- swapSelectAllButtonText(button, columnRows);
4077
4074
  });
4078
4075
  });
4079
- // Swap button text when a checkbox value changes
4076
+ // When a single checkbox is selected/unselected, the "All" checkbox should be updated accordingly.
4080
4077
  checkboxes.each(function(){
4081
4078
  $(this).on('change', function(){
4082
- swapSelectAllButtonText(button, columnRows);
4079
+ updateSelectAllInput(selectCheckbox, columnRows);
4083
4080
  });
4084
- });
4081
+ });
4085
4082
  });
4083
+
4086
4084
  // Check number of checkboxes against the number of checked
4087
4085
  // checkboxes to determine if all of them are checked or not
4088
4086
  function allCheckboxesChecked(elements) {
4089
4087
  return ($("input[type='checkbox']", elements).length == $("input[type='checkbox']:checked", elements).length)
4090
4088
  }
4091
- // Swap the button text to "Deselect all"
4092
- // when all the checkboxes are checked and
4093
- // "Select all" when any are unchecked
4094
- function swapSelectAllButtonText(button, elements) {
4089
+
4090
+ // Check or uncheck the "All" checkbox for each view column, e.g. Item details, List, etc.
4091
+ function updateSelectAllInput(checkbox, elements) {
4095
4092
  if ( allCheckboxesChecked(elements) ) {
4096
- button.text(button.data('deselect-text'));
4093
+ checkbox.prop('checked', true);
4097
4094
  } else {
4098
- button.text(button.data('select-text'));
4095
+ checkbox.prop('checked', false);
4099
4096
  }
4100
4097
  }
4101
4098
  }
4102
-
4099
+
4103
4100
  addEnableToggleBehavior() {
4104
4101
  $("[data-behavior='enable-feature']").each(function(){
4105
4102
  var checkbox = $(this);
@@ -6972,8 +6969,8 @@ SirTrevor.Blocks.UploadedItems = (function(){
6972
6969
  </div>
6973
6970
  <div class="col-md-4">
6974
6971
  <input name="${this.zpr_key}" type="hidden" value="false" />
6975
- <input name="${this.zpr_key}" id="${this.formId(this.zpr_key)}" data-key=${this.zpr_key}" type="checkbox" value="true" />
6976
- <label for="${this.formId(this.zpr_key)}">${ i18n.t("blocks:solr_documents:zpr:title")}</label>
6972
+ <input name="${this.zpr_key}" id="${this.formId(this.zpr_key)}" data-key="${this.zpr_key}" type="checkbox" value="true" />
6973
+ <label for="${this.formId(this.zpr_key)}">${i18n.t("blocks:solr_documents:zpr:title")}</label>
6977
6974
  </div>
6978
6975
  </div>
6979
6976
  ${this.text_area()}