blacklight-spotlight 4.2.0 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/app/assets/javascripts/spotlight/spotlight.esm.js +119 -3
  4. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  5. data/app/assets/javascripts/spotlight/spotlight.js +119 -3
  6. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  7. data/app/controllers/concerns/spotlight/search_helper.rb +2 -2
  8. data/app/controllers/spotlight/appearances_controller.rb +1 -1
  9. data/app/controllers/spotlight/bulk_actions_controller.rb +1 -1
  10. data/app/controllers/spotlight/bulk_updates_controller.rb +1 -1
  11. data/app/controllers/spotlight/featured_images_controller.rb +1 -1
  12. data/app/controllers/spotlight/groups_controller.rb +1 -1
  13. data/app/controllers/spotlight/pages_controller.rb +1 -1
  14. data/app/controllers/spotlight/resources/csv_upload_controller.rb +1 -1
  15. data/app/controllers/spotlight/roles_controller.rb +1 -1
  16. data/app/controllers/spotlight/searches_controller.rb +1 -1
  17. data/app/controllers/spotlight/translations_controller.rb +2 -2
  18. data/app/helpers/spotlight/application_helper.rb +2 -2
  19. data/app/helpers/spotlight/crop_helper.rb +1 -1
  20. data/app/helpers/spotlight/pages_helper.rb +7 -0
  21. data/app/helpers/spotlight/title_helper.rb +2 -2
  22. data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +1 -1
  23. data/app/javascript/spotlight/admin/blocks/resources_block.js +82 -1
  24. data/app/javascript/spotlight/admin/blocks/solr_documents_embed_block.js +1 -1
  25. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +21 -0
  26. data/app/javascript/spotlight/admin/sir-trevor/locales.js +11 -0
  27. data/app/jobs/concerns/spotlight/job_tracking.rb +1 -1
  28. data/app/jobs/spotlight/add_tags_job.rb +2 -2
  29. data/app/jobs/spotlight/add_uploads_from_csv.rb +1 -1
  30. data/app/jobs/spotlight/change_visibility_job.rb +2 -2
  31. data/app/jobs/spotlight/process_bulk_updates_csv_job.rb +2 -2
  32. data/app/jobs/spotlight/reindex_exhibit_job.rb +1 -1
  33. data/app/jobs/spotlight/reindex_job.rb +6 -6
  34. data/app/jobs/spotlight/remove_tags_job.rb +2 -2
  35. data/app/jobs/spotlight/rename_tags_job.rb +2 -2
  36. data/app/models/concerns/spotlight/exhibit_defaults.rb +1 -1
  37. data/app/models/concerns/spotlight/exhibit_documents.rb +2 -2
  38. data/app/models/concerns/spotlight/solr_document/finder.rb +4 -4
  39. data/app/models/concerns/spotlight/solr_document.rb +4 -4
  40. data/app/models/concerns/spotlight/translatables.rb +1 -1
  41. data/app/models/spotlight/analytics/ga.rb +1 -1
  42. data/app/models/spotlight/attachment.rb +1 -1
  43. data/app/models/spotlight/background_job_progress.rb +1 -1
  44. data/app/models/spotlight/contact_email.rb +1 -1
  45. data/app/models/spotlight/contact_form.rb +2 -2
  46. data/app/models/spotlight/custom_field.rb +2 -2
  47. data/app/models/spotlight/custom_search_field.rb +2 -2
  48. data/app/models/spotlight/job_tracker.rb +1 -1
  49. data/app/models/spotlight/page.rb +2 -2
  50. data/app/models/spotlight/resources/iiif_service.rb +4 -4
  51. data/app/models/spotlight/role.rb +1 -1
  52. data/app/models/spotlight/search.rb +2 -2
  53. data/app/services/spotlight/bulk_updates_csv_template_service.rb +2 -2
  54. data/app/services/spotlight/clone_translated_page_from_locale.rb +1 -1
  55. data/app/services/spotlight/etl/pipeline.rb +1 -1
  56. data/app/views/shared/_exhibit_navbar.html.erb +1 -1
  57. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +3 -3
  58. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +3 -3
  59. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +3 -3
  60. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +3 -3
  61. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +3 -2
  62. data/lib/migration/iiif.rb +3 -3
  63. data/lib/spotlight/engine.rb +4 -17
  64. data/lib/spotlight/version.rb +1 -1
  65. data/lib/tasks/spotlight_tasks.rake +3 -3
  66. data/spec/factories/exhibits.rb +1 -1
  67. metadata +3 -3
