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

Commit

Permalink
chore(COR-1830): Rename page and update router and redirects (#4909)
Browse files Browse the repository at this point in the history
* 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 <B>
  • Loading branch information
ben-van-eekelen authored Oct 23, 2023
1 parent 51f74db commit f38f823
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 15 deletions.
4 changes: 2 additions & 2 deletions packages/app/src/components/sitemap/use-data-sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export function useDataSitemap(base: 'nl' | 'gm', code?: string, data?: Pick<Nl,
header: commonTexts.sidebar.categories.vaccinations.title,
links: [
{
text: commonTexts.sidebar.metrics.vaccinations.title,
href: reverseRouter.nl.vaccinaties(),
text: commonTexts.sidebar.metrics.the_corona_vaccine.title,
href: reverseRouter.nl.deCoronaprik(),
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/domain/layout/gm-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function GmLayout(props: GmLayoutProps) {
map: [
['development_of_the_virus', ['sewage_measurement']],
['consequences_for_healthcare', ['hospital_admissions']],
['actions_to_take', ['vaccinations']],
['actions_to_take', ['the_corona_vaccine']],
['archived_metrics', ['positive_tests', 'mortality']],
],
});
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/domain/layout/logic/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export type Layout = 'nl' | 'gm' | 'custom';

type SharedCategoryKeys = 'development_of_the_virus' | 'consequences_for_healthcare' | 'actions_to_take';

export type GmItemKeys = 'hospital_admissions' | 'mortality' | 'positive_tests' | 'sewage_measurement' | 'vaccinations';
export type GmItemKeys = 'hospital_admissions' | 'mortality' | 'positive_tests' | 'sewage_measurement' | 'the_corona_vaccine';

export type GmCategoryKeys = SharedCategoryKeys | 'archived_metrics';

Expand All @@ -22,7 +22,7 @@ export type NlItemKeys =
| 'reproduction_number'
| 'sewage_measurement'
| 'infection_radar'
| 'vaccinations'
| 'the_corona_vaccine'
| 'variants';

export type NlCategoryKeys = SharedCategoryKeys | 'archived_metrics';
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/domain/layout/logic/use-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const mapKeysToReverseRouter = {
reproduction_number: 'reproductiegetal',
sewage_measurement: 'rioolwater',
infection_radar: 'infectieradar',
vaccinations: 'vaccinaties',
the_corona_vaccine: 'deCoronaprik',
variants: 'varianten',
} as const;

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 @@ -39,7 +39,7 @@ export function NlLayout(props: NlLayoutProps) {
map: [
['development_of_the_virus', ['sewage_measurement', 'infection_radar', 'variants', 'mortality']],
['consequences_for_healthcare', ['hospitals_and_care', 'patients']],
['actions_to_take', ['vaccinations']],
['actions_to_take', ['the_corona_vaccine']],
[
'archived_metrics',
[
Expand Down
6 changes: 6 additions & 0 deletions packages/app/src/next-config/redirects/redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ async function redirects() {
destination: '/landelijk/infectieradar',
permanent: true,
},
// Redirect for COR-1830
{
source: '/landelijk/vaccinaties',
destination: '/landelijk/de-coronaprik',
permanent: true,
},
];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/pages/gemeente/[code]/vaccinaties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) =>
/>
<VaccineCoverageChoropleth
data={archivedChoropleth.gm.vaccine_coverage_per_age_group_choropleth_archived_20231004}
dataOptions={{ getLink: reverseRouter.gm.vaccinaties, selectedCode: currentData.code, isPercentage: true }}
dataOptions={{ getLink: reverseRouter.gm.deCoronaprik, selectedCode: currentData.code, isPercentage: true }}
text={{
title: replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.gm.title, { municipalityName: municipalityName }),
description: replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.gm.description, { municipalityName: municipalityName }),
Expand Down Expand Up @@ -242,7 +242,7 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) =>
)}
<VaccineCoverageChoropleth
data={archivedChoropleth.gm.vaccine_coverage_per_age_group_choropleth_archived_20231004}
dataOptions={{ getLink: reverseRouter.gm.vaccinaties, selectedCode: currentData.code, isPercentage: true }}
dataOptions={{ getLink: reverseRouter.gm.deCoronaprik, selectedCode: currentData.code, isPercentage: true }}
text={{
title: replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.gm.archived.title, { municipalityName: municipalityName }),
description: replaceVariablesInText(commonTexts.choropleth.choropleth_vaccination_coverage.gm.archived.description, { municipalityName: municipalityName }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) {

<VaccineCoverageChoropleth
data={archivedChoropleth.gm}
dataOptions={{ getLink: (gmcode) => 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,
Expand Down Expand Up @@ -365,7 +365,7 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) {

<VaccineCoverageChoropleth
data={archivedChoropleth.gm}
dataOptions={{ getLink: (gmcode) => 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,
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/utils/__tests__/use-reverse-router.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/cms/src/lokalize/key-mutations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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,__
4 changes: 2 additions & 2 deletions packages/common/src/data/reverse-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;

Expand Down

0 comments on commit f38f823

Please sign in to comment.