blacklight-spotlight 4.5.0 → 4.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) 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/assets/stylesheets/spotlight/_browse.scss +27 -12
  9. data/app/components/spotlight/bulk_action_component.html.erb +8 -0
  10. data/app/components/spotlight/bulk_action_component.rb +20 -0
  11. data/app/components/spotlight/header_navigation_link_component.html.erb +1 -0
  12. data/app/components/spotlight/header_navigation_link_component.rb +14 -0
  13. data/app/components/spotlight/save_search_component.html.erb +25 -0
  14. data/app/components/spotlight/save_search_component.rb +25 -0
  15. data/app/components/spotlight/translations/subheading_component.html.erb +3 -0
  16. data/app/components/spotlight/translations/subheading_component.rb +17 -0
  17. data/app/controllers/spotlight/accessibility_controller.rb +1 -3
  18. data/app/helpers/spotlight/application_helper.rb +6 -7
  19. data/app/helpers/spotlight/main_app_helpers.rb +1 -1
  20. data/app/javascript/spotlight/admin/blacklight_configuration.js +18 -21
  21. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +2 -2
  22. data/app/models/spotlight/page_configurations.rb +2 -1
  23. data/app/views/catalog/_bulk_actions.html.erb +1 -10
  24. data/app/views/catalog/_save_search.html.erb +1 -25
  25. data/app/views/shared/_about_navbar.html.erb +1 -1
  26. data/app/views/shared/_browse_navbar.html.erb +1 -1
  27. data/app/views/shared/_curated_features_navbar.html.erb +4 -1
  28. data/app/views/spotlight/accessibility/alt_text.html.erb +1 -7
  29. data/app/views/spotlight/admin_users/index.html.erb +2 -2
  30. data/app/views/spotlight/metadata_configurations/edit.html.erb +12 -2
  31. data/app/views/spotlight/translations/_general.html.erb +2 -6
  32. data/app/views/spotlight/translations/_metadata.html.erb +1 -3
  33. data/app/views/spotlight/translations/_pages.html.erb +4 -9
  34. data/app/views/spotlight/translations/_search_fields.html.erb +3 -9
  35. data/config/locales/spotlight.en.yml +1 -1
  36. data/lib/generators/spotlight/templates/spotlight.scss +0 -1
  37. data/lib/spotlight/engine.rb +7 -0
  38. data/lib/spotlight/version.rb +1 -1
  39. metadata +10 -3
  40. 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: c1c1e34d4e9beb99a5032c7361b9fb355f461b4cd7a532f6aea0c25730858753
4
+ data.tar.gz: 5f6879362e353cd851f04653aec67ad93b35d5b799f7a3d48e81f07eb4c53e62
5
5
  SHA512:
6
- metadata.gz: c28398ba6f1b73939288ea0e3320259581ae0ff06903499d1120c9518c0506e2274f4d7c15d9c0e9d9ed0cf3c6fdd1f8ed31dd3cc93e2401324940215be3235b
7
- data.tar.gz: 1017fd63630a575d362cd6b675df840477d5eb3fefc706372283b1499c77952632a48582379162dde287eb360aff5c84c4ffeaaf95ec7fd545b659dbfdfcf61a
6
+ metadata.gz: 909f10a67ab1e3144bb2a43fc2590bbaf9ad7a5e9f0134f178b88bbc8674796acb1f868511f167f1e916985633aee927b274e3f0b5d479cd87ba41fbe15709b7
7
+ data.tar.gz: f5bc2b2ba5addad2ccbc01881e3e5b2bd5240fe96a82fc7fc742f94b5bda6132044f7b400cc132276173c0cc86e798741ba97156d0e5179bcb8e8338e9356ba0
@@ -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()}