diff --git a/docs/deleting-a-page-procedure.md b/docs/deleting-a-page-procedure.md new file mode 100644 index 0000000000..7118ca665e --- /dev/null +++ b/docs/deleting-a-page-procedure.md @@ -0,0 +1,28 @@ +# Deleting a page Procedure + +## For every file you delete do the following: +1. ### imports (if there are any) + Is the imported function/variable/type used elsewhere? + - Yes. only delete the import. + - No. Delete that file too. (Go recursively through the files meaning go to the first step of this list) +2. ### getStaticProps + - Delete the sanity lokalize keys in the nl_export.json + - Delete the JSON schema if the proto data is not used elsewhere. + - Delete the Sanity schema/structure if the imported sanity content is not used elsewhere. + +3. ### delete the page file. + - solve typescript errors + +4. ### follow up search for the page + - Look into the redirect.js file and remove/adjust the current or add redirects if needed. + - Look into the sitemap for references. + - Check the sidebar and layout files for references. + - Do an overall search for the page name: camelCased, and PascalCased. + +5. ### Do other checks + - ```yarn typecheck``` + - ```yarn bootstrap``` + - ```yarn build:app``` + - ```yarn start``` + +[Back to index](index.md) diff --git a/packages/app/src/components/table.ts b/packages/app/src/components/table.ts index b22e54764f..32369308c6 100644 --- a/packages/app/src/components/table.ts +++ b/packages/app/src/components/table.ts @@ -5,13 +5,11 @@ import { color, ColorProps, compose, - LayoutProps, margin, padding, position, PositionProps, space, - SpaceProps, verticalAlign, VerticalAlignProps, width, @@ -21,24 +19,11 @@ import { styledShouldForwardProp } from '~/lib/styled-should-forward-prop'; type TableProps = TableCellProps & PositionProps; -type TableCellProps = TableBodyProps & - WidthProps & - ColorProps & - BorderProps & - VerticalAlignProps; - -type TableBodyProps = SpaceProps & LayoutProps; +type TableCellProps = WidthProps & ColorProps & BorderProps & VerticalAlignProps; export const Table = styled.table.withConfig({ shouldForwardProp: styledShouldForwardProp, -})( - { borderCollapse: 'collapse', borderSpacing: 0, tableLayout: 'fixed' }, - compose(margin, padding, color, space, position) -); - -export const TableBody = styled.tbody.withConfig({ - shouldForwardProp: styledShouldForwardProp, -})(compose(margin, padding, space)); +})({ borderCollapse: 'collapse', borderSpacing: 0, tableLayout: 'fixed' }, compose(margin, padding, color, space, position)); export const Row = styled.tr.withConfig({ shouldForwardProp: styledShouldForwardProp, @@ -46,6 +31,4 @@ export const Row = styled.tr.withConfig({ export const Cell = styled.td.withConfig({ shouldForwardProp: styledShouldForwardProp, -})( - compose(margin, padding, color, space, border, verticalAlign, width) -); +})(compose(margin, padding, color, space, border, verticalAlign, width)); diff --git a/packages/app/src/domain/layout/logic/types.ts b/packages/app/src/domain/layout/logic/types.ts index b5218a87c0..5ae320cd55 100644 --- a/packages/app/src/domain/layout/logic/types.ts +++ b/packages/app/src/domain/layout/logic/types.ts @@ -11,7 +11,6 @@ export type VrItemKeys = | 'disabled_care' | 'elderly_at_home' | 'hospital_admissions' - | 'current_advices' | 'mortality' | 'nursing_home_care' | 'positive_tests' @@ -30,7 +29,6 @@ export type NlItemKeys = | 'hospitals_and_care' | 'patients' | 'infectious_people' - | 'current_advices' | 'mortality' | 'nursing_home_care' | 'positive_tests' diff --git a/packages/app/src/domain/layout/nl-layout.tsx b/packages/app/src/domain/layout/nl-layout.tsx index b71a859c01..ada788b9e1 100644 --- a/packages/app/src/domain/layout/nl-layout.tsx +++ b/packages/app/src/domain/layout/nl-layout.tsx @@ -39,7 +39,7 @@ export function NlLayout(props: NlLayoutProps) { map: [ ['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', 'current_advices', 'compliance']], + ['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/domain/layout/vr-layout.tsx b/packages/app/src/domain/layout/vr-layout.tsx index c190c9345c..2290240bef 100644 --- a/packages/app/src/domain/layout/vr-layout.tsx +++ b/packages/app/src/domain/layout/vr-layout.tsx @@ -63,7 +63,7 @@ export function VrLayout(props: VrLayoutProps) { map: [ ['development_of_the_virus', ['sewage_measurement', 'positive_tests', 'mortality']], ['consequences_for_healthcare', ['hospital_admissions', 'nursing_home_care']], - ['actions_to_take', ['vaccinations', 'current_advices']], + ['actions_to_take', ['vaccinations']], ['archived_metrics', ['disabled_care', 'elderly_at_home', 'compliance', 'source_investigation']], ], }); diff --git a/packages/app/src/domain/measures/measures-table.tsx b/packages/app/src/domain/measures/measures-table.tsx deleted file mode 100644 index 623ee68990..0000000000 --- a/packages/app/src/domain/measures/measures-table.tsx +++ /dev/null @@ -1,123 +0,0 @@ -import { css } from '@styled-system/css'; -import { Fragment } from 'react'; -import { Box } from '~/components/base'; -import { Cell, Row, Table, TableBody } from '~/components/table'; -import { BoldText } from '~/components/typography'; -import { space } from '~/style/theme'; -import { Measures } from '~/types/cms'; -import { useBreakpoints } from '~/utils/use-breakpoints'; -import DynamicIcon from '~/components/get-icon-by-name'; -import { IconName as MeasuresIcon } from '@corona-dashboard/icons/src/icon-name2filename'; -import { getFilenameToIconName } from '~/utils'; -import styled from 'styled-components'; -import { colors } from '@corona-dashboard/common'; -import { Dot } from '@corona-dashboard/icons'; - -interface MeasuresTableProps { - data: Measures; -} - -export function MeasuresTable(props: MeasuresTableProps) { - const { data } = props; - - const breakpoints = useBreakpoints(true); - - if (breakpoints.lg) { - return ; - } - - return ; -} - -const MobileMeasuresTable = (props: MeasuresTableProps) => { - const { data } = props; - - return ( - - - {data.measuresCollection.map((collection, index) => { - return ( - - - - {collection.title} - - - - - - {collection.measuresItems.map((measuresItem, index) => { - return ( - - {measuresItem.icon ? : } - - {measuresItem.title} - - ); - })} - - - - - ); - })} - -
- ); -}; - -const DesktopMeasuresTable = (props: MeasuresTableProps) => { - const { data } = props; - - return ( - - - {data.measuresCollection.map((collection, index) => { - return ( - - - {collection.title} - - - - {collection.measuresItems.map((measuresItem, index) => { - return ( - - {measuresItem.icon ? : } - - {measuresItem.title} - - - ); - })} - - - - ); - })} - -
- ); -}; - -const StyledIconWrapper = styled.span` - display: flex; - flex-shrink: 0; - margin-right: ${space[2]}; - width: 36px; - height: 36px; - align-items: center; - justify-content: center; - color: ${colors.blue8}; - svg { - height: ${space[4]}; - width: ${space[4]}; - } -`; diff --git a/packages/app/src/domain/measures/types.ts b/packages/app/src/domain/measures/types.ts deleted file mode 100644 index ae40da03a0..0000000000 --- a/packages/app/src/domain/measures/types.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Measures } from '~/types/cms'; - -export interface GeldendeAdviezenData { - measures: Measures; -} diff --git a/packages/app/src/next-config/redirects/redirects.js b/packages/app/src/next-config/redirects/redirects.js index 82b6aa81d7..b7458b77e2 100644 --- a/packages/app/src/next-config/redirects/redirects.js +++ b/packages/app/src/next-config/redirects/redirects.js @@ -42,11 +42,6 @@ async function redirects() { destination: '/images/touch-icon.png', permanent: false, }, - { - source: '/veiligheidsregio/:code/maatregelen', - destination: '/veiligheidsregio/:code/geldende-adviezen', - permanent: true, - }, { source: '/regio', destination: '/veiligheidsregio', @@ -96,11 +91,6 @@ async function redirects() { permanent: true, })), // Redirects for the NL pages - { - source: '/landelijk/maatregelen', - destination: '/landelijk/geldende-adviezen', - permanent: true, - }, { source: '/landelijk/ziekenhuis-opnames', destination: `/landelijk/ziekenhuizen-en-zorg`, @@ -127,6 +117,27 @@ async function redirects() { destination: '/artikelen', permanent: true, }, + // Redirects for removal of recommanded advices page - COR-1431 + { + source: '/veiligheidsregio/:code/maatregelen', + destination: '/', + permanent: true, + }, + { + source: '/landelijk/maatregelen', + destination: '/', + permanent: true, + }, + { + source: '/veiligheidsregio/:code/geldende-adviezen', + destination: '/', + permanent: true, + }, + { + source: '/landelijk/geldende-adviezen', + destination: '/', + permanent: true, + }, ]; } diff --git a/packages/app/src/pages/landelijk/geldende-adviezen.tsx b/packages/app/src/pages/landelijk/geldende-adviezen.tsx deleted file mode 100644 index 2fd03c5fea..0000000000 --- a/packages/app/src/pages/landelijk/geldende-adviezen.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { IconName as PageIcon } from '@corona-dashboard/icons/src/icon-name2filename'; -import { Box } from '~/components/base/box'; -import { RichContent } from '~/components/cms/rich-content'; -import { TileList } from '~/components/tile-list'; -import { Heading } from '~/components/typography'; -import { Header } from '~/components/page-information-block/components/header'; -import { Layout } from '~/domain/layout/layout'; -import { NlLayout } from '~/domain/layout/nl-layout'; -import { MeasuresTable } from '~/domain/measures/measures-table'; -import { Languages, SiteText } from '~/locale'; -import { createGetStaticProps, StaticProps } from '~/static-props/create-get-static-props'; -import { createGetContent, getLastGeneratedDate, getLokalizeTexts } from '~/static-props/get-data'; -import { useDynamicLokalizeTexts } from '~/utils/cms/use-dynamic-lokalize-texts'; -import { getFilenameToIconName } from '~/utils'; -import { useIntl } from '~/intl'; -import DynamicIcon from '~/components/get-icon-by-name'; -import { GeldendeAdviezenData } from '~/domain/measures/types'; - -const selectLokalizeTexts = (siteText: SiteText) => ({ - metadataTexts: siteText.pages.topical_page.nl.nationaal_metadata, - textNl: siteText.pages.measures_page.nl, -}); - -export const getStaticProps = createGetStaticProps( - ({ locale }: { locale: keyof Languages }) => getLokalizeTexts(selectLokalizeTexts, locale), - getLastGeneratedDate, - createGetContent((context) => { - const { locale } = context; - return ` - { - 'measures': *[ - _type == 'measures' && !(_id in path("drafts.**")) - ][0] { - icon, - 'measuresCollection': measuresCollection[]->{ - 'title': title.${locale}, - icon, - 'measuresItems': measuresItems[]->{ - 'title': title.${locale}, - icon - } - }, - 'title':title.${locale}, - 'description': description.${locale}, - 'collectionTitle': collectionTitle.${locale} - }, - }`; - }) -); - -const NationalRestrictions = (props: StaticProps) => { - const { pageText, content, lastGenerated } = props; - const { metadataTexts } = useDynamicLokalizeTexts(pageText, selectLokalizeTexts); - const { commonTexts } = useIntl(); - const { measures } = content; - - return ( - - - - -
} - title={measures.title} - category={commonTexts.sidebar.categories.actions_to_take.title} - /> - {measures.description && ( - - - - )} - - - {measures.collectionTitle} - - - - - - ); -}; - -export default NationalRestrictions; diff --git a/packages/app/src/pages/veiligheidsregio/[code]/geldende-adviezen.tsx b/packages/app/src/pages/veiligheidsregio/[code]/geldende-adviezen.tsx deleted file mode 100644 index 8a80555b88..0000000000 --- a/packages/app/src/pages/veiligheidsregio/[code]/geldende-adviezen.tsx +++ /dev/null @@ -1,119 +0,0 @@ -import { useRouter } from 'next/router'; -import { IconName as PageIcon } from '@corona-dashboard/icons/src/icon-name2filename'; -import { AnchorTile } from '~/components/anchor-tile'; -import { Box } from '~/components/base'; -import { RichContent } from '~/components/cms/rich-content'; -import { TileList } from '~/components/tile-list'; -import { Heading } from '~/components/typography'; -import { Header } from '~/components/page-information-block/components/header'; -import DynamicIcon from '~/components/get-icon-by-name'; -import { Layout } from '~/domain/layout/layout'; -import { VrLayout } from '~/domain/layout/vr-layout'; -import { MeasuresTable } from '~/domain/measures/measures-table'; -import { useIntl } from '~/intl'; -import { Languages, SiteText } from '~/locale'; -import { createGetStaticProps, StaticProps } from '~/static-props/create-get-static-props'; -import { createGetContent, getLastGeneratedDate, selectVrData, getLokalizeTexts } from '~/static-props/get-data'; -import { replaceVariablesInText } from '~/utils/replace-variables-in-text'; -import { useDynamicLokalizeTexts } from '~/utils/cms/use-dynamic-lokalize-texts'; -import { getFilenameToIconName } from '~/utils'; -import { GeldendeAdviezenData } from '~/domain/measures/types'; - -const selectLokalizeTexts = (siteText: SiteText) => ({ - textVr: siteText.pages.measures_page.vr, -}); - -export { getStaticPaths } from '~/static-paths/vr'; - -export const getStaticProps = createGetStaticProps( - ({ locale }: { locale: keyof Languages }) => getLokalizeTexts(selectLokalizeTexts, locale), - getLastGeneratedDate, - selectVrData(), - createGetContent((context) => { - const { locale } = context; - - return ` - { - 'measures': *[ - _type == 'measures' && !(_id in path("drafts.**")) - ][0] { - icon, - 'measuresCollection': measuresCollection[]->{ - 'title': title.${locale}, - icon, - 'measuresItems': measuresItems[]->{ - 'title': title.${locale}, - icon - } - }, - 'title':title.${locale}, - 'description': description.${locale}, - 'collectionTitle': collectionTitle.${locale} - }, - }`; - }) -); - -const RegionalRestrictions = (props: StaticProps) => { - const { pageText, content, vrName, lastGenerated } = props; - - const { commonTexts } = useIntl(); - const { textVr } = useDynamicLokalizeTexts(pageText, selectLokalizeTexts); - type VRCode = keyof typeof textVr.urls; - - const { measures } = content; - - const router = useRouter(); - const code = router.query.code as unknown as VRCode; - - const regioUrl = textVr.urls[code]; - - const metadata = { - ...commonTexts.veiligheidsregio_index.metadata, - title: replaceVariablesInText(textVr.metadata.title, { - safetyRegionName: vrName, - }), - description: replaceVariablesInText(textVr.metadata.title, { - safetyRegionName: vrName, - }), - }; - - return ( - - - - -
} - title={measures.title} - category={commonTexts.sidebar.categories.actions_to_take.title} - /> - {measures.description && ( - - - - )} - - - - {measures.collectionTitle} - - - - - {textVr.toelichting_aanvullendemaatregelen} - - - - - ); -}; - -export default RegionalRestrictions; diff --git a/packages/app/src/types/cms.d.ts b/packages/app/src/types/cms.d.ts index c59136b4cd..a44aeb9972 100644 --- a/packages/app/src/types/cms.d.ts +++ b/packages/app/src/types/cms.d.ts @@ -151,33 +151,6 @@ interface RichContentImageBlock extends ImageBlock { caption?: string; } -type MeasuresItems = { - icon?: string; - _key: string; - _type: 'measuresItems'; - title: string; -}; - -type MeasuresCollection = { - icon?: string; - title: string; - measuresItems: MeasuresItems[]; - _key: string; - _type: 'measuresCollection'; -}; - -export type Measures = { - _createdAt: string; - _id: string; - _rev: string; - _type: 'measures'; - _updatedAt: string; - icon: string; - title: string; - description: RichContentBlock[] | null; - collectionTitle: string; - measuresCollection: MeasuresCollection[]; -}; declare module 'picosanity' { type QueryParams = { [key: string]: unknown }; diff --git a/packages/cms/src/desk-structure.ts b/packages/cms/src/desk-structure.ts index b8b4310e7b..4f06ecf97b 100644 --- a/packages/cms/src/desk-structure.ts +++ b/packages/cms/src/desk-structure.ts @@ -1,5 +1,5 @@ import { StructureBuilder as S } from '@sanity/structure'; -import { BsCardChecklist, BsCardList, BsFillFileBarGraphFill, BsFillPuzzleFill, BsMap, BsHouseFill, BsThermometer, BsGearFill } from 'react-icons/bs'; +import { BsCardList, BsFillFileBarGraphFill, BsFillPuzzleFill, BsMap, BsHouseFill, BsThermometer, BsGearFill } from 'react-icons/bs'; import { GrCircleInformation } from 'react-icons/gr'; import { MdQuestionAnswer } from 'react-icons/md'; import { RiPagesFill } from 'react-icons/ri'; @@ -25,13 +25,9 @@ const hiddenDocTypes = [ 'faqQuestion', 'kpi', 'kpiConfiguration', - 'measures', 'lokalizeString', 'lokalizeSubject', 'lokalizeText', - 'measureTheme', - 'measureTile', - 'measureTileCollection', 'overDitDashboard', 'overRisicoNiveaus', 'overRisicoNiveausNew', @@ -71,7 +67,6 @@ export default () => pagePartListItem(), lokalizeListItem(), elementsListItem(), - addListItem(BsCardChecklist, 'Maatregelen', 'measures'), addListItem(GrCircleInformation, 'Over dit dashboard', 'overDitDashboard'), addListItem(BsMap, 'Over de risiconiveaus', 'overRisicoNiveausNew'), S.listItem() diff --git a/packages/cms/src/lokalize/key-mutations.csv b/packages/cms/src/lokalize/key-mutations.csv index a7c6419a8a..537636ae32 100644 --- a/packages/cms/src/lokalize/key-mutations.csv +++ b/packages/cms/src/lokalize/key-mutations.csv @@ -1 +1,32 @@ timestamp,action,key,document_id,move_to +2023-03-01T14:33:00.243Z,delete,pages.measures_page.nl.titel,jF33EuwumlGuwav2FD42bc,__ +2023-03-01T14:33:00.244Z,delete,pages.measures_page.vr.linktext_regionpage,jF33EuwumlGuwav2FD42qi,__ +2023-03-01T14:33:00.244Z,delete,pages.measures_page.vr.metadata.title,jF33EuwumlGuwav2FD42vk,__ +2023-03-01T14:33:00.244Z,delete,pages.measures_page.vr.titel,jF33EuwumlGuwav2FD42k0,__ +2023-03-01T14:33:00.244Z,delete,pages.measures_page.vr.titel_aanvullendemaatregelen,jF33EuwumlGuwav2FD42sO,__ +2023-03-01T14:33:00.244Z,delete,pages.measures_page.vr.toelichting_aanvullendemaatregelen,jF33EuwumlGuwav2FD42u4,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR01,jF33EuwumlGuwav2FD432S,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR02,jF33EuwumlGuwav2FD4348,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR03,jF33EuwumlGuwav2FD435o,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR04,jF33EuwumlGuwav2FD437U,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR05,jF33EuwumlGuwav2FD439A,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR06,jF33EuwumlGuwav2FD43Aq,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR07,jF33EuwumlGuwav2FD43CW,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR08,jF33EuwumlGuwav2FD43EC,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR09,jF33EuwumlGuwav2FD43Fs,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR10,jF33EuwumlGuwav2FD43HY,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR11,jF33EuwumlGuwav2FD43JE,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR12,jF33EuwumlGuwav2FD43Ku,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR13,jF33EuwumlGuwav2FD43Ma,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR14,jF33EuwumlGuwav2FD43OG,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR15,jF33EuwumlGuwav2FD43Pw,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR16,jF33EuwumlGuwav2FD43Rc,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR17,jF33EuwumlGuwav2FD43TI,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR18,jF33EuwumlGuwav2FD43Uy,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR19,jF33EuwumlGuwav2FD43We,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR20,jF33EuwumlGuwav2FD43YK,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR21,jF33EuwumlGuwav2FD43a0,__ +2023-03-01T14:33:00.245Z,delete,pages.measures_page.vr.urls.VR22,jF33EuwumlGuwav2FD43bg,__ +2023-03-01T14:33:00.246Z,delete,pages.measures_page.vr.urls.VR23,jF33EuwumlGuwav2FD43dM,__ +2023-03-01T14:33:00.246Z,delete,pages.measures_page.vr.urls.VR24,jF33EuwumlGuwav2FD43f2,__ +2023-03-01T14:33:00.246Z,delete,pages.measures_page.vr.urls.VR25,jF33EuwumlGuwav2FD43gi,__ diff --git a/packages/cms/src/schemas/measures/index.ts b/packages/cms/src/schemas/measures/index.ts deleted file mode 100644 index 6ab1ae9340..0000000000 --- a/packages/cms/src/schemas/measures/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './measures'; -export * from './measures-item'; -export * from './measures-collection'; diff --git a/packages/cms/src/schemas/measures/measures-collection.ts b/packages/cms/src/schemas/measures/measures-collection.ts deleted file mode 100644 index 8f509507e1..0000000000 --- a/packages/cms/src/schemas/measures/measures-collection.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { BsCollection } from 'react-icons/bs'; -import { KpiIconInput as MeasuresIconInput } from '../../components/portable-text/kpi-configuration/kpi-icon-input'; - -export const measuresCollection = { - title: 'Maatregelen groep', - name: 'measuresCollection', - type: 'document', - fields: [ - { - title: 'Maatregel groep', - description: 'Waar gaat deze maatregel groep over?', - name: 'title', - type: 'localeString', - }, - { - title: 'Icoon', - description: 'Welk icoon moet er naast de maatregelen groep staan?', - name: 'icon', - type: 'string', - inputComponent: MeasuresIconInput, - }, - { - title: 'Maatregel', - name: 'measuresItems', - type: 'array', - of: [{ type: 'reference', to: { type: 'measuresItem' } }], - }, - ], - preview: { - select: { - title: 'title.nl', - icon: 'icon', - }, - prepare(selection: { title: string }) { - const { title } = selection; - - return { - title: title, - media: BsCollection, - }; - }, - }, -}; diff --git a/packages/cms/src/schemas/measures/measures-item.ts b/packages/cms/src/schemas/measures/measures-item.ts deleted file mode 100644 index 3c20d4642e..0000000000 --- a/packages/cms/src/schemas/measures/measures-item.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { BsViewList } from 'react-icons/bs'; -import { KpiIconInput as MeasuresIconInput } from '../../components/portable-text/kpi-configuration/kpi-icon-input'; - -export const measuresItem = { - type: 'document', - title: 'Maatregel', - name: 'measuresItem', - fields: [ - { - title: 'Maatregel', - description: 'Beschrijf de maatregel voor deze categorie', - name: 'title', - type: 'localeString', - }, - { - title: 'Icoon', - description: 'Welk icoon moet er naast de maatregel staan?', - name: 'icon', - type: 'string', - inputComponent: MeasuresIconInput, - }, - ], - preview: { - select: { - title: 'title.nl', - icon: 'icon', - }, - prepare(selection: { title: string }) { - const { title } = selection; - - return { - title: title, - media: BsViewList, - }; - }, - }, -}; diff --git a/packages/cms/src/schemas/measures/measures.ts b/packages/cms/src/schemas/measures/measures.ts deleted file mode 100644 index 5f61c45788..0000000000 --- a/packages/cms/src/schemas/measures/measures.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { KpiIconInput as MeasuresIconInput } from '../../components/portable-text/kpi-configuration/kpi-icon-input'; -import { REQUIRED } from '../../validation'; - -export const measures = { - type: 'document', - title: 'Geldende adviezen', - name: 'measures', - fields: [ - { - title: 'Pagina icoon', - name: 'icon', - type: 'string', - inputComponent: MeasuresIconInput, - validation: REQUIRED, - }, - { - title: 'Titel van de pagina', - name: 'title', - type: 'localeString', - validation: REQUIRED, - }, - { - title: 'Omschrijving van de pagina', - name: 'description', - type: 'localeRichContentBlock', - }, - { - title: 'Titel van de groepen', - name: 'collectionTitle', - type: 'localeString', - validation: REQUIRED, - }, - { - title: 'Groepen', - description: 'De maatregelen zijn onderverdeeld in groepen', - name: 'measuresCollection', - type: 'array', - of: [{ type: 'reference', to: { type: 'measuresCollection' } }], - }, - ], -}; diff --git a/packages/cms/src/schemas/schema.ts b/packages/cms/src/schemas/schema.ts index fd8f2a57de..5ecab79dd2 100644 --- a/packages/cms/src/schemas/schema.ts +++ b/packages/cms/src/schemas/schema.ts @@ -9,7 +9,6 @@ import * as elements from '../elements/schemas'; import * as documents from './documents'; import * as locale from './locale'; import * as objects from './objects'; -import * as measures from './measures'; import * as topicalPageConfig from './topical'; // Then we give our schema to the builder and provide the result to Sanity @@ -18,12 +17,5 @@ export default createSchema({ name: 'default', // Then proceed to concatenate our document type // to the ones provided by any plugins that are installed - types: schemaTypes.concat( - ...Object.values(documents), - ...Object.values(measures), - ...Object.values(objects), - ...Object.values(locale), - ...Object.values(elements), - ...Object.values(topicalPageConfig) - ), + types: schemaTypes.concat(...Object.values(documents), ...Object.values(objects), ...Object.values(locale), ...Object.values(elements), ...Object.values(topicalPageConfig)), }); diff --git a/packages/common/src/data/reverse-router.ts b/packages/common/src/data/reverse-router.ts index 624b7cb967..9a8070599e 100644 --- a/packages/common/src/data/reverse-router.ts +++ b/packages/common/src/data/reverse-router.ts @@ -31,7 +31,6 @@ export function getReverseRouter(isMobile: boolean) { rioolwater: () => `/landelijk/rioolwater`, verdenkingenHuisartsen: () => `/landelijk/verdenkingen-huisartsen`, gedrag: () => `/landelijk/gedrag`, - geldendeAdviezen: () => `/landelijk/geldende-adviezen`, coronamelder: () => `/landelijk/coronamelder`, brononderzoek: () => `/landelijk/brononderzoek`, varianten: () => `/landelijk/varianten`, @@ -39,7 +38,6 @@ export function getReverseRouter(isMobile: boolean) { vr: { index: (code?: string) => (code ? (isMobile ? `/veiligheidsregio/${code}` : reverseRouter.vr.rioolwater(code)) : '/veiligheidsregio'), - geldendeAdviezen: (code: string) => `/veiligheidsregio/${code}/geldende-adviezen`, vaccinaties: (code: string) => `/veiligheidsregio/${code}/vaccinaties`, positiefGetesteMensen: (code: string) => `/veiligheidsregio/${code}/positief-geteste-mensen`, sterfte: (code: string) => `/veiligheidsregio/${code}/sterfte`,