Skip to content

Commit

Permalink
Exclude terms from batch edit.
Browse files Browse the repository at this point in the history
  • Loading branch information
lsitu committed Sep 5, 2023
1 parent b437faa commit 5e3e95d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/forms/hyrax/forms/resource_batch_edit_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class ResourceBatchEditForm < Hyrax::Forms::ResourceForm
self.required_fields = []
self.model_class = Hyrax.primary_work_type

# Terms that need to exclude from batch edit
class_attribute :terms_excluded
self.terms_excluded = [:abstract, :label, :source]

# Contains a list of titles of all the works in the batch
attr_accessor :names

Expand Down Expand Up @@ -36,7 +40,7 @@ def self.terms
secondary_terms = definitions.select { |_, definition| definition[:display] && !definition[:primary] }
.keys.map(&:to_sym)

primary_terms + secondary_terms
(primary_terms + secondary_terms) - terms_excluded
end

attr_reader :batch_document_ids
Expand Down

0 comments on commit 5e3e95d

Please sign in to comment.