blacklight-spotlight 4.1.2 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/app/assets/javascripts/spotlight/spotlight.esm.js +146 -27
  4. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  5. data/app/assets/javascripts/spotlight/spotlight.js +146 -27
  6. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  7. data/app/assets/stylesheets/spotlight/_blacklight_configuration.scss +19 -1
  8. data/app/components/spotlight/breadcrumbs_component.html.erb +19 -0
  9. data/app/components/spotlight/breadcrumbs_component.rb +23 -0
  10. data/app/components/spotlight/exhibit_navbar_component.html.erb +25 -0
  11. data/app/components/spotlight/exhibit_navbar_component.rb +12 -0
  12. data/app/components/spotlight/tag_list_form_component.html.erb +14 -0
  13. data/app/components/spotlight/tag_list_form_component.rb +13 -0
  14. data/app/controllers/concerns/spotlight/controller.rb +9 -1
  15. data/app/controllers/concerns/spotlight/search_helper.rb +2 -2
  16. data/app/controllers/spotlight/about_pages_controller.rb +1 -1
  17. data/app/controllers/spotlight/admin_users_controller.rb +2 -2
  18. data/app/controllers/spotlight/appearances_controller.rb +4 -4
  19. data/app/controllers/spotlight/browse_controller.rb +2 -2
  20. data/app/controllers/spotlight/bulk_actions_controller.rb +1 -1
  21. data/app/controllers/spotlight/bulk_updates_controller.rb +7 -2
  22. data/app/controllers/spotlight/catalog_controller.rb +11 -10
  23. data/app/controllers/spotlight/contacts_controller.rb +5 -5
  24. data/app/controllers/spotlight/custom_fields_controller.rb +5 -5
  25. data/app/controllers/spotlight/custom_search_fields_controller.rb +5 -5
  26. data/app/controllers/spotlight/dashboards_controller.rb +4 -4
  27. data/app/controllers/spotlight/exhibits_controller.rb +6 -5
  28. data/app/controllers/spotlight/feature_pages_controller.rb +5 -5
  29. data/app/controllers/spotlight/featured_images_controller.rb +1 -1
  30. data/app/controllers/spotlight/groups_controller.rb +1 -1
  31. data/app/controllers/spotlight/home_pages_controller.rb +2 -2
  32. data/app/controllers/spotlight/job_trackers_controller.rb +3 -3
  33. data/app/controllers/spotlight/metadata_configurations_controller.rb +3 -3
  34. data/app/controllers/spotlight/pages_controller.rb +3 -3
  35. data/app/controllers/spotlight/resources/csv_upload_controller.rb +1 -1
  36. data/app/controllers/spotlight/resources_controller.rb +4 -4
  37. data/app/controllers/spotlight/roles_controller.rb +4 -4
  38. data/app/controllers/spotlight/search_configurations_controller.rb +3 -3
  39. data/app/controllers/spotlight/searches_controller.rb +5 -5
  40. data/app/controllers/spotlight/sites_controller.rb +4 -4
  41. data/app/controllers/spotlight/tags_controller.rb +3 -3
  42. data/app/controllers/spotlight/translations_controller.rb +5 -5
  43. data/app/helpers/spotlight/application_helper.rb +2 -2
  44. data/app/helpers/spotlight/crop_helper.rb +1 -1
  45. data/app/helpers/spotlight/pages_helper.rb +7 -0
  46. data/app/helpers/spotlight/title_helper.rb +2 -2
  47. data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +1 -1
  48. data/app/javascript/spotlight/admin/blocks/resources_block.js +82 -1
  49. data/app/javascript/spotlight/admin/blocks/solr_documents_embed_block.js +1 -1
  50. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +21 -0
  51. data/app/javascript/spotlight/admin/edit_in_place.js +27 -0
  52. data/app/javascript/spotlight/admin/index.js +0 -2
  53. data/app/javascript/spotlight/admin/sir-trevor/locales.js +11 -0
  54. data/app/jobs/concerns/spotlight/job_tracking.rb +1 -1
  55. data/app/jobs/spotlight/add_tags_job.rb +2 -2
  56. data/app/jobs/spotlight/add_uploads_from_csv.rb +1 -1
  57. data/app/jobs/spotlight/change_visibility_job.rb +2 -2
  58. data/app/jobs/spotlight/process_bulk_updates_csv_job.rb +2 -2
  59. data/app/jobs/spotlight/reindex_exhibit_job.rb +1 -1
  60. data/app/jobs/spotlight/reindex_job.rb +6 -6
  61. data/app/jobs/spotlight/remove_tags_job.rb +2 -2
  62. data/app/jobs/spotlight/rename_tags_job.rb +2 -2
  63. data/app/models/breadcrumb.rb +15 -0
  64. data/app/models/concerns/spotlight/exhibit_defaults.rb +1 -1
  65. data/app/models/concerns/spotlight/exhibit_documents.rb +2 -2
  66. data/app/models/concerns/spotlight/solr_document/finder.rb +4 -4
  67. data/app/models/concerns/spotlight/solr_document.rb +4 -4
  68. data/app/models/concerns/spotlight/translatables.rb +1 -1
  69. data/app/models/spotlight/analytics/ga.rb +3 -3
  70. data/app/models/spotlight/attachment.rb +1 -1
  71. data/app/models/spotlight/background_job_progress.rb +1 -1
  72. data/app/models/spotlight/contact_email.rb +1 -1
  73. data/app/models/spotlight/contact_form.rb +2 -2
  74. data/app/models/spotlight/custom_field.rb +2 -2
  75. data/app/models/spotlight/custom_search_field.rb +2 -2
  76. data/app/models/spotlight/job_tracker.rb +1 -1
  77. data/app/models/spotlight/page.rb +2 -2
  78. data/app/models/spotlight/resources/iiif_service.rb +4 -4
  79. data/app/models/spotlight/role.rb +1 -1
  80. data/app/models/spotlight/search.rb +2 -2
  81. data/app/services/spotlight/bulk_updates_csv_template_service.rb +2 -2
  82. data/app/services/spotlight/clone_translated_page_from_locale.rb +1 -1
  83. data/app/services/spotlight/etl/pipeline.rb +1 -1
  84. data/app/views/shared/_exhibit_navbar.html.erb +2 -24
  85. data/app/views/shared/_masthead.html.erb +1 -1
  86. data/app/views/spotlight/exhibits/_form.html.erb +1 -1
  87. data/app/views/spotlight/exhibits/_new_exhibit_form.html.erb +1 -1
  88. data/app/views/spotlight/metadata_configurations/_metadata_field.html.erb +16 -5
  89. data/app/views/spotlight/metadata_configurations/edit.html.erb +2 -2
  90. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +3 -3
  91. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +3 -3
  92. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +3 -3
  93. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +3 -3
  94. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +3 -2
  95. data/config/locales/spotlight.en.yml +4 -0
  96. data/lib/generators/spotlight/templates/catalog_controller.rb +1 -0
  97. data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +4 -0
  98. data/lib/migration/iiif.rb +3 -3
  99. data/lib/spotlight/engine.rb +6 -26
  100. data/lib/spotlight/version.rb +1 -1
  101. data/lib/tasks/spotlight_tasks.rake +3 -3
  102. data/spec/factories/exhibits.rb +1 -1
  103. data/spec/support/views/test_view_helpers.rb +0 -1
  104. metadata +11 -27
  105. data/app/builders/spotlight/bootstrap_breadcrumbs_builder.rb +0 -39
  106. data/app/javascript/spotlight/admin/appearance.js +0 -22
  107. data/app/views/shared/_breadcrumbs.html.erb +0 -7
