diff --git a/Gemfile.lock b/Gemfile.lock index bad648b251..1adc995aad 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -488,9 +489,10 @@ 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) @@ -498,15 +500,17 @@ GEM 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) @@ -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) diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb index 62e164c872..566f8f74cc 100644 --- a/app/controllers/imports_controller.rb +++ b/app/controllers/imports_controller.rb @@ -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") @@ -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, diff --git a/app/models/case_contact_report.rb b/app/models/case_contact_report.rb index 891e6d07cf..916855464e 100644 --- a/app/models/case_contact_report.rb +++ b/app/models/case_contact_report.rb @@ -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) @@ -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