Repository navigation
v6.0.0.rc2
Pre-releaseThis is the second release candidate for Spotlight 6.0. Please try it against your own Spotlight applications and report problems in the issue tracker before the final release.
These notes cover changes since rc1. If you're upgrading from 5.x, start with the rc1 release notes for the upgrade steps and breaking changes, then apply the changes below.
Requirements
- Ruby 3.3+
- Blacklight 8.12+ or 9.x (was 8.7+ in rc1)
- ViewComponent 4.x (now required)
- blacklight-gallery 5.1+ (6.x for Blacklight 9)
- Solr 9 or 10
To install:
gem 'blacklight-spotlight', '6.0.0.rc2'npm install spotlight-frontend@nextBreaking changes
Requires ViewComponent 4
Spotlight now depends on view_component ~> 4.0, which raises two other floors: blacklight >= 8.12.0 (the first 8.x that allows ViewComponent 4) and blacklight-gallery >= 5.1 (older gallery releases break under ViewComponent 4). Blacklight 9 apps are already on ViewComponent 4 and gallery 6.
Action needed if your app has its own components or overrides Spotlight's: ViewComponent 4 no longer inherits from ActionView::Base, so form builders and partial rendering inside a component template need the helpers. proxy, e.g. helpers.bootstrap_form_for ... and helpers.render partial: .... Components without an initialize no longer accept arbitrary arguments, and use_helper(s) is gone (use include SomeHelper or helpers.). See the ViewComponent 4.0 changelog for the full list.
Upload and custom field forms
Upload fields can now be multivalued:
Spotlight::UploadFieldConfig.newacceptsis_multiple: true, which works like the existing option on custom fields. The field gets "Add another value" on the upload and item edit forms and is stored as an array, so make sure its Solr field is multivalued.- To split CSV upload values for multivalued fields (upload or custom), set
Spotlight::Engine.config.csv_upload_multivalued_field_delimiterto a delimiter such as'|'. It'snilby default, so CSV values aren't split unless you set it.
Upload fields and exhibit custom fields on the upload form and the item edit form now render through ViewComponents instead of partials:
Spotlight::EditSidecarComponentreplaces thespotlight/catalog/_edit_sidecarpartial.Spotlight::UploadFieldFormGroupComponentandSpotlight::CustomFieldFormGroupComponentrender each field, throughSpotlight::SidecarFormFieldComponentby default.Spotlight::UploadFieldConfig.newandSpotlight::Engine.config.custom_field_typesentries acceptcomponent:(a class or class name) to render the field with your own component.Spotlight::Engine.config.custom_field_typesentries also acceptform_field_type:. The built-intexttype setsform_field_type: :text_area.
Action needed if your app:
- overrides
spotlight/catalog/_edit_sidecar: the override is no longer rendered. CustomizeSpotlight::EditSidecarComponentinstead. - calls
uploaded_field_label(a public helper since 0.3): it has been removed. - replaces
custom_field_typeswholesale: addform_field_type: :text_areato yourtextentry, or those fields will render as text inputs instead of textareas. - overrides
spotlight/custom_fields/form_group/_<type>: the override still renders, with a deprecation warning (see Deprecations). The built-in_textand_vocabpartials have been removed. - styles or tests against these inputs: single-valued upload fields now get the same
f0_id prefix custom fields already had (e.g.f0_resources_upload_data_full_title_tesim). Stacked labels useform-labelinstead ofcol-form-label, and the per-inputmb-3wrapper is gone. The outerform-groupwrapper and inputnames are unchanged.
Removed
These were not called by Spotlight or any supported Blacklight version. Stop calling them if your app does:
Spotlight::InvitationMailer, its view, and the i18n keys only it used:spotlight.invitation_mailer.invitation_instructions.subjectand.visit, andspotlight.exhibits_admin_invitation_mailer.invitation_instructions.acceptand.subject. The other keys in those groups are still used by the devise_invitable invitation email, which is what sends invitations.- Partials
catalog/_image_defaultandspotlight/catalog/_curation_mode_toggle_default. - Helpers
CrudLinkHelpers#create_linkand#edit_link(useexhibit_create_link/exhibit_edit_link),Spotlight::ApplicationHelper#render_search_barand#selected_search_block_views. Spotlight::Search#display_masthead?,BrowseController#render_save_this_search?,SirTrevorRails::Blocks::BrowseBlock#search_options,Spotlight::JobTracker#progress_labeland#percent,Spotlight::Resources::IiifManifest#with_exhibit(passexhibit:to#to_solr).SolrDocument#attribute_present?and the protectedconvert_incoming_attributes,deep_transform_values,_deep_transform_values, anddeep_compact(they never ran on controller params).- The
zoom_in,zoom_out, andinfoicons.
Other changes
- Blank values are stripped from multivalued sidecar fields on save, so empty "Add another value" inputs are no longer stored. Blank single-valued fields are unchanged. Blanks already stored stay until the item is saved again; Solr never indexed them, so no reindex is needed.
- JSON uploads no longer copy the document's unique key into the sidecar data. Previously this made Solr reject any later reindex of the document (tagging, visibility changes, bulk updates). See #3812.
Spotlight::CleanupJobTrackersJobis documented, and now keeps completed trackers forreindex_progress_window(one hour by default), as intended. It previously kept them for 60 hours, so if you already schedule it, it will now delete more rows. Spotlight never enqueues this job itself; without it thespotlight_job_trackerstable grows indefinitely. See Cleaning up job trackers in the README for Solid Queue and cron examples. Completed job trackers are also what the exhibit dashboard's "Recent item indexing activity" table lists. Once this job runs, that table shows only completed jobs from the lastreindex_progress_window, but every failed job, so failures can look more frequent or more recent than they are. Schedule it with that in mind.
Deprecations
- App overrides of
spotlight/custom_fields/form_group/_<type>partials still render, log a warning, and will be removed in 7.0. Configure acomponent:on the custom field type inSpotlight::Engine.config.custom_field_typesinstead.
What's Changed
- Require ViewComponent 4 by @corylown in #3833
- Add multivalued option to upload field configurations by @ebtoner in #3829
- Adjust SidecarFormFieldComponent markup by @corylown in #3834
- Don't store the unique key in JSON upload sidecar data by @corylown in #3813
- Strip blank entries from multivalued sidecar fields on save by @jcoyne in #3837
- Render sidecar form fields through configurable components by @jcoyne in #3838
- Remove unused incoming-attribute cleanup from SolrDocument#update by @corylown in #3851
- Remove unused Spotlight::InvitationMailer by @jcoyne in #3840
- Remove unused curation_mode_toggle_default partial by @jcoyne in #3841
- Remove unused create_link and edit_link helpers by @jcoyne in #3842
- Remove unused Spotlight::Search#display_masthead? by @jcoyne in #3843
- Remove unused JobTracker#progress_label and #percent by @jcoyne in #3844
- Remove unused BrowseBlock#search_options by @jcoyne in #3845
- Remove unused render_search_bar helper override by @jcoyne in #3846
- Remove unused BrowseController#render_save_this_search? by @jcoyne in #3847
- Remove unused zoom_in, zoom_out and info icons by @jcoyne in #3848
- Remove selected_search_block_views helper by @jcoyne in #3849
- Remove IiifManifest#with_exhibit by @jcoyne in #3850
- Remove SolrDocument#attribute_present? stub by @jcoyne in #3852
- Remove unused catalog/_image_default partial by @jcoyne in #3853
- Document CleanupJobTrackersJob and fix its retention window by @jcoyne in #3855
- Fix RSpec/ContextWording offenses by @jcoyne in #3856
- Render the catalog edit sidecar fields with a ViewComponent by @jcoyne in #3857
- Remove no-op example from iiif_tilesource import spec by @corylown in #3858
- Prevent duplicate unique keys in JSON Solr updates by @Arthur031221 in #3743
- Use spies for connection#update in solr controller spec by @corylown in #3859
New Contributors
- @Arthur031221 made their first contribution in #3743
Full Changelog: v6.0.0.rc1...v6.0.0.rc2