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

revert-4734-feature/COR-1548-tests-page #4740

Merged
merged 2 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/app/src/domain/layout/logic/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ export type NlItemKeys =
| 'elderly_at_home'
| 'general_practitioner_suspicions'
| 'hospitals_and_care'
| 'patients'
| 'infectious_people'
| 'mortality'
| 'nursing_home_care'
| 'patients'
| 'positive_tests'
| 'reproduction_number'
| 'sewage_measurement'
| 'source_investigation'
| 'tests'
| 'vaccinations'
| 'variants';

Expand Down
7 changes: 3 additions & 4 deletions packages/app/src/domain/layout/logic/use-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,24 @@ const mapCategoriesToIcons = {
const mapKeysToReverseRouter = {
compliance: 'gedrag',
coronamelder_app: 'coronamelder',
current_advices: 'geldendeAdviezen',
disabled_care: 'gehandicaptenzorg',
elderly_at_home: 'thuiswonendeOuderen',
general_practitioner_suspicions: 'verdenkingenHuisartsen',
hospital_admissions: 'ziekenhuisopnames',
hospitals_and_care: 'ziekenhuizenEnZorg',
patients: 'patientenInBeeld',
infectious_people: 'besmettelijkeMensen',
intensive_care_admissions: 'intensiveCareOpnames',
current_advices: 'geldendeAdviezen',
mortality: 'sterfte',
// Still the nursing home care name is used because of legacy naming inside of sanity's lokalize texts.
nursing_home_care: 'kwetsbareGroepen',
patients: 'patientenInBeeld',
positive_tests: 'positiefGetesteMensen',
reproduction_number: 'reproductiegetal',
sewage_measurement: 'rioolwater',
source_investigation: 'brononderzoek',
tests: 'testen',
vaccinations: 'vaccinaties',
variants: 'varianten',
reproduction_number: 'reproductiegetal',
} as const;

type UseSidebarArgs<T extends Layout> = {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/domain/layout/nl-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function NlLayout(props: NlLayoutProps) {
const items = useSidebar({
layout: 'nl',
map: [
['development_of_the_virus', ['sewage_measurement', 'positive_tests', 'tests', 'reproduction_number', 'variants', 'mortality']],
['development_of_the_virus', ['sewage_measurement', 'positive_tests', 'reproduction_number', 'variants', 'mortality']],
['consequences_for_healthcare', ['hospitals_and_care', 'patients', 'nursing_home_care']],
['actions_to_take', ['vaccinations', 'compliance']],
['archived_metrics', ['disabled_care', 'elderly_at_home', 'source_investigation', 'coronamelder_app', 'infectious_people', 'general_practitioner_suspicions']],
Expand Down
34 changes: 34 additions & 0 deletions packages/app/src/pages/landelijk/positief-geteste-mensen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export const getStaticProps = createGetStaticProps(
function PositivelyTestedPeople(props: StaticProps<typeof getStaticProps>) {
const { pageText, selectedNlData: data, choropleth, content, lastGenerated } = props;

const [confirmedCasesSelfTestedTimeframe, setConfirmedCasesSelfTestedTimeframe] = useState<TimeframeOption>(TimeframeOption.SIX_MONTHS);

const [confirmedCasesInfectedTimeframe, setConfirmedCasesInfectedTimeframe] = useState<TimeframeOption>(TimeframeOption.SIX_MONTHS);

const [confirmedCasesInfectedPercentageTimeframe, setConfirmedCasesInfectedPercentageTimeframe] = useState<TimeframeOption>(TimeframeOption.ALL);
Expand Down Expand Up @@ -143,6 +145,38 @@ function PositivelyTestedPeople(props: StaticProps<typeof getStaticProps>) {
articles={content.articles}
/>

<ChartTile
title={textNl.linechart_self_test_titel}
description={textNl.linechart_self_test_toelichting}
metadata={{
source: textNl.bronnen.self_test,
}}
timeframeOptions={TimeframeOptionsList}
timeframeInitialValue={confirmedCasesSelfTestedTimeframe}
onSelectTimeframe={setConfirmedCasesSelfTestedTimeframe}
>
<TimeSeriesChart
accessibility={{
key: 'confirmed_cases_self_tested_over_time_chart',
}}
values={data.self_test_overall.values}
timeframe={confirmedCasesSelfTestedTimeframe}
seriesConfig={[
{
type: 'line',
metricProperty: 'infected_percentage',
label: textNl.linechart_self_test_tooltip_label,
color: colors.primary,
},
]}
dataOptions={{
isPercentage: true,
timelineEvents: getTimelineEvents(content.elements.timeSeries, 'self_test_overall'),
}}
forceLegend
/>
</ChartTile>

<ChartTile
title={textNl.linechart_titel}
description={replaceVariablesInText(textNl.linechart_toelichting, {
Expand Down
131 changes: 0 additions & 131 deletions packages/app/src/pages/landelijk/testen.tsx

This file was deleted.

21 changes: 10 additions & 11 deletions packages/app/src/types/cms.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@ import { ArticleSummary } from '~/components/article-teaser';
import { CategoriesTypes } from '~/domain/topical/common/categories';

export type PageIdentifier =
| 'behavior_page'
| 'deceased_page'
| 'disability_care_page'
| 'elderly_at_home_page'
| 'hospital_page'
| 'hospitals_and_care_page'
| 'behavior_page'
| 'situations_page'
| 'reproduction_page'
| 'infectious_people_page'
| 'nursing_home_page'
| 'patients_page'
| 'topical_page'
| 'elderly_at_home_page'
| 'disability_care_page'
| 'positive_tests_page'
| 'reproduction_page'
| 'variants_page'
| 'sewer_page'
| 'situations_page'
| 'tests_page'
| 'topical_page'
| 'patients_page'
| 'vaccinations_page'
| 'variants_page';
| 'nursing_home_page'
| 'deceased_page';

export type PageBasePart = {
pageDataKind: string;
Expand Down
7 changes: 7 additions & 0 deletions packages/cms/src/lokalize/key-mutations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,10 @@ timestamp,action,key,document_id,move_to
2023-04-11T15:39:52.717Z,delete,pages.positive_tests_page.nl.linechart_self_test_titel,PKXdxxxKAnTg0F1ZCghMkN,__
2023-04-11T15:39:52.725Z,delete,pages.positive_tests_page.nl.linechart_self_test_toelichting,PKXdxxxKAnTg0F1ZCghMnz,__
2023-04-11T15:39:52.730Z,delete,pages.positive_tests_page.nl.linechart_self_test_tooltip_label,KoLyCpXIGU95m7jfEHZKIf,__
2023-04-17T09:54:53.417Z,add,pages.positive_tests_page.nl.bronnen.self_test.aria_text,eamHKzD43YGGBYDBdLwkJN,__
2023-04-17T09:54:55.806Z,add,pages.positive_tests_page.nl.bronnen.self_test.download,eamHKzD43YGGBYDBdLwkSZ,__
2023-04-17T09:54:57.376Z,add,pages.positive_tests_page.nl.bronnen.self_test.href,oB32MHoi5k0LjWD2RooOOv,__
2023-04-17T09:54:58.827Z,add,pages.positive_tests_page.nl.bronnen.self_test.text,oB32MHoi5k0LjWD2RooOrr,__
2023-04-17T09:54:59.852Z,add,pages.positive_tests_page.nl.linechart_self_test_titel,oB32MHoi5k0LjWD2RooPFy,__
2023-04-17T09:55:01.863Z,add,pages.positive_tests_page.nl.linechart_self_test_toelichting,eamHKzD43YGGBYDBdLwkvz,__
2023-04-17T09:55:02.863Z,add,pages.positive_tests_page.nl.linechart_self_test_tooltip_label,eamHKzD43YGGBYDBdLwl5B,__
39 changes: 19 additions & 20 deletions packages/common/src/data/reverse-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,25 @@ export function getReverseRouter(isMobile: boolean) {
},

nl: {
index: () => (isMobile ? '/landelijk' : reverseRouter.nl.rioolwater()),
vaccinaties: () => '/landelijk/vaccinaties',
positiefGetesteMensen: () => '/landelijk/positief-geteste-mensen',
testen: () => '/landelijk/testen',
besmettelijkeMensen: () => '/landelijk/besmettelijke-mensen',
reproductiegetal: () => '/landelijk/reproductiegetal',
sterfte: () => '/landelijk/sterfte',
ziekenhuisopnames: () => '/landelijk/ziekenhuis-opnames',
intensiveCareOpnames: () => '/landelijk/intensive-care-opnames',
ziekenhuizenEnZorg: () => '/landelijk/ziekenhuizen-en-zorg',
patientenInBeeld: () => '/landelijk/patienten-in-beeld',
kwetsbareGroepen: () => '/landelijk/kwetsbare-groepen-70-plussers',
gehandicaptenzorg: () => '/landelijk/gehandicaptenzorg',
thuiswonendeOuderen: () => '/landelijk/thuiswonende-ouderen',
rioolwater: () => '/landelijk/rioolwater',
verdenkingenHuisartsen: () => '/landelijk/verdenkingen-huisartsen',
gedrag: () => '/landelijk/gedrag',
coronamelder: () => '/landelijk/coronamelder',
brononderzoek: () => '/landelijk/brononderzoek',
varianten: () => '/landelijk/varianten',
index: () => (isMobile ? `/landelijk` : reverseRouter.nl.rioolwater()),
vaccinaties: () => `/landelijk/vaccinaties`,
positiefGetesteMensen: () => `/landelijk/positief-geteste-mensen`,
besmettelijkeMensen: () => `/landelijk/besmettelijke-mensen`,
reproductiegetal: () => `/landelijk/reproductiegetal`,
sterfte: () => `/landelijk/sterfte`,
ziekenhuisopnames: () => `/landelijk/ziekenhuis-opnames`,
intensiveCareOpnames: () => `/landelijk/intensive-care-opnames`,
ziekenhuizenEnZorg: () => `/landelijk/ziekenhuizen-en-zorg`,
patientenInBeeld: () => `/landelijk/patienten-in-beeld`,
kwetsbareGroepen: () => `/landelijk/kwetsbare-groepen-70-plussers`,
gehandicaptenzorg: () => `/landelijk/gehandicaptenzorg`,
thuiswonendeOuderen: () => `/landelijk/thuiswonende-ouderen`,
rioolwater: () => `/landelijk/rioolwater`,
verdenkingenHuisartsen: () => `/landelijk/verdenkingen-huisartsen`,
gedrag: () => `/landelijk/gedrag`,
coronamelder: () => `/landelijk/coronamelder`,
brononderzoek: () => `/landelijk/brononderzoek`,
varianten: () => `/landelijk/varianten`,
},

vr: {
Expand Down