From f38f823839e2407bbb53f8a56253ccfc89ddac9d Mon Sep 17 00:00:00 2001 From: BE <137172332+VWSCoronaDashboard29@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:20:39 +0200 Subject: [PATCH] chore(COR-1830): Rename page and update router and redirects (#4909) * chore(COR-1830): Rename page and update router and redirects * chore(COR-1830): Update vaccines to coronaprik and apply json edits * chore: Update reverserouter links --------- Co-authored-by: VWSCoronaDashboard29 --- packages/app/src/components/sitemap/use-data-sitemap.ts | 4 ++-- packages/app/src/domain/layout/gm-layout.tsx | 2 +- packages/app/src/domain/layout/logic/types.ts | 4 ++-- packages/app/src/domain/layout/logic/use-sidebar.tsx | 2 +- packages/app/src/domain/layout/nl-layout.tsx | 2 +- packages/app/src/next-config/redirects/redirects.js | 6 ++++++ packages/app/src/pages/gemeente/[code]/vaccinaties.tsx | 4 ++-- .../pages/landelijk/{vaccinaties.tsx => de-coronaprik.tsx} | 4 ++-- .../app/src/utils/__tests__/use-reverse-router.spec.tsx | 4 ++-- packages/cms/src/lokalize/key-mutations.csv | 2 ++ packages/common/src/data/reverse-router.ts | 4 ++-- 11 files changed, 23 insertions(+), 15 deletions(-) rename packages/app/src/pages/landelijk/{vaccinaties.tsx => de-coronaprik.tsx} (99%) diff --git a/packages/app/src/components/sitemap/use-data-sitemap.ts b/packages/app/src/components/sitemap/use-data-sitemap.ts index 3dd5793b7c..afd7ff955d 100644 --- a/packages/app/src/components/sitemap/use-data-sitemap.ts +++ b/packages/app/src/components/sitemap/use-data-sitemap.ts @@ -48,8 +48,8 @@ export function useDataSitemap(base: 'nl' | 'gm', code?: string, data?: Pick) => /> ) => )} ) { reverseRouter.gm.vaccinaties(gmcode), isPercentage: true }} + dataOptions={{ getLink: (gmcode) => reverseRouter.gm.deCoronaprik(gmcode), isPercentage: true }} text={{ title: commonTexts.choropleth.choropleth_vaccination_coverage.nl.archived.fully_vaccinated.title, description: commonTexts.choropleth.choropleth_vaccination_coverage.nl.archived.fully_vaccinated.description, @@ -365,7 +365,7 @@ function VaccinationPage(props: StaticProps) { reverseRouter.gm.vaccinaties(gmcode), isPercentage: true }} + dataOptions={{ getLink: (gmcode) => reverseRouter.gm.deCoronaprik(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, diff --git a/packages/app/src/utils/__tests__/use-reverse-router.spec.tsx b/packages/app/src/utils/__tests__/use-reverse-router.spec.tsx index 2b5b38be59..712ed87f35 100644 --- a/packages/app/src/utils/__tests__/use-reverse-router.spec.tsx +++ b/packages/app/src/utils/__tests__/use-reverse-router.spec.tsx @@ -78,8 +78,8 @@ UseReverseRouter("indexes should 'redirect' to child pages", () => { const nlDiv = result.getByTestId('nl'); const gmDiv = result.getByTestId('gm'); - assert.equal(nlDiv.textContent?.endsWith('/vaccinaties'), true); - assert.equal(gmDiv.textContent?.endsWith('/vaccinaties'), true); + assert.equal(nlDiv.textContent?.endsWith('/deCoronaprik'), true); + assert.equal(gmDiv.textContent?.endsWith('/deCoronaprik'), true); }); UseReverseRouter('GM routes should have the GM code in them', () => { diff --git a/packages/cms/src/lokalize/key-mutations.csv b/packages/cms/src/lokalize/key-mutations.csv index d6e70b0f18..2601065f2e 100644 --- a/packages/cms/src/lokalize/key-mutations.csv +++ b/packages/cms/src/lokalize/key-mutations.csv @@ -13,3 +13,5 @@ timestamp,action,key,document_id,move_to 2023-10-20T09:31:28.284Z,add,pages.variants_page.nl.kpi_amount_of_samples.tile_total_variants.description,hT5k3RDQ7JafeiQP6wRLio,__ 2023-10-20T09:31:29.643Z,add,pages.variants_page.nl.kpi_amount_of_samples.disclaimer,w5vHLm19hF0S5wj1e5Ryjx,__ 2023-10-20T09:31:30.622Z,add,pages.variants_page.nl.varianten_tabel.omschrijving_te_weinig_samples,w5vHLm19hF0S5wj1e5RyoG,__ +2023-10-23T15:10:02.545Z,add,common.sidebar.metrics.the_corona_vaccine.title,ZkwHqMQjnsmR1ekP50kkn5,__ +2023-10-23T15:10:02.545Z,delete,common.sidebar.metrics.vaccinations.title,wzQp83DAUqyqV3ewG9xYUn,__ diff --git a/packages/common/src/data/reverse-router.ts b/packages/common/src/data/reverse-router.ts index a784920999..74caf6a4dc 100644 --- a/packages/common/src/data/reverse-router.ts +++ b/packages/common/src/data/reverse-router.ts @@ -16,7 +16,7 @@ export function getReverseRouter(isMobile: boolean) { nl: { index: () => (isMobile ? '/landelijk' : reverseRouter.nl.rioolwater()), - vaccinaties: () => '/landelijk/vaccinaties', + deCoronaprik: () => '/landelijk/de-coronaprik', positieveTesten: () => '/landelijk/positieve-testen', infectieradar: () => '/landelijk/infectieradar', besmettelijkeMensen: () => '/landelijk/besmettelijke-mensen', @@ -43,7 +43,7 @@ export function getReverseRouter(isMobile: boolean) { sterfte: (code: string) => `/gemeente/${code}/sterfte`, ziekenhuisopnames: (code: string) => `/gemeente/${code}/ziekenhuis-opnames`, rioolwater: (code: string) => `/gemeente/${code}/rioolwater`, - vaccinaties: (code: string) => `/gemeente/${code}/vaccinaties`, + deCoronaprik: (code: string) => `/gemeente/${code}/de-coronaprik`, }, } as const;