Browse Source

Revert "Handle back link for checking file page"

This reverts commit d3f775eaaa.
pull/2629/head
Manny Dinssa 2 years ago
parent
commit
a552b52a4a
  1. 2
      app/controllers/bulk_upload_lettings_logs_controller.rb
  2. 2
      app/controllers/bulk_upload_sales_logs_controller.rb
  3. 6
      app/models/forms/bulk_upload_lettings/checking_file.rb
  4. 2
      app/models/forms/bulk_upload_lettings/upload_your_file.rb
  5. 6
      app/models/forms/bulk_upload_sales/checking_file.rb
  6. 2
      app/models/forms/bulk_upload_sales/upload_your_file.rb

2
app/controllers/bulk_upload_lettings_logs_controller.rb

@ -55,7 +55,7 @@ private
when "upload-your-file" when "upload-your-file"
Forms::BulkUploadLettings::UploadYourFile.new(form_params.merge(current_user:, request:)) Forms::BulkUploadLettings::UploadYourFile.new(form_params.merge(current_user:, request:))
when "checking-file" when "checking-file"
Forms::BulkUploadLettings::CheckingFile.new(form_params.merge(request:)) Forms::BulkUploadLettings::CheckingFile.new(form_params)
else else
raise "Page not found for path #{params[:id]}" raise "Page not found for path #{params[:id]}"
end end

2
app/controllers/bulk_upload_sales_logs_controller.rb

@ -53,7 +53,7 @@ private
when "upload-your-file" when "upload-your-file"
Forms::BulkUploadSales::UploadYourFile.new(form_params.merge(current_user:, request:)) Forms::BulkUploadSales::UploadYourFile.new(form_params.merge(current_user:, request:))
when "checking-file" when "checking-file"
Forms::BulkUploadSales::CheckingFile.new(form_params.merge(request:)) Forms::BulkUploadSales::CheckingFile.new(form_params)
else else
raise "Page not found for path #{params[:id]}" raise "Page not found for path #{params[:id]}"
end end

6
app/models/forms/bulk_upload_lettings/checking_file.rb

@ -6,20 +6,14 @@ module Forms
include Rails.application.routes.url_helpers include Rails.application.routes.url_helpers
attribute :year, :integer attribute :year, :integer
attribute :organisation_id, :integer
def view_path def view_path
"bulk_upload_lettings_logs/forms/checking_file" "bulk_upload_lettings_logs/forms/checking_file"
end end
def back_path def back_path
organisation_id = request.query_parameters[:organisation_id]
if organisation_id.present?
lettings_logs_organisation_path(organisation_id)
else
bulk_upload_lettings_log_path(id: "start") bulk_upload_lettings_log_path(id: "start")
end end
end
def year_combo def year_combo
"#{year}/#{year + 1 - 2000}" "#{year}/#{year + 1 - 2000}"

2
app/models/forms/bulk_upload_lettings/upload_your_file.rb

@ -36,7 +36,7 @@ module Forms
end end
def next_path def next_path
bulk_upload_lettings_log_path(id: "checking-file", form: { year:, organisation_id: }) bulk_upload_lettings_log_path(id: "checking-file", form: { year: })
end end
def save! def save!

6
app/models/forms/bulk_upload_sales/checking_file.rb

@ -6,20 +6,14 @@ module Forms
include Rails.application.routes.url_helpers include Rails.application.routes.url_helpers
attribute :year, :integer attribute :year, :integer
attribute :organisation_id, :integer
def view_path def view_path
"bulk_upload_sales_logs/forms/checking_file" "bulk_upload_sales_logs/forms/checking_file"
end end
def back_path def back_path
organisation_id = request.query_parameters[:organisation_id]
if organisation_id.present?
sales_logs_organisation_path(organisation_id)
else
bulk_upload_sales_log_path(id: "start") bulk_upload_sales_log_path(id: "start")
end end
end
def year_combo def year_combo
"#{year}/#{year + 1 - 2000}" "#{year}/#{year + 1 - 2000}"

2
app/models/forms/bulk_upload_sales/upload_your_file.rb

@ -34,7 +34,7 @@ module Forms
end end
def next_path def next_path
bulk_upload_sales_log_path(id: "checking-file", form: { year:, organisation_id: }) bulk_upload_sales_log_path(id: "checking-file", form: { year: })
end end
def save! def save!

Loading…
Cancel
Save