Class: Hyrax::Forms::AdministrativeSetForm
- Inherits:
-
Valkyrie::ChangeSet
- Object
- Valkyrie::ChangeSet
- 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
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’.
Class Method Details
.model_class ⇒ Object
37 38 39 |
# File 'app/forms/hyrax/forms/administrative_set_form.rb', line 37 def model_class Hyrax::AdministrativeSet end |
.required_fields ⇒ Array<Symbol>
Returns list of required field names as symbols.
43 44 45 46 47 |
# File 'app/forms/hyrax/forms/administrative_set_form.rb', line 43 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’.
69 70 71 |
# File 'app/forms/hyrax/forms/administrative_set_form.rb', line 69 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.
53 54 55 56 57 |
# File 'app/forms/hyrax/forms/administrative_set_form.rb', line 53 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’.
61 62 63 64 65 |
# File 'app/forms/hyrax/forms/administrative_set_form.rb', line 61 def secondary_terms _form_field_definitions .select { |_, definition| definition[:display] && !definition[:primary] } .keys.map(&:to_sym) end |