From f884cb274d3144cfbcdc0a41996cf81976bd4317 Mon Sep 17 00:00:00 2001 From: "rian.thwaite" Date: Mon, 3 Feb 2025 18:28:09 +0000 Subject: [PATCH 1/3] EES-5835 fix to latest release link --- .../find-statistics/PublicationReleasePage.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx b/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx index 0445a93165..383d5c8fac 100644 --- a/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx +++ b/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx @@ -40,6 +40,12 @@ const PublicationReleasePage: NextPage = ({ release }) => { rsi => rsi.isLegacyLink || rsi.description !== release.title, ); + const releaseSeriesNonLegacy = release.publication.releaseSeries.find( + rsi => !rsi.isLegacyLink, + ); + + console.log(releaseSeriesNonLegacy); + // 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. @@ -126,15 +132,11 @@ const PublicationReleasePage: NextPage = ({ release }) => { View latest data:{' '} - { - release.publication.releaseSeries.find( - rsi => !rsi.isLegacyLink, - )?.description - } + {releaseSeriesNonLegacy?.description} )} From 038234fa7892df274f794770598c85e8f5e41e42 Mon Sep 17 00:00:00 2001 From: "rian.thwaite" Date: Mon, 3 Feb 2025 18:30:06 +0000 Subject: [PATCH 2/3] remove console log --- .../src/modules/find-statistics/PublicationReleasePage.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx b/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx index 383d5c8fac..c590a649db 100644 --- a/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx +++ b/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx @@ -44,8 +44,6 @@ const PublicationReleasePage: NextPage = ({ release }) => { rsi => !rsi.isLegacyLink, ); - console.log(releaseSeriesNonLegacy); - // 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. From 7fcca60c5473685292cefd47c6cef7fd350bb390 Mon Sep 17 00:00:00 2001 From: "rian.thwaite" Date: Tue, 4 Feb 2025 09:51:24 +0000 Subject: [PATCH 3/3] EES-5835 rename releaseSeriesNonLegacy to latestReleaseSeriesItem --- .../src/modules/find-statistics/PublicationReleasePage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx b/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx index c590a649db..3102a3da7b 100644 --- a/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx +++ b/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx @@ -40,7 +40,7 @@ const PublicationReleasePage: NextPage = ({ release }) => { rsi => rsi.isLegacyLink || rsi.description !== release.title, ); - const releaseSeriesNonLegacy = release.publication.releaseSeries.find( + const latestReleaseSeriesItem = release.publication.releaseSeries.find( rsi => !rsi.isLegacyLink, ); @@ -130,11 +130,11 @@ const PublicationReleasePage: NextPage = ({ release }) => { View latest data:{' '} - {releaseSeriesNonLegacy?.description} + {latestReleaseSeriesItem?.description} )}