Skip to content

Commit

Permalink
Merge pull request #2030 from unboxed/review-conditions
Browse files Browse the repository at this point in the history
Move review conditions to different partial
  • Loading branch information
EGiataganas authored Nov 12, 2024
2 parents 4a8f07f + fc67c05 commit 112f903
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,115 +14,9 @@
) %>
</div>
</li>
<% if @planning_application.possibly_immune? && @planning_application.immunity_detail.reviews.evidence.any? %>
<%= render(
TaskListItems::Reviewing::ImmunityDetailsComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% if @planning_application.possibly_immune? && @planning_application.immunity_detail.reviews.enforcement.any? %>
<%= render(
TaskListItems::Reviewing::ImmunityEnforcementComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% if @planning_application.review_heads_of_terms? %>
<%= render(
TaskListItems::Reviewing::HeadsOfTermsComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% if @planning_application.review_permitted_development_rights? %>
<%= render(
TaskListItems::Reviewing::PermittedDevelopmentRightComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<%= render(
TaskListItems::Reviewing::AssessmentDetailsComponent.new(
planning_application: @planning_application
)
) %>
<% if @planning_application.consideration_set.current_review %>
<%= render(
TaskListItems::Reviewing::ConsiderationsComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% if @planning_application.application_type.planning_conditions? %>
<% if @planning_application.condition_set&.current_review&.started? %>
<%= render(
TaskListItems::Reviewing::ConditionsComponent.new(
condition_set: @planning_application.condition_set
)
) %>
<% end %>
<% if @planning_application.pre_commencement_condition_set&.current_review&.started? %>
<%= render(
TaskListItems::Reviewing::ConditionsComponent.new(
condition_set: @planning_application.pre_commencement_condition_set
)
) %>
<% end %>
<% end %>
<% if @planning_application.application_type.informatives? %>
<% if @planning_application.informative_set&.current_review&.started? %>
<%= render(
TaskListItems::Reviewing::InformativesComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% end %>
<%= render partial: "policy_classes", locals: {planning_application: @planning_application, policy_class: @policy_class} %>
<% if @planning_application.application_type.assess_against_policies? %>
<%= render partial: "policy_classes_new", locals: {planning_application: @planning_application, policy_class: @policy_class} %>
<% end %>
<% if @planning_application.committee_decision&.current_review %>
<%= render(
TaskListItems::Reviewing::CommitteeComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<%= render "sign_off_recommendation" %>
<% if @planning_application.committee_decision.present? && @planning_application.committee_decision.recommend? %>
<%= render(
TaskListItems::Reviewing::NotifyCommitteeComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% if @planning_application.committee_decision.present? && @planning_application.committee_decision.recommend? %>
<li class="app-task-list__item">
<span class="app-task-list__task-name">
<%= link_to_if(
@planning_application.in_committee?,
"Update decision notice after committee",
edit_planning_application_review_recommendation_path(@planning_application, @planning_application.recommendation),
aria: {describedby: "review_assessment-completed"},
class: "govuk-link"
) %>
</span>
<div class="govuk-task-list__status app-task-list__task-tag">
<%= render(
StatusTags::AddCommitteeDecisionComponent.new(
planning_application: @planning_application
)
) %>
</div>
</li>
<% end %>
</ul>
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<h2 class="app-task-list__section govuk-!-margin-top-8">
Review conditions
</h2>
<ul class="app-task-list__items" id="review-conditions-section">
<% if @planning_application.possibly_immune? && @planning_application.immunity_detail.reviews.evidence.any? %>
<%= render(
TaskListItems::Reviewing::ImmunityDetailsComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% if @planning_application.possibly_immune? && @planning_application.immunity_detail.reviews.enforcement.any? %>
<%= render(
TaskListItems::Reviewing::ImmunityEnforcementComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% if @planning_application.review_heads_of_terms? %>
<%= render(
TaskListItems::Reviewing::HeadsOfTermsComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% if @planning_application.review_permitted_development_rights? %>
<%= render(
TaskListItems::Reviewing::PermittedDevelopmentRightComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% if @planning_application.consideration_set.current_review %>
<%= render(
TaskListItems::Reviewing::ConsiderationsComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% if @planning_application.application_type.planning_conditions? %>
<% if @planning_application.condition_set&.current_review&.started? %>
<%= render(
TaskListItems::Reviewing::ConditionsComponent.new(
condition_set: @planning_application.condition_set
)
) %>
<% end %>
<% if @planning_application.pre_commencement_condition_set&.current_review&.started? %>
<%= render(
TaskListItems::Reviewing::ConditionsComponent.new(
condition_set: @planning_application.pre_commencement_condition_set
)
) %>
<% end %>
<% end %>
<% if @planning_application.application_type.informatives? %>
<% if @planning_application.informative_set&.current_review&.started? %>
<%= render(
TaskListItems::Reviewing::InformativesComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% end %>
<%= render partial: "policy_classes", locals: {planning_application: @planning_application, policy_class: @policy_class} %>
<% if @planning_application.application_type.assess_against_policies? %>
<%= render partial: "policy_classes_new", locals: {planning_application: @planning_application, policy_class: @policy_class} %>
<% end %>
<% if @planning_application.committee_decision&.current_review %>
<%= render(
TaskListItems::Reviewing::CommitteeComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<%= render "sign_off_recommendation" %>
<% if @planning_application.committee_decision.present? && @planning_application.committee_decision.recommend? %>
<%= render(
TaskListItems::Reviewing::NotifyCommitteeComponent.new(
planning_application: @planning_application
)
) %>
<% end %>
<% if @planning_application.committee_decision.present? && @planning_application.committee_decision.recommend? %>
<li class="app-task-list__item">
<span class="app-task-list__task-name">
<%= link_to_if(
@planning_application.in_committee?,
"Update decision notice after committee",
edit_planning_application_review_recommendation_path(@planning_application, @planning_application.recommendation),
aria: {describedby: "review_assessment-completed"},
class: "govuk-link"
) %>
</span>
<div class="govuk-task-list__status app-task-list__task-tag">
<%= render(
StatusTags::AddCommitteeDecisionComponent.new(
planning_application: @planning_application
)
) %>
</div>
</li>
<% end %>
</ul>
6 changes: 6 additions & 0 deletions app/views/planning_applications/review/tasks/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
</div>
</div>

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<%= render "review_conditions" %>
</div>
</div>

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<%= render(Reviewing::Tasks::AfterSignOffComponent.new(planning_application: @planning_application)) %>
Expand Down

0 comments on commit 112f903

Please sign in to comment.