diff --git a/packages/app/src/components/kpi/bordered-kpi-section.tsx b/packages/app/src/components/kpi/bordered-kpi-section.tsx index 51df98694a..669943d999 100644 --- a/packages/app/src/components/kpi/bordered-kpi-section.tsx +++ b/packages/app/src/components/kpi/bordered-kpi-section.tsx @@ -9,11 +9,24 @@ import { BorderedKpiSectionProps } from './types'; import { Markdown } from '../markdown'; import { MetadataProps } from '../metadata/types'; -export const BorderedKpiSection = ({ title, description, source, dateOrRange, tilesData, disclaimer }: BorderedKpiSectionProps) => { +export const BorderedKpiSection = ({ + title, + description, + source, + timeframePeriod, + dateOfInsertion, + isTimeframePeriodKpi, + tilesData, + disclaimer, + isArchived, +}: BorderedKpiSectionProps) => { const metadata: MetadataProps = { - date: dateOrRange, + timeframePeriod: timeframePeriod, source: source, disclaimer: disclaimer, + isTimeframePeriodKpi: isTimeframePeriodKpi, + dateOfInsertion: dateOfInsertion, + isArchived: isArchived, }; return ( diff --git a/packages/app/src/components/kpi/components/kpi-content.tsx b/packages/app/src/components/kpi/components/kpi-content.tsx index 41f4dcca66..85df192c63 100644 --- a/packages/app/src/components/kpi/components/kpi-content.tsx +++ b/packages/app/src/components/kpi/components/kpi-content.tsx @@ -10,13 +10,15 @@ import { space } from '~/style/theme'; import { TileData as KpiContentProps } from '../types'; import { useIntl } from '~/intl'; -export const KpiContent = ({ title, description, value, bar, birthyear, differenceValue, isPercentage = false, dateOrRange, source }: KpiContentProps) => { +export const KpiContent = ({ title, description, value, bar, birthyear, differenceValue, isPercentage = false, dateOfInsertion, dateOrRange, source }: KpiContentProps) => { const { commonTexts } = useIntl(); const parsedBirthyearRange = birthyear ? parseBirthyearRange(birthyear) : null; const metadata: MetadataProps = { - date: dateOrRange, + timeframePeriod: dateOrRange, source: source, + isTimeframePeriodKpi: true, + dateOfInsertion: dateOfInsertion, }; return ( diff --git a/packages/app/src/components/kpi/types.ts b/packages/app/src/components/kpi/types.ts index 986f11d303..6ce856eefa 100644 --- a/packages/app/src/components/kpi/types.ts +++ b/packages/app/src/components/kpi/types.ts @@ -2,6 +2,7 @@ import { DifferenceInteger } from '@corona-dashboard/common'; export type TileData = { dateOrRange?: number | DateRange; + dateOfInsertion?: number; source?: { href: string; text: string; @@ -21,7 +22,10 @@ interface DateRange { } export interface BorderedKpiSectionProps { - dateOrRange?: number | DateRange; + timeframePeriod?: number | DateRange; + isTimeframePeriodKpi?: boolean; + dateOfInsertion?: number; + isArchived?: boolean; description: string; source?: { href: string; diff --git a/packages/app/src/components/metadata/components/tile-footer-metadata.tsx b/packages/app/src/components/metadata/components/tile-footer-metadata.tsx index 35330037a6..3d575a6778 100644 --- a/packages/app/src/components/metadata/components/tile-footer-metadata.tsx +++ b/packages/app/src/components/metadata/components/tile-footer-metadata.tsx @@ -24,33 +24,25 @@ interface TileFooterMetadataProps extends MetadataProps { * @param {TileFooterMetadataProps} props - The properties that define the metadata items to be displayed. * @param {string|null} props.dateString - The string representation of the date or null. * @param {string} props.marginBottom - The margin-bottom property of the TileFooterMetadata component. - * @param {string} props.datumsText - Textual representation of the metadata date. - * @param {(number|DateRange|string)} props.date - Date of the metadata item. It can be a number, a DateRange object, or a string. - * @param {DateRange} props.datePeriod - Date range for the metadata. - * @param {number} props.dateOfInsertion - Unix timestamp of when the metadata was inserted. - * @param {boolean} props.isArchivedGraph - Flag indicating whether the metadata is for an archived graph. - * @param {Source} props.source - Source of the metadata. * @param {Source[]} [props.dataSources=[]] - Array of data sources for the metadata. - * @param {string} [props.referenceLink] - Reference link for the metadata. + * @param {number} props.dateOfInsertion - Unix timestamp of when the metadata was inserted. * @param {string} props.disclaimer - Disclaimer text for the metadata. + * @param {boolean} props.isArchived - Flag indicating whether the metadata is for an archived KPI / Graph / Choropleth. * @param {number} props.obtainedAt - Unix timestamp of when the metadata was obtained. - * @param {string} props.intervalCount - Interval count for the metadata. + * @param {string} [props.referenceLink] - Reference link for the metadata. + * @param {Source} props.source - Source of the metadata. * @returns {ReactElement} A React element that contains the tile footer with metadata items. */ export function TileFooterMetadata({ + dateString, + marginBottom, dataSources = [], - date, dateOfInsertion, - dateString, - datumsText, disclaimer, - intervalString, - isArchivedGraph, - marginBottom, + isArchived, obtainedAt, referenceLink, source, - timeframePeriod, }: TileFooterMetadataProps) { const { commonTexts, formatDateFromSeconds } = useIntl(); const metadataText = commonTexts.common.metadata; @@ -58,65 +50,60 @@ export function TileFooterMetadata({ return ( - {datumsText && Array.isArray(date) ? ( - replaceVariablesInText(datumsText, { - weekStart: formatDateFromSeconds(date[0], 'weekday-long'), - weekEnd: formatDateFromSeconds(date[1], 'weekday-long'), - }) - ) : ( - <> - {timeframePeriod && ( - - - - - - {replaceVariablesInText(commonTexts.common.metadata.time_interval, { - dateStart: formatDateFromSeconds(timeframePeriod.start, 'weekday-long'), - dateEnd: formatDateFromSeconds(timeframePeriod.end, 'weekday-long'), - })} - - - )} + <> + {dateString && ( + + + + + {dateString} + + )} + + {dateOfInsertion && ( + + + + + + {isArchived + ? replaceVariablesInText(commonTexts.common.metadata.last_insertion_date_archived, { + dateOfInsertion: formatDateFromSeconds(dateOfInsertion, 'weekday-long'), + }) + : replaceVariablesInText(commonTexts.common.metadata.last_insertion_date, { dateOfInsertion: formatDateFromSeconds(dateOfInsertion, 'weekday-long') })} + + + )} - {dateOfInsertion && ( - - - - - - {isArchivedGraph - ? replaceVariablesInText(commonTexts.common.metadata.last_insertion_date_archived, { - dateOfInsertion: formatDateFromSeconds(dateOfInsertion, 'weekday-long'), - }) - : replaceVariablesInText(commonTexts.common.metadata.last_insertion_date, { dateOfInsertion: formatDateFromSeconds(dateOfInsertion, 'weekday-long') })} - - - )} + {obtainedAt && ( + + + + + + {replaceVariablesInText(commonTexts.common.metadata.obtained, { + date: formatDateFromSeconds(obtainedAt, 'weekday-long'), + })} + + + )} - {source ? ( - } items={[source]} label={commonTexts.common.metadata.source} /> - ) : dataSources && dataSources.length > 0 ? ( - } - items={dataSources} - label={referenceLink ? commonTexts.informatie_header.bron : metadataText.source} - /> - ) : null} + {source ? ( + } items={[source]} label={commonTexts.common.metadata.source} /> + ) : dataSources && dataSources.length > 0 ? ( + } + items={dataSources} + label={referenceLink ? commonTexts.informatie_header.bron : metadataText.source} + /> + ) : null} - {disclaimer && ( - - - - )} - {dateString} - {obtainedAt && - ` ${replaceVariablesInText(commonTexts.common.metadata.obtained, { - date: formatDateFromSeconds(obtainedAt, 'axis-with-year'), - })}`} - {intervalString && `. ${intervalString}`} - - )} + {disclaimer && ( + + + + )} + ); diff --git a/packages/app/src/components/metadata/metadata.tsx b/packages/app/src/components/metadata/metadata.tsx index 4f56068b7f..3569ab4b8b 100644 --- a/packages/app/src/components/metadata/metadata.tsx +++ b/packages/app/src/components/metadata/metadata.tsx @@ -22,13 +22,12 @@ import React from 'react'; export function Metadata({ accessibilitySubject, dataSources = [], - date, dateOfInsertion, dateOrRange, datumsText, disclaimer, intervalCount, - isArchivedGraph = false, + isArchived = false, isPageInformationBlock, isTileFooter, jsonSources = [], @@ -39,22 +38,29 @@ export function Metadata({ referenceLink, source, timeframePeriod, + isTimeframePeriodKpi, }: MetadataProps) { const { commonTexts, formatDateFromSeconds } = useIntl(); - const dateString = - typeof date === 'number' + const dateString = isTimeframePeriodKpi + ? typeof timeframePeriod === 'number' ? replaceVariablesInText(commonTexts.common.metadata.date, { - date: formatDateFromSeconds(date, 'axis-with-year'), + date: formatDateFromSeconds(timeframePeriod, 'weekday-long'), }) - : typeof date === 'string' - ? date - : date && date.start && date.end + : typeof timeframePeriod === 'string' + ? timeframePeriod + : timeframePeriod && timeframePeriod.start && timeframePeriod.end ? replaceVariablesInText(commonTexts.common.metadata.date_from_to, { - startDate: formatDateFromSeconds(date.start, 'weekday-long'), - endDate: formatDateFromSeconds(date.end, 'weekday-long'), + startDate: formatDateFromSeconds(timeframePeriod.start, 'weekday-long'), + endDate: formatDateFromSeconds(timeframePeriod.end, 'weekday-long'), }) - : null; + : null + : timeframePeriod && typeof timeframePeriod !== 'string' && typeof timeframePeriod !== 'number' + ? replaceVariablesInText(commonTexts.common.metadata.time_interval, { + dateStart: formatDateFromSeconds(timeframePeriod.start, 'weekday-long'), + dateEnd: formatDateFromSeconds(timeframePeriod.end, 'weekday-long'), + }) + : null; const dateText = datumsText && dateOfInsertion && dateOrRange ? insertDateIntoString(formatDateFromSeconds, datumsText, dateOfInsertion, dateOrRange) : undefined; @@ -93,16 +99,16 @@ export function Metadata({ dateString={dateString} marginBottom={marginBottom} datumsText={datumsText} - date={date} timeframePeriod={timeframePeriod} dateOfInsertion={dateOfInsertion} - isArchivedGraph={isArchivedGraph} + isArchived={isArchived} source={source} dataSources={dataSources} referenceLink={referenceLink} disclaimer={disclaimer} obtainedAt={obtainedAt} intervalString={intervalString} + isTimeframePeriodKpi={isTimeframePeriodKpi} /> )} diff --git a/packages/app/src/components/metadata/types.ts b/packages/app/src/components/metadata/types.ts index 290b4689a7..9af76c42a1 100644 --- a/packages/app/src/components/metadata/types.ts +++ b/packages/app/src/components/metadata/types.ts @@ -49,7 +49,7 @@ export interface DateRange { * @property {string} [disclaimer] - Disclaimer text for the metadata. * @property {DateRange} [datePeriod] - Date range for the metadata. * @property {number} [dateOfInsertion] - Unix timestamp of when the metadata was inserted. - * @property {boolean} [isArchivedGraph] - Flag indicating whether the metadata is for an archived graph. + * @property {boolean} [isArchived] - Flag indicating whether the metadata is for an archived graph. * @property {number|DateRange} [dateOrRange] - Date or date range of the metadata. * @property {string} [accessibilitySubject] - Accessibility subject text for the metadata. * @property {string} [moreInformationLabel] - Label for the "More Information" link. @@ -59,7 +59,6 @@ export interface DateRange { * @memberof module:Metadata */ export type MetadataProps = { - date?: number | DateRange | string; source?: Source; dataSources?: Source[]; obtainedAt?: number; @@ -68,9 +67,9 @@ export type MetadataProps = { datumsText?: string; intervalCount?: string; disclaimer?: string; - timeframePeriod?: DateRange; + timeframePeriod?: number | DateRange | string; dateOfInsertion?: number; - isArchivedGraph?: boolean; + isArchived?: boolean; dateOrRange?: number | DateRange; accessibilitySubject?: string; moreInformationLabel?: string; @@ -80,4 +79,5 @@ export type MetadataProps = { }; referenceLink?: string; jsonSources?: Datasource[]; + isTimeframePeriodKpi?: boolean; } & MarginBottomProps; diff --git a/packages/app/src/components/time-series-chart/time-series-chart.tsx b/packages/app/src/components/time-series-chart/time-series-chart.tsx index b29c75e2bc..bfab90ad12 100644 --- a/packages/app/src/components/time-series-chart/time-series-chart.tsx +++ b/packages/app/src/components/time-series-chart/time-series-chart.tsx @@ -210,7 +210,7 @@ export function TimeSeriesChart { if (onHandleTimeframePeriodChange) { - if (values.length == 0) { + if (values.length === 0) { onHandleTimeframePeriodChange(undefined); } else if (isDateSpanSeries(values)) { onHandleTimeframePeriodChange({ diff --git a/packages/app/src/domain/tested/g-number-bar-chart-tile.tsx b/packages/app/src/domain/tested/g-number-bar-chart-tile.tsx index ec5ae18860..41b4d1c5ec 100644 --- a/packages/app/src/domain/tested/g-number-bar-chart-tile.tsx +++ b/packages/app/src/domain/tested/g-number-bar-chart-tile.tsx @@ -25,8 +25,7 @@ export function GNumberBarChartTile({ data: __data, timeframeInitialValue = Time const last_value = __data.last_value; const endDate = createDateFromUnixTimestamp(last_value.date_unix); - const metadataTimeframePeriod = { start: values[0].date_unix, end: values[values.length - 1].date_unix }; - const metadataDateOfInsertion = values[values.length - 1].date_of_insertion_unix; + const metadataDateOfInsertion = last_value.date_of_insertion_unix; return ( diff --git a/packages/app/src/domain/tested/reproduction-chart-tile.tsx b/packages/app/src/domain/tested/reproduction-chart-tile.tsx index d66bbd371a..769c4f6b8f 100644 --- a/packages/app/src/domain/tested/reproduction-chart-tile.tsx +++ b/packages/app/src/domain/tested/reproduction-chart-tile.tsx @@ -36,7 +36,6 @@ export const ReproductionChartTile = ({ ); const last_value = last(values) as ArchivedNlReproductionValue; - const metadataTimeframePeriod = { start: values[0].date_unix, end: values[values.length - 1].date_unix }; const metadataDateOfInsertion = data.last_value.date_of_insertion_unix; return ( @@ -46,11 +45,10 @@ export const ReproductionChartTile = ({ timeframeOptions={timeframeOptions} timeframeInitialValue={timeframeInitialValue} metadata={{ - date: last_value.date_of_insertion_unix, source: text.bronnen.rivm, dateOfInsertion: metadataDateOfInsertion, - timeframePeriod: metadataTimeframePeriod, - isArchivedGraph: true, + timeframePeriod: last_value.date_of_insertion_unix, + isArchived: true, }} onSelectTimeframe={setReproductionTimeframe} > diff --git a/packages/app/src/domain/vaccine/vaccinations-over-time-tile.tsx b/packages/app/src/domain/vaccine/vaccinations-over-time-tile.tsx index fac7cab566..b458ffd56b 100644 --- a/packages/app/src/domain/vaccine/vaccinations-over-time-tile.tsx +++ b/packages/app/src/domain/vaccine/vaccinations-over-time-tile.tsx @@ -14,12 +14,12 @@ import { useFormatDateRange } from '~/utils/use-format-date-range'; import { useIntl } from '~/intl'; import React, { Dispatch, SetStateAction, useState, useMemo } from 'react'; -function useTileData( +const useTileData = ( activeChart: ActiveVaccinationChart, text: SiteText['pages']['vaccinations_page']['nl'], insertionDate: number, data: ArchivedNlVaccineCoverage | AdministrationData -) { +) => { if (activeChart === 'coverage') { const metadataData = data as ArchivedNlVaccineCoverage; const metadata = { @@ -32,7 +32,7 @@ function useTileData( * and that is not present in the graph */ timeframePeriod: { start: metadataData.values[0].date_end_unix, end: metadataData.values[data.values.length - 1].date_end_unix }, - isArchivedGraph: true, + isArchived: true, }; const description = text.grafiek_gevaccineerd_door_de_tijd_heen.omschrijving; return [metadata, description] as const; @@ -42,11 +42,11 @@ function useTileData( date: insertionDate, dateOfInsertion: insertionDate, timeframePeriod: { start: data.values[0].date_unix, end: data.values[data.values.length - 1].date_unix }, - isArchivedGraph: true, + isArchived: true, }; const description = text.grafiek.omschrijving; return [metadata, description] as const; -} +}; interface VaccinationsOverTimeTileProps { coverageData?: ArchivedNlVaccineCoverage; diff --git a/packages/app/src/domain/vaccine/vaccine-coverage-choropleth.tsx b/packages/app/src/domain/vaccine/vaccine-coverage-choropleth.tsx index f1e20083dc..84e9a4c777 100644 --- a/packages/app/src/domain/vaccine/vaccine-coverage-choropleth.tsx +++ b/packages/app/src/domain/vaccine/vaccine-coverage-choropleth.tsx @@ -28,9 +28,10 @@ interface VaccineCoverageChoroplethProps { ageGroupLabel?: string; }; isPrimarySeries?: boolean; + isArchived?: boolean; } -export const VaccineCoverageChoropleth = ({ data, dataOptions, text, isPrimarySeries }: VaccineCoverageChoroplethProps) => { +export const VaccineCoverageChoropleth = ({ data, dataOptions, text, isPrimarySeries, isArchived }: VaccineCoverageChoroplethProps) => { const { commonTexts } = useIntl(); const [selectedAgeGroup, setSelectedAgeGroup] = useState(isPrimarySeries ? '18' : '60'); const selectedCoverageKind: CoverageKindProperty = isPrimarySeries ? 'primary_series' : 'autumn_2022'; @@ -70,7 +71,10 @@ export const VaccineCoverageChoropleth = ({ data, dataOptions, text, isPrimarySe }} metadata={{ source: commonTexts.choropleth.vaccination_coverage.shared.bronnen.rivm, - date: data.find((item: ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth) => item.vaccination_type === selectedCoverageKind)?.date_unix, + timeframePeriod: data.find((item: ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth) => item.vaccination_type === selectedCoverageKind)?.date_unix, + dateOfInsertion: data.find((item: ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth) => item.vaccination_type === selectedCoverageKind)?.date_of_insertion_unix, + isTimeframePeriodKpi: true, + isArchived: isArchived, }} hasPadding > diff --git a/packages/app/src/domain/vaccine/vaccine-coverage-toggle-tile.tsx b/packages/app/src/domain/vaccine/vaccine-coverage-toggle-tile.tsx index df754986dc..1ba1e8097a 100644 --- a/packages/app/src/domain/vaccine/vaccine-coverage-toggle-tile.tsx +++ b/packages/app/src/domain/vaccine/vaccine-coverage-toggle-tile.tsx @@ -67,7 +67,8 @@ export function VaccineCoverageToggleTile({ const [selectedTab, setSelectedTab] = useState(age18PlusToggleText.label); const metadata: MetadataProps = { - date: dateUnix ?? undefined, + timeframePeriod: dateUnix ?? undefined, + isTimeframePeriodKpi: true, source: source, }; @@ -100,7 +101,7 @@ export function VaccineCoverageToggleTile({ description={age18PlusToggleText.description_booster_grade} numFractionDigits={numFractionDigits} > - {age18Plus.dateUnixBoostered && } + {age18Plus.dateUnixBoostered && } ) : ( @@ -114,7 +115,7 @@ export function VaccineCoverageToggleTile({ secondDescription={age18PlusToggleText.description_vaccination_one_shot_with_percentage} numFractionDigits={numFractionDigits} > - {metadata && } + {metadata && } )} @@ -128,7 +129,7 @@ export function VaccineCoverageToggleTile({ description={age12PlusToggleText.description_booster_grade} numFractionDigits={numFractionDigits} > - {age12Plus.dateUnixBoostered && } + {age12Plus.dateUnixBoostered && } ) : ( @@ -142,7 +143,7 @@ export function VaccineCoverageToggleTile({ secondDescription={age12PlusToggleText.description_vaccination_one_shot_with_percentage} numFractionDigits={numFractionDigits} > - {metadata && } + {metadata && } )} diff --git a/packages/app/src/domain/vaccine/vaccine-delivery-bar-chart.tsx b/packages/app/src/domain/vaccine/vaccine-delivery-bar-chart.tsx index af4d8fedb2..a43446e1b5 100644 --- a/packages/app/src/domain/vaccine/vaccine-delivery-bar-chart.tsx +++ b/packages/app/src/domain/vaccine/vaccine-delivery-bar-chart.tsx @@ -32,7 +32,7 @@ export function VaccineDeliveryBarChart({ data, text }: { data: ArchivedNlVaccin source: text.bronnen.rivm, dateOfInsertion: metadataDateOfInsertion, timeframePeriod: metadataTimeframePeriod, - isArchivedGraph: true, + isArchived: true, }} > diff --git a/packages/app/src/domain/vaccine/vaccine-stock-per-supplier-chart.tsx b/packages/app/src/domain/vaccine/vaccine-stock-per-supplier-chart.tsx index 59023dce8f..40695e1040 100644 --- a/packages/app/src/domain/vaccine/vaccine-stock-per-supplier-chart.tsx +++ b/packages/app/src/domain/vaccine/vaccine-stock-per-supplier-chart.tsx @@ -94,7 +94,7 @@ export function VaccineStockPerSupplierChart({ values, text }: VaccineStockPerSu source: text.bronnen.rivm, dateOfInsertion: metadataDateOfInsertion, timeframePeriod: metadataTimeframePeriod, - isArchivedGraph: true, + isArchived: true, }} > diff --git a/packages/app/src/domain/variants/variants-table-tile.tsx b/packages/app/src/domain/variants/variants-table-tile.tsx index 152ca8a7d1..be6d944288 100644 --- a/packages/app/src/domain/variants/variants-table-tile.tsx +++ b/packages/app/src/domain/variants/variants-table-tile.tsx @@ -79,9 +79,10 @@ function VariantsTableTileWithData({ text, sampleThresholdPassed, source, data, const { formatDateSpan } = useIntl(); const metadata: MetadataProps = { - date: { start: dates.date_start_unix, end: dates.date_end_unix }, + timeframePeriod: { start: dates.date_start_unix, end: dates.date_end_unix }, source, obtainedAt: dates.date_of_report_unix, + isTimeframePeriodKpi: true, }; const [date_start, date_end] = formatDateSpan({ seconds: dates.date_start_unix }, { seconds: dates.date_end_unix }); diff --git a/packages/app/src/pages/gemeente/[code]/de-coronaprik.tsx b/packages/app/src/pages/gemeente/[code]/de-coronaprik.tsx index 94357cea2d..2213290a1d 100644 --- a/packages/app/src/pages/gemeente/[code]/de-coronaprik.tsx +++ b/packages/app/src/pages/gemeente/[code]/de-coronaprik.tsx @@ -184,7 +184,9 @@ export const VaccinationsGmPage = (props: StaticProps) => }, }, ]} - dateOrRange={filteredVaccination.primarySeries.date_unix} + timeframePeriod={filteredVaccination.primarySeries.date_unix} + dateOfInsertion={filteredVaccination.primarySeries.date_of_insertion_unix} + isTimeframePeriodKpi={true} /> ) => title={textShared.vaccination_grade_tile.autumn_labels.title} description={textShared.vaccination_grade_tile.autumn_labels.description} source={textShared.vaccination_grade_tile.autumn_labels.source} + timeframePeriod={filteredVaccination.autumn2022.date_unix} + dateOfInsertion={filteredVaccination.autumn2022.date_of_insertion_unix} + isArchived={true} + isTimeframePeriodKpi={true} tilesData={[ { value: filteredVaccination.autumn2022.vaccinated_percentage_60_plus, @@ -244,7 +250,6 @@ export const VaccinationsGmPage = (props: StaticProps) => }, }, ]} - dateOrRange={filteredVaccination.autumn2022.date_unix} /> )} ) => description={textGm.vaccination_coverage.description} sortingOrder={['18+', '12+']} metadata={{ - date: archivedData.vaccine_coverage_per_age_group_archived_20220622.values.length + timeframePeriod: archivedData.vaccine_coverage_per_age_group_archived_20220622.values.length ? archivedData.vaccine_coverage_per_age_group_archived_20220622.values[0].date_unix : undefined, + dateOfInsertion: archivedData.vaccine_coverage_per_age_group_archived_20220622.values.length + ? archivedData.vaccine_coverage_per_age_group_archived_20220622.values[0].date_of_insertion_unix + : undefined, source: textGm.vaccination_coverage.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} values={archivedData.vaccine_coverage_per_age_group_archived_20220622.values} text={textNl} diff --git a/packages/app/src/pages/gemeente/[code]/patienten-in-beeld.tsx b/packages/app/src/pages/gemeente/[code]/patienten-in-beeld.tsx index cfe2f980af..9b30a2a135 100644 --- a/packages/app/src/pages/gemeente/[code]/patienten-in-beeld.tsx +++ b/packages/app/src/pages/gemeente/[code]/patienten-in-beeld.tsx @@ -114,7 +114,7 @@ function IntakeHospital(props: StaticProps) { }; const lastInsertionDateOfPage = getLastInsertionDateOfPage(data, pageMetrics); - //const lastInsertionDateHospitalNice = getLastInsertionDateOfPage(data, ['hospital_nice_archived_20240228']); + return ( @@ -154,8 +154,9 @@ function IntakeHospital(props: StaticProps) { dateEnd: formatDateFromSeconds(lastValue.date_end_unix, 'weekday-long'), })} metadata={{ - date: { start: sevenDayAverageDates.start, end: sevenDayAverageDates.end }, + timeframePeriod: { start: sevenDayAverageDates.start, end: sevenDayAverageDates.end }, source: textGm.bronnen.rivm, + isTimeframePeriodKpi: true, }} > @@ -226,8 +227,11 @@ function IntakeHospital(props: StaticProps) { municipality: municipalityName, })} metadata={{ - date: lastValueChoropleth.date_unix, + timeframePeriod: lastValueChoropleth.date_unix, + dateOfInsertion: lastValueChoropleth.date_of_insertion_unix, source: textGm.section_archived.archived_choropleth.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} description={textGm.section_archived.archived_choropleth.map_toelichting} legend={{ @@ -261,8 +265,11 @@ function IntakeHospital(props: StaticProps) { municipality: municipalityName, })} metadata={{ - date: { start: lastValueChoropleth.date_start_unix, end: lastValueChoropleth.date_end_unix }, + timeframePeriod: { start: lastValueChoropleth.date_start_unix, end: lastValueChoropleth.date_end_unix }, + dateOfInsertion: lastValueChoropleth.date_of_insertion_unix, source: textGm.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} description={textGm.map_toelichting} legend={{ diff --git a/packages/app/src/pages/gemeente/[code]/positieve-testen.tsx b/packages/app/src/pages/gemeente/[code]/positieve-testen.tsx index 5282042b4f..c107e82629 100644 --- a/packages/app/src/pages/gemeente/[code]/positieve-testen.tsx +++ b/packages/app/src/pages/gemeente/[code]/positieve-testen.tsx @@ -142,8 +142,11 @@ function PositivelyTestedPeople(props: StaticProps) { @@ -169,8 +172,11 @@ function PositivelyTestedPeople(props: StaticProps) { @@ -247,8 +253,11 @@ function PositivelyTestedPeople(props: StaticProps) { title: textShared.chloropleth_legenda_titel, }} metadata={{ - date: archivedLastValue.date_unix, + timeframePeriod: archivedLastValue.date_unix, + dateOfInsertion: archivedLastValue.date_of_insertion_unix, source: textGm.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} > ) => { @@ -149,8 +151,10 @@ const SewerWater = (props: StaticProps) => { title={textGm.total_measurements_title} description={textGm.total_measurements_description} metadata={{ - date: { start: sewerInstallationMeasurement.date_start_unix, end: sewerInstallationMeasurement.date_end_unix }, + timeframePeriod: { start: sewerInstallationMeasurement.date_start_unix, end: sewerInstallationMeasurement.date_end_unix }, + dateOfInsertion: sewerInstallationMeasurement.date_of_insertion_unix, source: textGm.bronnen.rivm, + isTimeframePeriodKpi: true, }} > diff --git a/packages/app/src/pages/gemeente/[code]/sterfte.tsx b/packages/app/src/pages/gemeente/[code]/sterfte.tsx index 7be6e30165..00bf42e29f 100644 --- a/packages/app/src/pages/gemeente/[code]/sterfte.tsx +++ b/packages/app/src/pages/gemeente/[code]/sterfte.tsx @@ -129,8 +129,11 @@ const DeceasedMunicipalPage = (props: StaticProps) => { @@ -140,8 +143,11 @@ const DeceasedMunicipalPage = (props: StaticProps) => { diff --git a/packages/app/src/pages/landelijk/besmettelijke-mensen.tsx b/packages/app/src/pages/landelijk/besmettelijke-mensen.tsx index c5761bc008..cc5013ba2d 100644 --- a/packages/app/src/pages/landelijk/besmettelijke-mensen.tsx +++ b/packages/app/src/pages/landelijk/besmettelijke-mensen.tsx @@ -94,7 +94,7 @@ const InfectiousPeople = (props: StaticProps) => { {hasActiveWarningTile && } diff --git a/packages/app/src/pages/landelijk/coronamelder.tsx b/packages/app/src/pages/landelijk/coronamelder.tsx index 44c692024f..488a956ffe 100644 --- a/packages/app/src/pages/landelijk/coronamelder.tsx +++ b/packages/app/src/pages/landelijk/coronamelder.tsx @@ -79,9 +79,10 @@ const CoronamelderPage = (props: StaticProps) => { ) { title: textNl.kpi_vaccinaties_de_coronaprik.tile_amount_administered_last_timeframe.title, description: textNl.kpi_vaccinaties_de_coronaprik.tile_amount_administered_last_timeframe.omschrijving, value: archivedData.vaccine_campaigns_archived_20240117.vaccine_campaigns[0].vaccine_administered_last_timeframe, + dateOfInsertion: archivedData.vaccine_campaigns_archived_20240117.date_of_insertion_unix, dateOrRange: { start: archivedData.vaccine_campaigns_archived_20240117.date_start_unix, end: archivedData.vaccine_campaigns_archived_20240117.date_end_unix }, source: textShared.bronnen.rivm, }, @@ -213,7 +214,8 @@ function VaccinationPage(props: StaticProps) { title: textNl.kpi_vaccinaties_de_coronaprik.tile_amount_administered_total.title, description: textNl.kpi_vaccinaties_de_coronaprik.tile_amount_administered_total.omschrijving, value: archivedData.vaccine_campaigns_archived_20240117.vaccine_campaigns[0].vaccine_administered_total, - dateOrRange: archivedData.vaccine_campaigns_archived_20240117.date_unix, + dateOfInsertion: archivedData.vaccine_campaigns_archived_20240117.date_of_insertion_unix, + dateOrRange: archivedData.vaccine_campaigns_archived_20240117.date_end_unix, source: textShared.bronnen.rivm, }, ]} @@ -225,7 +227,7 @@ function VaccinationPage(props: StaticProps) { data={archivedData.vaccine_administered_last_timeframe_archived_20240117.vaccine_types} metadata={{ source: textShared.bronnen.rivm, - date: { + timeframePeriod: { start: archivedData.vaccine_administered_last_timeframe_archived_20240117.date_start_unix, end: archivedData.vaccine_administered_last_timeframe_archived_20240117.date_end_unix, }, @@ -250,6 +252,9 @@ function VaccinationPage(props: StaticProps) { title={textShared.vaccination_grade_tile.fully_vaccinated_labels.title} description={textShared.vaccination_grade_tile.fully_vaccinated_labels.description} source={textShared.vaccination_grade_tile.fully_vaccinated_labels.source} + timeframePeriod={vaccineCoverageEstimatedFullyVaccinated.date_unix} + isTimeframePeriodKpi={true} + dateOfInsertion={vaccineCoverageEstimatedFullyVaccinated.date_of_insertion_unix} tilesData={[ { value: vaccineCoverageEstimatedFullyVaccinated.age_18_plus_vaccinated, @@ -274,7 +279,6 @@ function VaccinationPage(props: StaticProps) { }, }, ]} - dateOrRange={vaccineCoverageEstimatedFullyVaccinated.date_unix} /> ) { sortingOrder={['80+', '70-79', '60-69', '50-59', '40-49', '30-39', '18-29', '12-17', '5-11']} metadata={{ datumsText: textNl.dates, - date: archivedData.vaccine_coverage_per_age_group_archived_20231004.values[0].date_unix, + timeframePeriod: archivedData.vaccine_coverage_per_age_group_archived_20231004.values[0].date_unix, + isTimeframePeriodKpi: true, + dateOfInsertion: archivedData.vaccine_coverage_per_age_group_archived_20231004.values[0].date_of_insertion_unix, source: textNl.vaccination_coverage.bronnen.rivm, }} values={archivedData.vaccine_coverage_per_age_group_archived_20231004.values} @@ -347,7 +353,10 @@ function VaccinationPage(props: StaticProps) { }, }, ]} - dateOrRange={vaccineCoverageEstimatedAutumn2022.date_unix} + timeframePeriod={vaccineCoverageEstimatedAutumn2022.date_unix} + dateOfInsertion={vaccineCoverageEstimatedAutumn2022.date_of_insertion_unix} + isArchived={true} + isTimeframePeriodKpi={true} /> ) { campaignDescriptions={textNl.vaccine_campaigns.campaigns} metadata={{ datumsText: textNl.dates, - date: archivedData.vaccine_campaigns_archived_20231004.date_unix, + timeframePeriod: archivedData.vaccine_campaigns_archived_20231004.date_unix, + dateOfInsertion: archivedData.vaccine_campaigns_archived_20231004.date_of_insertion_unix, + isTimeframePeriodKpi: true, + isArchived: true, source: textNl.vaccine_campaigns.bronnen.rivm, disclaimer: textNl.vaccine_campaigns.description_footer, }} @@ -373,6 +385,7 @@ function VaccinationPage(props: StaticProps) { vaccinationKindLabel: commonTexts.choropleth.vaccination_coverage.shared.dropdown_label_vaccination_coverage_kind_select, ageGroupLabel: commonTexts.choropleth.vaccination_coverage.shared.dropdown_label_age_group_select, }} + isArchived={true} /> ) { sortingOrder={['80+', '70-79', '60-69', '50-59', '40-49', '30-39', '18-29', '12-17', '5-11']} metadata={{ datumsText: textNl.dates, - date: archivedData.vaccine_coverage_per_age_group_archived_20231004.values[0].date_unix, + timeframePeriod: archivedData.vaccine_coverage_per_age_group_archived_20231004.values[0].date_unix, + dateOfInsertion: archivedData.vaccine_coverage_per_age_group_archived_20231004.values[0].date_of_insertion_unix, source: textNl.vaccination_coverage.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} values={archivedData.vaccine_coverage_per_age_group_archived_20231004.values} /> @@ -395,8 +411,11 @@ function VaccinationPage(props: StaticProps) { sortingOrder={['80+', '70-79', '60-69', '50-59', '40-49', '30-39', '18-29', '12-17', '5-11']} metadata={{ datumsText: textNl.datums, - date: archivedData.vaccine_coverage_per_age_group_archived_20220908.values[0].date_unix, + timeframePeriod: archivedData.vaccine_coverage_per_age_group_archived_20220908.values[0].date_unix, + dateOfInsertion: archivedData.vaccine_coverage_per_age_group_archived_20220908.values[0].date_of_insertion_unix, source: textNl.vaccination_coverage.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} values={archivedData.vaccine_coverage_per_age_group_archived_20220908.values} /> @@ -433,9 +452,12 @@ function VaccinationPage(props: StaticProps) { campaignDescriptions={textNl.vaccine_campaigns.campaigns} metadata={{ datumsText: textNl.dates, - date: archivedData.vaccine_campaigns_archived_20220908.date_unix, + timeframePeriod: archivedData.vaccine_campaigns_archived_20220908.date_unix, source: textNl.vaccine_campaigns.bronnen.rivm, disclaimer: textNl.vaccine_campaigns.description_footer, + isTimeframePeriodKpi: true, + dateOfInsertion: archivedData.vaccine_campaigns_archived_20220908.date_of_insertion_unix, + isArchived: true, }} /> @@ -450,11 +472,14 @@ function VaccinationPage(props: StaticProps) { value={repeatingShotAdministeredLastValue.ggd_administered_total} metadata={{ datumsText: textNl.repeating_shot_kpi.datums, - date: repeatingShotAdministeredLastValue.date_unix, + timeframePeriod: repeatingShotAdministeredLastValue.date_unix, + dateOfInsertion: repeatingShotAdministeredLastValue.date_of_insertion_unix, source: { href: textNl.repeating_shot_kpi.sources.href, text: textNl.repeating_shot_kpi.sources.text, }, + isTimeframePeriodKpi: true, + isArchived: true, }} /> @@ -480,7 +505,10 @@ function VaccinationPage(props: StaticProps) { totalBoosterShots={boosterShotAdministeredArchivedLastValue.administered_total} metadateBoosterShots={{ datumsText: textNl.booster_kpi.datums, - date: boosterShotAdministeredArchivedLastValue.date_unix, + timeframePeriod: boosterShotAdministeredArchivedLastValue.date_unix, + dateOfInsertion: boosterShotAdministeredArchivedLastValue.date_of_insertion_unix, + isArchived: true, + isTimeframePeriodKpi: true, source: { href: textNl.booster_kpi.sources.href, text: textNl.booster_kpi.sources.text, @@ -489,20 +517,26 @@ function VaccinationPage(props: StaticProps) { boosterGgdValue={boosterShotAdministeredArchivedLastValue.ggd_administered_total} metadateBoosterGgd={{ datumsText: textNl.booster_kpi.datums, - date: boosterShotAdministeredArchivedLastValue.date_unix, + timeframePeriod: boosterShotAdministeredArchivedLastValue.date_unix, + dateOfInsertion: boosterShotAdministeredArchivedLastValue.date_of_insertion_unix, source: { href: textNl.booster_kpi.sources.href, text: textNl.booster_kpi.sources.text, }, + isArchived: true, + isTimeframePeriodKpi: true, }} boosterEstimatedValue={boosterShotAdministeredArchivedLastValue.others_administered_total} metadateBoosterEstimated={{ datumsText: textNl.booster_kpi.datums, - date: boosterShotAdministeredArchivedLastValue.date_unix, + timeframePeriod: boosterShotAdministeredArchivedLastValue.date_unix, + dateOfInsertion: boosterShotAdministeredArchivedLastValue.date_of_insertion_unix, source: { href: textNl.booster_kpi.sources.href, text: textNl.booster_kpi.sources.text, }, + isArchived: true, + isTimeframePeriodKpi: true, }} /> @@ -513,8 +547,11 @@ function VaccinationPage(props: StaticProps) { sortingOrder={['81+', '71-80', '61-70', '51-60', '41-50', '31-40', '18-30', '12-17', '5-11']} metadata={{ datumsText: textNl.dates, - date: archivedData.vaccine_coverage_per_age_group_archived_20220622.values[0].date_unix, + timeframePeriod: archivedData.vaccine_coverage_per_age_group_archived_20220622.values[0].date_unix, + dateOfInsertion: archivedData.vaccine_coverage_per_age_group_archived_20220622.values[0].date_of_insertion_unix, source: textNl.vaccination_coverage.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} values={archivedData.vaccine_coverage_per_age_group_archived_20220622.values} /> @@ -528,14 +565,10 @@ function VaccinationPage(props: StaticProps) { description={textNl.grafiek_draagvlak.omschrijving} metadata={{ datumsText: textNl.grafiek_draagvlak.metadata_tekst, - date: { - start: archivedData.vaccine_vaccinated_or_support_archived_20230411.last_value.date_start_unix, - end: archivedData.vaccine_vaccinated_or_support_archived_20230411.last_value.date_end_unix, - }, source: textNl.vaccination_coverage.bronnen.rivm, dateOfInsertion: getLastInsertionDateOfPage(archivedData, ['vaccine_vaccinated_or_support_archived_20230411']), timeframePeriod: vaccineVaccinatedOrSupportTimeframePeriod, - isArchivedGraph: true, + isArchived: true, }} > ) scrollRef={scrollToRef} text={textNl} metadata={{ - datumsText: textNl.datums, - date: behaviorLastValue.date_start_unix, + timeframePeriod: behaviorLastValue.date_start_unix, + dateOfInsertion: behaviorLastValue.date_of_insertion_unix, source: textNl.bronnen.rivm, + isArchived: true, + isTimeframePeriodKpi: true, }} /> @@ -198,11 +200,10 @@ export default function BehaviorPage(props: StaticProps) ) setCurrentId={setCurrentId} text={textNl} metadata={{ - datumsText: textNl.datums, - date: behaviorPerAgeGroup.date_start_unix, + timeframePeriod: behaviorPerAgeGroup.date_start_unix, + dateOfInsertion: behaviorPerAgeGroup.date_of_insertion_unix, source: textNl.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} /> diff --git a/packages/app/src/pages/landelijk/gehandicaptenzorg.tsx b/packages/app/src/pages/landelijk/gehandicaptenzorg.tsx index 2a4254061a..458b5c1c35 100644 --- a/packages/app/src/pages/landelijk/gehandicaptenzorg.tsx +++ b/packages/app/src/pages/landelijk/gehandicaptenzorg.tsx @@ -133,7 +133,12 @@ function DisabilityCare(props: StaticProps) { {hasActiveWarningTile && } ) { title={textNl.besmette_locaties.map_titel} description={textNl.besmette_locaties.map_toelichting} metadata={{ - date: lastValue.date_unix, + timeframePeriod: lastValue.date_unix, + dateOfInsertion: lastValue.date_of_insertion_unix, source: textNl.besmette_locaties.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} legend={{ thresholds: thresholds.vr.infected_locations_percentage, @@ -225,6 +233,7 @@ function DisabilityCare(props: StaticProps) { source: textNl.besmette_locaties.bronnen.rivm, dateOfInsertion: lastInsertionDateOfPage, timeframePeriod: metadataTimeframePeriod, + isArchived: true, }} timeframeOptions={TimeframeOptionsList} description={textNl.besmette_locaties.charts.linechart_description} @@ -266,7 +275,7 @@ function DisabilityCare(props: StaticProps) { /> ) => { ) => { diff --git a/packages/app/src/pages/landelijk/klachten-bij-huisartsen.tsx b/packages/app/src/pages/landelijk/klachten-bij-huisartsen.tsx index a6f0b57ac6..72462e841a 100644 --- a/packages/app/src/pages/landelijk/klachten-bij-huisartsen.tsx +++ b/packages/app/src/pages/landelijk/klachten-bij-huisartsen.tsx @@ -74,7 +74,7 @@ const SuspectedPatients = (props: StaticProps) => { ) { title={ElderlyPeopleText.hospital_admissions.kpi_titel} description={ElderlyPeopleText.hospital_admissions.kpi_toelichting} metadata={{ - date: { start: vulnerableHospitalAdmissionsData.date_start_unix, end: vulnerableHospitalAdmissionsData.date_end_unix }, + timeframePeriod: { start: vulnerableHospitalAdmissionsData.date_start_unix, end: vulnerableHospitalAdmissionsData.date_end_unix }, + dateOfInsertion: vulnerableHospitalAdmissionsData.date_of_insertion_unix, source: ElderlyPeopleText.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} > @@ -188,7 +191,10 @@ function VulnerableGroups(props: StaticProps) { title={textNl.kpi_tiles.infected_locations.title} description={textNl.kpi_tiles.infected_locations.description} source={infectedLocationsText.bronnen.rivm} - dateOrRange={vulnerableNursingHomeDataLastValue.date_unix} + timeframePeriod={vulnerableNursingHomeDataLastValue.date_unix} + isTimeframePeriodKpi={true} + dateOfInsertion={vulnerableNursingHomeDataLastValue.date_of_insertion_unix} + isArchived={true} tilesData={[ { value: vulnerableNursingHomeDataLastValue.infected_locations_total, @@ -208,8 +214,11 @@ function VulnerableGroups(props: StaticProps) { title={infectedLocationsText.map_titel} description={infectedLocationsText.map_toelichting} metadata={{ - date: vulnerableNursingHomeDataLastValue.date_unix, + timeframePeriod: vulnerableNursingHomeDataLastValue.date_unix, + dateOfInsertion: vulnerableNursingHomeDataLastValue.date_of_insertion_unix, source: infectedLocationsText.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} legend={{ thresholds: thresholds.vr.infected_locations_percentage, @@ -237,7 +246,7 @@ function VulnerableGroups(props: StaticProps) { source: infectedLocationsText.bronnen.rivm, dateOfInsertion: lastInsertionDateNursingHomeInfectedLocationsOverTime, timeframePeriod: nursingHomeInfectedLocationsOverTimeTimeframePeriod, - isArchivedGraph: true, + isArchived: true, }} title={infectedLocationsText.linechart_titel} timeframeOptions={TimeframeOptionsList} @@ -268,8 +277,11 @@ function VulnerableGroups(props: StaticProps) { title={positiveTestedPeopleText.barscale_titel} description={positiveTestedPeopleText.extra_uitleg} metadata={{ - date: nursinghomeDataLastValue.date_unix, + timeframePeriod: nursinghomeDataLastValue.date_unix, + dateOfInsertion: nursinghomeDataLastValue.date_of_insertion_unix, source: positiveTestedPeopleText.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} > @@ -281,7 +293,7 @@ function VulnerableGroups(props: StaticProps) { source: positiveTestedPeopleText.bronnen.rivm, dateOfInsertion: lastInsertionDateNursingHomeConfirmedCasesOverTime, timeframePeriod: nursingHomeConfirmedCasesOverTimeTimeframePeriod, - isArchivedGraph: true, + isArchived: true, }} title={positiveTestedPeopleText.linechart_titel} description={positiveTestedPeopleText.linechart_description} @@ -346,8 +358,11 @@ function VulnerableGroups(props: StaticProps) { title={textNl.barscale_titel} description={textNl.extra_uitleg} metadata={{ - date: nursinghomeDataLastValue.date_unix, + timeframePeriod: nursinghomeDataLastValue.date_unix, + dateOfInsertion: nursinghomeDataLastValue.date_of_insertion_unix, source: textNl.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} > @@ -359,7 +374,7 @@ function VulnerableGroups(props: StaticProps) { source: textNl.bronnen.rivm, dateOfInsertion: lastInsertionDateNursingHomeDeceasedOverTime, timeframePeriod: nursingHomeDeceasedOverTimeTimeframePeriod, - isArchivedGraph: true, + isArchived: true, }} title={textNl.linechart_titel} timeframeOptions={TimeframeOptionsList} diff --git a/packages/app/src/pages/landelijk/patienten-in-beeld.tsx b/packages/app/src/pages/landelijk/patienten-in-beeld.tsx index 1bfbdb1ceb..e67e16c449 100644 --- a/packages/app/src/pages/landelijk/patienten-in-beeld.tsx +++ b/packages/app/src/pages/landelijk/patienten-in-beeld.tsx @@ -391,8 +391,14 @@ const PatientsPage = (props: StaticProps) => { title: textNl.section_archived.archived_choropleth.legend_title, }} metadata={{ - date: archivedChoropleth.gm.hospital_nice_choropleth_archived_20230830[archivedChoropleth.gm.hospital_nice_choropleth_archived_20230830.length - 1].date_unix, + timeframePeriod: + archivedChoropleth.gm.hospital_nice_choropleth_archived_20230830[archivedChoropleth.gm.hospital_nice_choropleth_archived_20230830.length - 1].date_unix, source: textNl.sources.nice, + isTimeframePeriodKpi: true, + dateOfInsertion: + archivedChoropleth.gm.hospital_nice_choropleth_archived_20230830[archivedChoropleth.gm.hospital_nice_choropleth_archived_20230830.length - 1] + .date_of_insertion_unix, + isArchived: true, }} > ) => { outdatedDataLabel: textNl.choropleth_legend_outdated_data_label, }} metadata={{ - date: { + timeframePeriod: { start: archivedChoropleth.gm.hospital_nice_choropleth_archived_20240228[archivedChoropleth.gm.hospital_nice_choropleth_archived_20240228.length - 1].date_start_unix, end: archivedChoropleth.gm.hospital_nice_choropleth_archived_20240228[archivedChoropleth.gm.hospital_nice_choropleth_archived_20240228.length - 1] .date_end_unix, }, + isTimeframePeriodKpi: true, + dateOfInsertion: + archivedChoropleth.gm.hospital_nice_choropleth_archived_20240228[archivedChoropleth.gm.hospital_nice_choropleth_archived_20240228.length - 1] + .date_of_insertion_unix, source: textNl.sources.nice, + isArchived: true, }} pageType="patienten-in-beeld" notification={textNl.choropleth_update_notification} diff --git a/packages/app/src/pages/landelijk/positieve-testen.tsx b/packages/app/src/pages/landelijk/positieve-testen.tsx index 1da7cb8bfc..ac87f75561 100644 --- a/packages/app/src/pages/landelijk/positieve-testen.tsx +++ b/packages/app/src/pages/landelijk/positieve-testen.tsx @@ -170,7 +170,7 @@ function PositivelyTestedPeople(props: StaticProps) { source: textNl.bronnen.rivm, dateOfInsertion: getLastInsertionDateOfPage(data, ['tested_overall_archived_20230331']), timeframePeriod: testedOverallTimeframePeriod, - isArchivedGraph: true, + isArchived: true, }} timeframeOptions={TimeframeOptionsList} timeframeInitialValue={confirmedCasesInfectedTimeframe} @@ -219,11 +219,10 @@ function PositivelyTestedPeople(props: StaticProps) { infected_total: formatNumber(archivedDataGgdLastValue.infected), })} metadata={{ - date: getLastInsertionDateOfPage(data, ['tested_ggd_archived_20230321']), source: textNl.ggd.bronnen.rivm, dateOfInsertion: getLastInsertionDateOfPage(data, ['tested_ggd_archived_20230321']), timeframePeriod: testedGgdTimeframePeriod, - isArchivedGraph: true, + isArchived: true, }} onSelectTimeframe={setConfirmedCasesInfectedPercentageTimeframe} toggle={{ @@ -262,9 +261,9 @@ function PositivelyTestedPeople(props: StaticProps) { })} metadata={{ source: textNl.ggd.bronnen.rivm, - date: getLastInsertionDateOfPage(data, ['tested_ggd_archived_20230321']), dateOfInsertion: getLastInsertionDateOfPage(data, ['tested_per_age_group_archived_20230331']), timeframePeriod: testedGgdTimeframePeriod, + isArchived: true, }} onSelectTimeframe={setConfirmedCasesTestedOverTimeTimeframe} toggle={{ @@ -309,6 +308,7 @@ function PositivelyTestedPeople(props: StaticProps) { source: textNl.bronnen.rivm, dateOfInsertion: getLastInsertionDateOfPage(data, ['tested_per_age_group_archived_20230331']), timeframePeriod: testedPerAgeGroupTimeframePeriod, + isArchived: true, }} onSelectTimeframe={setConfirmedCasesInfectedPerAgeTimeframe} > @@ -328,8 +328,11 @@ function PositivelyTestedPeople(props: StaticProps) { diff --git a/packages/app/src/pages/landelijk/reproductiegetal.tsx b/packages/app/src/pages/landelijk/reproductiegetal.tsx index f0a426c735..88286765e0 100644 --- a/packages/app/src/pages/landelijk/reproductiegetal.tsx +++ b/packages/app/src/pages/landelijk/reproductiegetal.tsx @@ -113,9 +113,9 @@ const ReproductionIndex = (props: StaticProps) => { ) => { title={textNl.barscale_titel} description={textNl.extra_uitleg} metadata={{ - date: sewerAverages.last_value.date_unix, + timeframePeriod: sewerAverages.last_value.date_unix, + dateOfInsertion: sewerAverages.last_value.date_of_insertion_unix, source: textNl.bronnen.rivm, + isTimeframePeriodKpi: true, }} > ) => { title={textNl.map_titel} description={textNl.map_toelichting} metadata={{ - date: { start: choropleth.gm.sewer[0].date_start_unix, end: choropleth.gm.sewer[0].date_end_unix }, + timeframePeriod: { start: choropleth.gm.sewer[0].date_start_unix, end: choropleth.gm.sewer[0].date_end_unix }, + dateOfInsertion: choropleth.gm.sewer[0].date_of_insertion_unix, source: textNl.bronnen.rivm, + isTimeframePeriodKpi: true, }} valueAnnotation={commonTexts.waarde_annotaties.riool_normalized} legend={{ diff --git a/packages/app/src/pages/landelijk/sterfte.tsx b/packages/app/src/pages/landelijk/sterfte.tsx index ede0bcf1f1..6732832260 100644 --- a/packages/app/src/pages/landelijk/sterfte.tsx +++ b/packages/app/src/pages/landelijk/sterfte.tsx @@ -219,8 +219,10 @@ const DeceasedNationalPage = (props: StaticProps) => { @@ -229,8 +231,10 @@ const DeceasedNationalPage = (props: StaticProps) => { @@ -246,7 +250,7 @@ const DeceasedNationalPage = (props: StaticProps) => { source: textNl.section_deceased_rivm.bronnen.rivm, timeframePeriod: deceasedRivmTimeframePeriod, dateOfInsertion: deceasedRivmLastInsertionDate, - isArchivedGraph: true, + isArchived: true, }} onSelectTimeframe={setDeceasedOverTimeTimeframe} > @@ -282,8 +286,9 @@ const DeceasedNationalPage = (props: StaticProps) => { title={textNl.age_groups.title} description={textNl.age_groups.description} metadata={{ - date: lastdeceasedPerAgeGroupInsertionDate, + dateOfInsertion: lastdeceasedPerAgeGroupInsertionDate, source: textNl.age_groups.bronnen.rivm, + isArchived: true, }} > ) { @@ -171,8 +171,11 @@ function ElderlyAtHomeNationalPage(props: StaticProps) { title={textNl.section_positive_tested.choropleth_daily_title} description={textNl.section_positive_tested.choropleth_daily_description} metadata={{ - date: elderlyAtHomeData.last_value.date_unix, + timeframePeriod: elderlyAtHomeData.last_value.date_unix, + dateOfInsertion: elderlyAtHomeData.last_value.date_of_insertion_unix, source: textNl.section_positive_tested.bronnen.rivm, + isTimeframePeriodKpi: true, + isArchived: true, }} legend={{ thresholds: thresholds.vr.positive_tested_daily_per_100k, diff --git a/packages/app/src/pages/landelijk/varianten.tsx b/packages/app/src/pages/landelijk/varianten.tsx index 2f82f75133..20477c9fa1 100644 --- a/packages/app/src/pages/landelijk/varianten.tsx +++ b/packages/app/src/pages/landelijk/varianten.tsx @@ -172,10 +172,11 @@ export default function CovidVariantenPage(props: StaticProps )} diff --git a/packages/app/src/pages/landelijk/ziekenhuizen-in-beeld.tsx b/packages/app/src/pages/landelijk/ziekenhuizen-in-beeld.tsx index 506e4ecb8e..d071abc3aa 100644 --- a/packages/app/src/pages/landelijk/ziekenhuizen-in-beeld.tsx +++ b/packages/app/src/pages/landelijk/ziekenhuizen-in-beeld.tsx @@ -172,7 +172,8 @@ const HospitalsAndCarePage = (props: StaticProps) => { title={textNl.kpi_tiles.occupancies.title} description={textNl.kpi_tiles.occupancies.description} source={textNl.sources.lnaz} - dateOrRange={{ start: hospitalLastValue.date_start_unix, end: hospitalLastValue.date_end_unix }} + timeframePeriod={{ start: hospitalLastValue.date_start_unix, end: hospitalLastValue.date_end_unix }} + dateOfInsertion={hospitalLastValue.date_of_insertion_unix} tilesData={[ { value: hospitalLastValue.beds_occupied_covid_moving_average, @@ -306,7 +307,6 @@ const HospitalsAndCarePage = (props: StaticProps) => { title={textNl.kpi_tiles.influxes.title} description={textNl.kpi_tiles.influxes.description} source={textNl.sources.lnaz} - dateOrRange={{ start: hospitalLastValue.date_start_unix, end: hospitalLastValue.date_end_unix }} tilesData={[ { value: hospitalLastValue.influx_covid_patients, diff --git a/packages/cms/src/studio/data/data-structure.ts b/packages/cms/src/studio/data/data-structure.ts index 555b30ee6e..3f7512295b 100644 --- a/packages/cms/src/studio/data/data-structure.ts +++ b/packages/cms/src/studio/data/data-structure.ts @@ -38,9 +38,17 @@ export const dataStructure = { booster_coverage_archived_20220904: ['age_group', 'percentage', 'percentage_label'], sewer_archived_20230623: ['average', 'total_number_of_samples', 'sampled_installation_count', 'total_installation_count', 'data_is_outdated'], tested_overall_archived_20230331: ['infected', 'infected_moving_average', 'infected_moving_average_rounded', 'infected_per_100k', 'infected_per_100k_moving_average'], + hospital_nice_archived_20240228: [ + 'admissions_on_date_of_admission', + 'admissions_on_date_of_admission_moving_average', + 'admissions_on_date_of_admission_moving_average_rounded', + 'admissions_in_the_last_7_days', + 'admissions_on_date_of_reporting', + ], }, archived_gm_collection: { hospital_nice_choropleth_archived_20230830: ['admissions_on_date_of_admission', 'admissions_on_date_of_admission_per_100000', 'admissions_on_date_of_reporting'], + hospital_nice_choropleth_archived_20240228: ['admissions_in_the_last_7_days_per_100000'], sewer_archived_20230623: ['average', 'total_installation_count', 'data_is_outdated'], tested_overall_archived_20230331: ['infected_per_100k', 'infected'], vaccine_coverage_per_age_group_choropleth_archived_20231004: [ @@ -272,17 +280,8 @@ export const dataStructure = { disability_care_archived_20230126: ['newly_infected_people', 'newly_infected_locations', 'infected_locations_total', 'infected_locations_percentage', 'deceased_daily'], elderly_at_home_archived_20230126: ['positive_tested_daily', 'positive_tested_daily_per_100k', 'deceased_daily'], }, - gm: { - hospital_nice: [ - 'admissions_on_date_of_admission', - 'admissions_on_date_of_admission_moving_average', - 'admissions_on_date_of_admission_moving_average_rounded', - 'admissions_in_the_last_7_days', - 'admissions_on_date_of_reporting', - ], - sewer: ['average', 'data_is_outdated'], - }, - gm_collection: { hospital_nice_choropleth: ['admissions_in_the_last_7_days_per_100000'], sewer: ['average', 'data_is_outdated'] }, + gm: { sewer: ['average', 'data_is_outdated'] }, + gm_collection: { sewer: ['average', 'data_is_outdated'] }, nl: { intensive_care_nice: [ 'admissions_on_date_of_admission',