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
28 changes: 16 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ GEM
pretender (0.5.0)
actionpack (>= 6.1)
prettyprint (0.2.0)
prism (1.4.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand Down Expand Up @@ -488,25 +489,28 @@ GEM
rswag-ui (2.16.0)
actionpack (>= 5.2, < 8.1)
railties (>= 5.2, < 8.1)
rubocop (1.71.2)
rubocop (1.73.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.38.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.38.0)
parser (>= 3.3.1.0)
rubocop-ast (1.43.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.26.1)
rubocop (~> 1.61)
rubocop-performance (1.23.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-performance (1.24.0)
lint_roller (~> 1.1)
rubocop (>= 1.72.1, < 2.0)
rubocop-ast (>= 1.38.0, < 2.0)
rubocop-rails (2.26.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
Expand Down Expand Up @@ -558,18 +562,18 @@ GEM
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
standard (1.45.0)
standard (1.47.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.71.0)
rubocop (~> 1.73.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.6)
standard-performance (~> 1.7)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.6.0)
standard-performance (1.7.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.23.0)
rubocop-performance (~> 1.24.0)
standard-rails (1.2.0)
lint_roller (~> 1.0)
rubocop-rails (~> 2.26.0)
Expand Down
16 changes: 8 additions & 8 deletions app/controllers/imports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ class ImportsController < ApplicationController
include ActionView::Helpers::UrlHelper
after_action :verify_authorized

ERR_FAILED_IMPORT_NOTE = "Note: An additional 'error' column has been added to the file. " \
"Please note the failure reason and remove the column when resubmitting."
ERR_FILE_NOT_ATTACHED = "You must attach a CSV file in order to import information!"
ERR_FILE_NOT_FOUND = "CSV import file not found."
ERR_FILE_EMPTY = "File can not be empty."
ERR_INVALID_HEADER = "Looks like this CSV contains invalid formatting. " \
"Please download an example CSV for reference and try again."

def index
authorize :import
@import_type = params.fetch(:import_type, "volunteer")
Expand Down Expand Up @@ -46,14 +54,6 @@ def download_failed

private

ERR_FAILED_IMPORT_NOTE = "Note: An additional 'error' column has been added to the file. " \
"Please note the failure reason and remove the column when resubmitting."
ERR_FILE_NOT_ATTACHED = "You must attach a CSV file in order to import information!"
ERR_FILE_NOT_FOUND = "CSV import file not found."
ERR_FILE_EMPTY = "File can not be empty."
ERR_INVALID_HEADER = "Looks like this CSV contains invalid formatting. " \
"Please download an example CSV for reference and try again."

def header
{
"volunteer" => VolunteerImporter::IMPORT_HEADER,
Expand Down
37 changes: 18 additions & 19 deletions app/models/case_contact_report.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
class CaseContactReport
attr_reader :case_contacts, :columns
COLUMNS = [
:internal_contact_number,
:duration_minutes,
:contact_types,
:contact_made,
:contact_medium,
:occurred_at,
:added_to_system_at,
:miles_driven,
:wants_driving_reimbursement,
:casa_case_number,
:creator_email,
:creator_name,
:supervisor_name,
:case_contact_notes,
:court_topics
]

attr_reader :case_contacts, :columns
def initialize(args = {})
@columns = filtered_columns(args)
@case_contacts = filtered_case_contacts(args)
Expand Down Expand Up @@ -34,22 +51,4 @@ def filtered_columns(args)
COLUMNS
end
end

COLUMNS = [
:internal_contact_number,
:duration_minutes,
:contact_types,
:contact_made,
:contact_medium,
:occurred_at,
:added_to_system_at,
:miles_driven,
:wants_driving_reimbursement,
:casa_case_number,
:creator_email,
:creator_name,
:supervisor_name,
:case_contact_notes,
:court_topics
]
end
Loading