Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/lib/tind_spread/make_batch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/lib/tind_spread/spread_tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/models/tind_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions app/views/tind_validator/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) %>
</div>

<div class="form-label form-group">
<%= label_tag('5880_a', '5880_a (optional, source of description)', class: 'control-label') %>
</div>
<div class="form-input mb-4">
<%= f.text_field(:'5880_a', class: 'narrow form-control', required: false, autofocus: true) %>
</div>

<div class="form-label form-group">
<%= label_tag('991__a', 'Restriction (optional)', class: 'control-label') %>
</div>
Expand Down
3 changes: 3 additions & 0 deletions spec/models/tind_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -71,6 +73,7 @@
resource_type: nil,
library: nil,
f_982_p: nil,
f_588_p: nil,
restriction: nil,
fail: nil
}
Expand Down
2 changes: 2 additions & 0 deletions spec/request/tind_validator_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down
Loading