Sha256: df2470803a8fa9005d7b4a0e843eb0f8f07ee103c51d77468d40c27e5438ca74
Contents?: true
Size: 1.05 KB
Versions: 17
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true module Spotlight ## # A class to model the configuration required to build the Document Upload form. # This configuration is also used in other places around the application (e.g. Metadata Field Config) # See Spotlight::Engine.config.upload_fields for where this is consumed # We should look into changing this to a standard blacklight field config in Blacklight 7 class UploadFieldConfig attr_reader :blacklight_options, :field_name, :form_field_type, :solr_fields def initialize(blacklight_options: {}, field_name:, form_field_type: :text_field, label: nil, solr_fields: nil) @blacklight_options = blacklight_options @field_name = field_name @form_field_type = form_field_type @solr_fields = solr_fields @label = label || field_name end # aliasing for backwards compatability and consistency with blacklight config alias solr_field field_name # Allows a proc to be set as the label def label return @label.call if @label.is_a?(Proc) @label end end end
Version data entries
17 entries across 17 versions & 1 rubygems