From d3d585111e59cb57c36e71c40f91c9147691c2a9 Mon Sep 17 00:00:00 2001 From: LR <107395524+VWSCoronaDashboard26@users.noreply.github.com> Date: Mon, 17 Apr 2023 11:38:45 +0200 Subject: [PATCH 1/2] Revert "feature/COR-1548-tests-page (#4734)" This reverts commit 79b8cecee0e851b22309da055514e33fd79019ad. --- packages/app/src/domain/layout/logic/types.ts | 3 +- .../src/domain/layout/logic/use-sidebar.tsx | 7 +- packages/app/src/domain/layout/nl-layout.tsx | 2 +- .../landelijk/positief-geteste-mensen.tsx | 34 +++++ packages/app/src/pages/landelijk/testen.tsx | 131 ------------------ packages/app/src/types/cms.d.ts | 21 ++- packages/cms/src/lokalize/key-mutations.csv | 25 ---- packages/common/src/data/reverse-router.ts | 39 +++--- 8 files changed, 68 insertions(+), 194 deletions(-) delete mode 100644 packages/app/src/pages/landelijk/testen.tsx diff --git a/packages/app/src/domain/layout/logic/types.ts b/packages/app/src/domain/layout/logic/types.ts index 3e50f9b23e..5ae320cd55 100644 --- a/packages/app/src/domain/layout/logic/types.ts +++ b/packages/app/src/domain/layout/logic/types.ts @@ -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'; diff --git a/packages/app/src/domain/layout/logic/use-sidebar.tsx b/packages/app/src/domain/layout/logic/use-sidebar.tsx index 65c6f7a87b..d668581000 100644 --- a/packages/app/src/domain/layout/logic/use-sidebar.tsx +++ b/packages/app/src/domain/layout/logic/use-sidebar.tsx @@ -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 = { diff --git a/packages/app/src/domain/layout/nl-layout.tsx b/packages/app/src/domain/layout/nl-layout.tsx index 9f84227b10..ada788b9e1 100644 --- a/packages/app/src/domain/layout/nl-layout.tsx +++ b/packages/app/src/domain/layout/nl-layout.tsx @@ -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']], diff --git a/packages/app/src/pages/landelijk/positief-geteste-mensen.tsx b/packages/app/src/pages/landelijk/positief-geteste-mensen.tsx index c6d16854be..2822f01bfd 100644 --- a/packages/app/src/pages/landelijk/positief-geteste-mensen.tsx +++ b/packages/app/src/pages/landelijk/positief-geteste-mensen.tsx @@ -84,6 +84,8 @@ export const getStaticProps = createGetStaticProps( function PositivelyTestedPeople(props: StaticProps) { const { pageText, selectedNlData: data, choropleth, content, lastGenerated } = props; + const [confirmedCasesSelfTestedTimeframe, setConfirmedCasesSelfTestedTimeframe] = useState(TimeframeOption.SIX_MONTHS); + const [confirmedCasesInfectedTimeframe, setConfirmedCasesInfectedTimeframe] = useState(TimeframeOption.SIX_MONTHS); const [confirmedCasesInfectedPercentageTimeframe, setConfirmedCasesInfectedPercentageTimeframe] = useState(TimeframeOption.ALL); @@ -143,6 +145,38 @@ function PositivelyTestedPeople(props: StaticProps) { articles={content.articles} /> + + + + ({ - metadataTexts: siteText.pages.topical_page.nl.nationaal_metadata, - textNl: siteText.pages.tests_page.nl, -}); - -type LokalizeTexts = ReturnType; - -export const getStaticProps = createGetStaticProps( - ({ locale }: { locale: keyof Languages }) => getLokalizeTexts(selectLokalizeTexts, locale), - getLastGeneratedDate, - selectNlData('self_test_overall'), - async (context: GetStaticPropsContext) => { - const { content } = await createGetContent<{ - parts: PagePartQueryResult; - elements: ElementsQueryResult; - }>((context) => { - const { locale } = context; - return `{ - "parts": ${getPagePartsQuery('tests_page')}, - "elements": ${getElementsQuery('nl', ['self_test_overall'], locale)} - }`; - })(context); - return { - content: { - articles: getArticleParts(content.parts.pageParts, 'testsPageArticles'), - elements: content.elements, - }, - }; - } -); - -const Tests = (props: StaticProps) => { - const { pageText, selectedNlData: data, content, lastGenerated } = props; - - const [confirmedCasesSelfTestedTimeframe, setConfirmedCasesSelfTestedTimeframe] = useState(TimeframeOption.SIX_MONTHS); - - const { commonTexts } = useIntl(); - - const { metadataTexts, textNl } = useDynamicLokalizeTexts(pageText, selectLokalizeTexts); - - const metadata = { - ...metadataTexts, - title: textNl.metadata.title, - description: textNl.metadata.description, - }; - - const lastInsertionDateOfPage = getLastInsertionDateOfPage(data, pageMetrics); - - return ( - - - - - - - ); -}; - -export default Tests; diff --git a/packages/app/src/types/cms.d.ts b/packages/app/src/types/cms.d.ts index 160dc4f715..a44aeb9972 100644 --- a/packages/app/src/types/cms.d.ts +++ b/packages/app/src/types/cms.d.ts @@ -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; diff --git a/packages/cms/src/lokalize/key-mutations.csv b/packages/cms/src/lokalize/key-mutations.csv index 6c3efbcfde..9c9b875303 100644 --- a/packages/cms/src/lokalize/key-mutations.csv +++ b/packages/cms/src/lokalize/key-mutations.csv @@ -21,28 +21,3 @@ timestamp,action,key,document_id,move_to 2023-03-21T10:35:31.653Z,delete,pages.vaccinations_page.shared.vaccination_grade_tile.autumn_labels.description_footer,u6z14vWwH5lzTVbDpRg06r,__ 2023-03-21T10:35:31.653Z,delete,pages.vaccinations_page.shared.vaccination_grade_tile.fully_vaccinated_labels.description_footer,772MCeNIooHnNdtyUIs7TE,__ 2023-03-21T10:35:31.653Z,delete,pages.vaccinations_page.vr.vaccination_grade_toggle_tile.description_footer,qjZwg5QUJcN8JoCoxxDHxs,__ -2023-04-11T15:39:11.176Z,add,common.sidebar.metrics.tests.title,CsCcyhU6YSJUj7yolLoyBL,__ -2023-04-11T15:39:14.357Z,add,pages.tests_page.nl.metadata.description,CsCcyhU6YSJUj7yolLoyIy,__ -2023-04-11T15:39:16.050Z,add,pages.tests_page.nl.metadata.title,sV6BHv8iu7DuHPF8JxKZSk,__ -2023-04-11T15:39:17.408Z,add,pages.tests_page.nl.sources.rivm.aria_text,CsCcyhU6YSJUj7yolLoyQb,__ -2023-04-11T15:39:19.304Z,add,pages.tests_page.nl.sources.rivm.download,sV6BHv8iu7DuHPF8JxKaSq,__ -2023-04-11T15:39:21.493Z,add,pages.tests_page.nl.sources.rivm.href,sV6BHv8iu7DuHPF8JxKbQ7,__ -2023-04-11T15:39:26.183Z,add,pages.tests_page.nl.sources.rivm.text,CsCcyhU6YSJUj7yolLoyre,__ -2023-04-11T15:39:29.664Z,add,pages.tests_page.nl.sources.self_test.aria_text,jw0M9D1FUbTPkflikzUdd8,__ -2023-04-11T15:39:33.508Z,add,pages.tests_page.nl.sources.self_test.download,sV6BHv8iu7DuHPF8JxKd3j,__ -2023-04-11T15:39:35.057Z,add,pages.tests_page.nl.sources.self_test.href,jw0M9D1FUbTPkflikzUdmw,__ -2023-04-11T15:39:37.338Z,add,pages.tests_page.nl.sources.self_test.text,sV6BHv8iu7DuHPF8JxKdYm,__ -2023-04-11T15:39:38.574Z,add,pages.tests_page.nl.reference.href,jw0M9D1FUbTPkflikzUdsS,__ -2023-04-11T15:39:42.269Z,add,pages.tests_page.nl.dates,CsCcyhU6YSJUj7yolLozOw,__ -2023-04-11T15:39:45.361Z,add,pages.tests_page.nl.description,sV6BHv8iu7DuHPF8JxKesd,__ -2023-04-11T15:39:47.349Z,add,pages.tests_page.nl.title,sV6BHv8iu7DuHPF8JxKfCO,__ -2023-04-11T15:39:49.307Z,add,pages.tests_page.nl.chart_self_tests.title,CsCcyhU6YSJUj7yolLp0IQ,__ -2023-04-11T15:39:51.003Z,add,pages.tests_page.nl.chart_self_tests.description,CsCcyhU6YSJUj7yolLp0Of,__ -2023-04-11T15:39:52.678Z,add,pages.tests_page.nl.chart_self_tests.tooltip_label,jw0M9D1FUbTPkflikzUeTE,__ -2023-04-11T15:39:52.682Z,delete,pages.positive_tests_page.nl.bronnen.self_test.aria_text,PKXdxxxKAnTg0F1ZCsSm7v,__ -2023-04-11T15:39:52.694Z,delete,pages.positive_tests_page.nl.bronnen.self_test.download,KoLyCpXIGU95m7jfEPMPhh,__ -2023-04-11T15:39:52.702Z,delete,pages.positive_tests_page.nl.bronnen.self_test.href,KoLyCpXIGU95m7jfEPMPlH,__ -2023-04-11T15:39:52.711Z,delete,pages.positive_tests_page.nl.bronnen.self_test.text,0iJeil5hiqRr6jTKtbFGx7,__ -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,__ diff --git a/packages/common/src/data/reverse-router.ts b/packages/common/src/data/reverse-router.ts index 01f44daf1c..9a8070599e 100644 --- a/packages/common/src/data/reverse-router.ts +++ b/packages/common/src/data/reverse-router.ts @@ -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: { From bf1313e5fcad4300b62f16558e0538d41111b1cd Mon Sep 17 00:00:00 2001 From: VWSCoronaDashboard26 Date: Mon, 17 Apr 2023 11:59:53 +0200 Subject: [PATCH 2/2] chore(revert): updated key-mutations.csv; --- packages/cms/src/lokalize/key-mutations.csv | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/cms/src/lokalize/key-mutations.csv b/packages/cms/src/lokalize/key-mutations.csv index 9c9b875303..6c4b92ae96 100644 --- a/packages/cms/src/lokalize/key-mutations.csv +++ b/packages/cms/src/lokalize/key-mutations.csv @@ -21,3 +21,35 @@ timestamp,action,key,document_id,move_to 2023-03-21T10:35:31.653Z,delete,pages.vaccinations_page.shared.vaccination_grade_tile.autumn_labels.description_footer,u6z14vWwH5lzTVbDpRg06r,__ 2023-03-21T10:35:31.653Z,delete,pages.vaccinations_page.shared.vaccination_grade_tile.fully_vaccinated_labels.description_footer,772MCeNIooHnNdtyUIs7TE,__ 2023-03-21T10:35:31.653Z,delete,pages.vaccinations_page.vr.vaccination_grade_toggle_tile.description_footer,qjZwg5QUJcN8JoCoxxDHxs,__ +2023-04-11T15:39:11.176Z,add,common.sidebar.metrics.tests.title,CsCcyhU6YSJUj7yolLoyBL,__ +2023-04-11T15:39:14.357Z,add,pages.tests_page.nl.metadata.description,CsCcyhU6YSJUj7yolLoyIy,__ +2023-04-11T15:39:16.050Z,add,pages.tests_page.nl.metadata.title,sV6BHv8iu7DuHPF8JxKZSk,__ +2023-04-11T15:39:17.408Z,add,pages.tests_page.nl.sources.rivm.aria_text,CsCcyhU6YSJUj7yolLoyQb,__ +2023-04-11T15:39:19.304Z,add,pages.tests_page.nl.sources.rivm.download,sV6BHv8iu7DuHPF8JxKaSq,__ +2023-04-11T15:39:21.493Z,add,pages.tests_page.nl.sources.rivm.href,sV6BHv8iu7DuHPF8JxKbQ7,__ +2023-04-11T15:39:26.183Z,add,pages.tests_page.nl.sources.rivm.text,CsCcyhU6YSJUj7yolLoyre,__ +2023-04-11T15:39:29.664Z,add,pages.tests_page.nl.sources.self_test.aria_text,jw0M9D1FUbTPkflikzUdd8,__ +2023-04-11T15:39:33.508Z,add,pages.tests_page.nl.sources.self_test.download,sV6BHv8iu7DuHPF8JxKd3j,__ +2023-04-11T15:39:35.057Z,add,pages.tests_page.nl.sources.self_test.href,jw0M9D1FUbTPkflikzUdmw,__ +2023-04-11T15:39:37.338Z,add,pages.tests_page.nl.sources.self_test.text,sV6BHv8iu7DuHPF8JxKdYm,__ +2023-04-11T15:39:38.574Z,add,pages.tests_page.nl.reference.href,jw0M9D1FUbTPkflikzUdsS,__ +2023-04-11T15:39:42.269Z,add,pages.tests_page.nl.dates,CsCcyhU6YSJUj7yolLozOw,__ +2023-04-11T15:39:45.361Z,add,pages.tests_page.nl.description,sV6BHv8iu7DuHPF8JxKesd,__ +2023-04-11T15:39:47.349Z,add,pages.tests_page.nl.title,sV6BHv8iu7DuHPF8JxKfCO,__ +2023-04-11T15:39:49.307Z,add,pages.tests_page.nl.chart_self_tests.title,CsCcyhU6YSJUj7yolLp0IQ,__ +2023-04-11T15:39:51.003Z,add,pages.tests_page.nl.chart_self_tests.description,CsCcyhU6YSJUj7yolLp0Of,__ +2023-04-11T15:39:52.678Z,add,pages.tests_page.nl.chart_self_tests.tooltip_label,jw0M9D1FUbTPkflikzUeTE,__ +2023-04-11T15:39:52.682Z,delete,pages.positive_tests_page.nl.bronnen.self_test.aria_text,PKXdxxxKAnTg0F1ZCsSm7v,__ +2023-04-11T15:39:52.694Z,delete,pages.positive_tests_page.nl.bronnen.self_test.download,KoLyCpXIGU95m7jfEPMPhh,__ +2023-04-11T15:39:52.702Z,delete,pages.positive_tests_page.nl.bronnen.self_test.href,KoLyCpXIGU95m7jfEPMPlH,__ +2023-04-11T15:39:52.711Z,delete,pages.positive_tests_page.nl.bronnen.self_test.text,0iJeil5hiqRr6jTKtbFGx7,__ +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,__