From 2e5f7db0418058754c55a5afc10826c6cfaf0ad4 Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Thu, 21 Apr 2022 15:21:55 +0200 Subject: [PATCH] Change le style de la question imposition en dehors du toggle au dessus des simulateurs --- modele-social/règles/entreprise/imposition.yaml | 2 -- site/source/components/company/Details.tsx | 7 ++++++- site/source/components/conversation/RuleInput.tsx | 10 ++++++---- site/source/pages/Simulateurs/Indépendant.tsx | 5 +++-- .../declaration-charges-sociales-independant/index.tsx | 3 --- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/modele-social/règles/entreprise/imposition.yaml b/modele-social/règles/entreprise/imposition.yaml index 67ef9caaa..8549eb8b7 100644 --- a/modele-social/règles/entreprise/imposition.yaml +++ b/modele-social/règles/entreprise/imposition.yaml @@ -13,8 +13,6 @@ entreprise . imposition: - catégorie juridique . EI alors: "'IR'" - sinon: "'IS'" - meta: - affichage: toggle entreprise . imposition . IR: valeur: imposition = 'IR' diff --git a/site/source/components/company/Details.tsx b/site/source/components/company/Details.tsx index 305c5c6ec..41eec8f81 100644 --- a/site/source/components/company/Details.tsx +++ b/site/source/components/company/Details.tsx @@ -16,7 +16,12 @@ export function CompanyDetails({ }) { return ( - +

{' '} diff --git a/site/source/components/conversation/RuleInput.tsx b/site/source/components/conversation/RuleInput.tsx index 369fffc70..8f72dd72f 100644 --- a/site/source/components/conversation/RuleInput.tsx +++ b/site/source/components/conversation/RuleInput.tsx @@ -40,7 +40,7 @@ type Props = Omit< // cf .https://github.com/betagouv/mon-entreprise/issues/1489#issuecomment-823058710 showDefaultDateValue?: boolean onSubmit?: (source: string) => void - + type?: 'radio' | 'card' | 'toggle' | 'select' formatOptions?: Intl.NumberFormatOptions displayedUnit?: string modifiers?: Record @@ -73,6 +73,7 @@ export default function RuleInput({ onSubmit = () => null, showDefaultDateValue = false, missing, + type, modifiers = {}, ...props }: Props) { @@ -99,9 +100,10 @@ export default function RuleInput({ const meta = getMeta<{ affichage?: string }>(rule.rawNode, {}) if (getVariant(engine.getRule(dottedName))) { - const type = - meta.affichage && - ['radio', 'card', 'toggle', 'select'].includes(meta.affichage) + type = + type ?? + (meta.affichage && + ['radio', 'card', 'toggle', 'select'].includes(meta.affichage)) ? (meta.affichage as 'radio' | 'card' | 'toggle' | 'select') : 'radio' diff --git a/site/source/pages/Simulateurs/Indépendant.tsx b/site/source/pages/Simulateurs/Indépendant.tsx index d204826b8..7892854db 100644 --- a/site/source/pages/Simulateurs/Indépendant.tsx +++ b/site/source/pages/Simulateurs/Indépendant.tsx @@ -1,7 +1,9 @@ import { updateSituation } from '@/actions/actions' import ChiffreAffairesActivitéMixte from '@/components/ChiffreAffairesActivitéMixte' +import RuleInput from '@/components/conversation/RuleInput' import { Condition } from '@/components/EngineValue' import PeriodSwitch from '@/components/PeriodSwitch' +import { SelectSimulationYear } from '@/components/SelectSimulationYear' import SimulateurWarning from '@/components/SimulateurWarning' import Simulation, { SimulationGoal, @@ -9,8 +11,6 @@ import Simulation, { } from '@/components/Simulation' import IndépendantExplanation from '@/components/simulationExplanation/IndépendantExplanation' import { useDispatch } from 'react-redux' -import { SelectSimulationYear } from '@/components/SelectSimulationYear' -import RuleInput from '@/components/conversation/RuleInput' export function IndépendantPLSimulation() { return ( @@ -55,6 +55,7 @@ export default function IndépendantSimulation() { toggles={ <> { dispatch( diff --git a/site/source/pages/gerer/declaration-charges-sociales-independant/index.tsx b/site/source/pages/gerer/declaration-charges-sociales-independant/index.tsx index 2bf088735..d2dffc36e 100644 --- a/site/source/pages/gerer/declaration-charges-sociales-independant/index.tsx +++ b/site/source/pages/gerer/declaration-charges-sociales-independant/index.tsx @@ -2,10 +2,8 @@ import { updateSituation } from '@/actions/actions' import RuleInput from '@/components/conversation/RuleInput' import { Condition, WhenAlreadyDefined } from '@/components/EngineValue' import PageHeader from '@/components/PageHeader' -import PreviousSimulationBanner from '@/components/PreviousSimulationBanner' import { FromTop } from '@/components/ui/animate' import Warning from '@/components/ui/WarningBlock' -import { useEngine } from '@/components/utils/EngineContext' import { SitePathsContext } from '@/components/utils/SitePathsContext' import useSimulationConfig from '@/components/utils/useSimulationConfig' import { Strong } from '@/design-system/typography' @@ -71,7 +69,6 @@ export default function AideDéclarationIndépendant() {
  • Votre entreprise est domiciliée dans les DOM
  • -

    Imposition