fix types

pull/2787/head
Jérémy Rialland 2023-08-07 14:50:04 +02:00 committed by Jérémy Rialland
parent 478fa2b57b
commit bca4cee770
9 changed files with 14 additions and 35 deletions

View File

@ -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()

View File

@ -7,13 +7,16 @@ type SizeProps = SM | MD | LG
type SizeKey = KeysOfUnion<SizeProps>
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
}

View File

@ -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<Merge<SimulatorDataValues>>
*/
export const useCurrentSimulatorData = () => {
const simulatorsData = useSimulatorsData()
const isEmbedded = useIsEmbedded()
const pathname = decodeURI(useLocation().pathname)
const entries = Object.entries(simulatorsData)

View File

@ -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 = (
<Link
noUnderline
to={absoluteSitePaths.assistants['pour-mon-entreprise'].index}
>
<span aria-hidden></span> <Trans>Retour à mon activité</Trans>
</Link>
)
return (
<>
<ScrollToTop key={location.pathname} />

View File

@ -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 (

View File

@ -269,11 +269,6 @@ const ModifierOptions = ({
)
}
const Flex = styled.div`
display: flex;
align-items: baseline;
`
const FlexCentered = styled.div`
display: flex;
align-items: center;

View File

@ -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};
`

View File

@ -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()

View File

@ -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'),