Skip to content

Commit

Permalink
Show challenged reason if partnership exists and has been challenged
Browse files Browse the repository at this point in the history
To provide more context to super users why the partnership can't be created.
  • Loading branch information
leoapost committed Jun 5, 2024
1 parent cc4a709 commit a052585
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ def create_relationship!
end
end

def existing_partnership
@existing_partnership = Partnership.find_by(cohort:, school:, lead_provider_id:, delivery_partner_id:)
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 { "Challenged 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

0 comments on commit a052585

Please sign in to comment.