From f930129dd481332f7f440f0cbe49a3e00c837882 Mon Sep 17 00:00:00 2001 From: BE <137172332+VWSCoronaDashboard29@users.noreply.github.com> Date: Tue, 7 Nov 2023 16:48:56 +0100 Subject: [PATCH] fix(COR-1851): Fix incorrect dates being displayed on positive tests page (#4931) Co-authored-by: VWSCoronaDashboard29 --- .../app/src/pages/gemeente/[code]/positieve-testen.tsx | 10 +++++----- packages/app/src/pages/landelijk/positieve-testen.tsx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/app/src/pages/gemeente/[code]/positieve-testen.tsx b/packages/app/src/pages/gemeente/[code]/positieve-testen.tsx index 55652b3f19..2683347f11 100644 --- a/packages/app/src/pages/gemeente/[code]/positieve-testen.tsx +++ b/packages/app/src/pages/gemeente/[code]/positieve-testen.tsx @@ -43,7 +43,7 @@ const selectLokalizeTexts = (siteText: SiteText) => ({ type LokalizeTexts = ReturnType; -const pageMetrics = ['tested_overall']; +const pageMetrics = ['tested_overall_archived_20230331']; export const getStaticProps = createGetStaticProps( ({ locale }: { locale: keyof Languages }) => getLokalizeTexts(selectLokalizeTexts, locale), @@ -78,13 +78,13 @@ export const getStaticProps = createGetStaticProps( ); function PositivelyTestedPeople(props: StaticProps) { - const { pageText, selectedGmData: data, selectedArchivedGmData: archived_data, archivedChoropleth, municipalityName, content, lastGenerated } = props; + const { pageText, selectedGmData: data, selectedArchivedGmData: archivedData, archivedChoropleth, municipalityName, content, lastGenerated } = props; const [positivelyTestedPeopleTimeframe, setpositivelyTestedPeopleTimeframe] = useState(TimeframeOption.SIX_MONTHS); const { commonTexts, formatNumber, formatDateFromSeconds } = useIntl(); const reverseRouter = useReverseRouter(); const { textGm, textShared } = useDynamicLokalizeTexts(pageText, selectLokalizeTexts); - const archivedLastValue = archived_data.tested_overall_archived_20230331.last_value; + const archivedLastValue = archivedData.tested_overall_archived_20230331.last_value; const populationCount = data.static_values.population_count; const metadata = { ...commonTexts.gemeente_index.metadata, @@ -96,7 +96,7 @@ function PositivelyTestedPeople(props: StaticProps) { }), }; - const lastInsertionDateOfPage = getLastInsertionDateOfPage(data, pageMetrics); + const lastInsertionDateOfPage = getLastInsertionDateOfPage(archivedData, pageMetrics); return ( @@ -188,7 +188,7 @@ function PositivelyTestedPeople(props: StaticProps) { accessibility={{ key: 'confirmed_cases_infected_over_time_chart', }} - values={archived_data.tested_overall_archived_20230331.values} + values={archivedData.tested_overall_archived_20230331.values} timeframe={positivelyTestedPeopleTimeframe} seriesConfig={[ { diff --git a/packages/app/src/pages/landelijk/positieve-testen.tsx b/packages/app/src/pages/landelijk/positieve-testen.tsx index c3f2876e16..7b259eef60 100644 --- a/packages/app/src/pages/landelijk/positieve-testen.tsx +++ b/packages/app/src/pages/landelijk/positieve-testen.tsx @@ -236,7 +236,7 @@ function PositivelyTestedPeople(props: StaticProps) { })} metadata={{ source: textNl.ggd.bronnen.rivm, - date: getLastInsertionDateOfPage(data, ['tested_ggd']), + date: getLastInsertionDateOfPage(data, ['tested_ggd_archived_20230321']), }} onSelectTimeframe={setConfirmedCasesTestedOverTimeTimeframe} toggle={{