Skip to content

Commit

Permalink
Merge pull request #5584 from dfe-analytical-services/EES-5835-releas…
Browse files Browse the repository at this point in the history
…e-slug-hotfix

EES-5835 fix to latest release link
  • Loading branch information
rianski authored Feb 4, 2025
2 parents 71caccc + 7fcca60 commit c69bdfb
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const PublicationReleasePage: NextPage<Props> = ({ release }) => {
rsi => rsi.isLegacyLink || rsi.description !== release.title,
);

const latestReleaseSeriesItem = release.publication.releaseSeries.find(
rsi => !rsi.isLegacyLink,
);

// Re-order updates in descending order in-case the cached
// release from the content API has not been updated to
// have the updates in the correct order.
Expand Down Expand Up @@ -126,15 +130,11 @@ const PublicationReleasePage: NextPage<Props> = ({ release }) => {
<Link
className="govuk-!-display-none-print govuk-!-display-block govuk-!-margin-bottom-3"
unvisited
to={`/find-statistics/${release.publication.slug}/${release.slug}`}
to={`/find-statistics/${release.publication.slug}/${latestReleaseSeriesItem?.releaseSlug}`}
>
View latest data:{' '}
<span className="govuk-!-font-weight-bold">
{
release.publication.releaseSeries.find(
rsi => !rsi.isLegacyLink,
)?.description
}
{latestReleaseSeriesItem?.description}
</span>
</Link>
)}
Expand Down

0 comments on commit c69bdfb

Please sign in to comment.