From 41f68399706496f5adb655b5c64b32da36d07208 Mon Sep 17 00:00:00 2001 From: VWSCoronaDashboard18 <93984341+VWSCoronaDashboard18@users.noreply.github.com> Date: Tue, 28 Mar 2023 14:08:03 +0200 Subject: [PATCH 1/3] chore: Remove toggle on 'positive tested' page --- .../components/choropleth/logic/thresholds.ts | 1 - .../landelijk/positief-geteste-mensen.tsx | 76 +++++-------------- 2 files changed, 19 insertions(+), 58 deletions(-) diff --git a/packages/app/src/components/choropleth/logic/thresholds.ts b/packages/app/src/components/choropleth/logic/thresholds.ts index 8775e41609..fa221c6691 100644 --- a/packages/app/src/components/choropleth/logic/thresholds.ts +++ b/packages/app/src/components/choropleth/logic/thresholds.ts @@ -385,7 +385,6 @@ export const thresholds: Thresholds = { vaccinated_percentage_60_plus: vaccineCoveragePercentageThresholds, }, vr: { - infected_per_100k: positiveTestedThresholds, admissions_on_date_of_admission: vrHospitalAdmissionsThresholds, admissions_on_date_of_admission_per_100000: hospitalAdmissionsPer100000Thresholds, infected_locations_percentage: infectedLocationsPercentageThresholds, diff --git a/packages/app/src/pages/landelijk/positief-geteste-mensen.tsx b/packages/app/src/pages/landelijk/positief-geteste-mensen.tsx index 5c3877ec12..8c7e19f7fc 100644 --- a/packages/app/src/pages/landelijk/positief-geteste-mensen.tsx +++ b/packages/app/src/pages/landelijk/positief-geteste-mensen.tsx @@ -2,7 +2,6 @@ import { colors, NlTestedOverallValue, TimeframeOption, TimeframeOptionsList } f import { GgdTesten } from '@corona-dashboard/icons'; import { GetStaticPropsContext } from 'next'; import { useState } from 'react'; -import { RegionControlOption } from '~/components/chart-region-controls'; import { ChartTile } from '~/components/chart-tile'; import { ChartTileToggleItem } from '~/components/chart-tile-toggle'; import { DynamicChoropleth } from '~/components/choropleth'; @@ -58,7 +57,6 @@ export const getStaticProps = createGetStaticProps( ), createGetChoroplethData({ gm: ({ tested_overall }) => ({ tested_overall }), - vr: ({ tested_overall }) => ({ tested_overall }), }), async (context: GetStaticPropsContext) => { const { content } = await createGetContent<{ @@ -100,7 +98,6 @@ function PositivelyTestedPeople(props: StaticProps) { const { metadataTexts, textNl, textShared } = useDynamicLokalizeTexts(pageText, selectLokalizeTexts); - const [selectedMap, setSelectedMap] = useState('gm'); const [selectedGgdGraph, setSelectedGgdGraph] = useState('GGD_infected_percentage_over_time_chart'); const ggdGraphToggleItems: ChartTileToggleItem[] = [ @@ -351,64 +348,29 @@ function PositivelyTestedPeople(props: StaticProps) { })} } - onChartRegionChange={setSelectedMap} - chartRegion={selectedMap} legend={{ title: textShared.chloropleth_legenda.titel, - thresholds: thresholds.vr.infected_per_100k, + thresholds: thresholds.gm.infected_per_100k, }} > - {/** - * It's probably a good idea to abstract this even further, so that - * the switching of charts, and the state involved, are all handled by - * the component. The page does not have to be bothered with this. - * - * Ideally the ChoroplethTile would receive some props with the data - * it needs to render either Choropleth without it caring about - * MunicipalityChloropleth or VrChloropleth, that data would - * make the chart and define the tooltip layout for each, but maybe for - * now that is a bridge too far. Let's take it one step at a time. - */} - {selectedMap === 'gm' && ( - - )} - {selectedMap === 'vr' && ( - - )} + From 2ae3426c43f17d6822e73f9ecc97ef2763384477 Mon Sep 17 00:00:00 2001 From: VWSCoronaDashboard18 <93984341+VWSCoronaDashboard18@users.noreply.github.com> Date: Tue, 28 Mar 2023 14:51:07 +0200 Subject: [PATCH 2/3] chore: update lokalize keys --- packages/cms/src/lokalize/key-mutations.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/cms/src/lokalize/key-mutations.csv b/packages/cms/src/lokalize/key-mutations.csv index 6909473512..b244230982 100644 --- a/packages/cms/src/lokalize/key-mutations.csv +++ b/packages/cms/src/lokalize/key-mutations.csv @@ -45,3 +45,5 @@ timestamp,action,key,document_id,move_to 2023-03-24T07:45:03.890Z,delete,pages.topical_page.shared.secties.search.title.nl,PGwiP4IwXrA0GfLCLD9Tth,__ 2023-03-24T07:45:03.890Z,delete,pages.topical_page.shared.secties.search.title.vr,7nClfXqPlyZyEU7PO2TAAw,__ 2023-03-23T08:50:33.174Z,delete,common.nav.links.veiligheidsregio,jF33EuwumlGuwav2FD3VW8,__ +2023-03-28T12:50:47.492Z,delete,common.accessibility.charts.confirmed_cases_region_choropleth.description,Z3v1SKYekK4CLDpzUPbJIJ,__ +2023-03-28T12:50:47.493Z,delete,common.accessibility.charts.confirmed_cases_region_choropleth.label,G1DXw0RdifOml06twMjEhw,__ From 1ffdb2aaf6ba8ac6dbb0f4c6a6005250f16b84e6 Mon Sep 17 00:00:00 2001 From: VWSCoronaDashboard18 <93984341+VWSCoronaDashboard18@users.noreply.github.com> Date: Thu, 30 Mar 2023 07:39:30 +0200 Subject: [PATCH 3/3] fix: PR feedback about spacing --- .../src/pages/landelijk/positief-geteste-mensen.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/app/src/pages/landelijk/positief-geteste-mensen.tsx b/packages/app/src/pages/landelijk/positief-geteste-mensen.tsx index 8c7e19f7fc..db7492540f 100644 --- a/packages/app/src/pages/landelijk/positief-geteste-mensen.tsx +++ b/packages/app/src/pages/landelijk/positief-geteste-mensen.tsx @@ -2,6 +2,7 @@ import { colors, NlTestedOverallValue, TimeframeOption, TimeframeOptionsList } f import { GgdTesten } from '@corona-dashboard/icons'; import { GetStaticPropsContext } from 'next'; import { useState } from 'react'; +import { Box } from '~/components/base'; import { ChartTile } from '~/components/chart-tile'; import { ChartTileToggleItem } from '~/components/chart-tile-toggle'; import { DynamicChoropleth } from '~/components/choropleth'; @@ -24,6 +25,7 @@ import { ElementsQueryResult, getElementsQuery, getTimelineEvents } from '~/quer import { getArticleParts, getPagePartsQuery } from '~/queries/get-page-parts-query'; import { createGetStaticProps, StaticProps } from '~/static-props/create-get-static-props'; import { createGetChoroplethData, createGetContent, getLastGeneratedDate, getLokalizeTexts, 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'; import { getLastInsertionDateOfPage } from '~/utils/get-last-insertion-date-of-page'; @@ -342,10 +344,12 @@ function PositivelyTestedPeople(props: StaticProps) { description={ <> - {replaceComponentsInText(textNl.map_last_value_text, { - infected_per_100k: {`${formatNumber(dataOverallLastValue.infected_per_100k)}`}, - dateTo: formatDateFromSeconds(dataOverallLastValue.date_unix, 'weekday-long'), - })} + + {replaceComponentsInText(textNl.map_last_value_text, { + infected_per_100k: {`${formatNumber(dataOverallLastValue.infected_per_100k)}`}, + dateTo: formatDateFromSeconds(dataOverallLastValue.date_unix, 'weekday-long'), + })} + } legend={{