@@ -32,7 +32,7 @@ module Spotlight
32
32
  define_method(:"translated_#{attr_name}") do |default: [], **options|
33
33
  default = Array.wrap(default)
34
34
  default.prepend(attr_translation(attr_name)) if I18n.locale == I18n.default_locale
35
- I18n.t(attr_name, scope: slug, default: default, **options).presence
35
+ I18n.t(attr_name, scope: slug, default:, **options).presence
36
36
  end
37
37
  end
38
38
  end
@@ -115,7 +115,7 @@ module Spotlight
115
115
 
116
116
  @report_data = report_data
117
117
 
118
- OpenStruct.new({ rows: rows, totals: totals })
118
+ OpenStruct.new({ rows:, totals: })
119
119
  end
120
120
 
121
121
  private
@@ -8,7 +8,7 @@ module Spotlight
8
8
  mount_uploader :file, Spotlight::AttachmentUploader
9
9
 
10
10
  def as_json(options = nil)
11
- file.as_json(options).merge(name: name, uid: uid, attachment: to_global_id)
11
+ file.as_json(options).merge(name:, uid:, attachment: to_global_id)
12
12
  end
13
13
  end
14
14
  end
@@ -20,7 +20,7 @@ module Spotlight
20
20
  finished_at: localized_finish_time,
21
21
  updated_at: localized_updated_time,
22
22
  total: [total, completed].max,
23
- completed: completed,
23
+ completed:,
24
24
  finished: finished?,
25
25
  errored: errored?
26
26
  }
@@ -33,7 +33,7 @@ module Spotlight
33
33
  end
34
34
 
35
35
  def send_devise_notification(notification, *args)
36
- notice = notification_mailer.send(notification, self, *args, exhibit: exhibit)
36
+ notice = notification_mailer.send(notification, self, *args, exhibit:)
37
37
  if notice.respond_to? :deliver_now
38
38
  notice.deliver_now
39
39
  else
@@ -19,8 +19,8 @@ module Spotlight
19
19
 
20
20
  def headers
21
21
  {
22
- to: to,
23
- subject: I18n.t(:'spotlight.contact_form.subject', application_name: application_name),
22
+ to:,
23
+ subject: I18n.t(:'spotlight.contact_form.subject', application_name:),
24
24
  cc: contact_emails.join(', ')
25
25
  }
26
26
  end
@@ -34,7 +34,7 @@ module Spotlight
34
34
  end
35
35
 
36
36
  def label
37
- conf = if field && blacklight_configuration && blacklight_configuration.index_fields.key?(field)
37
+ conf = if field && blacklight_configuration&.index_fields&.key?(field)
38
38
  blacklight_configuration.index_fields[field].reverse_merge(configuration)
39
39
  else
40
40
  configuration
@@ -74,7 +74,7 @@ module Spotlight
74
74
  end
75
75
 
76
76
  def update_blacklight_configuration_label(label)
77
- return unless field && blacklight_configuration && blacklight_configuration.index_fields.key?(field)
77
+ return unless field && blacklight_configuration&.index_fields&.key?(field)
78
78
 
79
79
  blacklight_configuration.index_fields[field]['label'] = label
80
80
  blacklight_configuration.save
@@ -17,7 +17,7 @@ module Spotlight
17
17
  end
18
18
 
19
19
  def label
20
- conf = if slug && blacklight_configuration && blacklight_configuration.search_fields.key?(slug)
20
+ conf = if slug && blacklight_configuration&.search_fields&.key?(slug)
21
21
  blacklight_configuration.search_fields[slug].reverse_merge(configuration)
