Skip to content

Commit

Permalink
Rename anchors for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamineskola committed Feb 18, 2025
1 parent 11a756a commit 1d3d4ec
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def update
@previous_decision = @planning_application.cil_liable
if @planning_application.update(cil_liability_params)
record_audit_for_cil_liability!
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "check-cil"), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-cil-liability"), notice: t(".success")
else
render :edit
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def update
respond_to do |format|
format.html do
if @review_immunity_detail.update(review_immunity_detail_params)
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-evidence"),
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-immunity-details"),
notice: I18n.t("planning_applications.review..immunity_details.successfully_updated")
else
flash.now[:alert] = @review_immunity_detail.errors.messages.values.flatten.join(", ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def update
respond_to do |format|
format.html do
if @review_immunity_detail.update(review_immunity_detail_params)
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-enforcement"),
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-immunity-enforcements"),
notice: I18n.t("review_immunity_enforcements.successfully_updated")
else
flash.now[:alert] = @review_immunity_detail.errors.messages.values.flatten.join(", ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def update
respond_to do |format|
format.html do
if @neighbour_review.update(review_params) && @consultation.update(status: consultation_status)
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "check-neighbour-notifications"), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-neighbour-responses"), notice: t(".success")
else
error = @neighbour_review.errors.group_by_attribute.transform_values { |errors| errors.map(&:full_message) }.values.flatten
redirect_failed_create_error(error)
Expand All @@ -27,7 +27,7 @@ def create
respond_to do |format|
format.html do
if @neighbour_review.save && @consultation.update(status: consultation_status)
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "check-neighbour-notifications"), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-neighbour-responses"), notice: t(".success")
else
error = @neighbour_review.errors.group_by_attribute.transform_values { |errors| errors.map(&:full_message) }.values.flatten
redirect_failed_create_error(error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def update
@form.update(policy_section_status_params)

if @planning_application_policy_class.update_review(review_params)
redirect_to planning_application_review_policy_areas_policy_classes_path(@planning_application, anchor: "review-legislation"), notice: t(".success")
redirect_to planning_application_review_policy_areas_policy_classes_path(@planning_application, anchor: "review-policy-classes"), notice: t(".success")
else
render :edit
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def update
respond_to do |format|
format.html do
if @assessment_detail.update(assessment_detail_params)
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "check-publicity"), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-publicities"), notice: t(".success")
else
flash.now[:alert] = @assessment_detail.errors.messages.values.flatten.join(", ")
render_review_tasks
Expand All @@ -27,7 +27,7 @@ def create
respond_to do |format|
format.html do
if @assessment_detail.save
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "check-publicity"), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-publicities"), notice: t(".success")
else
flash.now[:alert] = @assessment_detail.errors.messages.values.flatten.join(", ")
render_review_tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<%= render "shared/dates_and_assignment_header" %>

<ul class="app-task-list__items" id="review-legislation">
<ul class="app-task-list__items" id="review-policy-classes">
<% @planning_application.planning_application_policy_classes.order(:policy_class_id).each do |policy_class| %>
<% next if policy_class.current_review.not_started? || policy_class.current_review.in_progress? %>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% accordion.with_heading(text: "Review assessment") %>

