Skip to content

Commit

Permalink
Fix: Shared project details change links
Browse files Browse the repository at this point in the history
These partials are shared by conversion and transfer projects and so the
recent 'Change' links introduced to conversions also appeared on
transfers when they should not.

This commit corrects this only showing the change links on conversion
projects.
  • Loading branch information
mec committed Apr 8, 2024
1 parent 10d1090 commit 33cb13e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
summary_list.with_row do |row|
row.with_key { t("project_information.show.advisory_board_details.rows.advisory_board_date") }
row.with_value { project.advisory_board_date.to_date.to_formatted_s(:govuk) }
row.with_action(text: "Change", href: conversions_edit_path(@project, anchor: "advisory-board"), visually_hidden_text: "the advisory board date")
if project.type == "Conversion::Project"
row.with_action(text: "Change", href: conversions_edit_path(@project, anchor: "advisory-board"), visually_hidden_text: "the advisory board date")
end
end
summary_list.with_row do |row|
row.with_key { t("project_information.show.advisory_board_details.rows.advisory_board_conditions") }
row.with_value { simple_format(project.advisory_board_conditions, class: "govuk-body") }
row.with_action(text: "Change", href: conversions_edit_path(@project, anchor: "advisory-board"), visually_hidden_text: "the advisory board conditions")
if project.type == "Conversion::Project"
row.with_action(text: "Change", href: conversions_edit_path(@project, anchor: "advisory-board"), visually_hidden_text: "the advisory board conditions")
end
end
end %>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
summary_list.with_row do |row|
row.with_key { t("project_information.show.incoming_trust_details.rows.ukprn") }
row.with_value { incoming_trust.ukprn.to_s }
row.with_action(text: "Change", href: conversions_edit_path(@project, anchor: "incoming-trust-ukprn"), visually_hidden_text: "the incoming trust UKPRN")
if project.type == "Conversion::Project"
row.with_action(text: "Change", href: conversions_edit_path(@project, anchor: "incoming-trust-ukprn"), visually_hidden_text: "the incoming trust UKPRN")
end
end
summary_list.with_row do |row|
row.with_key { t("project_information.show.incoming_trust_details.rows.group_identifier") }
Expand Down

0 comments on commit 33cb13e

Please sign in to comment.