Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show reason for challenge to admins when partnership already exists #4892

Merged
merged 1 commit into from
Jun 5, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ def create_relationship!
end
end

def existing_partnership
@existing_partnership = Partnership.find_by(cohort:, school:, lead_provider_id:, delivery_partner_id:)
end

def existing_partnership_challenged_at
existing_partnership.challenged_at.to_formatted_s(:govuk)
end

def existing_partnership_challenge_reason
existing_partnership.challenge_reason.humanize
end

def selected_lead_provider_name
selected_lead_provider&.name
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
<% row.with_key { "Delivery partner" } %>
<% row.with_value { @wizard.selected_delivery_partner_name } %>
<% end %>
<% if @wizard.existing_partnership.challenged_at %>
<% summary_list.with_row do |row| %>
<% row.with_key { "Challenged at" } %>
<% row.with_value { @wizard.existing_partnership_challenged_at } %>
<% end %>
<% summary_list.with_row do |row| %>
<% row.with_key { "Challenge reason" } %>
<% row.with_value { @wizard.existing_partnership_challenge_reason } %>
<% end %>
<% end %>
<% end %>

<%= govuk_link_to "Return to change relationship", @wizard.show_path_for(step: :change_training_programme), no_visited_state: true %>
Expand Down
Loading