From d3e46e829e83618c4505f6cdbb77fcbb6a5f0a27 Mon Sep 17 00:00:00 2001 From: parinita Date: Wed, 11 Mar 2020 16:04:55 -0700 Subject: [PATCH] CAL-877 Remove warning for diagnostic fields on the preview page (#799) * Rebuild gem file lock * Remove warning for diagnostic fields on the preview page --- app/uploaders/csv_manifest_validator.rb | 4 ++++ .../csv_import/csv_files_with_problems/extra_headers.csv | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/uploaders/csv_manifest_validator.rb b/app/uploaders/csv_manifest_validator.rb index 8b4db6b8..43411698 100644 --- a/app/uploaders/csv_manifest_validator.rb +++ b/app/uploaders/csv_manifest_validator.rb @@ -182,6 +182,10 @@ def missing_headers # Warn the user if we find any unexpected headers. def unrecognized_headers extra_headers = @headers - valid_headers + skip_headers = ['Item Status ID', 'Item Status', 'Duplicate', 'Delete in Title'] + extra_headers = extra_headers.reject do |header| + skip_headers.include?(header) + end extra_headers.each do |header| @warnings << "The field name \"#{header}\" is not supported. This field will be ignored, and the metadata for this field will not be imported." end diff --git a/spec/fixtures/csv_import/csv_files_with_problems/extra_headers.csv b/spec/fixtures/csv_import/csv_files_with_problems/extra_headers.csv index 703751a3..3ecdae87 100644 --- a/spec/fixtures/csv_import/csv_files_with_problems/extra_headers.csv +++ b/spec/fixtures/csv_import/csv_files_with_problems/extra_headers.csv @@ -1,2 +1,2 @@ -Object Type,Title,Item ARK,Parent ARK,Rights.copyrightStatus,File Name,another_header_1,another_header_2 -Work,Apple,ark:/abc/123456,ark:/abc/7890123,copyrighted,clusc_1_1_00010432a.tif,whatever,barbaz +Object Type,Title,Item ARK,Parent ARK,Rights.copyrightStatus,File Name,Item Status ID,Item Status,Duplicate,Delete in Title,another_header_1,another_header_2 +Work,Apple,ark:/abc/123456,ark:/abc/7890123,copyrighted,clusc_1_1_00010432a.tif,whatever,barbaz,helloooo,helppp,stoppp,duplicateee