Skip to content

Commit

Permalink
Merge pull request #2124 from unboxed/site_map_corrects
Browse files Browse the repository at this point in the history
Move sitemap corrects to its own task
  • Loading branch information
EGiataganas authored Jan 24, 2025
2 parents 90d6b63 + 1d05421 commit 50c64f4
Show file tree
Hide file tree
Showing 8 changed files with 261 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def permitted_params
:proposal_details_match_documents,
:proposal_details_match_documents_comment,
:site_map_correct,
:site_map_correct_comment,
:proposal_measurements_match_documents,
{proposal_measurement: %i[eaves_height max_height depth]}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
:site_map_correct,
legend: {text: t(".is_the_red"), size: "s"}
) do %>
<%= render "shared/location_map", locals: {in_accordion: true, geojson: @planning_application.boundary_geojson} %>
<br>
<% if can_edit %>
<%= form.govuk_radio_button(
:site_map_correct,
Expand All @@ -16,12 +18,14 @@
label: {text: t(".no")},
checked: form.object.default_site_map_correct_to_no?
) do %>
<% unless form.object.open_red_line_boundary_change_requests? %>
<%= govuk_link_to t(".request_red_line_boundary_change"), new_planning_application_validation_validation_request_path(
planning_application,
type: "red_line_boundary_change"
) %>
<% end %>
<% if planning_application.pre_application? %>
<%= form.govuk_text_area :site_map_correct_comment, label: {text: "Add a comment"} %>
<% elsif !form.object.open_red_line_boundary_change_requests? && !planning_application.pre_application? %>
<%= govuk_link_to t(".request_red_line_boundary_change"), new_planning_application_validation_validation_request_path(
planning_application,
type: "red_line_boundary_change"
) %>
<% end %>
<% end %>
<% else %>
<%= form.govuk_radio_button(
Expand All @@ -39,3 +43,9 @@
}
) %>
<% end %>
<% if !can_edit && consistency_checklist.site_map_correct_comment %>
<h4 class="govuk-heading-s">Comment</h4>
<p class="govuk-body">
<%= render(FormattedContentComponent.new(text: consistency_checklist.site_map_correct_comment)) %>
<p>
<% end %>
6 changes: 3 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ en:
edit_check_description: Edit check description, documents and proposal
introduction:
application_details: Application details
check_description_documents: Check description, documents, and proposal details
check_description_documents: Check application details
checking_plans_and: Checking plans and description
review_the_items: Review the description, site map, and documents submitted by the applicant to check they are consistent.
proposal_details_match_documents:
Expand All @@ -1259,7 +1259,7 @@ en:
reason: 'Reason:'
view_and_edit: View and edit request
site_map_correct:
is_the_red: Is the red line on the site map correct for the site and proposed works?
is_the_red: Is the site map correct?
'no': 'No'
request_red_line_boundary_change: Request a change to the red line boundary
'yes': 'Yes'
Expand Down Expand Up @@ -1408,7 +1408,7 @@ en:
check_consistency:
check_application: Check application
complete: Complete
description_documents_and: Check description, documents and proposal details
description_documents_and: Check application details
in_assessment: In assessment
permitted_development_rights: Permitted development rights
index:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class AddSiteMapCorrectCommentToConsistencyChecklists < ActiveRecord::Migration[7.2]
def change
add_column :consistency_checklists, :site_map_correct_comment, :text
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.2].define(version: 2024_12_19_161821) do
ActiveRecord::Schema[7.2].define(version: 2025_01_20_122725) do
# These are extensions that must be enabled in order to support this database
enable_extension "btree_gin"
enable_extension "plpgsql"
Expand Down Expand Up @@ -220,6 +220,7 @@
t.datetime "updated_at", null: false
t.integer "site_map_correct", default: 0, null: false
t.integer "proposal_measurements_match_documents", default: 0, null: false
t.text "site_map_correct_comment"
t.index ["planning_application_id"], name: "ix_consistency_checklists_on_planning_application_id"
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
within(".app-task-list") do
within("#check-consistency-assessment-tasks") do
expect(page).to have_content("Check application")
expect(page).to have_link("Check description, documents and proposal details")
expect(page).to have_link("Check application details")
expect(page).to have_link("Permitted development rights")

expect(page).not_to have_link("Evidence of immunity")
Expand Down Expand Up @@ -66,7 +66,7 @@
within(".app-task-list") do
within("#check-consistency-assessment-tasks") do
expect(page).to have_content("Check application")
expect(page).to have_link("Check description, documents and proposal details")
expect(page).to have_link("Check application details")
expect(page).to have_link("Permitted development rights")

expect(page).not_to have_link("Evidence of immunity")
Expand Down Expand Up @@ -224,7 +224,7 @@
within(".app-task-list") do
within("#check-consistency-assessment-tasks") do
expect(page).to have_content("Check application")
expect(page).to have_link("Check description, documents and proposal details")
expect(page).to have_link("Check application details")
expect(page).to have_link("Evidence of immunity")
expect(page).to have_link("Immunity/permitted development rights")
end
Expand Down
Loading

0 comments on commit 50c64f4

Please sign in to comment.