diff --git a/app/controllers/bulk_upload_lettings_resume_controller.rb b/app/controllers/bulk_upload_lettings_resume_controller.rb index a4bd291a9..21edd9d41 100644 --- a/app/controllers/bulk_upload_lettings_resume_controller.rb +++ b/app/controllers/bulk_upload_lettings_resume_controller.rb @@ -4,7 +4,7 @@ class BulkUploadLettingsResumeController < ApplicationController def start @bulk_upload = current_user.bulk_uploads.find(params[:id]) - redirect_to fix_choice_bulk_upload_lettings_resume_path(@bulk_upload) + redirect_to page_bulk_upload_lettings_resume_path(@bulk_upload, page: "fix-choice") end def show @@ -26,7 +26,14 @@ class BulkUploadLettingsResumeController < ApplicationController private def form - @form ||= Forms::BulkUploadLettingsResume::FixChoice.new(form_params.merge(bulk_upload: @bulk_upload)) + @form ||= case params[:page] + when "fix-choice" + Forms::BulkUploadLettingsResume::FixChoice.new(form_params.merge(bulk_upload: @bulk_upload)) + when "confirm" + Forms::BulkUploadLettingsResume::Confirm.new(form_params.merge(bulk_upload: @bulk_upload)) + else + raise "invalid form" + end end def form_params diff --git a/app/models/forms/bulk_upload_lettings_resume/confirm.rb b/app/models/forms/bulk_upload_lettings_resume/confirm.rb new file mode 100644 index 000000000..e5f246008 --- /dev/null +++ b/app/models/forms/bulk_upload_lettings_resume/confirm.rb @@ -0,0 +1,19 @@ +module Forms + module BulkUploadLettingsResume + class Confirm + include ActiveModel::Model + include ActiveModel::Attributes + include Rails.application.routes.url_helpers + + attribute :bulk_upload + + def view_path + "bulk_upload_lettings_resume/confirm" + end + + def back_path + page_bulk_upload_lettings_resume_path(bulk_upload, page: "fix-choice") + end + end + end +end diff --git a/app/models/forms/bulk_upload_lettings_resume/fix_choice.rb b/app/models/forms/bulk_upload_lettings_resume/fix_choice.rb index df6d1d44e..d266a0dfe 100644 --- a/app/models/forms/bulk_upload_lettings_resume/fix_choice.rb +++ b/app/models/forms/bulk_upload_lettings_resume/fix_choice.rb @@ -24,6 +24,8 @@ module Forms def next_path case choice + when "create-fix-inline" + page_bulk_upload_lettings_resume_path(bulk_upload, page: "confirm") when "upload-again" if BulkUploadErrorSummaryTableComponent.new(bulk_upload:).errors? summary_bulk_upload_lettings_result_path(bulk_upload) diff --git a/app/views/bulk_upload_lettings_logs/forms/needstype.erb b/app/views/bulk_upload_lettings_logs/forms/needstype.erb index a9bc28c4f..6deec7e1d 100644 --- a/app/views/bulk_upload_lettings_logs/forms/needstype.erb +++ b/app/views/bulk_upload_lettings_logs/forms/needstype.erb @@ -1,6 +1,7 @@ <% content_for :before_content do %> <%= govuk_back_link href: @form.back_path %> <% end %> +
There are 1000 logs in this bulk upload with <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> that still need to be fixed after upload.
+ + <%= govuk_warning_text(icon_fallback_text: "Danger") do %> + You can not delete logs once you create them + <% end %> + + <%= form_with model: @form, scope: :form, url: page_bulk_upload_lettings_resume_path(@bulk_upload, page: "confirm"), method: :patch do |f| %> + <%= f.govuk_submit %> + + <%= govuk_button_link_to "Cancel", @form.back_path, secondary: true %> + <% end %> +