diff --git a/app/lib/tind_spread/make_batch.rb b/app/lib/tind_spread/make_batch.rb index 30003aa3..9c9bdd73 100644 --- a/app/lib/tind_spread/make_batch.rb +++ b/app/lib/tind_spread/make_batch.rb @@ -6,7 +6,7 @@ module TindSpread module MakeBatch def self.added_headers(form_params) - added_headers = %i[336__a 852__c 540__a 980__a 982__a 982__b 982__p 991__a] + added_headers = %i[336__a 852__c 540__a 5880_a 980__a 982__a 982__b 982__p 991__a] form_params.select { |key| added_headers.include?(key) } end diff --git a/app/lib/tind_spread/spread_tool.rb b/app/lib/tind_spread/spread_tool.rb index bc8a3c44..6011b1a4 100644 --- a/app/lib/tind_spread/spread_tool.rb +++ b/app/lib/tind_spread/spread_tool.rb @@ -44,7 +44,7 @@ def header(row) end def delete_unnecessary_fields(all) - remove = %w[035__a 980__a 982__a 982__b 982__p 540__a 852__a 336__a 852__c 902__ 991__a FFT__a] + remove = %w[035__a 980__a 982__a 982__b 982__p 540__a 5880_a 852__a 336__a 852__c 902__ 991__a FFT__a] all.each_key do |key| all.delete(key) if remove.any? { |r| key.to_s.match(/#{r}/) } end diff --git a/app/models/tind_validator.rb b/app/models/tind_validator.rb index cbcab038..84722591 100644 --- a/app/models/tind_validator.rb +++ b/app/models/tind_validator.rb @@ -3,7 +3,7 @@ class TindValidator < ActiveRecord::Base # REQUIRED_PARAMS = %i[directory 980__a 982__a 982__b 540__a 336__a 852__c 902__n].freeze REQUIRED_PARAMS = %i[980__a 982__a 982__b 540__a 336__a 852__c 902__n].freeze - OPTIONAL_PARAMS = %i[982__p 991__a directory].freeze + OPTIONAL_PARAMS = %i[982__p 991__a 5880_a directory].freeze has_one_attached :input_file validate :directory_must_exist diff --git a/app/views/tind_validator/new.html.erb b/app/views/tind_validator/new.html.erb index d097afe5..4bc76fcf 100644 --- a/app/views/tind_validator/new.html.erb +++ b/app/views/tind_validator/new.html.erb @@ -93,6 +93,13 @@ <%= f.text_area(:'540__a', class: 'narrow form-control', autofocus: true, value: t('tind_marc_batch.standard_rights_statement'), rows: 8, required: true ) %> +
+ <%= label_tag('5880_a', '5880_a (optional, source of description)', class: 'control-label') %> +
+
+ <%= f.text_field(:'5880_a', class: 'narrow form-control', required: false, autofocus: true) %> +
+
<%= label_tag('991__a', 'Restriction (optional)', class: 'control-label') %>
diff --git a/spec/models/tind_validator_spec.rb b/spec/models/tind_validator_spec.rb index fd877d8b..f02f7e50 100644 --- a/spec/models/tind_validator_spec.rb +++ b/spec/models/tind_validator_spec.rb @@ -18,6 +18,7 @@ '982__b': 'Italian Librettos', '982__p': 'Some larger project', '540__a': 'some restriction text', + '5880_a': 'image, source of description', '336__a': 'Image', '852__c': 'The Bancroft Library', '902__n': 'DMZ', @@ -44,6 +45,7 @@ '982__b': 'Italian Librettos', '982__p': 'Some parent collection', '540__a': 'some restriction text', + '5880_a': 'image, source of description', '336__a': 'Image', '852__c': 'The Bancroft Library', '902__n': 'DMZ', @@ -71,6 +73,7 @@ resource_type: nil, library: nil, f_982_p: nil, + f_588_p: nil, restriction: nil, fail: nil } diff --git a/spec/request/tind_validator_request_spec.rb b/spec/request/tind_validator_request_spec.rb index 81bcf5fe..86bf483b 100644 --- a/spec/request/tind_validator_request_spec.rb +++ b/spec/request/tind_validator_request_spec.rb @@ -51,6 +51,7 @@ '982__b': 'Italian Librettos', '982__p': 'Some larger project', '540__a': 'some restriction text', + '5880_a': 'Image, source of description', '336__a': 'Image', '852__c': 'The Bancroft Library', '902__n': 'DMZ', @@ -74,6 +75,7 @@ '982__b': 'Italian Librettos', '982__p': 'Some larger project', '540__a': 'some restriction text', + '5880_a': 'Image, source of description', '336__a': 'Image', '852__c': 'The Bancroft Library', '902__n': 'DMZ',