Skip to content

Commit

Permalink
Redirect review tasks to anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamineskola committed Feb 18, 2025
1 parent 06e3f8e commit cd19043
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 18 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), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "check-cil"), notice: t(".success")
else
render :edit
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def update
respond_to do |format|
format.html do
if @committee_decision.update(committee_decision_params)
redirect_to planning_application_review_tasks_path(@planning_application), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "recommendation_to_committee_section"), notice: t(".success")
else
flash.now[:alert] = @committee_decision.errors.messages.values.flatten.join(", ")
render_review_tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def update
respond_to do |format|
format.html do
if @condition_set.update(condition_set_review_params)
redirect_to planning_application_review_tasks_path(@planning_application),
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-conditions"),
notice: I18n.t("review.conditions.update.success")
else
flash.now[:alert] = @condition_set.errors.messages.values.flatten.join(", ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def update
respond_to do |format|
format.html do
if @consideration.update(consideration_params)
redirect_to planning_application_review_tasks_path(@planning_application), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "considerations_section"), notice: t(".success")
else
render :edit
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def update
respond_to do |format|
format.html do
if @review.update(review_params)
redirect_to planning_application_review_tasks_path(@planning_application), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-considerations"), notice: t(".success")
else
flash.now[:alert] = @review.errors.messages.values.flatten.join(", ")
render_review_tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def update
respond_to do |format|
format.html do
if heads_of_term.update(review_params)
redirect_to planning_application_review_tasks_path(@planning_application),
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-heads-of-terms"),
notice: I18n.t("review.heads_of_terms.update.success")
else
flash.now[:alert] = heads_of_term.errors.messages.values.flatten.join(", ")
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),
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-evidence"),
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),
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-enforcement"),
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 @@ -17,7 +17,7 @@ def update
respond_to do |format|
format.html do
if @informative.update(informative_params)
redirect_to planning_application_review_tasks_path(@planning_application), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-informatives"), notice: t(".success")
else
render :edit
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def update
respond_to do |format|
format.html do
if @review.update(review_params)
redirect_to planning_application_review_tasks_path(@planning_application), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-informatives"), notice: t(".success")
else
flash.now[:alert] = @review.errors.messages.values.flatten.join(", ")
render_review_tasks
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), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "check-neighbour-notifications"), 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), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "check-neighbour-notifications"), 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 @@ -14,7 +14,7 @@ def update
respond_to do |format|
format.html do
if @permitted_development_right.update(permitted_development_right_params)
redirect_to planning_application_review_tasks_path(@planning_application),
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-permitted-development-rights"),
notice: I18n.t("permitted_development_rights.successfully_updated")
else
flash.now[:alert] = @permitted_development_right.errors.messages.values.flatten.join(", ")
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), notice: t(".success")
redirect_to planning_application_review_policy_areas_policy_classes_path(@planning_application, anchor: "review-legislation"), notice: t(".success")
else
render :edit
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def update
respond_to do |format|
format.html do
if @pre_commencement_condition_set.update(review_params)
redirect_to planning_application_review_tasks_path(@planning_application),
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "review-pre-commencement-conditions"),
notice: I18n.t("review.conditions.update.success")
else
flash.now[:alert] = @pre_commencement_condition_set.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 @assessment_detail.update(assessment_detail_params)
redirect_to planning_application_review_tasks_path(@planning_application), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "check-publicity"), 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), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "check-publicity"), 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 @@ -28,7 +28,7 @@ def create
)

if @recommendation.save_and_submit(recommendation_form_params)
redirect_to planning_application_review_tasks_path(@planning_application), notice: t(".success")
redirect_to planning_application_review_tasks_path(@planning_application, anchor: "recommendation_to_committee_section"), notice: t(".success")
else
render :new
end
Expand Down

0 comments on commit cd19043

Please sign in to comment.