From 5e3e95d40eeba527cdf1165cd835537c7fb4f188 Mon Sep 17 00:00:00 2001 From: Longshou Situ Date: Tue, 5 Sep 2023 08:12:43 -0700 Subject: [PATCH] Exclude terms from batch edit. --- app/forms/hyrax/forms/resource_batch_edit_form.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/forms/hyrax/forms/resource_batch_edit_form.rb b/app/forms/hyrax/forms/resource_batch_edit_form.rb index ec122a395e..290d40301a 100644 --- a/app/forms/hyrax/forms/resource_batch_edit_form.rb +++ b/app/forms/hyrax/forms/resource_batch_edit_form.rb @@ -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 @@ -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