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/21] 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/21] 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 ( - - {description} + + {tilesData.map((tile, index) => ( @@ -25,7 +25,6 @@ export const BorderedKpiSection = ({ title, description, source, dateOrRange, ti ))} - ); }; 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 ( - + - {text.warning && {text.warning}} - 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 ( - - - - 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, - }, - ]} - /> - - {selectedTab == text.gezette_prikken.tab_first.title && ( - <> - - - - - - - - - - - - - - > - )} - {selectedTab == text.gezette_prikken.tab_second.title && ( - <> - - - - - - - - - - > - )} - - - ); -} - -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 ( - - - {formatNumber(value)} - {' ' + description} - - - - {replaceVariablesInText(isReported ? text.reported_until : text.estimated_until, { - reportedDate: formatDateFromSeconds(date, 'weekday-long'), - })} - - - ); -} 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 ( - + ) => { date: { start: sewerAverages.last_value.date_start_unix, end: sewerAverages.last_value.date_end_unix }, source: textGm.bronnen.rivm, }} + description={textGm.extra_uitleg} > ) => { populationCountConnectedToRWZIS: {formatNumber(populationCountConnectedToRWZIS)}, })} - - ) => { 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} > - ) => { 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} > - {textGm.section_deceased_rivm.kpi_covid_total_description} 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) => { obtainedAt: reproductionLastValue.date_of_insertion_unix, }} hasNoBorder + description={textNl.barscale_toelichting} > ) => { showOldDateUnixForDifference isAmount /> - 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) => { date: dataRivm.last_value.date_unix, source: textNl.section_deceased_rivm.bronnen.rivm, }} + description={textNl.section_deceased_rivm.kpi_covid_daily_description} > - ) => { date: dataRivm.last_value.date_unix, source: textNl.section_deceased_rivm.bronnen.rivm, }} + description={textNl.section_deceased_rivm.kpi_covid_total_description} > - {textNl.section_deceased_rivm.kpi_covid_total_description} 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/21] 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 --- 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((value, index) => { + const values = firstVariantInList.values.map((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)[`${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; +/** + * 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(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((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((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(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[], - otherConfig: GappedAreaSeriesDefinition, - compareList: (keyof VariantChartValue)[] -) => { +const useFilteredSeriesConfig = (seriesConfig: GappedAreaSeriesDefinition[], 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; - 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/21] 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 --- .../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(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((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/21] 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 ( + + {groups.map(({ id, title, items }) => ( + + + {title} + + + {items.map((item, index) => ( + + ))} + + ))} + + ); +}; 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 ( + + {links.map(({ id, titleAboveLink, href, label, linkType }) => ( + + {titleAboveLink && ( + + {titleAboveLink} + + )} + + + + + + ))} + + ); +}; + +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 ( + + + {titleUrl ? : title} + + + + + {links && } + + ); +}; + +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 ( + + + + {label} + + + + + ); + } + + return ( + + + {linkType === 'phone' && } + {label} + {linkType !== 'phone' && } + + + ); +}; + +interface LinkWrapperProps { + iconMargin: string; +} + +const LinkWrapper = styled.div` + 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 ( + + {children} + + ); +}; 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((context) => { + createGetContent((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) => { 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 ( - - + + - - {content.title && {content.title}} - {content.description && ( - - )} - + + Contact + + + + + + + + ); }; -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) => { return ( - + @@ -85,7 +86,7 @@ const Over = (props: StaticProps) => { - + ); }; 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) => { return ( - + @@ -87,7 +88,7 @@ const Verantwoording = (props: StaticProps) => { - + ); }; 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 | | | Stopwatch | | | Taxi | | +| Telephone | | | Testbewijs | | | Toegangsbewijzen | | | Town | | 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 = { 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 @@ + \ 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/21] 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 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>; 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>; 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[] = BASE_SERIES_CONFIG.map((baseAgeGroup) => { + const seriesConfig: LineSeriesDefinition[] = 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 ( - >; + timelineEvents: Partial>; 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 - > - | undefined = useMemo(() => { + const coverageChartConfiguration: TimeSeriesChartProps> | 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 - >) + } as TimeSeriesChartProps>) : 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) => ( - - ), + formatTooltip: (x: TooltipData) => , seriesConfig: [ - ...vaccineNames.map< - StackedAreaSeriesDefinition - >((x) => ({ + ...vaccineNames.map>((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 - >; + } as TimeSeriesChartProps>; }, [ 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) ? ( - - ) : null; + return isDefined(chartProps) ? : null; } -type DailyNlVaccineCoverageValue = Omit< - NlVaccineCoverageValue, - 'date_start_unix' | 'date_end_unix' -> & - DateValue; +type DailyNlVaccineCoverageValue = Omit & DateValue; -function transformToDayTimestamps(values: NlVaccineCoverageValue[]) { +function transformToDayTimestamps(values: ArchivedNlVaccineCoverageValue[]) { return values.map((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>; 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 = ( - context: TooltipData + const formatTooltip: TooltipFormatter = ( + context: TooltipData ) => { return ; }; 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 = [ + const seriesConfig: SeriesConfig = [ { 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) { 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/21] fix(COR-1809): Remove unused variable replacement (#4879) Co-authored-by: VWSCoronaDashboard29 --- 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) { const lastInsertionDateOfPage = getLastInsertionDateOfPage(currentData, pageMetrics); - const variables = { - regio: commonTexts.choropleth.choropleth_vaccination_coverage.nl, - }; - return ( @@ -281,8 +277,8 @@ function VaccinationPage(props: StaticProps) { 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/21] feat: fixed aligning width of kpi's descriptions (#4877) Co-authored-by: VWSCoronaDashboard27 --- 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 ( - + + + {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/21] 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 ( - + {links.map(({ id, titleAboveLink, href, label, linkType }) => ( {titleAboveLink && ( @@ -21,19 +21,33 @@ export const ContactPageItemLinks = ({ links }: ContactPageItemLinksProps) => { )} - + ))} - + ); }; -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` 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/21] 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 ( - - - {title} - {children} - - - {href && ( - - {external ? ( - - - - - - {label} - - - ) : ( - - {label} - - )} - - )} - - ); -} - -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 ( - <> - - - - {showCauseMessage && ( - - - - )} - > - ); -} 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) => { }; 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) => { {hasActiveWarningTile && } - + + + + + + + + + {textNl.section_sterftemonitor.cause_message.link.url && ( + + + + {textNl.section_sterftemonitor.cause_message.link.text} + + + )} + + {content.faqs && content.faqs.questions?.length > 0 && } 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/21] 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 ; - return ; -}; 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 ( {description && } - - {trendIcon?.direction && iconColor && hasIconProps && {setTrendIcon(trendIcon.direction)}} + {levelDescription && } @@ -65,9 +56,3 @@ export const SeverityIndicatorTile = ({ description, label, level, title, datesL ); }; - -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 ( - - - - - - {title} - - {subtitle && ( - - - - )} + + + + + + {title} ); }; 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) => { return ( - + {theme.tiles && ( ({ textNl: siteText.pages.corona_thermometer_page.nl, @@ -131,7 +130,6 @@ const CoronaThermometer = (props: StaticProps) => { sourceLabel={thermometer.sourceLabel} datesLabel={thermometer.datesLabel} levelDescription={thermometer.levelDescription} - trendIcon={thermometer.trendIcon as TrendIcon} /> {thermometerEvents && thermometerEvents.length && ( { '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/21] 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 --- .../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 ( - + @@ -80,6 +81,12 @@ export const TopicalTile = ({ title, tileIcon, trendIcon, description, kpiValue, + {dateLabel && ( + + {dateLabel} + + )} + {sourceLabel && ( {sourceLabel} 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) => { 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 ( ) => { 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/21] 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 * 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 Co-authored-by: beek Co-authored-by: VWSCoronaDashboard29 --- .../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 @@ + \ 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 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 ( {title} @@ -36,6 +42,7 @@ export const KpiContent = ({ title, description, value, bar, birthyear, differen : description } /> + {metadata && } ); }; 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 - - {headerText.firstColumn} - - - {headerText.secondColumn} - - - {headerText.thirdColumn} - - {headerText.fourthColumn} + {headerText.firstColumn !== undefined && ( + + {headerText.firstColumn} + + )} + {headerText.secondColumn !== undefined && ( + + {headerText.secondColumn} + + )} + {headerText.thirdColumn !== undefined && ( + + {headerText.thirdColumn} + + )} + {headerText.fourthColumn !== undefined && {headerText.fourthColumn}} 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: ( @@ -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 ( @@ -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) => ( + + + + + + {title} + + + + + + + + + + +); + +type CampaignImageProps = { + src: string; + extension: string; + className?: string; + alt?: string; +}; + +const CampaignImage = (props: CampaignImageProps) => { + const { src, extension, ...imageProps } = props; + + return ( + + + + + + + ); +}; 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: ( + + ), + }; + }); + + 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 ( + + {breakpoints.lg ? ( + + ) : ( + + )} + + ); +}; 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 ( @@ -24,7 +25,14 @@ export const NarrowVaccineCampaignTable = ({ campaigns, campaignDescriptions, he {campaigns.map((campaign, index) => ( - + ))} @@ -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 } - {headers.last_week}:{' '} + {headers.last_week} :{' '} {isOpen ? ( {formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe)} ) : ( @@ -73,11 +82,13 @@ const VaccineCampaignRow = ({ campaign, campaignDescriptions, headers, isFirst } - - - {headers.total}: {isOpen ? {formatNumber(campaign.vaccine_administered_total)} : formatNumber(campaign.vaccine_administered_total)} - - + {showTotals && ( + + + {headers.total} : {isOpen ? {formatNumber(campaign.vaccine_administered_total)} : formatNumber(campaign.vaccine_administered_total)} + + + )} 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 ( {headers.vaccine} {headers.last_week} - {headers.total} + {showTotals && {headers.total}} {campaigns.map((campaign, index) => ( - + ))} @@ -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 {locale === 'nl' ? campaign.vaccine_campaign_name_nl : campaign.vaccine_campaign_name_en} - - {isOpen ? ( - {formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe)} - ) : ( - formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe) - )} - + {hideTotals ? ( + <> + + {isOpen ? ( + {formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe)} + ) : ( + formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe) + )} + - - - {isOpen ? {formatNumber(campaign.vaccine_administered_total)} : formatNumber(campaign.vaccine_administered_total)} + + + {isOpen ? {formatNumber(campaign.vaccine_administered_total)} : formatNumber(campaign.vaccine_administered_total)} - {collapsible.button()} - - + {collapsible.button()} + + + > + ) : ( + <> + + {isOpen ? ( + + {formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe)} + + {collapsible.button()} + + ) : ( + + {formatNumber(campaign.vaccine_administered_last_week || campaign.vaccine_administered_last_timeframe)} + {collapsible.button()} + + )} + + > + )} 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; export type VaccineCampaignHeaders = Record; +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 ( <> {breakpoints.sm ? ( - + ) : ( - + )} 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('18'); - const [selectedCoverageKind, setSelectedCoverageKind] = useState('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(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 ( {commonTexts.choropleth.vaccination_coverage.shared.dropdowns_title} - - - {text.vaccinationKindLabel && {text.vaccinationKindLabel}} - - {text.ageGroupLabel && {text.ageGroupLabel}} @@ -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) => { - 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(false); const reverseRouter = useReverseRouter(); - const { textGm, textNl, textShared } = useDynamicLokalizeTexts(pageText, selectLokalizeTexts); const metadata = { @@ -92,8 +97,8 @@ export const VaccinationsGmPage = (props: StaticProps) => }; 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) => faq: content.faqs, })} /> - {filteredVaccination.autumn2022.birthyear_range_60_plus && ( - - )} + + {!!textShared.warning && } + ) => dateOrRange={filteredVaccination.primarySeries.date_unix} /> ) => 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 && } @@ -228,6 +205,48 @@ export const VaccinationsGmPage = (props: StaticProps) => {hasHideArchivedCharts && ( <> + {filteredVaccination.autumn2022.birthyear_range_60_plus && ( + + )} + ({ - metadataTexts: siteText.pages.topical_page.nl.nationaal_metadata, - textNl: siteText.pages.vaccinations_page.nl, - textShared: siteText.pages.vaccinations_page.shared, -}); - -type LokalizeTexts = ReturnType; - 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; @@ -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; + function VaccinationPage(props: StaticProps) { - 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) { 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) { 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) { /> + + + + + + } + 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], + }} + /> + + + ) { dateOrRange={vaccineCoverageEstimatedFullyVaccinated.date_unix} /> - - - - 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 /> - {content.faqs && content.faqs.questions?.length > 0 && } @@ -313,6 +319,80 @@ function VaccinationPage(props: StaticProps) { {hasHideArchivedCharts && ( <> + + + + + 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, + }} + /> + + + ) { }} values={archivedData.vaccine_coverage_per_age_group_archived_20220908.values} /> + ) { age12PlusToggleText={textNl.vaccination_grade_toggle_tile.age_12_plus} age18PlusToggleText={textNl.vaccination_grade_toggle_tile.age_18_plus} /> - + ) { 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> 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 { 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> = { 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> = { 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/21] fix: Rename schemas to avoid conflicting names and update types (#4888) Co-authored-by: VWSCoronaDashboard29 --- .../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/21] 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 ( - + ) => 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 ( 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/21] 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 --- 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 ( + + } + metadata={{ + datumsText: metadata.datumsText, + dateOrRange: metadata.dateOrRange, + dateOfInsertionUnix: metadata.dateOfInsertionUnix, + dataSources: metadata.dataSources, + }} + /> + + ); +} 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 ( <> {breakpoints.sm ? ( - + ) : ( - + )} 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; function VaccinationPage(props: StaticProps) { 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(props.pageText, selectLokalizeTexts); @@ -232,10 +234,9 @@ function VaccinationPage(props: StaticProps) { altText={textNl.vaccine_campaigns.autumn_2023.campaign_banner.alt} /> - } metadata={{ datumsText: textNl.dates_archived, dateOrRange: archivedData.vaccine_administered_total_archived_20220324.last_value.date_unix, @@ -351,13 +352,11 @@ function VaccinationPage(props: StaticProps) { /> ) { age18PlusToggleText={textNl.vaccination_grade_toggle_tile.age_18_plus} /> + + Date: Wed, 4 Oct 2023 14:52:27 +0200 Subject: [PATCH 17/21] 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 --- 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) { 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/21] 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) { 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, }, ]} From e1ff9f4909d937cca71667299dc50b3c2c1dfe20 Mon Sep 17 00:00:00 2001 From: J <93984341+VWSCoronaDashboard18@users.noreply.github.com> Date: Mon, 9 Oct 2023 14:51:07 +0200 Subject: [PATCH 19/21] fix: remove the button only in CSS, because of incorrect usage of creationContext type (#4895) --- .../src/studio/document-options/document-options.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/cms/src/studio/document-options/document-options.ts b/packages/cms/src/studio/document-options/document-options.ts index c1c31e6be3..06e091dd22 100644 --- a/packages/cms/src/studio/document-options/document-options.ts +++ b/packages/cms/src/studio/document-options/document-options.ts @@ -4,15 +4,11 @@ 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 === 'structure') { - return prev.filter((templateItem) => templateItem.templateId !== 'lokalizeText'); - } - if (creationContext.type === 'global') { - // Removes the button visually from the header + // Removes the button visually from the header + window.document.querySelector('style')?.append('[data-ui="Navbar"] button[aria-label^="Create new document"] {display: none}'); - 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 []; + if (creationContext.type === 'structure' || creationContext.type === 'global') { + return prev.filter((templateItem) => templateItem.templateId !== 'lokalizeText'); } return prev; From b2d6599e5e756a7fff1e6f9f4452162a49adad63 Mon Sep 17 00:00:00 2001 From: BE <137172332+VWSCoronaDashboard29@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:01:37 +0200 Subject: [PATCH 20/21] Bugfix/cor 1784 corrections releaseday (#4896) * fix(COR-1784): Remove usefull links * fix(COR-1784): Seperate sanity keys for vaccine coverage --------- Co-authored-by: VWSCoronaDashboard29 --- .../app/src/pages/gemeente/[code]/vaccinaties.tsx | 4 +--- packages/app/src/pages/landelijk/vaccinaties.tsx | 12 +++++------- packages/cms/src/lokalize/key-mutations.csv | 6 ++++++ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx b/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx index 25d811ab1f..b644a01b25 100644 --- a/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx +++ b/packages/app/src/pages/gemeente/[code]/vaccinaties.tsx @@ -16,7 +16,7 @@ import { VaccineCoveragePerAgeGroup, VaccineCoverageToggleTile } from '~/domain/ import { VaccineCoverageChoropleth } from '~/domain/vaccine/vaccine-coverage-choropleth'; import { useIntl } from '~/intl'; import { Languages, SiteText } from '~/locale'; -import { getArticleParts, getDataExplainedParts, getFaqParts, getLinkParts, getPagePartsQuery } from '~/queries/get-page-parts-query'; +import { getArticleParts, getDataExplainedParts, getFaqParts, getPagePartsQuery } from '~/queries/get-page-parts-query'; import { createGetStaticProps, StaticProps } from '~/static-props/create-get-static-props'; import { createGetContent, getLastGeneratedDate, getLokalizeTexts, selectGmData, selectArchivedGmData, createGetArchivedChoroplethData } from '~/static-props/get-data'; import { ArticleParts, LinkParts, PagePartQueryResult } from '~/types/cms'; @@ -77,7 +77,6 @@ export const getStaticProps = createGetStaticProps( articles: getArticleParts(content.pageParts, 'vaccinationsPageArticles'), faqs: getFaqParts(content.pageParts, 'vaccinationsPageFAQs'), dataExplained: getDataExplainedParts(content.pageParts, 'vaccinationsPageDataExplained'), - links: getLinkParts(content.pageParts, 'vaccinationsPageLinks'), }, }; } @@ -140,7 +139,6 @@ export const VaccinationsGmPage = (props: StaticProps) => dateOfInsertionUnix: lastInsertionDateOfPage, dataSources: [textShared.bronnen.rivm], }} - pageLinks={content.links} vrNameOrGmName={municipalityName} warning={textGm.warning} pageInformationHeader={getPageInformationHeaderContent({ diff --git a/packages/app/src/pages/landelijk/vaccinaties.tsx b/packages/app/src/pages/landelijk/vaccinaties.tsx index bd6c416397..9716386f8f 100644 --- a/packages/app/src/pages/landelijk/vaccinaties.tsx +++ b/packages/app/src/pages/landelijk/vaccinaties.tsx @@ -116,7 +116,6 @@ export const getStaticProps = createGetStaticProps( articles: getArticleParts(content.parts.pageParts, 'vaccinationsPageArticles'), faqs: getFaqParts(content.parts.pageParts, 'vaccinationsPageFAQs'), dataExplained: getDataExplainedParts(content.parts.pageParts, 'vaccinationsPageDataExplained'), - links: getLinkParts(content.parts.pageParts, 'vaccinationsPageLinks'), boosterArticles: getArticleParts(content.parts.pageParts, 'vaccineBoosterArticles'), thirdShotArticles: getArticleParts(content.parts.pageParts, 'vaccineThirdShotArticles'), boosterLinks: getLinkParts(content.parts.pageParts, 'vaccinationsBoosterPageLinks'), @@ -189,7 +188,6 @@ function VaccinationPage(props: StaticProps) { dateOfInsertionUnix: lastInsertionDateOfPage, dataSources: [textShared.bronnen.rivm], }} - pageLinks={content.links} pageInformationHeader={getPageInformationHeaderContent({ dataExplained: content.dataExplained, faq: content.faqs, @@ -292,8 +290,8 @@ function VaccinationPage(props: StaticProps) { ) { ) { Date: Tue, 10 Oct 2023 16:37:59 +0200 Subject: [PATCH 21/21] fix(COR-1784): New key for last column vaccine coverage (#4897) Co-authored-by: VWSCoronaDashboard29 --- .../autumn-2022-shot-coverage-per-age-group.tsx | 2 +- packages/cms/src/lokalize/key-mutations.csv | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 3c24f72312..906a2dce01 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 @@ -47,7 +47,7 @@ export const Autumn2022ShotCoveragePerAgeGroup = ({ title, description, metadata headerText={{ firstColumn: text.headers.agegroup, secondColumn: text.headers.autumn_2022_shot, - thirdColumn: text.headers.fully_vaccinated, + thirdColumn: text.headers.autumn_2022_shot_bar, }} tableData={sortedData} percentageData={percentageData} diff --git a/packages/cms/src/lokalize/key-mutations.csv b/packages/cms/src/lokalize/key-mutations.csv index cc076a6338..40f84e8687 100644 --- a/packages/cms/src/lokalize/key-mutations.csv +++ b/packages/cms/src/lokalize/key-mutations.csv @@ -51,3 +51,4 @@ timestamp,action,key,document_id,move_to 2023-10-10T12:55:06.790Z,add,pages.vaccinations_page.nl.vaccination_coverage.title_autumn_2022_shot,Lfn0X6iH0v4r6Hw7fQhx7Z,__ 2023-10-10T12:55:07.777Z,add,pages.vaccinations_page.nl.vaccination_coverage.title_archived,rohM7ceZTOpkR9JaOOFM43,__ 2023-10-10T12:55:07.777Z,delete,pages.vaccinations_page.nl.vaccination_coverage.title,jF33EuwumlGuwav2FD464K,__ +2023-10-10T14:25:44.020Z,add,pages.vaccinations_page.nl.vaccination_coverage.headers.autumn_2022_shot_bar,Lfn0X6iH0v4r6Hw7fQm9gU,__