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
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ OTP_SECRET_ENCRYPTION_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
NOTIFY_API_KEY=xxxxx
NOTIFY_EMAIL_TEMPLATE_ID=xxxxx
NOTIFY_SMS_TEMPLATE_ID=xxxxx
GROUPED_PROPOSAL_DETAILS_FEATURE=enabled
GOOGLE_TAG_MANAGER_ID=GTM-XXXXXXXX
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,21 @@ def check_red_line_boundary_task_path
end

def check_and_request_documents_task_path
BopsPreapps::Engine.routes.url_helpers.task_path(
reference: @planning_application.reference,
slug: "check-and-validate/check-tag-and-confirm-documents/check-and-request-documents"
)
return unless redirect_to_check_and_request_documents_task?

if @planning_application.pre_application?
BopsPreapps::Engine.routes.url_helpers.task_path(
reference: @planning_application.reference,
slug: "check-and-validate/check-tag-and-confirm-documents/check-and-request-documents"
)
else
task_path(
reference: @planning_application.reference,
slug: "check-and-validate/check-tag-and-confirm-documents/check-and-request-documents"
)
end
end
helper_method :check_and_request_documents_task_path

def set_validation_request
return if params[:id].blank?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@
data: {unsaved_changes_target: "form", action: "submit->unsaved-changes#handleSubmit"} do |form| %>

<%= form.hidden_field :old_document_id, value: @document.id %>
<% return_to = params[:return_to].presence || params[:redirect_to].presence %>
<% if return_to.nil? && @planning_application.pre_application? %>
<% return_to = BopsPreapps::Engine.routes.url_helpers.task_path(
reference: @planning_application.reference,
slug: "check-and-validate/check-tag-and-confirm-documents/check-and-request-documents"
) %>
<% end %>
<%= form.hidden_field :return_to, value: return_to if return_to.present? %>
<% return_to = params[:return_to].presence || params[:redirect_to].presence || check_and_request_documents_task_path %>
<%= form.hidden_field :return_to, value: return_to %>

<%= form.govuk_error_summary %>

Expand Down
2 changes: 2 additions & 0 deletions spec/support/show_sidebar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
ensure
Rails.configuration.use_new_sidebar_layout = existing_value
end
else
example.run
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
)
end

it "I can mark documents as invalid and edit/delete the validation request", :capybara do
it "I can mark documents as invalid and edit/delete the validation request", :capybara, show_sidebar: false do
click_link "Check and validate"
within "#main-content" do
click_link "Review documents"
Expand Down Expand Up @@ -595,6 +595,8 @@
request.save!
request.old_document.archive("replaced by new document")

visit "/planning_applications/#{planning_application.reference}"

find("span", text: "Documents").click
click_link "Manage documents"

Expand Down
Loading