Skip to content

Commit

Permalink
Use relative URL for worldwide organisation links
Browse files Browse the repository at this point in the history
Links from the Worldwide Organisation pages currently use the `web_url`,
which is absolute, and never includes the draft part of the URL.

This means that a user viewing a draft Worldwide Organisation will be
taken to the live version of the page.

Updating to make the URL relative, meaning users are always taken to the
correct version of the page.

This was never previously an issue, since worldwide organisations have
not previously been editionable.
  • Loading branch information
brucebolt committed May 8, 2024
1 parent 8885d99 commit 74f4578
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/presenters/worldwide_organisation_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def person_in_primary_role

{
name: person["title"],
href: person["web_url"],
href: person["base_path"],
image_url: person["details"]["image"]["url"],
image_alt: person["details"]["image"]["alt_text"],
description: presented_title_for_roles(current_roles),
Expand All @@ -72,7 +72,7 @@ def people_in_non_primary_roles

{
name: person["title"],
href: person["web_url"],
href: person["base_path"],
description: presented_title_for_roles(current_roles),
}
end
Expand Down Expand Up @@ -110,7 +110,7 @@ def corporate_information_pages
return if ordered_cips.blank?

ordered_cips.map do |cip|
link = cips.find { |cp| cp["content_id"] == cip["content_id"] }["web_url"]
link = cips.find { |cp| cp["content_id"] == cip["content_id"] }["base_path"]
link_to(cip["title"], link, class: "govuk-link").html_safe
end
end
Expand Down

0 comments on commit 74f4578

Please sign in to comment.