@@ -20,7 +20,7 @@ namespace :spotlight do
20
20
  email = 'admin@localhost'
21
21
  password = 'testing'
22
22
 
23
- u = Spotlight::Engine.user_class.find_or_create_by!(email: email) do |user|
23
+ u = Spotlight::Engine.user_class.find_or_create_by!(email:) do |user|
24
24
  user.password = password
25
25
  end
26
26
  Spotlight::Role.create(user: u, resource: Spotlight::Site.instance, role: 'admin')
@@ -33,7 +33,7 @@ namespace :spotlight do
33
33
  title = prompt_for_title
34
34
  slug = prompt_for_slug
35
35
 
36
- exhibit = Spotlight::Exhibit.create!({ title: title, slug: slug })
36
+ exhibit = Spotlight::Exhibit.create!({ title:, slug: })
37
37
 
38
38
  puts 'Who can admin this exhibit?'
39
39
 
@@ -55,7 +55,7 @@ namespace :spotlight do
55
55
 
56
56
  slug = args[:exhibit_slug] || data['slug']
57
57
 
58
- exhibit = Spotlight::Exhibit.find_or_create_by! slug: slug do |e|
58
+ exhibit = Spotlight::Exhibit.find_or_create_by!(slug:) do |e|
59
59
  e.title = data['title']
60
60
  end
61
61
 
