Skip to content

v6.0.0.rc2

Pre-release
Pre-release

Choose a tag to compare

@corylown corylown released this 28 Oct 14:56
· 5 commits to main since this release

This 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@next

Breaking 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.new accepts is_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_delimiter to a delimiter such as '|'. It's nil by 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::EditSidecarComponent replaces the spotlight/catalog/_edit_sidecar partial.
  • Spotlight::UploadFieldFormGroupComponent and Spotlight::CustomFieldFormGroupComponent render each field, through Spotlight::SidecarFormFieldComponent by default.
  • Spotlight::UploadFieldConfig.new and Spotlight::Engine.config.custom_field_types entries accept component: (a class or class name) to render the field with your own component.
  • Spotlight::Engine.config.custom_field_types entries also accept form_field_type:. The built-in text type sets form_field_type: :text_area.

Action needed if your app:

  • overrides spotlight/catalog/_edit_sidecar: the override is no longer rendered. Customize Spotlight::EditSidecarComponent instead.
  • calls uploaded_field_label (a public helper since 0.3): it has been removed.
  • replaces custom_field_types wholesale: add form_field_type: :text_area to your text entry, 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 _text and _vocab partials 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 use form-label instead of col-form-label, and the per-input mb-3 wrapper is gone. The outer form-group wrapper and input names 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.subject and .visit, and spotlight.exhibits_admin_invitation_mailer.invitation_instructions.accept and .subject. The other keys in those groups are still used by the devise_invitable invitation email, which is what sends invitations.
  • Partials catalog/_image_default and spotlight/catalog/_curation_mode_toggle_default.
  • Helpers CrudLinkHelpers#create_link and #edit_link (use exhibit_create_link / exhibit_edit_link), Spotlight::ApplicationHelper#render_search_bar and #selected_search_block_views.
  • Spotlight::Search#display_masthead?, BrowseController#render_save_this_search?, SirTrevorRails::Blocks::BrowseBlock#search_options, Spotlight::JobTracker#progress_label and #percent, Spotlight::Resources::IiifManifest#with_exhibit (pass exhibit: to #to_solr).
  • SolrDocument#attribute_present? and the protected convert_incoming_attributes, deep_transform_values, _deep_transform_values, and deep_compact (they never ran on controller params).
  • The zoom_in, zoom_out, and info icons.

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::CleanupJobTrackersJob is documented, and now keeps completed trackers for reindex_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 the spotlight_job_trackers table 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 last reindex_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 a component: on the custom field type in Spotlight::Engine.config.custom_field_types instead.

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

Full Changelog: v6.0.0.rc1...v6.0.0.rc2