22
22
  else
23
23
  configuration
@@ -32,7 +32,7 @@ module Spotlight
32
32
  end
33
33
 
34
34
  def update_blacklight_configuration_label(label)
35
- return unless slug && blacklight_configuration && blacklight_configuration.search_fields.key?(slug)
35
+ return unless slug && blacklight_configuration&.search_fields&.key?(slug)
36
36
 
37
37
  blacklight_configuration.search_fields[slug]['label'] = label
38
38
  blacklight_configuration.save
@@ -92,7 +92,7 @@ module Spotlight
92
92
  end
93
93
 
94
94
  def append_log_entry(type:, exhibit: nil, **args)
95
- events.create(type: type, exhibit: exhibit, data: args)
95
+ events.create(type:, exhibit:, data: args)
96
96
  rescue StandardError => e
97
97
  Rails.logger.error("Unable to create log entry for job tracker #{id}: #{e}")
98
98
  end
@@ -31,7 +31,7 @@ module Spotlight
31
31
  scope :at_top_level, -> { where(parent_page_id: nil) }
32
32
  scope :published, -> { where(published: true) }
33
33
  scope :recent, -> { order('updated_at DESC').limit(10) }
34
- scope :for_locale, ->(locale = I18n.locale) { unscope(where: :locale).where(locale: locale) }
34
+ scope :for_locale, ->(locale = I18n.locale) { unscope(where: :locale).where(locale:) }
35
35
  scope :for_default_locale, -> { for_locale(I18n.default_locale) }
36
36
 
37
37
  has_one :lock, as: :on, dependent: :destroy
@@ -171,7 +171,7 @@ module Spotlight
171
171
  end
172
172
  end
173
173
 
174
- translated_pages.update(weight: weight) if saved_change_to_weight?
174
+ translated_pages.update(weight:) if saved_change_to_weight?
175
175
  end
176
176
  end
177
177
  end
@@ -56,21 +56,21 @@ module Spotlight
56
56
 
57
57
  private
58
58
 
59
- def recursive_manifests(thing, &block)
59
+ def recursive_manifests(thing, &)
60
60
  return to_enum(:recursive_manifests, thing) unless block_given?
61
61
 
62
- thing.manifests.each(&block)
62
+ thing.manifests.each(&)
63
63
 
64
64
  return if thing.collections.blank?
65
65
 
66
66
  thing.collections.each do |collection|
67
- recursive_manifests(collection, &block)
67
+ recursive_manifests(collection, &)
68
68
  end
69
69
  end
70
70
  end
71
71
 
72
72
  def create_iiif_manifest(manifest, collection = nil)
73
- IiifManifest.new(url: manifest['@id'], manifest: manifest, collection: collection)
73
+ IiifManifest.new(url: manifest['@id'], manifest:, collection:)
74
74
  end
75
75
 
76
76
  def manifest?
@@ -32,7 +32,7 @@ module Spotlight
32
32
  # validates :user, uniqueness: { scope: :exhibit}
33
33
  # but it puts the error message on the user_key instead of user so that the form will render correctly
34
34
  def user_must_be_unique
35
- errors.add(:user_key, 'already a member of this exhibit') if Spotlight::Role.where(resource: resource, user: user).where.not(id: id).any?
35
+ errors.add(:user_key, 'already a member of this exhibit') if Spotlight::Role.where(resource:, user:).where.not(id:).any?
36
36
  end
37
37
  end
38
38
  end
@@ -49,14 +49,14 @@ module Spotlight
49
49
  thumbnail.iiif_url
50
50
  end
51
51
 
52
- def documents(&block)
52
+ def documents(&)
53
53
  start = 0
54
54
  response = repository.search(search_params.start(start))
55
55
 
56
56
  return to_enum(:documents) { response['response']['numFound'] } unless block_given?
57
57
 
58
58
  while response.documents.present?
