Class: Hyrax::Forms::AdministrativeSetForm
- Inherits:
-
ResourceForm
- Object
- Valkyrie::ChangeSet
- ChangeSet
- ResourceForm
- Hyrax::Forms::AdministrativeSetForm
- Defined in:
- app/forms/hyrax/forms/administrative_set_form.rb
Overview
Constant Summary collapse
- AdminSetMembersPopulator =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
lambda do |**| self.member_ids = if model.new_record [] else Hyrax .query_service .find_inverse_references_by(property: :admin_set_id, resource: model) .map(&:id) end end
Constants inherited from ResourceForm
ResourceForm::LockKeyPrepopulator
Class Method Summary collapse
- .model_class ⇒ Object
-
.required_fields ⇒ Array<Symbol>
List of required field names as symbols.
Instance Method Summary collapse
-
#display_additional_fields? ⇒ Boolean
Whether there are terms to display ‘below-the-fold’.
-
#primary_terms ⇒ Array<Symbol>
Terms for display ‘above-the-fold’, or in the most prominent form real estate.
-
#secondary_terms ⇒ Array<Symbol>
Terms for display ‘below-the-fold’.
Methods inherited from ResourceForm
#[]=, for, #initialize, #model_class, required_fields=
Methods inherited from ChangeSet
Constructor Details
This class inherits a constructor from Hyrax::Forms::ResourceForm
Class Method Details
.model_class ⇒ Object
33 34 35 |
# File 'app/forms/hyrax/forms/administrative_set_form.rb', line 33 def model_class Hyrax::AdministrativeSet end |
.required_fields ⇒ Array<Symbol>
Returns list of required field names as symbols.
39 40 41 42 43 |
# File 'app/forms/hyrax/forms/administrative_set_form.rb', line 39 def required_fields definitions .select { |_, definition| definition[:required] } .keys.map(&:to_sym) end |
Instance Method Details
#display_additional_fields? ⇒ Boolean
Returns whether there are terms to display ‘below-the-fold’.
65 66 67 |
# File 'app/forms/hyrax/forms/administrative_set_form.rb', line 65 def display_additional_fields? secondary_terms.any? end |
#primary_terms ⇒ Array<Symbol>
Returns terms for display ‘above-the-fold’, or in the most prominent form real estate.
49 50 51 52 53 |
# File 'app/forms/hyrax/forms/administrative_set_form.rb', line 49 def primary_terms _form_field_definitions .select { |_, definition| definition[:primary] } .keys.map(&:to_sym) end |
#secondary_terms ⇒ Array<Symbol>
Returns terms for display ‘below-the-fold’.
57 58 59 60 61 |
# File 'app/forms/hyrax/forms/administrative_set_form.rb', line 57 def secondary_terms _form_field_definitions .select { |_, definition| definition[:display] && !definition[:primary] } .keys.map(&:to_sym) end |