Skip to content

Commit

Permalink
fixes skip and do not show existing entry option on new importer
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Feb 9, 2024
1 parent 44cb7d7 commit f5cd0fd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
14 changes: 7 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ require 'bundler/gem_tasks'

require 'solr_wrapper/rake_task' unless Rails.env.production?

require 'rubocop/rake_task'

RuboCop::RakeTask.new(:rubocop) do |t|
t.options = ['--display-cop-names', '--ignore-parent-exclusion', '-a']
end

begin
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

task default: :spec
task default: [:rubocop, :spec]
rescue LoadError # rubocop:disable Lint/HandleExceptions
# no rspec available
end

require 'rubocop/rake_task'

RuboCop::RakeTask.new(:rubocop) do |t|
t.options = ['--display-cop-names']
end
2 changes: 1 addition & 1 deletion app/models/bulkrax/importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def import_objects(types_array = nil)
# After an import any entries we did not touch are skipped.
# They are not really pending, complete for the last run, or failed
def mark_unseen_as_skipped
entries.where.not(id. seen).find_each do |entry|
entries.where.not(identifier: seen.keys).find_each do |entry|
entry.set_status_info('Skipped')
end
end
Expand Down
4 changes: 3 additions & 1 deletion app/views/bulkrax/importers/_csv_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
<h4>Add CSV File to Import:</h4>
<%# accept a single file upload; data files and bags will need to be added another way %>

<%= fi.input :file_style, collection: ['Upload a File', 'Specify a Path on the Server', 'Existing Entries'], as: :radio_buttons, label: false %>
<% file_style_list = ['Upload a File', 'Specify a Path on the Server'] %>
<% file_style_list << 'Existing Entries' unless importer.new_record? %>
<%= fi.input :file_style, collection: file_style_list, as: :radio_buttons, label: false %>
<div id='file_upload'>
<%= fi.input 'file', as: :file, input_html: { accept: 'text/csv,application/zip' } %><br />
</div>
Expand Down

0 comments on commit f5cd0fd

Please sign in to comment.