From bca4cee770251fcf3ba463af02d37dc203e244fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Mon, 7 Aug 2023 14:50:04 +0200 Subject: [PATCH] fix types --- .../mon-entreprise/assistants/choix-du-statut.ts | 6 ++++-- site/source/design-system/tag/index.tsx | 3 +++ site/source/hooks/useCurrentSimulatorData.ts | 2 -- site/source/pages/assistants/index.tsx | 13 +------------ .../pour-mon-entreprise/DemarcheEmbauche.tsx | 3 +-- .../components/ModifierOptions.tsx | 5 ----- .../comparaison-statuts/components/RevenuTable.tsx | 4 ---- site/source/pages/simulateurs/salarié/Salarié.tsx | 6 ------ site/source/pages/statistiques/useStatistiques.tsx | 7 +++++-- 9 files changed, 14 insertions(+), 35 deletions(-) diff --git a/site/cypress/integration/mon-entreprise/assistants/choix-du-statut.ts b/site/cypress/integration/mon-entreprise/assistants/choix-du-statut.ts index 4cc9bd607..8c9fa6e86 100644 --- a/site/cypress/integration/mon-entreprise/assistants/choix-du-statut.ts +++ b/site/cypress/integration/mon-entreprise/assistants/choix-du-statut.ts @@ -45,8 +45,10 @@ describe(`Assistant choix du statut`, { testIsolation: false }, function () { }) it('should allow to input remuneration and select appropriate statut', function () { - cy.get('#CA').click().type('50000') - cy.get('#charges').click().type('10000') + cy.get('#CA').click() + cy.type('50000') + cy.get('#charges').click() + cy.type('10000') checkA11Y() cy.contains('Enregistrer et continuer').not('[disabled]').click() diff --git a/site/source/design-system/tag/index.tsx b/site/source/design-system/tag/index.tsx index 090bafe3f..5f3c3f878 100644 --- a/site/source/design-system/tag/index.tsx +++ b/site/source/design-system/tag/index.tsx @@ -7,13 +7,16 @@ type SizeProps = SM | MD | LG type SizeKey = KeysOfUnion interface Color { + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents light: Colors | string + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents dark: Colors | string } interface TagProps { children?: React.ReactNode className?: string + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents color?: Colors | Color | string } diff --git a/site/source/hooks/useCurrentSimulatorData.ts b/site/source/hooks/useCurrentSimulatorData.ts index a8c3c66fe..377b6c16b 100644 --- a/site/source/hooks/useCurrentSimulatorData.ts +++ b/site/source/hooks/useCurrentSimulatorData.ts @@ -1,6 +1,5 @@ import { useLocation } from 'react-router-dom' -import { useIsEmbedded } from '@/hooks/useIsEmbedded' import { Merge, ToOptional } from '@/types/utils' import useSimulatorsData, { SimulatorDataValues } from './useSimulatorsData' @@ -12,7 +11,6 @@ export type MergedSimulatorDataValues = ToOptional> */ export const useCurrentSimulatorData = () => { const simulatorsData = useSimulatorsData() - const isEmbedded = useIsEmbedded() const pathname = decodeURI(useLocation().pathname) const entries = Object.entries(simulatorsData) diff --git a/site/source/pages/assistants/index.tsx b/site/source/pages/assistants/index.tsx index cccafd34e..b25ce679d 100644 --- a/site/source/pages/assistants/index.tsx +++ b/site/source/pages/assistants/index.tsx @@ -1,26 +1,15 @@ -import { Trans } from 'react-i18next' import { Navigate, Route, Routes, useLocation } from 'react-router-dom' import SimulateurOrAssistantPage from '@/components/SimulateurOrAssistantPage' import { ScrollToTop } from '@/components/utils/Scroll' -import { Link } from '@/design-system/typography/link' import useSimulatorsData from '@/hooks/useSimulatorsData' import { useSitePaths } from '@/sitePaths' export default function Assistants() { - const { relativeSitePaths, absoluteSitePaths } = useSitePaths() + const { absoluteSitePaths } = useSitePaths() const location = useLocation() const simulateurs = useSimulatorsData() - const back = ( - - Retour à mon activité - - ) - return ( <> diff --git a/site/source/pages/assistants/pour-mon-entreprise/DemarcheEmbauche.tsx b/site/source/pages/assistants/pour-mon-entreprise/DemarcheEmbauche.tsx index f85ea57ca..4a4f81460 100644 --- a/site/source/pages/assistants/pour-mon-entreprise/DemarcheEmbauche.tsx +++ b/site/source/pages/assistants/pour-mon-entreprise/DemarcheEmbauche.tsx @@ -1,11 +1,10 @@ import { Trans, useTranslation } from 'react-i18next' import { Article } from '@/design-system/card' -import { useSitePaths } from '@/sitePaths' // TODO: remove? export function DemarcheEmbaucheCard() { - const { absoluteSitePaths } = useSitePaths() + // const { absoluteSitePaths } = useSitePaths() const { t } = useTranslation() return ( diff --git a/site/source/pages/simulateurs/comparaison-statuts/components/ModifierOptions.tsx b/site/source/pages/simulateurs/comparaison-statuts/components/ModifierOptions.tsx index 627bb9bbc..0832e1076 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/components/ModifierOptions.tsx +++ b/site/source/pages/simulateurs/comparaison-statuts/components/ModifierOptions.tsx @@ -269,11 +269,6 @@ const ModifierOptions = ({ ) } -const Flex = styled.div` - display: flex; - align-items: baseline; -` - const FlexCentered = styled.div` display: flex; align-items: center; diff --git a/site/source/pages/simulateurs/comparaison-statuts/components/RevenuTable.tsx b/site/source/pages/simulateurs/comparaison-statuts/components/RevenuTable.tsx index 576fce5c0..407ac2dce 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/components/RevenuTable.tsx +++ b/site/source/pages/simulateurs/comparaison-statuts/components/RevenuTable.tsx @@ -283,7 +283,3 @@ const Minus = styled.span` color: ${({ theme }) => theme.colors.bases.secondary[500]}; margin-right: ${({ theme }) => theme.spacings.sm}; ` - -const StyledStrong = styled(Strong)` - font-family: ${({ theme }) => theme.fonts.main}; -` diff --git a/site/source/pages/simulateurs/salarié/Salarié.tsx b/site/source/pages/simulateurs/salarié/Salarié.tsx index d8aa63470..e7fdf9dfd 100644 --- a/site/source/pages/simulateurs/salarié/Salarié.tsx +++ b/site/source/pages/simulateurs/salarié/Salarié.tsx @@ -20,7 +20,6 @@ import SalaryExplanation from '@/components/simulationExplanation/SalaryExplanat import { FromTop } from '@/components/ui/animate' import BrowserOnly from '@/components/utils/BrowserOnly' import { useEngine } from '@/components/utils/EngineContext' -import { Button } from '@/design-system/buttons' import { Emoji } from '@/design-system/emoji' import { Strong } from '@/design-system/typography' import { H2 } from '@/design-system/typography/heading' @@ -33,11 +32,6 @@ import { targetUnitSelector } from '@/store/selectors/simulationSelectors' import urlIllustrationNetBrutEn from './illustration-net-brut-en.png' import urlIllustrationNetBrut from './illustration-net-brut.png' -const ButtonContainer = styled.span` - display: block; - margin: 2rem 1rem; -` - export default function SalariéSimulation() { const { absoluteSitePaths } = useSitePaths() diff --git a/site/source/pages/statistiques/useStatistiques.tsx b/site/source/pages/statistiques/useStatistiques.tsx index d4c8554d6..7f062600c 100644 --- a/site/source/pages/statistiques/useStatistiques.tsx +++ b/site/source/pages/statistiques/useStatistiques.tsx @@ -37,7 +37,10 @@ export function useStatistiques({ ) : null, })) } - if (typeof filter !== 'string' && filter.chapter2 === 'choix_du_statut') { + if ( + typeof filter !== 'string' && + filter.chapter2 === PageChapter2.ChoixDuStatut + ) { const pages = rawData.pages as Pageish[] return statsChoixStatut(pages) @@ -122,7 +125,7 @@ function filterPage( const statsChoixStatut = (pages: Pageish[]) => { const choixStatutPage = pages.filter( - (p) => p.page_chapter2 === 'choix_du_statut' + (p) => p.page_chapter2 === PageChapter2.ChoixDuStatut ) const accueil = groupBy( choixStatutPage.filter((p) => 'page' in p && p.page === 'accueil'),