@@ -4,7 +4,7 @@ FactoryBot.define do
4
4
  factory :exhibit, class: 'Spotlight::Exhibit' do
5
5
  sequence(:title) { |n| "Exhibit Title #{n}" }
6
6
  published { true }
7
- after(:build) { |exhibit| exhibit.searches << FactoryBot.build(:default_search, exhibit: exhibit) }
7
+ after(:build) { |exhibit| exhibit.searches << FactoryBot.build(:default_search, exhibit:) }
8
8
 
9
9
  trait :with_thumbnail do
10
10
  association :thumbnail, factory: :exhibit_thumbnail
@@ -14,7 +14,6 @@ module Spotlight
14
14
  view.send(:extend, Spotlight::CropHelper)
15
15
  view.send(:extend, Spotlight::PagesHelper)
16
16
  view.send(:extend, Blacklight::ComponentHelperBehavior)
17
- view.send(:extend, BreadcrumbsOnRails::ActionController::HelperMethods)
18
17
  end
19
18
  end
20
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.2
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-09-27 00:00:00.000000000 Z
14
+ date: 2024-10-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activejob-status
@@ -121,26 +121,6 @@ dependencies:
121
121
  - - "<"
122
122
  - !ruby/object:Gem::Version
123
123
  version: '6'
124
- - !ruby/object:Gem::Dependency
125
- name: breadcrumbs_on_rails
126
- requirement: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- version: '3.0'
131
- - - "<"
132
- - !ruby/object:Gem::Version
133
- version: '5'
134
- type: :runtime
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- requirements:
138
- - - ">="
139
- - !ruby/object:Gem::Version
140
- version: '3.0'
141
- - - "<"
142
- - !ruby/object:Gem::Version
143
- version: '5'
144
124
  - !ruby/object:Gem::Dependency
145
125
  name: cancancan
146
126
  requirement: !ruby/object:Gem::Requirement
@@ -921,7 +901,6 @@ files:
921
901
  - app/assets/stylesheets/spotlight/_view_larger.scss
922
902
  - app/assets/stylesheets/spotlight/browse_group_categories_block.scss
923
903
  - app/assets/stylesheets/spotlight/typeahead.scss
924
- - app/builders/spotlight/bootstrap_breadcrumbs_builder.rb
925
904
  - app/components/blacklight/icons/arrow_alt_circle_left_component.rb
926
905
  - app/components/blacklight/icons/arrow_alt_circle_right_component.rb
927
906
  - app/components/blacklight/icons/arrow_back_ios_component.rb
@@ -941,14 +920,20 @@ files:
941
920
  - app/components/spotlight/analytics/aggregation_component.rb
942
921
  - app/components/spotlight/analytics/dashboard_component.html.erb
943
922
  - app/components/spotlight/analytics/dashboard_component.rb
923
+ - app/components/spotlight/breadcrumbs_component.html.erb
924
+ - app/components/spotlight/breadcrumbs_component.rb
944
925
  - app/components/spotlight/document_admin_table_component.html.erb
945
926
  - app/components/spotlight/document_admin_table_component.rb
946
927
  - app/components/spotlight/document_component.rb
928
+ - app/components/spotlight/exhibit_navbar_component.html.erb
929
+ - app/components/spotlight/exhibit_navbar_component.rb
947
930
  - app/components/spotlight/header_component.html.erb
948
931
  - app/components/spotlight/header_component.rb
949
932
  - app/components/spotlight/icon_component.rb
950
933
  - app/components/spotlight/solr_document_legacy_embed_component.html.erb
951
934
  - app/components/spotlight/solr_document_legacy_embed_component.rb
935
+ - app/components/spotlight/tag_list_form_component.html.erb
936
+ - app/components/spotlight/tag_list_form_component.rb
952
937
  - app/controllers/concerns/spotlight/base.rb
953
938
  - app/controllers/concerns/spotlight/catalog.rb
954
939
  - app/controllers/concerns/spotlight/config.rb
@@ -1016,7 +1001,6 @@ files:
1016
1001
  - app/javascript/spotlight/admin/add_another.js
1017
1002
  - app/javascript/spotlight/admin/add_image_selector.js
1018
1003
  - app/javascript/spotlight/admin/add_new_button.js
1019
- - app/javascript/spotlight/admin/appearance.js
1020
1004
  - app/javascript/spotlight/admin/blacklight_configuration.js
1021
1005
  - app/javascript/spotlight/admin/block_mixins/autocompleteable.js
1022
1006
  - app/javascript/spotlight/admin/block_mixins/formable.js
