blacklight-spotlight 4.2.0 → 4.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/app/assets/javascripts/spotlight/spotlight.esm.js +120 -4
- data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
- data/app/assets/javascripts/spotlight/spotlight.js +120 -4
- data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
- data/app/controllers/concerns/spotlight/search_helper.rb +2 -2
- data/app/controllers/spotlight/appearances_controller.rb +1 -1
- data/app/controllers/spotlight/bulk_actions_controller.rb +1 -1
- data/app/controllers/spotlight/bulk_updates_controller.rb +1 -1
- data/app/controllers/spotlight/featured_images_controller.rb +1 -1
- data/app/controllers/spotlight/groups_controller.rb +1 -1
- data/app/controllers/spotlight/pages_controller.rb +1 -1
- data/app/controllers/spotlight/resources/csv_upload_controller.rb +1 -1
- data/app/controllers/spotlight/roles_controller.rb +1 -1
- data/app/controllers/spotlight/searches_controller.rb +1 -1
- data/app/controllers/spotlight/translations_controller.rb +2 -2
- data/app/helpers/spotlight/application_helper.rb +2 -2
- data/app/helpers/spotlight/crop_helper.rb +1 -1
- data/app/helpers/spotlight/pages_helper.rb +7 -0
- data/app/helpers/spotlight/title_helper.rb +2 -2
- data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +1 -1
- data/app/javascript/spotlight/admin/blocks/resources_block.js +82 -1
- data/app/javascript/spotlight/admin/blocks/solr_documents_embed_block.js +1 -1
- data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +21 -0
- data/app/javascript/spotlight/admin/sir-trevor/locales.js +11 -0
- data/app/jobs/concerns/spotlight/job_tracking.rb +1 -1
- data/app/jobs/spotlight/add_tags_job.rb +2 -2
- data/app/jobs/spotlight/add_uploads_from_csv.rb +1 -1
- data/app/jobs/spotlight/change_visibility_job.rb +2 -2
- data/app/jobs/spotlight/process_bulk_updates_csv_job.rb +2 -2
- data/app/jobs/spotlight/reindex_exhibit_job.rb +1 -1
- data/app/jobs/spotlight/reindex_job.rb +6 -6
- data/app/jobs/spotlight/remove_tags_job.rb +2 -2
- data/app/jobs/spotlight/rename_tags_job.rb +2 -2
- data/app/models/concerns/spotlight/exhibit_defaults.rb +1 -1
- data/app/models/concerns/spotlight/exhibit_documents.rb +2 -2
- data/app/models/concerns/spotlight/solr_document/finder.rb +4 -4
- data/app/models/concerns/spotlight/solr_document.rb +4 -4
- data/app/models/concerns/spotlight/translatables.rb +1 -1
- data/app/models/spotlight/analytics/ga.rb +1 -1
- data/app/models/spotlight/attachment.rb +1 -1
- data/app/models/spotlight/background_job_progress.rb +1 -1
- data/app/models/spotlight/contact_email.rb +1 -1
- data/app/models/spotlight/contact_form.rb +2 -2
- data/app/models/spotlight/custom_field.rb +2 -2
- data/app/models/spotlight/custom_search_field.rb +2 -2
- data/app/models/spotlight/job_tracker.rb +1 -1
- data/app/models/spotlight/page.rb +2 -2
- data/app/models/spotlight/resources/iiif_service.rb +4 -4
- data/app/models/spotlight/role.rb +1 -1
- data/app/models/spotlight/search.rb +9 -6
- data/app/services/spotlight/bulk_updates_csv_template_service.rb +2 -2
- data/app/services/spotlight/clone_translated_page_from_locale.rb +1 -1
- data/app/services/spotlight/etl/pipeline.rb +1 -1
- data/app/views/shared/_exhibit_navbar.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +3 -3
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +3 -3
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +3 -3
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +3 -3
- data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +3 -2
- data/lib/migration/iiif.rb +3 -3
- data/lib/spotlight/engine.rb +4 -17
- data/lib/spotlight/version.rb +1 -1
- data/lib/tasks/spotlight_tasks.rake +3 -3
- data/spec/factories/exhibits.rb +1 -1
- metadata +4 -4
@@ -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
|
35
|
+
I18n.t(attr_name, scope: slug, default:, **options).presence
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -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
|
11
|
+
file.as_json(options).merge(name:, uid:, attachment: to_global_id)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -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:
|
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
|
23
|
-
subject: I18n.t(:'spotlight.contact_form.subject', 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
|
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
|
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
|
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
|
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
|
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:
|
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:
|
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, &
|
59
|
+
def recursive_manifests(thing, &)
|
60
60
|
return to_enum(:recursive_manifests, thing) unless block_given?
|
61
61
|
|
62
|
-
thing.manifests.each(&
|
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, &
|
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
|
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
|
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(&
|
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(&
|
59
|
+
response.documents.each(&)
|
60
60
|
start += response.documents.length
|
61
61
|
response = repository.search(search_params.start(start))
|
62
62
|
end
|
@@ -79,13 +79,16 @@ module Spotlight
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def search_params
|
82
|
-
search_service.search_builder.with(
|
82
|
+
search_service.search_builder.with(base_search_state).merge(facet: false)
|
83
83
|
end
|
84
84
|
|
85
85
|
def merge_params_for_search(params, blacklight_config)
|
86
|
-
|
87
|
-
user_query
|
88
|
-
|
86
|
+
user_query = Blacklight::SearchState.new(params, blacklight_config, nil).to_h
|
87
|
+
base_search_state.params_for_search(user_query).merge(user_query.slice(:page))
|
88
|
+
end
|
89
|
+
|
90
|
+
def base_search_state
|
91
|
+
Blacklight::SearchState.new((query_params || {}).with_indifferent_access, blacklight_config, nil)
|
89
92
|
end
|
90
93
|
|
91
94
|
private
|
@@ -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
|
15
|
+
return to_enum(:template, view_context:, title:, tags:, visibility:) unless block_given?
|
16
16
|
|
17
|
-
yield ::CSV.generate_line(csv_headers(title
|
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([
|
@@ -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:
|
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
|
-
|
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">
|
data/lib/migration/iiif.rb
CHANGED
@@ -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:
|
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
|
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:
|
87
|
+
image.update(iiif_tilesource:)
|
88
88
|
upload.upload_id = image.id
|
89
89
|
upload.save_and_index
|
90
90
|
end
|
data/lib/spotlight/engine.rb
CHANGED
@@ -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
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
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
|
data/lib/spotlight/version.rb
CHANGED
@@ -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:
|
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
|
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!
|
58
|
+
exhibit = Spotlight::Exhibit.find_or_create_by!(slug:) do |e|
|
59
59
|
e.title = data['title']
|
60
60
|
end
|
61
61
|
|
data/spec/factories/exhibits.rb
CHANGED
@@ -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:
|
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.
|
4
|
+
version: 4.3.1
|
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-
|
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,14 +1579,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1579
1579
|
requirements:
|
1580
1580
|
- - ">="
|
1581
1581
|
- !ruby/object:Gem::Version
|
1582
|
-
version: '
|
1582
|
+
version: '3.1'
|
1583
1583
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1584
1584
|
requirements:
|
1585
1585
|
- - ">="
|
1586
1586
|
- !ruby/object:Gem::Version
|
1587
1587
|
version: '0'
|
1588
1588
|
requirements: []
|
1589
|
-
rubygems_version: 3.
|
1589
|
+
rubygems_version: 3.5.9
|
1590
1590
|
signing_key:
|
1591
1591
|
specification_version: 4
|
1592
1592
|
summary: Enable librarians, curators, and others who are responsible for digital collections
|