blacklight-spotlight 4.4.0 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) 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 +3 -11
  9. data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +4 -2
  10. data/app/components/spotlight/bulk_action_component.html.erb +8 -0
  11. data/app/components/spotlight/bulk_action_component.rb +20 -0
  12. data/app/components/spotlight/header_navigation_link_component.html.erb +1 -0
  13. data/app/components/spotlight/header_navigation_link_component.rb +14 -0
  14. data/app/components/spotlight/save_search_component.html.erb +25 -0
  15. data/app/components/spotlight/save_search_component.rb +25 -0
  16. data/app/components/spotlight/translations/subheading_component.html.erb +3 -0
  17. data/app/components/spotlight/translations/subheading_component.rb +17 -0
  18. data/app/controllers/spotlight/accessibility_controller.rb +3 -8
  19. data/app/helpers/spotlight/application_helper.rb +6 -7
  20. data/app/helpers/spotlight/main_app_helpers.rb +1 -1
  21. data/app/javascript/spotlight/admin/blacklight_configuration.js +18 -21
  22. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +2 -2
  23. data/app/models/spotlight/blacklight_configuration.rb +2 -1
  24. data/app/models/spotlight/page_configurations.rb +2 -1
  25. data/app/views/catalog/_bulk_actions.html.erb +1 -10
  26. data/app/views/catalog/_save_search.html.erb +1 -25
  27. data/app/views/layouts/spotlight/base.html.erb +1 -1
  28. data/app/views/shared/_about_navbar.html.erb +1 -1
  29. data/app/views/shared/_browse_navbar.html.erb +1 -1
  30. data/app/views/shared/_curated_features_navbar.html.erb +4 -1
  31. data/app/views/shared/_masthead.html.erb +1 -1
  32. data/app/views/spotlight/accessibility/alt_text.html.erb +1 -7
  33. data/app/views/spotlight/admin_users/index.html.erb +2 -2
  34. data/app/views/spotlight/bulk_updates/_upload.html.erb +1 -1
  35. data/app/views/spotlight/custom_fields/form_group/_text.html.erb +1 -1
  36. data/app/views/spotlight/custom_fields/form_group/_vocab.html.erb +1 -1
  37. data/app/views/spotlight/feature_pages/_header.html.erb +2 -2
  38. data/app/views/spotlight/metadata_configurations/_metadata_field.html.erb +7 -0
  39. data/app/views/spotlight/metadata_configurations/edit.html.erb +13 -2
  40. data/app/views/spotlight/shared/_honeypot_field.html.erb +2 -2
  41. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -1
  42. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +1 -1
  43. data/app/views/spotlight/sir_trevor/blocks/_featured_pages_block.html.erb +1 -1
  44. data/app/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb +1 -1
  45. data/app/views/spotlight/translations/_general.html.erb +2 -6
  46. data/app/views/spotlight/translations/_import.html.erb +1 -1
  47. data/app/views/spotlight/translations/_metadata.html.erb +1 -3
  48. data/app/views/spotlight/translations/_pages.html.erb +4 -9
  49. data/app/views/spotlight/translations/_search_fields.html.erb +3 -9
  50. data/config/locales/spotlight.en.yml +5 -1
  51. data/lib/generators/spotlight/templates/spotlight.scss +0 -1
  52. data/lib/spotlight/engine.rb +7 -0
  53. data/lib/spotlight/version.rb +1 -1
  54. metadata +10 -3
  55. 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: 7b824d393d7e458b70cd977fb7bcf44ebb8a01a42149fafc864279494643da83
4
- data.tar.gz: 252004c2bd545f5a02a2ef89e2fc413714a1aabcba17cf36326b7d28367d5f9a
3
+ metadata.gz: cf4c6e80e6610969a1f0c37a27cb1c3e67ada96d4e22b63ef92a84a32d1e4946
4
+ data.tar.gz: e03d10a0a4db7fcdab708987cf5be0a50966ed831ece6037a9d3eb8b5fddb022
5
5
  SHA512:
6
- metadata.gz: c8c4d7c05b5acb51e72e700ef80b18b176234a3f6a8e1f98ff298374da5776c3da8034fdfc4fb800bb3fae2a9657247abf874a8f6f342f539ad690e55d154fe1
7
- data.tar.gz: 1ed0b3c2e3518b50aeedc6ab2cf3bf6d19257453722abadedb34565fbcbb8f982b30231042e78db462658f9065ffa33f6df4e53b6bc3698786a95940e47626bc
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()}