@@ -1092,6 +1076,7 @@ files:
1092
1076
  - app/mailers/spotlight/indexing_complete_mailer.rb
1093
1077
  - app/mailers/spotlight/invitation_mailer.rb
1094
1078
  - app/models/ability.rb
1079
+ - app/models/breadcrumb.rb
1095
1080
  - app/models/concerns/spotlight/access_controls_enforcement_search_builder.rb
1096
1081
  - app/models/concerns/spotlight/blacklight_configuration_defaults.rb
1097
1082
  - app/models/concerns/spotlight/browse_category_search_builder.rb
@@ -1207,7 +1192,6 @@ files:
1207
1192
  - app/views/shared/_about_navbar.html.erb
1208
1193
  - app/views/shared/_analytics.html.erb
1209
1194
  - app/views/shared/_body_preamble.html.erb
1210
- - app/views/shared/_breadcrumbs.html.erb
1211
1195
  - app/views/shared/_browse_navbar.html.erb
1212
1196
  - app/views/shared/_curated_features_navbar.html.erb
1213
1197
  - app/views/shared/_exhibit_navbar.html.erb
@@ -1595,14 +1579,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
1595
1579
  requirements:
1596
1580
  - - ">="
1597
1581
  - !ruby/object:Gem::Version
1598
- version: '2.6'
1582
+ version: '3.1'
1599
1583
  required_rubygems_version: !ruby/object:Gem::Requirement
1600
1584
  requirements:
1601
1585
  - - ">="
1602
1586
  - !ruby/object:Gem::Version
1603
1587
  version: '0'
1604
1588
  requirements: []
1605
- rubygems_version: 3.5.9
1589
+ rubygems_version: 3.4.19
1606
1590
  signing_key:
1607
1591
  specification_version: 4
1608
1592
  summary: Enable librarians, curators, and others who are responsible for digital collections
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Spotlight
4
- # The BootstrapBreadcrumbsBuilder is a Bootstrap compatible breadcrumb builder.
5
- # It provides basic functionalities to render a breadcrumb navigation according to Bootstrap's conventions.
6
- #
7
- # BootstrapBreadcrumbsBuilder accepts a limited set of options:
8
- #
9
- # You can use it with the :builder option on render_breadcrumbs:
10
- # <%= render_breadcrumbs :builder => Spotlight::BootstrapBreadcrumbsBuilder %>
11
- #
12
- class BootstrapBreadcrumbsBuilder < BreadcrumbsOnRails::Breadcrumbs::Builder
13
- include ActionView::Helpers::OutputSafetyHelper
14
-
15
- def render
16
- return '' if @elements.blank?
17
-
18
- @context.content_tag(:ul, class: 'breadcrumb') do
19
- safe_join(@elements.uniq.map { |e| render_element(e) })
20
- end
21
- end
22
-
23
- def render_element(element)
24
- current = @context.current_page?(compute_path(element)) || element.options&.dig(:current)
25
-
26
- html_class = 'active' if current
27
-
28
- @context.content_tag(:li, class: "breadcrumb-item truncated-value #{html_class}") do
29
- @context.link_to_unless(current, element_label(element), compute_path(element), element.options&.except(:current))
30
- end
31
- end
32
-
33
- private
34
-
35
- def element_label(element)
36
- @context.content_tag(:span) { compute_name(element) }
37
- end
38
- end
39
- end
@@ -1,22 +0,0 @@
1
- export default class {
2
- connect(){
3
- $("[data-behavior='restore-default']").each(function(){
4
- var hidden = $("[data-default-value]", $(this));
5
- var value = $($("[data-in-place-edit-target]", $(this)).data('in-place-edit-target'), $(this));
6
- var button = $("[data-restore-default]", $(this));
7
- hidden.on('blur', function(){
8
- if( $(this).val() == $(this).data('default-value') ) {
9
- button.addClass('d-none');
10
- } else {
11
- button.removeClass('d-none');
12
- }
13
- });
14
- button.on('click', function(e){
15
- e.preventDefault();
16
- hidden.val(hidden.data('default-value'));
17
- value.text(hidden.data('default-value'));
18
- button.hide();
19
- });
20
- });
21
- }
22
- }
@@ -1,7 +0,0 @@
1
- <div class="container breadcrumbs-container" role="navigation" aria-label="<%= t('spotlight.breadcrumb.label') %>">
2
- <div class="row">
3
- <div class="col-md-12">
4
- <%= render_breadcrumbs builder: Spotlight::BootstrapBreadcrumbsBuilder %>
5
- </div>
6
- </div>
7
- </div>