Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
fix(COR-1851): Fix incorrect dates being displayed on positive tests …
Browse files Browse the repository at this point in the history
…page (#4931)

Co-authored-by: VWSCoronaDashboard29 <B>
  • Loading branch information
ben-van-eekelen authored Nov 7, 2023
1 parent 7c28810 commit f930129
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/app/src/pages/gemeente/[code]/positieve-testen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const selectLokalizeTexts = (siteText: SiteText) => ({

type LokalizeTexts = ReturnType<typeof selectLokalizeTexts>;

const pageMetrics = ['tested_overall'];
const pageMetrics = ['tested_overall_archived_20230331'];

export const getStaticProps = createGetStaticProps(
({ locale }: { locale: keyof Languages }) => getLokalizeTexts(selectLokalizeTexts, locale),
Expand Down Expand Up @@ -78,13 +78,13 @@ export const getStaticProps = createGetStaticProps(
);

function PositivelyTestedPeople(props: StaticProps<typeof getStaticProps>) {
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>(TimeframeOption.SIX_MONTHS);
const { commonTexts, formatNumber, formatDateFromSeconds } = useIntl();
const reverseRouter = useReverseRouter();
const { textGm, textShared } = useDynamicLokalizeTexts<LokalizeTexts>(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,
Expand All @@ -96,7 +96,7 @@ function PositivelyTestedPeople(props: StaticProps<typeof getStaticProps>) {
}),
};

const lastInsertionDateOfPage = getLastInsertionDateOfPage(data, pageMetrics);
const lastInsertionDateOfPage = getLastInsertionDateOfPage(archivedData, pageMetrics);

return (
<Layout {...metadata} lastGenerated={lastGenerated}>
Expand Down Expand Up @@ -188,7 +188,7 @@ function PositivelyTestedPeople(props: StaticProps<typeof getStaticProps>) {
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={[
{
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/pages/landelijk/positieve-testen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function PositivelyTestedPeople(props: StaticProps<typeof getStaticProps>) {
})}
metadata={{
source: textNl.ggd.bronnen.rivm,
date: getLastInsertionDateOfPage(data, ['tested_ggd']),
date: getLastInsertionDateOfPage(data, ['tested_ggd_archived_20230321']),
}}
onSelectTimeframe={setConfirmedCasesTestedOverTimeTimeframe}
toggle={{
Expand Down

0 comments on commit f930129

Please sign in to comment.