<% if @planning_application.application_type.cil? %>
<% accordion.with_section(id: "check-cil", expanded: false) do |section| %>
<% accordion.with_section(id: "review-cil-liability", expanded: false) do |section| %>
<%= section.with_heading(text: "Check Community Infrastructure Levy (CIL)") %>
<%= section.with_status do %>
<%= render(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<% end %>

<% if @planning_application.possibly_immune? && @planning_application.immunity_detail.reviews.evidence.any? %>
<%= accordion.with_section(id: "review-evidence", expanded: @planning_application.immunity_detail.current_evidence_review_immunity_detail.errors.any?) do |section| %>
<%= accordion.with_section(id: "review-immunity-details", expanded: @planning_application.immunity_detail.current_evidence_review_immunity_detail.errors.any?) do |section| %>
<% section.with_heading(text: "Review evidence of immunity") %>

<% section.with_status do %>
Expand All @@ -47,14 +47,14 @@
<%= govuk_link_to "Show evidence", planning_application_review_immunity_detail_path(@planning_application, @planning_application.immunity_detail.current_evidence_review_immunity_detail) %>
<% end %>

<% section.with_footer(id: "review-evidence-form") do %>
<% section.with_footer(id: "review-immunity-details-form") do %>
<%= render(partial: "planning_applications/review/immunity_details/form") %>
<% end %>
<% end %>
<% end %>

<% if @planning_application.possibly_immune? && @planning_application.immunity_detail.reviews.enforcement.any? %>
<%= accordion.with_section(id: "review-enforcement", expanded: @planning_application.immunity_detail.current_enforcement_review_immunity_detail.errors.any?) do |section| %>
<%= accordion.with_section(id: "review-immunity-enforcements", expanded: @planning_application.immunity_detail.current_enforcement_review_immunity_detail.errors.any?) do |section| %>
<% section.with_heading(text: "Review assessment of immunity") %>

<% section.with_status do %>
Expand All @@ -69,7 +69,7 @@
<%= render(partial: "planning_applications/review/immunity_enforcements/details") %>
<% end %>

<% section.with_footer(id: "review-enforcement-form") do %>
<% section.with_footer(id: "review-immunity-enforcements-form") do %>
<%= render(partial: "planning_applications/review/immunity_enforcements/form") %>
<% end %>
<% end %>
Expand Down Expand Up @@ -167,7 +167,7 @@

<ul class="app-task-list__items">
<% if @planning_application.application_type.assess_against_policies? %>
<li class="app-task-list__item" id="review-legislation">
<li class="app-task-list__item" id="review-policy-classes">
<span class="app-task-list__task-name">
<%= govuk_link_to "Review assessment against legislation", planning_application_review_policy_areas_policy_classes_path(@planning_application) %>
</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%= bops_task_accordion(id: "review-consultation") do |accordion| %>
<% accordion.with_heading(text: "Review consultation") %>
<%= accordion.with_section(id: "check-neighbour-notifications", expanded: @neighbour_review.errors.any?) do |section| %>
<%= accordion.with_section(id: "review-neighbour-responses", expanded: @neighbour_review.errors.any?) do |section| %>
<% section.with_heading(text: "Check neighbour notifications") %>

<% section.with_status do %>
Expand All @@ -19,7 +19,7 @@
<% end %>
<% end %>

<%= accordion.with_section(id: "check-publicity", expanded: @planning_application.existing_or_new_check_publicity.errors.any?) do |section| %>
<%= accordion.with_section(id: "review-publicities", expanded: @planning_application.existing_or_new_check_publicity.errors.any?) do |section| %>
<% section.with_heading(text: "Check publicity") %>
<% section.with_status do %>
<%= render(
Expand All @@ -37,7 +37,7 @@
<%= render(partial: "planning_applications/review/publicities/press_notice") %>
<% end %>

<% section.with_footer(id: "check-publicity-form") do %>
<% section.with_footer(id: "review-publicities-form") do %>
<%= render(partial: "planning_applications/review/publicities/form") %>
<% end %>
<% end %>
Expand Down
10 changes: 5 additions & 5 deletions spec/system/planning_applications/assessing/immunity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

click_button "Review evidence of immunity"

within("#review-evidence") do
within("#review-immunity-details") do
choose "Return with comments"
fill_in "Add a comment", with: "Please re-assess the evidence of immunity"
click_button "Save and mark as complete"
Expand All @@ -120,13 +120,13 @@

click_button "Review assessment of immunity"

within("#review-enforcement") do
within("#review-immunity-enforcements") do
expect(page).to have_content("Assessor decision: Yes")
expect(page).to have_content("Reason: no action is taken within 4 years for an unauthorised change of use to a single dwellinghouse")
expect(page).to have_content("Summary: A summary")
end

within("#review-enforcement-form") do
within("#review-immunity-enforcements-form") do
choose "Return with comments"
fill_in "Add a comment", with: "Please re-assess immunity enforcement response"
click_button "Save and mark as complete"
Expand Down Expand Up @@ -188,15 +188,15 @@

click_button "Review evidence of immunity"

within("#review-evidence") do
within("#review-immunity-details") do
choose "Agree"
click_button "Save and mark as complete"
end
expect(page).to have_content("Review immunity details was successfully updated")

click_button "Review assessment of immunity"

within("#review-enforcement") do
within("#review-immunity-enforcements") do
expect(page).to have_content("Assessor decision: No")
expect(page).to have_content("Reason: Application is not immune")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
it "the reviewer can mark it as not needing confirmation" do
visit "planning_applications/#{planning_application.id}/review/tasks"

within "#check-cil" do
within "#review-cil-liability" do
expect(page).to have_content "Not started"
end

click_button "Check Community Infrastructure Levy (CIL)"

expect(page).to have_content "The validation officer did not confirm whether the application is liable for CIL."

within "#check-cil" do
within "#review-cil-liability" do
click_button "Save and mark as complete"
end

expect(page).to have_content "Review of CIL liability successfully updated"

within "#check-cil" do
within "#review-cil-liability" do
expect(page).to have_content "Completed"
end

Expand All @@ -58,7 +58,7 @@
it "the reviewer can update it" do
visit "planning_applications/#{planning_application.id}/review/tasks"

within "#check-cil" do
within "#review-cil-liability" do
expect(page).to have_content "Not started"
end

Expand All @@ -68,13 +68,13 @@

choose "Yes"

within "#check-cil" do
within "#review-cil-liability" do
click_button "Save and mark as complete"
end

expect(page).to have_content "Review of CIL liability successfully updated"

within "#check-cil" do
within "#review-cil-liability" do
expect(page).to have_content "Completed"
end

Expand All @@ -93,21 +93,21 @@
it "the reviewer can mark it as correct" do
visit "planning_applications/#{planning_application.id}/review/tasks"

within "#check-cil" do
within "#review-cil-liability" do
expect(page).to have_content "Not started"
end

click_button "Check Community Infrastructure Levy (CIL)"

expect(page).to have_content "The validation officer marked this application as liable for CIL"

within "#check-cil" do
within "#review-cil-liability" do
click_button "Save and mark as complete"
end

expect(page).to have_content "Review of CIL liability successfully updated"

within "#check-cil" do
within "#review-cil-liability" do
expect(page).to have_content "Completed"
end

Expand All @@ -120,7 +120,7 @@
it "the reviewer can change it" do
visit "planning_applications/#{planning_application.id}/review/tasks"

within "#check-cil" do
within "#review-cil-liability" do
expect(page).to have_content "Not started"
end

Expand All @@ -130,13 +130,13 @@

choose "No"

within "#check-cil" do
within "#review-cil-liability" do
click_button "Save and mark as complete"
end

expect(page).to have_content "Review of CIL liability successfully updated"

within "#check-cil" do
within "#review-cil-liability" do
expect(page).to have_content "Completed"
end

Expand All @@ -155,7 +155,7 @@
it "does not have a section to review CIL" do
visit "planning_applications/#{planning_application.reference}/review/tasks"

expect(page).not_to have_css("#check-cil")
expect(page).not_to have_css("#review-cil-liability")
expect(page).not_to have_content("Check Community Infrastructure Levy (CIL)")
end
end
Expand Down
Loading

0 comments on commit 1d3d4ec

Please sign in to comment.