From 415333725c948d58d1d646572250585befa31e0f Mon Sep 17 00:00:00 2001 From: J <93984341+VWSCoronaDashboard18@users.noreply.github.com> Date: Thu, 14 Sep 2023 14:41:22 +0200 Subject: [PATCH 01/18] task: Remove add new document button in navbar (#4868) --- .../cms/src/studio/document-options/document-options.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/cms/src/studio/document-options/document-options.ts b/packages/cms/src/studio/document-options/document-options.ts index bc3d4bfaee..c1c31e6be3 100644 --- a/packages/cms/src/studio/document-options/document-options.ts +++ b/packages/cms/src/studio/document-options/document-options.ts @@ -4,9 +4,16 @@ import { PublishOrAcceptAction } from './custom-actions/publish-or-accept'; // Removes lokalize from the global "create new" interface at the top left of the navigation bar. export const newDocumentOptions = (prev: TemplateResponse[], { creationContext }: { creationContext: NewDocumentCreationContext }) => { - if (creationContext.type === 'global' || creationContext.type === 'structure') { + if (creationContext.type === 'structure') { return prev.filter((templateItem) => templateItem.templateId !== 'lokalizeText'); } + if (creationContext.type === 'global') { + // Removes the button visually from the header + + window.document.querySelector('style')?.append('[data-ui="Navbar"] button[aria-label^="Create new document"] {display: none}'); + // Removes the functionality from the button in the header + return []; + } return prev; }; From c878cb544df642fb7e6c281c419b3eedb4888df2 Mon Sep 17 00:00:00 2001 From: J <93984341+VWSCoronaDashboard18@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:35:48 +0200 Subject: [PATCH 02/18] Feature/cor 1563 refactor text keys in kpi to markdown (#4867) * fix: deleted unused component * fix: Create markdown consistency in KPI tiles --- .../components/kpi/bordered-kpi-section.tsx | 9 +- packages/app/src/domain/vaccine/index.ts | 1 - .../vaccine/vaccinations-shot-kpi-section.tsx | 20 +-- .../vaccine-administrations-kpi-section.tsx | 139 ------------------ .../vaccine/vaccine-coverage-toggle-tile.tsx | 2 +- .../src/pages/gemeente/[code]/rioolwater.tsx | 4 +- .../app/src/pages/gemeente/[code]/sterfte.tsx | 6 +- .../src/pages/landelijk/reproductiegetal.tsx | 3 +- packages/app/src/pages/landelijk/sterfte.tsx | 6 +- 9 files changed, 14 insertions(+), 176 deletions(-) delete mode 100644 packages/app/src/domain/vaccine/vaccine-administrations-kpi-section.tsx diff --git a/packages/app/src/components/kpi/bordered-kpi-section.tsx b/packages/app/src/components/kpi/bordered-kpi-section.tsx index 3f9041ade6..c7935e64d6 100644 --- a/packages/app/src/components/kpi/bordered-kpi-section.tsx +++ b/packages/app/src/components/kpi/bordered-kpi-section.tsx @@ -3,11 +3,11 @@ import styled from 'styled-components'; import { Box } from '~/components/base'; import { mediaQueries, space } from '~/style/theme'; import { KpiTile } from '../kpi-tile'; -import { Metadata, MetadataProps } from '../metadata'; +import { MetadataProps } from '../metadata'; import { TwoKpiSection } from '../two-kpi-section'; -import { Text } from '../typography'; import { KpiContent } from './components/kpi-content'; import { BorderedKpiSectionProps } from './types'; +import { Markdown } from '../markdown'; export const BorderedKpiSection = ({ title, description, source, dateOrRange, tilesData }: BorderedKpiSectionProps) => { const metadata: MetadataProps = { @@ -16,8 +16,8 @@ export const BorderedKpiSection = ({ title, description, source, dateOrRange, ti }; return ( - <KpiTile title={title} hasNoPaddingBottom> - <Text>{description}</Text> + <KpiTile title={title} hasNoPaddingBottom metadata={metadata}> + <Markdown content={description} /> <TwoKpiSection spacing={5}> <KpiContentContainer> {tilesData.map((tile, index) => ( @@ -25,7 +25,6 @@ export const BorderedKpiSection = ({ title, description, source, dateOrRange, ti ))} </KpiContentContainer> </TwoKpiSection> - <Metadata {...metadata} isTileFooter /> </KpiTile> ); }; diff --git a/packages/app/src/domain/vaccine/index.ts b/packages/app/src/domain/vaccine/index.ts index 308025c30a..d6d4fab7e8 100644 --- a/packages/app/src/domain/vaccine/index.ts +++ b/packages/app/src/domain/vaccine/index.ts @@ -3,7 +3,6 @@ export { BoosterShotCoveragePerAgeGroup } from './booster-shot-coverage-per-age- export { Autumn2022ShotCoveragePerAgeGroup } from './autumn-2022-shot-coverage-per-age-group/autumn-2022-shot-coverage-per-age-group'; export { VaccinationsOverTimeTile } from './vaccinations-over-time-tile'; export { VaccineBoosterAdministrationsKpiSection } from './vaccine-booster-administrations-kpi-section'; -export { VaccineAdministrationsKpiSection } from './vaccine-administrations-kpi-section'; export { VaccinationsShotKpiSection } from './vaccinations-shot-kpi-section'; export { VaccinationsKpiHeader } from './vaccinations-kpi-header'; export { VaccineCoverageChoropleth } from './vaccine-coverage-choropleth'; diff --git a/packages/app/src/domain/vaccine/vaccinations-shot-kpi-section.tsx b/packages/app/src/domain/vaccine/vaccinations-shot-kpi-section.tsx index b08e3467d1..fed43dc2a4 100644 --- a/packages/app/src/domain/vaccine/vaccinations-shot-kpi-section.tsx +++ b/packages/app/src/domain/vaccine/vaccinations-shot-kpi-section.tsx @@ -1,13 +1,5 @@ import { useIntl } from '~/intl'; -import { - KpiTile, - KpiValue, - Markdown, - TwoKpiSection, - Metadata, - Message, - MetadataProps, -} from '~/components'; +import { KpiTile, KpiValue, TwoKpiSection, Message, MetadataProps } from '~/components'; import { Box } from '~/components/base'; type SourceType = { @@ -29,19 +21,13 @@ interface VaccinationsShotKpiSectionProps { metadata: MetadataProps; } -export function VaccinationsShotKpiSection({ - text, - value, - metadata, -}: VaccinationsShotKpiSectionProps) { +export function VaccinationsShotKpiSection({ text, value, metadata }: VaccinationsShotKpiSectionProps) { const { formatNumber } = useIntl(); return ( <TwoKpiSection hasBorder hasPadding> - <KpiTile title={text.title} hasNoBorder hasNoPaddingBottom> + <KpiTile title={text.title} hasNoBorder hasNoPaddingBottom description={text.description} metadata={metadata}> <KpiValue text={formatNumber(value)} /> - <Markdown content={text.description} /> {text.warning && <Message variant="warning">{text.warning}</Message>} - <Metadata {...metadata} isTileFooter /> </KpiTile> <Box /> </TwoKpiSection> diff --git a/packages/app/src/domain/vaccine/vaccine-administrations-kpi-section.tsx b/packages/app/src/domain/vaccine/vaccine-administrations-kpi-section.tsx deleted file mode 100644 index d4196902bb..0000000000 --- a/packages/app/src/domain/vaccine/vaccine-administrations-kpi-section.tsx +++ /dev/null @@ -1,139 +0,0 @@ -import { Nl } from '@corona-dashboard/common'; -import { css } from '@styled-system/css'; -import { useState } from 'react'; -import { Box } from '~/components/base'; -import { KpiTile } from '~/components/kpi-tile'; -import { KpiValue } from '~/components/kpi-value'; -import { Markdown } from '~/components/markdown'; -import { RadioGroup } from '~/components/radio-group'; -import { TwoKpiSection } from '~/components/two-kpi-section'; -import { InlineText, Text, BoldText } from '~/components/typography'; -import { useIntl } from '~/intl'; -import { SiteText } from '~/locale'; -import { space } from '~/style/theme'; -import { replaceVariablesInText } from '~/utils/replace-variables-in-text'; - -export function VaccineAdministrationsKpiSection({ - data, - text, -}: { - data: Pick< - Nl, - | 'vaccine_administered_total' - | 'vaccine_administered_ggd' - | 'vaccine_administered_hospitals_and_care_institutions' - | 'vaccine_administered_doctors' - | 'vaccine_administered_ggd_ghor' - >; - text: SiteText['pages']['vaccinations_page']['nl']; -}) { - const [selectedTab, setSelectedTab] = useState(text.gezette_prikken.tab_first.title); - - return ( - <TwoKpiSection> - <KpiTile - title={text.gezette_prikken.title} - metadata={{ - source: text.bronnen.all_left, - }} - > - <Box css={css({ '& div': { justifyContent: 'flex-start' } })} marginBottom={space[3]}> - <RadioGroup - value={selectedTab} - onChange={(value) => setSelectedTab(value)} - items={[ - { - label: text.gezette_prikken.tab_first.title, - value: text.gezette_prikken.tab_first.title, - }, - { - label: text.gezette_prikken.tab_second.title, - value: text.gezette_prikken.tab_second.title, - }, - ]} - /> - </Box> - {selectedTab == text.gezette_prikken.tab_first.title && ( - <> - <KpiValue absolute={data.vaccine_administered_total.last_value.estimated} /> - <Box display="flex" flexDirection={{ _: 'column', lg: 'row' }}> - <Box flex={{ lg: '1 1 50%' }} marginBottom={space[3]}> - <Markdown content={text.gezette_prikken.tab_first.description} /> - </Box> - <Box flex={{ lg: '1 1 50%' }} marginLeft={{ lg: space[4] }} spacing={3}> - <VaccineAdministeredItem - value={data.vaccine_administered_ggd.last_value.estimated} - description={text.gezette_prikken.estimated.ggd} - date={data.vaccine_administered_ggd.last_value.date_unix} - text={text.gezette_prikken} - /> - - <VaccineAdministeredItem - value={data.vaccine_administered_hospitals_and_care_institutions.last_value.estimated} - description={text.gezette_prikken.estimated.hospitals_and_care_institutions} - date={data.vaccine_administered_hospitals_and_care_institutions.last_value.date_unix} - text={text.gezette_prikken} - /> - - <VaccineAdministeredItem - value={data.vaccine_administered_doctors.last_value.estimated} - description={text.gezette_prikken.estimated.doctors} - date={data.vaccine_administered_doctors.last_value.date_unix} - text={text.gezette_prikken} - /> - </Box> - </Box> - </> - )} - {selectedTab == text.gezette_prikken.tab_second.title && ( - <> - <KpiValue absolute={data.vaccine_administered_total.last_value.reported} /> - <Box display="flex" flexDirection={{ _: 'column', lg: 'row' }}> - <Box flex={{ lg: '1 1 50%' }}> - <Markdown content={text.gezette_prikken.tab_second.description} /> - </Box> - <Box flex={{ lg: '1 1 50%' }} marginLeft={{ lg: space[4] }}> - <VaccineAdministeredItem - value={data.vaccine_administered_ggd_ghor.last_value.reported} - description={text.gezette_prikken.reported.ggd_ghor} - date={data.vaccine_administered_ggd_ghor.last_value.date_unix} - isReported - text={text.gezette_prikken} - /> - </Box> - </Box> - </> - )} - </KpiTile> - </TwoKpiSection> - ); -} - -interface VaccineAdministeredProps { - value: number; - date: number; - description: string; - isReported?: boolean; - text: SiteText['pages']['vaccinations_page']['nl']['gezette_prikken']; -} - -function VaccineAdministeredItem(props: VaccineAdministeredProps) { - const { value, date, description, isReported, text } = props; - - const { formatNumber, formatDateFromSeconds } = useIntl(); - - return ( - <Box spacing={1}> - <BoldText> - <InlineText color="data.primary">{formatNumber(value)}</InlineText> - {' ' + description} - </BoldText> - - <Text variant="label1" color="gray7"> - {replaceVariablesInText(isReported ? text.reported_until : text.estimated_until, { - reportedDate: formatDateFromSeconds(date, 'weekday-long'), - })} - </Text> - </Box> - ); -} 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 27e19cb642..2da116aa8b 100644 --- a/packages/app/src/domain/vaccine/vaccine-coverage-toggle-tile.tsx +++ b/packages/app/src/domain/vaccine/vaccine-coverage-toggle-tile.tsx @@ -71,7 +71,7 @@ export function VaccineCoverageToggleTile({ }; return ( - <KpiTile title={title}> + <KpiTile title={title} metadata={metadata}> <Box css={css({ '& div': { justifyContent: 'flex-start' } })} marginBottom={space[3]}> <RadioGroup value={selectedTab} diff --git a/packages/app/src/pages/gemeente/[code]/rioolwater.tsx b/packages/app/src/pages/gemeente/[code]/rioolwater.tsx index ede59b6f71..f597674f2b 100644 --- a/packages/app/src/pages/gemeente/[code]/rioolwater.tsx +++ b/packages/app/src/pages/gemeente/[code]/rioolwater.tsx @@ -5,7 +5,6 @@ import { GetStaticPropsContext } from 'next'; import { InView } from '~/components/in-view'; import { KpiTile } from '~/components/kpi-tile'; import { KpiValue } from '~/components/kpi-value'; -import { Markdown } from '~/components/markdown'; import { PageArticlesTile } from '~/components/articles/page-articles-tile'; import { PageFaqTile } from '~/components/page-faq-tile'; import { PageInformationBlock } from '~/components/page-information-block'; @@ -124,6 +123,7 @@ const SewerWater = (props: StaticProps<typeof getStaticProps>) => { date: { start: sewerAverages.last_value.date_start_unix, end: sewerAverages.last_value.date_end_unix }, source: textGm.bronnen.rivm, }} + description={textGm.extra_uitleg} > <KpiValue absolute={sewerAverages.last_value.average} @@ -137,8 +137,6 @@ const SewerWater = (props: StaticProps<typeof getStaticProps>) => { populationCountConnectedToRWZIS: <strong>{formatNumber(populationCountConnectedToRWZIS)}</strong>, })} </Text> - - <Markdown content={textGm.extra_uitleg} /> </KpiTile> <KpiTile diff --git a/packages/app/src/pages/gemeente/[code]/sterfte.tsx b/packages/app/src/pages/gemeente/[code]/sterfte.tsx index 3c789c8c66..b67c8f0b9b 100644 --- a/packages/app/src/pages/gemeente/[code]/sterfte.tsx +++ b/packages/app/src/pages/gemeente/[code]/sterfte.tsx @@ -6,14 +6,12 @@ import { ChartTile } from '~/components/chart-tile'; import { InView } from '~/components/in-view'; import { KpiTile } from '~/components/kpi-tile'; import { KpiValue } from '~/components/kpi-value'; -import { Markdown } from '~/components/markdown'; import { PageArticlesTile } from '~/components/articles/page-articles-tile'; import { PageFaqTile } from '~/components/page-faq-tile'; import { PageInformationBlock } from '~/components/page-information-block/page-information-block'; import { TileList } from '~/components/tile-list'; import { TimeSeriesChart } from '~/components/time-series-chart/time-series-chart'; import { TwoKpiSection } from '~/components/two-kpi-section'; -import { Text } from '~/components/typography'; import { WarningTile } from '~/components/warning-tile'; import { GmLayout, Layout } from '~/domain/layout'; import { useIntl } from '~/intl'; @@ -123,9 +121,9 @@ const DeceasedMunicipalPage = (props: StaticProps<typeof getStaticProps>) => { date: data.deceased_rivm_archived_20221231.last_value.date_unix, source: textGm.section_deceased_rivm.bronnen.rivm, }} + description={textGm.section_deceased_rivm.kpi_covid_daily_description} > <KpiValue absolute={data.deceased_rivm_archived_20221231.last_value.covid_daily} difference={data.difference.deceased_rivm__covid_daily_archived_20221231} isAmount /> - <Markdown content={textGm.section_deceased_rivm.kpi_covid_daily_description} /> </KpiTile> <KpiTile @@ -134,9 +132,9 @@ const DeceasedMunicipalPage = (props: StaticProps<typeof getStaticProps>) => { date: data.deceased_rivm_archived_20221231.last_value.date_unix, source: textGm.section_deceased_rivm.bronnen.rivm, }} + description={textGm.section_deceased_rivm.kpi_covid_total_description} > <KpiValue absolute={data.deceased_rivm_archived_20221231.last_value.covid_total} /> - <Text>{textGm.section_deceased_rivm.kpi_covid_total_description}</Text> </KpiTile> </TwoKpiSection> diff --git a/packages/app/src/pages/landelijk/reproductiegetal.tsx b/packages/app/src/pages/landelijk/reproductiegetal.tsx index ad0def1b3c..78b55fa403 100644 --- a/packages/app/src/pages/landelijk/reproductiegetal.tsx +++ b/packages/app/src/pages/landelijk/reproductiegetal.tsx @@ -3,7 +3,6 @@ import { Reproductiegetal } from '@corona-dashboard/icons'; import { GetStaticPropsContext } from 'next'; import { InView } from '~/components/in-view'; import { IllustrationTile } from '~/components/illustration-tile'; -import { Markdown } from '~/components/markdown'; import { PageArticlesTile } from '~/components/articles/page-articles-tile'; import { PageFaqTile } from '~/components/page-faq-tile'; import { PageInformationBlock } from '~/components/page-information-block'; @@ -114,6 +113,7 @@ const ReproductionIndex = (props: StaticProps<typeof getStaticProps>) => { obtainedAt: reproductionLastValue.date_of_insertion_unix, }} hasNoBorder + description={textNl.barscale_toelichting} > <KpiValue absolute={reproductionLastValue.index_average} @@ -122,7 +122,6 @@ const ReproductionIndex = (props: StaticProps<typeof getStaticProps>) => { showOldDateUnixForDifference isAmount /> - <Markdown content={textNl.barscale_toelichting} /> </KpiTile> <IllustrationTile image={'/images/reproductie-explainer.svg'} alt={textNl.reproductie_explainer_alt} description={textNl.extra_uitleg} hasNoBorder /> diff --git a/packages/app/src/pages/landelijk/sterfte.tsx b/packages/app/src/pages/landelijk/sterfte.tsx index 808193478c..b474f5a2cb 100644 --- a/packages/app/src/pages/landelijk/sterfte.tsx +++ b/packages/app/src/pages/landelijk/sterfte.tsx @@ -8,14 +8,12 @@ import { ChartTile } from '~/components/chart-tile'; import { InView } from '~/components/in-view'; import { KpiTile } from '~/components/kpi-tile'; import { KpiValue } from '~/components/kpi-value'; -import { Markdown } from '~/components/markdown'; import { PageArticlesTile } from '~/components/articles/page-articles-tile'; import { PageFaqTile } from '~/components/page-faq-tile'; import { PageInformationBlock } from '~/components/page-information-block'; import { TileList } from '~/components/tile-list'; import { TimeSeriesChart } from '~/components/time-series-chart'; import { TwoKpiSection } from '~/components/two-kpi-section'; -import { Text } from '~/components/typography'; import { WarningTile } from '~/components/warning-tile'; import { DeceasedMonitorSection } from '~/domain/deceased'; import { Layout, NlLayout } from '~/domain/layout'; @@ -160,9 +158,9 @@ const DeceasedNationalPage = (props: StaticProps<typeof getStaticProps>) => { date: dataRivm.last_value.date_unix, source: textNl.section_deceased_rivm.bronnen.rivm, }} + description={textNl.section_deceased_rivm.kpi_covid_daily_description} > <KpiValue absolute={dataRivm.last_value.covid_daily} difference={archivedData.difference.deceased_rivm__covid_daily_archived_20221231} isAmount /> - <Markdown content={textNl.section_deceased_rivm.kpi_covid_daily_description} /> </KpiTile> <KpiTile title={textNl.section_deceased_rivm.kpi_covid_total_title} @@ -170,9 +168,9 @@ const DeceasedNationalPage = (props: StaticProps<typeof getStaticProps>) => { date: dataRivm.last_value.date_unix, source: textNl.section_deceased_rivm.bronnen.rivm, }} + description={textNl.section_deceased_rivm.kpi_covid_total_description} > <KpiValue absolute={dataRivm.last_value.covid_total} /> - <Text>{textNl.section_deceased_rivm.kpi_covid_total_description}</Text> </KpiTile> </TwoKpiSection> From 38093ef49fc70d2ecce5da3c0a26aa6f2069abc2 Mon Sep 17 00:00:00 2001 From: VWSCoronaDashboard29 <137172332+VWSCoronaDashboard29@users.noreply.github.com> Date: Tue, 19 Sep 2023 09:10:50 +0200 Subject: [PATCH 03/18] Bugfix/cor 1769 variants table and graph 2 (#4870) * fix(COR-1769): Removed keys from schemas * fix(COR-1769): Removed historical significance key * fix(COR-1769): Update getter functions * fix(COR-1769): Remove unused code from variants chart * fix(COR-1769): Re-add destructuring based on suggestion --------- Co-authored-by: VWSCoronaDashboard29 <coronadashboard@netcompany.com> --- packages/app/schema/nl/variants.json | 8 ---- .../static-props/get-variant-chart-data.ts | 25 +++++++------ .../static-props/get-variant-order-colors.ts | 6 +-- .../static-props/get-variant-table-data.ts | 32 +++++++++------- .../variants-stacked-area-tile.tsx | 37 +++++-------------- .../cms/src/studio/data/data-structure.ts | 4 +- packages/common/src/types/data.ts | 12 +----- 7 files changed, 49 insertions(+), 75 deletions(-) diff --git a/packages/app/schema/nl/variants.json b/packages/app/schema/nl/variants.json index d628af7a57..7f2473f281 100644 --- a/packages/app/schema/nl/variants.json +++ b/packages/app/schema/nl/variants.json @@ -41,8 +41,6 @@ "order", "occurrence", "percentage", - "is_variant_of_concern", - "has_historical_significance", "sample_size", "date_start_unix", "date_end_unix", @@ -61,12 +59,6 @@ "percentage": { "type": "number" }, - "is_variant_of_concern": { - "type": "boolean" - }, - "has_historical_significance": { - "type": "boolean" - }, "sample_size": { "type": "integer" }, diff --git a/packages/app/src/domain/variants/static-props/get-variant-chart-data.ts b/packages/app/src/domain/variants/static-props/get-variant-chart-data.ts index 600d5ea608..9943c5ef49 100644 --- a/packages/app/src/domain/variants/static-props/get-variant-chart-data.ts +++ b/packages/app/src/domain/variants/static-props/get-variant-chart-data.ts @@ -18,31 +18,32 @@ const EMPTY_VALUES = { }, } as const; +/** + * Returns values for variant timeseries chart + * @param variants + */ export function getVariantChartData(variants: NlVariants | undefined) { if (!isDefined(variants) || !isDefined(variants.values)) { return EMPTY_VALUES; } - const variantsOfConcern = variants.values - .filter((variant) => variant.last_value.is_variant_of_concern || variant.last_value.has_historical_significance) - .filter((variant) => variant.variant_code !== 'other_graph' && variant.variant_code !== 'other_table') - .sort((a, b) => b.last_value.order - a.last_value.order); + const sortedVariants = variants.values.sort((a, b) => b.last_value.order - a.last_value.order); - const firstVariant = variantsOfConcern.shift(); + const firstVariantInList = sortedVariants.shift(); - if (!isDefined(firstVariant)) { + if (!isDefined(firstVariantInList)) { return EMPTY_VALUES; } - const values = firstVariant.values.map<VariantChartValue>((value, index) => { + const values = firstVariantInList.values.map<VariantChartValue>((value, index) => { const item = { is_reliable: true, date_start_unix: value.date_start_unix, date_end_unix: value.date_end_unix, - [`${firstVariant.variant_code}_percentage`]: value.percentage, + [`${firstVariantInList.variant_code}_percentage`]: value.percentage, } as VariantChartValue; - variantsOfConcern.forEach((variant) => { + sortedVariants.forEach((variant) => { (item as unknown as Record<string, number>)[`${variant.variant_code}_percentage`] = variant.values[index].percentage; }); @@ -52,9 +53,9 @@ export function getVariantChartData(variants: NlVariants | undefined) { return { variantChart: values, dates: { - date_of_report_unix: firstVariant.last_value.date_of_report_unix, - date_start_unix: firstVariant.last_value.date_start_unix, - date_end_unix: firstVariant.last_value.date_end_unix, + date_of_report_unix: firstVariantInList.last_value.date_of_report_unix, + date_start_unix: firstVariantInList.last_value.date_start_unix, + date_end_unix: firstVariantInList.last_value.date_end_unix, }, } as const; } diff --git a/packages/app/src/domain/variants/static-props/get-variant-order-colors.ts b/packages/app/src/domain/variants/static-props/get-variant-order-colors.ts index d899e624a9..b100539ff3 100644 --- a/packages/app/src/domain/variants/static-props/get-variant-order-colors.ts +++ b/packages/app/src/domain/variants/static-props/get-variant-order-colors.ts @@ -8,8 +8,7 @@ export type ColorMatch = { }; const getColorForVariant = (variantCode: VariantCode, index: number): string => { - if (variantCode === 'other_table') return colors.gray5; - if (variantCode === 'other_graph') return colors.gray5; + if (variantCode === 'other_variants') return colors.gray5; return colors.variants.colorList[index]; }; @@ -20,8 +19,7 @@ export const getVariantOrderColors = (variants: NlVariants | undefined): ColorMa } const colorOrder = variants.values - .filter((variant) => variant.last_value.is_variant_of_concern || variant.last_value.has_historical_significance) - .sort((a, b) => (a.variant_code.includes('other') || b.variant_code.includes('other') ? -1 : a.last_value.order - b.last_value.order)) + .sort((a, b) => a.last_value.order - b.last_value.order) .map((variant, index) => { const variantColor = getColorForVariant(variant.variant_code, index); return { diff --git a/packages/app/src/domain/variants/static-props/get-variant-table-data.ts b/packages/app/src/domain/variants/static-props/get-variant-table-data.ts index 7e173b3168..73081fb5d4 100644 --- a/packages/app/src/domain/variants/static-props/get-variant-table-data.ts +++ b/packages/app/src/domain/variants/static-props/get-variant-table-data.ts @@ -13,6 +13,12 @@ export type VariantRow = { export type VariantTableData = ReturnType<typeof getVariantTableData>; +/** + * Return values to populate the variants table + * @param variants + * @param namedDifference + * @param variantColors + */ export function getVariantTableData(variants: NlVariants | undefined, namedDifference: NlNamedDifference, variantColors: ColorMatch[]) { const emptyValues = { variantTable: null, @@ -31,14 +37,14 @@ export function getVariantTableData(variants: NlVariants | undefined, namedDiffe if (isPresent(namedDifference.variants__percentage)) { const difference = namedDifference.variants__percentage.find((x) => x.variant_code === name); - if (!difference) { - return null; - } - - return difference; + return difference ?? null; } } + function mapVariantToNamedDifference(namedDifferenceVariantCode: string) { + return variants?.values.find((x) => x.variant_code === namedDifferenceVariantCode) ?? null; + } + const firstLastValue = first<NlVariantsVariant>(variants.values); if (!isDefined(firstLastValue)) { @@ -50,16 +56,16 @@ export function getVariantTableData(variants: NlVariants | undefined, namedDiffe date_of_report_unix: firstLastValue.last_value.date_of_report_unix, }; - const variantTable = variants.values - .filter((variant) => variant.variant_code !== 'other_graph' && !variant.last_value.has_historical_significance) - .sort((a, b) => b.last_value.order - a.last_value.order) - .map<VariantRow>((variant) => { - const color = variantColors.find((variantColor) => variantColor.variant === variant.variant_code)?.color || colors.gray5; + const variantTable = namedDifference.variants__percentage + .filter((namedDifferencePercentage) => mapVariantToNamedDifference(namedDifferencePercentage.variant_code) !== null) + .sort((a, b) => mapVariantToNamedDifference(b.variant_code)!.last_value.order - mapVariantToNamedDifference(a.variant_code)!.last_value.order) + .map<VariantRow>((namedDifferenceEntry) => { + const color = variantColors.find((variantColor) => variantColor.variant === namedDifferenceEntry.variant_code)?.color || colors.gray5; return { - variantCode: variant.variant_code, - percentage: variant.last_value.percentage, - difference: findDifference(variant.variant_code), + variantCode: namedDifferenceEntry.variant_code, + percentage: mapVariantToNamedDifference(namedDifferenceEntry.variant_code)?.last_value.percentage as unknown as number, + difference: findDifference(namedDifferenceEntry.variant_code), color, }; }); diff --git a/packages/app/src/domain/variants/variants-stacked-area-tile/variants-stacked-area-tile.tsx b/packages/app/src/domain/variants/variants-stacked-area-tile/variants-stacked-area-tile.tsx index 27311fa89b..753222a673 100644 --- a/packages/app/src/domain/variants/variants-stacked-area-tile/variants-stacked-area-tile.tsx +++ b/packages/app/src/domain/variants/variants-stacked-area-tile/variants-stacked-area-tile.tsx @@ -1,4 +1,4 @@ -import { colors, TimeframeOption, TimeframeOptionsList } from '@corona-dashboard/common'; +import { TimeframeOption, TimeframeOptionsList } from '@corona-dashboard/common'; import { useMemo, useState } from 'react'; import { isDefined, isPresent } from 'ts-is-present'; import { Spacer } from '~/components/base'; @@ -35,9 +35,9 @@ export const VariantsStackedAreaTile = ({ text, values, variantColors, metadata const { list, toggle, clear } = useList<keyof VariantChartValue>(alwaysEnabled); - const [seriesConfig, otherConfig, selectOptions] = useSeriesConfig(text, values, variantColors); + const [seriesConfig, selectOptions] = useSeriesConfig(text, values, variantColors); - const filteredConfig = useFilteredSeriesConfig(seriesConfig, otherConfig, list); + const filteredConfig = useFilteredSeriesConfig(seriesConfig, list); /* Static legend contains only the inaccurate item */ const staticLegendItems: LegendItem[] = []; @@ -93,8 +93,8 @@ export const VariantsStackedAreaTile = ({ text, values, variantColors, metadata const reorderContext = { ...context, config: [ + // Destructuring so as to not interact with the object directly and eliminate the possibility of introducing inconsistencies ...context.config.filter((value) => !hasMetricProperty(value) || filteredValues[value.metricProperty] || hasSelectedMetrics), - context.config.find((value) => hasMetricProperty(value) && value.metricProperty === 'other_graph_percentage'), ].filter(isDefined), value: !hasSelectedMetrics ? filteredValues : context.value, }; @@ -117,16 +117,10 @@ const hasMetricProperty = (config: any): config is { metricProperty: string } => return 'metricProperty' in config; }; -const useFilteredSeriesConfig = ( - seriesConfig: GappedAreaSeriesDefinition<VariantChartValue>[], - otherConfig: GappedAreaSeriesDefinition<VariantChartValue>, - compareList: (keyof VariantChartValue)[] -) => { +const useFilteredSeriesConfig = (seriesConfig: GappedAreaSeriesDefinition<VariantChartValue>[], compareList: (keyof VariantChartValue)[]) => { return useMemo(() => { - return [otherConfig, ...seriesConfig].filter( - (item) => item.metricProperty !== 'other_graph_percentage' && (compareList.includes(item.metricProperty) || compareList.length === alwaysEnabled.length) - ); - }, [seriesConfig, otherConfig, compareList]); + return seriesConfig.filter((item) => compareList.includes(item.metricProperty) || compareList.length === alwaysEnabled.length); + }, [seriesConfig, compareList]); }; const useSeriesConfig = (text: VariantsStackedAreaTileText, values: VariantChartValue[], variantColors: ColorMatch[]) => { @@ -134,7 +128,7 @@ const useSeriesConfig = (text: VariantsStackedAreaTileText, values: VariantChart const baseVariantsFiltered = values .flatMap((x) => Object.keys(x)) .filter((x, index, array) => array.indexOf(x) === index) // de-dupe - .filter((x) => x.endsWith('_percentage') && x !== 'other_graph_percentage') + .filter((x) => x.endsWith('_percentage')) .reverse(); // Reverse to be in an alphabetical order /* Enrich config with dynamic data / locale */ @@ -146,7 +140,7 @@ const useSeriesConfig = (text: VariantsStackedAreaTileText, values: VariantChart const variantDynamicLabel = text.variantCodes[variantCode]; - const color = variantColors.find((variantColors) => variantColors.variant === variantCode)?.color || colors.gray5; + const color = variantColors.find((variantColors) => variantColors.variant === variantCode)?.color; if (variantDynamicLabel) { const newConfig = { @@ -164,19 +158,8 @@ const useSeriesConfig = (text: VariantsStackedAreaTileText, values: VariantChart } }); - const otherConfig = { - type: 'gapped-area', - metricProperty: 'other_graph_percentage', - label: text.tooltip_labels.other_percentage, - fillOpacity: 0.2, - shape: 'square', - color: colors.gray5, - strokeWidth: 2, - mixBlendMode: 'multiply', - } as GappedAreaSeriesDefinition<VariantChartValue>; - const selectOptions = [...seriesConfig]; - return [seriesConfig, otherConfig, selectOptions] as const; + return [seriesConfig, selectOptions] as const; }, [values, text.tooltip_labels.other_percentage, text.variantCodes, variantColors]); }; diff --git a/packages/cms/src/studio/data/data-structure.ts b/packages/cms/src/studio/data/data-structure.ts index 7e394fe459..6e80c22a9c 100644 --- a/packages/cms/src/studio/data/data-structure.ts +++ b/packages/cms/src/studio/data/data-structure.ts @@ -28,6 +28,7 @@ export const dataStructure = { tested_overall_archived_20230331: ['infected', 'infected_moving_average', 'infected_moving_average_rounded', 'infected_per_100k', 'infected_per_100k_moving_average'], }, 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'], sewer_archived_20230623: ['average', 'total_installation_count', 'data_is_outdated'], tested_overall_archived_20230331: ['infected_per_100k', 'infected'], }, @@ -226,6 +227,7 @@ export const dataStructure = { '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'], @@ -243,7 +245,7 @@ export const dataStructure = { ], }, gm_collection: { - hospital_nice_choropleth: ['admissions_on_date_of_admission', 'admissions_on_date_of_admission_per_100000', 'admissions_on_date_of_reporting'], + hospital_nice_choropleth: ['admissions_in_the_last_7_days_per_100000'], sewer: ['average', 'data_is_outdated'], vaccine_coverage_per_age_group: [ 'vaccination_type', diff --git a/packages/common/src/types/data.ts b/packages/common/src/types/data.ts index 0011031c18..5c81e342de 100644 --- a/packages/common/src/types/data.ts +++ b/packages/common/src/types/data.ts @@ -758,14 +758,7 @@ export interface GmStaticValues { population_count_connected_to_rwzis: number; } export interface GmDifference { - hospital_nice__admissions_on_date_of_reporting_moving_average: DifferenceDecimal; - sewer__average?: DifferenceInteger; -} -export interface DifferenceDecimal { - old_value: number; - difference: number; - old_date_unix: number; - new_date_unix: number; + sewer__average: DifferenceInteger; } export interface DifferenceInteger { old_value: number; @@ -1209,8 +1202,7 @@ export interface NlVariantsVariantValue { order: number; occurrence: number; percentage: number; - is_variant_of_concern: boolean; - has_historical_significance: boolean; + has_historical_significance?: boolean; sample_size: number; date_start_unix: number; date_end_unix: number; From 69c904ef9cbe38dfa891207c90c1706230eec120 Mon Sep 17 00:00:00 2001 From: VWSCoronaDashboard29 <137172332+VWSCoronaDashboard29@users.noreply.github.com> Date: Tue, 19 Sep 2023 16:30:28 +0200 Subject: [PATCH 04/18] Hotfix/cor 1769 other variants on top (#4876) * fix(COR-1769): Put other_variants at bottom of table * fix(COR-1769): Add comment * fix(COR-1769): Clean up code * fix(COR-1769): Remove unused filter --------- Co-authored-by: VWSCoronaDashboard29 <coronadashboard@netcompany.com> --- .../static-props/get-variant-table-data.ts | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/packages/app/src/domain/variants/static-props/get-variant-table-data.ts b/packages/app/src/domain/variants/static-props/get-variant-table-data.ts index 73081fb5d4..de5947f6ed 100644 --- a/packages/app/src/domain/variants/static-props/get-variant-table-data.ts +++ b/packages/app/src/domain/variants/static-props/get-variant-table-data.ts @@ -1,11 +1,12 @@ import { colors, NlNamedDifference, NlVariants, NlVariantsVariant, NamedDifferenceDecimal } from '@corona-dashboard/common'; import { first } from 'lodash'; -import { isDefined, isPresent } from 'ts-is-present'; +import { isDefined } from 'ts-is-present'; import { ColorMatch } from './get-variant-order-colors'; import { VariantCode } from '../static-props'; export type VariantRow = { variantCode: VariantCode; + order: number; percentage: number | null; difference?: NamedDifferenceDecimal | null; color: string; @@ -33,18 +34,6 @@ export function getVariantTableData(variants: NlVariants | undefined, namedDiffe return emptyValues; } - function findDifference(name: string) { - if (isPresent(namedDifference.variants__percentage)) { - const difference = namedDifference.variants__percentage.find((x) => x.variant_code === name); - - return difference ?? null; - } - } - - function mapVariantToNamedDifference(namedDifferenceVariantCode: string) { - return variants?.values.find((x) => x.variant_code === namedDifferenceVariantCode) ?? null; - } - const firstLastValue = first<NlVariantsVariant>(variants.values); if (!isDefined(firstLastValue)) { @@ -56,18 +45,28 @@ export function getVariantTableData(variants: NlVariants | undefined, namedDiffe date_of_report_unix: firstLastValue.last_value.date_of_report_unix, }; + /** + * Reverse order of variants to what is received from the master table + * Move 'other variants' all the way to the bottom of the table + */ const variantTable = namedDifference.variants__percentage - .filter((namedDifferencePercentage) => mapVariantToNamedDifference(namedDifferencePercentage.variant_code) !== null) - .sort((a, b) => mapVariantToNamedDifference(b.variant_code)!.last_value.order - mapVariantToNamedDifference(a.variant_code)!.last_value.order) .map<VariantRow>((namedDifferenceEntry) => { - const color = variantColors.find((variantColor) => variantColor.variant === namedDifferenceEntry.variant_code)?.color || colors.gray5; + // There is ALWAYS a corresponding variant to a namedDifference entry. + const variant = variants.values.find((x) => x.variant_code === namedDifferenceEntry.variant_code)!; return { variantCode: namedDifferenceEntry.variant_code, - percentage: mapVariantToNamedDifference(namedDifferenceEntry.variant_code)?.last_value.percentage as unknown as number, - difference: findDifference(namedDifferenceEntry.variant_code), - color, + order: variant.last_value.order, + percentage: variant.last_value.percentage, + difference: namedDifferenceEntry, + color: variantColors.find((variantColor) => variantColor.variant === namedDifferenceEntry.variant_code)?.color || colors.gray5, }; + }) + .sort((a, b) => { + // Other Variants must always take the bottom row in the table + if (a.variantCode === 'other_variants') return 1; + if (b.variantCode === 'other_variants') return -1; + return b.order - a.order; }); return { variantTable, dates }; From dae12d5e34c05ec1ea75f56166c7c4a5cb37b52c Mon Sep 17 00:00:00 2001 From: AP <116002914+VWSCoronaDashboard28@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:40:33 +0200 Subject: [PATCH 05/18] feature/COR-1597-contact-page-improved-design (#4873) * feat(contact-page-redesign): Updated and added the necessary schemas for the new design. * feat(contact-page-redesign): Updated validation for the link and link type of an item title. Also added some UX improvements to hide the field unless it needs to be filled. * feat(contact-page-redesign): Added a telephone Icon. * feat(contact-page-redesign): Updated group schema with validation * feat(contact-page-redesign): Contact page redesign WIP * feat(contact-page-redesign): Extended the heading component so it can accept margins. * feat(contact-page-redesign): Refactoring. * feat(contact-page-redesign): Remove page title from schema. * feat(contact-page-redesign): Create a content layout and reuse on content pages. * feat(contact-page-redesign): Add utility and unit test. * feat(contact-page-redesign): Spacing fix. --- .../components/contact/contact-page-group.tsx | 27 +++++ .../contact/contact-page-item-links.tsx | 51 ++++++++ .../components/contact/contact-page-item.tsx | 35 ++++++ .../components/contact/contact-page-link.tsx | 56 +++++++++ packages/app/src/components/contact/types.ts | 31 +++++ packages/app/src/components/typography.tsx | 13 +- .../app/src/domain/layout/content-layout.tsx | 14 +++ packages/app/src/pages/contact.tsx | 112 +++++++++--------- packages/app/src/pages/over.tsx | 5 +- .../app/src/pages/veelgestelde-vragen.tsx | 5 +- .../format-link-according-to-type.spec.ts | 34 ++++++ .../utils/format-link-according-to-type.ts | 13 ++ .../src/schemas/documents/pages/contact.ts | 28 ----- .../schemas/documents/pages/contact/group.ts | 31 +++++ .../schemas/documents/pages/contact/index.ts | 23 ++++ .../schemas/documents/pages/contact/item.ts | 78 ++++++++++++ .../schemas/documents/pages/contact/link.ts | 36 ++++++ packages/cms/src/schemas/index.ts | 11 +- packages/cms/src/schemas/objects/link-type.ts | 23 ++++ packages/icons/icons.md | 1 + packages/icons/src/icon-name2filename.ts | 2 + packages/icons/src/svg/telephone.svg | 1 + 22 files changed, 537 insertions(+), 93 deletions(-) create mode 100644 packages/app/src/components/contact/contact-page-group.tsx create mode 100644 packages/app/src/components/contact/contact-page-item-links.tsx create mode 100644 packages/app/src/components/contact/contact-page-item.tsx create mode 100644 packages/app/src/components/contact/contact-page-link.tsx create mode 100644 packages/app/src/components/contact/types.ts create mode 100644 packages/app/src/domain/layout/content-layout.tsx create mode 100644 packages/app/src/utils/__tests__/format-link-according-to-type.spec.ts create mode 100644 packages/app/src/utils/format-link-according-to-type.ts delete mode 100644 packages/cms/src/schemas/documents/pages/contact.ts create mode 100644 packages/cms/src/schemas/documents/pages/contact/group.ts create mode 100644 packages/cms/src/schemas/documents/pages/contact/index.ts create mode 100644 packages/cms/src/schemas/documents/pages/contact/item.ts create mode 100644 packages/cms/src/schemas/documents/pages/contact/link.ts create mode 100644 packages/cms/src/schemas/objects/link-type.ts create mode 100644 packages/icons/src/svg/telephone.svg diff --git a/packages/app/src/components/contact/contact-page-group.tsx b/packages/app/src/components/contact/contact-page-group.tsx new file mode 100644 index 0000000000..c27046886e --- /dev/null +++ b/packages/app/src/components/contact/contact-page-group.tsx @@ -0,0 +1,27 @@ +import { space } from '~/style/theme'; +import { Box } from '../base/box'; +import { Heading } from '../typography'; +import { ContactPageGroupItem } from './contact-page-item'; +import { PageGroup } from './types'; + +interface ContactPageGroupProps { + groups: PageGroup[]; +} + +export const ContactPageGroup = ({ groups }: ContactPageGroupProps) => { + return ( + <Box as="section" flexBasis="50%"> + {groups.map(({ id, title, items }) => ( + <div key={id}> + <Heading marginBottom={space[3]} level={2}> + {title} + </Heading> + + {items.map((item, index) => ( + <ContactPageGroupItem key={item.id} item={item} index={index} groupItemsLength={items.length} /> + ))} + </div> + ))} + </Box> + ); +}; diff --git a/packages/app/src/components/contact/contact-page-item-links.tsx b/packages/app/src/components/contact/contact-page-item-links.tsx new file mode 100644 index 0000000000..6f24a26640 --- /dev/null +++ b/packages/app/src/components/contact/contact-page-item-links.tsx @@ -0,0 +1,51 @@ +import { colors } from '@corona-dashboard/common'; +import styled from 'styled-components'; +import { mediaQueries, radii, space } from '~/style/theme'; +import { Box } from '../base/box'; +import { Text } from '../typography'; +import { ContactPageLink } from './contact-page-link'; +import { ItemLink } from './types'; + +interface ContactPageItemLinksProps { + links: ItemLink[]; +} + +export const ContactPageItemLinks = ({ links }: ContactPageItemLinksProps) => { + return ( + <Box display="grid" gridTemplateColumns={{ _: '1fr', sm: '1fr 1fr' }} marginTop={space[3]} spacing={{ _: 3, sm: 0 }}> + {links.map(({ id, titleAboveLink, href, label, linkType }) => ( + <div key={id}> + {titleAboveLink && ( + <Text fontWeight="bold" marginBottom={space[3]}> + {titleAboveLink} + </Text> + )} + + <LinkListItem> + <ContactPageLink href={href} label={label} linkType={linkType} /> + </LinkListItem> + </div> + ))} + </Box> + ); +}; + +const LinkListItem = styled.div` + border-radius: ${radii[1]}px; + border: 1px solid ${colors.gray3}; + display: block; + padding: ${space[2]} ${space[3]}; + transition: all 0.2s; + + &:hover { + background-color: ${colors.blue8}; + + a { + color: ${colors.white}; + } + } + + @media ${mediaQueries.sm} { + display: inline-block; + } +`; diff --git a/packages/app/src/components/contact/contact-page-item.tsx b/packages/app/src/components/contact/contact-page-item.tsx new file mode 100644 index 0000000000..733f97e9f5 --- /dev/null +++ b/packages/app/src/components/contact/contact-page-item.tsx @@ -0,0 +1,35 @@ +import { colors } from '@corona-dashboard/common'; +import styled from 'styled-components'; +import { radii, space } from '~/style/theme'; +import { Box } from '../base/box'; +import { RichContent } from '../cms/rich-content'; +import { Heading } from '../typography'; +import { ContactPageLink } from './contact-page-link'; +import { ContactPageItemLinks } from './contact-page-item-links'; +import { GroupItem } from './types'; + +interface ContactPageGroupItemProps { + groupItemsLength: number; + index: number; + item: GroupItem; +} + +export const ContactPageGroupItem = ({ item, index, groupItemsLength }: ContactPageGroupItemProps) => { + const { title, titleUrl, linkType, description, links } = item; + + return ( + <Box border={`1px solid ${colors.gray3}`} borderRadius={radii[2]} padding={space[3]} marginBottom={index === groupItemsLength - 1 ? space[4] : space[3]}> + <Heading marginBottom={space[2]} variant="h4" level={3}> + {titleUrl ? <ContactPageLink href={titleUrl} label={title} linkType={linkType} /> : title} + </Heading> + + <RichContent blocks={description} contentWrapper={RichContentWrapper} /> + + {links && <ContactPageItemLinks links={links} />} + </Box> + ); +}; + +const RichContentWrapper = styled.div` + width: 100%; +`; diff --git a/packages/app/src/components/contact/contact-page-link.tsx b/packages/app/src/components/contact/contact-page-link.tsx new file mode 100644 index 0000000000..e7896b39f0 --- /dev/null +++ b/packages/app/src/components/contact/contact-page-link.tsx @@ -0,0 +1,56 @@ +import { ChevronRight, External, Telephone } from '@corona-dashboard/icons'; +import styled from 'styled-components'; +import { ExternalLink } from '~/components/external-link'; +import { space } from '~/style/theme'; +import { formatLinkAccordingToType } from '~/utils/format-link-according-to-type'; +import { isInternalUrl } from '~/utils/is-internal-url'; +import { Link } from '~/utils/link'; +import { LinkType } from './types'; + +interface ContactPageLinkProps { + href: string; + label: string; + linkType: LinkType | undefined; +} + +export const ContactPageLink = ({ href, label, linkType }: ContactPageLinkProps) => { + if (isInternalUrl(href)) { + return ( + <LinkWrapper iconMargin={`0 0 0 ${space[2]}`}> + <Link passHref href={formatLinkAccordingToType(href, linkType)}> + <a> + {label} + <ChevronRight /> + </a> + </Link> + </LinkWrapper> + ); + } + + return ( + <LinkWrapper iconMargin={linkType === 'phone' ? `0 ${space[2]} 0 0` : `0 0 0 ${space[2]}`}> + <ExternalLink href={formatLinkAccordingToType(href, linkType)}> + {linkType === 'phone' && <Telephone />} + {label} + {linkType !== 'phone' && <External />} + </ExternalLink> + </LinkWrapper> + ); +}; + +interface LinkWrapperProps { + iconMargin: string; +} + +const LinkWrapper = styled.div<LinkWrapperProps>` + a { + align-items: center; + display: flex; + } + + svg { + height: 16px; + margin: ${({ iconMargin }) => iconMargin}; + width: 16px; + } +`; diff --git a/packages/app/src/components/contact/types.ts b/packages/app/src/components/contact/types.ts new file mode 100644 index 0000000000..d01f33a080 --- /dev/null +++ b/packages/app/src/components/contact/types.ts @@ -0,0 +1,31 @@ +import { RichContentBlock } from '~/types/cms'; + +export type LinkType = 'regular' | 'email' | 'phone'; + +interface Base { + title: string; + id: string; +} + +export interface ItemLink { + id: string; + href: string; + label: string; + linkType: LinkType; + titleAboveLink?: string; +} + +export interface GroupItem extends Base { + description: RichContentBlock[]; + links?: ItemLink[]; + titleUrl?: string; + linkType?: LinkType; +} + +export interface PageGroup extends Base { + items: GroupItem[]; +} + +export interface ContactPage { + groups: PageGroup[]; +} diff --git a/packages/app/src/components/typography.tsx b/packages/app/src/components/typography.tsx index e4e31c3069..bf0048d955 100644 --- a/packages/app/src/components/typography.tsx +++ b/packages/app/src/components/typography.tsx @@ -3,7 +3,14 @@ import css, { CSSProperties } from '@styled-system/css'; import styled, { DefaultTheme } from 'styled-components'; import { Preset, preset } from '~/style/preset'; -export interface TextProps { +interface AllMarginProps { + margin?: CSSProperties['margin']; + marginRight?: CSSProperties['marginRight']; + marginBottom?: CSSProperties['marginBottom']; + marginLeft?: CSSProperties['marginLeft']; +} + +export interface TextProps extends AllMarginProps { variant?: keyof Preset['typography']; fontWeight?: keyof DefaultTheme['fontWeights']; textTransform?: CSSProperties['textTransform']; @@ -32,6 +39,10 @@ export const textStyle = (props: TextProps & { as?: string }) => { ...(props.textTransform ? { textTransform: props.textTransform } : undefined), ...(props.textAlign ? { textAlign: props.textAlign } : undefined), ...(props.hyphens ? { hyphens: props.hyphens } : undefined), + ...(props.margin ? { margin: props.margin } : undefined), + ...(props.marginRight ? { marginRight: props.marginRight } : undefined), + ...(props.marginBottom ? { marginBottom: props.marginBottom } : undefined), + ...(props.marginLeft ? { marginLeft: props.marginLeft } : undefined), }); }; diff --git a/packages/app/src/domain/layout/content-layout.tsx b/packages/app/src/domain/layout/content-layout.tsx new file mode 100644 index 0000000000..b0fb00ea77 --- /dev/null +++ b/packages/app/src/domain/layout/content-layout.tsx @@ -0,0 +1,14 @@ +import { Box } from '~/components/base/box'; +import { sizes, space } from '~/style/theme'; + +interface ContentLayoutProps { + children?: React.ReactNode; +} + +export const ContentLayout = ({ children }: ContentLayoutProps) => { + return ( + <Box margin={`${space[5]} auto`} maxWidth={`${sizes.maxWidth}px`} padding={`0 ${space[3]}`}> + {children} + </Box> + ); +}; diff --git a/packages/app/src/pages/contact.tsx b/packages/app/src/pages/contact.tsx index 287d60eb6c..30cde7ba17 100644 --- a/packages/app/src/pages/contact.tsx +++ b/packages/app/src/pages/contact.tsx @@ -1,86 +1,82 @@ -import css from '@styled-system/css'; import Head from 'next/head'; import styled from 'styled-components'; -import { RichContent } from '~/components/cms/rich-content'; +import { VisuallyHidden } from '~/components'; +import { ContactPageGroup } from '~/components/contact/contact-page-group'; +import { ContactPage } from '~/components/contact/types'; import { Heading } from '~/components/typography'; -import { Content } from '~/domain/layout/content'; +import { ContentLayout } from '~/domain/layout/content-layout'; import { Layout } from '~/domain/layout/layout'; import { useIntl } from '~/intl'; -import { - createGetStaticProps, - StaticProps, -} from '~/static-props/create-get-static-props'; -import { - createGetContent, - getLastGeneratedDate, -} from '~/static-props/get-data'; -import { RichContentBlock } from '~/types/cms'; - -interface ContactData { - title: string | null; - description: RichContentBlock[] | null; -} +import { StaticProps, createGetStaticProps } from '~/static-props/create-get-static-props'; +import { createGetContent, getLastGeneratedDate } from '~/static-props/get-data'; +import { mediaQueries, space } from '~/style/theme'; export const getStaticProps = createGetStaticProps( getLastGeneratedDate, - createGetContent<ContactData>((context) => { + createGetContent<ContactPage>((context) => { const { locale } = context; - return `*[_type == 'contact']{ - title, - "description": { - "_type": description._type, - "${locale}": [ - ...description.${locale}[] - { - ..., - "asset": asset-> - }, - ] + return `// groq + *[_type == 'contact'] { + 'groups': contactPageGroups[]->{ + 'id': _id, + 'title': title.${locale}, + 'items': contactPageGroupItems[]->{ + 'id': _id, + 'title': title.${locale}, + 'titleUrl': itemTitleUrl, + 'linkType': linkType.linkType, + 'description': description.${locale}, + 'links': contactPageItemLinks[] { + 'id': _id, + 'titleAboveLink': title.${locale}, + 'linkType': linkType.linkType, + 'label': link.title.${locale}, + 'href': link.href + } + } } - }[0] - `; + }[0]`; }) ); const Contact = (props: StaticProps<typeof getStaticProps>) => { const { commonTexts } = useIntl(); - const { content, lastGenerated } = props; + const { + content: { groups }, + lastGenerated, + } = props; + + const middleIndexOfGroups = Math.ceil(groups.length / 2); + const firstHalf = groups.slice(0, middleIndexOfGroups); + const secondHalf = groups.slice(middleIndexOfGroups); return ( <Layout {...commonTexts.contact_metadata} lastGenerated={lastGenerated}> <Head> - <link - key="dc-type" - rel="dcterms:type" - href="https://standaarden.overheid.nl/owms/terms/webpagina" - /> - <link - key="dc-type-title" - rel="dcterms:type" - href="https://standaarden.overheid.nl/owms/terms/webpagina" - title="webpagina" - /> + <link key="dc-type" rel="dcterms:type" href="https://standaarden.overheid.nl/owms/terms/webpagina" /> + <link key="dc-type-title" rel="dcterms:type" href="https://standaarden.overheid.nl/owms/terms/webpagina" title="webpagina" /> </Head> - <Content> - {content.title && <Heading level={1}>{content.title}</Heading>} - {content.description && ( - <RichContent - blocks={content.description} - contentWrapper={RichContentWrapper} - /> - )} - </Content> + <VisuallyHidden> + <Heading level={1}>Contact</Heading> + </VisuallyHidden> + + <ContentLayout> + <ContactLayout> + <ContactPageGroup groups={firstHalf} /> + <ContactPageGroup groups={secondHalf} /> + </ContactLayout> + </ContentLayout> </Layout> ); }; -const RichContentWrapper = styled.div( - css({ - maxWidth: 'maxWidthText', - width: '100%', - }) -); +const ContactLayout = styled.div` + @media ${mediaQueries.sm} { + display: flex; + gap: ${space[4]} ${space[5]}; + } +`; export default Contact; diff --git a/packages/app/src/pages/over.tsx b/packages/app/src/pages/over.tsx index ed7bd73620..7c48cc01d8 100644 --- a/packages/app/src/pages/over.tsx +++ b/packages/app/src/pages/over.tsx @@ -5,6 +5,7 @@ import { ContentImage } from '~/components/cms/content-image'; import { RichContent } from '~/components/cms/rich-content'; import { FullscreenChartTile } from '~/components/fullscreen-chart-tile'; import { Heading } from '~/components/typography'; +import { ContentLayout } from '~/domain/layout/content-layout'; import { Layout } from '~/domain/layout/layout'; import { useIntl } from '~/intl'; import { createGetStaticProps, StaticProps } from '~/static-props/create-get-static-props'; @@ -60,7 +61,7 @@ const Over = (props: StaticProps<typeof getStaticProps>) => { return ( <Layout {...commonTexts.over_metadata} lastGenerated={lastGenerated}> - <Box margin={`${space[5]} auto`} maxWidth={`${sizes.maxWidth}px`} padding={` 0 ${space[4]}`}> + <ContentLayout> <Head> <link key="dc-type" rel="dcterms:type" href="https://standaarden.overheid.nl/owms/terms/webpagina" /> <link key="dc-type-title" rel="dcterms:type" href="https://standaarden.overheid.nl/owms/terms/webpagina" title="webpagina" /> @@ -85,7 +86,7 @@ const Over = (props: StaticProps<typeof getStaticProps>) => { </div> </TwoColumnLayout> </Box> - </Box> + </ContentLayout> </Layout> ); }; diff --git a/packages/app/src/pages/veelgestelde-vragen.tsx b/packages/app/src/pages/veelgestelde-vragen.tsx index b09608ebe4..331d3e25b2 100644 --- a/packages/app/src/pages/veelgestelde-vragen.tsx +++ b/packages/app/src/pages/veelgestelde-vragen.tsx @@ -5,6 +5,7 @@ import { Box } from '~/components/base/box'; import { RichContent } from '~/components/cms/rich-content'; import { FaqSection } from '~/components/faq/faq-section'; import { Heading } from '~/components/typography'; +import { ContentLayout } from '~/domain/layout/content-layout'; import { Layout } from '~/domain/layout/layout'; import { useIntl } from '~/intl'; import { createGetStaticProps, StaticProps } from '~/static-props/create-get-static-props'; @@ -68,7 +69,7 @@ const Verantwoording = (props: StaticProps<typeof getStaticProps>) => { return ( <Layout {...commonTexts.veelgestelde_vragen_metadata} lastGenerated={lastGenerated}> - <Box margin={`${space[5]} auto`} maxWidth={`${sizes.maxWidth}px`} padding={` 0 ${space[4]}`}> + <ContentLayout> <Head> <link key="dc-type" rel="dcterms:type" href="https://standaarden.overheid.nl/owms/terms/webpagina" /> <link key="dc-type-title" rel="dcterms:type" href="https://standaarden.overheid.nl/owms/terms/webpagina" title="webpagina" /> @@ -87,7 +88,7 @@ const Verantwoording = (props: StaticProps<typeof getStaticProps>) => { <FaqSection section={firstHalf} /> <FaqSection section={secondHalf} /> </FaqLayout> - </Box> + </ContentLayout> </Layout> ); }; diff --git a/packages/app/src/utils/__tests__/format-link-according-to-type.spec.ts b/packages/app/src/utils/__tests__/format-link-according-to-type.spec.ts new file mode 100644 index 0000000000..4bff96a984 --- /dev/null +++ b/packages/app/src/utils/__tests__/format-link-according-to-type.spec.ts @@ -0,0 +1,34 @@ +import { suite } from 'uvu'; +import * as assert from 'uvu/assert'; +import { formatLinkAccordingToType } from '../format-link-according-to-type'; + +const FormatLinkAccordingToType = suite('formatLinkAccordingToType'); + +FormatLinkAccordingToType('should not do anything to a regular link', () => { + const linkType = 'regular'; + const href = '/'; + + const result = formatLinkAccordingToType(href, linkType); + + assert.is(result, '/'); +}); + +FormatLinkAccordingToType('should format as a telephone link', () => { + const linkType = 'phone'; + const href = '123-456-789'; + + const result = formatLinkAccordingToType(href, linkType); + + assert.is(result, 'tel:123456789'); +}); + +FormatLinkAccordingToType('should format as a email link', () => { + const linkType = 'email'; + const href = 'test@test.com'; + + const result = formatLinkAccordingToType(href, linkType); + + assert.is(result, 'mailto:test@test.com'); +}); + +FormatLinkAccordingToType.run(); diff --git a/packages/app/src/utils/format-link-according-to-type.ts b/packages/app/src/utils/format-link-according-to-type.ts new file mode 100644 index 0000000000..5223ef69f1 --- /dev/null +++ b/packages/app/src/utils/format-link-according-to-type.ts @@ -0,0 +1,13 @@ +/** + * Returns a formatted link based on the link type of email, phone, regular + */ +export const formatLinkAccordingToType = (href: string, linkType: string | undefined) => { + switch (linkType) { + case 'email': + return `mailto:${href}`; + case 'phone': + return `tel:${href.replace(/\s/g, '').replaceAll('-', '')}`; + default: + return href; + } +}; diff --git a/packages/cms/src/schemas/documents/pages/contact.ts b/packages/cms/src/schemas/documents/pages/contact.ts deleted file mode 100644 index 7f88393b98..0000000000 --- a/packages/cms/src/schemas/documents/pages/contact.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { localeStringValidation, localeValidation } from '../../../studio/validation/locale-validation'; -import { defineField, defineType } from 'sanity'; - -export const contact = defineType({ - name: 'contact', - type: 'document', - title: 'Contact', - fields: [ - defineField({ - name: 'title', - type: 'localeString', - title: 'Titel', - validation: localeStringValidation((rule) => rule.required()), - }), - defineField({ - name: 'description', - type: 'localeBlock', - title: 'Beschrijving', - validation: localeValidation((rule) => rule.required()), - }), - ], - preview: { - select: { - title: 'title.nl', - subtitle: 'description.nl', - }, - }, -}); diff --git a/packages/cms/src/schemas/documents/pages/contact/group.ts b/packages/cms/src/schemas/documents/pages/contact/group.ts new file mode 100644 index 0000000000..b73ccaa498 --- /dev/null +++ b/packages/cms/src/schemas/documents/pages/contact/group.ts @@ -0,0 +1,31 @@ +import { defineArrayMember, defineField, defineType } from 'sanity'; +import { localeStringValidation } from '../../../../studio/validation/locale-validation'; + +export const contactPageGroup = defineType({ + name: 'contactPageGroup', + title: 'Contactpaginagroep', + description: 'Configureer een groep voor de contactpagina. Stel de titel voor een groep in en voeg er items aan toe.', + type: 'document', + fields: [ + defineField({ + name: 'title', + title: 'Groepstitel', + type: 'localeString', + description: 'Configureer de titel voor deze groep.', + validation: localeStringValidation((rule) => rule.required()), + }), + defineField({ + name: 'contactPageGroupItems', + title: 'Groep Items', + type: 'array', + description: 'Voeg items toe aan deze groep.', + of: [defineArrayMember({ type: 'reference', to: { type: 'contactPageGroupItem' } })], + validation: (rule) => rule.required(), + }), + ], + preview: { + select: { + title: 'title.nl', + }, + }, +}); diff --git a/packages/cms/src/schemas/documents/pages/contact/index.ts b/packages/cms/src/schemas/documents/pages/contact/index.ts new file mode 100644 index 0000000000..efb43e11c0 --- /dev/null +++ b/packages/cms/src/schemas/documents/pages/contact/index.ts @@ -0,0 +1,23 @@ +import { defineArrayMember, defineField, defineType } from 'sanity'; + +export const contact = defineType({ + name: 'contact', + title: 'Contact Page', + description: 'Dit is het startpunt voor het configureren van de contactpagina. Voeg er secties aan toe met behulp van de onderstaande lijst.', + type: 'document', + fields: [ + defineField({ + name: 'contactPageGroups', + title: 'Pagina Groepen', + description: 'Groepen toevoegen, verwijderen of opnieuw rangschikken op de contactpagina.', + type: 'array', + of: [defineArrayMember({ type: 'reference', to: { type: 'contactPageGroup' } })], + validation: (rule) => rule.required().min(3).error('De contactpagina moet minimaal 3 secties bevatten.'), + }), + ], + preview: { + select: { + title: 'title.nl', + }, + }, +}); diff --git a/packages/cms/src/schemas/documents/pages/contact/item.ts b/packages/cms/src/schemas/documents/pages/contact/item.ts new file mode 100644 index 0000000000..7b3cafba48 --- /dev/null +++ b/packages/cms/src/schemas/documents/pages/contact/item.ts @@ -0,0 +1,78 @@ +import { ValidationContext, defineArrayMember, defineField, defineType } from 'sanity'; +import { localeValidation } from '../../../../studio/validation/locale-validation'; + +export const contactPageGroupItem = defineType({ + name: 'contactPageGroupItem', + title: 'Contactpagina Item', + description: 'Configureer een item voor een bepaalde contactpaginagroep.', + type: 'document', + fieldsets: [ + { + title: 'Item Titel Configuratie', + name: 'titleConfiguration', + options: { + collapsible: true, + collapsed: false, + }, + }, + { + title: 'Item Beschrijving', + name: 'itemDescription', + options: { + collapsible: true, + collapsed: false, + }, + }, + ], + fields: [ + defineField({ + name: 'title', + title: 'Titel', + description: + 'Configureer de titel en de link voor dit item. Als u een link aan een e-mail wilt toevoegen, vult u alleen het e-mailadres in. Als je een link naar een telefoonnummer wilt toevoegen, voeg dan alleen het nummer toe.', + type: 'localeString', + fieldset: 'titleConfiguration', + validation: (rule) => rule.required(), + }), + defineField({ + name: 'itemTitleUrl', + title: 'Link', + description: + 'De bestemming voor de link naar de itemtitel. U kunt dit veld leeg laten als de titel geen link vereist. Als u een link aan een e-mail wilt toevoegen, vult u alleen het e-mailadres in. Als je een link naar een telefoonnummer wilt toevoegen, voeg dan alleen het nummer toe.', + type: 'string', + fieldset: 'titleConfiguration', + }), + defineField({ + name: 'linkType', + type: 'linkType', + fieldset: 'titleConfiguration', + validation: (rule) => + rule.custom((value, context: ValidationContext) => { + const parent = context.parent as { itemTitleUrl: string }; + return 'itemTitleUrl' in parent && parent.itemTitleUrl.length && value === undefined ? 'Dit veld is verplicht als uw titel een link bevat' : true; + }), + hidden: ({ parent }) => !('itemTitleUrl' in parent && parent.itemTitleUrl.length), + }), + defineField({ + name: 'description', + title: 'Beschrijving', + description: 'Configureer een beschrijving. Wordt onder de titel getoond.', + type: 'localeBlock', + fieldset: 'itemDescription', + validation: localeValidation((rule) => rule.required()), + }), + defineField({ + name: 'contactPageItemLinks', + title: 'Item Links', + description: 'Configureer een lijst met links voor dit item. Als er geen links nodig zijn, kan deze leeg gelaten worden. Deze worden onder de beschrijving weergegeven.', + type: 'array', + of: [defineArrayMember({ type: 'contactPageItemLink' })], + }), + ], + preview: { + select: { + title: 'title.nl', + subtitle: 'description.nl', + }, + }, +}); diff --git a/packages/cms/src/schemas/documents/pages/contact/link.ts b/packages/cms/src/schemas/documents/pages/contact/link.ts new file mode 100644 index 0000000000..8ff6209e5d --- /dev/null +++ b/packages/cms/src/schemas/documents/pages/contact/link.ts @@ -0,0 +1,36 @@ +import { defineField, defineType } from 'sanity'; + +export const contactPageItemLink = defineType({ + name: 'contactPageItemLink', + title: 'Contactpagina Itemlink', + description: + 'Configureer een link voor een bepaald pagina-item. Kies het linktype en voeg een label toe. Als u een link aan een e-mail wilt toevoegen, vult u alleen het e-mailadres in. Als je een link naar een telefoonnummer wilt toevoegen, voeg dan alleen het nummer toe.', + type: 'document', + fields: [ + defineField({ + name: 'link', + title: 'Link', + description: + "Configureer de link en het bijbehorende label. Als de link een telefoonnummer is, vermijd dan het gebruik van spaties. Als het een internationaal nummer is, vervang dan '+' door '00'.", + type: 'link', + validation: (rule) => rule.required(), + }), + defineField({ + name: 'linkType', + type: 'linkType', + validation: (rule) => rule.required(), + }), + defineField({ + name: 'title', + title: 'Link Titel', + description: 'Configureer indien nodig een titel die boven de link wordt weergegeven. Dit is niet het linklabel. Gebruik dit alleen als het linklabel niet voldoende is.', + type: 'localeString', + }), + ], + preview: { + select: { + title: 'link.title.nl', + subtitle: 'link.href', + }, + }, +}); diff --git a/packages/cms/src/schemas/index.ts b/packages/cms/src/schemas/index.ts index 3cff87000c..e34dd3613c 100644 --- a/packages/cms/src/schemas/index.ts +++ b/packages/cms/src/schemas/index.ts @@ -9,6 +9,9 @@ import { links } from './documents/page-parts/links'; import { about } from './documents/pages/about'; import { accessibility } from './documents/pages/accessibility'; import { contact } from './documents/pages/contact'; +import { contactPageGroup } from './documents/pages/contact/group'; +import { contactPageGroupItem } from './documents/pages/contact/item'; +import { contactPageItemLink } from './documents/pages/contact/link'; import { dataExplained } from './documents/pages/data-explained'; import { dataExplainedGroups } from './documents/pages/data-explained/groups'; import { dataExplainedItem } from './documents/pages/data-explained/item'; @@ -37,19 +40,23 @@ import { timeSeries } from './elements/time-series'; import { timelineEvent } from './elements/timeline-event'; import { timelineEventCollection } from './elements/timeline-event-collection'; import { block } from './locale/block'; +import { image } from './locale/image'; import { richContentBlock } from './locale/rich-content-block'; import { string } from './locale/string'; import { text } from './locale/text'; -import { image } from './locale/image'; import { inlineBlock } from './objects/inline-block'; import { inlineCollapsible } from './objects/inline-collapsible'; import { link } from './objects/link'; +import { linkType } from './objects/link-type'; const localeSpecificSchemas = [block, richContentBlock, string, text, image]; const richContentSchemas = [inlineBlock, inlineCollapsible]; const documentSchemas = [ advice, article, + contactPageGroup, + contactPageGroupItem, + contactPageItemLink, dataExplainedGroups, dataExplainedItem, faqGroups, @@ -75,6 +82,6 @@ const documentSchemas = [ const pageSchemas = [about, accessibility, contact, dataExplained, faq, homepage, notFound]; const pagePartSchemas = [articles, dataExplainedParts, faqParts, highlights, links]; const elementSchemas = [timelineEvent, timelineEventCollection, timeSeries]; -const objectSchemas = [link]; +const objectSchemas = [link, linkType]; export const schemaTypes = [...localeSpecificSchemas, ...richContentSchemas, ...documentSchemas, ...elementSchemas, ...pageSchemas, ...pagePartSchemas, ...objectSchemas]; diff --git a/packages/cms/src/schemas/objects/link-type.ts b/packages/cms/src/schemas/objects/link-type.ts new file mode 100644 index 0000000000..18335e681d --- /dev/null +++ b/packages/cms/src/schemas/objects/link-type.ts @@ -0,0 +1,23 @@ +import { defineField, defineType } from 'sanity'; + +export const linkType = defineType({ + name: 'linkType', + title: 'Linktype', + type: 'object', + fields: [ + defineField({ + name: 'linkType', + title: 'Linktype', + description: 'Selecteer het type link op basis van of het een e-mail, telefoon of normaal link is.', + type: 'string', + options: { + list: [ + { value: 'regular', title: 'Normaal' }, + { value: 'email', title: 'E-mail' }, + { value: 'phone', title: 'Telefoon' }, + ], + layout: 'dropdown', + }, + }), + ], +}); diff --git a/packages/icons/icons.md b/packages/icons/icons.md index f25d8423a3..b791afa664 100644 --- a/packages/icons/icons.md +++ b/packages/icons/icons.md @@ -120,6 +120,7 @@ See below an overview of all the available icons in this package. This file is g | Stap1WinkelsOpen | <div style="background-color: white;"><img src="./src/svg/stap_1_winkels_open.svg" alt="Stap1WinkelsOpen" /></div> | | Stopwatch | <div style="background-color: white;"><img src="./src/svg/stopwatch.svg" alt="Stopwatch" /></div> | | Taxi | <div style="background-color: white;"><img src="./src/svg/taxi.svg" alt="Taxi" /></div> | +| Telephone | <div style="background-color: white;"><img src="./src/svg/telephone.svg" alt="Telephone" /></div> | | Testbewijs | <div style="background-color: white;"><img src="./src/svg/testbewijs.svg" alt="Testbewijs" /></div> | | Toegangsbewijzen | <div style="background-color: white;"><img src="./src/svg/toegangsbewijzen.svg" alt="Toegangsbewijzen" /></div> | | Town | <div style="background-color: white;"><img src="./src/svg/town.svg" alt="Town" /></div> | diff --git a/packages/icons/src/icon-name2filename.ts b/packages/icons/src/icon-name2filename.ts index 5474596caa..307f71583c 100644 --- a/packages/icons/src/icon-name2filename.ts +++ b/packages/icons/src/icon-name2filename.ts @@ -115,6 +115,7 @@ export type IconName = | 'Stap1WinkelsOpen' | 'Stopwatch' | 'Taxi' + | 'Telephone' | 'Testbewijs' | 'Toegangsbewijzen' | 'Town' @@ -254,6 +255,7 @@ export const iconName2filename: Record<IconName, string> = { Stap1WinkelsOpen: 'stap_1_winkels_open.svg', Stopwatch: 'stopwatch.svg', Taxi: 'taxi.svg', + Telephone: 'telephone.svg', Testbewijs: 'testbewijs.svg', Toegangsbewijzen: 'toegangsbewijzen.svg', Town: 'town.svg', diff --git a/packages/icons/src/svg/telephone.svg b/packages/icons/src/svg/telephone.svg new file mode 100644 index 0000000000..5048827c1f --- /dev/null +++ b/packages/icons/src/svg/telephone.svg @@ -0,0 +1 @@ +<svg viewBox="0 0 56 56" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><g id="testbewijs"><path d="M19.19 13.66a3.74 3.74 0 0 1-1.07 4.21c-1.31 1.37-2.55 2.61-3.05 3.06a2 2 0 0 0-.62 2.66c4.33 8.55 10 13.49 18 18a2 2 0 0 0 2.67-.62c.44-.49 1.74-1.73 3.05-3.05a3.77 3.77 0 0 1 4.22-1.07l13.65 9.49a8.4 8.4 0 0 1-1.56 3.9c-.347.44-.718.86-1.11 1.26-.07.07-.13.14-.21.21a15.43 15.43 0 0 1-10.15 4.26c-7 .46-14-4.21-15-4.86C17.37 44.43 10.97 38.24 4.9 28c-.66-1-5.32-8-4.87-15A15.54 15.54 0 0 1 4.32 2.84l.21-.21c.49-.48.94-.84 1.27-1.11A6.67 6.67 0 0 1 9.71 0c.69-.02 9.48 13.66 9.48 13.66Z"/></g></svg> \ No newline at end of file From d0e2037d093fa31de810c3a42bb5ed4aefd0e339 Mon Sep 17 00:00:00 2001 From: M <120020483+VWSCoronaDashboard30@users.noreply.github.com> Date: Thu, 21 Sep 2023 10:05:13 +0200 Subject: [PATCH 06/18] feature/COR-1788_refactor_archived_schemas_titles (#4872) * feat(COR-1788): fixed archived GM level schemas * feat(COR-1788): fixed archived GM_COLLECTION schemas * feat(COR-1788): fixed archived NL schemas * feat(COR-1788): fixed archived GM level schemas * feat(COR-1788): Fixed archived / non-archived NL schemas --- .../app/schema/archived_gm/__difference.json | 2 +- .../schema/archived_gm/booster_coverage.json | 4 +- .../app/schema/archived_gm/deceased_rivm.json | 4 +- .../positive_tests/tested_overall.json | 4 +- packages/app/schema/archived_gm/sewer.json | 4 +- .../vaccine_coverage_per_age_group.json | 4 +- ...erage_per_age_group_with_booster_shot.json | 4 +- .../positive_tests/tested_overall.json | 2 +- .../schema/archived_gm_collection/sewer.json | 12 +- .../app/schema/archived_nl/__difference.json | 2 +- .../schema/archived_nl/behavior/behavior.json | 4 +- .../behavior/behavior_annotations.json | 4 +- .../behavior/behavior_per_age_group.json | 4 +- .../schema/archived_nl/booster_coverage.json | 4 +- .../booster_shot_administered.json | 4 +- .../corona_melder_app_download.json | 4 +- .../corona_melder_app_warning.json | 4 +- .../app/schema/archived_nl/deceased_rivm.json | 4 +- .../deceased_rivm_per_age_group.json | 4 +- .../schema/archived_nl/disability_care.json | 4 +- packages/app/schema/archived_nl/doctor.json | 12 +- .../schema/archived_nl/elderly_at_home.json | 4 +- .../schema/archived_nl/infectious_people.json | 12 +- .../app/schema/archived_nl/nursing_home.json | 4 +- .../archived_nl/positive_tests/g_number.json | 4 +- .../positive_tests/tested_ggd.json | 4 +- .../positive_tests/tested_overall.json | 4 +- .../positive_tests/tested_per_age_group.json | 4 +- .../repeating_shot_administered.json | 10 +- .../app/schema/archived_nl/reproduction.json | 4 +- packages/app/schema/archived_nl/sewer.json | 4 +- .../schema/archived_nl/vaccine_campaigns.json | 4 +- .../schema/archived_nl/vaccine_coverage.json | 4 +- .../vaccine_coverage_per_age_group.json | 4 +- ...cine_coverage_per_age_group_estimated.json | 2 +- ...erage_per_age_group_with_booster_shot.json | 4 +- .../vaccine_delivery_per_supplier.json | 4 +- .../schema/archived_nl/vaccine_planned.json | 2 +- .../app/schema/archived_nl/vaccine_stock.json | 4 +- .../vaccine_vaccinated_or_support.json | 4 +- .../vulnerable_hospital_admissions.json | 9 +- .../archived_nl/vulnerable_nursing_home.json | 12 +- .../schema/gm/hospital_nice_choropleth.json | 45 -- .../app/schema/gm/sewer_per_installation.json | 2 +- .../src/components/choropleth/logic/types.ts | 4 +- .../behavior/behavior-line-chart-tile.tsx | 4 +- .../behavior/behavior-per-age-group-tile.tsx | 4 +- .../domain/behavior/behavior-table-tile.tsx | 8 +- .../domain/tested/g-number-bar-chart-tile.tsx | 4 +- .../infected-per-age-group.tsx | 6 +- .../domain/tested/reproduction-chart-tile.tsx | 6 +- .../booster-shot-coverage-per-age-group.tsx | 4 +- .../vaccine/vaccinations-over-time-chart.tsx | 146 ++----- .../vaccine/vaccinations-over-time-tile.tsx | 4 +- .../vaccine-coverage-per-age-group.tsx | 4 +- .../vaccine/vaccine-delivery-bar-chart.tsx | 8 +- .../vaccine-stock-per-supplier-chart.tsx | 12 +- .../src/pages/landelijk/positieve-testen.tsx | 4 +- .../app/src/pages/landelijk/vaccinaties.tsx | 3 +- packages/common/src/types/data.ts | 392 +++++++++--------- 60 files changed, 349 insertions(+), 512 deletions(-) delete mode 100644 packages/app/schema/gm/hospital_nice_choropleth.json diff --git a/packages/app/schema/archived_gm/__difference.json b/packages/app/schema/archived_gm/__difference.json index b18ce224e6..654d85660d 100644 --- a/packages/app/schema/archived_gm/__difference.json +++ b/packages/app/schema/archived_gm/__difference.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "gm_difference", + "title": "archived_gm_difference", "type": "object", "required": [ "tested_overall__infected_moving_average_archived_20230331", diff --git a/packages/app/schema/archived_gm/booster_coverage.json b/packages/app/schema/archived_gm/booster_coverage.json index d397eb78df..af3eb4b369 100644 --- a/packages/app/schema/archived_gm/booster_coverage.json +++ b/packages/app/schema/archived_gm/booster_coverage.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "gm_booster_coverage", + "title": "archived_gm_booster_coverage", "type": "object", "properties": { "values": { @@ -15,7 +15,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "gm_booster_coverage_archived_20220904_value", + "title": "archived_gm_booster_coverage_value", "type": "object", "properties": { "age_group": { diff --git a/packages/app/schema/archived_gm/deceased_rivm.json b/packages/app/schema/archived_gm/deceased_rivm.json index e2be182b6b..e008acdb22 100644 --- a/packages/app/schema/archived_gm/deceased_rivm.json +++ b/packages/app/schema/archived_gm/deceased_rivm.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "gm_deceased_rivm", + "title": "archived_gm_deceased_rivm", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "gm_deceased_rivm_archived_20221231_value", + "title": "archived_gm_deceased_rivm_value", "type": "object", "properties": { "covid_daily": { diff --git a/packages/app/schema/archived_gm/positive_tests/tested_overall.json b/packages/app/schema/archived_gm/positive_tests/tested_overall.json index df68bf44e3..91658848f9 100644 --- a/packages/app/schema/archived_gm/positive_tests/tested_overall.json +++ b/packages/app/schema/archived_gm/positive_tests/tested_overall.json @@ -1,7 +1,7 @@ { "definitions": { "value": { - "title": "gm_tested_overall_value", + "title": "archived_gm_tested_overall_value", "type": "object", "additionalProperties": false, "required": [ @@ -40,7 +40,7 @@ }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "tested_overall.json", - "title": "gm_tested_overall", + "title": "archived_gm_tested_overall", "type": "object", "required": ["values", "last_value"], "additionalProperties": false, diff --git a/packages/app/schema/archived_gm/sewer.json b/packages/app/schema/archived_gm/sewer.json index 02c4ae016b..30d5daaf80 100644 --- a/packages/app/schema/archived_gm/sewer.json +++ b/packages/app/schema/archived_gm/sewer.json @@ -1,7 +1,7 @@ { "definitions": { "value": { - "title": "gm_sewer_value", + "title": "archived_gm_sewer_value", "type": "object", "additionalProperties": false, "required": [ @@ -43,7 +43,7 @@ } }, "$schema": "http://json-schema.org/draft-07/schema#", - "title": "gm_sewer", + "title": "archived_gm_sewer", "type": "object", "required": ["values", "last_value"], "additionalProperties": false, diff --git a/packages/app/schema/archived_gm/vaccine_coverage_per_age_group.json b/packages/app/schema/archived_gm/vaccine_coverage_per_age_group.json index 3dd58d6db3..2488774dac 100644 --- a/packages/app/schema/archived_gm/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/archived_gm/vaccine_coverage_per_age_group.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "gm_vaccine_coverage_per_age_group_archived_20220622", + "title": "archived_gm_vaccine_coverage_per_age_group", "type": "object", "required": ["values"], "additionalProperties": false, @@ -14,7 +14,7 @@ }, "definitions": { "value": { - "title": "gm_vaccine_coverage_per_age_group_archived_value", + "title": "archived_gm_vaccine_coverage_per_age_group_value", "additionalProperties": false, "type": "object", "required": [ diff --git a/packages/app/schema/archived_gm/vaccine_coverage_per_age_group_with_booster_shot.json b/packages/app/schema/archived_gm/vaccine_coverage_per_age_group_with_booster_shot.json index 6e3edba728..658b5e6968 100644 --- a/packages/app/schema/archived_gm/vaccine_coverage_per_age_group_with_booster_shot.json +++ b/packages/app/schema/archived_gm/vaccine_coverage_per_age_group_with_booster_shot.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "gm_vaccine_coverage_per_age_group_with_booster_shot", + "title": "archived_gm_vaccine_coverage_per_age_group_with_booster_shot", "type": "object", "required": ["values"], "additionalProperties": false, @@ -14,7 +14,7 @@ }, "definitions": { "value": { - "title": "gm_vaccine_coverage_per_age_group_archived_20220908_value", + "title": "archived_gm_vaccine_coverage_per_age_group_with_booster_shot_value", "additionalProperties": false, "type": "object", "required": [ diff --git a/packages/app/schema/archived_gm_collection/positive_tests/tested_overall.json b/packages/app/schema/archived_gm_collection/positive_tests/tested_overall.json index 1556b9091d..749e5afab0 100644 --- a/packages/app/schema/archived_gm_collection/positive_tests/tested_overall.json +++ b/packages/app/schema/archived_gm_collection/positive_tests/tested_overall.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", - "title": "gm_collection_tested_overall", + "title": "archived_gm_collection_tested_overall", "additionalProperties": false, "required": ["date_unix", "gmcode", "infected", "infected_per_100k", "date_of_insertion_unix"], "properties": { diff --git a/packages/app/schema/archived_gm_collection/sewer.json b/packages/app/schema/archived_gm_collection/sewer.json index 7cd18a9855..d1fd9fe29f 100644 --- a/packages/app/schema/archived_gm_collection/sewer.json +++ b/packages/app/schema/archived_gm_collection/sewer.json @@ -1,17 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "gm_collection_sewer", + "title": "archived_gm_collection_sewer", "type": "object", "additionalProperties": false, - "required": [ - "date_start_unix", - "date_end_unix", - "gmcode", - "average", - "total_installation_count", - "date_of_insertion_unix", - "data_is_outdated" - ], + "required": ["date_start_unix", "date_end_unix", "gmcode", "average", "total_installation_count", "date_of_insertion_unix", "data_is_outdated"], "properties": { "date_start_unix": { "type": "integer" diff --git a/packages/app/schema/archived_nl/__difference.json b/packages/app/schema/archived_nl/__difference.json index 23d1b5a9b3..781c637191 100644 --- a/packages/app/schema/archived_nl/__difference.json +++ b/packages/app/schema/archived_nl/__difference.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_difference", + "title": "archived_nl_difference", "type": "object", "properties": { "deceased_rivm__covid_daily_archived_20221231": { diff --git a/packages/app/schema/archived_nl/behavior/behavior.json b/packages/app/schema/archived_nl/behavior/behavior.json index c033b8081e..3a3bfac531 100644 --- a/packages/app/schema/archived_nl/behavior/behavior.json +++ b/packages/app/schema/archived_nl/behavior/behavior.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_behavior", + "title": "archived_nl_behavior", "type": "object", "properties": { "values": { @@ -28,7 +28,7 @@ ] }, "value": { - "title": "nl_behavior_value", + "title": "archived_nl_behavior_value", "type": "object", "properties": { "number_of_participants": { diff --git a/packages/app/schema/archived_nl/behavior/behavior_annotations.json b/packages/app/schema/archived_nl/behavior/behavior_annotations.json index 0e6aead8df..68ff028e9b 100644 --- a/packages/app/schema/archived_nl/behavior/behavior_annotations.json +++ b/packages/app/schema/archived_nl/behavior/behavior_annotations.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_behavior_annotations", + "title": "archived_nl_behavior_annotations", "type": "object", "properties": { "values": { @@ -50,7 +50,7 @@ "message_desc_en": { "minLength": 1, "type": "string" - }, + }, "date_start_unix": { "type": "integer" }, diff --git a/packages/app/schema/archived_nl/behavior/behavior_per_age_group.json b/packages/app/schema/archived_nl/behavior/behavior_per_age_group.json index 6fb7671a8b..0f1e6df32d 100644 --- a/packages/app/schema/archived_nl/behavior/behavior_per_age_group.json +++ b/packages/app/schema/archived_nl/behavior/behavior_per_age_group.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_behavior_per_age_group", + "title": "archived_nl_behavior_per_age_group", "type": "object", "properties": { "keep_distance_compliance": { "$ref": "#/definitions/value" }, @@ -32,7 +32,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_behavior_per_age_group_value", + "title": "archived_nl_behavior_per_age_group_value", "type": "object", "properties": { "16_24": { "type": ["integer", "null"] }, diff --git a/packages/app/schema/archived_nl/booster_coverage.json b/packages/app/schema/archived_nl/booster_coverage.json index 384f27d75b..8147ad6e6f 100644 --- a/packages/app/schema/archived_nl/booster_coverage.json +++ b/packages/app/schema/archived_nl/booster_coverage.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_booster_coverage", + "title": "archived_nl_booster_coverage", "type": "object", "properties": { "values": { @@ -16,7 +16,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_booster_coverage_archived_20220904_value", + "title": "archived_nl_booster_coverage_value", "type": "object", "properties": { "age_group": { diff --git a/packages/app/schema/archived_nl/booster_shot_administered.json b/packages/app/schema/archived_nl/booster_shot_administered.json index 544c3531ec..1b22825550 100644 --- a/packages/app/schema/archived_nl/booster_shot_administered.json +++ b/packages/app/schema/archived_nl/booster_shot_administered.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_booster_shot_administered", + "title": "archived_nl_booster_shot_administered", "type": "object", "properties": { "values": { @@ -19,7 +19,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_booster_shot_administered_archived_20220904_value", + "title": "archived_nl_booster_shot_administered_value", "type": "object", "properties": { "administered_total": { diff --git a/packages/app/schema/archived_nl/corona_melder_app_download.json b/packages/app/schema/archived_nl/corona_melder_app_download.json index 9205b548e0..178ded5c9e 100644 --- a/packages/app/schema/archived_nl/corona_melder_app_download.json +++ b/packages/app/schema/archived_nl/corona_melder_app_download.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_corona_melder_app_download", + "title": "archived_nl_corona_melder_app_download", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_corona_melder_app_download_value", + "title": "archived_nl_corona_melder_app_download_value", "type": "object", "properties": { "count": { diff --git a/packages/app/schema/archived_nl/corona_melder_app_warning.json b/packages/app/schema/archived_nl/corona_melder_app_warning.json index 600b21681c..ffa2c06d56 100644 --- a/packages/app/schema/archived_nl/corona_melder_app_warning.json +++ b/packages/app/schema/archived_nl/corona_melder_app_warning.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_corona_melder_app_warning", + "title": "archived_nl_corona_melder_app_warning", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_corona_melder_app_warning_value", + "title": "archived_nl_corona_melder_app_warning_value", "type": "object", "properties": { "count": { diff --git a/packages/app/schema/archived_nl/deceased_rivm.json b/packages/app/schema/archived_nl/deceased_rivm.json index 5c842a8f91..8c52acca89 100644 --- a/packages/app/schema/archived_nl/deceased_rivm.json +++ b/packages/app/schema/archived_nl/deceased_rivm.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_deceased_rivm", + "title": "archived_nl_deceased_rivm", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_deceased_rivm_archived_20221231_value", + "title": "archived_nl_deceased_rivm_value", "type": "object", "properties": { "covid_daily": { diff --git a/packages/app/schema/archived_nl/deceased_rivm_per_age_group.json b/packages/app/schema/archived_nl/deceased_rivm_per_age_group.json index 4a5289ac61..3a64e1dd39 100644 --- a/packages/app/schema/archived_nl/deceased_rivm_per_age_group.json +++ b/packages/app/schema/archived_nl/deceased_rivm_per_age_group.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_deceased_rivm_per_age_group", + "title": "archived_nl_deceased_rivm_per_age_group", "type": "object", "required": ["values"], "additionalProperties": false, @@ -14,7 +14,7 @@ }, "definitions": { "value": { - "title": "nl_deceased_rivm_per_age_group_archived_20221231_value", + "title": "archived_nl_deceased_rivm_per_age_group_value", "type": "object", "required": ["age_group_range", "age_group_percentage", "covid_percentage", "date_of_insertion_unix"], "additionalProperties": false, diff --git a/packages/app/schema/archived_nl/disability_care.json b/packages/app/schema/archived_nl/disability_care.json index e182afa8a2..a9707ab056 100644 --- a/packages/app/schema/archived_nl/disability_care.json +++ b/packages/app/schema/archived_nl/disability_care.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_disability_care", + "title": "archived_nl_disability_care", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_disability_care_archived_20230126_value", + "title": "archived_nl_disability_care_value", "type": "object", "properties": { "newly_infected_people": { diff --git a/packages/app/schema/archived_nl/doctor.json b/packages/app/schema/archived_nl/doctor.json index 0c06a44824..1db3e8c3b3 100644 --- a/packages/app/schema/archived_nl/doctor.json +++ b/packages/app/schema/archived_nl/doctor.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_doctor", + "title": "archived_nl_doctor", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_doctor_value", + "title": "archived_nl_doctor_value", "type": "object", "properties": { "date_start_unix": { @@ -36,13 +36,7 @@ "type": "integer" } }, - "required": [ - "date_start_unix", - "date_end_unix", - "covid_symptoms_per_100k", - "covid_symptoms", - "date_of_insertion_unix" - ], + "required": ["date_start_unix", "date_end_unix", "covid_symptoms_per_100k", "covid_symptoms", "date_of_insertion_unix"], "additionalProperties": false } } diff --git a/packages/app/schema/archived_nl/elderly_at_home.json b/packages/app/schema/archived_nl/elderly_at_home.json index 3e239a0537..2301d9bc0b 100644 --- a/packages/app/schema/archived_nl/elderly_at_home.json +++ b/packages/app/schema/archived_nl/elderly_at_home.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_elderly_at_home", + "title": "archived_nl_elderly_at_home", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_elderly_at_home_archived_20230126_value", + "title": "archived_nl_elderly_at_home_value", "type": "object", "properties": { "positive_tested_daily": { diff --git a/packages/app/schema/archived_nl/infectious_people.json b/packages/app/schema/archived_nl/infectious_people.json index 9fd1946065..2629361aa0 100644 --- a/packages/app/schema/archived_nl/infectious_people.json +++ b/packages/app/schema/archived_nl/infectious_people.json @@ -1,16 +1,10 @@ { "definitions": { "value": { - "title": "nl_infectious_people_value", + "title": "archived_nl_infectious_people_value", "type": "object", "additionalProperties": false, - "required": [ - "margin_low", - "estimate", - "margin_high", - "date_unix", - "date_of_insertion_unix" - ], + "required": ["margin_low", "estimate", "margin_high", "date_unix", "date_of_insertion_unix"], "properties": { "margin_low": { "type": "integer" @@ -32,7 +26,7 @@ } }, "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_infectious_people", + "title": "archived_nl_infectious_people", "type": "object", "required": ["values", "last_value"], "additionalProperties": false, diff --git a/packages/app/schema/archived_nl/nursing_home.json b/packages/app/schema/archived_nl/nursing_home.json index 83ff2041cb..0b2cf143e7 100644 --- a/packages/app/schema/archived_nl/nursing_home.json +++ b/packages/app/schema/archived_nl/nursing_home.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_nursing_home", + "title": "archived_nl_nursing_home", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_nursing_home_archived_20230126_value", + "title": "archived_nl_nursing_home_value", "type": "object", "properties": { "newly_infected_people": { diff --git a/packages/app/schema/archived_nl/positive_tests/g_number.json b/packages/app/schema/archived_nl/positive_tests/g_number.json index 2dc61e6f4c..21b06758c7 100644 --- a/packages/app/schema/archived_nl/positive_tests/g_number.json +++ b/packages/app/schema/archived_nl/positive_tests/g_number.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_g_number", + "title": "archived_nl_g_number", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_g_number_value", + "title": "archived_nl_g_number_value", "type": "object", "properties": { "g_number": { diff --git a/packages/app/schema/archived_nl/positive_tests/tested_ggd.json b/packages/app/schema/archived_nl/positive_tests/tested_ggd.json index 8d0ae48145..f9971bdac5 100644 --- a/packages/app/schema/archived_nl/positive_tests/tested_ggd.json +++ b/packages/app/schema/archived_nl/positive_tests/tested_ggd.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_tested_ggd", + "title": "archived_nl_tested_ggd", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_tested_ggd_value", + "title": "archived_nl_tested_ggd_value", "type": "object", "properties": { "infected": { diff --git a/packages/app/schema/archived_nl/positive_tests/tested_overall.json b/packages/app/schema/archived_nl/positive_tests/tested_overall.json index 99be016b17..d750cfade9 100644 --- a/packages/app/schema/archived_nl/positive_tests/tested_overall.json +++ b/packages/app/schema/archived_nl/positive_tests/tested_overall.json @@ -1,7 +1,7 @@ { "definitions": { "value": { - "title": "nl_tested_overall_value", + "title": "archived_nl_tested_overall_value", "type": "object", "additionalProperties": false, "required": [ @@ -39,7 +39,7 @@ } }, "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_tested_overall", + "title": "archived_nl_tested_overall", "type": "object", "required": ["values", "last_value"], "additionalProperties": false, diff --git a/packages/app/schema/archived_nl/positive_tests/tested_per_age_group.json b/packages/app/schema/archived_nl/positive_tests/tested_per_age_group.json index b1011a3c3d..1ab9475441 100644 --- a/packages/app/schema/archived_nl/positive_tests/tested_per_age_group.json +++ b/packages/app/schema/archived_nl/positive_tests/tested_per_age_group.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_tested_per_age_group", + "title": "archived_nl_tested_per_age_group", "type": "object", "additionalProperties": false, "properties": { @@ -17,7 +17,7 @@ "required": ["values", "last_value"], "definitions": { "value": { - "title": "nl_tested_per_age_group_value", + "title": "archived_nl_tested_per_age_group_value", "additionalProperties": false, "type": "object", "required": [ diff --git a/packages/app/schema/archived_nl/repeating_shot_administered.json b/packages/app/schema/archived_nl/repeating_shot_administered.json index b9606c4178..01005a12ac 100644 --- a/packages/app/schema/archived_nl/repeating_shot_administered.json +++ b/packages/app/schema/archived_nl/repeating_shot_administered.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_repeating_shot_administered", + "title": "archived_nl_repeating_shot_administered", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_repeating_shot_administered_value", + "title": "archived_nl_repeating_shot_administered_value", "type": "object", "properties": { "ggd_administered_total": { @@ -30,11 +30,7 @@ "type": "integer" } }, - "required": [ - "ggd_administered_total", - "date_unix", - "date_of_insertion_unix" - ], + "required": ["ggd_administered_total", "date_unix", "date_of_insertion_unix"], "additionalProperties": false } } diff --git a/packages/app/schema/archived_nl/reproduction.json b/packages/app/schema/archived_nl/reproduction.json index 713c129c28..69e708670b 100644 --- a/packages/app/schema/archived_nl/reproduction.json +++ b/packages/app/schema/archived_nl/reproduction.json @@ -1,7 +1,7 @@ { "definitions": { "value": { - "title": "nl_reproduction_value", + "title": "archived_nl_reproduction_value", "type": "object", "additionalProperties": false, "required": ["index_low", "index_average", "index_high", "date_unix", "date_of_insertion_unix"], @@ -29,7 +29,7 @@ }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "reproduction.json", - "title": "nl_reproduction", + "title": "archived_nl_reproduction", "type": "object", "required": ["values", "last_value"], "additionalProperties": false, diff --git a/packages/app/schema/archived_nl/sewer.json b/packages/app/schema/archived_nl/sewer.json index be2727f66d..703b328e7f 100644 --- a/packages/app/schema/archived_nl/sewer.json +++ b/packages/app/schema/archived_nl/sewer.json @@ -1,7 +1,7 @@ { "definitions": { "value": { - "title": "nl_sewer_value", + "title": "archived_nl_sewer_value", "type": "object", "required": ["average", "date_of_insertion_unix", "date_unix"], "additionalProperties": false, @@ -19,7 +19,7 @@ } }, "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_sewer", + "title": "archived_nl_sewer", "type": "object", "required": ["values", "last_value"], "additionalProperties": false, diff --git a/packages/app/schema/archived_nl/vaccine_campaigns.json b/packages/app/schema/archived_nl/vaccine_campaigns.json index e5cc945d34..78ce0fb80b 100644 --- a/packages/app/schema/archived_nl/vaccine_campaigns.json +++ b/packages/app/schema/archived_nl/vaccine_campaigns.json @@ -1,7 +1,7 @@ { "definitions": { "vaccine_campaign": { - "title": "nl_vaccine_campaigns", + "title": "archived_nl_vaccine_campaigns", "type": "object", "required": ["vaccine_campaign_order", "vaccine_campaign_name_nl", "vaccine_campaign_name_en", "vaccine_administered_total", "vaccine_administered_last_week"], "additionalProperties": false, @@ -25,7 +25,7 @@ } }, "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_vaccine_campaigns_archived_20220908", + "title": "archived_nl_vaccine_campaigns", "type": "object", "required": ["vaccine_campaigns", "date_unix", "date_start_unix", "date_end_unix", "date_of_insertion_unix"], "additionalProperties": false, diff --git a/packages/app/schema/archived_nl/vaccine_coverage.json b/packages/app/schema/archived_nl/vaccine_coverage.json index f8395e508a..84bc81fca7 100644 --- a/packages/app/schema/archived_nl/vaccine_coverage.json +++ b/packages/app/schema/archived_nl/vaccine_coverage.json @@ -1,7 +1,7 @@ { "definitions": { "value": { - "title": "nl_vaccine_coverage_value", + "title": "archived_nl_vaccine_coverage_value", "type": "object", "required": [ "booster_vaccinated", @@ -43,7 +43,7 @@ } }, "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_vaccine_coverage", + "title": "archived_nl_vaccine_coverage", "type": "object", "required": ["values", "last_value"], "additionalProperties": false, diff --git a/packages/app/schema/archived_nl/vaccine_coverage_per_age_group.json b/packages/app/schema/archived_nl/vaccine_coverage_per_age_group.json index 4734a3af7b..bfe9b687cb 100644 --- a/packages/app/schema/archived_nl/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/archived_nl/vaccine_coverage_per_age_group.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_vaccine_coverage_per_age_group_archived_20220622", + "title": "archived_nl_vaccine_coverage_per_age_group", "type": "object", "required": ["values"], "additionalProperties": false, @@ -14,7 +14,7 @@ }, "definitions": { "value": { - "title": "nl_vaccine_coverage_per_age_group_archived_value", + "title": "archived_nl_vaccine_coverage_per_age_group_value", "additionalProperties": false, "type": "object", "required": [ diff --git a/packages/app/schema/archived_nl/vaccine_coverage_per_age_group_estimated.json b/packages/app/schema/archived_nl/vaccine_coverage_per_age_group_estimated.json index a3ebd521ae..bd7f3a328a 100644 --- a/packages/app/schema/archived_nl/vaccine_coverage_per_age_group_estimated.json +++ b/packages/app/schema/archived_nl/vaccine_coverage_per_age_group_estimated.json @@ -1,7 +1,7 @@ { "definitions": { "value": { - "title": "nl_vaccine_coverage_per_age_group_estimated", + "title": "archived_nl_vaccine_coverage_per_age_group_estimated", "type": "object", "required": [ "age_18_plus_fully_vaccinated", diff --git a/packages/app/schema/archived_nl/vaccine_coverage_per_age_group_with_booster_shot.json b/packages/app/schema/archived_nl/vaccine_coverage_per_age_group_with_booster_shot.json index 043b13ad49..97eaa877f2 100644 --- a/packages/app/schema/archived_nl/vaccine_coverage_per_age_group_with_booster_shot.json +++ b/packages/app/schema/archived_nl/vaccine_coverage_per_age_group_with_booster_shot.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_vaccine_coverage_per_age_group_with_booster_shot", + "title": "archived_nl_vaccine_coverage_per_age_group_with_booster_shot", "type": "object", "required": ["values"], "additionalProperties": false, @@ -14,7 +14,7 @@ }, "definitions": { "value": { - "title": "nl_vaccine_coverage_per_age_group_archived_20220908_value", + "title": "archived_nl_vaccine_coverage_per_age_group_with_booster_shot_value", "additionalProperties": false, "type": "object", "required": [ diff --git a/packages/app/schema/archived_nl/vaccine_delivery_per_supplier.json b/packages/app/schema/archived_nl/vaccine_delivery_per_supplier.json index d09b1d318b..afef25a75c 100644 --- a/packages/app/schema/archived_nl/vaccine_delivery_per_supplier.json +++ b/packages/app/schema/archived_nl/vaccine_delivery_per_supplier.json @@ -1,7 +1,7 @@ { "definitions": { "value": { - "title": "nl_vaccine_delivery_per_supplier_value", + "title": "archived_nl_vaccine_delivery_per_supplier_value", "type": "object", "required": [ "total", @@ -60,7 +60,7 @@ } }, "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_vaccine_delivery_per_supplier", + "title": "archived_nl_vaccine_delivery_per_supplier", "type": "object", "required": ["values", "last_value"], "additionalProperties": false, diff --git a/packages/app/schema/archived_nl/vaccine_planned.json b/packages/app/schema/archived_nl/vaccine_planned.json index c82b4299a3..01f733b70b 100644 --- a/packages/app/schema/archived_nl/vaccine_planned.json +++ b/packages/app/schema/archived_nl/vaccine_planned.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_vaccine_planned", + "title": "archived_nl_vaccine_planned", "type": "object", "required": ["doses", "date_unix", "date_start_unix", "date_end_unix", "date_of_insertion_unix"], "additionalProperties": false, diff --git a/packages/app/schema/archived_nl/vaccine_stock.json b/packages/app/schema/archived_nl/vaccine_stock.json index ce3e1f9176..c443d738ec 100644 --- a/packages/app/schema/archived_nl/vaccine_stock.json +++ b/packages/app/schema/archived_nl/vaccine_stock.json @@ -1,7 +1,7 @@ { "definitions": { "value": { - "title": "nl_vaccine_stock_value", + "title": "archived_nl_vaccine_stock_value", "type": "object", "required": [ "total_available", @@ -75,7 +75,7 @@ } }, "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_vaccine_stock", + "title": "archived_nl_vaccine_stock", "type": "object", "required": ["values", "last_value"], "additionalProperties": false, diff --git a/packages/app/schema/archived_nl/vaccine_vaccinated_or_support.json b/packages/app/schema/archived_nl/vaccine_vaccinated_or_support.json index 9ae9d1d916..ab1483717a 100644 --- a/packages/app/schema/archived_nl/vaccine_vaccinated_or_support.json +++ b/packages/app/schema/archived_nl/vaccine_vaccinated_or_support.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_vaccine_vaccinated_or_support", + "title": "archived_nl_vaccine_vaccinated_or_support", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_vaccine_vaccinated_or_support_value", + "title": "archived_nl_vaccine_vaccinated_or_support_value", "type": "object", "properties": { "percentage_average": { diff --git a/packages/app/schema/archived_nl/vulnerable_hospital_admissions.json b/packages/app/schema/archived_nl/vulnerable_hospital_admissions.json index 9f5241bd55..841a589d03 100644 --- a/packages/app/schema/archived_nl/vulnerable_hospital_admissions.json +++ b/packages/app/schema/archived_nl/vulnerable_hospital_admissions.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_vulnerable_hospital_admissions", + "title": "archived_nl_vulnerable_hospital_admissions", "type": "object", "properties": { "admissions_age_70_plus": { @@ -16,11 +16,6 @@ "type": "integer" } }, - "required":[ - "admissions_age_70_plus", - "date_start_unix", - "date_end_unix", - "date_of_insertion_unix" - ], + "required": ["admissions_age_70_plus", "date_start_unix", "date_end_unix", "date_of_insertion_unix"], "additionalProperties": false } diff --git a/packages/app/schema/archived_nl/vulnerable_nursing_home.json b/packages/app/schema/archived_nl/vulnerable_nursing_home.json index 975347c0a8..de367c14e1 100644 --- a/packages/app/schema/archived_nl/vulnerable_nursing_home.json +++ b/packages/app/schema/archived_nl/vulnerable_nursing_home.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_vulnerable_nursing_home", + "title": "archived_nl_vulnerable_nursing_home", "type": "object", "properties": { "values": { @@ -17,7 +17,7 @@ "additionalProperties": false, "definitions": { "value": { - "title": "nl_vulnerable_nursing_home_value", + "title": "archived_nl_vulnerable_nursing_home_value", "type": "object", "properties": { "newly_infected_locations": { @@ -36,13 +36,7 @@ "type": "integer" } }, - "required": [ - "newly_infected_locations", - "infected_locations_total", - "infected_locations_percentage", - "date_unix", - "date_of_insertion_unix" - ], + "required": ["newly_infected_locations", "infected_locations_total", "infected_locations_percentage", "date_unix", "date_of_insertion_unix"], "additionalProperties": false } } diff --git a/packages/app/schema/gm/hospital_nice_choropleth.json b/packages/app/schema/gm/hospital_nice_choropleth.json deleted file mode 100644 index 96a0917a87..0000000000 --- a/packages/app/schema/gm/hospital_nice_choropleth.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "definitions": { - "value": { - "title": "gm_hospital_nice_choropleth_value", - "type": "object", - "additionalProperties": false, - "required": [ - "admissions_on_date_of_admission", - "admissions_on_date_of_reporting", - "date_unix", - "date_of_insertion_unix" - ], - "properties": { - "date_unix": { - "type": "integer" - }, - "admissions_on_date_of_admission": { - "type": "integer" - }, - "admissions_on_date_of_reporting": { - "type": "integer" - }, - "date_of_insertion_unix": { - "type": "integer" - } - } - } - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "gm_hospital_nice_choropleth", - "type": "object", - "required": ["values", "last_value"], - "additionalProperties": false, - "properties": { - "values": { - "type": "array", - "items": { - "$ref": "#/definitions/value" - } - }, - "last_value": { - "$ref": "#/definitions/value" - } - } -} diff --git a/packages/app/schema/gm/sewer_per_installation.json b/packages/app/schema/gm/sewer_per_installation.json index d8050f1760..78de203b92 100644 --- a/packages/app/schema/gm/sewer_per_installation.json +++ b/packages/app/schema/gm/sewer_per_installation.json @@ -18,7 +18,7 @@ } }, "installation": { - "title": "municipal_sewer_per_installation_installation", + "title": "municipal_sewer_per_installation", "type": "object", "additionalProperties": false, "required": ["rwzi_awzi_name", "values", "last_value"], diff --git a/packages/app/src/components/choropleth/logic/types.ts b/packages/app/src/components/choropleth/logic/types.ts index f7d9c9e4cf..56b1c29bf8 100644 --- a/packages/app/src/components/choropleth/logic/types.ts +++ b/packages/app/src/components/choropleth/logic/types.ts @@ -4,7 +4,7 @@ import type { GmCollection, GmCollectionHospitalNiceChoropleth, GmCollectionSewer, - GmCollectionTestedOverall, + ArchivedGmCollectionTestedOverall, GmCollectionVaccineCoveragePerAgeGroup, ArchivedVrCollection, VrCollectionVulnerableNursingHome, @@ -60,7 +60,7 @@ export type InferedDataCollection<T extends ChoroplethDataItem> = T extends GmDa export type GmDataCollection = GmCollectionHospitalNiceChoropleth[] | GmCollectionSewer[] | GmCollectionVaccineCoveragePerAgeGroup[]; export type GmDataItem = GmDataCollection[number]; -export type ArchivedGmDataCollection = GmCollectionTestedOverall[] | ArchivedGmCollectionHospitalNiceChoropleth[]; +export type ArchivedGmDataCollection = ArchivedGmCollectionTestedOverall[] | ArchivedGmCollectionHospitalNiceChoropleth[]; export type ArchivedGmDataItem = ArchivedGmDataCollection[number]; export type ArchivedVrDataCollection = VrCollectionVulnerableNursingHome[] | VrCollectionElderlyAtHome[] | VrCollectionDisabilityCare[]; diff --git a/packages/app/src/domain/behavior/behavior-line-chart-tile.tsx b/packages/app/src/domain/behavior/behavior-line-chart-tile.tsx index cfb46cafbe..3c1b1d6c48 100644 --- a/packages/app/src/domain/behavior/behavior-line-chart-tile.tsx +++ b/packages/app/src/domain/behavior/behavior-line-chart-tile.tsx @@ -1,4 +1,4 @@ -import { colors, NlBehaviorValue } from '@corona-dashboard/common'; +import { colors, ArchivedNlBehaviorValue } from '@corona-dashboard/common'; import { dropRightWhile, dropWhile } from 'lodash'; import { useMemo } from 'react'; import { isPresent } from 'ts-is-present'; @@ -15,7 +15,7 @@ import { useBreakpoints } from '~/utils/use-breakpoints'; import { SelectBehavior } from './components/select-behavior'; import { BehaviorIdentifier } from './logic/behavior-types'; -type ValueType = NlBehaviorValue; +type ValueType = ArchivedNlBehaviorValue; type ValueKey = keyof ValueType; interface BehaviorLineChartTileProps { diff --git a/packages/app/src/domain/behavior/behavior-per-age-group-tile.tsx b/packages/app/src/domain/behavior/behavior-per-age-group-tile.tsx index 41a84a647a..c2c96704eb 100644 --- a/packages/app/src/domain/behavior/behavior-per-age-group-tile.tsx +++ b/packages/app/src/domain/behavior/behavior-per-age-group-tile.tsx @@ -1,4 +1,4 @@ -import { colors, NlBehaviorPerAgeGroup } from '@corona-dashboard/common'; +import { colors, ArchivedNlBehaviorPerAgeGroup } from '@corona-dashboard/common'; import React from 'react'; import { AgeGroup } from '~/components/age-groups/age-group'; import { Box } from '~/components/base'; @@ -23,7 +23,7 @@ const AGE_GROUPS_KEYS = ['70_plus', '55_69', '40_54', '25_39', '16_24'] as const interface BehaviorPerAgeGroupProps { title: string; description: string; - data: NlBehaviorPerAgeGroup; + data: ArchivedNlBehaviorPerAgeGroup; currentId: BehaviorIdentifier; setCurrentId: React.Dispatch<React.SetStateAction<BehaviorIdentifier>>; text: SiteText['pages']['behavior_page']['nl']; diff --git a/packages/app/src/domain/behavior/behavior-table-tile.tsx b/packages/app/src/domain/behavior/behavior-table-tile.tsx index 656cd6d960..ec75ccd3b6 100644 --- a/packages/app/src/domain/behavior/behavior-table-tile.tsx +++ b/packages/app/src/domain/behavior/behavior-table-tile.tsx @@ -1,4 +1,4 @@ -import { colors, NlBehaviorValue } from '@corona-dashboard/common'; +import { colors, ArchivedNlBehaviorValue } from '@corona-dashboard/common'; import React, { useMemo } from 'react'; import { isDefined, isPresent } from 'ts-is-present'; import { Box } from '~/components/base'; @@ -20,7 +20,7 @@ import { useBehaviorLookupKeys } from './logic/use-behavior-lookup-keys'; interface BehaviorTableTileProps { title: string; description: string; - value: NlBehaviorValue; + value: ArchivedNlBehaviorValue; annotation: string; setCurrentId: React.Dispatch<React.SetStateAction<BehaviorIdentifier>>; scrollRef: { current: HTMLDivElement | null }; @@ -30,7 +30,7 @@ interface BehaviorTableTileProps { export const BehaviorTableTile = ({ title, description, value, annotation, setCurrentId, scrollRef, text, metadata }: BehaviorTableTileProps) => { const breakpoints = useBreakpoints(true); - const behaviorsTableData: TableData[] = useBehaviorTableData(value as NlBehaviorValue, { scrollRef, setCurrentId }); + const behaviorsTableData: TableData[] = useBehaviorTableData(value as ArchivedNlBehaviorValue, { scrollRef, setCurrentId }); const titles = { first: text.basisregels.rules_followed, second: text.basisregels.rules_supported }; const colorValues = { first: colors.blue6, second: colors.yellow3 }; const percentageData = useGetPercentageData(behaviorsTableData, titles, colorValues); @@ -79,7 +79,7 @@ export const BehaviorTableTile = ({ title, description, value, annotation, setCu ); }; -function useBehaviorTableData(value: NlBehaviorValue, onClickConfig: OnClickConfig) { +function useBehaviorTableData(value: ArchivedNlBehaviorValue, onClickConfig: OnClickConfig) { const behaviorLookupKeys = useBehaviorLookupKeys(); return useMemo(() => { 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 81a9516b30..ee06eabaee 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 @@ -1,4 +1,4 @@ -import { colors, NlGNumber, TimeframeOption, TimeframeOptionsList } from '@corona-dashboard/common'; +import { colors, ArchivedNlGNumber, TimeframeOption, TimeframeOptionsList } from '@corona-dashboard/common'; import { useState } from 'react'; import { ChartTile } from '~/components/chart-tile'; import { TimeSeriesChart } from '~/components/time-series-chart'; @@ -8,7 +8,7 @@ import { useIntl } from '~/intl'; import { createDateFromUnixTimestamp } from '~/utils/create-date-from-unix-timestamp'; interface GNumberBarChartTileProps { - data: NlGNumber; + data: ArchivedNlGNumber; timeframeInitialValue?: TimeframeOption; } diff --git a/packages/app/src/domain/tested/infected-per-age-group/infected-per-age-group.tsx b/packages/app/src/domain/tested/infected-per-age-group/infected-per-age-group.tsx index df49d7a2b7..88c4fd8130 100644 --- a/packages/app/src/domain/tested/infected-per-age-group/infected-per-age-group.tsx +++ b/packages/app/src/domain/tested/infected-per-age-group/infected-per-age-group.tsx @@ -1,4 +1,4 @@ -import { NlTestedPerAgeGroupValue, TimeframeOption } from '@corona-dashboard/common'; +import { ArchivedNlTestedPerAgeGroupValue, TimeframeOption } from '@corona-dashboard/common'; import { Spacer } from '~/components/base'; import { ErrorBoundary } from '~/components/error-boundary'; import { InteractiveLegend, SelectOption } from '~/components/interactive-legend'; @@ -22,7 +22,7 @@ interface InfectedPerAgeGroup { * graph with a label and description. */ accessibility: AccessibilityDefinition; - values: NlTestedPerAgeGroupValue[]; + values: ArchivedNlTestedPerAgeGroupValue[]; timeframe: TimeframeOption; timelineEvents?: TimelineEventConfig[]; text: SiteText['pages']['positive_tests_page']['nl']; @@ -36,7 +36,7 @@ export function InfectedPerAgeGroup({ values, timeframe, accessibility, timeline const underReportedDateStart = getBoundaryDateStartUnix(values, 7); /* Enrich config with dynamic data / locale */ - const seriesConfig: LineSeriesDefinition<NlTestedPerAgeGroupValue>[] = BASE_SERIES_CONFIG.map((baseAgeGroup) => { + const seriesConfig: LineSeriesDefinition<ArchivedNlTestedPerAgeGroupValue>[] = BASE_SERIES_CONFIG.map((baseAgeGroup) => { const label = baseAgeGroup.metricProperty in text.infected_per_age_group.legend ? text.infected_per_age_group.legend[baseAgeGroup.metricProperty] : baseAgeGroup.metricProperty; const ariaLabel = replaceVariablesInText(commonTexts.aria_labels.age_old, { diff --git a/packages/app/src/domain/tested/reproduction-chart-tile.tsx b/packages/app/src/domain/tested/reproduction-chart-tile.tsx index 1223f69454..9f236f7fbf 100644 --- a/packages/app/src/domain/tested/reproduction-chart-tile.tsx +++ b/packages/app/src/domain/tested/reproduction-chart-tile.tsx @@ -1,4 +1,4 @@ -import { colors, NlReproduction, NlReproductionValue, TimeframeOption, TimeframeOptionsList } from '@corona-dashboard/common'; +import { colors, ArchivedNlReproduction, ArchivedNlReproductionValue, TimeframeOption, TimeframeOptionsList } from '@corona-dashboard/common'; import { useState } from 'react'; import { last } from 'lodash'; import { isPresent } from 'ts-is-present'; @@ -8,7 +8,7 @@ import { TimelineEventConfig } from '~/components/time-series-chart/components/t import { SiteText } from '~/locale'; interface ReproductionChartTileProps { - data: NlReproduction; + data: ArchivedNlReproduction; timeframeOptions?: TimeframeOption[]; timeframeInitialValue?: TimeframeOption; timelineEvents?: TimelineEventConfig[]; @@ -34,7 +34,7 @@ export const ReproductionChartTile = ({ 0, data.values.findIndex((x) => !isPresent(x.index_average)) ); - const last_value = last(values) as NlReproductionValue; + const last_value = last(values) as ArchivedNlReproductionValue; return ( <ChartTile diff --git a/packages/app/src/domain/vaccine/booster-shot-coverage-per-age-group/booster-shot-coverage-per-age-group.tsx b/packages/app/src/domain/vaccine/booster-shot-coverage-per-age-group/booster-shot-coverage-per-age-group.tsx index 79b5c87fca..0e44525d75 100644 --- a/packages/app/src/domain/vaccine/booster-shot-coverage-per-age-group/booster-shot-coverage-per-age-group.tsx +++ b/packages/app/src/domain/vaccine/booster-shot-coverage-per-age-group/booster-shot-coverage-per-age-group.tsx @@ -1,4 +1,4 @@ -import { GmVaccineCoveragePerAgeGroupArchived_20220908Value, NlVaccineCoveragePerAgeGroupArchived_20220908Value } from '@corona-dashboard/common'; +import { ArchivedGmVaccineCoveragePerAgeGroupWithBoosterShotValue, ArchivedNlVaccineCoveragePerAgeGroupWithBoosterShotValue } from '@corona-dashboard/common'; import { AgeGroup } from '~/components/age-groups/age-group'; import { ChartTile } from '~/components/chart-tile'; import { MetadataProps } from '~/components/metadata'; @@ -16,7 +16,7 @@ interface BoosterCoveragePerAgeGroupProps { description: string; metadata: MetadataProps; sortingOrder: string[]; - values: NlVaccineCoveragePerAgeGroupArchived_20220908Value[] | GmVaccineCoveragePerAgeGroupArchived_20220908Value[]; + values: ArchivedNlVaccineCoveragePerAgeGroupWithBoosterShotValue[] | ArchivedGmVaccineCoveragePerAgeGroupWithBoosterShotValue[]; text: SiteText['pages']['vaccinations_page']['nl']; } diff --git a/packages/app/src/domain/vaccine/vaccinations-over-time-chart.tsx b/packages/app/src/domain/vaccine/vaccinations-over-time-chart.tsx index 0cea4bc675..754693335a 100644 --- a/packages/app/src/domain/vaccine/vaccinations-over-time-chart.tsx +++ b/packages/app/src/domain/vaccine/vaccinations-over-time-chart.tsx @@ -1,86 +1,41 @@ -import { - assert, - colors, - DateValue, - NlVaccineCoverage, - NlVaccineCoverageValue, -} from '@corona-dashboard/common'; +import { assert, colors, DateValue, ArchivedNlVaccineCoverage, ArchivedNlVaccineCoverageValue } from '@corona-dashboard/common'; import { first } from 'lodash'; import { useMemo } from 'react'; import { isDefined } from 'ts-is-present'; import { RadioGroup, RadioGroupItem } from '~/components/radio-group'; -import { - SeriesConfig, - TimeSeriesChart, - TimeSeriesChartProps, -} from '~/components/time-series-chart'; +import { SeriesConfig, TimeSeriesChart, TimeSeriesChartProps } from '~/components/time-series-chart'; import { TooltipData } from '~/components/time-series-chart/components'; import { TimelineEventConfig } from '~/components/time-series-chart/components/timeline'; -import { - DataOptions, - StackedAreaSeriesDefinition, -} from '~/components/time-series-chart/logic'; +import { DataOptions, StackedAreaSeriesDefinition } from '~/components/time-series-chart/logic'; import { useIntl } from '~/intl'; import { SiteText } from '~/locale'; import { replaceVariablesInText } from '~/utils/replace-variables-in-text'; import { useBreakpoints } from '~/utils/use-breakpoints'; import { VaccineDeliveryAndAdministrationsTooltip } from './components/vaccine-delivery-and-administrations-tooltip'; -import { - AdministrationData, - VaccineAdministrationsValue, -} from './data-selection/select-administration-data'; +import { AdministrationData, VaccineAdministrationsValue } from './data-selection/select-administration-data'; export type ActiveVaccinationChart = 'coverage' | 'deliveryAndAdministration'; interface VaccinationsOverTimeChartProps { - coverageData?: NlVaccineCoverage; + coverageData?: ArchivedNlVaccineCoverage; administrationData: AdministrationData; activeChart: ActiveVaccinationChart; - timelineEvents: Partial< - Record<ActiveVaccinationChart, TimelineEventConfig[]> - >; + timelineEvents: Partial<Record<ActiveVaccinationChart, TimelineEventConfig[]>>; text: SiteText['pages']['vaccinations_page']['nl']; } -const vaccines = [ - 'pfizer', - 'moderna', - 'astra_zeneca', - 'janssen', - 'novavax', -] as const; -vaccines.forEach((x) => - assert( - colors.vaccines[x], - `[${VaccinationsOverTimeChart.name}] missing vaccine color for vaccine ${x}` - ) -); +const vaccines = ['pfizer', 'moderna', 'astra_zeneca', 'janssen', 'novavax'] as const; +vaccines.forEach((x) => assert(colors.vaccines[x], `[${VaccinationsOverTimeChart.name}] missing vaccine color for vaccine ${x}`)); -export function VaccinationsOverTimeChart( - props: VaccinationsOverTimeChartProps -) { - const { - coverageData, - administrationData, - activeChart, - timelineEvents, - text, - } = props; +export function VaccinationsOverTimeChart(props: VaccinationsOverTimeChartProps) { + const { coverageData, administrationData, activeChart, timelineEvents, text } = props; const { commonTexts, formatNumber } = useIntl(); const breakpoints = useBreakpoints(true); const firstValue = first(administrationData.values); - const vaccineNames = useMemo( - () => vaccines.filter((x) => firstValue?.[x] !== undefined).reverse(), - [firstValue] - ); + const vaccineNames = useMemo(() => vaccines.filter((x) => firstValue?.[x] !== undefined).reverse(), [firstValue]); - const coverageChartConfiguration: - | TimeSeriesChartProps< - DailyNlVaccineCoverageValue, - SeriesConfig<DailyNlVaccineCoverageValue> - > - | undefined = useMemo(() => { + const coverageChartConfiguration: TimeSeriesChartProps<DailyNlVaccineCoverageValue, SeriesConfig<DailyNlVaccineCoverageValue>> | undefined = useMemo(() => { return isDefined(coverageData) ? ({ accessibility: { key: 'vaccine_coverage_over_time_chart' }, @@ -88,17 +43,13 @@ export function VaccinationsOverTimeChart( minHeight: breakpoints.md ? 400 : 250, formatTickValue: (x: number) => `${x / 1_000_000}`, dataOptions: { - valueAnnotation: - text.grafiek_gevaccineerd_door_de_tijd_heen.waarde_annotatie, + valueAnnotation: text.grafiek_gevaccineerd_door_de_tijd_heen.waarde_annotatie, timelineEvents: timelineEvents.coverage, } as DataOptions, seriesConfig: [ { - label: - text.grafiek_gevaccineerd_door_de_tijd_heen.label_gedeeltelijk, - shortLabel: - text.grafiek_gevaccineerd_door_de_tijd_heen - .tooltip_label_gedeeltelijk, + label: text.grafiek_gevaccineerd_door_de_tijd_heen.label_gedeeltelijk, + shortLabel: text.grafiek_gevaccineerd_door_de_tijd_heen.tooltip_label_gedeeltelijk, type: 'stacked-area', metricProperty: 'partially_vaccinated', color: colors.blue4, @@ -107,9 +58,7 @@ export function VaccinationsOverTimeChart( }, { label: text.grafiek_gevaccineerd_door_de_tijd_heen.label_volledig, - shortLabel: - text.grafiek_gevaccineerd_door_de_tijd_heen - .tooltip_label_volledig, + shortLabel: text.grafiek_gevaccineerd_door_de_tijd_heen.tooltip_label_volledig, type: 'stacked-area', metricProperty: 'fully_vaccinated', color: colors.primary, @@ -117,12 +66,8 @@ export function VaccinationsOverTimeChart( fillOpacity: 1, }, { - label: - text.grafiek_gevaccineerd_door_de_tijd_heen - .label_booster_vaccinated, - shortLabel: - text.grafiek_gevaccineerd_door_de_tijd_heen - .tooltip_label_booster_vaccinated, + label: text.grafiek_gevaccineerd_door_de_tijd_heen.label_booster_vaccinated, + shortLabel: text.grafiek_gevaccineerd_door_de_tijd_heen.tooltip_label_booster_vaccinated, type: 'stacked-area', metricProperty: 'booster_vaccinated', color: colors.blue10, @@ -131,18 +76,13 @@ export function VaccinationsOverTimeChart( }, { label: text.grafiek_gevaccineerd_door_de_tijd_heen.label_totaal, - shortLabel: - text.grafiek_gevaccineerd_door_de_tijd_heen - .tooltip_label_totaal, + shortLabel: text.grafiek_gevaccineerd_door_de_tijd_heen.tooltip_label_totaal, type: 'line', metricProperty: 'partially_or_fully_vaccinated', color: 'black', }, ], - } as TimeSeriesChartProps< - DailyNlVaccineCoverageValue, - SeriesConfig<DailyNlVaccineCoverageValue> - >) + } as TimeSeriesChartProps<DailyNlVaccineCoverageValue, SeriesConfig<DailyNlVaccineCoverageValue>>) : undefined; }, [ coverageData, @@ -154,8 +94,7 @@ export function VaccinationsOverTimeChart( text.grafiek_gevaccineerd_door_de_tijd_heen.tooltip_label_gedeeltelijk, text.grafiek_gevaccineerd_door_de_tijd_heen.tooltip_label_volledig, text.grafiek_gevaccineerd_door_de_tijd_heen.label_booster_vaccinated, - text.grafiek_gevaccineerd_door_de_tijd_heen - .tooltip_label_booster_vaccinated, + text.grafiek_gevaccineerd_door_de_tijd_heen.tooltip_label_booster_vaccinated, timelineEvents.coverage, breakpoints, ]); @@ -176,21 +115,14 @@ export function VaccinationsOverTimeChart( values: administrationData.values, numGridLines: 6, formatTickValue: (x: number) => formatNumber(x / 1000000), - formatTooltip: (x: TooltipData<VaccineAdministrationsValue>) => ( - <VaccineDeliveryAndAdministrationsTooltip data={x} /> - ), + formatTooltip: (x: TooltipData<VaccineAdministrationsValue>) => <VaccineDeliveryAndAdministrationsTooltip data={x} />, seriesConfig: [ - ...vaccineNames.map< - StackedAreaSeriesDefinition<VaccineAdministrationsValue> - >((x) => ({ + ...vaccineNames.map<StackedAreaSeriesDefinition<VaccineAdministrationsValue>>((x) => ({ metricProperty: x as keyof VaccineAdministrationsValue, type: 'stacked-area', - label: replaceVariablesInText( - text.data.vaccination_chart.legend_label, - { - name: text.data.vaccination_chart.product_names[x], - } - ), + label: replaceVariablesInText(text.data.vaccination_chart.legend_label, { + name: text.data.vaccination_chart.product_names[x], + }), shortLabel: text.data.vaccination_chart.product_names[x], color: colors.vaccines[x], mixBlendMode: 'multiply', @@ -203,10 +135,7 @@ export function VaccinationsOverTimeChart( label: text.data.vaccination_chart.doses_administered, }, ], - } as TimeSeriesChartProps< - VaccineAdministrationsValue, - SeriesConfig<VaccineAdministrationsValue> - >; + } as TimeSeriesChartProps<VaccineAdministrationsValue, SeriesConfig<VaccineAdministrationsValue>>; }, [ administrationData, commonTexts.waarde_annotaties.x_miljoen, @@ -219,23 +148,14 @@ export function VaccinationsOverTimeChart( timelineEvents.deliveryAndAdministration, ]); - const chartProps = - activeChart === 'coverage' - ? coverageChartConfiguration - : deliveryAndAdministrationChartConfiguration; + const chartProps = activeChart === 'coverage' ? coverageChartConfiguration : deliveryAndAdministrationChartConfiguration; - return isDefined(chartProps) ? ( - <TimeSeriesChart {...(chartProps as any)} /> - ) : null; + return isDefined(chartProps) ? <TimeSeriesChart {...(chartProps as any)} /> : null; } -type DailyNlVaccineCoverageValue = Omit< - NlVaccineCoverageValue, - 'date_start_unix' | 'date_end_unix' -> & - DateValue; +type DailyNlVaccineCoverageValue = Omit<ArchivedNlVaccineCoverageValue, 'date_start_unix' | 'date_end_unix'> & DateValue; -function transformToDayTimestamps(values: NlVaccineCoverageValue[]) { +function transformToDayTimestamps(values: ArchivedNlVaccineCoverageValue[]) { return values.map<DailyNlVaccineCoverageValue>((x) => { const newValue = { ...x, @@ -262,9 +182,7 @@ export function VaccinationChartControls(props: VaccinationChartControlsProps) { value: 'coverage', }, { - label: - commonTexts.charts.vaccination_coverage_controls - .delivery_and_administration, + label: commonTexts.charts.vaccination_coverage_controls.delivery_and_administration, value: 'deliveryAndAdministration', }, ]; 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 22afa1dc23..e18ae33990 100644 --- a/packages/app/src/domain/vaccine/vaccinations-over-time-tile.tsx +++ b/packages/app/src/domain/vaccine/vaccinations-over-time-tile.tsx @@ -1,4 +1,4 @@ -import { NlVaccineAdministeredPlannedValue, NlVaccineCoverage } from '@corona-dashboard/common'; +import { NlVaccineAdministeredPlannedValue, ArchivedNlVaccineCoverage } from '@corona-dashboard/common'; import React, { Dispatch, SetStateAction, useState, useMemo } from 'react'; import { Box } from '~/components/base'; import { isDefined } from 'ts-is-present'; @@ -32,7 +32,7 @@ function useTileData(activeChart: ActiveVaccinationChart, text: SiteText['pages' } interface VaccinationsOverTimeTileProps { - coverageData?: NlVaccineCoverage; + coverageData?: ArchivedNlVaccineCoverage; administrationData: AdministrationData; vaccineAdministeredPlannedLastValue: NlVaccineAdministeredPlannedValue; timelineEvents: Partial<Record<ActiveVaccinationChart, TimelineEventConfig[]>>; diff --git a/packages/app/src/domain/vaccine/vaccine-coverage-per-age-group/vaccine-coverage-per-age-group.tsx b/packages/app/src/domain/vaccine/vaccine-coverage-per-age-group/vaccine-coverage-per-age-group.tsx index d8c2486465..98b451770b 100644 --- a/packages/app/src/domain/vaccine/vaccine-coverage-per-age-group/vaccine-coverage-per-age-group.tsx +++ b/packages/app/src/domain/vaccine/vaccine-coverage-per-age-group/vaccine-coverage-per-age-group.tsx @@ -1,4 +1,4 @@ -import { GmVaccineCoveragePerAgeGroupArchivedValue, NlVaccineCoveragePerAgeGroupArchivedValue } from '@corona-dashboard/common'; +import { ArchivedGmVaccineCoveragePerAgeGroupValue, ArchivedNlVaccineCoveragePerAgeGroupValue } from '@corona-dashboard/common'; import { AgeGroup } from '~/components/age-groups/age-group'; import { ChartTile } from '~/components/chart-tile'; import { MetadataProps } from '~/components/metadata'; @@ -16,7 +16,7 @@ interface VaccineCoveragePerAgeGroupProps { description: string; metadata: MetadataProps; sortingOrder: string[]; - values: NlVaccineCoveragePerAgeGroupArchivedValue[] | GmVaccineCoveragePerAgeGroupArchivedValue[]; + values: ArchivedNlVaccineCoveragePerAgeGroupValue[] | ArchivedGmVaccineCoveragePerAgeGroupValue[]; text: SiteText['pages']['vaccinations_page']['nl']; } 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 09bcd7a63c..c09c2d6450 100644 --- a/packages/app/src/domain/vaccine/vaccine-delivery-bar-chart.tsx +++ b/packages/app/src/domain/vaccine/vaccine-delivery-bar-chart.tsx @@ -1,4 +1,4 @@ -import { colors, NlVaccineDeliveryPerSupplier, NlVaccineDeliveryPerSupplierValue } from '@corona-dashboard/common'; +import { colors, ArchivedNlVaccineDeliveryPerSupplier, ArchivedNlVaccineDeliveryPerSupplierValue } from '@corona-dashboard/common'; import { isDefined } from 'ts-is-present'; import { Box } from '~/components/base'; import { ChartTile } from '~/components/chart-tile'; @@ -10,14 +10,14 @@ import { useIntl } from '~/intl'; import { SiteText } from '~/locale'; import { space } from '~/style/theme'; -export function VaccineDeliveryBarChart({ data, text }: { data: NlVaccineDeliveryPerSupplier; text: SiteText['pages']['vaccinations_page']['nl'] }) { +export function VaccineDeliveryBarChart({ data, text }: { data: ArchivedNlVaccineDeliveryPerSupplier; text: SiteText['pages']['vaccinations_page']['nl'] }) { const { commonTexts } = useIntl(); data.values = data.values.filter((x) => !x.is_estimate); const productNames = text.data.vaccination_chart.product_names; - const formatTooltip: TooltipFormatter<NlVaccineDeliveryPerSupplierValue & StackedBarTooltipData> = ( - context: TooltipData<NlVaccineDeliveryPerSupplierValue & StackedBarTooltipData> + const formatTooltip: TooltipFormatter<ArchivedNlVaccineDeliveryPerSupplierValue & StackedBarTooltipData> = ( + context: TooltipData<ArchivedNlVaccineDeliveryPerSupplierValue & StackedBarTooltipData> ) => { return <TooltipSeriesList data={context} />; }; 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 cc85994c54..d040bf0598 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 @@ -1,4 +1,4 @@ -import { colors, getValuesInTimeframe, NlVaccineStockValue, TimeframeOption } from '@corona-dashboard/common'; +import { colors, getValuesInTimeframe, ArchivedNlVaccineStockValue, TimeframeOption } from '@corona-dashboard/common'; import { pick } from 'lodash'; import { useMemo, useState } from 'react'; import { isPresent } from 'ts-is-present'; @@ -12,7 +12,7 @@ import { useCurrentDate } from '~/utils/current-date-context'; import { replaceVariablesInText } from '~/utils/replace-variables-in-text'; interface VaccineStockPerSupplierChartProps { - values: NlVaccineStockValue[]; + values: ArchivedNlVaccineStockValue[]; text: SiteText['pages']['vaccinations_page']['nl']; } @@ -60,10 +60,10 @@ export function VaccineStockPerSupplierChart({ values, text }: VaccineStockPerSu const selectedConfig = optionsConfig.find((x) => x.metricProperty === selected) ?? optionsConfig[0]; - const seriesConfig: SeriesConfig<NlVaccineStockValue> = [ + const seriesConfig: SeriesConfig<ArchivedNlVaccineStockValue> = [ { type: 'area', - metricProperty: `${selected}_available` as keyof NlVaccineStockValue, + metricProperty: `${selected}_available` as keyof ArchivedNlVaccineStockValue, label: replaceVariablesInText(text.stock_per_supplier_chart.legend.available, { vaccineName: selectedConfig.label, }), @@ -73,7 +73,7 @@ export function VaccineStockPerSupplierChart({ values, text }: VaccineStockPerSu }, { type: 'line', - metricProperty: `${selected}_total` as keyof NlVaccineStockValue, + metricProperty: `${selected}_total` as keyof ArchivedNlVaccineStockValue, label: replaceVariablesInText(text.stock_per_supplier_chart.legend.total, { vaccineName: selectedConfig.label, }), @@ -111,7 +111,7 @@ export function VaccineStockPerSupplierChart({ values, text }: VaccineStockPerSu ); } -function getMaximumPropertyValueInTimeframe(values: NlVaccineStockValue[], timeframe: TimeframeOption, today: Date) { +function getMaximumPropertyValueInTimeframe(values: ArchivedNlVaccineStockValue[], timeframe: TimeframeOption, today: Date) { const valuesInTimeframe = getValuesInTimeframe(values, timeframe, today); return valuesInTimeframe.reduce( diff --git a/packages/app/src/pages/landelijk/positieve-testen.tsx b/packages/app/src/pages/landelijk/positieve-testen.tsx index daba6c8d34..c3f2876e16 100644 --- a/packages/app/src/pages/landelijk/positieve-testen.tsx +++ b/packages/app/src/pages/landelijk/positieve-testen.tsx @@ -1,4 +1,4 @@ -import { colors, NlTestedOverallValue, TimeframeOption, TimeframeOptionsList } from '@corona-dashboard/common'; +import { colors, ArchivedNlTestedOverallValue, TimeframeOption, TimeframeOptionsList } from '@corona-dashboard/common'; import { GgdTesten } from '@corona-dashboard/icons'; import { GetStaticPropsContext } from 'next'; import { useState } from 'react'; @@ -178,7 +178,7 @@ function PositivelyTestedPeople(props: StaticProps<typeof getStaticProps>) { outOfBoundsConfig: { label: textNl.labels.infected_out_of_bounds, tooltipLabel: textNl.tooltip_labels.annotations, - checkIsOutofBounds: (x: NlTestedOverallValue, max: number) => x.infected > max, + checkIsOutofBounds: (x: ArchivedNlTestedOverallValue, max: number) => x.infected > max, }, timelineEvents: getTimelineEvents(content.elements.timeSeries, 'tested_overall_archived_20230331'), }} diff --git a/packages/app/src/pages/landelijk/vaccinaties.tsx b/packages/app/src/pages/landelijk/vaccinaties.tsx index edf23e10d9..824560a24e 100644 --- a/packages/app/src/pages/landelijk/vaccinaties.tsx +++ b/packages/app/src/pages/landelijk/vaccinaties.tsx @@ -82,8 +82,7 @@ export const getStaticProps = createGetStaticProps( 'vaccine_coverage_per_age_group', 'vaccine_coverage_per_age_group_estimated_fully_vaccinated', 'vaccine_coverage_per_age_group_estimated_autumn_2022', - 'vaccine_campaigns', - 'repeating_shot_administered' + 'vaccine_campaigns' ), selectArchivedNlData( 'vaccine_coverage_per_age_group_archived_20220908', diff --git a/packages/common/src/types/data.ts b/packages/common/src/types/data.ts index 5c81e342de..74d4a0a397 100644 --- a/packages/common/src/types/data.ts +++ b/packages/common/src/types/data.ts @@ -7,19 +7,19 @@ export type ArchivedGmCode = string; export interface ArchivedGm { - difference: GmDifference; - deceased_rivm_archived_20221231: GmDeceasedRivm; + difference: ArchivedGmDifference; + deceased_rivm_archived_20221231: ArchivedGmDeceasedRivm; last_generated: string; proto_name: ArchivedGmCode; name: ArchivedGmCode; code: ArchivedGmCode; - vaccine_coverage_per_age_group_archived_20220622: GmVaccineCoveragePerAgeGroupArchived_20220622; - vaccine_coverage_per_age_group_archived_20220908: GmVaccineCoveragePerAgeGroupWithBoosterShot; - booster_coverage_archived_20220904: GmBoosterCoverage; - sewer_archived_20230623: GmSewer; - tested_overall_archived_20230331: GmTestedOverall; + vaccine_coverage_per_age_group_archived_20220622: ArchivedGmVaccineCoveragePerAgeGroup; + vaccine_coverage_per_age_group_archived_20220908: ArchivedGmVaccineCoveragePerAgeGroupWithBoosterShot; + booster_coverage_archived_20220904: ArchivedGmBoosterCoverage; + sewer_archived_20230623: ArchivedGmSewer; + tested_overall_archived_20230331: ArchivedGmTestedOverall; } -export interface GmDifference { +export interface ArchivedGmDifference { tested_overall__infected_moving_average_archived_20230331: DifferenceDecimal; tested_overall__infected_per_100k_moving_average_archived_20230331: DifferenceDecimal; deceased_rivm__covid_daily_archived_20221231: DifferenceInteger; @@ -37,21 +37,21 @@ export interface DifferenceInteger { old_date_unix: number; new_date_unix: number; } -export interface GmDeceasedRivm { - values: GmDeceasedRivmArchived_20221231Value[]; - last_value: GmDeceasedRivmArchived_20221231Value; +export interface ArchivedGmDeceasedRivm { + values: ArchivedGmDeceasedRivmValue[]; + last_value: ArchivedGmDeceasedRivmValue; } -export interface GmDeceasedRivmArchived_20221231Value { +export interface ArchivedGmDeceasedRivmValue { covid_daily: number; covid_daily_moving_average: number | null; covid_total: number; date_unix: number; date_of_insertion_unix: number; } -export interface GmVaccineCoveragePerAgeGroupArchived_20220622 { - values: GmVaccineCoveragePerAgeGroupArchivedValue[]; +export interface ArchivedGmVaccineCoveragePerAgeGroup { + values: ArchivedGmVaccineCoveragePerAgeGroupValue[]; } -export interface GmVaccineCoveragePerAgeGroupArchivedValue { +export interface ArchivedGmVaccineCoveragePerAgeGroupValue { age_group_range: '12+' | '18+'; fully_vaccinated_percentage: number | null; has_one_shot_percentage: number | null; @@ -61,10 +61,10 @@ export interface GmVaccineCoveragePerAgeGroupArchivedValue { date_unix: number; date_of_insertion_unix: number; } -export interface GmVaccineCoveragePerAgeGroupWithBoosterShot { - values: GmVaccineCoveragePerAgeGroupArchived_20220908Value[]; +export interface ArchivedGmVaccineCoveragePerAgeGroupWithBoosterShot { + values: ArchivedGmVaccineCoveragePerAgeGroupWithBoosterShotValue[]; } -export interface GmVaccineCoveragePerAgeGroupArchived_20220908Value { +export interface ArchivedGmVaccineCoveragePerAgeGroupWithBoosterShotValue { age_group_range: '12+' | '18+'; fully_vaccinated_percentage: number | null; booster_shot_percentage: number | null; @@ -76,21 +76,21 @@ export interface GmVaccineCoveragePerAgeGroupArchived_20220908Value { date_unix: number; date_of_insertion_unix: number; } -export interface GmBoosterCoverage { - values: GmBoosterCoverageArchived_20220904Value[]; +export interface ArchivedGmBoosterCoverage { + values: ArchivedGmBoosterCoverageValue[]; } -export interface GmBoosterCoverageArchived_20220904Value { +export interface ArchivedGmBoosterCoverageValue { age_group?: '12+' | '18+'; percentage: number; percentage_label: string | null; date_unix: number; date_of_insertion_unix: number; } -export interface GmSewer { - values: GmSewerValue[]; - last_value: GmSewerValue; +export interface ArchivedGmSewer { + values: ArchivedGmSewerValue[]; + last_value: ArchivedGmSewerValue; } -export interface GmSewerValue { +export interface ArchivedGmSewerValue { date_start_unix: number; date_end_unix: number; average: number; @@ -100,11 +100,11 @@ export interface GmSewerValue { date_of_insertion_unix: number; data_is_outdated: boolean; } -export interface GmTestedOverall { - values: GmTestedOverallValue[]; - last_value: GmTestedOverallValue; +export interface ArchivedGmTestedOverall { + values: ArchivedGmTestedOverallValue[]; + last_value: ArchivedGmTestedOverallValue; } -export interface GmTestedOverallValue { +export interface ArchivedGmTestedOverallValue { date_unix: number; infected: number; infected_moving_average: number | null; @@ -122,8 +122,8 @@ export interface ArchivedGmCollection { name: ArchivedGmCollectionId; code: ArchivedGmCollectionId; hospital_nice_choropleth_archived_20230830: ArchivedGmCollectionHospitalNiceChoropleth[]; - sewer_archived_20230623: GmCollectionSewer[]; - tested_overall_archived_20230331: GmCollectionTestedOverall[]; + sewer_archived_20230623: ArchivedGmCollectionSewer[]; + tested_overall_archived_20230331: ArchivedGmCollectionTestedOverall[]; } export interface ArchivedGmCollectionHospitalNiceChoropleth { date_unix: number; @@ -133,7 +133,7 @@ export interface ArchivedGmCollectionHospitalNiceChoropleth { admissions_on_date_of_reporting: number; date_of_insertion_unix: number; } -export interface GmCollectionSewer { +export interface ArchivedGmCollectionSewer { date_start_unix: number; date_end_unix: number; gmcode: string; @@ -142,7 +142,7 @@ export interface GmCollectionSewer { date_of_insertion_unix: number; data_is_outdated: boolean; } -export interface GmCollectionTestedOverall { +export interface ArchivedGmCollectionTestedOverall { date_unix: number; gmcode: string; infected_per_100k: number; @@ -157,41 +157,41 @@ export interface ArchivedNl { proto_name: ArchivedNlId; name: ArchivedNlId; code: ArchivedNlId; - difference: NlDifference; - behavior_archived_20230411: NlBehavior; - behavior_annotations_archived_20230412: NlBehaviorAnnotations; - behavior_per_age_group_archived_20230411: NlBehaviorPerAgeGroup; - booster_shot_administered_archived_20220904: NlBoosterShotAdministered; - booster_coverage_archived_20220904: NlBoosterCoverage; - deceased_rivm_archived_20221231: NlDeceasedRivm; - deceased_rivm_per_age_group_archived_20221231: NlDeceasedRivmPerAgeGroup; - doctor_archived_20210903: NlDoctor; - disability_care_archived_20230126: NlDisabilityCare; - elderly_at_home_archived_20230126: NlElderlyAtHome; - g_number_archived_20220607: NlGNumber; - nursing_home_archived_20230126: NlNursingHome; - tested_ggd_archived_20230321: NlTestedGgd; - tested_overall_archived_20230331: NlTestedOverall; - tested_per_age_group_archived_20230331: NlTestedPerAgeGroup; - sewer_archived_20230623: NlSewer; - vaccine_campaigns_archived_20220908: NlVaccineCampaignsArchived_20220908; - vaccine_planned_archived_20220908: NlVaccinePlanned; - vaccine_coverage_per_age_group_archived_20220622: NlVaccineCoveragePerAgeGroupArchived_20220622; - vaccine_coverage_per_age_group_archived_20220908: NlVaccineCoveragePerAgeGroupWithBoosterShot; + difference: ArchivedNlDifference; + behavior_archived_20230411: ArchivedNlBehavior; + behavior_annotations_archived_20230412: ArchivedNlBehaviorAnnotations; + behavior_per_age_group_archived_20230411: ArchivedNlBehaviorPerAgeGroup; + booster_shot_administered_archived_20220904: ArchivedNlBoosterShotAdministered; + booster_coverage_archived_20220904: ArchivedNlBoosterCoverage; + deceased_rivm_archived_20221231: ArchivedNlDeceasedRivm; + deceased_rivm_per_age_group_archived_20221231: ArchivedNlDeceasedRivmPerAgeGroup; + doctor_archived_20210903: ArchivedNlDoctor; + disability_care_archived_20230126: ArchivedNlDisabilityCare; + elderly_at_home_archived_20230126: ArchivedNlElderlyAtHome; + g_number_archived_20220607: ArchivedNlGNumber; + nursing_home_archived_20230126: ArchivedNlNursingHome; + tested_ggd_archived_20230321: ArchivedNlTestedGgd; + tested_overall_archived_20230331: ArchivedNlTestedOverall; + tested_per_age_group_archived_20230331: ArchivedNlTestedPerAgeGroup; + sewer_archived_20230623: ArchivedNlSewer; + vaccine_campaigns_archived_20220908: ArchivedNlVaccineCampaigns; + vaccine_planned_archived_20220908: ArchivedNlVaccinePlanned; + vaccine_coverage_per_age_group_archived_20220622: ArchivedNlVaccineCoveragePerAgeGroup; + vaccine_coverage_per_age_group_archived_20220908: ArchivedNlVaccineCoveragePerAgeGroupWithBoosterShot; vaccine_coverage_per_age_group_estimated_archived_20220908: NlVaccineCoveragePerAgeGroupEstimatedArchived_20220908Value; - vulnerable_nursing_home_archived_20230711: NlVulnerableNursingHome; - vulnerable_hospital_admissions_archived_20230711: NlVulnerableHospitalAdmissions; - reproduction_archived_20230711: NlReproduction; - vaccine_vaccinated_or_support_archived_20230411: NlVaccineVaccinatedOrSupport; - vaccine_coverage_archived_20220518: NlVaccineCoverage; - vaccine_delivery_per_supplier_archived_20211101: NlVaccineDeliveryPerSupplier; - vaccine_stock_archived_20211024: NlVaccineStock; - repeating_shot_administered_20220713: NlRepeatingShotAdministered; - corona_melder_app_warning_archived_20220421: NlCoronaMelderAppWarning; - corona_melder_app_download_archived_20220421: NlCoronaMelderAppDownload; - infectious_people_archived_20210709: NlInfectiousPeople; -} -export interface NlDifference { + vulnerable_nursing_home_archived_20230711: ArchivedNlVulnerableNursingHome; + vulnerable_hospital_admissions_archived_20230711: ArchivedNlVulnerableHospitalAdmissions; + reproduction_archived_20230711: ArchivedNlReproduction; + vaccine_vaccinated_or_support_archived_20230411: ArchivedNlVaccineVaccinatedOrSupport; + vaccine_coverage_archived_20220518: ArchivedNlVaccineCoverage; + vaccine_delivery_per_supplier_archived_20211101: ArchivedNlVaccineDeliveryPerSupplier; + vaccine_stock_archived_20211024: ArchivedNlVaccineStock; + repeating_shot_administered_20220713: ArchivedNlRepeatingShotAdministered; + corona_melder_app_warning_archived_20220421: ArchivedNlCoronaMelderAppWarning; + corona_melder_app_download_archived_20220421: ArchivedNlCoronaMelderAppDownload; + infectious_people_archived_20210709: ArchivedNlInfectiousPeople; +} +export interface ArchivedNlDifference { deceased_rivm__covid_daily_archived_20221231: DifferenceInteger; nursing_home__deceased_daily_archived_20230126: DifferenceInteger; nursing_home__newly_infected_people_archived_20230126: DifferenceInteger; @@ -215,11 +215,11 @@ export interface DifferenceDecimal { old_date_unix: number; new_date_unix: number; } -export interface NlBehavior { - values: NlBehaviorValue[]; - last_value: NlBehaviorValue; +export interface ArchivedNlBehavior { + values: ArchivedNlBehaviorValue[]; + last_value: ArchivedNlBehaviorValue; } -export interface NlBehaviorValue { +export interface ArchivedNlBehaviorValue { number_of_participants: number; curfew_compliance?: number | null; curfew_compliance_trend: ('up' | 'down' | 'equal') | null; @@ -281,10 +281,10 @@ export interface NlBehaviorValue { date_end_unix: number; date_of_insertion_unix: number; } -export interface NlBehaviorAnnotations { - values: NlBehaviorAnnotations1[]; +export interface ArchivedNlBehaviorAnnotations { + values: NlBehaviorAnnotations[]; } -export interface NlBehaviorAnnotations1 { +export interface NlBehaviorAnnotations { behavior_indicator: | 'wash_hands' | 'curfew' @@ -308,89 +308,89 @@ export interface NlBehaviorAnnotations1 { date_end_unix: number; date_of_insertion_unix: number; } -export interface NlBehaviorPerAgeGroup { - keep_distance_compliance?: NlBehaviorPerAgeGroupValue; - keep_distance_support?: NlBehaviorPerAgeGroupValue; - sneeze_cough_elbow_compliance?: NlBehaviorPerAgeGroupValue; - sneeze_cough_elbow_support?: NlBehaviorPerAgeGroupValue; - wash_hands_compliance?: NlBehaviorPerAgeGroupValue; - wash_hands_support?: NlBehaviorPerAgeGroupValue; - work_from_home_compliance?: NlBehaviorPerAgeGroupValue; - work_from_home_support?: NlBehaviorPerAgeGroupValue; - ventilate_home_compliance?: NlBehaviorPerAgeGroupValue; - ventilate_home_support?: NlBehaviorPerAgeGroupValue; - selftest_visit_compliance?: NlBehaviorPerAgeGroupValue; - selftest_visit_support?: NlBehaviorPerAgeGroupValue; - posttest_isolation_compliance?: NlBehaviorPerAgeGroupValue; - posttest_isolation_support?: NlBehaviorPerAgeGroupValue; +export interface ArchivedNlBehaviorPerAgeGroup { + keep_distance_compliance?: ArchivedNlBehaviorPerAgeGroupValue; + keep_distance_support?: ArchivedNlBehaviorPerAgeGroupValue; + sneeze_cough_elbow_compliance?: ArchivedNlBehaviorPerAgeGroupValue; + sneeze_cough_elbow_support?: ArchivedNlBehaviorPerAgeGroupValue; + wash_hands_compliance?: ArchivedNlBehaviorPerAgeGroupValue; + wash_hands_support?: ArchivedNlBehaviorPerAgeGroupValue; + work_from_home_compliance?: ArchivedNlBehaviorPerAgeGroupValue; + work_from_home_support?: ArchivedNlBehaviorPerAgeGroupValue; + ventilate_home_compliance?: ArchivedNlBehaviorPerAgeGroupValue; + ventilate_home_support?: ArchivedNlBehaviorPerAgeGroupValue; + selftest_visit_compliance?: ArchivedNlBehaviorPerAgeGroupValue; + selftest_visit_support?: ArchivedNlBehaviorPerAgeGroupValue; + posttest_isolation_compliance?: ArchivedNlBehaviorPerAgeGroupValue; + posttest_isolation_support?: ArchivedNlBehaviorPerAgeGroupValue; date_of_insertion_unix: number; date_start_unix: number; date_end_unix: number; } -export interface NlBehaviorPerAgeGroupValue { +export interface ArchivedNlBehaviorPerAgeGroupValue { '16_24': number | null; '25_39': number | null; '40_54': number | null; '55_69': number | null; '70_plus': number | null; } -export interface NlBoosterShotAdministered { - values: NlBoosterShotAdministeredArchived_20220904Value[]; - last_value: NlBoosterShotAdministeredArchived_20220904Value; +export interface ArchivedNlBoosterShotAdministered { + values: ArchivedNlBoosterShotAdministeredValue[]; + last_value: ArchivedNlBoosterShotAdministeredValue; } -export interface NlBoosterShotAdministeredArchived_20220904Value { +export interface ArchivedNlBoosterShotAdministeredValue { administered_total: number; ggd_administered_total: number; others_administered_total: number; date_unix: number; date_of_insertion_unix: number; } -export interface NlBoosterCoverage { - values: NlBoosterCoverageArchived_20220904Value[]; +export interface ArchivedNlBoosterCoverage { + values: ArchivedNlBoosterCoverageValue[]; } -export interface NlBoosterCoverageArchived_20220904Value { +export interface ArchivedNlBoosterCoverageValue { age_group?: '12+' | '18+'; percentage: number; date_unix: number; date_of_insertion_unix: number; } -export interface NlDeceasedRivm { - values: NlDeceasedRivmArchived_20221231Value[]; - last_value: NlDeceasedRivmArchived_20221231Value; +export interface ArchivedNlDeceasedRivm { + values: ArchivedNlDeceasedRivmValue[]; + last_value: ArchivedNlDeceasedRivmValue; } -export interface NlDeceasedRivmArchived_20221231Value { +export interface ArchivedNlDeceasedRivmValue { covid_daily: number; covid_daily_moving_average: number | null; covid_total: number; date_unix: number; date_of_insertion_unix: number; } -export interface NlDeceasedRivmPerAgeGroup { - values: NlDeceasedRivmPerAgeGroupArchived_20221231Value[]; +export interface ArchivedNlDeceasedRivmPerAgeGroup { + values: ArchivedNlDeceasedRivmPerAgeGroupValue[]; } -export interface NlDeceasedRivmPerAgeGroupArchived_20221231Value { +export interface ArchivedNlDeceasedRivmPerAgeGroupValue { age_group_range: string; age_group_percentage: number; covid_percentage: number; date_unix?: number; date_of_insertion_unix: number; } -export interface NlDoctor { - values: NlDoctorValue[]; - last_value: NlDoctorValue; +export interface ArchivedNlDoctor { + values: ArchivedNlDoctorValue[]; + last_value: ArchivedNlDoctorValue; } -export interface NlDoctorValue { +export interface ArchivedNlDoctorValue { date_start_unix: number; date_end_unix: number; covid_symptoms_per_100k: number; covid_symptoms: number; date_of_insertion_unix: number; } -export interface NlDisabilityCare { - values: NlDisabilityCareArchived_20230126Value[]; - last_value: NlDisabilityCareArchived_20230126Value; +export interface ArchivedNlDisabilityCare { + values: ArchivedNlDisabilityCareValue[]; + last_value: ArchivedNlDisabilityCareValue; } -export interface NlDisabilityCareArchived_20230126Value { +export interface ArchivedNlDisabilityCareValue { newly_infected_people: number; newly_infected_people_moving_average: number | null; deceased_daily: number; @@ -401,11 +401,11 @@ export interface NlDisabilityCareArchived_20230126Value { date_unix: number; date_of_insertion_unix: number; } -export interface NlElderlyAtHome { - values: NlElderlyAtHomeArchived_20230126Value[]; - last_value: NlElderlyAtHomeArchived_20230126Value; +export interface ArchivedNlElderlyAtHome { + values: ArchivedNlElderlyAtHomeValue[]; + last_value: ArchivedNlElderlyAtHomeValue; } -export interface NlElderlyAtHomeArchived_20230126Value { +export interface ArchivedNlElderlyAtHomeValue { positive_tested_daily: number; positive_tested_daily_moving_average: number | null; positive_tested_daily_per_100k: number; @@ -414,20 +414,20 @@ export interface NlElderlyAtHomeArchived_20230126Value { date_unix: number; date_of_insertion_unix: number; } -export interface NlGNumber { - values: NlGNumberValue[]; - last_value: NlGNumberValue; +export interface ArchivedNlGNumber { + values: ArchivedNlGNumberValue[]; + last_value: ArchivedNlGNumberValue; } -export interface NlGNumberValue { +export interface ArchivedNlGNumberValue { g_number: number; date_unix: number; date_of_insertion_unix: number; } -export interface NlNursingHome { - values: NlNursingHomeArchived_20230126Value[]; - last_value: NlNursingHomeArchived_20230126Value; +export interface ArchivedNlNursingHome { + values: ArchivedNlNursingHomeValue[]; + last_value: ArchivedNlNursingHomeValue; } -export interface NlNursingHomeArchived_20230126Value { +export interface ArchivedNlNursingHomeValue { newly_infected_people: number; newly_infected_people_moving_average: number | null; deceased_daily: number; @@ -438,11 +438,11 @@ export interface NlNursingHomeArchived_20230126Value { date_unix: number; date_of_insertion_unix: number; } -export interface NlTestedGgd { - values: NlTestedGgdValue[]; - last_value: NlTestedGgdValue; +export interface ArchivedNlTestedGgd { + values: ArchivedNlTestedGgdValue[]; + last_value: ArchivedNlTestedGgdValue; } -export interface NlTestedGgdValue { +export interface ArchivedNlTestedGgdValue { infected: number; infected_moving_average: number | null; infected_percentage: number; @@ -453,11 +453,11 @@ export interface NlTestedGgdValue { date_unix: number; date_of_insertion_unix: number; } -export interface NlTestedOverall { - values: NlTestedOverallValue[]; - last_value: NlTestedOverallValue; +export interface ArchivedNlTestedOverall { + values: ArchivedNlTestedOverallValue[]; + last_value: ArchivedNlTestedOverallValue; } -export interface NlTestedOverallValue { +export interface ArchivedNlTestedOverallValue { infected: number; infected_moving_average: number | null; infected_moving_average_rounded: number | null; @@ -466,11 +466,11 @@ export interface NlTestedOverallValue { date_unix: number; date_of_insertion_unix: number; } -export interface NlTestedPerAgeGroup { - values: NlTestedPerAgeGroupValue[]; - last_value: NlTestedPerAgeGroupValue; +export interface ArchivedNlTestedPerAgeGroup { + values: ArchivedNlTestedPerAgeGroupValue[]; + last_value: ArchivedNlTestedPerAgeGroupValue; } -export interface NlTestedPerAgeGroupValue { +export interface ArchivedNlTestedPerAgeGroupValue { infected_age_0_9_per_100k: number; infected_age_10_19_per_100k: number; infected_age_20_29_per_100k: number; @@ -485,40 +485,40 @@ export interface NlTestedPerAgeGroupValue { date_unix: number; date_of_insertion_unix: number; } -export interface NlSewer { - values: NlSewerValue[]; - last_value: NlSewerValue; +export interface ArchivedNlSewer { + values: ArchivedNlSewerValue[]; + last_value: ArchivedNlSewerValue; } -export interface NlSewerValue { +export interface ArchivedNlSewerValue { average: number | null; date_of_insertion_unix: number; date_unix: number; } -export interface NlVaccineCampaignsArchived_20220908 { - vaccine_campaigns: NlVaccineCampaigns[]; +export interface ArchivedNlVaccineCampaigns { + vaccine_campaigns: ArchivedNlVaccineCampaigns1[]; date_unix: number; date_start_unix: number; date_end_unix: number; date_of_insertion_unix: number; } -export interface NlVaccineCampaigns { +export interface ArchivedNlVaccineCampaigns1 { vaccine_campaign_order: number; vaccine_campaign_name_nl: string; vaccine_campaign_name_en: string; vaccine_administered_total: number; vaccine_administered_last_week: number; } -export interface NlVaccinePlanned { +export interface ArchivedNlVaccinePlanned { doses: number; date_unix: number; date_start_unix: number; date_end_unix: number; date_of_insertion_unix: number; } -export interface NlVaccineCoveragePerAgeGroupArchived_20220622 { - values: NlVaccineCoveragePerAgeGroupArchivedValue[]; +export interface ArchivedNlVaccineCoveragePerAgeGroup { + values: ArchivedNlVaccineCoveragePerAgeGroupValue[]; } -export interface NlVaccineCoveragePerAgeGroupArchivedValue { +export interface ArchivedNlVaccineCoveragePerAgeGroupValue { age_group_range: '5-11' | '12-17' | '18-30' | '31-40' | '41-50' | '51-60' | '61-70' | '71-80' | '81+'; age_group_percentage: number; age_group_total: number; @@ -531,10 +531,10 @@ export interface NlVaccineCoveragePerAgeGroupArchivedValue { date_of_report_unix: number; birthyear_range: string; } -export interface NlVaccineCoveragePerAgeGroupWithBoosterShot { - values: NlVaccineCoveragePerAgeGroupArchived_20220908Value[]; +export interface ArchivedNlVaccineCoveragePerAgeGroupWithBoosterShot { + values: ArchivedNlVaccineCoveragePerAgeGroupWithBoosterShotValue[]; } -export interface NlVaccineCoveragePerAgeGroupArchived_20220908Value { +export interface ArchivedNlVaccineCoveragePerAgeGroupWithBoosterShotValue { age_group_range: '5-11' | '12-17' | '18-29' | '30-39' | '40-49' | '50-59' | '60-69' | '70-79' | '80+'; age_group_percentage: number; age_group_total: number; @@ -550,10 +550,10 @@ export interface NlVaccineCoveragePerAgeGroupArchived_20220908Value { birthyear_range: string; } export interface NlVaccineCoveragePerAgeGroupEstimatedArchived_20220908Value { - values: NlVaccineCoveragePerAgeGroupEstimated[]; - last_value: NlVaccineCoveragePerAgeGroupEstimated; + values: ArchivedNlVaccineCoveragePerAgeGroupEstimated[]; + last_value: ArchivedNlVaccineCoveragePerAgeGroupEstimated; } -export interface NlVaccineCoveragePerAgeGroupEstimated { +export interface ArchivedNlVaccineCoveragePerAgeGroupEstimated { age_18_plus_fully_vaccinated: number; age_18_plus_has_one_shot: number; age_18_plus_birthyear: string; @@ -563,39 +563,39 @@ export interface NlVaccineCoveragePerAgeGroupEstimated { date_unix: number; date_of_insertion_unix: number; } -export interface NlVulnerableNursingHome { - values: NlVulnerableNursingHomeValue[]; - last_value: NlVulnerableNursingHomeValue; +export interface ArchivedNlVulnerableNursingHome { + values: ArchivedNlVulnerableNursingHomeValue[]; + last_value: ArchivedNlVulnerableNursingHomeValue; } -export interface NlVulnerableNursingHomeValue { +export interface ArchivedNlVulnerableNursingHomeValue { newly_infected_locations: number; infected_locations_total: number; infected_locations_percentage: number; date_unix: number; date_of_insertion_unix: number; } -export interface NlVulnerableHospitalAdmissions { +export interface ArchivedNlVulnerableHospitalAdmissions { admissions_age_70_plus: number; date_start_unix: number; date_end_unix: number; date_of_insertion_unix: number; } -export interface NlReproduction { - values: NlReproductionValue[]; - last_value: NlReproductionValue; +export interface ArchivedNlReproduction { + values: ArchivedNlReproductionValue[]; + last_value: ArchivedNlReproductionValue; } -export interface NlReproductionValue { +export interface ArchivedNlReproductionValue { index_low: number | null; index_average: number | null; index_high: number | null; date_unix: number; date_of_insertion_unix: number; } -export interface NlVaccineVaccinatedOrSupport { - values: NlVaccineVaccinatedOrSupportValue[]; - last_value: NlVaccineVaccinatedOrSupportValue; +export interface ArchivedNlVaccineVaccinatedOrSupport { + values: ArchivedNlVaccineVaccinatedOrSupportValue[]; + last_value: ArchivedNlVaccineVaccinatedOrSupportValue; } -export interface NlVaccineVaccinatedOrSupportValue { +export interface ArchivedNlVaccineVaccinatedOrSupportValue { percentage_average: number; percentage_70_plus: number | null; percentage_55_69: number | null; @@ -606,11 +606,11 @@ export interface NlVaccineVaccinatedOrSupportValue { date_end_unix: number; date_of_insertion_unix: number; } -export interface NlVaccineCoverage { - values: NlVaccineCoverageValue[]; - last_value: NlVaccineCoverageValue; +export interface ArchivedNlVaccineCoverage { + values: ArchivedNlVaccineCoverageValue[]; + last_value: ArchivedNlVaccineCoverageValue; } -export interface NlVaccineCoverageValue { +export interface ArchivedNlVaccineCoverageValue { booster_vaccinated: number; partially_vaccinated: number; fully_vaccinated: number; @@ -620,11 +620,11 @@ export interface NlVaccineCoverageValue { date_unix: number; date_of_insertion_unix: number; } -export interface NlVaccineDeliveryPerSupplier { - values: NlVaccineDeliveryPerSupplierValue[]; - last_value: NlVaccineDeliveryPerSupplierValue; +export interface ArchivedNlVaccineDeliveryPerSupplier { + values: ArchivedNlVaccineDeliveryPerSupplierValue[]; + last_value: ArchivedNlVaccineDeliveryPerSupplierValue; } -export interface NlVaccineDeliveryPerSupplierValue { +export interface ArchivedNlVaccineDeliveryPerSupplierValue { total: number; bio_n_tech_pfizer: number; moderna: number; @@ -639,11 +639,11 @@ export interface NlVaccineDeliveryPerSupplierValue { date_end_unix: number; date_of_report_unix: number; } -export interface NlVaccineStock { - values: NlVaccineStockValue[]; - last_value: NlVaccineStockValue; +export interface ArchivedNlVaccineStock { + values: ArchivedNlVaccineStockValue[]; + last_value: ArchivedNlVaccineStockValue; } -export interface NlVaccineStockValue { +export interface ArchivedNlVaccineStockValue { total_available: number | null; total_not_available: number | null; bio_n_tech_pfizer_available: number | null; @@ -661,38 +661,38 @@ export interface NlVaccineStockValue { date_of_insertion_unix: number; date_unix: number; } -export interface NlRepeatingShotAdministered { - values: NlRepeatingShotAdministeredValue[]; - last_value: NlRepeatingShotAdministeredValue; +export interface ArchivedNlRepeatingShotAdministered { + values: ArchivedNlRepeatingShotAdministeredValue[]; + last_value: ArchivedNlRepeatingShotAdministeredValue; } -export interface NlRepeatingShotAdministeredValue { +export interface ArchivedNlRepeatingShotAdministeredValue { ggd_administered_total: number; date_unix: number; date_of_insertion_unix: number; } -export interface NlCoronaMelderAppWarning { - values: NlCoronaMelderAppWarningValue[]; - last_value: NlCoronaMelderAppWarningValue; +export interface ArchivedNlCoronaMelderAppWarning { + values: ArchivedNlCoronaMelderAppWarningValue[]; + last_value: ArchivedNlCoronaMelderAppWarningValue; } -export interface NlCoronaMelderAppWarningValue { +export interface ArchivedNlCoronaMelderAppWarningValue { count: number; date_unix: number; date_of_insertion_unix: number; } -export interface NlCoronaMelderAppDownload { - values: NlCoronaMelderAppDownloadValue[]; - last_value: NlCoronaMelderAppDownloadValue; +export interface ArchivedNlCoronaMelderAppDownload { + values: ArchivedNlCoronaMelderAppDownloadValue[]; + last_value: ArchivedNlCoronaMelderAppDownloadValue; } -export interface NlCoronaMelderAppDownloadValue { +export interface ArchivedNlCoronaMelderAppDownloadValue { count: number; date_unix: number; date_of_insertion_unix: number; } -export interface NlInfectiousPeople { - values: NlInfectiousPeopleValue[]; - last_value: NlInfectiousPeopleValue; +export interface ArchivedNlInfectiousPeople { + values: ArchivedNlInfectiousPeopleValue[]; + last_value: ArchivedNlInfectiousPeopleValue; } -export interface NlInfectiousPeopleValue { +export interface ArchivedNlInfectiousPeopleValue { margin_low: number; estimate: number | null; margin_high: number; @@ -793,9 +793,9 @@ export interface GmSewerValue { data_is_outdated: boolean; } export interface GmSewerPerInstallation { - values: MunicipalSewerPerInstallationInstallation[]; + values: MunicipalSewerPerInstallation[]; } -export interface MunicipalSewerPerInstallationInstallation { +export interface MunicipalSewerPerInstallation { rwzi_awzi_name: string; values: GmSewerPerInstallationValue[]; last_value: GmSewerPerInstallationValue; From 9668a2a6e40fac74274ea00f7670cf7c11f5dfe5 Mon Sep 17 00:00:00 2001 From: VWSCoronaDashboard29 <137172332+VWSCoronaDashboard29@users.noreply.github.com> Date: Thu, 21 Sep 2023 11:15:48 +0200 Subject: [PATCH 07/18] fix(COR-1809): Remove unused variable replacement (#4879) Co-authored-by: VWSCoronaDashboard29 <coronadashboard@netcompany.com> --- packages/app/src/pages/landelijk/vaccinaties.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/app/src/pages/landelijk/vaccinaties.tsx b/packages/app/src/pages/landelijk/vaccinaties.tsx index 824560a24e..a3536789d4 100644 --- a/packages/app/src/pages/landelijk/vaccinaties.tsx +++ b/packages/app/src/pages/landelijk/vaccinaties.tsx @@ -164,10 +164,6 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { const lastInsertionDateOfPage = getLastInsertionDateOfPage(currentData, pageMetrics); - const variables = { - regio: commonTexts.choropleth.choropleth_vaccination_coverage.nl, - }; - return ( <Layout {...metadata} lastGenerated={lastGenerated}> <NlLayout> @@ -281,8 +277,8 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { data={choropleth.gm} dataOptions={{ getLink: (gmcode) => reverseRouter.gm.vaccinaties(gmcode), isPercentage: true }} text={{ - title: replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.nl.title, variables), - description: replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.nl.description, variables), + title: commonTexts.choropleth.choropleth_vaccination_coverage.nl.title, + description: commonTexts.choropleth.choropleth_vaccination_coverage.nl.description, vaccinationKindLabel: commonTexts.choropleth.vaccination_coverage.shared.dropdown_label_vaccination_coverage_kind_select, ageGroupLabel: commonTexts.choropleth.vaccination_coverage.shared.dropdown_label_age_group_select, }} From cee21797d1eb638f3d7d24a2ef99a63e6d6733cb Mon Sep 17 00:00:00 2001 From: VWSCoronaDashboard27 <111750729+VWSCoronaDashboard27@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:54:17 +0200 Subject: [PATCH 08/18] feat: fixed aligning width of kpi's descriptions (#4877) Co-authored-by: VWSCoronaDashboard27 <VWSCoronaDashboard27@users.noreply.github.com> --- packages/app/src/components/kpi/bordered-kpi-section.tsx | 4 +++- packages/app/src/static-props/get-data.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/app/src/components/kpi/bordered-kpi-section.tsx b/packages/app/src/components/kpi/bordered-kpi-section.tsx index c7935e64d6..a5f0d5a9a4 100644 --- a/packages/app/src/components/kpi/bordered-kpi-section.tsx +++ b/packages/app/src/components/kpi/bordered-kpi-section.tsx @@ -17,7 +17,9 @@ export const BorderedKpiSection = ({ title, description, source, dateOrRange, ti return ( <KpiTile title={title} hasNoPaddingBottom metadata={metadata}> - <Markdown content={description} /> + <Box maxWidth="maxWidthText"> + <Markdown content={description} /> + </Box> <TwoKpiSection spacing={5}> <KpiContentContainer> {tilesData.map((tile, index) => ( diff --git a/packages/app/src/static-props/get-data.ts b/packages/app/src/static-props/get-data.ts index 50bd20c9c1..2abab323cf 100644 --- a/packages/app/src/static-props/get-data.ts +++ b/packages/app/src/static-props/get-data.ts @@ -318,7 +318,7 @@ function replaceInaccurateLastValue(data: any) { metricsWithInaccurateData.forEach((m) => { if (isValuesWithLastValue(data[m])) { - for(const prop in inaccurateMetricProperties) { + for (const prop in inaccurateMetricProperties) { data[m] = adjustDataToLastAccurateValue(data[m], inaccurateMetricProperties[prop]); } } From f1c7038b51de829228d34ea2a99b53f697c8c7af Mon Sep 17 00:00:00 2001 From: AP <116002914+VWSCoronaDashboard28@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:21:44 +0200 Subject: [PATCH 09/18] feat(contact-page-redesign): Implemented test feedback. (#4882) --- .../contact/contact-page-item-links.tsx | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/packages/app/src/components/contact/contact-page-item-links.tsx b/packages/app/src/components/contact/contact-page-item-links.tsx index 6f24a26640..906f9c816d 100644 --- a/packages/app/src/components/contact/contact-page-item-links.tsx +++ b/packages/app/src/components/contact/contact-page-item-links.tsx @@ -12,7 +12,7 @@ interface ContactPageItemLinksProps { export const ContactPageItemLinks = ({ links }: ContactPageItemLinksProps) => { return ( - <Box display="grid" gridTemplateColumns={{ _: '1fr', sm: '1fr 1fr' }} marginTop={space[3]} spacing={{ _: 3, sm: 0 }}> + <LinkListItemContainer spacing={{ _: 3, md: 0 }}> {links.map(({ id, titleAboveLink, href, label, linkType }) => ( <div key={id}> {titleAboveLink && ( @@ -21,19 +21,33 @@ export const ContactPageItemLinks = ({ links }: ContactPageItemLinksProps) => { </Text> )} - <LinkListItem> + <LinkListItem hasTitle={!!titleAboveLink}> <ContactPageLink href={href} label={label} linkType={linkType} /> </LinkListItem> </div> ))} - </Box> + </LinkListItemContainer> ); }; -const LinkListItem = styled.div` +const LinkListItemContainer = styled(Box)` + margin-top: ${space[3]}; + + @media ${mediaQueries.md} { + display: flex; + gap: ${space[3]}; + } +`; + +interface LinkListItemProps { + hasTitle: boolean; +} + +const LinkListItem = styled.div<LinkListItemProps>` border-radius: ${radii[1]}px; border: 1px solid ${colors.gray3}; display: block; + margin-top: ${({ hasTitle }) => (hasTitle ? space[3] : undefined)}; padding: ${space[2]} ${space[3]}; transition: all 0.2s; @@ -45,7 +59,7 @@ const LinkListItem = styled.div` } } - @media ${mediaQueries.sm} { + @media ${mediaQueries.md} { display: inline-block; } `; From 7b984829d6e1f5fa3e5db6833e5f29943bf7e3a5 Mon Sep 17 00:00:00 2001 From: AP <116002914+VWSCoronaDashboard28@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:22:14 +0200 Subject: [PATCH 10/18] feat(sterfte-page-adjustments): Adjust spacing on the sterfte page and refactor. (#4881) --- packages/app/src/components/anchor-tile.tsx | 105 ------------------ .../deceased/deceased-monitor-section.tsx | 59 ---------- packages/app/src/domain/deceased/index.ts | 1 - packages/app/src/pages/landelijk/sterfte.tsx | 70 ++++++++++-- 4 files changed, 60 insertions(+), 175 deletions(-) delete mode 100644 packages/app/src/components/anchor-tile.tsx delete mode 100644 packages/app/src/domain/deceased/deceased-monitor-section.tsx delete mode 100644 packages/app/src/domain/deceased/index.ts diff --git a/packages/app/src/components/anchor-tile.tsx b/packages/app/src/components/anchor-tile.tsx deleted file mode 100644 index 4865a5aeba..0000000000 --- a/packages/app/src/components/anchor-tile.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import { colors } from '@corona-dashboard/common'; -import { External as ExternalLinkIcon } from '@corona-dashboard/icons'; -import styled from 'styled-components'; -import { Anchor, Heading } from '~/components/typography'; -import { Box } from '~/components/base'; -import { Link } from '~/utils/link'; -import { ExternalLink } from './external-link'; -import { mediaQueries, space, sizes } from '~/style/theme'; - -interface AnchorTileProps { - title: string; - href: string; - label: string; - children: React.ReactNode; - external?: boolean; - shadow?: boolean; -} - -export function AnchorTile({ title, href, label, children, external = false }: AnchorTileProps) { - return ( - <Container> - <Content> - <Heading level={3}>{title}</Heading> - {children} - </Content> - - {href && ( - <LinkContainer> - {external ? ( - <ExternalLink href={href}> - <Box display="flex" alignItems="center"> - <IconWrapper> - <ExternalLinkIcon /> - </IconWrapper> - {label} - </Box> - </ExternalLink> - ) : ( - <Link href={href} passHref> - <Anchor>{label}</Anchor> - </Link> - )} - </LinkContainer> - )} - </Container> - ); -} - -export const IconWrapper = styled.span` - margin-right: ${space[2]}; - - svg { - width: 24px; - height: 11px; - display: block; - max-width: initial; - } -`; - -const Container = styled.article` - border-top: 2px solid ${colors.gray2}; - display: flex; - flex-direction: column; - padding-block: ${space[2]} ${space[3]}; - - @media ${mediaQueries.sm} { - padding-block: ${space[3]} ${space[4]}; - } - - @media ${mediaQueries.lg} { - flex-direction: row; - } -`; - -const Content = styled.div` - flex-grow: 1; - flex: 1 1 70%; - max-width: ${sizes.maxWidthText}px; -`; - -const LinkContainer = styled.div` - flex-shrink: 1; - flex: 1 1 30%; - display: flex; - align-items: center; - justify-content: center; - border: 0; - border-top: 1px solid ${colors.gray3}; - margin-top: ${space[3]}; - padding-top: ${space[3]}; - - @media ${mediaQueries.md} { - margin-top: 0; - justify-content: normal; - } - - @media ${mediaQueries.lg} { - border-top: none; - border-left: 1px solid; - border-left-color: ${colors.gray3}; - padding-top: 0; - padding-left: ${space[4]}; - margin-left: ${space[4]}; - } -`; diff --git a/packages/app/src/domain/deceased/deceased-monitor-section.tsx b/packages/app/src/domain/deceased/deceased-monitor-section.tsx deleted file mode 100644 index 1f60645f0b..0000000000 --- a/packages/app/src/domain/deceased/deceased-monitor-section.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { colors, NlDeceasedCbs } from '@corona-dashboard/common'; -import { AnchorTile } from '~/components/anchor-tile'; -import { ChartTile } from '~/components/chart-tile'; -import { Markdown } from '~/components/markdown'; -import { TimeSeriesChart } from '~/components/time-series-chart'; -import { SiteText } from '~/locale'; - -export function DeceasedMonitorSection({ - data, - text, - showCauseMessage, -}: { - data: NlDeceasedCbs; - text: SiteText['pages']['deceased_page']['nl']['section_sterftemonitor']; - showCauseMessage?: boolean; -}) { - return ( - <> - <ChartTile metadata={{ source: text.bronnen.cbs }} title={text.deceased_monitor_chart_title} description={text.deceased_monitor_chart_description}> - <TimeSeriesChart - accessibility={{ - key: 'deceased_monitor', - }} - tooltipTitle={text.deceased_monitor_chart_title} - values={data.values} - seriesConfig={[ - { - type: 'line', - metricProperty: 'expected', - label: text.deceased_monitor_chart_legenda_expected, - shortLabel: text.deceased_monitor_chart_legenda_expected_short, - color: colors.primary, - }, - { - type: 'line', - metricProperty: 'registered', - label: text.deceased_monitor_chart_legenda_registered, - shortLabel: text.deceased_monitor_chart_legenda_registered_short, - color: colors.orange1, - }, - { - type: 'range', - metricPropertyLow: 'expected_min', - metricPropertyHigh: 'expected_max', - label: text.deceased_monitor_chart_legenda_expected_margin, - shortLabel: text.deceased_monitor_chart_legenda_expected_margin_short, - color: colors.blue2, - }, - ]} - /> - </ChartTile> - {showCauseMessage && ( - <AnchorTile title={text.cause_message.title} label={text.cause_message.link.text} href={text.cause_message.link.url} external> - <Markdown content={text.cause_message.message}></Markdown> - </AnchorTile> - )} - </> - ); -} diff --git a/packages/app/src/domain/deceased/index.ts b/packages/app/src/domain/deceased/index.ts deleted file mode 100644 index 41bb38c83f..0000000000 --- a/packages/app/src/domain/deceased/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { DeceasedMonitorSection } from './deceased-monitor-section'; diff --git a/packages/app/src/pages/landelijk/sterfte.tsx b/packages/app/src/pages/landelijk/sterfte.tsx index b474f5a2cb..5738642e33 100644 --- a/packages/app/src/pages/landelijk/sterfte.tsx +++ b/packages/app/src/pages/landelijk/sterfte.tsx @@ -1,28 +1,29 @@ import { TimeframeOption, TimeframeOptionsList, colors } from '@corona-dashboard/common'; -import { Coronavirus } from '@corona-dashboard/icons'; +import { Coronavirus, External } from '@corona-dashboard/icons'; import { GetStaticPropsContext } from 'next'; import { useState } from 'react'; import { AgeDemographic } from '~/components/age-demographic'; +import { PageArticlesTile } from '~/components/articles/page-articles-tile'; import { Box } from '~/components/base/box'; import { ChartTile } from '~/components/chart-tile'; +import { ExternalLink } from '~/components/external-link'; import { InView } from '~/components/in-view'; import { KpiTile } from '~/components/kpi-tile'; import { KpiValue } from '~/components/kpi-value'; -import { PageArticlesTile } from '~/components/articles/page-articles-tile'; +import { Markdown } from '~/components/markdown'; import { PageFaqTile } from '~/components/page-faq-tile'; import { PageInformationBlock } from '~/components/page-information-block'; import { TileList } from '~/components/tile-list'; import { TimeSeriesChart } from '~/components/time-series-chart'; import { TwoKpiSection } from '~/components/two-kpi-section'; import { WarningTile } from '~/components/warning-tile'; -import { DeceasedMonitorSection } from '~/domain/deceased'; import { Layout, NlLayout } from '~/domain/layout'; import { useIntl } from '~/intl'; import { Languages, SiteText } from '~/locale'; import { ElementsQueryResult, getElementsQuery, getTimelineEvents } from '~/queries/get-elements-query'; import { getArticleParts, getDataExplainedParts, getFaqParts, getPagePartsQuery } from '~/queries/get-page-parts-query'; import { StaticProps, createGetStaticProps } from '~/static-props/create-get-static-props'; -import { createGetContent, getLastGeneratedDate, getLokalizeTexts, selectNlData, selectArchivedNlData } from '~/static-props/get-data'; +import { createGetContent, getLastGeneratedDate, getLokalizeTexts, selectArchivedNlData, selectNlData } from '~/static-props/get-data'; import { space } from '~/style/theme'; import { ArticleParts, PagePartQueryResult } from '~/types/cms'; import { useDynamicLokalizeTexts } from '~/utils/cms/use-dynamic-lokalize-texts'; @@ -51,9 +52,9 @@ export const getStaticProps = createGetStaticProps( }>((context) => { const { locale } = context; return `{ - "parts": ${getPagePartsQuery('deceased_page')}, - "elements": ${getElementsQuery('nl', ['deceased_rivm_archived_20221231'], locale)} - }`; + "parts": ${getPagePartsQuery('deceased_page')}, + "elements": ${getElementsQuery('nl', ['deceased_rivm_archived_20221231'], locale)} + }`; })(context); return { @@ -87,9 +88,7 @@ const DeceasedNationalPage = (props: StaticProps<typeof getStaticProps>) => { }; const hasActiveWarningTile = !!textShared.notification.message; - const lastInsertionDateOfPage = getLastInsertionDateOfPage(archivedData, pageMetrics); - const lastdeceasedPerAgeGroupInsertionDate = getLastInsertionDateOfPage(archivedData, ['deceased_rivm_per_age_group_archived_20221231']); return ( @@ -119,7 +118,58 @@ const DeceasedNationalPage = (props: StaticProps<typeof getStaticProps>) => { {hasActiveWarningTile && <WarningTile isFullWidth message={textShared.notification.message} variant="informational" />} - <DeceasedMonitorSection data={dataCbs} text={textNl.section_sterftemonitor} showCauseMessage /> + <ChartTile + metadata={{ source: textNl.section_sterftemonitor.bronnen.cbs }} + title={textNl.section_sterftemonitor.deceased_monitor_chart_title} + description={textNl.section_sterftemonitor.deceased_monitor_chart_description} + > + <TimeSeriesChart + accessibility={{ + key: 'deceased_monitor', + }} + tooltipTitle={textNl.section_sterftemonitor.deceased_monitor_chart_title} + values={dataCbs.values} + seriesConfig={[ + { + type: 'line', + metricProperty: 'expected', + label: textNl.section_sterftemonitor.deceased_monitor_chart_legenda_expected, + shortLabel: textNl.section_sterftemonitor.deceased_monitor_chart_legenda_expected_short, + color: colors.primary, + }, + { + type: 'line', + metricProperty: 'registered', + label: textNl.section_sterftemonitor.deceased_monitor_chart_legenda_registered, + shortLabel: textNl.section_sterftemonitor.deceased_monitor_chart_legenda_registered_short, + color: colors.orange1, + }, + { + type: 'range', + metricPropertyLow: 'expected_min', + metricPropertyHigh: 'expected_max', + label: textNl.section_sterftemonitor.deceased_monitor_chart_legenda_expected_margin, + shortLabel: textNl.section_sterftemonitor.deceased_monitor_chart_legenda_expected_margin_short, + color: colors.blue2, + }, + ]} + /> + </ChartTile> + + <ChartTile title={textNl.section_sterftemonitor.cause_message.title} disableFullscreen> + <Box maxWidth="maxWidthText"> + <Markdown content={textNl.section_sterftemonitor.cause_message.message}></Markdown> + + {textNl.section_sterftemonitor.cause_message.link.url && ( + <ExternalLink href={textNl.section_sterftemonitor.cause_message.link.url}> + <Box display="flex" alignItems="center"> + <External /> + {textNl.section_sterftemonitor.cause_message.link.text} + </Box> + </ExternalLink> + )} + </Box> + </ChartTile> {content.faqs && content.faqs.questions?.length > 0 && <PageFaqTile questions={content.faqs.questions} title={content.faqs.sectionTitle} />} From 68912fd3ec7a53e470639498c0377b4564063a7a Mon Sep 17 00:00:00 2001 From: AP <116002914+VWSCoronaDashboard28@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:05:47 +0200 Subject: [PATCH 11/18] Feature/COR-1637-adjustments-in-sanity (#4878) * feat(sanity-ui-improvements): Made textual adjustments. * feat(sanity-ui-improvements): Removed the De beschrijving boven de thermometer fieldset, fields and associated code/content * feat(sanity-ui-improvements): Removed the Titel van standen informatie fieldset, fields and associated code/content. * feat(sanity-ui-improvements): Last few changes. * Merge branch 'develop' into feature/COR-1637-adjustments-in-sanity --- .../logic/set-trend-icon.tsx | 11 ------- .../severity-indicator-tile.tsx | 23 +++----------- .../components/topical-theme-header.tsx | 30 +++++++------------ packages/app/src/pages/index.tsx | 2 +- .../pages/landelijk/corona-thermometer.tsx | 28 ++++++++--------- .../queries/get-topical-structure-query.ts | 6 ---- packages/app/src/queries/query-types.ts | 3 -- .../documents/pages/homepage/theme-tile.ts | 15 ++++++++-- .../schemas/documents/pages/homepage/theme.ts | 15 ---------- .../pages/homepage/thermometer-timeline.ts | 2 +- .../documents/pages/homepage/thermometer.ts | 30 ------------------- .../desk-structure/homepage-structure-item.ts | 2 +- 12 files changed, 43 insertions(+), 124 deletions(-) delete mode 100644 packages/app/src/components/severity-indicator-tile/logic/set-trend-icon.tsx diff --git a/packages/app/src/components/severity-indicator-tile/logic/set-trend-icon.tsx b/packages/app/src/components/severity-indicator-tile/logic/set-trend-icon.tsx deleted file mode 100644 index 7ec38cf891..0000000000 --- a/packages/app/src/components/severity-indicator-tile/logic/set-trend-icon.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Down, Up } from '@corona-dashboard/icons'; -import { ICON_DIRECTION_DOWN } from '~/domain/topical/common'; - -/** - * Set the correction icon for specific direction that is beign passed. - * */ - -export const setTrendIcon = (direction: string) => { - if (direction === ICON_DIRECTION_DOWN) return <Down />; - return <Up />; -}; diff --git a/packages/app/src/components/severity-indicator-tile/severity-indicator-tile.tsx b/packages/app/src/components/severity-indicator-tile/severity-indicator-tile.tsx index b714d09055..dd0a9dd9ca 100644 --- a/packages/app/src/components/severity-indicator-tile/severity-indicator-tile.tsx +++ b/packages/app/src/components/severity-indicator-tile/severity-indicator-tile.tsx @@ -1,18 +1,14 @@ import { colors } from '@corona-dashboard/common'; import css from '@styled-system/css'; -import styled from 'styled-components'; -import { space } from '~/style/theme'; import { Box } from '~/components/base'; import { Markdown } from '~/components/markdown'; import { InlineText } from '~/components/typography'; -import { TrendIcon, TrendIconColor } from '~/domain/topical/types'; -import { SeverityIndicatorLabel } from './components/severity-indicator-label'; +import { space } from '~/style/theme'; import { SeverityIndicator } from './components/severity-indicator'; +import { SeverityIndicatorLabel } from './components/severity-indicator-label'; import { SEVERITY_INDICATOR_TILE_COLUMN_MIN_WIDTH } from './constants'; import { getSeverityColor } from './logic/get-severity-color'; import { SeverityLevel } from './types'; -import { mapStringToColors } from './logic/map-string-to-colors'; -import { setTrendIcon } from '~/components/severity-indicator-tile/logic/set-trend-icon'; interface SeverityIndicatorTileProps { description: string; @@ -22,13 +18,9 @@ interface SeverityIndicatorTileProps { sourceLabel: string; datesLabel: string; levelDescription: string; - trendIcon: TrendIcon; } -export const SeverityIndicatorTile = ({ description, label, level, title, datesLabel, sourceLabel, levelDescription, trendIcon }: SeverityIndicatorTileProps) => { - const hasIconProps = trendIcon?.direction && trendIcon?.color; - const iconColor = trendIcon?.color?.toUpperCase() as TrendIconColor; - +export const SeverityIndicatorTile = ({ description, label, level, title, datesLabel, sourceLabel, levelDescription }: SeverityIndicatorTileProps) => { return ( <Box alignItems="flex-start" @@ -54,8 +46,7 @@ export const SeverityIndicatorTile = ({ description, label, level, title, datesL <Box flexGrow={1} width={`min(${SEVERITY_INDICATOR_TILE_COLUMN_MIN_WIDTH}px, 50%)`} as="figcaption"> {description && <Markdown content={description} />} - <Box display={hasIconProps ? 'flex' : 'block'} alignItems="center" marginTop={space[3]} css={css({ gap: space[2] })}> - {trendIcon?.direction && iconColor && hasIconProps && <TrendIconWrapper color={mapStringToColors(iconColor)}>{setTrendIcon(trendIcon.direction)}</TrendIconWrapper>} + <Box display="block" alignItems="center" marginTop={space[3]} css={css({ gap: space[2] })}> {levelDescription && <Markdown content={levelDescription} />} </Box> <Box marginY={space[3]}> @@ -65,9 +56,3 @@ export const SeverityIndicatorTile = ({ description, label, level, title, datesL </Box> ); }; - -const TrendIconWrapper = styled.span` - color: ${({ color }) => color}; - flex-shrink: 0; - width: 20px; -`; diff --git a/packages/app/src/domain/topical/components/topical-theme-header.tsx b/packages/app/src/domain/topical/components/topical-theme-header.tsx index cc38858970..95a57271e8 100644 --- a/packages/app/src/domain/topical/components/topical-theme-header.tsx +++ b/packages/app/src/domain/topical/components/topical-theme-header.tsx @@ -1,33 +1,23 @@ -import { Box } from '~/components/base'; -import styled from 'styled-components'; -import { Heading } from '~/components/typography'; -import { RichContent } from '~/components/cms/rich-content'; import { IconName as TopicalIcon } from '@corona-dashboard/icons/src/icon-name2filename'; +import styled from 'styled-components'; +import { Box } from '~/components/base'; import DynamicIcon from '~/components/get-icon-by-name'; +import { Heading } from '~/components/typography'; import theme from '~/style/theme'; -import { PortableTextEntry } from '@sanity/block-content-to-react'; -import { fontSizes } from '~/style/theme'; interface TopicalThemeHeaderProps { title: string; - subtitle?: PortableTextEntry[] | null; icon: TopicalIcon; } -export const TopicalThemeHeader = ({ title, subtitle, icon }: TopicalThemeHeaderProps) => { +export const TopicalThemeHeader = ({ title, icon }: TopicalThemeHeaderProps) => { return ( - <Box spacing={3}> - <Box display="flex" justifyContent="start" alignItems="center"> - <StyledTopicalThemeHeaderIcon> - <DynamicIcon name={icon} aria-hidden="true" /> - </StyledTopicalThemeHeaderIcon> - <Heading level={2}>{title}</Heading> - </Box> - {subtitle && ( - <Box fontSize={fontSizes[3]}> - <RichContent blocks={subtitle} /> - </Box> - )} + <Box display="flex" alignItems="center"> + <StyledTopicalThemeHeaderIcon> + <DynamicIcon name={icon} aria-hidden="true" /> + </StyledTopicalThemeHeaderIcon> + + <Heading level={2}>{title}</Heading> </Box> ); }; diff --git a/packages/app/src/pages/index.tsx b/packages/app/src/pages/index.tsx index 0c5deb9ac8..c62ab6256c 100644 --- a/packages/app/src/pages/index.tsx +++ b/packages/app/src/pages/index.tsx @@ -103,7 +103,7 @@ const Home = (props: StaticProps<typeof getStaticProps>) => { return ( <Box key={theme.title}> <Box marginBottom={space[4]}> - <TopicalThemeHeader title={theme.title} subtitle={theme.subTitle} icon={getFilenameToIconName(theme.themeIcon) as TopicalIcon} /> + <TopicalThemeHeader title={theme.title} icon={getFilenameToIconName(theme.themeIcon) as TopicalIcon} /> </Box> {theme.tiles && ( <Box diff --git a/packages/app/src/pages/landelijk/corona-thermometer.tsx b/packages/app/src/pages/landelijk/corona-thermometer.tsx index 29fee7e2c6..da77d04556 100644 --- a/packages/app/src/pages/landelijk/corona-thermometer.tsx +++ b/packages/app/src/pages/landelijk/corona-thermometer.tsx @@ -1,34 +1,33 @@ -import { Languages, SiteText } from '~/locale'; import { colors } from '@corona-dashboard/common'; +import { Coronathermometer } from '@corona-dashboard/icons'; +import { GetStaticPropsContext } from 'next'; import styled from 'styled-components'; +import { ChartTile, InView, PageInformationBlock, TileList, WarningTile } from '~/components'; +import { PageArticlesTile } from '~/components/articles/page-articles-tile'; import { Box } from '~/components/base'; -import { GetStaticPropsContext } from 'next'; +import { PageFaqTile } from '~/components/page-faq-tile'; import { getTimelineRangeDates } from '~/components/severity-indicator-tile/components/timeline/logic'; import { Timeline } from '~/components/severity-indicator-tile/components/timeline/timeline'; import { SEVERITY_LEVELS_LIST, TOPICAL_SEVERITY_INDICATOR_TILE_MAX_WIDTH } from '~/components/severity-indicator-tile/constants'; import { SeverityIndicatorTile } from '~/components/severity-indicator-tile/severity-indicator-tile'; import { SeverityLevel } from '~/components/severity-indicator-tile/types'; import { TimelineMarker } from '~/components/time-series-chart/components/timeline'; +import { Layout } from '~/domain/layout/layout'; +import { NlLayout } from '~/domain/layout/nl-layout'; import { IndicatorLevelDescription } from '~/domain/topical/components/indicator-level-description'; -import { TrendIcon } from '~/domain/topical/types'; +import { useIntl } from '~/intl'; +import { Languages, SiteText } from '~/locale'; +import { getArticleParts, getDataExplainedParts, getFaqParts, getPagePartsQuery } from '~/queries/get-page-parts-query'; import { getThermometerEvents, getTopicalStructureQuery } from '~/queries/get-topical-structure-query'; +import { TopicalSanityData } from '~/queries/query-types'; import { StaticProps, createGetStaticProps } from '~/static-props/create-get-static-props'; import { createGetContent, getLastGeneratedDate, getLokalizeTexts } from '~/static-props/get-data'; +import { space } from '~/style/theme'; import { ArticleParts, LinkParts, PagePartQueryResult, RichTextParts } from '~/types/cms'; -import { TopicalSanityData } from '~/queries/query-types'; -import { getArticleParts, getDataExplainedParts, getFaqParts, getPagePartsQuery } from '~/queries/get-page-parts-query'; -import { Layout } from '~/domain/layout/layout'; -import { NlLayout } from '~/domain/layout/nl-layout'; -import { ChartTile, InView, PageInformationBlock, TileList, WarningTile } from '~/components'; import { useDynamicLokalizeTexts } from '~/utils/cms/use-dynamic-lokalize-texts'; -import { space } from '~/style/theme'; -import { Coronathermometer } from '@corona-dashboard/icons'; -import { useIntl } from '~/intl'; -import { replaceVariablesInText } from '~/utils/replace-variables-in-text'; import { getPageInformationHeaderContent } from '~/utils/get-page-information-header-content'; -import { PageFaqTile } from '~/components/page-faq-tile'; -import { PageArticlesTile } from '~/components/articles/page-articles-tile'; import { getThermometerSeverityLevels } from '~/utils/get-thermometer-severity-level'; +import { replaceVariablesInText } from '~/utils/replace-variables-in-text'; const selectLokalizeTexts = (siteText: SiteText) => ({ textNl: siteText.pages.corona_thermometer_page.nl, @@ -131,7 +130,6 @@ const CoronaThermometer = (props: StaticProps<typeof getStaticProps>) => { sourceLabel={thermometer.sourceLabel} datesLabel={thermometer.datesLabel} levelDescription={thermometer.levelDescription} - trendIcon={thermometer.trendIcon as TrendIcon} /> {thermometerEvents && thermometerEvents.length && ( <Timeline diff --git a/packages/app/src/queries/get-topical-structure-query.ts b/packages/app/src/queries/get-topical-structure-query.ts index 5aa031c0c5..377afa1017 100644 --- a/packages/app/src/queries/get-topical-structure-query.ts +++ b/packages/app/src/queries/get-topical-structure-query.ts @@ -26,7 +26,6 @@ export function getTopicalStructureQuery(locale: string) { ][0]{ 'themes': themes[]->{ 'title':title.${locale}, - 'subTitle':subTitle.${locale}, themeIcon, 'linksLabelMobile': labelMobile.${locale}, 'linksLabelDesktop': labelDesktop.${locale}, @@ -62,7 +61,6 @@ export function getTopicalStructureQuery(locale: string) { ][0]{ icon, 'title': title.${locale}, - 'subTitle': subTitle.${locale}, 'tileTitle':tileTitle.${locale}, currentLevel, 'thermometerLevels': thermometerLevels[]->{ @@ -75,10 +73,6 @@ export function getTopicalStructureQuery(locale: string) { 'sourceLabel': sourceLabel.${locale}, 'articleReference': articleReference.${locale}, 'collapsibleTitle': collapsibleTitle.${locale}, - 'trendIcon': { - 'color': trendIcon.color, - 'direction': trendIcon.direction, - }, 'timeline': { 'title': timeline.title.${locale}, 'tooltipLabel': timeline.tooltipCurrentEstimationLabel.${locale}, diff --git a/packages/app/src/queries/query-types.ts b/packages/app/src/queries/query-types.ts index 0d75d2347b..d837e69648 100644 --- a/packages/app/src/queries/query-types.ts +++ b/packages/app/src/queries/query-types.ts @@ -15,7 +15,6 @@ export interface TopicalSanityData { export interface ThermometerConfig { icon: TopicalIcon; title: string; - subTitle: PortableTextEntry[] | null; tileTitle: string | null; currentLevel: SeverityLevel; datesLabel: string; @@ -23,7 +22,6 @@ export interface ThermometerConfig { sourceLabel: string; articleReference: PortableTextEntry[]; collapsibleTitle: string; - trendIcon: TrendIcon; thermometerLevels: ThermometerLevel[]; timeline: ThermometerTimeLine; } @@ -60,7 +58,6 @@ interface KpiThemes { } interface Theme { title: string; - subTitle: PortableTextEntry[] | null; themeIcon: TopicalIcon; } diff --git a/packages/cms/src/schemas/documents/pages/homepage/theme-tile.ts b/packages/cms/src/schemas/documents/pages/homepage/theme-tile.ts index 843775ca16..ae70b71548 100644 --- a/packages/cms/src/schemas/documents/pages/homepage/theme-tile.ts +++ b/packages/cms/src/schemas/documents/pages/homepage/theme-tile.ts @@ -24,6 +24,15 @@ export const themeTile = defineType({ collapsed: true, }, }, + { + title: 'Link configuratie', + name: 'link-configuration', + description: 'Klik op het label om de velden te tonen.', + options: { + collapsible: true, + collapsed: true, + }, + }, ], fields: [ defineField({ @@ -54,7 +63,7 @@ export const themeTile = defineType({ fieldset: 'kpiValue', }), defineField({ - title: 'Verberg trend icoon', + title: 'Toon geen pijlen', name: 'hideTrendIcon', type: 'boolean', description: 'Wanneer aangevinkt, wordt het trend icoon niet getoond bij de KPI waarde.', @@ -92,14 +101,16 @@ export const themeTile = defineType({ fieldset: 'theme-tile-date-config', }), defineField({ - title: 'Trend icon', + title: 'Trend pijlen', name: 'trendIcon', type: 'trendIcon', }), defineField({ title: 'Link', + description: 'Vul hier de link in naar de juiste Landelijk pagina', name: 'cta', type: 'link', + fieldset: 'link-configuration', }), ], preview: { diff --git a/packages/cms/src/schemas/documents/pages/homepage/theme.ts b/packages/cms/src/schemas/documents/pages/homepage/theme.ts index aca4c43d0c..bbfb184316 100644 --- a/packages/cms/src/schemas/documents/pages/homepage/theme.ts +++ b/packages/cms/src/schemas/documents/pages/homepage/theme.ts @@ -9,15 +9,6 @@ export const theme = defineType({ name: 'theme', icon: BsFileEarmark, fieldsets: [ - { - title: 'Ondertitel', - description: 'Klik op het label om de velden te tonen.', - name: 'ondertitel', - options: { - collapsible: true, - collapsed: true, - }, - }, { title: 'Links', description: 'Klik op het label om de velden te tonen.', @@ -35,12 +26,6 @@ export const theme = defineType({ type: 'localeString', validation: localeStringValidation((rule) => rule.required()), }), - defineField({ - title: 'Ondertitel', - name: 'subTitle', - type: 'localeRichContentBlock', - fieldset: 'ondertitel', - }), defineField({ title: 'Thema icoon', name: 'themeIcon', diff --git a/packages/cms/src/schemas/documents/pages/homepage/thermometer-timeline.ts b/packages/cms/src/schemas/documents/pages/homepage/thermometer-timeline.ts index 7911016df9..c5467bb571 100644 --- a/packages/cms/src/schemas/documents/pages/homepage/thermometer-timeline.ts +++ b/packages/cms/src/schemas/documents/pages/homepage/thermometer-timeline.ts @@ -30,7 +30,7 @@ export const thermometerTimeline = defineType({ title: 'Tooltip label', description: 'Extra beschrijving voor in de laatste gebeurtenis in de tijdlijn', name: 'tooltipCurrentEstimationLabel', - type: 'localeText', + type: 'localeString', validation: (rule) => rule.required(), }), defineField({ diff --git a/packages/cms/src/schemas/documents/pages/homepage/thermometer.ts b/packages/cms/src/schemas/documents/pages/homepage/thermometer.ts index b370b594ce..688f45a361 100644 --- a/packages/cms/src/schemas/documents/pages/homepage/thermometer.ts +++ b/packages/cms/src/schemas/documents/pages/homepage/thermometer.ts @@ -8,15 +8,6 @@ export const thermometer = defineType({ title: 'Thermometer', name: 'thermometer', fieldsets: [ - { - title: 'De beschrijving boven de thermometer', - name: 'description', - description: 'Klik op het label om de velden te tonen.', - options: { - collapsible: true, - collapsed: true, - }, - }, { title: 'Artikel referentie', name: 'artikel-referentie', @@ -26,15 +17,6 @@ export const thermometer = defineType({ collapsed: true, }, }, - { - title: 'Titel van standen informatie', - name: 'level-information', - description: 'Klik op het label om de velden te tonen.', - options: { - collapsible: true, - collapsed: true, - }, - }, ], fields: [ defineField({ @@ -52,12 +34,6 @@ export const thermometer = defineType({ type: 'localeString', validation: localeStringValidation((rule) => rule.required()), }), - defineField({ - title: 'De beschrijving boven de thermometer', - name: 'subTitle', - type: 'localeRichContentBlock', - fieldset: 'description', - }), defineField({ title: 'De titel binnen de thermometer tegel', name: 'tileTitle', @@ -110,12 +86,6 @@ export const thermometer = defineType({ type: 'localeString', validation: localeStringValidation((rule) => rule.required()), }), - defineField({ - title: 'Titel van standen informatie', - name: 'trendIcon', - type: 'thermometerTrendIcon', - fieldset: 'level-information', - }), defineField({ title: 'Tijdlijn', name: 'timeline', diff --git a/packages/cms/src/studio/desk-structure/homepage-structure-item.ts b/packages/cms/src/studio/desk-structure/homepage-structure-item.ts index e5ca5181cc..90541d4a38 100644 --- a/packages/cms/src/studio/desk-structure/homepage-structure-item.ts +++ b/packages/cms/src/studio/desk-structure/homepage-structure-item.ts @@ -14,7 +14,7 @@ export const homepageStructureItem = (S: StructureBuilder) => { addStructureItem(S, BsGear, 'Samenvattingspagina configuratie', 'topicalPageConfig'), addStructureItem(S, BsCardList, 'Weeksamenvatting', 'weeklySummary'), addStructureItem(S, BsThermometer, 'Thermometer', 'thermometer'), - addStructureItem(S, BsCardText, "Thema's", 'themeCollection'), + addStructureItem(S, BsCardText, "KPI thema's en tegels", 'themeCollection'), addStructureItem(S, BsCardText, 'Adviezen', 'advice'), ]) ); From ce5c2a306462a9268b226829b811a49ce1001d64 Mon Sep 17 00:00:00 2001 From: VWSCoronaDashboard27 <111750729+VWSCoronaDashboard27@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:02:55 +0200 Subject: [PATCH 12/18] feature/COR-1470_separate_source_from_value_row_on_kpi_tiles (#4880) * feat: separate source from value row on kpi tiles * fix: resolved conversation * fix: changed Sanity discription for dateLabel and sourceLabel and made it as optional fields * fix: mobile padding --------- Co-authored-by: VWSCoronaDashboard27 <VWSCoronaDashboard27@users.noreply.github.com> --- .../components/topical-kpi-tile/topical-tile.tsx | 13 ++++++++++--- packages/app/src/pages/index.tsx | 5 +++-- .../app/src/queries/get-topical-structure-query.ts | 1 + packages/app/src/queries/query-types.ts | 3 ++- .../schemas/documents/pages/homepage/theme-tile.ts | 8 +++++++- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/packages/app/src/domain/topical/components/topical-kpi-tile/topical-tile.tsx b/packages/app/src/domain/topical/components/topical-kpi-tile/topical-tile.tsx index 210fa8c7e9..59531e823a 100644 --- a/packages/app/src/domain/topical/components/topical-kpi-tile/topical-tile.tsx +++ b/packages/app/src/domain/topical/components/topical-kpi-tile/topical-tile.tsx @@ -23,13 +23,14 @@ interface TopicalTileProps { description: PortableTextEntry[]; hideTrendIcon: boolean; kpiValue: string | null; - sourceLabel: string | null; + sourceLabel?: string; + dateLabel?: string; tileIcon: TopicalIcon; title: string; trendIcon: TrendIconType; } -export const TopicalTile = ({ title, tileIcon, trendIcon, description, kpiValue, cta, sourceLabel, hideTrendIcon }: TopicalTileProps) => { +export const TopicalTile = ({ title, tileIcon, trendIcon, description, kpiValue, cta, sourceLabel, dateLabel, hideTrendIcon }: TopicalTileProps) => { const { formatNumber } = useIntl(); const formattedKpiValue = typeof kpiValue === 'number' ? formatNumber(kpiValue) : typeof kpiValue === 'string' ? kpiValue : false; @@ -45,7 +46,7 @@ export const TopicalTile = ({ title, tileIcon, trendIcon, description, kpiValue, return ( <TopicalTileWrapper cta={cta}> - <Box display="flex" flexDirection="column" justifyContent="start"> + <Box display="flex" flexDirection="column" justifyContent="start" flexGrow={1}> <Box display="flex" justifyContent="space-between"> <Box fontSize={{ _: fontSizes[6], xs: fontSizes[7] }} paddingLeft={{ _: space[3], xs: space[4] }} paddingTop={{ _: space[3], xs: space[4] }}> <StyledHeading level={3} color={colors.blue8}> @@ -80,6 +81,12 @@ export const TopicalTile = ({ title, tileIcon, trendIcon, description, kpiValue, </Box> </Box> + {dateLabel && ( + <Box padding={{ _: `0 ${space[3]} ${space[1]}`, xs: `0 ${space[4]} ${space[1]}` }}> + <InlineText color={colors.gray7}>{dateLabel}</InlineText> + </Box> + )} + {sourceLabel && ( <Box padding={{ _: `0 ${space[3]} ${space[3]}`, xs: `0 ${space[4]} ${space[4]}` }}> <InlineText color={colors.gray7}>{sourceLabel}</InlineText> diff --git a/packages/app/src/pages/index.tsx b/packages/app/src/pages/index.tsx index c62ab6256c..228ffd1b93 100644 --- a/packages/app/src/pages/index.tsx +++ b/packages/app/src/pages/index.tsx @@ -114,7 +114,7 @@ const Home = (props: StaticProps<typeof getStaticProps>) => { marginBottom={{ _: space[4], sm: space[5] }} > {theme.tiles.map((themeTile) => { - const sourceLabel = themeTile.sourceLabel ? replaceVariablesInText(themeTile.sourceLabel, { date: themeTile.tileDate }) : null; + const dateLabel = themeTile.dateLabel ? replaceVariablesInText(themeTile.dateLabel, { date: themeTile.tileDate }) : undefined; return ( <TopicalTile hideTrendIcon={themeTile.hideTrendIcon} @@ -125,7 +125,8 @@ const Home = (props: StaticProps<typeof getStaticProps>) => { cta={themeTile.cta} key={themeTile.title} kpiValue={themeTile.kpiValue} - sourceLabel={sourceLabel} + sourceLabel={themeTile.sourceLabel} + dateLabel={dateLabel} /> ); })} diff --git a/packages/app/src/queries/get-topical-structure-query.ts b/packages/app/src/queries/get-topical-structure-query.ts index 377afa1017..1f821563a4 100644 --- a/packages/app/src/queries/get-topical-structure-query.ts +++ b/packages/app/src/queries/get-topical-structure-query.ts @@ -40,6 +40,7 @@ export function getTopicalStructureQuery(locale: string) { 'description':description.${locale}, tileIcon, 'title':title.${locale}, + 'dateLabel':dateLabel.${locale}, 'sourceLabel':sourceLabel.${locale}, 'tileDate': tileDate.${locale}, 'kpiValue': kpiValue.${locale}, diff --git a/packages/app/src/queries/query-types.ts b/packages/app/src/queries/query-types.ts index d837e69648..5718b4dff5 100644 --- a/packages/app/src/queries/query-types.ts +++ b/packages/app/src/queries/query-types.ts @@ -80,7 +80,8 @@ export interface BaseTile { interface TopicalTile extends BaseTile { title: string; - sourceLabel: string | null; + dateLabel?: string; + sourceLabel?: string; tileDate: string; kpiValue: string | null; cta: Cta; diff --git a/packages/cms/src/schemas/documents/pages/homepage/theme-tile.ts b/packages/cms/src/schemas/documents/pages/homepage/theme-tile.ts index ae70b71548..dde629bece 100644 --- a/packages/cms/src/schemas/documents/pages/homepage/theme-tile.ts +++ b/packages/cms/src/schemas/documents/pages/homepage/theme-tile.ts @@ -72,7 +72,13 @@ export const themeTile = defineType({ }), defineField({ title: 'Metadata label', - description: 'Bij {{date}} wordt de tekst geplaatst van het tegeldatumveld. Deze kan handmatig overschreven worden.', + description: 'Bij {{date}} is de tekst van het tegeldatumveld optioneel', + name: 'dateLabel', + type: 'localeString', + }), + defineField({ + title: 'Source label', + description: 'Deze velden zijn optionele broninformatie.', name: 'sourceLabel', type: 'localeString', }), From e960c78f477f8c30e31535f13b0199dbf8e27b3d Mon Sep 17 00:00:00 2001 From: M <120020483+VWSCoronaDashboard30@users.noreply.github.com> Date: Mon, 2 Oct 2023 16:14:45 +0200 Subject: [PATCH 13/18] feature/COR-1784_COR-1801_vaccinations-modifications (#4887) * feat(COR-1801): Finalized ticket * fix(zks-graphs): Fixed range dates to date (#4865) * fix(zks-graphs): Fixed range dates to date * fix(1806): Updated documentation * task: Remove add new document button in navbar (#4868) * Feature/cor 1563 refactor text keys in kpi to markdown (#4867) * fix: deleted unused component * fix: Create markdown consistency in KPI tiles * Bugfix/cor 1769 variants table and graph 2 (#4870) * fix(COR-1769): Removed keys from schemas * fix(COR-1769): Removed historical significance key * fix(COR-1769): Update getter functions * fix(COR-1769): Remove unused code from variants chart * fix(COR-1769): Re-add destructuring based on suggestion --------- Co-authored-by: VWSCoronaDashboard29 <coronadashboard@netcompany.com> * feat(COR-1784): Update schemas to match protos * feat(COR-1784): Update schemas to protos and fix * feat(COR-1784): Update branch to match old branch * feat(COR-1784): Update schema titles * feat(COR-1784): Adapt vaccine campaign tiles * feat(COR-1784): Made vaccine coverage generic * feat(COR-1784): Streamline hook * feat(COR-1784): Split autumn vaccine per age group table * feat(COR-1784): Add primary series choropleth and fix keys * feat(COR-1784): Add campaign banner component * task: Apply changes from COR-1788 * feat(COR-1784): Add campaign hero * feat(COR-1784): Update vaccine colours * feat(COR-1784): Remove barrel files * feat(COR-1784): Update schema to match protos * feat(COR-1784): Update conditional display based on feedback * feat(COR-1784): Add newline in schemafile * feat(COR-1784): Removed type indication in coverage-per-age-group * feat(COR-1784): Centralize styling * fix(COR-1784): Update types to new schemanames * feat(COR-1784): Reverted conditional component based on feedback * feat(COR-1784): Update schemas and datatypes to match protos * feat(COR-1801): Replaced the protos actual values * feat(COR-1801): Fixed typecheck issues and adjusted the municipality page * feat(COR-1784): Update vaccines page to new designs spec * feat(COR-1784): Update pageinfo block for primary series * task(COR-1784): Check in sanity key mutations * refactor(COR-1784): Refactor name from feedback * fix(COR-1784): Change date of primary series pageinfo * fix(COR-1784): Add optional to metadata * refactor(COR-1784/COR-1801): Refactored generic types usage * refactor(COR-1784/COR-1801): refactored ternary operator * refactor(COR-1784/COR-1801): Refactored the vaccine-campaign-tile * refactor(COR-1784/COR-1801): Refactored campaign banner * refactor(COR-1784/COR-1801): Refactor schemanames * fix(COR-1784/COR-1801): Fix feature flags * fix(COR-1784/COR-1801): Fix choropleth validation * refactor(COR-1784/COR-1801): Refactored schema names --------- Co-authored-by: J <93984341+VWSCoronaDashboard18@users.noreply.github.com> Co-authored-by: VWSCoronaDashboard29 <137172332+VWSCoronaDashboard29@users.noreply.github.com> Co-authored-by: VWSCoronaDashboard29 <coronadashboard@netcompany.com> Co-authored-by: beek <ben.vaneekelen@netcompany.com> Co-authored-by: VWSCoronaDashboard29 <B> --- .../images/Najaarsronde-coronaprik-hero.svg | 1 + packages/app/schema/archived_gm/__index.json | 4 + ...cine_campaign_coverage_per_age_group.json} | 4 +- .../archived_gm_collection/__index.json | 19 +- .../vaccine_coverage_per_age_group.json | 2 +- ...ine_coverage_per_age_group_choropleth.json | 69 ++++ packages/app/schema/archived_nl/__index.json | 58 ++- .../vaccine_coverage_per_age_group.json | 18 +- .../vaccine_administered.json | 0 .../vaccine_administered_doctors.json | 0 .../vaccine_administered_ggd.json | 0 .../vaccine_administered_ggd_ghor.json | 0 ...tered_hospitals_and_care_institutions.json | 0 .../vaccine_administered_planned.json | 0 .../vaccine_administered_total.json | 0 ...aigns.json => vaccine_campaigns_2022.json} | 4 +- .../archived_nl/vaccine_campaigns_2023.json | 52 +++ .../vaccine_coverage_per_age_group.json | 2 +- ...e_per_age_group_estimated_autumn_2022.json | 0 ..._age_group_estimated_fully_vaccinated.json | 0 packages/app/schema/gm/__index.json | 17 +- .../app/schema/gm_collection/__index.json | 10 +- packages/app/schema/nl/__index.json | 42 +-- packages/app/schema/nl/vaccine_campaigns.json | 6 +- .../src/components/choropleth/logic/types.ts | 9 +- .../components/kpi/components/kpi-content.tsx | 9 +- packages/app/src/components/kpi/types.ts | 9 +- ...use-get-single-coverage-percentage-data.ts | 31 ++ packages/app/src/components/tables/types.ts | 18 +- .../app/src/components/tables/wide-table.tsx | 26 +- ...utumn-2022-shot-coverage-per-age-group.tsx | 18 +- .../index.ts | 1 - .../index.ts | 1 - .../campaign-banner/campaign-banner.tsx | 68 ++++ packages/app/src/domain/vaccine/common.ts | 4 +- packages/app/src/domain/vaccine/index.ts | 2 + .../primary-series-coverage-per-age-group.tsx | 60 +++ .../narrow-vaccine-campaign-table.tsx | 29 +- .../wide-vaccine-campaign-table.tsx | 57 ++- .../vaccine/vaccine-campaigns-tile/types.ts | 7 +- .../vaccine-campaigns-tile.tsx | 16 +- .../vaccine/vaccine-coverage-choropleth.tsx | 37 +- .../src/pages/gemeente/[code]/vaccinaties.tsx | 115 +++--- .../app/src/pages/landelijk/vaccinaties.tsx | 271 +++++++++----- packages/app/src/static-props/get-data.ts | 14 +- packages/cli/src/schema/schema-info.ts | 7 +- .../src/elements/schemas/shared/index.ts | 10 +- packages/cms/src/lokalize/key-mutations.csv | 40 ++ packages/cms/src/studio/constants.ts | 20 +- .../cms/src/studio/data/data-structure.ts | 98 ++--- packages/common/src/feature-flags/features.ts | 8 +- packages/common/src/theme/colors.ts | 19 +- packages/common/src/types/data.ts | 348 +++++++++--------- 53 files changed, 1070 insertions(+), 590 deletions(-) create mode 100644 packages/app/public/images/Najaarsronde-coronaprik-hero.svg rename packages/app/schema/{gm/vaccine_coverage_per_age_group.json => archived_gm/vaccinaties/vaccine_campaign_coverage_per_age_group.json} (94%) rename packages/app/schema/{gm_collection => archived_gm_collection}/vaccine_coverage_per_age_group.json (96%) create mode 100644 packages/app/schema/archived_gm_collection/vaccine_coverage_per_age_group_choropleth.json rename packages/app/schema/{nl => archived_nl/vaccinaties}/vaccine_coverage_per_age_group.json (81%) rename packages/app/schema/{nl => archived_nl}/vaccine_administered.json (100%) rename packages/app/schema/{nl => archived_nl}/vaccine_administered_doctors.json (100%) rename packages/app/schema/{nl => archived_nl}/vaccine_administered_ggd.json (100%) rename packages/app/schema/{nl => archived_nl}/vaccine_administered_ggd_ghor.json (100%) rename packages/app/schema/{nl => archived_nl}/vaccine_administered_hospitals_and_care_institutions.json (100%) rename packages/app/schema/{nl => archived_nl}/vaccine_administered_planned.json (100%) rename packages/app/schema/{nl => archived_nl}/vaccine_administered_total.json (100%) rename packages/app/schema/archived_nl/{vaccine_campaigns.json => vaccine_campaigns_2022.json} (92%) create mode 100644 packages/app/schema/archived_nl/vaccine_campaigns_2023.json rename packages/app/schema/{nl => archived_nl}/vaccine_coverage_per_age_group_estimated_autumn_2022.json (100%) rename packages/app/schema/{nl => archived_nl}/vaccine_coverage_per_age_group_estimated_fully_vaccinated.json (100%) create mode 100644 packages/app/src/components/tables/logic/use-get-single-coverage-percentage-data.ts delete mode 100644 packages/app/src/domain/vaccine/autumn-2022-shot-coverage-per-age-group/index.ts delete mode 100644 packages/app/src/domain/vaccine/booster-shot-coverage-per-age-group/index.ts create mode 100644 packages/app/src/domain/vaccine/campaign-banner/campaign-banner.tsx create mode 100644 packages/app/src/domain/vaccine/primary-series-coverage-per-age-group/primary-series-coverage-per-age-group.tsx diff --git a/packages/app/public/images/Najaarsronde-coronaprik-hero.svg b/packages/app/public/images/Najaarsronde-coronaprik-hero.svg new file mode 100644 index 0000000000..362ce5ed62 --- /dev/null +++ b/packages/app/public/images/Najaarsronde-coronaprik-hero.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="185" height="227" viewBox="0 0 185 227" fill="none"><path fill="#8FCAE7" fill-rule="evenodd" d="M31.206 205.386c-2.116 15.826 49.196 26.149 93.361 18.945 44.165-7.204 64.426-35.337 43.351-50.328-21.075-14.99-134.596 15.556-136.712 31.383Z" clip-rule="evenodd" opacity=".505"/><path fill="#BFFFE3" fill-rule="evenodd" d="m23.528 159.089 24.298-2.9c2.94-.352 5.02-2.977 4.645-5.865L41.345 64.656 6.4 68.828l11.125 85.668c.376 2.888 3.063 4.944 6.003 4.593Z" clip-rule="evenodd"/><path fill="#A5E7CA" fill-rule="evenodd" d="m23.378 159.105 24.408-2.893c2.953-.35 5.04-2.981 4.662-5.877l-6.485-49.601-35.103 4.161 6.485 49.602c.38 2.895 3.08 4.958 6.033 4.608ZM1.31 64.502l43.728-5.337.575 4.527L1.885 69.03l-.576-4.528Z" clip-rule="evenodd"/><mask id="a" width="31" height="23" x="6" y="35" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#fff" d="m36.136 43.164-24.429-7.972L6.735 49.69l24.429 7.972 4.972-14.498Z"/></mask><g mask="url(#a)"><path fill="#A5E7CA" fill-rule="evenodd" d="m8.148 45.742 26.022-3.234.563 4.614-26.022 3.235-.563-4.615Z" clip-rule="evenodd"/></g><path fill="#BFFFE3" fill-rule="evenodd" d="m13.442 49.727 16.423-2.101 1.597 13.184-16.422 2.1-1.598-13.183Z" clip-rule="evenodd"/><path fill="#A5E7CA" fill-rule="evenodd" d="m29.785 158.748 10.896-1.06.617 4.007-10.896 1.06-.617-4.007Zm3.341 3.805 4.888-.519.562 3.91-4.888.519-.562-3.91Z" clip-rule="evenodd"/><path fill="#6459E7" fill-rule="evenodd" d="m10.736 103.324 35.022-4.209.45 3.497-35.02 4.209-.452-3.497Z" clip-rule="evenodd"/><path fill="#4A2CB1" fill-rule="evenodd" d="m38.54 72.65 3.453-.318-.194-1.212-3.452.317.194 1.212Zm-3.662 9.25 8.255-1.095-.169-1.451-8.255 1.094.17 1.452Zm2.213 17.07 8.255-1.094-.169-1.452-8.255 1.094.17 1.452Zm5.179 8.236 4.068-.476-.198-1.499-4.068.476.198 1.499Zm-1.946-17.063 4.068-.475-.198-1.5-4.068.476.198 1.5Zm-1.017 25.889 8.255-1.094-.169-1.451-8.255 1.094.17 1.451Zm5.173 8.244 4.068-.475-.198-1.5-4.068.476.198 1.499Zm-2.96 8.834 8.255-1.094-.169-1.451-8.255 1.094.17 1.451Zm5.176 8.236 4.068-.475-.199-1.499-4.067.475.198 1.499Zm-2.963 8.827 8.255-1.094-.169-1.452-8.255 1.094.17 1.452Z" clip-rule="evenodd"/><path fill="#0C8751" fill-rule="evenodd" d="m14.87 63.143-1.712-13.31-4.54.547-.588-4.571 12.936-1.559L36.64 166.055l-2.491.3-.528-4.1-2.833.341-.528-4.101-6.826.823c-2.941.355-5.627-1.706-6-4.601L6.38 68.807l-4.643.56-.588-4.57 13.721-1.654Z" clip-rule="evenodd" opacity=".3"/><path fill="#4A2CB1" fill-rule="evenodd" d="m39.617 184.557-1.75.268-2.582-20.871 1.75-.269 2.582 20.872Z" clip-rule="evenodd"/><path fill="#BA7F48" fill-rule="evenodd" d="M103.128 71.505c1.774-2.083 2.974-4.634 2.774-7.494-.578-8.239-12.047-6.426-14.278-2.268-2.23 4.158-1.966 14.706.918 15.449 1.15.296 3.599-.43 6.092-1.932l-1.565 11.07h9.239l-3.18-14.825Z" clip-rule="evenodd"/><path fill="#191847" fill-rule="evenodd" d="M96.89 56.955c1.218-.2 4.497-.337 5.102-.337.386 0 .805.088 1.034-.267.187-.29.118-.782.174-1.119.065-.392.157-.778.251-1.164a11.81 11.81 0 0 1 1.229-3.121c1.054-1.84 2.598-3.28 4.548-4.118 2.153-.926 4.589-1.138 6.905-.95 2.478.2 4.722 1.019 7.061 1.789 2.23.733 4.566 1.022 6.898.664 2.349-.36 4.125-1.634 6.107-2.843 2.029-1.238 4.347-2.047 6.746-1.86 2.239.173 4.302 1.097 6.154 2.332 1.732 1.156 3.161 2.546 3.968 4.503.868 2.104.868 4.414-.56 6.274-2.069 2.697-5.91 3.394-9.106 3.324a17.395 17.395 0 0 1-5.409-.99c-2.328-.82-4.339-2.207-6.516-3.333a16.964 16.964 0 0 0-3.185-1.274c-1.075-.304-2.133-.443-3.106.206-1.029.687-1.951 1.361-3.128 1.79a10.085 10.085 0 0 1-3.529.634c-2.34-.018-4.648-.747-6.922-1.236-1.854-.398-3.837-.795-5.728-.412-.788.16-1.94.49-2.225 1.31 4.794.868 6.677 6.798 5.326 11.151-.73 2.35-5.115 5.096-6.82 3.861-1.08-.783-.425-1.81 0-2.488.813-1.299 1.091-2.967-.413-3.871-1.298-.78-2.661 1.072-2.687 1.07-.357-.028-3.438-1.77-5.56-4.313-2.094.124-2.412-1.257-1.912-2.386.5-1.13 3.62-2.55 5.303-2.826Z" clip-rule="evenodd"/><path fill="#BA7F48" fill-rule="evenodd" d="m108.613 118.297-28.607 47.825-21.447 40.432H53.94l35.934-88.257h18.739Z" clip-rule="evenodd"/><path fill="#191847" fill-rule="evenodd" d="M61.382 204.688c.43 1.15.646 2.01.646 2.581 0 .694-.116 1.707-.347 3.039H39.968c-.565-1.865-.239-2.872.977-3.021 1.215-.149 2.225-.283 3.03-.403l10.092-4.499a.385.385 0 0 1 .508.195l.004.01.65 1.574c1.124.525 2.039.787 2.743.787.571 0 1.36-.231 2.368-.692a.769.769 0 0 1 1.042.429Z" clip-rule="evenodd"/><path fill="#CA005D" fill-rule="evenodd" d="m64.517 200.079-8.909-2.695c3.903-11.668 8.687-24.508 14.352-38.52 5.664-14.013 11.747-27.535 18.25-40.567h25.16c-7.229 16.485-14.893 31.464-22.991 44.937-8.099 13.472-16.72 25.754-25.862 36.845Z" clip-rule="evenodd"/><path fill="#BA7F48" fill-rule="evenodd" d="M110.492 118.297c2.7 16.806 7.907 38.277 8.398 38.94.328.442 12.123 4.394 35.384 11.857l-.998 4.073c-27.739-4.002-42.355-7.107-43.848-9.315-2.24-3.312-13.424-29.477-17.755-45.555h18.819Z" clip-rule="evenodd"/><path fill="#E86166" fill-rule="evenodd" d="m146.096 165.573-1.757 6.56c-20.748 1.82-33.46.505-38.138-3.944-4.677-4.45-10.008-21.08-15.992-49.892H114.2c3.792 23.593 5.911 35.885 6.359 36.875.448.991 8.96 4.457 25.536 10.401Z" clip-rule="evenodd"/><path fill="#191847" fill-rule="evenodd" d="M153.137 167.394c1.207-.225 2.092-.288 2.654-.189.684.121 1.661.411 2.933.87l-3.771 21.384c-1.935.231-2.87-.264-2.806-1.487.065-1.223.108-2.241.13-3.054l-2.679-10.72a.386.386 0 0 1 .281-.467l.01-.003 1.663-.365c.712-1.017 1.13-1.872 1.252-2.565.099-.563.009-1.381-.271-2.453a.77.77 0 0 1 .604-.951Z" clip-rule="evenodd"/><path fill="#BA7F48" fill-rule="evenodd" d="m75.488 112.18-10.905 10.639c-3.173 1.353-5.773 2.848-7.8 4.483-.456.55-.952 1.603 1.192 1.132 2.145-.471 4.422-.871 4.825-.173.403.697-.785 1.766-.04 2.678.497.609 2.167-1.327 5.01-5.806l11.34-6.686-3.622-6.267Zm48.406 1.5-8.045.032c4.968 16.036 7.65 24.544 8.045 25.525.891 2.208-.994 5.57-1.8 7.377 2.626 1.175 2.346-3.176 5.658-1.635 3.023 1.406 5.323 3.955 8.816 1.8.429-.265.9-1.263-.237-2.043-2.833-1.942-6.915-5.341-7.466-6.46-.753-1.526-2.409-9.725-4.971-24.596Z" clip-rule="evenodd"/><path fill="#0D99FF" fill-rule="evenodd" d="m101.032 79.918-3.33-.57c-5.73 14.317-15.737 27.326-30.019 39.027l10.792 13.111c14.28-16.661 23.082-33.85 22.557-51.568Z" clip-rule="evenodd"/><path fill="#DDE3E9" fill-rule="evenodd" d="M115.545 121.755H85.901C92.77 105.056 96.203 90.871 96.203 79.2l8.942-1.333c7.027 11.303 9.012 25.218 10.4 43.888Z" clip-rule="evenodd"/><path fill="#8FCAE7" fill-rule="evenodd" d="m105.334 77.874-.003-.007h-.584c-.698.024-1.762.068-3.191.13l-2.161 6.175c-.229 7.529-1.563 22.7-4.004 45.516h19.432a118.195 118.195 0 0 1-.252 4.771h14.448c-2.161-24.383-10.054-43.247-23.678-56.592l-.007.007Z" clip-rule="evenodd"/><path fill="#0D99FF" fill-rule="evenodd" d="M113.536 109.523c-.553 9.823-1.937 16.595-4.154 20.315h5.433c.238-7.067-.188-13.839-1.279-20.315Z" clip-rule="evenodd"/><path fill="#fff" fill-opacity=".2" fill-rule="evenodd" d="m110.494 117.908-9.582-4.455v4.455h9.582Z" clip-rule="evenodd"/><path fill="#8FCAE7" fill-rule="evenodd" d="m72.01 63.406 6.966-4.875-.634-.906-6.965 4.875.634.906Zm-4.42-2.752 1.006-5.34-1.087-.205-1.006 5.34 1.087.205Zm-12.118-5.09 5.03 6.191.858-.697-5.03-6.19-.858.696Zm24.958 10.28h-6.58v1.106h6.578v-1.106Zm-7.613 6.183 5.727 3.096.526-.973-5.727-3.095-.526.972Zm-4.89 2.968 3.327 8.358 1.028-.41-3.328-8.357-1.027.409Zm-3.281.715-.774 4.644 1.09.182.775-4.643-1.091-.182Zm-4.173-2.382-3.096 4.643.92.614 3.096-4.643-.92-.614Zm-2.762-3.633-7.893 1.858.253 1.076 7.894-1.857-.254-1.077Zm.881-4.928-5.495-2.322-.43 1.019 5.494 2.322.43-1.02Z" clip-rule="evenodd"/><path fill="#8FCAE7" d="M79.27 60.285a2.283 2.283 0 1 1 0-4.566 2.283 2.283 0 0 1 0 4.566Z"/><path fill="#01689B" d="M65.96 77.966c-5.514 0-9.984-4.47-9.984-9.983 0-5.513 4.47-9.983 9.983-9.983 5.514 0 9.983 4.47 9.983 9.983 0 5.513-4.47 9.983-9.983 9.983Z"/><path fill="#8FCAE7" fill-rule="evenodd" d="M79.27 55.99a2.006 2.006 0 1 1 0 4.013 2.006 2.006 0 0 1 0-4.013Zm2.56 2.007a2.56 2.56 0 1 0-5.119 0 2.56 2.56 0 0 0 5.12 0Z" clip-rule="evenodd"/><path fill="#8FCAE7" d="M54.974 56.18a2.05 2.05 0 1 1 0-4.102 2.05 2.05 0 0 1 0 4.102Z"/><path fill="#8FCAE7" fill-rule="evenodd" d="M54.974 52.358a1.774 1.774 0 1 1 0 3.548 1.774 1.774 0 0 1 0-3.548Zm2.327 1.774a2.327 2.327 0 1 0-4.654 0 2.327 2.327 0 0 0 4.654 0Z" clip-rule="evenodd"/><path fill="#8FCAE7" d="M48.697 74.442a2.206 2.206 0 1 1 0-4.41 2.206 2.206 0 0 1 0 4.41Z"/><path fill="#8FCAE7" fill-rule="evenodd" d="M48.702 70.319a1.93 1.93 0 1 1 0 3.858 1.93 1.93 0 0 1 0-3.859Zm2.482 1.929a2.482 2.482 0 1 0-4.964 0 2.482 2.482 0 0 0 4.964 0Z" clip-rule="evenodd"/><path fill="#8FCAE7" d="M72.112 86.444a2.554 2.554 0 1 1 0-5.108 2.554 2.554 0 0 1 0 5.108Z"/><path fill="#8FCAE7" fill-rule="evenodd" d="M72.115 81.608a2.277 2.277 0 1 1 0 4.554 2.277 2.277 0 0 1 0-4.555Zm2.83 2.277a2.83 2.83 0 1 0-5.66 0 2.83 2.83 0 0 0 5.66 0Z" clip-rule="evenodd"/><path fill="#8FCAE7" d="M80.625 67.792a1.47 1.47 0 1 1 0-2.94 1.47 1.47 0 0 1 0 2.94Z"/><path fill="#8FCAE7" fill-rule="evenodd" d="M80.627 65.123a1.194 1.194 0 1 1 0 2.388 1.194 1.194 0 0 1 0-2.388Zm1.747 1.194a1.747 1.747 0 1 0-3.493 0 1.747 1.747 0 0 0 3.493 0Z" clip-rule="evenodd"/><path fill="#8FCAE7" d="M70.878 67.321a.774.774 0 1 1 0-1.547.774.774 0 0 1 0 1.547Z"/><path fill="#8FCAE7" fill-rule="evenodd" d="M70.878 66.06a.497.497 0 1 1 0 .996.497.497 0 0 1 0-.995Zm1.05.498a1.05 1.05 0 1 0-2.1 0 1.05 1.05 0 0 0 2.1 0Z" clip-rule="evenodd"/><path fill="#8FCAE7" d="M67.896 64.69a1.896 1.896 0 1 1 0-3.792 1.896 1.896 0 0 1 0 3.792Z"/><path fill="#8FCAE7" fill-rule="evenodd" d="M67.896 61.178a1.62 1.62 0 1 1 0 3.239 1.62 1.62 0 0 1 0-3.24Zm2.173 1.62a2.172 2.172 0 1 0-4.345 0 2.172 2.172 0 0 0 4.345 0Z" clip-rule="evenodd"/><path fill="#8FCAE7" d="M63.564 75.296a1.277 1.277 0 1 1 0-2.554 1.277 1.277 0 0 1 0 2.554Z"/><path fill="#8FCAE7" fill-rule="evenodd" d="M63.564 73.014a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm1.554 1a1.553 1.553 0 1 0-3.107 0 1.553 1.553 0 0 0 3.107 0Z" clip-rule="evenodd"/><path fill="#8FCAE7" d="M66.35 71.113a1.045 1.045 0 1 1 0-2.09 1.045 1.045 0 0 1 0 2.09Z"/><path fill="#8FCAE7" fill-rule="evenodd" d="M66.352 69.303a.768.768 0 1 1 0 1.536.768.768 0 0 1 0-1.536Zm1.321.768a1.321 1.321 0 1 0-2.642 0 1.321 1.321 0 0 0 2.642 0Z" clip-rule="evenodd"/><path fill="#8FCAE7" d="M61.047 70.416a.696.696 0 1 1 0-1.393.696.696 0 0 1 0 1.393Z"/><path fill="#8FCAE7" fill-rule="evenodd" d="M61.045 69.303a.42.42 0 1 1 0 .84.42.42 0 0 1 0-.84Zm.973.42a.973.973 0 1 0-1.946 0 .973.973 0 0 0 1.946 0Z" clip-rule="evenodd"/><path fill="#8FCAE7" d="M70.182 74.293a.62.62 0 1 1 0-1.238.62.62 0 0 1 0 1.238Z"/><path fill="#8FCAE7" fill-rule="evenodd" d="M70.181 73.326a.343.343 0 1 1 0 .686.343.343 0 0 1 0-.686Zm.896.343a.896.896 0 1 0-1.791 0 .896.896 0 0 0 1.79 0ZM68.13 52.442a1.304 1.304 0 1 1 0 2.609 1.304 1.304 0 0 1 0-2.61Zm2.41 1.304a2.41 2.41 0 1 0-4.82 0 2.41 2.41 0 0 0 4.82 0Zm-19.053 7.055a1.305 1.305 0 1 1 0 2.61 1.305 1.305 0 0 1 0-2.61Zm2.41 1.304a2.41 2.41 0 1 0-4.82 0 2.41 2.41 0 0 0 4.82 0Zm26.194 12.391a.879.879 0 1 1 0 1.758.879.879 0 0 1 0-1.758Zm1.985.88a1.985 1.985 0 1 0-3.97 0 1.985 1.985 0 0 0 3.97 0Zm-25.4 3.074a1.691 1.691 0 1 1 0 3.382 1.691 1.691 0 0 1 0-3.382Zm2.797 1.69a2.797 2.797 0 1 0-5.594 0 2.797 2.797 0 0 0 5.594 0Zm4.826.552a.879.879 0 1 1 0 1.757.879.879 0 0 1 0-1.757Zm1.984.879a1.985 1.985 0 1 0-3.969 0 1.985 1.985 0 0 0 3.97 0Z" clip-rule="evenodd"/><path fill="#8FCAE7" d="M61.63 66.245a1.509 1.509 0 1 1 0-3.018 1.509 1.509 0 0 1 0 3.018Z"/><path fill="#8FCAE7" fill-rule="evenodd" d="M61.63 63.498a1.233 1.233 0 1 1 0 2.465 1.233 1.233 0 0 1 0-2.465Zm1.785 1.233a1.786 1.786 0 1 0-3.57 0 1.786 1.786 0 0 0 3.57 0Z" clip-rule="evenodd"/><path fill="#CEC8FE" fill-rule="evenodd" d="m130.67 21.884-8.053 2.727-.354-1.047 8.052-2.728.355 1.048Zm.4-5.191-4.899-2.35.478-.996 4.899 2.35-.478.996Zm3.066-12.78 2.013 7.719-1.07.279-2.013-7.72 1.07-.278Zm-6.484 26.201 3.893-5.301.891.654-3.893 5.302-.891-.655Zm9.488-2.474-.895 6.447-1.095-.152.895-6.448 1.095.153Zm5.289-2.186 4.767 7.63-.938.585-4.767-7.63.938-.585Zm2.516-2.224 4.201 2.125-.499.987-4.201-2.125.499-.987Zm.548-4.774 5.575.254-.05 1.104-5.575-.253.05-1.105Zm-1.293-4.372 6.169-5.263.718.84-6.17 5.264-.717-.841Zm-4.494-2.209 1.381-5.802 1.076.256-1.381 5.802-1.076-.256Z" clip-rule="evenodd"/><path fill="#6459E7" d="M145.987 25.627c3.264-4.444 2.307-10.692-2.137-13.955-4.444-3.264-10.692-2.307-13.956 2.137-3.263 4.444-2.306 10.692 2.138 13.955 4.444 3.264 10.692 2.307 13.955-2.137Z"/><path fill="#CEC8FE" fill-rule="evenodd" d="M120.497 26.599a2.56 2.56 0 1 1 3.032-4.127 2.56 2.56 0 0 1-3.032 4.127ZM131.9 4.539a2.327 2.327 0 1 1 2.754-3.751 2.327 2.327 0 0 1-2.754 3.751Zm18.217 5.791a2.481 2.481 0 1 1 2.937-4 2.481 2.481 0 0 1-2.937 4Zm-4.675 26.043a2.83 2.83 0 1 1 3.35-4.562 2.83 2.83 0 0 1-3.35 4.562Zm-18.559-4.41a1.746 1.746 0 1 1 2.067-2.816 1.746 1.746 0 0 1-2.067 2.816Zm6.37-8.283a1.05 1.05 0 1 1 1.24-1.693 1.05 1.05 0 0 1-1.24 1.693Zm-1.925-3.721a2.173 2.173 0 1 1 2.572-3.502 2.173 2.173 0 0 1-2.572 3.502Zm11.975 2.652a1.553 1.553 0 1 1 1.837-2.504 1.553 1.553 0 0 1-1.837 2.504Zm-4.695-.278a1.321 1.321 0 1 1 1.564-2.13 1.321 1.321 0 0 1-1.564 2.13Zm3.067-4.764a.973.973 0 1 1 1.152-1.57.973.973 0 0 1-1.152 1.57Zm-2.181 9.639a.895.895 0 1 1 1.058-1.443.895.895 0 0 1-1.058 1.443Zm-15.366-14.942a1.304 1.304 0 1 0 2.1 1.545 1.304 1.304 0 0 0-2.1-1.545Zm-.376 2.715a2.411 2.411 0 1 1 2.854-3.883 2.411 2.411 0 0 1-2.854 3.883ZM140.715 3.8a1.304 1.304 0 1 0 2.103 1.544 1.304 1.304 0 0 0-2.103-1.544Zm-.375 2.714a2.41 2.41 0 1 1 2.853-3.885 2.41 2.41 0 0 1-2.853 3.885Zm-5.515 28.446a.878.878 0 1 0 1.415 1.041.878.878 0 0 0-1.415-1.04Zm-.467 2.12a1.986 1.986 0 1 1 2.352-3.2 1.986 1.986 0 0 1-2.352 3.2Zm17.509-18.654a1.691 1.691 0 1 0 2.726 2.002 1.691 1.691 0 0 0-2.726-2.002Zm-.292 3.255a2.797 2.797 0 1 1 3.31-4.51 2.797 2.797 0 0 1-3.31 4.51Zm-2.414 4.217a.878.878 0 1 0 1.415 1.04.878.878 0 0 0-1.415-1.04Zm-.467 2.12a1.986 1.986 0 1 1 2.352-3.2 1.986 1.986 0 0 1-2.352 3.2Zm-11.869-12.273a1.787 1.787 0 0 1 2.114-2.879 1.785 1.785 0 1 1-2.114 2.879Z" clip-rule="evenodd"/><path fill="#1FB573" fill-rule="evenodd" d="m172.335 95.322 8.51-5.957-.775-1.107-8.51 5.957.775 1.107Zm-5.401-3.36 1.229-6.524-1.328-.25-1.229 6.524 1.328.25Zm-14.804-6.219 6.146 7.564 1.049-.852-6.147-7.564-1.048.852Zm30.494 12.562h-8.037v1.35h8.037v-1.35Zm-9.3 7.555 6.997 3.783.643-1.189-6.998-3.782-.642 1.188Zm-5.979 3.632 4.066 10.212 1.256-.5-4.066-10.212-1.256.5Zm-4.009.867-.946 5.674 1.333.222.945-5.674-1.332-.222Zm-5.097-2.914-3.782 5.674 1.124.749 3.783-5.673-1.125-.75Zm-3.371-4.437-9.645 2.269.31 1.315 9.645-2.269-.31-1.315Zm1.075-6.023-6.713-2.837-.526 1.245 6.713 2.837.526-1.245Z" clip-rule="evenodd"/><path fill="#1FB573" d="M181.205 91.516a2.79 2.79 0 1 1 0-5.579 2.79 2.79 0 0 1 0 5.58Z"/><path fill="#A5E7CA" d="M164.945 113.122c-6.737 0-12.198-5.461-12.198-12.198 0-6.736 5.461-12.197 12.198-12.197 6.736 0 12.197 5.46 12.197 12.197 0 6.737-5.461 12.198-12.197 12.198Z"/><path fill="#1FB573" fill-rule="evenodd" d="M181.21 86.261a2.451 2.451 0 1 1 0 4.903 2.451 2.451 0 0 1 0-4.903Zm3.127 2.452a3.127 3.127 0 1 0-6.254 0 3.127 3.127 0 0 0 6.254 0Z" clip-rule="evenodd"/><path fill="#1FB573" d="M151.52 86.504a2.506 2.506 0 1 1 0-5.012 2.506 2.506 0 0 1 0 5.012Z"/><path fill="#1FB573" fill-rule="evenodd" d="M151.519 81.824a2.168 2.168 0 1 1 0 4.335 2.168 2.168 0 0 1 0-4.335Zm2.844 2.168a2.844 2.844 0 1 0-5.687 0 2.844 2.844 0 0 0 5.687 0Z" clip-rule="evenodd"/><path fill="#1FB573" d="M143.852 108.812a2.695 2.695 0 1 1 0-5.39 2.695 2.695 0 0 1 0 5.39Z"/><path fill="#1FB573" fill-rule="evenodd" d="M143.859 103.769a2.357 2.357 0 1 1 0 4.715 2.357 2.357 0 0 1 0-4.715Zm3.033 2.357a3.033 3.033 0 1 0-6.066.002 3.033 3.033 0 0 0 6.066-.002Z" clip-rule="evenodd"/><path fill="#1FB573" d="M172.461 123.467a3.12 3.12 0 1 1 0-6.24 3.12 3.12 0 0 1 0 6.24Z"/><path fill="#1FB573" fill-rule="evenodd" d="M172.463 117.574a2.783 2.783 0 1 1 0 5.566 2.783 2.783 0 0 1 0-5.566Zm3.458 2.783a3.459 3.459 0 1 0-6.917 0 3.459 3.459 0 0 0 6.917 0Z" clip-rule="evenodd"/><path fill="#1FB573" d="M182.866 100.679a1.796 1.796 0 1 1 0-3.592 1.796 1.796 0 0 1 0 3.592Z"/><path fill="#1FB573" fill-rule="evenodd" d="M182.866 97.433a1.459 1.459 0 1 1-.001 2.918 1.459 1.459 0 0 1 .001-2.918Zm2.134 1.46a2.135 2.135 0 1 0-4.27 0 2.135 2.135 0 0 0 4.27 0Z" clip-rule="evenodd"/><path fill="#1FB573" d="M170.953 100.118a.945.945 0 1 1 0-1.89.945.945 0 0 1 0 1.89Z"/><path fill="#1FB573" fill-rule="evenodd" d="M170.952 98.558a.608.608 0 1 1 0 1.216.608.608 0 0 1 0-1.216Zm1.284.608a1.284 1.284 0 1 0-2.568.001 1.284 1.284 0 0 0 2.568 0Z" clip-rule="evenodd"/><path fill="#1FB573" d="M167.311 96.899a2.317 2.317 0 1 1 0-4.633 2.317 2.317 0 0 1 0 4.633Z"/><path fill="#1FB573" fill-rule="evenodd" d="M167.307 92.605a1.979 1.979 0 1 1 0 3.958 1.979 1.979 0 0 1 0-3.958Zm2.655 1.98a2.655 2.655 0 1 0-5.31 0 2.655 2.655 0 0 0 5.31 0Z" clip-rule="evenodd"/><path fill="#1FB573" d="M162.016 109.863a1.56 1.56 0 1 1 .002-3.122 1.56 1.56 0 0 1-.002 3.122Z"/><path fill="#1FB573" fill-rule="evenodd" d="M162.016 107.066a1.222 1.222 0 1 1 0 2.444 1.222 1.222 0 0 1 0-2.444Zm1.898 1.223a1.898 1.898 0 1 0-3.795 0 1.898 1.898 0 0 0 3.795 0Z" clip-rule="evenodd"/><path fill="#1FB573" d="M165.42 104.748a1.276 1.276 0 1 1-.001-2.553 1.276 1.276 0 0 1 .001 2.553Z"/><path fill="#1FB573" fill-rule="evenodd" d="M165.422 102.535a.938.938 0 1 1 0 1.877.938.938 0 0 1 0-1.877Zm1.614.939a1.615 1.615 0 1 0-3.23 0 1.615 1.615 0 0 0 3.23 0Z" clip-rule="evenodd"/><path fill="#1FB573" d="M158.941 103.897a.851.851 0 1 1 0-1.702.851.851 0 0 1 0 1.702Z"/><path fill="#1FB573" fill-rule="evenodd" d="M158.937 102.535a.513.513 0 1 1 0 1.026.513.513 0 0 1 0-1.026Zm1.189.513a1.19 1.19 0 1 0-2.378 0 1.19 1.19 0 0 0 2.378 0Z" clip-rule="evenodd"/><path fill="#1FB573" d="M170.101 108.63a.757.757 0 1 1 0-1.514.757.757 0 0 1 0 1.514Z"/><path fill="#1FB573" fill-rule="evenodd" d="M170.103 107.449a.418.418 0 1 1 0 .836.418.418 0 0 1 0-.836Zm1.094.419a1.094 1.094 0 1 0-2.189-.001 1.094 1.094 0 0 0 2.189.001Zm-3.603-25.938a1.593 1.593 0 1 1 .001 3.186 1.593 1.593 0 0 1-.001-3.187Zm2.945 1.593a2.945 2.945 0 1 0-5.89 0 2.945 2.945 0 0 0 5.89 0ZM147.26 92.14a1.594 1.594 0 1 1 0 3.188 1.594 1.594 0 0 1 0-3.188Zm2.945 1.594a2.945 2.945 0 1 0-5.89 0 2.945 2.945 0 0 0 5.89 0Zm32.003 15.14a1.074 1.074 0 1 1 0 2.148 1.074 1.074 0 0 1 0-2.148Zm2.425 1.074a2.425 2.425 0 1 0-4.85 0 2.425 2.425 0 0 0 4.85 0Zm-31.033 3.755a2.066 2.066 0 1 1 .002 4.132 2.066 2.066 0 0 1-.002-4.132Zm3.418 2.066a3.417 3.417 0 1 0-6.835 0 3.417 3.417 0 0 0 6.835 0Zm5.897.676a1.073 1.073 0 1 1 0 2.147 1.073 1.073 0 0 1 0-2.147Zm2.424 1.074a2.424 2.424 0 1 0-4.848-.002 2.424 2.424 0 0 0 4.848.002Z" clip-rule="evenodd"/><path fill="#1FB573" d="M159.655 98.797a1.844 1.844 0 1 1 0-3.688 1.844 1.844 0 0 1 0 3.688Z"/><path fill="#1FB573" fill-rule="evenodd" d="M159.655 95.441a1.507 1.507 0 1 1-.001 3.013 1.507 1.507 0 0 1 .001-3.013Zm2.181 1.506a2.182 2.182 0 1 0-4.363 0 2.182 2.182 0 0 0 4.363 0Z" clip-rule="evenodd"/></svg> \ No newline at end of file diff --git a/packages/app/schema/archived_gm/__index.json b/packages/app/schema/archived_gm/__index.json index 5416edf2b7..7e3885b0ca 100644 --- a/packages/app/schema/archived_gm/__index.json +++ b/packages/app/schema/archived_gm/__index.json @@ -14,6 +14,7 @@ "name", "vaccine_coverage_per_age_group_archived_20220622", "vaccine_coverage_per_age_group_archived_20220908", + "vaccine_coverage_per_age_group_archived_20231004", "tested_overall_archived_20230331" ], "properties": { @@ -41,6 +42,9 @@ "vaccine_coverage_per_age_group_archived_20220908": { "$ref": "vaccine_coverage_per_age_group_with_booster_shot.json" }, + "vaccine_coverage_per_age_group_archived_20231004": { + "$ref": "vaccinaties/vaccine_campaign_coverage_per_age_group.json" + }, "booster_coverage_archived_20220904": { "$ref": "booster_coverage.json" }, diff --git a/packages/app/schema/gm/vaccine_coverage_per_age_group.json b/packages/app/schema/archived_gm/vaccinaties/vaccine_campaign_coverage_per_age_group.json similarity index 94% rename from packages/app/schema/gm/vaccine_coverage_per_age_group.json rename to packages/app/schema/archived_gm/vaccinaties/vaccine_campaign_coverage_per_age_group.json index d98a04f721..f31ee2d9d8 100644 --- a/packages/app/schema/gm/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/archived_gm/vaccinaties/vaccine_campaign_coverage_per_age_group.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "gm_vaccine_coverage_per_age_group", + "title": "archived_gm_vaccine_campaign_coverage_per_age_group", "type": "object", "required": ["values"], "additionalProperties": false, @@ -14,7 +14,7 @@ }, "definitions": { "value": { - "title": "gm_vaccine_coverage_per_age_group_value", + "title": "archived_gm_vaccine_campaign_coverage_per_age_group_value", "additionalProperties": false, "type": "object", "required": [ diff --git a/packages/app/schema/archived_gm_collection/__index.json b/packages/app/schema/archived_gm_collection/__index.json index 662345ffd9..8b67f9ac7b 100644 --- a/packages/app/schema/archived_gm_collection/__index.json +++ b/packages/app/schema/archived_gm_collection/__index.json @@ -3,7 +3,16 @@ "type": "object", "title": "archived_gm_collection", "additionalProperties": false, - "required": ["last_generated", "proto_name", "name", "code", "hospital_nice_choropleth_archived_20230830", "sewer_archived_20230623", "tested_overall_archived_20230331"], + "required": [ + "last_generated", + "proto_name", + "name", + "code", + "hospital_nice_choropleth_archived_20230830", + "sewer_archived_20230623", + "tested_overall_archived_20230331", + "vaccine_coverage_per_age_group_choropleth_archived_20231004" + ], "properties": { "last_generated": { "type": "string" @@ -40,6 +49,14 @@ "items": { "$ref": "positive_tests/tested_overall.json" } + }, + "vaccine_coverage_per_age_group_choropleth_archived_20231004": { + "type": "array", + "minItems": 684, + "maxItems": 684, + "items": { + "$ref": "vaccine_coverage_per_age_group_choropleth.json" + } } }, "$defs": { diff --git a/packages/app/schema/gm_collection/vaccine_coverage_per_age_group.json b/packages/app/schema/archived_gm_collection/vaccine_coverage_per_age_group.json similarity index 96% rename from packages/app/schema/gm_collection/vaccine_coverage_per_age_group.json rename to packages/app/schema/archived_gm_collection/vaccine_coverage_per_age_group.json index 464ecf98b6..cc56a71944 100644 --- a/packages/app/schema/gm_collection/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/archived_gm_collection/vaccine_coverage_per_age_group.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "gm_collection_vaccine_coverage_per_age_group", + "title": "archived_gm_collection_vaccine_coverage_per_age_group", "type": "object", "additionalProperties": false, "required": [ diff --git a/packages/app/schema/archived_gm_collection/vaccine_coverage_per_age_group_choropleth.json b/packages/app/schema/archived_gm_collection/vaccine_coverage_per_age_group_choropleth.json new file mode 100644 index 0000000000..07a7bb6f54 --- /dev/null +++ b/packages/app/schema/archived_gm_collection/vaccine_coverage_per_age_group_choropleth.json @@ -0,0 +1,69 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "archived_gm_collection_vaccine_coverage_per_age_group_choropleth", + "type": "object", + "additionalProperties": false, + "required": [ + "gmcode", + "vaccination_type", + "birthyear_range_12_plus", + "birthyear_range_18_plus", + "birthyear_range_60_plus", + "vaccinated_percentage_12_plus", + "vaccinated_percentage_12_plus_label", + "vaccinated_percentage_18_plus", + "vaccinated_percentage_18_plus_label", + "vaccinated_percentage_60_plus", + "vaccinated_percentage_60_plus_label", + "date_of_insertion_unix", + "date_unix" + ], + "properties": { + "gmcode": { + "type": "string", + "pattern": "^GM[0-9]+$" + }, + "vaccination_type": { + "type": "string" + }, + "birthyear_range_12_plus": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" + }, + "birthyear_range_18_plus": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" + }, + "birthyear_range_60_plus": { + "type": ["string", "null"], + "pattern": "^[0-9]{4}-[0-9]{4}$|^-[0-9]{4}$|^[0-9]{4}-$" + }, + "vaccinated_percentage_12_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_12_plus_label": { + "type": ["string", "null"], + "pattern": "^([><][=][0-9]{1,2})$" + }, + "vaccinated_percentage_18_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_18_plus_label": { + "type": ["string", "null"], + "pattern": "^([><][=][0-9]{1,2})$" + }, + "vaccinated_percentage_60_plus": { + "type": ["number", "null"] + }, + "vaccinated_percentage_60_plus_label": { + "type": ["string", "null"], + "pattern": "^([><][=][0-9]{1,2})$" + }, + "date_unix": { + "type": "integer" + }, + "date_of_insertion_unix": { + "type": "integer" + } + } +} diff --git a/packages/app/schema/archived_nl/__index.json b/packages/app/schema/archived_nl/__index.json index ed9fef3b42..7322cb6794 100644 --- a/packages/app/schema/archived_nl/__index.json +++ b/packages/app/schema/archived_nl/__index.json @@ -22,20 +22,31 @@ "nursing_home_archived_20230126", "reproduction_archived_20230711", "sewer_archived_20230623", - "vaccine_campaigns_archived_20220908", - "vaccine_planned_archived_20220908", + "vaccine_administered_archived_20220914", + "vaccine_administered_doctors_archived_20220324", + "vaccine_administered_ggd_archived_20220324", + "vaccine_administered_ggd_ghor_archived_20220324", + "vaccine_administered_hospitals_and_care_institutions_archived_20220324", + "vaccine_administered_planned_archived_20220518", + "vaccine_administered_total_archived_20220324", + "vaccine_coverage_archived_20220518", "vaccine_coverage_per_age_group_archived_20220622", "vaccine_coverage_per_age_group_archived_20220908", + "vaccine_coverage_per_age_group_archived_20231004", "vaccine_coverage_per_age_group_estimated_archived_20220908", + "vaccine_coverage_per_age_group_estimated_autumn_2022_archived_20231004", + "vaccine_coverage_per_age_group_estimated_fully_vaccinated_archived_20231004", + "vaccine_campaigns_archived_20220908", + "vaccine_campaigns_archived_20231004", + "vaccine_planned_archived_20220908", + "vaccine_vaccinated_or_support_archived_20230411", + "vaccine_delivery_per_supplier_archived_20211101", + "vaccine_stock_archived_20211024", "tested_ggd_archived_20230321", "tested_overall_archived_20230331", "tested_per_age_group_archived_20230331", "vulnerable_hospital_admissions_archived_20230711", "vulnerable_nursing_home_archived_20230711", - "vaccine_vaccinated_or_support_archived_20230411", - "vaccine_coverage_archived_20220518", - "vaccine_delivery_per_supplier_archived_20211101", - "vaccine_stock_archived_20211024", "repeating_shot_administered_20220713", "corona_melder_app_warning_archived_20220421", "corona_melder_app_download_archived_20220421", @@ -107,7 +118,10 @@ "$ref": "sewer.json" }, "vaccine_campaigns_archived_20220908": { - "$ref": "vaccine_campaigns.json" + "$ref": "vaccine_campaigns_2022.json" + }, + "vaccine_campaigns_archived_20231004": { + "$ref": "vaccine_campaigns_2023.json" }, "vaccine_planned_archived_20220908": { "$ref": "vaccine_planned.json" @@ -133,9 +147,39 @@ "vaccine_vaccinated_or_support_archived_20230411": { "$ref": "vaccine_vaccinated_or_support.json" }, + "vaccine_administered_archived_20220914": { + "$ref": "vaccine_administered.json" + }, + "vaccine_administered_doctors_archived_20220324": { + "$ref": "vaccine_administered_doctors.json" + }, + "vaccine_administered_ggd_ghor_archived_20220324": { + "$ref": "vaccine_administered_ggd_ghor.json" + }, + "vaccine_administered_ggd_archived_20220324": { + "$ref": "vaccine_administered_ggd.json" + }, + "vaccine_administered_hospitals_and_care_institutions_archived_20220324": { + "$ref": "vaccine_administered_hospitals_and_care_institutions.json" + }, + "vaccine_administered_total_archived_20220324": { + "$ref": "vaccine_administered_total.json" + }, + "vaccine_administered_planned_archived_20220518": { + "$ref": "vaccine_administered_planned.json" + }, "vaccine_coverage_archived_20220518": { "$ref": "vaccine_coverage.json" }, + "vaccine_coverage_per_age_group_archived_20231004": { + "$ref": "vaccinaties/vaccine_coverage_per_age_group.json" + }, + "vaccine_coverage_per_age_group_estimated_autumn_2022_archived_20231004": { + "$ref": "vaccine_coverage_per_age_group_estimated_autumn_2022.json" + }, + "vaccine_coverage_per_age_group_estimated_fully_vaccinated_archived_20231004": { + "$ref": "vaccine_coverage_per_age_group_estimated_fully_vaccinated.json" + }, "vaccine_delivery_per_supplier_archived_20211101": { "$ref": "vaccine_delivery_per_supplier.json" }, diff --git a/packages/app/schema/nl/vaccine_coverage_per_age_group.json b/packages/app/schema/archived_nl/vaccinaties/vaccine_coverage_per_age_group.json similarity index 81% rename from packages/app/schema/nl/vaccine_coverage_per_age_group.json rename to packages/app/schema/archived_nl/vaccinaties/vaccine_coverage_per_age_group.json index b9d8acd305..c02db4ff9e 100644 --- a/packages/app/schema/nl/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/archived_nl/vaccinaties/vaccine_coverage_per_age_group.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_vaccine_coverage_per_age_group", + "title": "archived_nl_vaccine_coverage_per_age_group_autumn_2022", "type": "object", "required": ["values"], "additionalProperties": false, @@ -14,7 +14,7 @@ }, "definitions": { "value": { - "title": "nl_vaccine_coverage_per_age_group_value", + "title": "archived_nl_vaccine_coverage_per_age_group_value", "additionalProperties": false, "type": "object", "required": [ @@ -33,17 +33,7 @@ "properties": { "age_group_range": { "type": "string", - "enum": [ - "5-11", - "12-17", - "18-29", - "30-39", - "40-49", - "50-59", - "60-69", - "70-79", - "80+" - ] + "enum": ["5-11", "12-17", "18-29", "30-39", "40-49", "50-59", "60-69", "70-79", "80+"] }, "age_group_percentage": { "type": "number" @@ -52,7 +42,7 @@ "type": "integer" }, "autumn_2022_vaccinated": { - "type":["integer", "null"] + "type": ["integer", "null"] }, "fully_vaccinated": { "type": "integer" diff --git a/packages/app/schema/nl/vaccine_administered.json b/packages/app/schema/archived_nl/vaccine_administered.json similarity index 100% rename from packages/app/schema/nl/vaccine_administered.json rename to packages/app/schema/archived_nl/vaccine_administered.json diff --git a/packages/app/schema/nl/vaccine_administered_doctors.json b/packages/app/schema/archived_nl/vaccine_administered_doctors.json similarity index 100% rename from packages/app/schema/nl/vaccine_administered_doctors.json rename to packages/app/schema/archived_nl/vaccine_administered_doctors.json diff --git a/packages/app/schema/nl/vaccine_administered_ggd.json b/packages/app/schema/archived_nl/vaccine_administered_ggd.json similarity index 100% rename from packages/app/schema/nl/vaccine_administered_ggd.json rename to packages/app/schema/archived_nl/vaccine_administered_ggd.json diff --git a/packages/app/schema/nl/vaccine_administered_ggd_ghor.json b/packages/app/schema/archived_nl/vaccine_administered_ggd_ghor.json similarity index 100% rename from packages/app/schema/nl/vaccine_administered_ggd_ghor.json rename to packages/app/schema/archived_nl/vaccine_administered_ggd_ghor.json diff --git a/packages/app/schema/nl/vaccine_administered_hospitals_and_care_institutions.json b/packages/app/schema/archived_nl/vaccine_administered_hospitals_and_care_institutions.json similarity index 100% rename from packages/app/schema/nl/vaccine_administered_hospitals_and_care_institutions.json rename to packages/app/schema/archived_nl/vaccine_administered_hospitals_and_care_institutions.json diff --git a/packages/app/schema/nl/vaccine_administered_planned.json b/packages/app/schema/archived_nl/vaccine_administered_planned.json similarity index 100% rename from packages/app/schema/nl/vaccine_administered_planned.json rename to packages/app/schema/archived_nl/vaccine_administered_planned.json diff --git a/packages/app/schema/nl/vaccine_administered_total.json b/packages/app/schema/archived_nl/vaccine_administered_total.json similarity index 100% rename from packages/app/schema/nl/vaccine_administered_total.json rename to packages/app/schema/archived_nl/vaccine_administered_total.json diff --git a/packages/app/schema/archived_nl/vaccine_campaigns.json b/packages/app/schema/archived_nl/vaccine_campaigns_2022.json similarity index 92% rename from packages/app/schema/archived_nl/vaccine_campaigns.json rename to packages/app/schema/archived_nl/vaccine_campaigns_2022.json index 78ce0fb80b..96de74e1f4 100644 --- a/packages/app/schema/archived_nl/vaccine_campaigns.json +++ b/packages/app/schema/archived_nl/vaccine_campaigns_2022.json @@ -1,7 +1,7 @@ { "definitions": { "vaccine_campaign": { - "title": "archived_nl_vaccine_campaigns", + "title": "archived_nl_vaccine_campaigns_2022", "type": "object", "required": ["vaccine_campaign_order", "vaccine_campaign_name_nl", "vaccine_campaign_name_en", "vaccine_administered_total", "vaccine_administered_last_week"], "additionalProperties": false, @@ -25,7 +25,7 @@ } }, "$schema": "http://json-schema.org/draft-07/schema#", - "title": "archived_nl_vaccine_campaigns", + "title": "archived_nl_vaccine_campaigns_2022", "type": "object", "required": ["vaccine_campaigns", "date_unix", "date_start_unix", "date_end_unix", "date_of_insertion_unix"], "additionalProperties": false, diff --git a/packages/app/schema/archived_nl/vaccine_campaigns_2023.json b/packages/app/schema/archived_nl/vaccine_campaigns_2023.json new file mode 100644 index 0000000000..880f0f1c3a --- /dev/null +++ b/packages/app/schema/archived_nl/vaccine_campaigns_2023.json @@ -0,0 +1,52 @@ +{ + "definitions": { + "vaccine_campaign": { + "title": "archived_nl_vaccine_campaign_2023", + "type": "object", + "required": ["vaccine_campaign_order", "vaccine_campaign_name_nl", "vaccine_campaign_name_en", "vaccine_administered_total", "vaccine_administered_last_timeframe"], + "additionalProperties": false, + "properties": { + "vaccine_campaign_order": { + "type": "integer" + }, + "vaccine_campaign_name_nl": { + "type": "string" + }, + "vaccine_campaign_name_en": { + "type": "string" + }, + "vaccine_administered_total": { + "type": "integer" + }, + "vaccine_administered_last_timeframe": { + "type": "integer" + } + } + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "archived_nl_vaccine_campaign_2023", + "type": "object", + "required": ["vaccine_campaigns", "date_unix", "date_start_unix", "date_end_unix", "date_of_insertion_unix"], + "additionalProperties": false, + "properties": { + "vaccine_campaigns": { + "type": "array", + "items": { + "$ref": "#/definitions/vaccine_campaign" + } + }, + "date_unix": { + "type": "integer" + }, + "date_start_unix": { + "type": "integer" + }, + "date_end_unix": { + "type": "integer" + }, + "date_of_insertion_unix": { + "type": "integer" + } + } +} diff --git a/packages/app/schema/archived_nl/vaccine_coverage_per_age_group.json b/packages/app/schema/archived_nl/vaccine_coverage_per_age_group.json index bfe9b687cb..43e4cf36b6 100644 --- a/packages/app/schema/archived_nl/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/archived_nl/vaccine_coverage_per_age_group.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "archived_nl_vaccine_coverage_per_age_group", + "title": "archived_nl_vaccine_coverage_per_age_group_primary_series_and_booster", "type": "object", "required": ["values"], "additionalProperties": false, diff --git a/packages/app/schema/nl/vaccine_coverage_per_age_group_estimated_autumn_2022.json b/packages/app/schema/archived_nl/vaccine_coverage_per_age_group_estimated_autumn_2022.json similarity index 100% rename from packages/app/schema/nl/vaccine_coverage_per_age_group_estimated_autumn_2022.json rename to packages/app/schema/archived_nl/vaccine_coverage_per_age_group_estimated_autumn_2022.json diff --git a/packages/app/schema/nl/vaccine_coverage_per_age_group_estimated_fully_vaccinated.json b/packages/app/schema/archived_nl/vaccine_coverage_per_age_group_estimated_fully_vaccinated.json similarity index 100% rename from packages/app/schema/nl/vaccine_coverage_per_age_group_estimated_fully_vaccinated.json rename to packages/app/schema/archived_nl/vaccine_coverage_per_age_group_estimated_fully_vaccinated.json diff --git a/packages/app/schema/gm/__index.json b/packages/app/schema/gm/__index.json index 58d3424a30..cf5ce47fc1 100644 --- a/packages/app/schema/gm/__index.json +++ b/packages/app/schema/gm/__index.json @@ -3,19 +3,7 @@ "type": "object", "title": "gm", "additionalProperties": false, - "required": [ - "name", - "proto_name", - "code", - "difference", - "static_values", - "hospital_nice", - "sewer_installation_measurement", - "sewer_per_installation", - "sewer", - "vaccine_coverage_per_age_group", - "last_generated" - ], + "required": ["name", "proto_name", "code", "difference", "static_values", "hospital_nice", "sewer_installation_measurement", "sewer_per_installation", "sewer", "last_generated"], "properties": { "last_generated": { "type": "string" @@ -46,9 +34,6 @@ }, "sewer_installation_measurement": { "$ref": "sewer_installation_measurement.json" - }, - "vaccine_coverage_per_age_group": { - "$ref": "vaccine_coverage_per_age_group.json" } }, "$defs": { diff --git a/packages/app/schema/gm_collection/__index.json b/packages/app/schema/gm_collection/__index.json index 293b4dcaa4..75666d865a 100644 --- a/packages/app/schema/gm_collection/__index.json +++ b/packages/app/schema/gm_collection/__index.json @@ -3,7 +3,7 @@ "type": "object", "title": "gm_collection", "additionalProperties": false, - "required": ["last_generated", "proto_name", "name", "code", "hospital_nice_choropleth", "sewer", "vaccine_coverage_per_age_group"], + "required": ["last_generated", "proto_name", "name", "code", "hospital_nice_choropleth", "sewer"], "properties": { "last_generated": { "type": "string" @@ -32,14 +32,6 @@ "items": { "$ref": "sewer.json" } - }, - "vaccine_coverage_per_age_group": { - "type": "array", - "minItems": 684, - "maxItems": 684, - "items": { - "$ref": "vaccine_coverage_per_age_group.json" - } } }, "$defs": { diff --git a/packages/app/schema/nl/__index.json b/packages/app/schema/nl/__index.json index 2b8031df10..a8ed83c1e1 100644 --- a/packages/app/schema/nl/__index.json +++ b/packages/app/schema/nl/__index.json @@ -20,17 +20,7 @@ "infectionradar_symptoms_trend_per_age_group_weekly", "sewer", "vaccine_campaigns", - "vaccine_administered", - "vaccine_administered_doctors", - "vaccine_administered_ggd_ghor", - "vaccine_administered_ggd", - "vaccine_administered_hospitals_and_care_institutions", - "vaccine_administered_total", - "vaccine_administered_planned", - "vaccine_administered_last_timeframe", - "vaccine_coverage_per_age_group", - "vaccine_coverage_per_age_group_estimated_autumn_2022", - "vaccine_coverage_per_age_group_estimated_fully_vaccinated" + "vaccine_administered_last_timeframe" ], "additionalProperties": false, "properties": { @@ -76,42 +66,12 @@ "deceased_cbs": { "$ref": "deceased_cbs.json" }, - "vaccine_administered": { - "$ref": "vaccine_administered.json" - }, - "vaccine_administered_doctors": { - "$ref": "vaccine_administered_doctors.json" - }, - "vaccine_administered_ggd_ghor": { - "$ref": "vaccine_administered_ggd_ghor.json" - }, - "vaccine_administered_ggd": { - "$ref": "vaccine_administered_ggd.json" - }, - "vaccine_administered_hospitals_and_care_institutions": { - "$ref": "vaccine_administered_hospitals_and_care_institutions.json" - }, - "vaccine_administered_total": { - "$ref": "vaccine_administered_total.json" - }, - "vaccine_administered_planned": { - "$ref": "vaccine_administered_planned.json" - }, "vaccine_administered_last_timeframe": { "$ref": "vaccine_administered_last_timeframe.json" }, "vaccine_campaigns": { "$ref": "vaccine_campaigns.json" }, - "vaccine_coverage_per_age_group": { - "$ref": "vaccine_coverage_per_age_group.json" - }, - "vaccine_coverage_per_age_group_estimated_autumn_2022": { - "$ref": "vaccine_coverage_per_age_group_estimated_autumn_2022.json" - }, - "vaccine_coverage_per_age_group_estimated_fully_vaccinated": { - "$ref": "vaccine_coverage_per_age_group_estimated_fully_vaccinated.json" - }, "variants": { "$ref": "variants.json" }, diff --git a/packages/app/schema/nl/vaccine_campaigns.json b/packages/app/schema/nl/vaccine_campaigns.json index a54846b84c..0c752f82a2 100644 --- a/packages/app/schema/nl/vaccine_campaigns.json +++ b/packages/app/schema/nl/vaccine_campaigns.json @@ -1,7 +1,7 @@ { "definitions": { "vaccine_campaign": { - "title": "nl_vaccine_campaign", + "title": "nl_vaccine_campaigns", "type": "object", "required": ["vaccine_campaign_order", "vaccine_campaign_name_nl", "vaccine_campaign_name_en", "vaccine_administered_total", "vaccine_administered_last_timeframe"], "additionalProperties": false, @@ -16,7 +16,7 @@ "type": "string" }, "vaccine_administered_total": { - "type": "integer" + "type": ["integer", "null"] }, "vaccine_administered_last_timeframe": { "type": "integer" @@ -25,7 +25,7 @@ } }, "$schema": "http://json-schema.org/draft-07/schema#", - "title": "nl_vaccine_campaigns", + "title": "nl_vaccine_campaign", "type": "object", "required": ["vaccine_campaigns", "date_unix", "date_start_unix", "date_end_unix", "date_of_insertion_unix"], "additionalProperties": false, diff --git a/packages/app/src/components/choropleth/logic/types.ts b/packages/app/src/components/choropleth/logic/types.ts index 56b1c29bf8..e53ab26bc5 100644 --- a/packages/app/src/components/choropleth/logic/types.ts +++ b/packages/app/src/components/choropleth/logic/types.ts @@ -4,8 +4,8 @@ import type { GmCollection, GmCollectionHospitalNiceChoropleth, GmCollectionSewer, + ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth, ArchivedGmCollectionTestedOverall, - GmCollectionVaccineCoveragePerAgeGroup, ArchivedVrCollection, VrCollectionVulnerableNursingHome, VrCollectionElderlyAtHome, @@ -57,10 +57,13 @@ export type InferedDataCollection<T extends ChoroplethDataItem> = T extends GmDa ? ArchivedVrCollection : never; -export type GmDataCollection = GmCollectionHospitalNiceChoropleth[] | GmCollectionSewer[] | GmCollectionVaccineCoveragePerAgeGroup[]; +export type GmDataCollection = GmCollectionHospitalNiceChoropleth[] | GmCollectionSewer[]; export type GmDataItem = GmDataCollection[number]; -export type ArchivedGmDataCollection = ArchivedGmCollectionTestedOverall[] | ArchivedGmCollectionHospitalNiceChoropleth[]; +export type ArchivedGmDataCollection = + | ArchivedGmCollectionTestedOverall[] + | ArchivedGmCollectionHospitalNiceChoropleth[] + | ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth[]; export type ArchivedGmDataItem = ArchivedGmDataCollection[number]; export type ArchivedVrDataCollection = VrCollectionVulnerableNursingHome[] | VrCollectionElderlyAtHome[] | VrCollectionDisabilityCare[]; diff --git a/packages/app/src/components/kpi/components/kpi-content.tsx b/packages/app/src/components/kpi/components/kpi-content.tsx index 15f97f0de6..3304d511ee 100644 --- a/packages/app/src/components/kpi/components/kpi-content.tsx +++ b/packages/app/src/components/kpi/components/kpi-content.tsx @@ -8,11 +8,17 @@ import { useIntl } from '~/intl'; import { space } from '~/style/theme'; import { replaceVariablesInText } from '~/utils'; import { TileData as KpiContentProps } from '../types'; +import { Metadata, MetadataProps } from '~/components'; -export const KpiContent = ({ title, description, value, bar, birthyear, differenceValue, isPercentage = false }: KpiContentProps) => { +export const KpiContent = ({ title, description, value, bar, birthyear, differenceValue, isPercentage = false, dateOrRange, source }: KpiContentProps) => { const { commonTexts } = useIntl(); const parsedBirthyearRange = birthyear ? parseBirthyearRange(birthyear) : null; + const metadata: MetadataProps = { + date: dateOrRange, + source: source, + }; + return ( <Box> <BoldText>{title}</BoldText> @@ -36,6 +42,7 @@ export const KpiContent = ({ title, description, value, bar, birthyear, differen : description } /> + {metadata && <Metadata {...metadata} isTileFooter marginBottom={space[2]} />} </Box> ); }; diff --git a/packages/app/src/components/kpi/types.ts b/packages/app/src/components/kpi/types.ts index 7d92ecaf65..8f68774cb0 100644 --- a/packages/app/src/components/kpi/types.ts +++ b/packages/app/src/components/kpi/types.ts @@ -1,6 +1,11 @@ import { DifferenceInteger } from '@corona-dashboard/common'; export type TileData = { + dateOrRange?: number | DateRange; + source?: { + href: string; + text: string; + }; description: string; title: string; value: number | null; @@ -16,9 +21,9 @@ interface DateRange { } export interface BorderedKpiSectionProps { - dateOrRange: number | DateRange; + dateOrRange?: number | DateRange; description: string; - source: { + source?: { href: string; text: string; }; diff --git a/packages/app/src/components/tables/logic/use-get-single-coverage-percentage-data.ts b/packages/app/src/components/tables/logic/use-get-single-coverage-percentage-data.ts new file mode 100644 index 0000000000..c5e4b0ffc8 --- /dev/null +++ b/packages/app/src/components/tables/logic/use-get-single-coverage-percentage-data.ts @@ -0,0 +1,31 @@ +import { useIntl } from '~/intl'; +import { PercentageDataPoint, SingleCoverageTableData } from '../types'; + +type FormatParam = { shouldFormat: boolean }; + +// Returns an array of objects corresponding to percentage data used by tables on the dashboard +export const useGetSingleCoveragePercentageData = ( + dataset: SingleCoverageTableData[], + title: string, + color: string, + percentageFormattingRules?: FormatParam +): PercentageDataPoint[][] => { + const { commonTexts, formatPercentage } = useIntl(); + + const getFormattedPercentageValue = (percentage: number | null, shouldFormat: boolean) => { + return percentage === null ? commonTexts.common.no_data : shouldFormat ? `${formatPercentage(percentage)}%` : percentage; + }; + + return dataset.map((datasetItem) => { + return [ + { + title: title, + trendDirection: 'firstPercentageTrend' in datasetItem ? datasetItem['firstPercentageTrend'] : null, + percentage: { + color: color, + value: getFormattedPercentageValue(datasetItem.firstPercentage, percentageFormattingRules?.shouldFormat ?? false), + }, + }, + ]; + }); +}; diff --git a/packages/app/src/components/tables/types.ts b/packages/app/src/components/tables/types.ts index da8cd005eb..5a6539b56f 100644 --- a/packages/app/src/components/tables/types.ts +++ b/packages/app/src/components/tables/types.ts @@ -12,18 +12,28 @@ export type PercentageDataPoint = { }; }; -export interface TableData { +export interface BaseTableData { id: string; firstColumnLabel: React.ReactNode; + description?: string; + ageGroupRange?: string; +} + +export interface SingleCoverageTableData extends BaseTableData { + firstPercentage: number | null; + firstPercentageTrend?: BehaviorTrendType; +} + +export interface TableData extends BaseTableData { firstPercentage: number | null; secondPercentage: number | null; firstPercentageTrend?: TrendDirection; secondPercentageTrend?: TrendDirection; - description?: string; - ageGroupRange?: string; } +export type BaseCoverageTable = BaseTableData; + export interface CommonTableProps { - tableData: TableData[]; + tableData: SingleCoverageTableData[] | TableData[]; percentageData: PercentageDataPoint[][]; } diff --git a/packages/app/src/components/tables/wide-table.tsx b/packages/app/src/components/tables/wide-table.tsx index d0d1b2ab31..24a9c09ea6 100644 --- a/packages/app/src/components/tables/wide-table.tsx +++ b/packages/app/src/components/tables/wide-table.tsx @@ -22,16 +22,22 @@ export const WideTable = ({ tableData, headerText, percentageData }: WideTablePr <Table> <TableHead> <Row> - <HeaderCell minWidth="300px" width={tableColumnWidths.labelColumn}> - {headerText.firstColumn} - </HeaderCell> - <HeaderCell minWidth="150px" width={tableColumnWidths.percentageColumn}> - {headerText.secondColumn} - </HeaderCell> - <HeaderCell minWidth="150px" width={tableColumnWidths.percentageColumn}> - {headerText.thirdColumn} - </HeaderCell> - <HeaderCell width={tableColumnWidths.percentageBarColumn}>{headerText.fourthColumn}</HeaderCell> + {headerText.firstColumn !== undefined && ( + <HeaderCell minWidth="300px" width={tableColumnWidths.labelColumn}> + {headerText.firstColumn} + </HeaderCell> + )} + {headerText.secondColumn !== undefined && ( + <HeaderCell minWidth="150px" width={tableColumnWidths.percentageColumn}> + {headerText.secondColumn} + </HeaderCell> + )} + {headerText.thirdColumn !== undefined && ( + <HeaderCell minWidth="150px" width={tableColumnWidths.percentageColumn}> + {headerText.thirdColumn} + </HeaderCell> + )} + {headerText.fourthColumn !== undefined && <HeaderCell width={tableColumnWidths.percentageBarColumn}>{headerText.fourthColumn}</HeaderCell>} </Row> </TableHead> diff --git a/packages/app/src/domain/vaccine/autumn-2022-shot-coverage-per-age-group/autumn-2022-shot-coverage-per-age-group.tsx b/packages/app/src/domain/vaccine/autumn-2022-shot-coverage-per-age-group/autumn-2022-shot-coverage-per-age-group.tsx index 2d9c320183..9f7488e152 100644 --- a/packages/app/src/domain/vaccine/autumn-2022-shot-coverage-per-age-group/autumn-2022-shot-coverage-per-age-group.tsx +++ b/packages/app/src/domain/vaccine/autumn-2022-shot-coverage-per-age-group/autumn-2022-shot-coverage-per-age-group.tsx @@ -2,14 +2,14 @@ import { NlVaccineCoveragePerAgeGroupValue } from '@corona-dashboard/common'; import { AgeGroup } from '~/components/age-groups/age-group'; import { ChartTile } from '~/components/chart-tile'; import { MetadataProps } from '~/components/metadata'; -import { useGetPercentageData } from '~/components/tables/logic/use-get-percentage-data'; import { NarrowTable } from '~/components/tables/narrow-table'; -import { TableData } from '~/components/tables/types'; +import { SingleCoverageTableData } from '~/components/tables/types'; import { WideTable } from '~/components/tables/wide-table'; -import { COLOR_AUTUMN_2022_SHOT, COLOR_FULLY_VACCINATED } from '~/domain/vaccine/common'; +import { COLOR_AUTUMN_2022_SHOT } from '~/domain/vaccine/common'; import { SiteText } from '~/locale'; import { useBreakpoints } from '~/utils/use-breakpoints'; import { getSortingOrder } from '../logic/get-sorting-order'; +import { useGetSingleCoveragePercentageData } from '~/components/tables/logic/use-get-single-coverage-percentage-data'; interface Autumn2022ShotCoveragePerAgeGroupProps { title: string; @@ -23,11 +23,10 @@ interface Autumn2022ShotCoveragePerAgeGroupProps { export const Autumn2022ShotCoveragePerAgeGroup = ({ title, description, metadata, values, sortingOrder, text }: Autumn2022ShotCoveragePerAgeGroupProps) => { const breakpoints = useBreakpoints(true); const componentName = Autumn2022ShotCoveragePerAgeGroup.name; - const requiredData: TableData[] = values.map((value) => { + const requiredData: SingleCoverageTableData[] = values.map((value) => { return { id: `${componentName}-${value.age_group_range}`, firstPercentage: value.autumn_2022_vaccinated_percentage, - secondPercentage: value.fully_vaccinated_percentage, ageGroupRange: value.age_group_range, firstColumnLabel: ( <AgeGroup peopleInAgeGroup={'age_group_total' in value ? value.age_group_total : undefined} range={value.age_group_range} birthYearRange={value.birthyear_range} /> @@ -36,10 +35,10 @@ export const Autumn2022ShotCoveragePerAgeGroup = ({ title, description, metadata }); const sortedData = requiredData.sort((a, b) => getSortingOrder(a.ageGroupRange, sortingOrder, componentName) - getSortingOrder(b.ageGroupRange, sortingOrder, componentName)); - const percentageTitles = { first: text.headers.autumn_2022_shot, second: text.headers.fully_vaccinated }; - const percentageColors = { first: COLOR_AUTUMN_2022_SHOT, second: COLOR_FULLY_VACCINATED }; - const percentageFormattingRules = { first: { shouldFormat: true }, second: { shouldFormat: true } }; - const percentageData = useGetPercentageData(sortedData, percentageTitles, percentageColors, percentageFormattingRules); + const percentageTitles = text.headers.autumn_2022_shot; + const percentageColors = COLOR_AUTUMN_2022_SHOT; + const percentageFormattingRules = { shouldFormat: true }; + const percentageData = useGetSingleCoveragePercentageData(sortedData, percentageTitles, percentageColors, percentageFormattingRules); return ( <ChartTile title={title} description={description} metadata={metadata}> @@ -49,7 +48,6 @@ export const Autumn2022ShotCoveragePerAgeGroup = ({ title, description, metadata firstColumn: text.headers.agegroup, secondColumn: text.headers.autumn_2022_shot, thirdColumn: text.headers.fully_vaccinated, - fourthColumn: text.headers.difference_autumn_2022_shot_and_fully_vaccinated, }} tableData={sortedData} percentageData={percentageData} diff --git a/packages/app/src/domain/vaccine/autumn-2022-shot-coverage-per-age-group/index.ts b/packages/app/src/domain/vaccine/autumn-2022-shot-coverage-per-age-group/index.ts deleted file mode 100644 index bb046c501c..0000000000 --- a/packages/app/src/domain/vaccine/autumn-2022-shot-coverage-per-age-group/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './autumn-2022-shot-coverage-per-age-group'; diff --git a/packages/app/src/domain/vaccine/booster-shot-coverage-per-age-group/index.ts b/packages/app/src/domain/vaccine/booster-shot-coverage-per-age-group/index.ts deleted file mode 100644 index be2075e917..0000000000 --- a/packages/app/src/domain/vaccine/booster-shot-coverage-per-age-group/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './booster-shot-coverage-per-age-group'; diff --git a/packages/app/src/domain/vaccine/campaign-banner/campaign-banner.tsx b/packages/app/src/domain/vaccine/campaign-banner/campaign-banner.tsx new file mode 100644 index 0000000000..ccccba08f7 --- /dev/null +++ b/packages/app/src/domain/vaccine/campaign-banner/campaign-banner.tsx @@ -0,0 +1,68 @@ +import { Box } from '~/components/base'; +import { sizes, space } from '~/style/theme'; +import { MaxWidth } from '~/components/max-width'; +import { colors } from '@corona-dashboard/common'; +import { Heading } from '~/components/typography'; +import { Markdown, Tile } from '~/components'; +import { Image } from '~/components/image'; + +interface CampaignBannerProps { + title: string; + description: string; + altText: string; +} + +export const CampaignBanner = ({ title, description, altText }: CampaignBannerProps) => ( + <Tile> + <Box backgroundColor={colors.blue1} marginY={space[4]}> + <MaxWidth + alignItems={{ _: 'flex-start', sm: 'center' }} + display="flex" + flexDirection={{ _: 'column', md: 'row' }} + justifyContent="center" + gridColumnGap={{ _: space[4], md: space[2] }} + paddingX={{ _: space[3], sm: space[4] }} + paddingY={space[4]} + > + <Box + maxWidth={sizes.maxWidthText} + display="flex" + flexDirection="column" + justifyContent="space-between" + gridRowGap={space[4]} + paddingX={{ md: space[4], lg: space[5] }} + paddingY={space[4]} + > + <Heading level={2} variant="h2"> + {title} + </Heading> + + <Markdown content={description} /> + </Box> + <Box paddingX={{ sm: space[5], md: space[4] }} alignSelf={{ _: 'center', sm: 'left' }}> + <CampaignImage src={'/images/Najaarsronde-coronaprik-hero.svg'} extension="svg" alt={altText} /> + </Box> + </MaxWidth> + </Box> + </Tile> +); + +type CampaignImageProps = { + src: string; + extension: string; + className?: string; + alt?: string; +}; + +const CampaignImage = (props: CampaignImageProps) => { + const { src, extension, ...imageProps } = props; + + return ( + <Box alignSelf="center"> + <picture className={props.className}> + <source type={`image/${extension}`} /> + <Image loading="lazy" src={src} {...imageProps} /> + </picture> + </Box> + ); +}; diff --git a/packages/app/src/domain/vaccine/common.ts b/packages/app/src/domain/vaccine/common.ts index 36ba48d1ce..f532fb8c33 100644 --- a/packages/app/src/domain/vaccine/common.ts +++ b/packages/app/src/domain/vaccine/common.ts @@ -1,4 +1,4 @@ -import { colors, GmCollectionVaccineCoveragePerAgeGroup } from '@corona-dashboard/common'; +import { colors, ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth } from '@corona-dashboard/common'; export const COLOR_FULLY_VACCINATED = colors.scale.blueDetailed[3]; export const COLOR_FULLY_BOOSTERED = colors.scale.blue[5]; @@ -23,7 +23,7 @@ type MatchingVaccineCoverageAgeGroupsType = { primary_series: PrimarySeriesVaccinatedAges[]; }; -export type VaccineCoverageData = GmCollectionVaccineCoveragePerAgeGroup; +export type VaccineCoverageData = ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth; export const matchingAgeGroups: MatchingVaccineCoverageAgeGroupsType = { autumn_2022: ['60', '12'], diff --git a/packages/app/src/domain/vaccine/index.ts b/packages/app/src/domain/vaccine/index.ts index d6d4fab7e8..754a7fca84 100644 --- a/packages/app/src/domain/vaccine/index.ts +++ b/packages/app/src/domain/vaccine/index.ts @@ -11,3 +11,5 @@ export { VaccineCoverageToggleTile } from './vaccine-coverage-toggle-tile'; export { VaccineDeliveryBarChart } from './vaccine-delivery-bar-chart'; export { VaccineStockPerSupplierChart } from './vaccine-stock-per-supplier-chart'; export { ChoroplethTooltip } from './vaccine-coverage-choropleth'; +export { CampaignBanner } from './campaign-banner/campaign-banner'; +export { PrimarySeriesShotCoveragePerAgeGroup } from './primary-series-coverage-per-age-group/primary-series-coverage-per-age-group'; diff --git a/packages/app/src/domain/vaccine/primary-series-coverage-per-age-group/primary-series-coverage-per-age-group.tsx b/packages/app/src/domain/vaccine/primary-series-coverage-per-age-group/primary-series-coverage-per-age-group.tsx new file mode 100644 index 0000000000..0c54fcf1a1 --- /dev/null +++ b/packages/app/src/domain/vaccine/primary-series-coverage-per-age-group/primary-series-coverage-per-age-group.tsx @@ -0,0 +1,60 @@ +import { NlVaccineCoveragePerAgeGroupValue } from '@corona-dashboard/common'; +import { AgeGroup } from '~/components/age-groups/age-group'; +import { ChartTile } from '~/components/chart-tile'; +import { MetadataProps } from '~/components/metadata'; +import { useGetSingleCoveragePercentageData } from '~/components/tables/logic/use-get-single-coverage-percentage-data'; +import { NarrowTable } from '~/components/tables/narrow-table'; +import { SingleCoverageTableData } from '~/components/tables/types'; +import { WideTable } from '~/components/tables/wide-table'; +import { COLOR_FULLY_VACCINATED } from '~/domain/vaccine/common'; +import { SiteText } from '~/locale'; +import { useBreakpoints } from '~/utils/use-breakpoints'; +import { getSortingOrder } from '../logic/get-sorting-order'; + +interface PrimarySeriesShotCoveragePerAgeGroupProps { + title: string; + description: string; + metadata: MetadataProps; + sortingOrder: string[]; + values: NlVaccineCoveragePerAgeGroupValue[]; + text: SiteText['pages']['vaccinations_page']['nl']['vaccination_coverage']; +} + +export const PrimarySeriesShotCoveragePerAgeGroup = ({ title, description, metadata, values, sortingOrder, text }: PrimarySeriesShotCoveragePerAgeGroupProps) => { + const breakpoints = useBreakpoints(true); + const componentName = PrimarySeriesShotCoveragePerAgeGroup.name; + const requiredData: SingleCoverageTableData[] = values.map((value) => { + return { + id: `${componentName}-${value.age_group_range}`, + firstPercentage: value.fully_vaccinated_percentage, + ageGroupRange: value.age_group_range, + firstColumnLabel: ( + <AgeGroup peopleInAgeGroup={'age_group_total' in value ? value.age_group_total : undefined} range={value.age_group_range} birthYearRange={value.birthyear_range} /> + ), + }; + }); + + const sortedData = requiredData.sort((a, b) => getSortingOrder(a.ageGroupRange, sortingOrder, componentName) - getSortingOrder(b.ageGroupRange, sortingOrder, componentName)); + const percentageTitles = text.headers.fully_vaccinated; + const percentageColors = COLOR_FULLY_VACCINATED; + const percentageFormattingRules = { shouldFormat: true }; + const percentageData = useGetSingleCoveragePercentageData(sortedData, percentageTitles, percentageColors, percentageFormattingRules); + + return ( + <ChartTile title={title} description={description} metadata={metadata}> + {breakpoints.lg ? ( + <WideTable + headerText={{ + firstColumn: text.headers.agegroup, + secondColumn: text.headers.fully_vaccinated, + thirdColumn: text.headers.difference_autumn_2022_shot_and_fully_vaccinated, + }} + tableData={sortedData} + percentageData={percentageData} + /> + ) : ( + <NarrowTable headerText={text.headers.agegroup} tableData={sortedData} percentageData={percentageData} /> + )} + </ChartTile> + ); +}; diff --git a/packages/app/src/domain/vaccine/vaccine-campaigns-tile/components/narrow-vaccine-campaign-table.tsx b/packages/app/src/domain/vaccine/vaccine-campaigns-tile/components/narrow-vaccine-campaign-table.tsx index 8887bc3135..e3b6baed33 100644 --- a/packages/app/src/domain/vaccine/vaccine-campaigns-tile/components/narrow-vaccine-campaign-table.tsx +++ b/packages/app/src/domain/vaccine/vaccine-campaigns-tile/components/narrow-vaccine-campaign-table.tsx @@ -11,9 +11,10 @@ interface NarrowVaccineCampaignTableProps { campaigns: VaccineCampaign[]; campaignDescriptions: VaccineCampaignDescriptions; headers: VaccineCampaignHeaders; + showTotals: boolean; } -export const NarrowVaccineCampaignTable = ({ campaigns, campaignDescriptions, headers }: NarrowVaccineCampaignTableProps) => { +export const NarrowVaccineCampaignTable = ({ campaigns, campaignDescriptions, headers, showTotals }: NarrowVaccineCampaignTableProps) => { return ( <StyledTable> <thead> @@ -24,7 +25,14 @@ export const NarrowVaccineCampaignTable = ({ campaigns, campaignDescriptions, he <tbody> {campaigns.map((campaign, index) => ( - <VaccineCampaignRow key={campaign.vaccine_campaign_order} campaign={campaign} campaignDescriptions={campaignDescriptions} headers={headers} isFirst={index === 0} /> + <VaccineCampaignRow + key={campaign.vaccine_campaign_order} + campaign={campaign} + campaignDescriptions={campaignDescriptions} + headers={headers} + isFirst={index === 0} + showTotals={showTotals} + /> ))} </tbody> </StyledTable> @@ -36,9 +44,10 @@ interface VaccineCampaignRowProps { campaignDescriptions: VaccineCampaignDescriptions; headers: VaccineCampaignHeaders; isFirst: boolean; + showTotals: boolean; } -const VaccineCampaignRow = ({ campaign, campaignDescriptions, headers, isFirst }: VaccineCampaignRowProps) => { +const VaccineCampaignRow = ({ campaign, campaignDescriptions, headers, isFirst, showTotals }: VaccineCampaignRowProps) => { const { formatNumber } = useIntl(); const collapsible = useCollapsible({ isOpen: isFirst }); const { locale = 'nl' } = useRouter(); @@ -64,7 +73,7 @@ const VaccineCampaignRow = ({ campaign, campaignDescriptions, headers, isFirst } <tr> <StyledCell paddingY="0" isMobile> - {headers.last_week}:{' '} + {headers.last_week} :{' '} {isOpen ? ( <BoldText>{formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe)}</BoldText> ) : ( @@ -73,11 +82,13 @@ const VaccineCampaignRow = ({ campaign, campaignDescriptions, headers, isFirst } </StyledCell> </tr> - <tr> - <StyledCell paddingY="0" isMobile> - {headers.total}: {isOpen ? <BoldText>{formatNumber(campaign.vaccine_administered_total)}</BoldText> : formatNumber(campaign.vaccine_administered_total)} - </StyledCell> - </tr> + {showTotals && ( + <tr> + <StyledCell paddingY="0" isMobile> + {headers.total} : {isOpen ? <BoldText>{formatNumber(campaign.vaccine_administered_total)}</BoldText> : formatNumber(campaign.vaccine_administered_total)} + </StyledCell> + </tr> + )} <tr> <StyledCell paddingBottom={collapsible.isOpen ? space[3] : space[2]} colSpan={2} isMobile> diff --git a/packages/app/src/domain/vaccine/vaccine-campaigns-tile/components/wide-vaccine-campaign-table.tsx b/packages/app/src/domain/vaccine/vaccine-campaigns-tile/components/wide-vaccine-campaign-table.tsx index a6f42d728c..938d41c731 100644 --- a/packages/app/src/domain/vaccine/vaccine-campaigns-tile/components/wide-vaccine-campaign-table.tsx +++ b/packages/app/src/domain/vaccine/vaccine-campaigns-tile/components/wide-vaccine-campaign-table.tsx @@ -12,22 +12,23 @@ interface WideVaccineCampaignTableProps { campaigns: VaccineCampaign[]; campaignDescriptions: VaccineCampaignDescriptions; headers: VaccineCampaignHeaders; + showTotals: boolean; } -export const WideVaccineCampaignTable = ({ campaigns, campaignDescriptions, headers }: WideVaccineCampaignTableProps) => { +export const WideVaccineCampaignTable = ({ campaigns, campaignDescriptions, headers, showTotals }: WideVaccineCampaignTableProps) => { return ( <StyledTable> <thead> <tr> <StyledHeaderCell>{headers.vaccine}</StyledHeaderCell> <StyledHeaderCell>{headers.last_week}</StyledHeaderCell> - <StyledHeaderCell>{headers.total}</StyledHeaderCell> + {showTotals && <StyledHeaderCell>{headers.total}</StyledHeaderCell>} </tr> </thead> <tbody> {campaigns.map((campaign, index) => ( - <VaccineCampaignRow key={index} campaign={campaign} campaignDescriptions={campaignDescriptions} isFirst={index === 0} /> + <VaccineCampaignRow key={index} campaign={campaign} campaignDescriptions={campaignDescriptions} isFirst={index === 0} hideTotals={showTotals} /> ))} </tbody> </StyledTable> @@ -38,9 +39,10 @@ interface VaccineCampaignRowProps { campaign: VaccineCampaign; campaignDescriptions: VaccineCampaignDescriptions; isFirst: boolean; + hideTotals: boolean; } -const VaccineCampaignRow = ({ campaign, campaignDescriptions, isFirst }: VaccineCampaignRowProps) => { +const VaccineCampaignRow = ({ campaign, campaignDescriptions, isFirst, hideTotals }: VaccineCampaignRowProps) => { const { formatNumber } = useIntl(); const collapsible = useCollapsible({ isOpen: isFirst }); const { locale = 'nl' } = useRouter(); @@ -59,21 +61,42 @@ const VaccineCampaignRow = ({ campaign, campaignDescriptions, isFirst }: Vaccine <BoldText>{locale === 'nl' ? campaign.vaccine_campaign_name_nl : campaign.vaccine_campaign_name_en}</BoldText> </StyledCell> - <StyledCell> - {isOpen ? ( - <BoldText>{formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe)}</BoldText> - ) : ( - formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe) - )} - </StyledCell> + {hideTotals ? ( + <> + <StyledCell> + {isOpen ? ( + <BoldText>{formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe)}</BoldText> + ) : ( + formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe) + )} + </StyledCell> - <StyledCell> - <Box display="flex" justifyContent="space-between" alignItems="center"> - {isOpen ? <BoldText>{formatNumber(campaign.vaccine_administered_total)}</BoldText> : formatNumber(campaign.vaccine_administered_total)} + <StyledCell> + <Box display="flex" justifyContent="space-between" alignItems="center"> + {isOpen ? <BoldText>{formatNumber(campaign.vaccine_administered_total)}</BoldText> : formatNumber(campaign.vaccine_administered_total)} - {collapsible.button()} - </Box> - </StyledCell> + {collapsible.button()} + </Box> + </StyledCell> + </> + ) : ( + <> + <StyledCell> + {isOpen ? ( + <Box display="flex" justifyContent="space-between" alignItems="center"> + <BoldText>{formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe)}</BoldText> + + {collapsible.button()} + </Box> + ) : ( + <Box display="flex" justifyContent="space-between" alignItems="center"> + {formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe)} + {collapsible.button()} + </Box> + )} + </StyledCell> + </> + )} </tr> <tr> diff --git a/packages/app/src/domain/vaccine/vaccine-campaigns-tile/types.ts b/packages/app/src/domain/vaccine/vaccine-campaigns-tile/types.ts index 77be55ff2c..b33422faee 100644 --- a/packages/app/src/domain/vaccine/vaccine-campaigns-tile/types.ts +++ b/packages/app/src/domain/vaccine/vaccine-campaigns-tile/types.ts @@ -2,11 +2,16 @@ export type VaccineCampaign = { vaccine_campaign_order: number; vaccine_campaign_name_nl: string; vaccine_campaign_name_en: string; - vaccine_administered_total: number; + vaccine_administered_total: number | null; } & Partial<{ vaccine_administered_last_week: number; vaccine_administered_last_timeframe: number; }>; +interface VaccineCampaignOptionProps { + hide_campaigns: number[]; +} + export type VaccineCampaignDescriptions = Record<string, string>; export type VaccineCampaignHeaders = Record<string, string>; +export type VaccineCampaignOptions = VaccineCampaignOptionProps; diff --git a/packages/app/src/domain/vaccine/vaccine-campaigns-tile/vaccine-campaigns-tile.tsx b/packages/app/src/domain/vaccine/vaccine-campaigns-tile/vaccine-campaigns-tile.tsx index d6165fd46a..1f0bae2e29 100644 --- a/packages/app/src/domain/vaccine/vaccine-campaigns-tile/vaccine-campaigns-tile.tsx +++ b/packages/app/src/domain/vaccine/vaccine-campaigns-tile/vaccine-campaigns-tile.tsx @@ -3,7 +3,7 @@ import { ChartTile, Markdown, MetadataProps } from '~/components'; import { Text } from '~/components/typography'; import { NarrowVaccineCampaignTable } from './components/narrow-vaccine-campaign-table'; import { WideVaccineCampaignTable } from './components/wide-vaccine-campaign-table'; -import { VaccineCampaign, VaccineCampaignDescriptions, VaccineCampaignHeaders } from './types'; +import { VaccineCampaign, VaccineCampaignDescriptions, VaccineCampaignHeaders, VaccineCampaignOptions } from './types'; import { Box } from '~/components/base'; import { space } from '~/style/theme'; @@ -15,20 +15,26 @@ interface VaccineCampaignsTileProps { headers: VaccineCampaignHeaders; campaigns: VaccineCampaign[]; campaignDescriptions: VaccineCampaignDescriptions; + campaignOptions?: VaccineCampaignOptions; } -export const VaccineCampaignsTile = ({ title, headers, campaigns, campaignDescriptions, description, descriptionFooter, metadata }: VaccineCampaignsTileProps) => { +export const VaccineCampaignsTile = ({ title, headers, campaigns, campaignDescriptions, description, descriptionFooter, metadata, campaignOptions }: VaccineCampaignsTileProps) => { const breakpoints = useBreakpoints(); - const sortedCampaigns = campaigns.sort((campaignA, campaignB) => campaignA.vaccine_campaign_order - campaignB.vaccine_campaign_order); + // Display only the campaigns that are not hidden in the campaignOptions prop + const sortedCampaigns = campaigns + .filter((vaccineCampaign) => campaignOptions && !campaignOptions.hide_campaigns.includes(vaccineCampaign.vaccine_campaign_order)) + .sort((campaignA, campaignB) => campaignA.vaccine_campaign_order - campaignB.vaccine_campaign_order); + + const totalsAvailable = sortedCampaigns.some((camp) => camp.vaccine_administered_total); return ( <> <ChartTile title={title} description={description} metadata={metadata}> {breakpoints.sm ? ( - <WideVaccineCampaignTable campaigns={sortedCampaigns} campaignDescriptions={campaignDescriptions} headers={headers} /> + <WideVaccineCampaignTable campaigns={sortedCampaigns} campaignDescriptions={campaignDescriptions} headers={headers} showTotals={totalsAvailable} /> ) : ( - <NarrowVaccineCampaignTable campaigns={sortedCampaigns} campaignDescriptions={campaignDescriptions} headers={headers} /> + <NarrowVaccineCampaignTable campaigns={sortedCampaigns} campaignDescriptions={campaignDescriptions} headers={headers} showTotals={totalsAvailable} /> )} <Box marginTop={space[3]}> <Text variant="label1" color="gray7"> diff --git a/packages/app/src/domain/vaccine/vaccine-coverage-choropleth.tsx b/packages/app/src/domain/vaccine/vaccine-coverage-choropleth.tsx index e02f616009..f1e20083dc 100644 --- a/packages/app/src/domain/vaccine/vaccine-coverage-choropleth.tsx +++ b/packages/app/src/domain/vaccine/vaccine-coverage-choropleth.tsx @@ -1,4 +1,4 @@ -import { colors, GmCollectionVaccineCoveragePerAgeGroup } from '@corona-dashboard/common'; +import { colors, ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth } from '@corona-dashboard/common'; import { SiteText } from '~/locale'; import { matchingAgeGroups, VaccineCoverageData, DataPerAgeGroup, BirthyearRangeKeysOfAgeGroups, PercentageKeysOfAgeGroups, PercentageLabelKeysOfAgeGroups } from './common'; import css from '@styled-system/css'; @@ -15,11 +15,11 @@ import { BoldText } from '~/components/typography'; import { useIntl } from '~/intl'; import { replaceVariablesInText } from '~/utils/replace-variables-in-text'; import { AgeGroup, AgeGroupSelect } from './components/age-group-select'; -import { CoverageKindProperty, VaccinationCoverageKindSelect } from './components/vaccination-coverage-kind-select'; +import { CoverageKindProperty } from './components/vaccination-coverage-kind-select'; import { parseVaccinatedPercentageLabel } from './logic/parse-vaccinated-percentage-label'; interface VaccineCoverageChoroplethProps { - data: GmCollectionVaccineCoveragePerAgeGroup[]; + data: ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth[]; dataOptions: DataOptions; text: { title: string; @@ -27,25 +27,17 @@ interface VaccineCoverageChoroplethProps { vaccinationKindLabel?: string; ageGroupLabel?: string; }; + isPrimarySeries?: boolean; } -export const VaccineCoverageChoropleth = ({ data, dataOptions, text }: VaccineCoverageChoroplethProps) => { +export const VaccineCoverageChoropleth = ({ data, dataOptions, text, isPrimarySeries }: VaccineCoverageChoroplethProps) => { const { commonTexts } = useIntl(); - const [selectedAgeGroup, setSelectedAgeGroup] = useState<AgeGroup>('18'); - const [selectedCoverageKind, setSelectedCoverageKind] = useState<CoverageKindProperty>('primary_series'); - /** - * When changing between coverage kinds where the selected age group isn't available, - * the other coverage kind set the non-matching age group to a default one. - */ - const setSelectedCoverageKindAndAge = (coverageKind: CoverageKindProperty) => { - if (coverageKind === selectedCoverageKind) return; - if (selectedAgeGroup !== '12') { - setSelectedAgeGroup(selectedAgeGroup === '18' ? '60' : '18'); - } - setSelectedCoverageKind(coverageKind); - }; + const [selectedAgeGroup, setSelectedAgeGroup] = useState<AgeGroup>(isPrimarySeries ? '18' : '60'); + const selectedCoverageKind: CoverageKindProperty = isPrimarySeries ? 'primary_series' : 'autumn_2022'; - const choroplethDataGm: GmCollectionVaccineCoveragePerAgeGroup[] = data.filter((choroplethDataSingleGM) => choroplethDataSingleGM.vaccination_type === selectedCoverageKind); + const choroplethDataGm: ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth[] = data.filter( + (choroplethDataSingleGM) => choroplethDataSingleGM.vaccination_type === selectedCoverageKind + ); return ( <ChoroplethTile @@ -63,12 +55,7 @@ export const VaccineCoverageChoropleth = ({ data, dataOptions, text }: VaccineCo > {commonTexts.choropleth.vaccination_coverage.shared.dropdowns_title} </BoldText> - <Box display="grid" gridTemplateColumns={{ _: '1 fr', lg: 'repeat(2, 1fr)' }} gridGap={{ _: '24px', lg: space[2] }} margin={`${space[2]} 0`} minWidth="100%"> - <Box> - {text.vaccinationKindLabel && <BoldText>{text.vaccinationKindLabel}</BoldText>} - <VaccinationCoverageKindSelect marginTop={space[2]} onChange={setSelectedCoverageKindAndAge} initialValue={selectedCoverageKind} /> - </Box> <Box> {text.ageGroupLabel && <BoldText>{text.ageGroupLabel}</BoldText>} <AgeGroupSelect marginTop={space[2]} onChange={setSelectedAgeGroup} initialValue={selectedAgeGroup} shownAgeGroups={matchingAgeGroups[selectedCoverageKind]} /> @@ -83,7 +70,7 @@ export const VaccineCoverageChoropleth = ({ data, dataOptions, text }: VaccineCo }} metadata={{ source: commonTexts.choropleth.vaccination_coverage.shared.bronnen.rivm, - date: data.find((item: GmCollectionVaccineCoveragePerAgeGroup) => item.vaccination_type === selectedCoverageKind)?.date_unix, + date: data.find((item: ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth) => item.vaccination_type === selectedCoverageKind)?.date_unix, }} hasPadding > @@ -92,7 +79,7 @@ export const VaccineCoverageChoropleth = ({ data, dataOptions, text }: VaccineCo accessibility={{ key: 'vaccine_coverage_nl_choropleth' }} data={choroplethDataGm} dataConfig={{ - metricName: 'vaccine_coverage_per_age_group', + metricName: 'vaccine_coverage_per_age_group_choropleth_archived_20231004', metricProperty: `vaccinated_percentage_${selectedAgeGroup}_plus`, }} dataOptions={dataOptions} diff --git a/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx b/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx index 1543d2ce79..9db0c7c4f4 100644 --- a/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx +++ b/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx @@ -1,4 +1,4 @@ -import { colors, GmCollectionVaccineCoveragePerAgeGroup } from '@corona-dashboard/common'; +import { colors, ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth } from '@corona-dashboard/common'; import { Vaccinaties as VaccinatieIcon } from '@corona-dashboard/icons'; import { GetStaticPropsContext } from 'next'; import { useState } from 'react'; @@ -18,12 +18,13 @@ import { useIntl } from '~/intl'; import { Languages, SiteText } from '~/locale'; import { getArticleParts, getDataExplainedParts, getFaqParts, getLinkParts, getPagePartsQuery } from '~/queries/get-page-parts-query'; import { createGetStaticProps, StaticProps } from '~/static-props/create-get-static-props'; -import { createGetChoroplethData, createGetContent, getLastGeneratedDate, getLokalizeTexts, selectGmData, selectArchivedGmData } from '~/static-props/get-data'; +import { createGetContent, getLastGeneratedDate, getLokalizeTexts, selectGmData, selectArchivedGmData, createGetArchivedChoroplethData } from '~/static-props/get-data'; import { ArticleParts, LinkParts, PagePartQueryResult } from '~/types/cms'; import { assert, replaceVariablesInText, useFormatLokalizePercentage, useReverseRouter } from '~/utils'; import { useDynamicLokalizeTexts } from '~/utils/cms/use-dynamic-lokalize-texts'; import { getLastInsertionDateOfPage } from '~/utils/get-last-insertion-date-of-page'; import { getPageInformationHeaderContent } from '~/utils/get-page-information-header-content'; +import { WarningTile } from '~/components/warning-tile'; const pageMetrics = ['vaccine_coverage_per_age_group', 'vaccine_coverage_per_age_group_archived', 'booster_coverage_archived_20220904']; @@ -40,21 +41,26 @@ export { getStaticPaths } from '~/static-paths/gm'; export const getStaticProps = createGetStaticProps( ({ locale }: { locale: keyof Languages }) => getLokalizeTexts(selectLokalizeTexts, locale), getLastGeneratedDate, - selectGmData('code', 'vaccine_coverage_per_age_group'), - selectArchivedGmData('vaccine_coverage_per_age_group_archived_20220622', 'vaccine_coverage_per_age_group_archived_20220908', 'booster_coverage_archived_20220904'), - createGetChoroplethData({ - gm: ({ vaccine_coverage_per_age_group }, ctx) => { - if (!isDefined(vaccine_coverage_per_age_group)) { + selectGmData('code'), + selectArchivedGmData( + 'vaccine_coverage_per_age_group_archived_20220622', + 'vaccine_coverage_per_age_group_archived_20220908', + 'booster_coverage_archived_20220904', + 'vaccine_coverage_per_age_group_archived_20231004' + ), + createGetArchivedChoroplethData({ + gm: ({ vaccine_coverage_per_age_group_choropleth_archived_20231004 }, ctx) => { + if (!isDefined(vaccine_coverage_per_age_group_choropleth_archived_20231004)) { return { - vaccine_coverage_per_age_group: null as unknown as GmCollectionVaccineCoveragePerAgeGroup[], + vaccine_coverage_per_age_group_choropleth_archived_20231004: null as unknown as ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth[], }; } const vrCode = isPresent(ctx.params?.code) ? vrCodeByGmCode[ctx.params?.code as 'string'] : undefined; return { - vaccine_coverage_per_age_group: isDefined(vrCode) - ? vaccine_coverage_per_age_group.filter((vaccineCoveragePerAgeGroup) => gmCodesByVrCode[vrCode].includes(vaccineCoveragePerAgeGroup.gmcode)) - : vaccine_coverage_per_age_group, + vaccine_coverage_per_age_group_choropleth_archived_20231004: isDefined(vrCode) + ? vaccine_coverage_per_age_group_choropleth_archived_20231004.filter((vaccineCoveragePerAgeGroup) => gmCodesByVrCode[vrCode].includes(vaccineCoveragePerAgeGroup.gmcode)) + : vaccine_coverage_per_age_group_choropleth_archived_20231004, }; }, }), @@ -73,12 +79,11 @@ export const getStaticProps = createGetStaticProps( ); export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => { - const { pageText, choropleth, municipalityName, selectedGmData: currentData, selectedArchivedGmData: archivedData, content, lastGenerated } = props; + const { pageText, archivedChoropleth, municipalityName, selectedGmData: currentData, selectedArchivedGmData: archivedData, content, lastGenerated } = props; const { commonTexts } = useIntl(); const { formatPercentageAsNumber } = useFormatLokalizePercentage(); const [hasHideArchivedCharts, setHideArchivedCharts] = useState<boolean>(false); const reverseRouter = useReverseRouter(); - const { textGm, textNl, textShared } = useDynamicLokalizeTexts<LokalizeTexts>(pageText, selectLokalizeTexts); const metadata = { @@ -92,8 +97,8 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => }; const filteredVaccination = { - primarySeries: currentData.vaccine_coverage_per_age_group.values.find((item) => item.vaccination_type === 'primary_series'), - autumn2022: currentData.vaccine_coverage_per_age_group.values.find((item) => item.vaccination_type === 'autumn_2022'), + primarySeries: archivedData.vaccine_coverage_per_age_group_archived_20231004.values.find((item) => item.vaccination_type === 'primary_series'), + autumn2022: archivedData.vaccine_coverage_per_age_group_archived_20231004.values.find((item) => item.vaccination_type === 'autumn_2022'), }; assert(filteredVaccination.primarySeries, `[${VaccinationsGmPage.name}] Could not find data for the vaccine coverage per age group for the primary series`); @@ -138,38 +143,9 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => faq: content.faqs, })} /> - {filteredVaccination.autumn2022.birthyear_range_60_plus && ( - <BorderedKpiSection - title={textShared.vaccination_grade_tile.autumn_labels.title} - description={textShared.vaccination_grade_tile.autumn_labels.description} - source={textShared.vaccination_grade_tile.autumn_labels.source} - tilesData={[ - { - value: filteredVaccination.autumn2022.vaccinated_percentage_60_plus, - isPercentage: true, - birthyear: filteredVaccination.autumn2022.birthyear_range_60_plus, - title: textShared.vaccination_grade_tile.age_group_labels.age_60_plus, - description: textShared.vaccination_grade_tile.autumn_labels.description_60_plus, - bar: { - value: filteredVaccination.autumn2022.vaccinated_percentage_60_plus || 0, - color: colors.scale.blueDetailed[8], - }, - }, - { - value: filteredVaccination.autumn2022.vaccinated_percentage_12_plus, - isPercentage: true, - birthyear: filteredVaccination.autumn2022.birthyear_range_12_plus, - title: textShared.vaccination_grade_tile.age_group_labels.age_12_plus, - description: textShared.vaccination_grade_tile.autumn_labels.description_12_plus, - bar: { - value: filteredVaccination.autumn2022.vaccinated_percentage_12_plus || 0, - color: colors.scale.blueDetailed[8], - }, - }, - ]} - dateOrRange={filteredVaccination.autumn2022.date_unix} - /> - )} + + {!!textShared.warning && <WarningTile isFullWidth message={textShared.warning} variant="informational" />} + <BorderedKpiSection title={textShared.vaccination_grade_tile.fully_vaccinated_labels.title} description={textShared.vaccination_grade_tile.fully_vaccinated_labels.description} @@ -201,7 +177,7 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => dateOrRange={filteredVaccination.primarySeries.date_unix} /> <VaccineCoverageChoropleth - data={choropleth.gm.vaccine_coverage_per_age_group} + data={archivedChoropleth.gm.vaccine_coverage_per_age_group_choropleth_archived_20231004} dataOptions={{ getLink: reverseRouter.gm.vaccinaties, selectedCode: currentData.code, isPercentage: true }} text={{ title: replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.gm.title, { municipalityName: municipalityName }), @@ -209,6 +185,7 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => vaccinationKindLabel: commonTexts.choropleth.vaccination_coverage.shared.dropdown_label_vaccination_coverage_kind_select, ageGroupLabel: commonTexts.choropleth.vaccination_coverage.shared.dropdown_label_age_group_select, }} + isPrimarySeries /> {content.faqs && content.faqs.questions?.length > 0 && <PageFaqTile questions={content.faqs.questions} title={content.faqs.sectionTitle} />} @@ -228,6 +205,48 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => {hasHideArchivedCharts && ( <> + {filteredVaccination.autumn2022.birthyear_range_60_plus && ( + <BorderedKpiSection + title={textShared.vaccination_grade_tile.autumn_labels.title} + description={textShared.vaccination_grade_tile.autumn_labels.description} + source={textShared.vaccination_grade_tile.autumn_labels.source} + tilesData={[ + { + value: filteredVaccination.autumn2022.vaccinated_percentage_60_plus, + isPercentage: true, + birthyear: filteredVaccination.autumn2022.birthyear_range_60_plus, + title: textShared.vaccination_grade_tile.age_group_labels.age_60_plus, + description: textShared.vaccination_grade_tile.autumn_labels.description_60_plus, + bar: { + value: filteredVaccination.autumn2022.vaccinated_percentage_60_plus || 0, + color: colors.scale.blueDetailed[8], + }, + }, + { + value: filteredVaccination.autumn2022.vaccinated_percentage_12_plus, + isPercentage: true, + birthyear: filteredVaccination.autumn2022.birthyear_range_12_plus, + title: textShared.vaccination_grade_tile.age_group_labels.age_12_plus, + description: textShared.vaccination_grade_tile.autumn_labels.description_12_plus, + bar: { + value: filteredVaccination.autumn2022.vaccinated_percentage_12_plus || 0, + color: colors.scale.blueDetailed[8], + }, + }, + ]} + dateOrRange={filteredVaccination.autumn2022.date_unix} + /> + )} + <VaccineCoverageChoropleth + data={archivedChoropleth.gm.vaccine_coverage_per_age_group_choropleth_archived_20231004} + dataOptions={{ getLink: reverseRouter.gm.vaccinaties, selectedCode: currentData.code, isPercentage: true }} + text={{ + title: replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.gm.archived.title, { municipalityName: municipalityName }), + description: replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.gm.archived.description, { municipalityName: municipalityName }), + vaccinationKindLabel: commonTexts.choropleth.vaccination_coverage.shared.dropdown_label_vaccination_coverage_kind_select, + ageGroupLabel: commonTexts.choropleth.vaccination_coverage.shared.dropdown_label_age_group_select, + }} + /> <VaccineCoverageToggleTile title={textGm.vaccination_grade_toggle_tile.title} source={textGm.vaccination_grade_toggle_tile.source} diff --git a/packages/app/src/pages/landelijk/vaccinaties.tsx b/packages/app/src/pages/landelijk/vaccinaties.tsx index a3536789d4..e5e1ce2021 100644 --- a/packages/app/src/pages/landelijk/vaccinaties.tsx +++ b/packages/app/src/pages/landelijk/vaccinaties.tsx @@ -15,7 +15,7 @@ import { WarningTile } from '~/components/warning-tile'; import { Layout, NlLayout } from '~/domain/layout'; import { Autumn2022ShotCoveragePerAgeGroup, - BoosterShotCoveragePerAgeGroup, + CampaignBanner, VaccinationsKpiHeader, VaccinationsOverTimeTile, VaccinationsShotKpiSection, @@ -26,6 +26,8 @@ import { VaccineDeliveryBarChart, VaccineStockPerSupplierChart, selectAdministrationData, + BoosterShotCoveragePerAgeGroup, + PrimarySeriesShotCoveragePerAgeGroup, } from '~/domain/vaccine'; import { VaccinationsPerSupplierOverLastTimeframeTile } from '~/domain/vaccine/vaccinations-per-supplier-over-last-timeframe-tile'; import { VaccineCampaignsTile } from '~/domain/vaccine/vaccine-campaigns-tile/vaccine-campaigns-tile'; @@ -34,7 +36,15 @@ import { Languages, SiteText } from '~/locale'; import { ElementsQueryResult, getElementsQuery, getTimelineEvents } from '~/queries/get-elements-query'; import { getArticleParts, getDataExplainedParts, getFaqParts, getLinkParts, getPagePartsQuery, getRichTextParts } from '~/queries/get-page-parts-query'; import { StaticProps, createGetStaticProps } from '~/static-props/create-get-static-props'; -import { createGetChoroplethData, createGetContent, getLastGeneratedDate, getLokalizeTexts, getNlData, selectArchivedNlData, selectNlData } from '~/static-props/get-data'; +import { + createGetArchivedChoroplethData, + createGetContent, + getArchivedNlData, + getLastGeneratedDate, + getLokalizeTexts, + selectArchivedNlData, + selectNlData, +} from '~/static-props/get-data'; import { ArticleParts, LinkParts, PagePartQueryResult, RichTextParts } from '~/types/cms'; import { replaceVariablesInText, useFormatLokalizePercentage } from '~/utils'; import { useDynamicLokalizeTexts } from '~/utils/cms/use-dynamic-lokalize-texts'; @@ -43,10 +53,10 @@ import { getPageInformationHeaderContent } from '~/utils/get-page-information-he import { useReverseRouter } from '~/utils/use-reverse-router'; const pageMetrics = [ - 'vaccine_administered_doctors', + 'vaccine_administered_doctors_archived_20220324', 'vaccine_administered_hospitals_and_care_institutions', - 'vaccine_administered_planned', - 'vaccine_administered_total', + 'vaccine_administered_planned_archived_20231004', + 'vaccine_administered_total_archived_20220324', 'vaccine_administered_last_timeframe', 'vaccine_coverage_per_age_group', 'vaccine_coverage_archived_20220518', @@ -62,31 +72,20 @@ const pageMetrics = [ 'repeating_shot_administered_20220713', ]; -const selectLokalizeTexts = (siteText: SiteText) => ({ - metadataTexts: siteText.pages.topical_page.nl.nationaal_metadata, - textNl: siteText.pages.vaccinations_page.nl, - textShared: siteText.pages.vaccinations_page.shared, -}); - -type LokalizeTexts = ReturnType<typeof selectLokalizeTexts>; - export const getStaticProps = createGetStaticProps( ({ locale }: { locale: keyof Languages }) => getLokalizeTexts(selectLokalizeTexts, locale), getLastGeneratedDate, - selectNlData( - 'vaccine_administered_doctors', - 'vaccine_administered_hospitals_and_care_institutions', - 'vaccine_administered_planned', - 'vaccine_administered_total', - 'vaccine_administered_last_timeframe', - 'vaccine_coverage_per_age_group', - 'vaccine_coverage_per_age_group_estimated_fully_vaccinated', - 'vaccine_coverage_per_age_group_estimated_autumn_2022', - 'vaccine_campaigns' - ), + selectNlData('vaccine_administered_last_timeframe', 'vaccine_campaigns'), selectArchivedNlData( + 'vaccine_administered_doctors_archived_20220324', + 'vaccine_administered_hospitals_and_care_institutions_archived_20220324', + 'vaccine_administered_planned_archived_20220518', + 'vaccine_administered_total_archived_20220324', 'vaccine_coverage_per_age_group_archived_20220908', 'vaccine_coverage_per_age_group_archived_20220622', + 'vaccine_coverage_per_age_group_archived_20231004', + 'vaccine_coverage_per_age_group_estimated_autumn_2022_archived_20231004', + 'vaccine_coverage_per_age_group_estimated_fully_vaccinated_archived_20231004', 'vaccine_campaigns_archived_20220908', 'vaccine_planned_archived_20220908', 'booster_coverage_archived_20220904', @@ -98,7 +97,7 @@ export const getStaticProps = createGetStaticProps( 'vaccine_stock_archived_20211024', 'vaccine_vaccinated_or_support_archived_20230411' ), - () => selectAdministrationData(getNlData().data.vaccine_administered), + () => selectAdministrationData(getArchivedNlData().data.vaccine_administered_archived_20220914), async (context: GetStaticPropsContext) => { const { content } = await createGetContent<{ parts: PagePartQueryResult<ArticleParts | LinkParts | RichTextParts>; @@ -106,7 +105,7 @@ export const getStaticProps = createGetStaticProps( }>((context) => { return `{ "parts": ${getPagePartsQuery('vaccinations_page')}, - "elements": ${getElementsQuery('nl', ['vaccine_coverage_archived_20220518', 'vaccine_administered'], context.locale)} + "elements": ${getElementsQuery('nl', ['vaccine_coverage_archived_20220518', 'vaccine_administered_archived_20220914'], context.locale)} }`; })(context); @@ -125,13 +124,21 @@ export const getStaticProps = createGetStaticProps( }, }; }, - createGetChoroplethData({ - gm: ({ vaccine_coverage_per_age_group }) => vaccine_coverage_per_age_group ?? null, + createGetArchivedChoroplethData({ + gm: ({ vaccine_coverage_per_age_group_choropleth_archived_20231004 }) => vaccine_coverage_per_age_group_choropleth_archived_20231004 ?? null, }) ); +const selectLokalizeTexts = (siteText: SiteText) => ({ + metadataTexts: siteText.pages.topical_page.nl.nationaal_metadata, + textNl: siteText.pages.vaccinations_page.nl, + textShared: siteText.pages.vaccinations_page.shared, +}); + +type LokalizeTexts = ReturnType<typeof selectLokalizeTexts>; + function VaccinationPage(props: StaticProps<typeof getStaticProps>) { - const { content, choropleth, selectedNlData: currentData, selectedArchivedNlData: archivedData, lastGenerated, administrationData } = props; + const { content, archivedChoropleth, selectedNlData: currentData, selectedArchivedNlData: archivedData, lastGenerated, administrationData } = props; const { commonTexts, formatNumber } = useIntl(); const reverseRouter = useReverseRouter(); @@ -145,8 +152,8 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { description: textNl.metadata.description, }; - const vaccineCoverageEstimatedFullyVaccinated = currentData.vaccine_coverage_per_age_group_estimated_fully_vaccinated.last_value; - const vaccineCoverageEstimatedAutumn2022 = currentData.vaccine_coverage_per_age_group_estimated_autumn_2022.last_value; + const vaccineCoverageEstimatedFullyVaccinated = archivedData.vaccine_coverage_per_age_group_estimated_fully_vaccinated_archived_20231004.last_value; + const vaccineCoverageEstimatedAutumn2022 = archivedData.vaccine_coverage_per_age_group_estimated_autumn_2022_archived_20231004.last_value; const vaccineCoverageEstimatedArchivedLastValue = archivedData.vaccine_coverage_per_age_group_estimated_archived_20220908.last_value; @@ -176,7 +183,7 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { description={textNl.information_block.description} metadata={{ datumsText: textNl.dates, - dateOrRange: currentData.vaccine_administered_total.last_value.date_unix, + dateOrRange: archivedData.vaccine_administered_total_archived_20220324.last_value.date_unix, dateOfInsertionUnix: lastInsertionDateOfPage, dataSources: [textShared.bronnen.rivm], }} @@ -188,35 +195,57 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { /> <BorderedKpiSection - title={textShared.vaccination_grade_tile.autumn_labels.title} - description={textShared.vaccination_grade_tile.autumn_labels.description} - source={textShared.vaccination_grade_tile.autumn_labels.source} + title={textNl.kpi_vaccinaties_de_coronaprik.title} + description={textNl.kpi_vaccinaties_de_coronaprik.description} tilesData={[ { - value: vaccineCoverageEstimatedAutumn2022.age_60_plus_vaccinated, - isPercentage: true, - birthyear: vaccineCoverageEstimatedAutumn2022.age_60_plus_birthyear, - title: textShared.vaccination_grade_tile.age_group_labels.age_60_plus, - description: textShared.vaccination_grade_tile.autumn_labels.description_60_plus, - bar: { - value: vaccineCoverageEstimatedAutumn2022.age_60_plus_vaccinated, - color: colors.scale.blueDetailed[8], - }, + 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: currentData.vaccine_campaigns.vaccine_campaigns[0].vaccine_administered_last_timeframe, + dateOrRange: { start: currentData.vaccine_campaigns.date_start_unix, end: currentData.vaccine_campaigns.date_end_unix }, + source: textShared.bronnen.rivm, }, { - value: vaccineCoverageEstimatedAutumn2022.age_12_plus_vaccinated, - isPercentage: true, - birthyear: vaccineCoverageEstimatedAutumn2022.age_12_plus_birthyear, - title: textShared.vaccination_grade_tile.age_group_labels.age_12_plus, - description: textShared.vaccination_grade_tile.autumn_labels.description_12_plus, - bar: { - value: vaccineCoverageEstimatedAutumn2022.age_12_plus_vaccinated, - color: colors.scale.blueDetailed[8], - }, + title: textNl.kpi_vaccinaties_de_coronaprik.tile_amount_administered_total.title, + description: textNl.kpi_vaccinaties_de_coronaprik.tile_amount_administered_total.omschrijving, + value: currentData.vaccine_campaigns.vaccine_campaigns[0].vaccine_administered_total, + dateOrRange: currentData.vaccine_campaigns.date_of_insertion_unix, + source: textShared.bronnen.rivm, }, ]} - dateOrRange={vaccineCoverageEstimatedAutumn2022.date_unix} /> + + <VaccinationsPerSupplierOverLastTimeframeTile + title={textNl.vaccinations_per_supplier_over_last_timeframe.title} + description={textNl.vaccinations_per_supplier_over_last_timeframe.description} + data={currentData.vaccine_administered_last_timeframe.vaccine_types} + metadata={{ + source: textShared.bronnen.rivm, + 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, + }} + /> + + <CampaignBanner + title={textNl.vaccine_campaigns.autumn_2023.campaign_banner.title} + description={textNl.vaccine_campaigns.autumn_2023.campaign_banner.description} + altText={textNl.vaccine_campaigns.autumn_2023.campaign_banner.alt} + /> + + <PageInformationBlock + title={textNl.section_basisserie.title} + description={textNl.section_basisserie.description} + icon={<VaccinatieIcon aria-hidden="true" />} + metadata={{ + datumsText: textNl.dates_archived, + dateOrRange: archivedData.vaccine_administered_total_archived_20220324.last_value.date_unix, + dateOfInsertionUnix: archivedData.vaccine_coverage_per_age_group_estimated_fully_vaccinated_archived_20231004.last_value.date_unix, + dataSources: [textShared.bronnen.rivm], + }} + /> + + <WarningTile message={textNl.basisserie_niet_bijgewerkt} variant="informational" isFullWidth /> + <BorderedKpiSection title={textShared.vaccination_grade_tile.fully_vaccinated_labels.title} description={textShared.vaccination_grade_tile.fully_vaccinated_labels.description} @@ -248,52 +277,29 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { dateOrRange={vaccineCoverageEstimatedFullyVaccinated.date_unix} /> - <VaccineCampaignsTile - title={textNl.vaccine_campaigns.title} - description={textNl.vaccine_campaigns.description} - descriptionFooter={textNl.vaccine_campaigns.description_footer} - headers={textNl.vaccine_campaigns.headers} - campaigns={currentData.vaccine_campaigns.vaccine_campaigns} - campaignDescriptions={textNl.vaccine_campaigns.campaigns} - metadata={{ - datumsText: textNl.dates, - date: currentData.vaccine_campaigns.date_unix, - source: textNl.vaccine_campaigns.bronnen.rivm, - }} - /> - - <VaccinationsPerSupplierOverLastTimeframeTile - title={textNl.vaccinations_per_supplier_over_last_timeframe.title} - description={textNl.vaccinations_per_supplier_over_last_timeframe.description} - data={currentData.vaccine_administered_last_timeframe.vaccine_types} - metadata={{ - source: textShared.bronnen.rivm, - 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, - }} - /> - <VaccineCoverageChoropleth - data={choropleth.gm} + data={archivedChoropleth.gm} dataOptions={{ getLink: (gmcode) => reverseRouter.gm.vaccinaties(gmcode), isPercentage: true }} text={{ - title: commonTexts.choropleth.choropleth_vaccination_coverage.nl.title, - description: commonTexts.choropleth.choropleth_vaccination_coverage.nl.description, + title: commonTexts.choropleth.choropleth_vaccination_coverage.nl.archived.fully_vaccinated.title, + description: commonTexts.choropleth.choropleth_vaccination_coverage.nl.archived.fully_vaccinated.description, vaccinationKindLabel: commonTexts.choropleth.vaccination_coverage.shared.dropdown_label_vaccination_coverage_kind_select, ageGroupLabel: commonTexts.choropleth.vaccination_coverage.shared.dropdown_label_age_group_select, }} + isPrimarySeries /> - <Autumn2022ShotCoveragePerAgeGroup + + <PrimarySeriesShotCoveragePerAgeGroup text={textNl.vaccination_coverage} title={textNl.vaccination_coverage.title} description={textNl.vaccination_coverage.description_autumn_2022_shot} sortingOrder={['80+', '70-79', '60-69', '50-59', '40-49', '30-39', '18-29', '12-17', '5-11']} metadata={{ datumsText: textNl.dates, - date: currentData.vaccine_coverage_per_age_group.values[0].date_unix, + date: archivedData.vaccine_coverage_per_age_group_archived_20231004.values[0].date_unix, source: textNl.vaccination_coverage.bronnen.rivm, }} - values={currentData.vaccine_coverage_per_age_group.values} + values={archivedData.vaccine_coverage_per_age_group_archived_20231004.values} /> {content.faqs && content.faqs.questions?.length > 0 && <PageFaqTile questions={content.faqs.questions} title={content.faqs.sectionTitle} />} @@ -313,6 +319,80 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { {hasHideArchivedCharts && ( <> + <BorderedKpiSection + title={textShared.vaccination_grade_tile.autumn_labels.title} + description={textShared.vaccination_grade_tile.autumn_labels.description} + source={textShared.vaccination_grade_tile.autumn_labels.source} + tilesData={[ + { + value: vaccineCoverageEstimatedAutumn2022.age_60_plus_vaccinated, + isPercentage: true, + birthyear: vaccineCoverageEstimatedAutumn2022.age_60_plus_birthyear, + title: textShared.vaccination_grade_tile.age_group_labels.age_60_plus, + description: textShared.vaccination_grade_tile.autumn_labels.description_60_plus, + bar: { + value: vaccineCoverageEstimatedAutumn2022.age_60_plus_vaccinated, + color: colors.scale.blueDetailed[8], + }, + }, + { + value: vaccineCoverageEstimatedAutumn2022.age_12_plus_vaccinated, + isPercentage: true, + birthyear: vaccineCoverageEstimatedAutumn2022.age_12_plus_birthyear, + title: textShared.vaccination_grade_tile.age_group_labels.age_12_plus, + description: textShared.vaccination_grade_tile.autumn_labels.description_12_plus, + bar: { + value: vaccineCoverageEstimatedAutumn2022.age_12_plus_vaccinated, + color: colors.scale.blueDetailed[8], + }, + }, + ]} + dateOrRange={vaccineCoverageEstimatedAutumn2022.date_unix} + /> + + <VaccineCampaignsTile + title={textNl.vaccine_campaigns.title} + description={replaceVariablesInText(textNl.vaccine_campaigns.description_archived, { + vaccinePlanned: formatNumber(archivedData.vaccine_planned_archived_20220908.doses), + })} + descriptionFooter={textNl.vaccine_campaigns.description_footer} + headers={textNl.vaccine_campaigns.headers} + campaigns={archivedData.vaccine_campaigns_archived_20220908.vaccine_campaigns} + campaignDescriptions={textNl.vaccine_campaigns.campaigns} + campaignOptions={{ + hide_campaigns: [3], + }} + metadata={{ + datumsText: textNl.dates, + date: archivedData.vaccine_campaigns_archived_20220908.date_unix, + source: textNl.vaccine_campaigns.bronnen.rivm, + }} + /> + + <VaccineCoverageChoropleth + data={archivedChoropleth.gm} + dataOptions={{ getLink: (gmcode) => reverseRouter.gm.vaccinaties(gmcode), isPercentage: true }} + text={{ + title: commonTexts.choropleth.choropleth_vaccination_coverage.nl.archived.autumn_2022.title, + description: commonTexts.choropleth.choropleth_vaccination_coverage.nl.archived.autumn_2022.description, + vaccinationKindLabel: commonTexts.choropleth.vaccination_coverage.shared.dropdown_label_vaccination_coverage_kind_select, + ageGroupLabel: commonTexts.choropleth.vaccination_coverage.shared.dropdown_label_age_group_select, + }} + /> + + <Autumn2022ShotCoveragePerAgeGroup + text={textNl.vaccination_coverage} + title={textNl.vaccination_coverage.title} + description={textNl.vaccination_coverage.description_autumn_2022_shot} + 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, + source: textNl.vaccination_coverage.bronnen.rivm, + }} + values={archivedData.vaccine_coverage_per_age_group_archived_20231004.values} + /> + <BoosterShotCoveragePerAgeGroup text={textNl} title={textNl.vaccination_coverage.title} @@ -325,6 +405,7 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { }} values={archivedData.vaccine_coverage_per_age_group_archived_20220908.values} /> + <VaccineCoverageToggleTile labelTexts={textNl.vaccination_grade_toggle_tile.top_labels} title={textNl.vaccination_grade_toggle_tile.title} @@ -348,21 +429,7 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { age12PlusToggleText={textNl.vaccination_grade_toggle_tile.age_12_plus} age18PlusToggleText={textNl.vaccination_grade_toggle_tile.age_18_plus} /> - <VaccineCampaignsTile - title={textNl.vaccine_campaigns.title} - description={replaceVariablesInText(textNl.vaccine_campaigns.description_archived, { - vaccinePlanned: formatNumber(archivedData.vaccine_planned_archived_20220908.doses), - })} - descriptionFooter={textNl.vaccine_campaigns.description_footer} - headers={textNl.vaccine_campaigns.headers} - campaigns={archivedData.vaccine_campaigns_archived_20220908.vaccine_campaigns} - campaignDescriptions={textNl.vaccine_campaigns.campaigns} - metadata={{ - datumsText: textNl.dates, - date: archivedData.vaccine_campaigns_archived_20220908.date_unix, - source: textNl.vaccine_campaigns.bronnen.rivm, - }} - /> + <VaccinationsKpiHeader text={textNl.repeating_shot_information_block} dateUnix={boosterShotAdministeredArchivedLastValue.date_unix} @@ -386,10 +453,10 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { text={textNl} coverageData={archivedData.vaccine_coverage_archived_20220518} administrationData={administrationData} - vaccineAdministeredPlannedLastValue={currentData.vaccine_administered_planned.last_value} + vaccineAdministeredPlannedLastValue={archivedData.vaccine_administered_planned_archived_20220518.last_value} timelineEvents={{ coverage: getTimelineEvents(content.elements.timeSeries, 'vaccine_coverage_archived_20220518'), - deliveryAndAdministration: getTimelineEvents(content.elements.timeSeries, 'vaccine_administered'), + deliveryAndAdministration: getTimelineEvents(content.elements.timeSeries, 'vaccine_administered_archived_20220914'), }} /> diff --git a/packages/app/src/static-props/get-data.ts b/packages/app/src/static-props/get-data.ts index 2abab323cf..75fc0c81f0 100644 --- a/packages/app/src/static-props/get-data.ts +++ b/packages/app/src/static-props/get-data.ts @@ -124,13 +124,6 @@ export function selectNlData<T extends keyof Nl | F.AutoPath<Nl, keyof Nl, '.'>> return () => { const { data } = getNlData(); - /** - * Instead of getting the full timeseries we are getting the latest value only per age group. - */ - if (isDefined(data.vaccine_coverage_per_age_group)) { - data.vaccine_coverage_per_age_group.values = getCoveragePerAgeGroupLatestValues(data.vaccine_coverage_per_age_group.values); - } - const selectedNlData = metrics.reduce( (acc, p) => set( @@ -170,6 +163,13 @@ export function selectArchivedNlData<T extends keyof ArchivedNl | F.AutoPath<Arc return () => { const { data } = getArchivedNlData(); + /** + * Instead of getting the full timeseries we are getting the latest value only per age group. + */ + if (isDefined(data.vaccine_coverage_per_age_group_archived_20231004)) { + data.vaccine_coverage_per_age_group_archived_20231004.values = getCoveragePerAgeGroupLatestValues(data.vaccine_coverage_per_age_group_archived_20231004.values); + } + const selectedArchivedNlData = metrics.reduce( (acc, p) => set( diff --git a/packages/cli/src/schema/schema-info.ts b/packages/cli/src/schema/schema-info.ts index 90b5cca6e3..df00726944 100644 --- a/packages/cli/src/schema/schema-info.ts +++ b/packages/cli/src/schema/schema-info.ts @@ -28,7 +28,10 @@ export function getSchemaInfo(jsonDirectory: string = defaultJsonDirectory): Sch gm: { files: getFileNames(fileList, /^GM[0-9]+.json$/), basePath: jsonDirectory, - customValidations: [createChoroplethValidation(path.join(defaultJsonDirectory, 'GM_COLLECTION.json'), 'gmcode', ['vaccine_coverage_per_age_group']), validateMovingAverages], + customValidations: [ + createChoroplethValidation(path.join(defaultJsonDirectory, 'GM_COLLECTION.json'), 'gmcode', ['vaccine_coverage_per_age_group_archived_20231004']), + validateMovingAverages, + ], }, gm_collection: { files: ['GM_COLLECTION.json'], basePath: jsonDirectory }, archived_nl: { @@ -39,7 +42,7 @@ export function getSchemaInfo(jsonDirectory: string = defaultJsonDirectory): Sch files: getFileNames(archivedFileList, /^GM[0-9]+.json$/), basePath: path.join(jsonDirectory, 'archived'), customValidations: [ - createChoroplethValidation(path.join(defaultJsonDirectory, 'archived', 'GM_COLLECTION.json'), 'gmcode', ['vaccine_coverage_per_age_group']), + createChoroplethValidation(path.join(defaultJsonDirectory, 'archived', 'GM_COLLECTION.json'), 'gmcode', ['vaccine_coverage_per_age_group_archived_20231004']), validateMovingAverages, ], }, diff --git a/packages/cms-v2/src/elements/schemas/shared/index.ts b/packages/cms-v2/src/elements/schemas/shared/index.ts index 029cf55f8d..18770e9d90 100644 --- a/packages/cms-v2/src/elements/schemas/shared/index.ts +++ b/packages/cms-v2/src/elements/schemas/shared/index.ts @@ -57,12 +57,12 @@ const titleByMetricName: Partial<Record<MetricName, string>> = { hospital_nice: 'Ziekenhuisopnames', intensive_care_nice: 'IC-opnames', reproduction_archived_20230711: 'Reproductiegetal', - vaccine_coverage_per_age_group: 'Vaccinatiegraad (per leeftijd)', - vaccine_administered: 'Gezette prikken', + vaccine_coverage_per_age_group_archived_20231004: 'Vaccinatiegraad (per leeftijd)', + vaccine_administered_archived_20220914: 'Gezette prikken', vaccine_coverage_archived_20220518: 'Vaccinatiegraad', - vaccine_coverage_per_age_group_estimated_fully_vaccinated: 'Vaccinatiegraad basisserie berekend (per leeftijd)', - vaccine_coverage_per_age_group_estimated_autumn_2022: 'Vaccinatiegraad herfst 2022 booster berekend (per leeftijd)', - vaccine_administered_total: 'Totaal gezette prikken', + vaccine_coverage_per_age_group_estimated_fully_vaccinated_archived_20231004: 'Vaccinatiegraad basisserie berekend (per leeftijd)', + vaccine_coverage_per_age_group_estimated_autumn_2022_archived_20231004: 'Vaccinatiegraad herfst 2022 booster berekend (per leeftijd)', + vaccine_administered_total_archived_20220324: 'Totaal gezette prikken', nursing_home_archived_20230126: 'Verpleeghuizen', disability_care_archived_20230126: 'Gehandicaptenzorg', deceased_rivm_archived_20221231: 'Sterfte (RIVM)', diff --git a/packages/cms/src/lokalize/key-mutations.csv b/packages/cms/src/lokalize/key-mutations.csv index a7c6419a8a..f653d59620 100644 --- a/packages/cms/src/lokalize/key-mutations.csv +++ b/packages/cms/src/lokalize/key-mutations.csv @@ -1 +1,41 @@ timestamp,action,key,document_id,move_to +2023-09-12T09:25:11.961Z,add,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.titel,MlD8yElsvTVffFUh17v9QX,__ +2023-09-12T09:25:12.951Z,add,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.omschrijving,Ruz0yC4w36r8d89kKBqr9l,__ +2023-09-11T09:17:19.215Z,add,pages.vaccinations_page.shared.warning,MlD8yElsvTVffFUh16iULJ,__ +2023-09-11T10:30:31.950Z,add,common.choropleth.choropleth_vaccination_coverage.gm.archived.description,MlD8yElsvTVffFUh16ktPd,__ +2023-09-11T10:30:32.940Z,add,common.choropleth.choropleth_vaccination_coverage.gm.archived.title,uYp87y9X4zO2L2HWNEril1,__ +2023-09-18T14:01:37.076Z,add,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.tile_amount_administered.omschrijving,OkMYDzh72BFc2hr3nJ2Lkw,__ +2023-09-18T14:01:38.040Z,add,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.tile_amount_administered.title,DteE6ilYiKYImFm3VTFImC,__ +2023-09-18T14:01:38.994Z,add,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.tile_explanation.titel,DteE6ilYiKYImFm3VTFIyO,__ +2023-09-18T14:01:40.012Z,add,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.tile_explanation.omschrijving,zScV1rsnyM5v6J5UlmYwqT,__ +2023-09-18T14:01:40.013Z,delete,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.omschrijving,Ruz0yC4w36r8d89kKBqr9l,__ +2023-09-18T14:01:40.013Z,delete,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.titel,MlD8yElsvTVffFUh17v9QX,__ +2023-09-18T14:32:26.195Z,add,pages.vaccinations_page.nl.section_basisserie.title,OkMYDzh72BFc2hr3nJ2TOA,__ +2023-09-18T14:32:27.172Z,add,pages.vaccinations_page.nl.section_basisserie.description,zScV1rsnyM5v6J5UlmZFS1,__ +2023-09-20T12:54:18.463Z,add,common.choropleth.choropleth_vaccination_coverage.nl.archived.title,22Xg3hRGtxwin2PlG9NMPZ,__ +2023-09-20T12:54:19.482Z,add,common.choropleth.choropleth_vaccination_coverage.nl.archived.description,VHsF191hipdqXYgC9N3exS,__ +2023-09-20T12:54:20.436Z,add,pages.vaccinations_page.nl.vaccine_campaigns.campaigns.corona_shot_description,rSp4S739bAmLxyOsipsZex,__ +2023-09-20T12:54:20.437Z,delete,common.choropleth.choropleth_vaccination_coverage.nl.title,G6M7GhzH8XbtdKiRrez1Og,__ +2023-09-20T12:55:03.414Z,delete,common.choropleth.choropleth_vaccination_coverage.nl.title,G6M7GhzH8XbtdKiRrez1Og,__ +2023-09-20T12:58:51.350Z,add,common.choropleth.choropleth_vaccination_coverage.nl.archived.fully_vaccinated.description,22Xg3hRGtxwin2PlG9NYgS,__ +2023-09-20T12:58:52.372Z,add,common.choropleth.choropleth_vaccination_coverage.nl.archived.fully_vaccinated.title,rSp4S739bAmLxyOsipsmGD,__ +2023-09-20T12:58:53.410Z,add,common.choropleth.choropleth_vaccination_coverage.nl.archived.autumn_2022.title,22Xg3hRGtxwin2PlG9NYpP,__ +2023-09-20T12:58:54.472Z,add,common.choropleth.choropleth_vaccination_coverage.nl.archived.autumn_2022.description,TJ9Rmz8PFNgDMUrCLNzcFS,__ +2023-09-20T12:58:54.472Z,delete,common.choropleth.choropleth_vaccination_coverage.nl.archived.description,VHsF191hipdqXYgC9N3exS,__ +2023-09-20T12:58:54.473Z,delete,common.choropleth.choropleth_vaccination_coverage.nl.archived.title,22Xg3hRGtxwin2PlG9NMPZ,__ +2023-09-22T14:30:49.450Z,add,pages.vaccinations_page.nl.vaccine_campaigns.autumn_2023.campaign_banner.title,fQMSbwQpEgDbjt4uWGfKig,__ +2023-09-22T14:30:50.432Z,add,pages.vaccinations_page.nl.vaccine_campaigns.autumn_2023.campaign_banner.description,nX27LJrkVpILF9ToyJf7OI,__ +2023-09-29T14:03:41.724Z,add,pages.vaccinations_page.nl.basisserie_niet_bijgewerkt,uM9i5K7TlE0aLwmg4de0Um,__ +2023-09-29T14:03:42.869Z,add,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.title,TJ9Rmz8PFNgDMUrCLRPoOa,__ +2023-09-29T14:03:44.134Z,add,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.description,fQMSbwQpEgDbjt4uWJB5dn,__ +2023-09-29T14:03:45.263Z,add,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.tile_amount_administered_last_timeframe.omschrijving,TJ9Rmz8PFNgDMUrCLRPoX0,__ +2023-09-29T14:03:46.318Z,add,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.tile_amount_administered_last_timeframe.title,nX27LJrkVpILF9ToyLcrxK,__ +2023-09-29T14:03:47.271Z,add,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.tile_amount_administered_total.title,fQMSbwQpEgDbjt4uWJB5lm,__ +2023-09-29T14:03:48.341Z,add,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.tile_amount_administered_total.omschrijving,C32lwRDGVQp5utRyR4KaDj,__ +2023-09-29T14:03:48.343Z,delete,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.tile_amount_administered.omschrijving,OkMYDzh72BFc2hr3nJ2Lkw,__ +2023-09-29T14:03:48.344Z,delete,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.tile_amount_administered.title,DteE6ilYiKYImFm3VTFImC,__ +2023-09-29T14:03:48.345Z,delete,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.tile_explanation.omschrijving,zScV1rsnyM5v6J5UlmYwqT,__ +2023-09-29T14:03:48.346Z,delete,pages.vaccinations_page.nl.kpi_vaccinaties_de_coronaprik.tile_explanation.titel,DteE6ilYiKYImFm3VTFIyO,__ +2023-09-29T14:03:48.346Z,delete,__root.test_123,0hrRKce5hYl5O3WpoZ6oAl,__ +2023-09-29T14:03:48.347Z,delete,__root.test_key_345,0hrRKce5hYl5O3WpoZ6nXX,__ +2023-10-02T12:06:06.749Z,add,pages.vaccinations_page.nl.vaccine_campaigns.autumn_2023.campaign_banner.alt,fQMSbwQpEgDbjt4uWKBe2g,__ diff --git a/packages/cms/src/studio/constants.ts b/packages/cms/src/studio/constants.ts index 4ea6d7a79a..f7c2d10cff 100644 --- a/packages/cms/src/studio/constants.ts +++ b/packages/cms/src/studio/constants.ts @@ -36,21 +36,21 @@ export const titleByMetricName: Partial<Record<MetricName, string>> = { tested_ggd_archived_20230321: "Positief geteste mensen (GGD'en)", tested_overall_archived_20230331: 'Positief geteste mensen', tested_per_age_group_archived_20230331: 'Positief getest (per leeftijd)', - vaccine_administered_doctors: 'Gezette prikken (huisartsen)', - vaccine_administered_ggd_ghor: "Gezette prikken (GGD'en)", - vaccine_administered_ggd: "Gezette prikken (GGD'en)", - vaccine_administered_hospitals_and_care_institutions: 'Gezette prikken in instellingen (inclusief ziekenhuizen)', - vaccine_administered_planned: 'Gepland aantal te zetten prikken', - vaccine_administered_total: 'Totaal aantal gezette prikken', - vaccine_administered: 'Gezette prikken', + vaccine_administered_doctors_archived_20220324: 'Gezette prikken (huisartsen)', + vaccine_administered_ggd_ghor_archived_20220324: "Gezette prikken (GGD'en)", + vaccine_administered_ggd_archived_20220324: "Gezette prikken (GGD'en)", + vaccine_administered_hospitals_and_care_institutions_archived_20220324: 'Gezette prikken in instellingen (inclusief ziekenhuizen)', + vaccine_administered_planned_archived_20220518: 'Gepland aantal te zetten prikken', + vaccine_administered_total_archived_20220324: 'Totaal aantal gezette prikken', + vaccine_administered_archived_20220914: 'Gezette prikken', vaccine_campaigns_archived_20220908: 'Vaccinatie campagnes (archief per 08-09-2022)', vaccine_campaigns: 'Vaccinatie campagnes', vaccine_coverage_per_age_group_archived_20220908: 'Vaccinatiegraad (per leeftijd) (archief per 08-09-2022)', vaccine_coverage_per_age_group_archived_20220622: 'Vaccinatiegraad (per leeftijd) (archief)', vaccine_coverage_per_age_group_estimated_archived_20220908: 'Vaccinatiegraad berekend (per leeftijd) (archief 08-09-2022)', - vaccine_coverage_per_age_group_estimated_autumn_2022: 'Vaccinatiegraad herfst 2022 booster berekend (per leeftijd)', - vaccine_coverage_per_age_group_estimated_fully_vaccinated: 'Vaccinatiegraad basisserie berekend (per leeftijd)', - vaccine_coverage_per_age_group: 'Vaccinatiegraad (per leeftijd)', + vaccine_coverage_per_age_group_estimated_autumn_2022_archived_20231004: 'Vaccinatiegraad herfst 2022 booster berekend (per leeftijd)', + vaccine_coverage_per_age_group_estimated_fully_vaccinated_archived_20231004: 'Vaccinatiegraad basisserie berekend (per leeftijd)', + vaccine_coverage_per_age_group_archived_20231004: 'Vaccinatiegraad (per leeftijd)', vaccine_coverage_archived_20220518: 'Vaccinatiegraad', vaccine_delivery_per_supplier_archived_20211101: 'Vaccinleveringen per leverancier', vaccine_planned_archived_20220908: 'Geplande prikken (archief per 09-08-2022)', diff --git a/packages/cms/src/studio/data/data-structure.ts b/packages/cms/src/studio/data/data-structure.ts index 6e80c22a9c..3c2c8b2b04 100644 --- a/packages/cms/src/studio/data/data-structure.ts +++ b/packages/cms/src/studio/data/data-structure.ts @@ -23,6 +23,18 @@ export const dataStructure = { 'booster_shot_percentage_label', 'has_one_shot_percentage_label', ], + vaccine_coverage_per_age_group_archived_20231004: [ + 'vaccination_type', + 'birthyear_range_12_plus', + 'birthyear_range_18_plus', + 'birthyear_range_60_plus', + 'vaccinated_percentage_12_plus', + 'vaccinated_percentage_12_plus_label', + 'vaccinated_percentage_18_plus', + 'vaccinated_percentage_18_plus_label', + 'vaccinated_percentage_60_plus', + 'vaccinated_percentage_60_plus_label', + ], 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'], @@ -31,6 +43,18 @@ export const dataStructure = { hospital_nice_choropleth_archived_20230830: ['admissions_on_date_of_admission', 'admissions_on_date_of_admission_per_100000', 'admissions_on_date_of_reporting'], 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: [ + 'vaccination_type', + 'birthyear_range_12_plus', + 'birthyear_range_18_plus', + 'birthyear_range_60_plus', + 'vaccinated_percentage_12_plus', + 'vaccinated_percentage_12_plus_label', + 'vaccinated_percentage_18_plus', + 'vaccinated_percentage_18_plus_label', + 'vaccinated_percentage_60_plus', + 'vaccinated_percentage_60_plus_label', + ], }, archived_nl: { behavior_archived_20230411: [ @@ -183,7 +207,32 @@ export const dataStructure = { vulnerable_nursing_home_archived_20230711: ['newly_infected_locations', 'infected_locations_total', 'infected_locations_percentage'], reproduction_archived_20230711: ['index_low', 'index_average', 'index_high'], vaccine_vaccinated_or_support_archived_20230411: ['percentage_average', 'percentage_70_plus', 'percentage_55_69', 'percentage_40_54', 'percentage_25_39', 'percentage_16_24'], + vaccine_administered_archived_20220914: ['pfizer', 'moderna', 'astra_zeneca', 'cure_vac', 'janssen', 'sanofi', 'novavax', 'total'], + vaccine_administered_doctors_archived_20220324: ['estimated'], + vaccine_administered_ggd_ghor_archived_20220324: ['reported'], + vaccine_administered_ggd_archived_20220324: ['estimated'], + vaccine_administered_hospitals_and_care_institutions_archived_20220324: ['estimated'], + vaccine_administered_total_archived_20220324: ['estimated', 'reported'], + vaccine_administered_planned_archived_20220518: ['doses'], vaccine_coverage_archived_20220518: ['booster_vaccinated', 'partially_vaccinated', 'fully_vaccinated', 'partially_or_fully_vaccinated'], + vaccine_coverage_per_age_group_archived_20231004: [ + 'age_group_range', + 'age_group_percentage', + 'age_group_total', + 'autumn_2022_vaccinated', + 'fully_vaccinated', + 'autumn_2022_vaccinated_percentage', + 'fully_vaccinated_percentage', + 'date_of_report_unix', + 'birthyear_range', + ], + vaccine_coverage_per_age_group_estimated_autumn_2022_archived_20231004: ['age_12_plus_birthyear', 'age_12_plus_vaccinated', 'age_60_plus_birthyear', 'age_60_plus_vaccinated'], + vaccine_coverage_per_age_group_estimated_fully_vaccinated_archived_20231004: [ + 'age_12_plus_birthyear', + 'age_12_plus_vaccinated', + 'age_18_plus_birthyear', + 'age_18_plus_vaccinated', + ], vaccine_delivery_per_supplier_archived_20211101: [ 'total', 'bio_n_tech_pfizer', @@ -231,35 +280,8 @@ export const dataStructure = { 'admissions_on_date_of_reporting', ], sewer: ['average', 'data_is_outdated'], - vaccine_coverage_per_age_group: [ - 'vaccination_type', - 'birthyear_range_12_plus', - 'birthyear_range_18_plus', - 'birthyear_range_60_plus', - 'vaccinated_percentage_12_plus', - 'vaccinated_percentage_12_plus_label', - 'vaccinated_percentage_18_plus', - 'vaccinated_percentage_18_plus_label', - 'vaccinated_percentage_60_plus', - 'vaccinated_percentage_60_plus_label', - ], - }, - gm_collection: { - hospital_nice_choropleth: ['admissions_in_the_last_7_days_per_100000'], - sewer: ['average', 'data_is_outdated'], - vaccine_coverage_per_age_group: [ - 'vaccination_type', - 'birthyear_range_12_plus', - 'birthyear_range_18_plus', - 'birthyear_range_60_plus', - 'vaccinated_percentage_12_plus', - 'vaccinated_percentage_12_plus_label', - 'vaccinated_percentage_18_plus', - 'vaccinated_percentage_18_plus_label', - 'vaccinated_percentage_60_plus', - 'vaccinated_percentage_60_plus_label', - ], }, + gm_collection: { hospital_nice_choropleth: ['admissions_in_the_last_7_days_per_100000'], sewer: ['average', 'data_is_outdated'] }, nl: { intensive_care_nice: [ 'admissions_on_date_of_admission', @@ -307,26 +329,6 @@ export const dataStructure = { 'influx_covid_patients_moving_average', ], deceased_cbs: ['registered', 'expected', 'expected_min', 'expected_max'], - vaccine_administered: ['pfizer', 'moderna', 'astra_zeneca', 'cure_vac', 'janssen', 'sanofi', 'novavax', 'total'], - vaccine_administered_doctors: ['estimated'], - vaccine_administered_ggd_ghor: ['reported'], - vaccine_administered_ggd: ['estimated'], - vaccine_administered_hospitals_and_care_institutions: ['estimated'], - vaccine_administered_total: ['estimated', 'reported'], - vaccine_administered_planned: ['doses'], - vaccine_coverage_per_age_group: [ - 'age_group_range', - 'age_group_percentage', - 'age_group_total', - 'autumn_2022_vaccinated', - 'fully_vaccinated', - 'autumn_2022_vaccinated_percentage', - 'fully_vaccinated_percentage', - 'date_of_report_unix', - 'birthyear_range', - ], - vaccine_coverage_per_age_group_estimated_autumn_2022: ['age_12_plus_birthyear', 'age_12_plus_vaccinated', 'age_60_plus_birthyear', 'age_60_plus_vaccinated'], - vaccine_coverage_per_age_group_estimated_fully_vaccinated: ['age_12_plus_birthyear', 'age_12_plus_vaccinated', 'age_18_plus_birthyear', 'age_18_plus_vaccinated'], variants: ['variant_code', 'values', 'last_value'], self_test_overall: ['infected_percentage'], infectionradar_symptoms_trend_per_age_group_weekly: [ diff --git a/packages/common/src/feature-flags/features.ts b/packages/common/src/feature-flags/features.ts index 17f1184c3c..660272ae5b 100644 --- a/packages/common/src/feature-flags/features.ts +++ b/packages/common/src/feature-flags/features.ts @@ -4,13 +4,13 @@ export const features: Feature[] = [ { name: 'nlVaccinationCoveragePerAgeGroupAutumn2022', isEnabled: false, - metricName: 'vaccine_coverage_per_age_group_estimated_autumn_2022', - dataScopes: ['nl'], + metricName: 'vaccine_coverage_per_age_group_estimated_autumn_2022_archived_20231004', + dataScopes: ['archived_nl'], }, { name: 'nlVaccinationCoveragePerAgeGroupFullyVaccinated', isEnabled: false, - metricName: 'vaccine_coverage_per_age_group_estimated_fully_vaccinated', - dataScopes: ['nl'], + metricName: 'vaccine_coverage_per_age_group_estimated_fully_vaccinated_archived_20231004', + dataScopes: ['archived_nl'], }, ]; diff --git a/packages/common/src/theme/colors.ts b/packages/common/src/theme/colors.ts index 089c2345ed..1b5ef68801 100644 --- a/packages/common/src/theme/colors.ts +++ b/packages/common/src/theme/colors.ts @@ -51,6 +51,7 @@ const colorDefinitions = { //Orange scales orange1: '#E37321', orange2: '#A14E00', + orange3: '#F65234', //Yellow scales yellow1: '#FFF4C1', yellow2: '#fee670', @@ -120,16 +121,16 @@ export const colors = { }, vaccines: { - bio_n_tech_pfizer: colorDefinitions.blue6, + bio_n_tech_pfizer: colorDefinitions.blue7, moderna: colorDefinitions.yellow3, - astra_zeneca: colorDefinitions.green2, + astra_zeneca: colorDefinitions.green1, cure_vac: colorDefinitions.magenta1, - janssen: colorDefinitions.orange1, + janssen: colorDefinitions.orange3, sanofi: colorDefinitions.blue9, - novavax: colorDefinitions.magenta2, + novavax: colorDefinitions.magenta1, // @TODO remove when data is updated to new name - pfizer: colorDefinitions.blue6, + pfizer: colorDefinitions.blue7, /** * The below list are duplicates of the above entries, because BE is @@ -137,10 +138,10 @@ export const colors = { * data entry IDs. This has been introduced as part of COR-938. * @TODO - remove duplicates when/if BE is able to provide IDs. */ - 'BioNTech/Pfizer': colorDefinitions.blue6, + 'BioNTech/Pfizer': colorDefinitions.blue7, Moderna: colorDefinitions.yellow3, - AstraZeneca: colorDefinitions.green2, - Janssen: colorDefinitions.orange1, - Novavax: colorDefinitions.magenta2, + AstraZeneca: colorDefinitions.green1, + Janssen: colorDefinitions.orange3, + Novavax: colorDefinitions.magenta1, }, } as const; diff --git a/packages/common/src/types/data.ts b/packages/common/src/types/data.ts index 74d4a0a397..7aaebab7c0 100644 --- a/packages/common/src/types/data.ts +++ b/packages/common/src/types/data.ts @@ -15,6 +15,7 @@ export interface ArchivedGm { code: ArchivedGmCode; vaccine_coverage_per_age_group_archived_20220622: ArchivedGmVaccineCoveragePerAgeGroup; vaccine_coverage_per_age_group_archived_20220908: ArchivedGmVaccineCoveragePerAgeGroupWithBoosterShot; + vaccine_coverage_per_age_group_archived_20231004: ArchivedGmVaccineCampaignCoveragePerAgeGroup; booster_coverage_archived_20220904: ArchivedGmBoosterCoverage; sewer_archived_20230623: ArchivedGmSewer; tested_overall_archived_20230331: ArchivedGmTestedOverall; @@ -76,6 +77,23 @@ export interface ArchivedGmVaccineCoveragePerAgeGroupWithBoosterShotValue { date_unix: number; date_of_insertion_unix: number; } +export interface ArchivedGmVaccineCampaignCoveragePerAgeGroup { + values: ArchivedGmVaccineCampaignCoveragePerAgeGroupValue[]; +} +export interface ArchivedGmVaccineCampaignCoveragePerAgeGroupValue { + vaccination_type: string; + birthyear_range_12_plus: string; + birthyear_range_18_plus: string; + birthyear_range_60_plus: string | null; + vaccinated_percentage_12_plus: number | null; + vaccinated_percentage_12_plus_label: string | null; + vaccinated_percentage_18_plus: number | null; + vaccinated_percentage_18_plus_label: string | null; + vaccinated_percentage_60_plus: number | null; + vaccinated_percentage_60_plus_label: string | null; + date_unix: number; + date_of_insertion_unix: number; +} export interface ArchivedGmBoosterCoverage { values: ArchivedGmBoosterCoverageValue[]; } @@ -124,6 +142,7 @@ export interface ArchivedGmCollection { hospital_nice_choropleth_archived_20230830: ArchivedGmCollectionHospitalNiceChoropleth[]; sewer_archived_20230623: ArchivedGmCollectionSewer[]; tested_overall_archived_20230331: ArchivedGmCollectionTestedOverall[]; + vaccine_coverage_per_age_group_choropleth_archived_20231004: ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth[]; } export interface ArchivedGmCollectionHospitalNiceChoropleth { date_unix: number; @@ -149,6 +168,21 @@ export interface ArchivedGmCollectionTestedOverall { infected: number; date_of_insertion_unix: number; } +export interface ArchivedGmCollectionVaccineCoveragePerAgeGroupChoropleth { + gmcode: string; + vaccination_type: string; + birthyear_range_12_plus: string; + birthyear_range_18_plus: string; + birthyear_range_60_plus: string | null; + vaccinated_percentage_12_plus: number | null; + vaccinated_percentage_12_plus_label: string | null; + vaccinated_percentage_18_plus: number | null; + vaccinated_percentage_18_plus_label: string | null; + vaccinated_percentage_60_plus: number | null; + vaccinated_percentage_60_plus_label: string | null; + date_unix: number; + date_of_insertion_unix: number; +} export type ArchivedNlId = 'NL'; @@ -174,7 +208,8 @@ export interface ArchivedNl { tested_overall_archived_20230331: ArchivedNlTestedOverall; tested_per_age_group_archived_20230331: ArchivedNlTestedPerAgeGroup; sewer_archived_20230623: ArchivedNlSewer; - vaccine_campaigns_archived_20220908: ArchivedNlVaccineCampaigns; + vaccine_campaigns_archived_20220908: ArchivedNlVaccineCampaigns_2022; + vaccine_campaigns_archived_20231004: ArchivedNlVaccineCampaign_2023; vaccine_planned_archived_20220908: ArchivedNlVaccinePlanned; vaccine_coverage_per_age_group_archived_20220622: ArchivedNlVaccineCoveragePerAgeGroup; vaccine_coverage_per_age_group_archived_20220908: ArchivedNlVaccineCoveragePerAgeGroupWithBoosterShot; @@ -183,7 +218,17 @@ export interface ArchivedNl { vulnerable_hospital_admissions_archived_20230711: ArchivedNlVulnerableHospitalAdmissions; reproduction_archived_20230711: ArchivedNlReproduction; vaccine_vaccinated_or_support_archived_20230411: ArchivedNlVaccineVaccinatedOrSupport; + vaccine_administered_archived_20220914: NlVaccineAdministered; + vaccine_administered_doctors_archived_20220324: NlVaccineAdministeredDoctors; + vaccine_administered_ggd_ghor_archived_20220324: NlVaccineAdministeredGgdGhor; + vaccine_administered_ggd_archived_20220324: NlVaccineAdministeredGgd; + vaccine_administered_hospitals_and_care_institutions_archived_20220324: NlVaccineAdministeredHospitalsAndCareInstitutions; + vaccine_administered_total_archived_20220324: NlVaccineAdministeredTotal; + vaccine_administered_planned_archived_20220518: NlVaccineAdministeredPlanned; vaccine_coverage_archived_20220518: ArchivedNlVaccineCoverage; + vaccine_coverage_per_age_group_archived_20231004: NlVaccineCoveragePerAgeGroup; + vaccine_coverage_per_age_group_estimated_autumn_2022_archived_20231004: NlVaccineCoveragePerAgeGroupEstimatedAutumn_2022Value; + vaccine_coverage_per_age_group_estimated_fully_vaccinated_archived_20231004: NlVaccineCoveragePerAgeGroupEstimatedFullyVaccinatedValue; vaccine_delivery_per_supplier_archived_20211101: ArchivedNlVaccineDeliveryPerSupplier; vaccine_stock_archived_20211024: ArchivedNlVaccineStock; repeating_shot_administered_20220713: ArchivedNlRepeatingShotAdministered; @@ -494,20 +539,34 @@ export interface ArchivedNlSewerValue { date_of_insertion_unix: number; date_unix: number; } -export interface ArchivedNlVaccineCampaigns { - vaccine_campaigns: ArchivedNlVaccineCampaigns1[]; +export interface ArchivedNlVaccineCampaigns_2022 { + vaccine_campaigns: ArchivedNlVaccineCampaigns_20221[]; date_unix: number; date_start_unix: number; date_end_unix: number; date_of_insertion_unix: number; } -export interface ArchivedNlVaccineCampaigns1 { +export interface ArchivedNlVaccineCampaigns_20221 { vaccine_campaign_order: number; vaccine_campaign_name_nl: string; vaccine_campaign_name_en: string; vaccine_administered_total: number; vaccine_administered_last_week: number; } +export interface ArchivedNlVaccineCampaign_2023 { + vaccine_campaigns: ArchivedNlVaccineCampaign_20231[]; + date_unix: number; + date_start_unix: number; + date_end_unix: number; + date_of_insertion_unix: number; +} +export interface ArchivedNlVaccineCampaign_20231 { + vaccine_campaign_order: number; + vaccine_campaign_name_nl: string; + vaccine_campaign_name_en: string; + vaccine_administered_total: number; + vaccine_administered_last_timeframe: number; +} export interface ArchivedNlVaccinePlanned { doses: number; date_unix: number; @@ -606,6 +665,79 @@ export interface ArchivedNlVaccineVaccinatedOrSupportValue { date_end_unix: number; date_of_insertion_unix: number; } +export interface NlVaccineAdministered { + values: NlVaccineAdministeredValue[]; + last_value: NlVaccineAdministeredValue; +} +export interface NlVaccineAdministeredValue { + pfizer: number; + moderna: number; + astra_zeneca: number; + cure_vac?: number; + janssen?: number; + sanofi?: number; + novavax: number; + total: number; + date_of_insertion_unix: number; + date_start_unix: number; + date_end_unix: number; +} +export interface NlVaccineAdministeredDoctors { + values: NlVaccineAdministeredDoctorsValue[]; + last_value: NlVaccineAdministeredDoctorsValue; +} +export interface NlVaccineAdministeredDoctorsValue { + estimated: number; + date_unix: number; + date_of_insertion_unix: number; +} +export interface NlVaccineAdministeredGgdGhor { + values: NlVaccineAdministeredGgdGhorValue[]; + last_value: NlVaccineAdministeredGgdGhorValue; +} +export interface NlVaccineAdministeredGgdGhorValue { + reported: number; + date_unix: number; + date_of_insertion_unix: number; +} +export interface NlVaccineAdministeredGgd { + values: NlVaccineAdministeredGgdValue[]; + last_value: NlVaccineAdministeredGgdValue; +} +export interface NlVaccineAdministeredGgdValue { + estimated: number; + date_unix: number; + date_of_insertion_unix: number; +} +export interface NlVaccineAdministeredHospitalsAndCareInstitutions { + values: NlVaccineAdministeredHospitalsAndCareInstitutionsValue[]; + last_value: NlVaccineAdministeredHospitalsAndCareInstitutionsValue; +} +export interface NlVaccineAdministeredHospitalsAndCareInstitutionsValue { + estimated: number; + date_unix: number; + date_of_insertion_unix: number; +} +export interface NlVaccineAdministeredTotal { + values: NlVaccineAdministeredTotalValue[]; + last_value: NlVaccineAdministeredTotalValue; +} +export interface NlVaccineAdministeredTotalValue { + estimated: number; + reported: number; + date_unix: number; + date_of_insertion_unix: number; +} +export interface NlVaccineAdministeredPlanned { + values: NlVaccineAdministeredPlannedValue[]; + last_value: NlVaccineAdministeredPlannedValue; +} +export interface NlVaccineAdministeredPlannedValue { + doses: number; + date_start_unix: number; + date_end_unix: number; + date_of_insertion_unix: number; +} export interface ArchivedNlVaccineCoverage { values: ArchivedNlVaccineCoverageValue[]; last_value: ArchivedNlVaccineCoverageValue; @@ -620,6 +752,46 @@ export interface ArchivedNlVaccineCoverageValue { date_unix: number; date_of_insertion_unix: number; } +export interface NlVaccineCoveragePerAgeGroup { + values: NlVaccineCoveragePerAgeGroupValue[]; +} +export interface NlVaccineCoveragePerAgeGroupValue { + age_group_range: '5-11' | '12-17' | '18-29' | '30-39' | '40-49' | '50-59' | '60-69' | '70-79' | '80+'; + age_group_percentage: number; + age_group_total: number; + autumn_2022_vaccinated: number | null; + fully_vaccinated: number; + autumn_2022_vaccinated_percentage: number | null; + fully_vaccinated_percentage: number; + date_unix: number; + date_of_insertion_unix: number; + date_of_report_unix: number; + birthyear_range: string; +} +export interface NlVaccineCoveragePerAgeGroupEstimatedAutumn_2022Value { + values: NlVaccineCoveragePerAgeGroupEstimatedAutumn_2022[]; + last_value: NlVaccineCoveragePerAgeGroupEstimatedAutumn_2022; +} +export interface NlVaccineCoveragePerAgeGroupEstimatedAutumn_2022 { + age_12_plus_birthyear: string; + age_12_plus_vaccinated: number; + age_60_plus_birthyear: string; + age_60_plus_vaccinated: number; + date_unix: number; + date_of_insertion_unix: number; +} +export interface NlVaccineCoveragePerAgeGroupEstimatedFullyVaccinatedValue { + values: NlVaccineCoveragePerAgeGroupEstimatedFullyVaccinated[]; + last_value: NlVaccineCoveragePerAgeGroupEstimatedFullyVaccinated; +} +export interface NlVaccineCoveragePerAgeGroupEstimatedFullyVaccinated { + age_12_plus_birthyear: string; + age_12_plus_vaccinated: number; + age_18_plus_birthyear: string; + age_18_plus_vaccinated: number; + date_unix: number; + date_of_insertion_unix: number; +} export interface ArchivedNlVaccineDeliveryPerSupplier { values: ArchivedNlVaccineDeliveryPerSupplierValue[]; last_value: ArchivedNlVaccineDeliveryPerSupplierValue; @@ -751,7 +923,6 @@ export interface Gm { sewer: GmSewer; sewer_per_installation: GmSewerPerInstallation; sewer_installation_measurement: GmSewerInstallationMeasurement; - vaccine_coverage_per_age_group: GmVaccineCoveragePerAgeGroup; } export interface GmStaticValues { population_count: number; @@ -813,23 +984,6 @@ export interface GmSewerInstallationMeasurement { total_installation_count: number; date_of_insertion_unix: number; } -export interface GmVaccineCoveragePerAgeGroup { - values: GmVaccineCoveragePerAgeGroupValue[]; -} -export interface GmVaccineCoveragePerAgeGroupValue { - vaccination_type: string; - birthyear_range_12_plus: string; - birthyear_range_18_plus: string; - birthyear_range_60_plus: string | null; - vaccinated_percentage_12_plus: number | null; - vaccinated_percentage_12_plus_label: string | null; - vaccinated_percentage_18_plus: number | null; - vaccinated_percentage_18_plus_label: string | null; - vaccinated_percentage_60_plus: number | null; - vaccinated_percentage_60_plus_label: string | null; - date_unix: number; - date_of_insertion_unix: number; -} export type GmCollectionId = 'GM_COLLECTION'; @@ -840,7 +994,6 @@ export interface GmCollection { code: GmCollectionId; hospital_nice_choropleth: GmCollectionHospitalNiceChoropleth[]; sewer: GmCollectionSewer[]; - vaccine_coverage_per_age_group: GmCollectionVaccineCoveragePerAgeGroup[]; } export interface GmCollectionHospitalNiceChoropleth { date_unix: number; @@ -858,21 +1011,6 @@ export interface GmCollectionSewer { date_of_insertion_unix: number; data_is_outdated: boolean; } -export interface GmCollectionVaccineCoveragePerAgeGroup { - gmcode: string; - vaccination_type: string; - birthyear_range_12_plus: string; - birthyear_range_18_plus: string; - birthyear_range_60_plus: string | null; - vaccinated_percentage_12_plus: number | null; - vaccinated_percentage_12_plus_label: string | null; - vaccinated_percentage_18_plus: number | null; - vaccinated_percentage_18_plus_label: string | null; - vaccinated_percentage_60_plus: number | null; - vaccinated_percentage_60_plus_label: string | null; - date_unix: number; - date_of_insertion_unix: number; -} export type NlId = 'NL'; @@ -891,18 +1029,8 @@ export interface Nl { hospital_lcps: NlHospitalLcps; intensive_care_lcps: NlIntensiveCareLcps; deceased_cbs: NlDeceasedCbs; - vaccine_administered: NlVaccineAdministered; - vaccine_administered_doctors: NlVaccineAdministeredDoctors; - vaccine_administered_ggd_ghor: NlVaccineAdministeredGgdGhor; - vaccine_administered_ggd: NlVaccineAdministeredGgd; - vaccine_administered_hospitals_and_care_institutions: NlVaccineAdministeredHospitalsAndCareInstitutions; - vaccine_administered_total: NlVaccineAdministeredTotal; - vaccine_administered_planned: NlVaccineAdministeredPlanned; vaccine_administered_last_timeframe: NlVaccineAdministeredLastTimeframe; - vaccine_campaigns: NlVaccineCampaigns; - vaccine_coverage_per_age_group: NlVaccineCoveragePerAgeGroup; - vaccine_coverage_per_age_group_estimated_autumn_2022: NlVaccineCoveragePerAgeGroupEstimatedAutumn_2022Value; - vaccine_coverage_per_age_group_estimated_fully_vaccinated: NlVaccineCoveragePerAgeGroupEstimatedFullyVaccinatedValue; + vaccine_campaigns: NlVaccineCampaign; variants?: NlVariants; self_test_overall: NlSelfTestOverall; infectionradar_symptoms_trend_per_age_group_weekly: NlInfectionradarSymptomsTrendPerAgeGroupWeekly; @@ -1052,79 +1180,6 @@ export interface NlDeceasedCbsValue { date_end_unix: number; date_of_insertion_unix: number; } -export interface NlVaccineAdministered { - values: NlVaccineAdministeredValue[]; - last_value: NlVaccineAdministeredValue; -} -export interface NlVaccineAdministeredValue { - pfizer: number; - moderna: number; - astra_zeneca: number; - cure_vac?: number; - janssen?: number; - sanofi?: number; - novavax: number; - total: number; - date_of_insertion_unix: number; - date_start_unix: number; - date_end_unix: number; -} -export interface NlVaccineAdministeredDoctors { - values: NlVaccineAdministeredDoctorsValue[]; - last_value: NlVaccineAdministeredDoctorsValue; -} -export interface NlVaccineAdministeredDoctorsValue { - estimated: number; - date_unix: number; - date_of_insertion_unix: number; -} -export interface NlVaccineAdministeredGgdGhor { - values: NlVaccineAdministeredGgdGhorValue[]; - last_value: NlVaccineAdministeredGgdGhorValue; -} -export interface NlVaccineAdministeredGgdGhorValue { - reported: number; - date_unix: number; - date_of_insertion_unix: number; -} -export interface NlVaccineAdministeredGgd { - values: NlVaccineAdministeredGgdValue[]; - last_value: NlVaccineAdministeredGgdValue; -} -export interface NlVaccineAdministeredGgdValue { - estimated: number; - date_unix: number; - date_of_insertion_unix: number; -} -export interface NlVaccineAdministeredHospitalsAndCareInstitutions { - values: NlVaccineAdministeredHospitalsAndCareInstitutionsValue[]; - last_value: NlVaccineAdministeredHospitalsAndCareInstitutionsValue; -} -export interface NlVaccineAdministeredHospitalsAndCareInstitutionsValue { - estimated: number; - date_unix: number; - date_of_insertion_unix: number; -} -export interface NlVaccineAdministeredTotal { - values: NlVaccineAdministeredTotalValue[]; - last_value: NlVaccineAdministeredTotalValue; -} -export interface NlVaccineAdministeredTotalValue { - estimated: number; - reported: number; - date_unix: number; - date_of_insertion_unix: number; -} -export interface NlVaccineAdministeredPlanned { - values: NlVaccineAdministeredPlannedValue[]; - last_value: NlVaccineAdministeredPlannedValue; -} -export interface NlVaccineAdministeredPlannedValue { - doses: number; - date_start_unix: number; - date_end_unix: number; - date_of_insertion_unix: number; -} export interface NlVaccineAdministeredLastTimeframe { vaccine_types: NlVaccineType[]; date_unix: number; @@ -1136,60 +1191,20 @@ export interface NlVaccineType { vaccine_type_name: string; vaccine_type_value: number; } -export interface NlVaccineCampaigns { - vaccine_campaigns: NlVaccineCampaign[]; +export interface NlVaccineCampaign { + vaccine_campaigns: NlVaccineCampaigns[]; date_unix: number; date_start_unix: number; date_end_unix: number; date_of_insertion_unix: number; } -export interface NlVaccineCampaign { +export interface NlVaccineCampaigns { vaccine_campaign_order: number; vaccine_campaign_name_nl: string; vaccine_campaign_name_en: string; - vaccine_administered_total: number; + vaccine_administered_total: number | null; vaccine_administered_last_timeframe: number; } -export interface NlVaccineCoveragePerAgeGroup { - values: NlVaccineCoveragePerAgeGroupValue[]; -} -export interface NlVaccineCoveragePerAgeGroupValue { - age_group_range: '5-11' | '12-17' | '18-29' | '30-39' | '40-49' | '50-59' | '60-69' | '70-79' | '80+'; - age_group_percentage: number; - age_group_total: number; - autumn_2022_vaccinated: number | null; - fully_vaccinated: number; - autumn_2022_vaccinated_percentage: number | null; - fully_vaccinated_percentage: number; - date_unix: number; - date_of_insertion_unix: number; - date_of_report_unix: number; - birthyear_range: string; -} -export interface NlVaccineCoveragePerAgeGroupEstimatedAutumn_2022Value { - values: NlVaccineCoveragePerAgeGroupEstimatedAutumn_2022[]; - last_value: NlVaccineCoveragePerAgeGroupEstimatedAutumn_2022; -} -export interface NlVaccineCoveragePerAgeGroupEstimatedAutumn_2022 { - age_12_plus_birthyear: string; - age_12_plus_vaccinated: number; - age_60_plus_birthyear: string; - age_60_plus_vaccinated: number; - date_unix: number; - date_of_insertion_unix: number; -} -export interface NlVaccineCoveragePerAgeGroupEstimatedFullyVaccinatedValue { - values: NlVaccineCoveragePerAgeGroupEstimatedFullyVaccinated[]; - last_value: NlVaccineCoveragePerAgeGroupEstimatedFullyVaccinated; -} -export interface NlVaccineCoveragePerAgeGroupEstimatedFullyVaccinated { - age_12_plus_birthyear: string; - age_12_plus_vaccinated: number; - age_18_plus_birthyear: string; - age_18_plus_vaccinated: number; - date_unix: number; - date_of_insertion_unix: number; -} export interface NlVariants { values: NlVariantsVariant[]; } @@ -1202,7 +1217,6 @@ export interface NlVariantsVariantValue { order: number; occurrence: number; percentage: number; - has_historical_significance?: boolean; sample_size: number; date_start_unix: number; date_end_unix: number; From bfb3c8a07bb78e860aca46121fd8ea2a85631165 Mon Sep 17 00:00:00 2001 From: BE <137172332+VWSCoronaDashboard29@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:29:54 +0200 Subject: [PATCH 14/18] fix: Rename schemas to avoid conflicting names and update types (#4888) Co-authored-by: VWSCoronaDashboard29 <B> --- .../vaccine_coverage_per_age_group.json | 2 +- .../vaccine_coverage_per_age_group.json | 2 +- .../autumn-2022-shot-coverage-per-age-group.tsx | 4 ++-- .../primary-series-coverage-per-age-group.tsx | 4 ++-- .../vaccine-coverage-per-age-group.tsx | 4 ++-- .../get-coverage-per-age-group-latest-values.ts | 10 +++------- packages/common/src/types/data.ts | 16 ++++++++-------- 7 files changed, 19 insertions(+), 23 deletions(-) diff --git a/packages/app/schema/archived_nl/vaccinaties/vaccine_coverage_per_age_group.json b/packages/app/schema/archived_nl/vaccinaties/vaccine_coverage_per_age_group.json index c02db4ff9e..f9727fc431 100644 --- a/packages/app/schema/archived_nl/vaccinaties/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/archived_nl/vaccinaties/vaccine_coverage_per_age_group.json @@ -14,7 +14,7 @@ }, "definitions": { "value": { - "title": "archived_nl_vaccine_coverage_per_age_group_value", + "title": "archived_nl_vaccine_coverage_per_age_group_autumn_2022_value", "additionalProperties": false, "type": "object", "required": [ diff --git a/packages/app/schema/archived_nl/vaccine_coverage_per_age_group.json b/packages/app/schema/archived_nl/vaccine_coverage_per_age_group.json index 43e4cf36b6..fd11e05c8a 100644 --- a/packages/app/schema/archived_nl/vaccine_coverage_per_age_group.json +++ b/packages/app/schema/archived_nl/vaccine_coverage_per_age_group.json @@ -14,7 +14,7 @@ }, "definitions": { "value": { - "title": "archived_nl_vaccine_coverage_per_age_group_value", + "title": "archived_nl_vaccine_coverage_per_age_group_primary_series_and_booster_value", "additionalProperties": false, "type": "object", "required": [ diff --git a/packages/app/src/domain/vaccine/autumn-2022-shot-coverage-per-age-group/autumn-2022-shot-coverage-per-age-group.tsx b/packages/app/src/domain/vaccine/autumn-2022-shot-coverage-per-age-group/autumn-2022-shot-coverage-per-age-group.tsx index 9f7488e152..3c24f72312 100644 --- a/packages/app/src/domain/vaccine/autumn-2022-shot-coverage-per-age-group/autumn-2022-shot-coverage-per-age-group.tsx +++ b/packages/app/src/domain/vaccine/autumn-2022-shot-coverage-per-age-group/autumn-2022-shot-coverage-per-age-group.tsx @@ -1,4 +1,4 @@ -import { NlVaccineCoveragePerAgeGroupValue } from '@corona-dashboard/common'; +import { ArchivedNlVaccineCoveragePerAgeGroupAutumn_2022Value } from '@corona-dashboard/common'; import { AgeGroup } from '~/components/age-groups/age-group'; import { ChartTile } from '~/components/chart-tile'; import { MetadataProps } from '~/components/metadata'; @@ -16,7 +16,7 @@ interface Autumn2022ShotCoveragePerAgeGroupProps { description: string; metadata: MetadataProps; sortingOrder: string[]; - values: NlVaccineCoveragePerAgeGroupValue[]; + values: ArchivedNlVaccineCoveragePerAgeGroupAutumn_2022Value[]; text: SiteText['pages']['vaccinations_page']['nl']['vaccination_coverage']; } diff --git a/packages/app/src/domain/vaccine/primary-series-coverage-per-age-group/primary-series-coverage-per-age-group.tsx b/packages/app/src/domain/vaccine/primary-series-coverage-per-age-group/primary-series-coverage-per-age-group.tsx index 0c54fcf1a1..493e434eba 100644 --- a/packages/app/src/domain/vaccine/primary-series-coverage-per-age-group/primary-series-coverage-per-age-group.tsx +++ b/packages/app/src/domain/vaccine/primary-series-coverage-per-age-group/primary-series-coverage-per-age-group.tsx @@ -1,4 +1,4 @@ -import { NlVaccineCoveragePerAgeGroupValue } from '@corona-dashboard/common'; +import { ArchivedNlVaccineCoveragePerAgeGroupAutumn_2022Value } from '@corona-dashboard/common'; import { AgeGroup } from '~/components/age-groups/age-group'; import { ChartTile } from '~/components/chart-tile'; import { MetadataProps } from '~/components/metadata'; @@ -16,7 +16,7 @@ interface PrimarySeriesShotCoveragePerAgeGroupProps { description: string; metadata: MetadataProps; sortingOrder: string[]; - values: NlVaccineCoveragePerAgeGroupValue[]; + values: ArchivedNlVaccineCoveragePerAgeGroupAutumn_2022Value[]; text: SiteText['pages']['vaccinations_page']['nl']['vaccination_coverage']; } diff --git a/packages/app/src/domain/vaccine/vaccine-coverage-per-age-group/vaccine-coverage-per-age-group.tsx b/packages/app/src/domain/vaccine/vaccine-coverage-per-age-group/vaccine-coverage-per-age-group.tsx index 98b451770b..f11906e5d2 100644 --- a/packages/app/src/domain/vaccine/vaccine-coverage-per-age-group/vaccine-coverage-per-age-group.tsx +++ b/packages/app/src/domain/vaccine/vaccine-coverage-per-age-group/vaccine-coverage-per-age-group.tsx @@ -1,4 +1,4 @@ -import { ArchivedGmVaccineCoveragePerAgeGroupValue, ArchivedNlVaccineCoveragePerAgeGroupValue } from '@corona-dashboard/common'; +import { ArchivedGmVaccineCoveragePerAgeGroupValue, ArchivedNlVaccineCoveragePerAgeGroupPrimarySeriesAndBoosterValue } from '@corona-dashboard/common'; import { AgeGroup } from '~/components/age-groups/age-group'; import { ChartTile } from '~/components/chart-tile'; import { MetadataProps } from '~/components/metadata'; @@ -16,7 +16,7 @@ interface VaccineCoveragePerAgeGroupProps { description: string; metadata: MetadataProps; sortingOrder: string[]; - values: ArchivedNlVaccineCoveragePerAgeGroupValue[] | ArchivedGmVaccineCoveragePerAgeGroupValue[]; + values: ArchivedNlVaccineCoveragePerAgeGroupPrimarySeriesAndBoosterValue[] | ArchivedGmVaccineCoveragePerAgeGroupValue[]; text: SiteText['pages']['vaccinations_page']['nl']; } diff --git a/packages/app/src/static-props/vaccinations/get-coverage-per-age-group-latest-values.ts b/packages/app/src/static-props/vaccinations/get-coverage-per-age-group-latest-values.ts index f447f0d0ae..afc7c72cdf 100644 --- a/packages/app/src/static-props/vaccinations/get-coverage-per-age-group-latest-values.ts +++ b/packages/app/src/static-props/vaccinations/get-coverage-per-age-group-latest-values.ts @@ -1,14 +1,10 @@ -import { NlVaccineCoveragePerAgeGroupValue } from '@corona-dashboard/common'; +import { ArchivedNlVaccineCoveragePerAgeGroupAutumn_2022Value } from '@corona-dashboard/common'; -export function getCoveragePerAgeGroupLatestValues( - values: NlVaccineCoveragePerAgeGroupValue[] -) { +export function getCoveragePerAgeGroupLatestValues(values: ArchivedNlVaccineCoveragePerAgeGroupAutumn_2022Value[]) { /** * Get all the unique age groups in the data. */ - const uniqueAgeKeys = [ - ...new Set(values.map((item) => item.age_group_range).flat()), - ]; + const uniqueAgeKeys = [...new Set(values.map((item) => item.age_group_range).flat())]; /** * Per unique age group get the latest value available. diff --git a/packages/common/src/types/data.ts b/packages/common/src/types/data.ts index 7aaebab7c0..bda448e74c 100644 --- a/packages/common/src/types/data.ts +++ b/packages/common/src/types/data.ts @@ -211,7 +211,7 @@ export interface ArchivedNl { vaccine_campaigns_archived_20220908: ArchivedNlVaccineCampaigns_2022; vaccine_campaigns_archived_20231004: ArchivedNlVaccineCampaign_2023; vaccine_planned_archived_20220908: ArchivedNlVaccinePlanned; - vaccine_coverage_per_age_group_archived_20220622: ArchivedNlVaccineCoveragePerAgeGroup; + vaccine_coverage_per_age_group_archived_20220622: ArchivedNlVaccineCoveragePerAgeGroupPrimarySeriesAndBooster; vaccine_coverage_per_age_group_archived_20220908: ArchivedNlVaccineCoveragePerAgeGroupWithBoosterShot; vaccine_coverage_per_age_group_estimated_archived_20220908: NlVaccineCoveragePerAgeGroupEstimatedArchived_20220908Value; vulnerable_nursing_home_archived_20230711: ArchivedNlVulnerableNursingHome; @@ -226,7 +226,7 @@ export interface ArchivedNl { vaccine_administered_total_archived_20220324: NlVaccineAdministeredTotal; vaccine_administered_planned_archived_20220518: NlVaccineAdministeredPlanned; vaccine_coverage_archived_20220518: ArchivedNlVaccineCoverage; - vaccine_coverage_per_age_group_archived_20231004: NlVaccineCoveragePerAgeGroup; + vaccine_coverage_per_age_group_archived_20231004: ArchivedNlVaccineCoveragePerAgeGroupAutumn_2022; vaccine_coverage_per_age_group_estimated_autumn_2022_archived_20231004: NlVaccineCoveragePerAgeGroupEstimatedAutumn_2022Value; vaccine_coverage_per_age_group_estimated_fully_vaccinated_archived_20231004: NlVaccineCoveragePerAgeGroupEstimatedFullyVaccinatedValue; vaccine_delivery_per_supplier_archived_20211101: ArchivedNlVaccineDeliveryPerSupplier; @@ -574,10 +574,10 @@ export interface ArchivedNlVaccinePlanned { date_end_unix: number; date_of_insertion_unix: number; } -export interface ArchivedNlVaccineCoveragePerAgeGroup { - values: ArchivedNlVaccineCoveragePerAgeGroupValue[]; +export interface ArchivedNlVaccineCoveragePerAgeGroupPrimarySeriesAndBooster { + values: ArchivedNlVaccineCoveragePerAgeGroupPrimarySeriesAndBoosterValue[]; } -export interface ArchivedNlVaccineCoveragePerAgeGroupValue { +export interface ArchivedNlVaccineCoveragePerAgeGroupPrimarySeriesAndBoosterValue { age_group_range: '5-11' | '12-17' | '18-30' | '31-40' | '41-50' | '51-60' | '61-70' | '71-80' | '81+'; age_group_percentage: number; age_group_total: number; @@ -752,10 +752,10 @@ export interface ArchivedNlVaccineCoverageValue { date_unix: number; date_of_insertion_unix: number; } -export interface NlVaccineCoveragePerAgeGroup { - values: NlVaccineCoveragePerAgeGroupValue[]; +export interface ArchivedNlVaccineCoveragePerAgeGroupAutumn_2022 { + values: ArchivedNlVaccineCoveragePerAgeGroupAutumn_2022Value[]; } -export interface NlVaccineCoveragePerAgeGroupValue { +export interface ArchivedNlVaccineCoveragePerAgeGroupAutumn_2022Value { age_group_range: '5-11' | '12-17' | '18-29' | '30-39' | '40-49' | '50-59' | '60-69' | '70-79' | '80+'; age_group_percentage: number; age_group_total: number; From 116286a3a31d43e6755ccb0a2acb1472698570d4 Mon Sep 17 00:00:00 2001 From: M <120020483+VWSCoronaDashboard30@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:21:12 +0200 Subject: [PATCH 15/18] bugfix(COR-1801): Removed the duplicated metadata and fixed date (#4889) --- .../app/src/domain/vaccine/vaccine-coverage-toggle-tile.tsx | 2 +- packages/app/src/pages/gemeente/[code]/vaccinaties.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 2da116aa8b..27e19cb642 100644 --- a/packages/app/src/domain/vaccine/vaccine-coverage-toggle-tile.tsx +++ b/packages/app/src/domain/vaccine/vaccine-coverage-toggle-tile.tsx @@ -71,7 +71,7 @@ export function VaccineCoverageToggleTile({ }; return ( - <KpiTile title={title} metadata={metadata}> + <KpiTile title={title}> <Box css={css({ '& div': { justifyContent: 'flex-start' } })} marginBottom={space[3]}> <RadioGroup value={selectedTab} diff --git a/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx b/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx index 9db0c7c4f4..c10ba4ab2c 100644 --- a/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx +++ b/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx @@ -116,7 +116,7 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) => archivedData.vaccine_coverage_per_age_group_archived_20220908.values.find((x) => x.age_group_range === '12+') || emptyCoverageData.vaccine_coverage_per_age_group_archived_20220908.values[1]; - const lastInsertionDateOfPage = getLastInsertionDateOfPage(currentData, pageMetrics); + const lastInsertionDateOfPage = getLastInsertionDateOfPage(archivedData, pageMetrics); return ( <Layout {...metadata} lastGenerated={lastGenerated}> From 3af5e3f1d64b540a5eb1bd38aa2393f083c7f26b Mon Sep 17 00:00:00 2001 From: BE <137172332+VWSCoronaDashboard29@users.noreply.github.com> Date: Wed, 4 Oct 2023 10:16:48 +0200 Subject: [PATCH 16/18] Fix/cor 1784 correct vaccine adminstered graphs (#4891) * fix(COR-1784): Update autumn 2022 vaccine table to show correct data * fix(COR-1784): Re-add vaccine campaign tile * fix(COR-1784): Fix filteredCampaigns * feat(COR-1784): Add border to basic series kpi header --------- Co-authored-by: VWSCoronaDashboard29 <B> --- packages/app/src/domain/vaccine/index.ts | 1 + .../vaccine/primary-series-kpi-header.tsx | 28 ++++++++++++++++++ .../vaccine-campaigns-tile.tsx | 12 ++++---- .../app/src/pages/landelijk/vaccinaties.tsx | 29 ++++++++++++++----- packages/cms/src/lokalize/key-mutations.csv | 6 ++++ 5 files changed, 62 insertions(+), 14 deletions(-) create mode 100644 packages/app/src/domain/vaccine/primary-series-kpi-header.tsx diff --git a/packages/app/src/domain/vaccine/index.ts b/packages/app/src/domain/vaccine/index.ts index 754a7fca84..601a1e81b0 100644 --- a/packages/app/src/domain/vaccine/index.ts +++ b/packages/app/src/domain/vaccine/index.ts @@ -13,3 +13,4 @@ export { VaccineStockPerSupplierChart } from './vaccine-stock-per-supplier-chart export { ChoroplethTooltip } from './vaccine-coverage-choropleth'; export { CampaignBanner } from './campaign-banner/campaign-banner'; export { PrimarySeriesShotCoveragePerAgeGroup } from './primary-series-coverage-per-age-group/primary-series-coverage-per-age-group'; +export { PrimarySeriesKpiHeader } from './primary-series-kpi-header'; diff --git a/packages/app/src/domain/vaccine/primary-series-kpi-header.tsx b/packages/app/src/domain/vaccine/primary-series-kpi-header.tsx new file mode 100644 index 0000000000..f41974d402 --- /dev/null +++ b/packages/app/src/domain/vaccine/primary-series-kpi-header.tsx @@ -0,0 +1,28 @@ +import { PageInformationBlock } from '~/components'; +import { Vaccinaties as VaccinatieIcon } from '@corona-dashboard/icons'; +import { Box } from '~/components/base'; +import { MetadataProps } from '~/components/page-information-block/components/metadata'; + +interface PrimarySeriesKpiHeaderProps { + title: string; + description: string; + metadata: MetadataProps; +} + +export function PrimarySeriesKpiHeader({ title, description, metadata }: PrimarySeriesKpiHeaderProps) { + return ( + <Box paddingTop="40px" borderTopWidth="2px" borderColor="gray3" borderStyle="solid"> + <PageInformationBlock + title={title} + description={description} + icon={<VaccinatieIcon aria-hidden="true" />} + metadata={{ + datumsText: metadata.datumsText, + dateOrRange: metadata.dateOrRange, + dateOfInsertionUnix: metadata.dateOfInsertionUnix, + dataSources: metadata.dataSources, + }} + /> + </Box> + ); +} diff --git a/packages/app/src/domain/vaccine/vaccine-campaigns-tile/vaccine-campaigns-tile.tsx b/packages/app/src/domain/vaccine/vaccine-campaigns-tile/vaccine-campaigns-tile.tsx index 1f0bae2e29..b07689951a 100644 --- a/packages/app/src/domain/vaccine/vaccine-campaigns-tile/vaccine-campaigns-tile.tsx +++ b/packages/app/src/domain/vaccine/vaccine-campaigns-tile/vaccine-campaigns-tile.tsx @@ -22,19 +22,19 @@ export const VaccineCampaignsTile = ({ title, headers, campaigns, campaignDescri const breakpoints = useBreakpoints(); // Display only the campaigns that are not hidden in the campaignOptions prop - const sortedCampaigns = campaigns - .filter((vaccineCampaign) => campaignOptions && !campaignOptions.hide_campaigns.includes(vaccineCampaign.vaccine_campaign_order)) - .sort((campaignA, campaignB) => campaignA.vaccine_campaign_order - campaignB.vaccine_campaign_order); + const filteredCampaigns = campaignOptions ? campaigns.filter((vaccineCampaign) => !campaignOptions.hide_campaigns.includes(vaccineCampaign.vaccine_campaign_order)) : campaigns; - const totalsAvailable = sortedCampaigns.some((camp) => camp.vaccine_administered_total); + const sortedAndFilteredCampaigns = filteredCampaigns.sort((campaignA, campaignB) => campaignA.vaccine_campaign_order - campaignB.vaccine_campaign_order); + + const totalsAvailable = sortedAndFilteredCampaigns.some((camp) => camp.vaccine_administered_total); return ( <> <ChartTile title={title} description={description} metadata={metadata}> {breakpoints.sm ? ( - <WideVaccineCampaignTable campaigns={sortedCampaigns} campaignDescriptions={campaignDescriptions} headers={headers} showTotals={totalsAvailable} /> + <WideVaccineCampaignTable campaigns={sortedAndFilteredCampaigns} campaignDescriptions={campaignDescriptions} headers={headers} showTotals={totalsAvailable} /> ) : ( - <NarrowVaccineCampaignTable campaigns={sortedCampaigns} campaignDescriptions={campaignDescriptions} headers={headers} showTotals={totalsAvailable} /> + <NarrowVaccineCampaignTable campaigns={sortedAndFilteredCampaigns} campaignDescriptions={campaignDescriptions} headers={headers} showTotals={totalsAvailable} /> )} <Box marginTop={space[3]}> <Text variant="label1" color="gray7"> diff --git a/packages/app/src/pages/landelijk/vaccinaties.tsx b/packages/app/src/pages/landelijk/vaccinaties.tsx index e5e1ce2021..388f3dead6 100644 --- a/packages/app/src/pages/landelijk/vaccinaties.tsx +++ b/packages/app/src/pages/landelijk/vaccinaties.tsx @@ -28,6 +28,7 @@ import { selectAdministrationData, BoosterShotCoveragePerAgeGroup, PrimarySeriesShotCoveragePerAgeGroup, + PrimarySeriesKpiHeader, } from '~/domain/vaccine'; import { VaccinationsPerSupplierOverLastTimeframeTile } from '~/domain/vaccine/vaccinations-per-supplier-over-last-timeframe-tile'; import { VaccineCampaignsTile } from '~/domain/vaccine/vaccine-campaigns-tile/vaccine-campaigns-tile'; @@ -87,6 +88,7 @@ export const getStaticProps = createGetStaticProps( 'vaccine_coverage_per_age_group_estimated_autumn_2022_archived_20231004', 'vaccine_coverage_per_age_group_estimated_fully_vaccinated_archived_20231004', 'vaccine_campaigns_archived_20220908', + 'vaccine_campaigns_archived_20231004', 'vaccine_planned_archived_20220908', 'booster_coverage_archived_20220904', 'vaccine_coverage_per_age_group_estimated_archived_20220908', @@ -139,7 +141,7 @@ type LokalizeTexts = ReturnType<typeof selectLokalizeTexts>; function VaccinationPage(props: StaticProps<typeof getStaticProps>) { const { content, archivedChoropleth, selectedNlData: currentData, selectedArchivedNlData: archivedData, lastGenerated, administrationData } = props; - const { commonTexts, formatNumber } = useIntl(); + const { commonTexts } = useIntl(); const reverseRouter = useReverseRouter(); const { metadataTexts, textNl, textShared } = useDynamicLokalizeTexts<LokalizeTexts>(props.pageText, selectLokalizeTexts); @@ -232,10 +234,9 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { altText={textNl.vaccine_campaigns.autumn_2023.campaign_banner.alt} /> - <PageInformationBlock + <PrimarySeriesKpiHeader title={textNl.section_basisserie.title} description={textNl.section_basisserie.description} - icon={<VaccinatieIcon aria-hidden="true" />} metadata={{ datumsText: textNl.dates_archived, dateOrRange: archivedData.vaccine_administered_total_archived_20220324.last_value.date_unix, @@ -351,13 +352,11 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { /> <VaccineCampaignsTile - title={textNl.vaccine_campaigns.title} - description={replaceVariablesInText(textNl.vaccine_campaigns.description_archived, { - vaccinePlanned: formatNumber(archivedData.vaccine_planned_archived_20220908.doses), - })} + title={textNl.vaccine_campaigns.autumn_2022.title} + description={textNl.vaccine_campaigns.autumn_2022.description} descriptionFooter={textNl.vaccine_campaigns.description_footer} headers={textNl.vaccine_campaigns.headers} - campaigns={archivedData.vaccine_campaigns_archived_20220908.vaccine_campaigns} + campaigns={archivedData.vaccine_campaigns_archived_20231004.vaccine_campaigns} campaignDescriptions={textNl.vaccine_campaigns.campaigns} campaignOptions={{ hide_campaigns: [3], @@ -430,6 +429,20 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { age18PlusToggleText={textNl.vaccination_grade_toggle_tile.age_18_plus} /> + <VaccineCampaignsTile + title={textNl.vaccine_campaigns.title} + description={textNl.vaccine_campaigns.description_archived} + descriptionFooter={textNl.vaccine_campaigns.description_footer} + headers={textNl.vaccine_campaigns.headers} + campaigns={archivedData.vaccine_campaigns_archived_20220908.vaccine_campaigns} + campaignDescriptions={textNl.vaccine_campaigns.campaigns} + metadata={{ + datumsText: textNl.dates, + date: archivedData.vaccine_campaigns_archived_20220908.date_unix, + source: textNl.vaccine_campaigns.bronnen.rivm, + }} + /> + <VaccinationsKpiHeader text={textNl.repeating_shot_information_block} dateUnix={boosterShotAdministeredArchivedLastValue.date_unix} diff --git a/packages/cms/src/lokalize/key-mutations.csv b/packages/cms/src/lokalize/key-mutations.csv index f653d59620..61ef5b0e7e 100644 --- a/packages/cms/src/lokalize/key-mutations.csv +++ b/packages/cms/src/lokalize/key-mutations.csv @@ -39,3 +39,9 @@ timestamp,action,key,document_id,move_to 2023-09-29T14:03:48.346Z,delete,__root.test_123,0hrRKce5hYl5O3WpoZ6oAl,__ 2023-09-29T14:03:48.347Z,delete,__root.test_key_345,0hrRKce5hYl5O3WpoZ6nXX,__ 2023-10-02T12:06:06.749Z,add,pages.vaccinations_page.nl.vaccine_campaigns.autumn_2023.campaign_banner.alt,fQMSbwQpEgDbjt4uWKBe2g,__ +2023-10-04T06:45:00.447Z,add,pages.vaccinations_page.nl.vaccine_campaigns.atuumn_2022.title,uM9i5K7TlE0aLwmg4eRLuC,__ +2023-10-04T06:45:01.740Z,add,pages.vaccinations_page.nl.vaccine_campaigns.atuumn_2022.description,fQMSbwQpEgDbjt4uWKxuMY,__ +2023-10-04T06:46:57.761Z,add,pages.vaccinations_page.nl.vaccine_campaigns.autumn_2022.description,C32lwRDGVQp5utRyR51ePz,__ +2023-10-04T06:46:58.690Z,add,pages.vaccinations_page.nl.vaccine_campaigns.autumn_2022.title,22Xg3hRGtxwin2PlGEkt4Q,__ +2023-10-04T06:46:58.690Z,delete,pages.vaccinations_page.nl.vaccine_campaigns.atuumn_2022.description,fQMSbwQpEgDbjt4uWKxuMY,__ +2023-10-04T06:46:58.691Z,delete,pages.vaccinations_page.nl.vaccine_campaigns.atuumn_2022.title,uM9i5K7TlE0aLwmg4eRLuC,__ From 128e71d3797ed22644586650549adf3830ce227c Mon Sep 17 00:00:00 2001 From: BE <137172332+VWSCoronaDashboard29@users.noreply.github.com> Date: Wed, 4 Oct 2023 14:52:27 +0200 Subject: [PATCH 17/18] Fix/cor 1784 fix archived graph date (#4892) * fix(COR-1784): Update archived graph to correct archived data * fix(COR-1801): Add archived metric to pageMetrics --------- Co-authored-by: VWSCoronaDashboard29 <B> --- packages/app/src/pages/gemeente/[code]/vaccinaties.tsx | 7 ++++++- packages/app/src/pages/landelijk/vaccinaties.tsx | 5 +---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx b/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx index c10ba4ab2c..25d811ab1f 100644 --- a/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx +++ b/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx @@ -26,7 +26,12 @@ import { getLastInsertionDateOfPage } from '~/utils/get-last-insertion-date-of-p import { getPageInformationHeaderContent } from '~/utils/get-page-information-header-content'; import { WarningTile } from '~/components/warning-tile'; -const pageMetrics = ['vaccine_coverage_per_age_group', 'vaccine_coverage_per_age_group_archived', 'booster_coverage_archived_20220904']; +const pageMetrics = [ + 'vaccine_coverage_per_age_group', + 'vaccine_coverage_per_age_group_archived', + 'booster_coverage_archived_20220904', + 'vaccine_coverage_per_age_group_archived_20231004', +]; const selectLokalizeTexts = (siteText: SiteText) => ({ textGm: siteText.pages.vaccinations_page.gm, diff --git a/packages/app/src/pages/landelijk/vaccinaties.tsx b/packages/app/src/pages/landelijk/vaccinaties.tsx index 388f3dead6..1d7029a25e 100644 --- a/packages/app/src/pages/landelijk/vaccinaties.tsx +++ b/packages/app/src/pages/landelijk/vaccinaties.tsx @@ -358,12 +358,9 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { headers={textNl.vaccine_campaigns.headers} campaigns={archivedData.vaccine_campaigns_archived_20231004.vaccine_campaigns} campaignDescriptions={textNl.vaccine_campaigns.campaigns} - campaignOptions={{ - hide_campaigns: [3], - }} metadata={{ datumsText: textNl.dates, - date: archivedData.vaccine_campaigns_archived_20220908.date_unix, + date: archivedData.vaccine_campaigns_archived_20231004.date_unix, source: textNl.vaccine_campaigns.bronnen.rivm, }} /> From e5e8d2c596b65380e903f9a68f32c3afe01b4fa0 Mon Sep 17 00:00:00 2001 From: M <120020483+VWSCoronaDashboard30@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:17:42 +0200 Subject: [PATCH 18/18] bugfix(COR-1784): corrected KPI date (#4894) --- packages/app/src/pages/landelijk/vaccinaties.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/pages/landelijk/vaccinaties.tsx b/packages/app/src/pages/landelijk/vaccinaties.tsx index 1d7029a25e..bd6c416397 100644 --- a/packages/app/src/pages/landelijk/vaccinaties.tsx +++ b/packages/app/src/pages/landelijk/vaccinaties.tsx @@ -211,7 +211,7 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) { title: textNl.kpi_vaccinaties_de_coronaprik.tile_amount_administered_total.title, description: textNl.kpi_vaccinaties_de_coronaprik.tile_amount_administered_total.omschrijving, value: currentData.vaccine_campaigns.vaccine_campaigns[0].vaccine_administered_total, - dateOrRange: currentData.vaccine_campaigns.date_of_insertion_unix, + dateOrRange: currentData.vaccine_campaigns.date_unix, source: textShared.bronnen.rivm, }, ]}