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

Commit

Permalink
feat(COR-1765): PR comment resolution. Solved compiler issue because …
Browse files Browse the repository at this point in the history
…of DateRange
  • Loading branch information
VWSCoronaDashboard30 committed Aug 21, 2023
1 parent b636d28 commit c1a769c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 17 deletions.
5 changes: 0 additions & 5 deletions packages/app/src/components/metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ export function Metadata({ date, source, obtainedAt, isTileFooter, datumsText, m
? replaceVariablesInText(commonTexts.common.metadata.date, {
date: formatDateFromSeconds(date, 'weekday-long'),
})
: Array.isArray(date)
? replaceVariablesInText(commonTexts.common.metadata.date_from_to, {
startDate: formatDateFromSeconds(date[0], 'weekday-long'),
endDate: formatDateFromSeconds(date[1], 'weekday-long'),
})
: typeof date === 'string'
? date
: date && date.start && date.end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function VariantsTableTileWithData({
const { formatDateSpan } = useIntl();

const metadata: MetadataProps = {
date: [dates.date_start_unix, dates.date_end_unix],
date: { start: dates.date_start_unix, end: dates.date_end_unix },
source,
obtainedAt: dates.date_of_report_unix,
};
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/pages/gemeente/[code]/rioolwater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const SewerWater = (props: StaticProps<typeof getStaticProps>) => {
<KpiTile
title={textGm.barscale_titel}
metadata={{
date: [sewerAverages.last_value.date_start_unix, sewerAverages.last_value.date_end_unix],
date: { start: sewerAverages.last_value.date_start_unix, end: sewerAverages.last_value.date_end_unix },
source: textGm.bronnen.rivm,
}}
>
Expand All @@ -145,7 +145,7 @@ const SewerWater = (props: StaticProps<typeof getStaticProps>) => {
title={textGm.total_measurements_title}
description={textGm.total_measurements_description}
metadata={{
date: [sewerInstallationMeasurement.date_start_unix, sewerInstallationMeasurement.date_end_unix],
date: { start: sewerInstallationMeasurement.date_start_unix, end: sewerInstallationMeasurement.date_end_unix },
source: textGm.bronnen.rivm,
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function IntakeHospital(props: StaticProps<typeof getStaticProps>) {
dateEnd: formatDateFromSeconds(sevenDayAverageDates[1], 'weekday-long'),
})}
metadata={{
date: sevenDayAverageDates,
date: { start: sevenDayAverageDates[0], end: sevenDayAverageDates[1] },
source: textGm.bronnen.rivm,
}}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/pages/landelijk/gedrag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default function BehaviorPage(props: StaticProps<typeof getStaticProps>)
<BehaviorLineChartTile
values={behaviorValues}
metadata={{
date: [behaviorLastValue.date_start_unix, behaviorLastValue.date_end_unix],
date: { start: behaviorLastValue.date_start_unix, end: behaviorLastValue.date_end_unix },
source: textNl.bronnen.rivm,
}}
{...timelineProp}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function VulnerableGroups(props: StaticProps<typeof getStaticProps>) {
title={ElderlyPeopleText.hospital_admissions.kpi_titel}
description={ElderlyPeopleText.hospital_admissions.kpi_toelichting}
metadata={{
date: [vulnerableHospitalAdmissionsData.date_start_unix, vulnerableHospitalAdmissionsData.date_end_unix],
date: { start: vulnerableHospitalAdmissionsData.date_start_unix, end: vulnerableHospitalAdmissionsData.date_end_unix },
source: ElderlyPeopleText.bronnen.rivm,
}}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/pages/landelijk/rioolwater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const SewerWater = (props: StaticProps<typeof getStaticProps>) => {
title={textNl.map_titel}
description={textNl.map_toelichting}
metadata={{
date: [choropleth.gm.sewer[0].date_start_unix, choropleth.gm.sewer[0].date_end_unix],
date: { start: choropleth.gm.sewer[0].date_start_unix, end: choropleth.gm.sewer[0].date_end_unix },
source: textNl.bronnen.rivm,
}}
valueAnnotation={commonTexts.waarde_annotaties.riool_normalized}
Expand Down
10 changes: 5 additions & 5 deletions packages/app/src/pages/landelijk/vaccinaties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) {
data={currentData.vaccine_administered_last_timeframe.vaccine_types}
metadata={{
source: textShared.bronnen.rivm,
date: [currentData.vaccine_administered_last_timeframe.date_start_unix, currentData.vaccine_administered_last_timeframe.date_end_unix],
date: { start: currentData.vaccine_administered_last_timeframe.date_start_unix, end: currentData.vaccine_administered_last_timeframe.date_end_unix },
obtainedAt: currentData.vaccine_administered_last_timeframe.date_of_insertion_unix,
}}
/>
Expand Down Expand Up @@ -458,10 +458,10 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) {
description={textNl.grafiek_draagvlak.omschrijving}
metadata={{
datumsText: textNl.grafiek_draagvlak.metadata_tekst,
date: [
archivedData.vaccine_vaccinated_or_support_archived_20230411.last_value.date_start_unix,
archivedData.vaccine_vaccinated_or_support_archived_20230411.last_value.date_end_unix,
],
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,
},
}}
>
<TimeSeriesChart
Expand Down

0 comments on commit c1a769c

Please sign in to comment.