59
- response.documents.each(&block)
59
+ response.documents.each(&)
60
60
  start += response.documents.length
61
61
  response = repository.search(search_params.start(start))
62
62
  end
@@ -12,9 +12,9 @@ module Spotlight
12
12
  end
13
13
 
14
14
  def template(view_context:, title: true, tags: true, visibility: true)
15
- return to_enum(:template, view_context: view_context, title: title, tags: tags, visibility: visibility) unless block_given?
15
+ return to_enum(:template, view_context:, title:, tags:, visibility:) unless block_given?
16
16
 
17
- yield ::CSV.generate_line(csv_headers(title: title, tags: tags, visibility: visibility))
17
+ yield ::CSV.generate_line(csv_headers(title:, tags:, visibility:))
18
18
  each_document do |document|
19
19
  sidecar = document.sidecar(exhibit)
20
20
  yield ::CSV.generate_line([
@@ -13,7 +13,7 @@ module Spotlight
13
13
  end
14
14
 
15
15
  def self.call(locale:, page:)
16
- new(locale: locale, page: page).clone
16
+ new(locale:, page:).clone
17
17
  end
18
18
 
19
19
  def clone
@@ -59,7 +59,7 @@ module Spotlight
59
59
  # @yield (optioanlly..) each transformed document after it is transformed but before
60
60
  # it is sent to the loaders
61
61
  def call(context, data: {}, cache: nil, &block)
62
- executor(context, cache: cache).call(data: data, &block)
62
+ executor(context, cache:).call(data:, &block)
63
63
  end
64
64
 
65
65
  ##
@@ -1,2 +1,2 @@
1
- <%- Spotlight.deprecator.warn("_exhibit_navbar.html.erb will be removed. Customize the exhibit navbar using components instead.") %>
1
+ <%- Spotlight.deprecator.warn("_exhibit_navbar.html.erb will be removed. Customize the exhibit navbar using components instead.") if !blacklight_config.key?(:exhibit_navbar_component) %>
2
2
  <%= render (blacklight_config&.exhibit_navbar_component || Spotlight::ExhibitNavbarComponent).new %>
@@ -9,11 +9,11 @@
9
9
  <div class="box" data-id="<%= document.id %>">
10
10
  <div class="contents">
11
11
  <% if block_options[:thumbnail_image_url].present? %>
12
- <%= link_to_document(document, image_tag(block_options[:thumbnail_image_url], class: 'img-thumbnail', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
12
+ <%= link_to_document(document, image_tag(block_options[:thumbnail_image_url], class: 'img-thumbnail', alt: resource_alt_text(block_options, doc_presenter.heading), skip_pipeline: true), counter: -1) %>
13
13
  <% elsif block_options[:iiif_tilesource_base].present? %>
14
- <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!400,400/0/default.jpg', class: 'img-thumbnail', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
14
+ <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!400,400/0/default.jpg', class: 'img-thumbnail', alt: resource_alt_text(block_options, doc_presenter.heading), skip_pipeline: true), counter: -1) %>
15
15
  <% elsif doc_presenter.thumbnail.exists? %>
16
- <%= doc_presenter.thumbnail.thumbnail_tag({ class: 'img-thumbnail', alt: doc_presenter.heading }, document_counter: -1) %>
16
+ <%= doc_presenter.thumbnail.thumbnail_tag({ class: 'img-thumbnail', alt: resource_alt_text(block_options, doc_presenter.heading) }, document_counter: -1) %>
17
17
  <% end %>
18
18
  <% if solr_documents_block.primary_caption? %>
19
19
  <div class="caption primary-caption">
@@ -9,11 +9,11 @@
9
9
  <% doc_presenter = document_presenter(document) %>
10
10
  <div class="carousel-item <%= 'active' if index == 0 %>" data-id="<%= document.id %>">
11
11
  <% if block_options[:full_image_url].present? %>
12
- <%= link_to_document(document, image_tag(block_options[:full_image_url], alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
12
+ <%= link_to_document(document, image_tag(block_options[:full_image_url], alt: resource_alt_text(block_options, doc_presenter.heading), skip_pipeline: true), counter: -1) %>
13
13
  <% elsif block_options[:iiif_tilesource_base].present? %>
14
- <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!800,800/0/default.jpg', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
14
+ <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!800,800/0/default.jpg', alt: resource_alt_text(block_options, doc_presenter.heading), skip_pipeline: true), counter: -1) %>
15
15
  <% elsif doc_presenter.thumbnail.exists? %>
16
- <%= doc_presenter.thumbnail.thumbnail_tag({ alt: doc_presenter.heading }, document_counter: -1) %>
16
+ <%= doc_presenter.thumbnail.thumbnail_tag({ alt: resource_alt_text(block_options, doc_presenter.heading) }, document_counter: -1) %>
17
17
  <% end %>
18
18
  <div class="carousel-caption">
19
19
  <% if solr_documents_carousel_block.primary_caption? %>
@@ -12,11 +12,11 @@
12
12
  <% doc_presenter = document_presenter(document) %>
13
13
  <div class="carousel-item <%= 'active' if index == 0 %>" data-id="<%= document.id %>">
14
14
  <% if block_options[:full_image_url].present? %>
15
- <%= link_to_document(document, image_tag(block_options[:full_image_url], alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
15
+ <%= link_to_document(document, image_tag(block_options[:full_image_url], alt: resource_alt_text(block_options, doc_presenter.heading), skip_pipeline: true), counter: -1) %>
16
16
  <% elsif block_options[:iiif_tilesource_base].present? %>
17
- <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!800,800/0/default.jpg', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
17
+ <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!800,800/0/default.jpg', alt: resource_alt_text(block_options, doc_presenter.heading), skip_pipeline: true), counter: -1) %>
18
18
  <% elsif doc_presenter.thumbnail.exists? %>
19
- <%= doc_presenter.thumbnail.thumbnail_tag({ alt: doc_presenter.heading }, document_counter: -1) %>
19
+ <%= doc_presenter.thumbnail.thumbnail_tag({ alt: resource_alt_text(block_options, doc_presenter.heading) }, document_counter: -1) %>
20
20
  <% end %>
21
21
  </div>
22
22
 
@@ -6,11 +6,11 @@
6
6
  <% doc_presenter = document_presenter(document) %>
7
7
  <div class="box item-<%= index %>" data-id="<%= document.id %>">
8
8
  <% if block_options[:thumbnail_image_url].present? %>
9
- <%= link_to_document(document, image_tag(block_options[:thumbnail_image_url], class: 'img-thumbnail', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
9
+ <%= link_to_document(document, image_tag(block_options[:thumbnail_image_url], class: 'img-thumbnail', alt: resource_alt_text(block_options, doc_presenter.heading), skip_pipeline: true), counter: -1) %>
10
10
  <% elsif block_options[:iiif_tilesource_base].present? %>
11
- <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!400,400/0/default.jpg', class: 'img-thumbnail', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
11
+ <%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!400,400/0/default.jpg', class: 'img-thumbnail', alt: resource_alt_text(block_options, doc_presenter.heading), skip_pipeline: true), counter: -1) %>
12
12
  <% elsif doc_presenter.thumbnail.exists? %>
13
- <%= doc_presenter.thumbnail.thumbnail_tag({ class: 'img-thumbnail', alt: doc_presenter.heading }, document_counter: -1) %>
13
+ <%= doc_presenter.thumbnail.thumbnail_tag({ class: 'img-thumbnail', alt: resource_alt_text(block_options, doc_presenter.heading) }, document_counter: -1) %>
14
14
  <% end %>
15
15
  </div>
16
16
  <% end %>
@@ -6,10 +6,11 @@
6
6
  <div class="contents">
7
7
  <% if file[:link].present? %>
8
8
  <%= link_to file[:link], rel: 'ugc' do %>
9
- <%= image_tag file[:url], class: 'img-thumbnail', alt: file[:caption] %>
9
+ <%= image_tag file[:url], class: 'img-thumbnail', alt: resource_alt_text(file, file[:caption]) %>
10
10
  <% end %>
11
11
  <% else %>
12
- <%= image_tag file[:url], class: 'img-thumbnail', alt: '', role: 'presentation' %>
12
+ <% alt_text = resource_alt_text(file, '') %>
13
+ <%= image_tag file[:url], class: 'img-thumbnail', alt: alt_text, role: alt_text.present? ? nil : 'presentation' %>
13
14
  <% end %>
14
15
  <% if file[:caption].present? %>
15
16
  <div class="caption">
@@ -32,7 +32,7 @@ module Migration
32
32
  def migrate_contact_avatars
33
33
  Spotlight::Contact.all.find_each do |contact|
34
34
  avatar = copy_contact_image_to_avatar(contact)
35
- contact.update(avatar: avatar) if avatar
35
+ contact.update(avatar:) if avatar
36
36
  end
37
37
  end
38
38
 
@@ -70,7 +70,7 @@ module Migration
70
70
  old_file = File.new(filepath)
71
71
  image = contact.create_avatar { |i| i.image.store!(old_file) }
72
72
  iiif_tilesource = Spotlight::Engine.config.iiif_service.info_url(image)
73
- image.update(iiif_tilesource: iiif_tilesource, iiif_region: avatar_coordinates(contact))
73
+ image.update(iiif_tilesource:, iiif_region: avatar_coordinates(contact))
74
74
  image
75
75
  end
76
76
 
@@ -84,7 +84,7 @@ module Migration
84
84
  old_file = File.new(filepath)
85
85
  image = upload.create_upload { |i| i.image.store!(old_file) }
86
86
  iiif_tilesource = Spotlight::Engine.config.iiif_service.info_url(image)
87
- image.update(iiif_tilesource: iiif_tilesource)
87
+ image.update(iiif_tilesource:)
88
88
  upload.upload_id = image.id
89
89
  upload.save_and_index
90
90
  end
@@ -330,23 +330,10 @@ module Spotlight
330
330
 
331
331
  config.exhibit_roles = %w[admin curator viewer]
332
332
  # PaperTrail serializes objects to YAML, so we need to permit these classes to be deserialized
333
- if ActiveRecord.respond_to?(:yaml_column_permitted_classes)
334
- # Rails >= 7.0
335
- ActiveRecord.yaml_column_permitted_classes ||= []
336
- ActiveRecord.yaml_column_permitted_classes += [Symbol,
337
- ActiveSupport::HashWithIndifferentAccess,
338
- ActiveSupport::TimeWithZone,
339
- ActiveSupport::TimeZone,
340
- Time]
341
- elsif ActiveRecord::Base.respond_to?(:yaml_column_permitted_classes)
342
- # Rails 6.1
343
- ActiveRecord::Base.yaml_column_permitted_classes ||= []
344
- ActiveRecord::Base.yaml_column_permitted_classes += [Symbol,
345
- ActiveSupport::HashWithIndifferentAccess,
346
- ActiveSupport::TimeWithZone,
347
- ActiveSupport::TimeZone,
348
- Time]
349
- end
333
+ ActiveRecord.yaml_column_permitted_classes += [ActiveSupport::HashWithIndifferentAccess,
334
+ ActiveSupport::TimeWithZone,
335
+ ActiveSupport::TimeZone,
336
+ Time]
350
337
  end
351
338
  # rubocop:enable Metrics/ClassLength
352
339
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spotlight
4
- VERSION = '4.2.0'
4
+ VERSION = '4.3.0'
5
5
  end
@@ -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
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.2.0
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-10-08 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
@@ -1579,7 +1579,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
1579
1579
  requirements:
1580
1580
  - - ">="
1581
1581
  - !ruby/object:Gem::Version
1582
- version: '2.6'
1582
+ version: '3.1'
1583
1583
  required_rubygems_version: !ruby/object:Gem::Requirement
1584
1584
  requirements:
1585
1585
  - - ">="