From d33d7db5edf084586476762f46a40d216fca9088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Tue, 5 Sep 2023 15:24:43 +0200 Subject: [PATCH] Update imports --- .../ChiffreAffairesActivitéMixte.tsx | 5 +--- site/source/components/EngineValue.tsx | 5 +--- site/source/components/Notifications.tsx | 2 +- site/source/components/References.tsx | 25 +++++++++++++----- site/source/components/RuleLink.tsx | 24 +++++++---------- .../components/SelectSimulationYear.tsx | 2 +- site/source/components/SimulateurWarning.tsx | 2 +- .../components/Simulation/SimulationGoal.tsx | 5 +--- site/source/components/StackedBarChart.tsx | 2 +- .../components/conversation/AnswerList.tsx | 2 +- .../components/conversation/Conversation.tsx | 10 +++---- .../components/conversation/Explicable.tsx | 2 +- .../conversation/MulipleChoicesInput.tsx | 2 +- .../components/conversation/RuleInput.tsx | 20 +++++++------- site/source/components/utils/BrowserOnly.tsx | 2 +- .../source/components/utils/EngineContext.tsx | 12 ++++----- .../utils/useSearchParamsSimulationSharing.ts | 10 +++---- site/source/hooks/useNextQuestion.tsx | 2 +- site/source/pages/Documentation.tsx | 26 ++++++++++++++----- site/source/pages/_landing/SearchOrCreate.tsx | 2 +- .../AnnuaireEntreprises.tsx | 2 +- site/source/pages/simulateurs/NextSteps.tsx | 2 +- .../components/Comparateur.tsx | 2 +- .../components/DetailsRowCards.tsx | 2 +- .../components/TableRow.tsx | 2 +- .../simulateurs/comparaison-statuts/utils.ts | 2 +- .../store/selectors/simulationSelectors.ts | 2 +- 27 files changed, 92 insertions(+), 84 deletions(-) diff --git a/site/source/components/ChiffreAffairesActivitéMixte.tsx b/site/source/components/ChiffreAffairesActivitéMixte.tsx index 8aa3926cf..57450f9c3 100644 --- a/site/source/components/ChiffreAffairesActivitéMixte.tsx +++ b/site/source/components/ChiffreAffairesActivitéMixte.tsx @@ -1,3 +1,4 @@ +import { useAsyncGetRule, useWorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import { PublicodesExpression, serializeEvaluation } from 'publicodes' import { useCallback } from 'react' @@ -11,10 +12,6 @@ import { batchUpdateSituation } from '@/store/actions/actions' import { situationSelector } from '@/store/selectors/simulationSelectors' import { ReplaceReturnType } from '@/types/utils' import { catchDivideByZeroError } from '@/utils' -import { - useAsyncGetRule, - useWorkerEngine, -} from '@/worker/workerEngineClientReact' import { ExplicableRule } from './conversation/Explicable' import { Condition, WhenApplicable } from './EngineValue' diff --git a/site/source/components/EngineValue.tsx b/site/source/components/EngineValue.tsx index 9a23d6815..6504adc05 100644 --- a/site/source/components/EngineValue.tsx +++ b/site/source/components/EngineValue.tsx @@ -1,3 +1,4 @@ +import { useAsyncParsedRules, useWorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import { ASTNode, @@ -11,10 +12,6 @@ import { useTranslation } from 'react-i18next' import { keyframes, styled } from 'styled-components' import { usePromise } from '@/hooks/usePromise' -import { - useAsyncParsedRules, - useWorkerEngine, -} from '@/worker/workerEngineClientReact' import RuleLink from './RuleLink' diff --git a/site/source/components/Notifications.tsx b/site/source/components/Notifications.tsx index 10f1426ba..ccca2db05 100644 --- a/site/source/components/Notifications.tsx +++ b/site/source/components/Notifications.tsx @@ -1,3 +1,4 @@ +import { useWorkerEngine, WorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import Engine, { RuleNode } from 'publicodes' import { useTranslation } from 'react-i18next' @@ -12,7 +13,6 @@ import { usePromise } from '@/hooks/usePromise' import { hideNotification } from '@/store/actions/actions' import { RootState } from '@/store/reducers/rootReducer' import { isNotNull } from '@/utils' -import { useWorkerEngine, WorkerEngine } from '@/worker/workerEngineClientReact' import { ExplicableRule } from './conversation/Explicable' import { Appear } from './ui/animate' diff --git a/site/source/components/References.tsx b/site/source/components/References.tsx index 8ad3a8861..be053d195 100644 --- a/site/source/components/References.tsx +++ b/site/source/components/References.tsx @@ -1,3 +1,4 @@ +import { useWorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import { utils } from 'publicodes' import { useContext } from 'react' @@ -17,7 +18,19 @@ export function References({ references?: Record dottedName?: DottedName | undefined }): JSX.Element | null { - const engine = useEngine() + return null + const workerEngine = useWorkerEngine() + const parentRefences = usePromise(async () => { + if (!dottedName && !references) { + return null + } + const parentRule = utils.ruleParent(dottedName as string) as DottedName + if (!parentRule) { + return null + } + + return (await workerEngine.asyncGetRule(parentRule)).rawNode.références + }, [dottedName, references, workerEngine]) if (!dottedName && !references) { return null @@ -34,11 +47,11 @@ export function References({ } // If no reference, check if parent has some that we could use - const parentRule = utils.ruleParent(dottedName as string) as DottedName - if (!parentRule) { - return null - } - const parentRefences = engine.getRule(parentRule).rawNode.références + // const parentRule = utils.ruleParent(dottedName as string) as DottedName + // if (!parentRule) { + // return null + // } + // const parentRefences = engine.getRule(parentRule).rawNode.références if (!parentRefences) { return null } diff --git a/site/source/components/RuleLink.tsx b/site/source/components/RuleLink.tsx index 1ac668a89..eada78fef 100644 --- a/site/source/components/RuleLink.tsx +++ b/site/source/components/RuleLink.tsx @@ -1,24 +1,21 @@ +import { useWorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import { RuleLink as EngineRuleLink } from 'publicodes-react' -import React, { ReactNode } from 'react' +import React from 'react' import { Link } from '@/design-system/typography/link' import { usePromise } from '@/hooks/usePromise' import { useSitePaths } from '@/sitePaths' -import { useWorkerEngine } from '@/worker/workerEngineClientReact' // TODO : quicklink -> en cas de variations ou de somme avec un seul élément actif, faire un lien vers cet élément export default function RuleLink( props: { dottedName: DottedName - displayIcon?: boolean children?: React.ReactNode documentationPath?: string - linkComponent?: ReactNode - engineId?: number } & Omit, 'to' | 'children'> ) { - const engineId = props.engineId ?? 0 + const { dottedName, documentationPath, ...linkProps } = props const { absoluteSitePaths } = useSitePaths() const [loading, setLoading] = React.useState(true) const [error, setError] = React.useState(false) @@ -29,26 +26,23 @@ export default function RuleLink( setError(false) return workerEngine - .asyncGetRule(props.dottedName) + .asyncGetRule(dottedName) .catch(() => setError(true)) .then(() => setLoading(false)) - }, [props.dottedName, workerEngine]) + }, [dottedName, workerEngine]) if (loading || error) { return null } - return <>EngineRuleLink - - // TODO : publicodes-react ne supporte pas encore les engines dans un worker return ( ) diff --git a/site/source/components/SelectSimulationYear.tsx b/site/source/components/SelectSimulationYear.tsx index 1a590fb79..69e7ab874 100644 --- a/site/source/components/SelectSimulationYear.tsx +++ b/site/source/components/SelectSimulationYear.tsx @@ -1,3 +1,4 @@ +import { useWorkerEngine } from '@publicodes/worker-react' import { Evaluation } from 'publicodes' import { Trans } from 'react-i18next' import { useDispatch } from 'react-redux' @@ -7,7 +8,6 @@ import Banner from '@/components/Banner' import { Link as DesignSystemLink } from '@/design-system/typography/link' import { usePromise } from '@/hooks/usePromise' import { updateSituation } from '@/store/actions/actions' -import { useWorkerEngine } from '@/worker/workerEngineClientReact' const Bold = styled.span<{ $bold: boolean }>` ${({ $bold }) => ($bold ? 'font-weight: bold;' : '')} diff --git a/site/source/components/SimulateurWarning.tsx b/site/source/components/SimulateurWarning.tsx index b93c6f16f..faeb4faf0 100644 --- a/site/source/components/SimulateurWarning.tsx +++ b/site/source/components/SimulateurWarning.tsx @@ -1,3 +1,4 @@ +import { useWorkerEngine } from '@publicodes/worker-react' import { Evaluation } from 'publicodes' import { Trans } from 'react-i18next' import { styled } from 'styled-components' @@ -8,7 +9,6 @@ import { Li, Ul } from '@/design-system/typography/list' import { Body } from '@/design-system/typography/paragraphs' import { usePromise } from '@/hooks/usePromise' import { AbsoluteSitePaths } from '@/sitePaths' -import { useWorkerEngine } from '@/worker/workerEngineClientReact' type SimulateurWarningProps = { simulateur: Exclude diff --git a/site/source/components/Simulation/SimulationGoal.tsx b/site/source/components/Simulation/SimulationGoal.tsx index da579ce37..c56476ab5 100644 --- a/site/source/components/Simulation/SimulationGoal.tsx +++ b/site/source/components/Simulation/SimulationGoal.tsx @@ -1,3 +1,4 @@ +import { useAsyncGetRule, useWorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import { formatValue, PublicodesExpression } from 'publicodes' import React, { useCallback, useState } from 'react' @@ -11,10 +12,6 @@ import { Body, SmallBody } from '@/design-system/typography/paragraphs' import { usePromise } from '@/hooks/usePromise' import { updateSituation } from '@/store/actions/actions' import { targetUnitSelector } from '@/store/selectors/simulationSelectors' -import { - useAsyncGetRule, - useWorkerEngine, -} from '@/worker/workerEngineClientReact' import { ExplicableRule } from '../conversation/Explicable' import RuleInput, { InputProps } from '../conversation/RuleInput' diff --git a/site/source/components/StackedBarChart.tsx b/site/source/components/StackedBarChart.tsx index da9abfea8..952381839 100755 --- a/site/source/components/StackedBarChart.tsx +++ b/site/source/components/StackedBarChart.tsx @@ -1,3 +1,4 @@ +import { useWorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import { EvaluatedNode } from 'publicodes' import React, { useContext } from 'react' @@ -10,7 +11,6 @@ import RuleLink from '@/components/RuleLink' import useDisplayOnIntersecting from '@/components/utils/useDisplayOnIntersecting' import { usePromise } from '@/hooks/usePromise' import { targetUnitSelector } from '@/store/selectors/simulationSelectors' -import { useWorkerEngine } from '@/worker/workerEngineClientReact' import { DisableAnimationContext } from './utils/DisableAnimationContext' diff --git a/site/source/components/conversation/AnswerList.tsx b/site/source/components/conversation/AnswerList.tsx index 070ab8878..d6f3d180c 100644 --- a/site/source/components/conversation/AnswerList.tsx +++ b/site/source/components/conversation/AnswerList.tsx @@ -1,3 +1,4 @@ +import { useWorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import { PublicodesExpression, RuleNode, utils } from 'publicodes' import { useCallback, useMemo } from 'react' @@ -25,7 +26,6 @@ import { companySituationSelector, situationSelector, } from '@/store/selectors/simulationSelectors' -import { useWorkerEngine } from '@/worker/workerEngineClientReact' import Value from '../EngineValue' import { JeDonneMonAvis } from '../JeDonneMonAvis' diff --git a/site/source/components/conversation/Conversation.tsx b/site/source/components/conversation/Conversation.tsx index e7f8e7c16..b62853de9 100644 --- a/site/source/components/conversation/Conversation.tsx +++ b/site/source/components/conversation/Conversation.tsx @@ -1,3 +1,8 @@ +import { + useAsyncGetRule, + useWorkerEngine, + WorkerEngine, +} from '@publicodes/worker-react' import { DottedName } from 'modele-social' import Engine, { PublicodesExpression, RuleNode } from 'publicodes' import React, { useCallback, useEffect, useState } from 'react' @@ -19,11 +24,6 @@ import { answeredQuestionsSelector, situationSelector, } from '@/store/selectors/simulationSelectors' -import { - useAsyncGetRule, - useWorkerEngine, - WorkerEngine, -} from '@/worker/workerEngineClientReact' import { TrackPage } from '../ATInternetTracking' import { JeDonneMonAvis } from '../JeDonneMonAvis' diff --git a/site/source/components/conversation/Explicable.tsx b/site/source/components/conversation/Explicable.tsx index a16d33d3f..3568e8d73 100644 --- a/site/source/components/conversation/Explicable.tsx +++ b/site/source/components/conversation/Explicable.tsx @@ -1,3 +1,4 @@ +import { useWorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import { useContext, useEffect } from 'react' @@ -7,7 +8,6 @@ import HelpButtonWithPopover from '@/design-system/buttons/HelpButtonWithPopover import { Spacing } from '@/design-system/layout' import { H3 } from '@/design-system/typography/heading' import { usePromise } from '@/hooks/usePromise' -import { useWorkerEngine } from '@/worker/workerEngineClientReact' import { References } from '../References' import RuleLink from '../RuleLink' diff --git a/site/source/components/conversation/MulipleChoicesInput.tsx b/site/source/components/conversation/MulipleChoicesInput.tsx index bbba95311..7151cd6dc 100644 --- a/site/source/components/conversation/MulipleChoicesInput.tsx +++ b/site/source/components/conversation/MulipleChoicesInput.tsx @@ -1,3 +1,4 @@ +import { useWorkerEngine, WorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import { PublicodesExpression, RuleNode } from 'publicodes' import { Fragment } from 'react' @@ -6,7 +7,6 @@ import { useTranslation } from 'react-i18next' import { Checkbox } from '@/design-system' import { Emoji } from '@/design-system/emoji' import { usePromise } from '@/hooks/usePromise' -import { useWorkerEngine, WorkerEngine } from '@/worker/workerEngineClientReact' import { ExplicableRule } from './Explicable' import { InputProps, RuleWithMultiplePossibilities } from './RuleInput' diff --git a/site/source/components/conversation/RuleInput.tsx b/site/source/components/conversation/RuleInput.tsx index 60cc3d9f4..21cb5b66c 100644 --- a/site/source/components/conversation/RuleInput.tsx +++ b/site/source/components/conversation/RuleInput.tsx @@ -1,3 +1,8 @@ +import { + useAsyncGetRule, + useWorkerEngine, + WorkerEngine, +} from '@publicodes/worker-react' import { DottedName } from 'modele-social' import { ASTNode, @@ -14,11 +19,6 @@ import SelectCommune from '@/components/conversation/select/SelectCommune' import { DateFieldProps } from '@/design-system/field/DateField' import { usePromise } from '@/hooks/usePromise' import { getMeta, isNotNull } from '@/utils' -import { - useAsyncGetRule, - useWorkerEngine, - WorkerEngine, -} from '@/worker/workerEngineClientReact' import { Choice, MultipleAnswerInput, OuiNonInput } from './ChoicesInput' import DateInput from './DateInput' @@ -100,10 +100,6 @@ export default function RuleInput({ const rule = useAsyncGetRule(dottedName) - useEffect(() => { - console.log('update', workerEngine.situationVersion) - }, [workerEngine.situationVersion]) - // const evaluation = engineValue.evaluate({ valeur: dottedName, ...modifiers }) // async const evaluation = usePromise( @@ -187,11 +183,13 @@ export default function RuleInput({ } if (rule.rawNode.API && rule.rawNode.API === 'commune') { - return ` commonProps.onChange({ batchUpdate: c })} value={value as Evaluation} - />` + /> + ) } if (rule.rawNode.API && rule.rawNode.API.startsWith('pays détachement')) { diff --git a/site/source/components/utils/BrowserOnly.tsx b/site/source/components/utils/BrowserOnly.tsx index 8064a8232..c97357e04 100644 --- a/site/source/components/utils/BrowserOnly.tsx +++ b/site/source/components/utils/BrowserOnly.tsx @@ -2,7 +2,7 @@ import React from 'react' import { Appear } from '@/components/ui/animate' -// We add a animation for all coponents displayed on the client only but not on +// We add a animation for all components displayed on the client only but not on // the SSR to avoid augment the CLS (Cumulative Layout Shift). export default function BrowserOnly({ children, diff --git a/site/source/components/utils/EngineContext.tsx b/site/source/components/utils/EngineContext.tsx index 1d3d51900..786daf885 100644 --- a/site/source/components/utils/EngineContext.tsx +++ b/site/source/components/utils/EngineContext.tsx @@ -1,3 +1,4 @@ +import { useWorkerEngine, WorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import Engine, { EvaluatedNode, @@ -6,7 +7,7 @@ import Engine, { Rule, RuleNode, } from 'publicodes' -import { createContext, useContext, useEffect, useMemo } from 'react' +import React, { createContext, useContext, useEffect, useMemo } from 'react' import { useDispatch, useSelector } from 'react-redux' import { deleteFromSituation } from '@/store/actions/actions' @@ -16,7 +17,6 @@ import { situationSelector, } from '@/store/selectors/simulationSelectors' import { omit } from '@/utils' -import { useWorkerEngine, WorkerEngine } from '@/worker/workerEngineClientReact' import i18n from '../../locales/i18n' @@ -158,13 +158,13 @@ export const useSetupSafeSituation = (workerEngine?: WorkerEngine) => { // const workerEngine = useWorkerEngine() const rawSituation = useRawSituation() - const simulatorSituation = useSelector(situationSelector) - const configSituation = useSelector(configSituationSelector) - const companySituation = useSelector(companySituationSelector) + // const simulatorSituation = useSelector(situationSelector) + // const configSituation = useSelector(configSituationSelector) + // const companySituation = useSelector(companySituationSelector) const { asyncSetSituation } = workerEngine ?? {} useEffect(() => { - if (!asyncSetSituation) { + if (!asyncSetSituation || Object.keys(rawSituation).length === 0) { return } console.log('set rawSituation', rawSituation, workerEngine) diff --git a/site/source/components/utils/useSearchParamsSimulationSharing.ts b/site/source/components/utils/useSearchParamsSimulationSharing.ts index c484d33e5..3a9604fc5 100644 --- a/site/source/components/utils/useSearchParamsSimulationSharing.ts +++ b/site/source/components/utils/useSearchParamsSimulationSharing.ts @@ -1,3 +1,8 @@ +import { + useAsyncParsedRules, + useWorkerEngine, + WorkerEngine, +} from '@publicodes/worker-react' import { DottedName } from 'modele-social' import { ParsedRules, serializeEvaluation } from 'publicodes' import { useEffect, useMemo, useState } from 'react' @@ -13,11 +18,6 @@ import { configObjectifsSelector, situationSelector, } from '@/store/selectors/simulationSelectors' -import { - useAsyncParsedRules, - useWorkerEngine, - WorkerEngine, -} from '@/worker/workerEngineClientReact' type ShortName = string // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents diff --git a/site/source/hooks/useNextQuestion.tsx b/site/source/hooks/useNextQuestion.tsx index cc5f96bcd..ad412e1ea 100644 --- a/site/source/hooks/useNextQuestion.tsx +++ b/site/source/hooks/useNextQuestion.tsx @@ -1,3 +1,4 @@ +import { useWorkerEngine, WorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import Engine, { RuleNode } from 'publicodes' import { useMemo } from 'react' @@ -10,7 +11,6 @@ import { useMissingVariables, } from '@/store/selectors/simulationSelectors' import { ImmutableType } from '@/types/utils' -import { useWorkerEngine, WorkerEngine } from '@/worker/workerEngineClientReact' import { usePromise } from './usePromise' diff --git a/site/source/pages/Documentation.tsx b/site/source/pages/Documentation.tsx index 64153c269..b2b0f7a9b 100644 --- a/site/source/pages/Documentation.tsx +++ b/site/source/pages/Documentation.tsx @@ -1,6 +1,7 @@ +import { useWorkerEngine, WorkerEngine } from '@publicodes/worker-react' import rules, { DottedName } from 'modele-social' import Engine from 'publicodes' -import { getDocumentationSiteMap, RulePage } from 'publicodes-react' +import { RulePage, useDocumentationSiteMap } from 'publicodes-react' import { ComponentProps, useMemo, useRef } from 'react' import { Helmet } from 'react-helmet-async' import { Trans, useTranslation } from 'react-i18next' @@ -38,20 +39,27 @@ export default function Documentation({ engine, }: { documentationPath: string - engine: Engine + engine: WorkerEngine }) { const { t } = useTranslation() const location = useLocation() const pathname = decodeURI(location?.pathname ?? '') - const documentationSitePaths = useMemo( - () => getDocumentationSiteMap({ engine, documentationPath }), - [engine, documentationPath] + const workerEngine = useWorkerEngine() + const documentationSitePaths = useDocumentationSiteMap( + workerEngine, + documentationPath ) + if (!documentationSitePaths) { + return <>documentationSitePaths loading... + } + return ( } /> - } /> + {IS_DEVELOPMENT && ( + } /> + )} theme.box.borderRadius}; + } ` type Renderers = ComponentProps['renderers'] @@ -117,7 +129,7 @@ function DocumentationPageBody({ engine, }: { documentationPath: string - engine: Engine + engine: WorkerEngine }) { const { absoluteSitePaths } = useSitePaths() const { i18n } = useTranslation() diff --git a/site/source/pages/_landing/SearchOrCreate.tsx b/site/source/pages/_landing/SearchOrCreate.tsx index 907228aa1..f2a699773 100644 --- a/site/source/pages/_landing/SearchOrCreate.tsx +++ b/site/source/pages/_landing/SearchOrCreate.tsx @@ -1,3 +1,4 @@ +import { useWorkerEngine } from '@publicodes/worker-react' import { useCallback, useEffect } from 'react' import { Trans, useTranslation } from 'react-i18next' import { useDispatch } from 'react-redux' @@ -22,7 +23,6 @@ import { useSetEntreprise } from '@/hooks/useSetEntreprise' import { useSitePaths } from '@/sitePaths' import { getCookieValue } from '@/storage/readCookie' import { resetCompany } from '@/store/actions/companyActions' -import { useWorkerEngine } from '@/worker/workerEngineClientReact' // import { RootState } from '@/store/reducers/rootReducer' diff --git a/site/source/pages/assistants/pour-mon-entreprise/AnnuaireEntreprises.tsx b/site/source/pages/assistants/pour-mon-entreprise/AnnuaireEntreprises.tsx index 5c73bf781..bd89f2c30 100644 --- a/site/source/pages/assistants/pour-mon-entreprise/AnnuaireEntreprises.tsx +++ b/site/source/pages/assistants/pour-mon-entreprise/AnnuaireEntreprises.tsx @@ -1,8 +1,8 @@ +import { useWorkerEngine } from '@publicodes/worker-react' import { useTranslation } from 'react-i18next' import { Article } from '@/design-system/card' import { usePromise } from '@/hooks/usePromise' -import { useWorkerEngine } from '@/worker/workerEngineClientReact' export function AnnuaireEntreprises() { const { t } = useTranslation() diff --git a/site/source/pages/simulateurs/NextSteps.tsx b/site/source/pages/simulateurs/NextSteps.tsx index ea43655ef..1359698a2 100644 --- a/site/source/pages/simulateurs/NextSteps.tsx +++ b/site/source/pages/simulateurs/NextSteps.tsx @@ -1,3 +1,4 @@ +import { useWorkerEngine } from '@publicodes/worker-react' import { Trans, useTranslation } from 'react-i18next' import { Condition, WhenAlreadyDefined } from '@/components/EngineValue' @@ -11,7 +12,6 @@ import { usePromise } from '@/hooks/usePromise' import { GuideURSSAFCard } from '@/pages/simulateurs/cards/GuideURSSAFCard' import { IframeIntegrationCard } from '@/pages/simulateurs/cards/IframeIntegrationCard' import { useSitePaths } from '@/sitePaths' -import { useWorkerEngine } from '@/worker/workerEngineClientReact' import { AnnuaireEntreprises } from '../assistants/pour-mon-entreprise/AnnuaireEntreprises' import { AutoEntrepreneurCard } from '../assistants/pour-mon-entreprise/AutoEntrepeneurCard' diff --git a/site/source/pages/simulateurs/comparaison-statuts/components/Comparateur.tsx b/site/source/pages/simulateurs/comparaison-statuts/components/Comparateur.tsx index 92442e112..4dff544a6 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/components/Comparateur.tsx +++ b/site/source/pages/simulateurs/comparaison-statuts/components/Comparateur.tsx @@ -1,7 +1,7 @@ +import { DottedName } from 'modele-social' import Engine from 'publicodes' import { useTranslation } from 'react-i18next' -import { DottedName } from '@/../../modele-social' import { EngineDocumentationRoutes } from '@/components/EngineDocumentationRoutes' import PeriodSwitch from '@/components/PeriodSwitch' import Simulation, { diff --git a/site/source/pages/simulateurs/comparaison-statuts/components/DetailsRowCards.tsx b/site/source/pages/simulateurs/comparaison-statuts/components/DetailsRowCards.tsx index 2d2d32b64..46cf1765a 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/components/DetailsRowCards.tsx +++ b/site/source/pages/simulateurs/comparaison-statuts/components/DetailsRowCards.tsx @@ -1,8 +1,8 @@ +import { DottedName } from 'modele-social' import Engine, { PublicodesExpression } from 'publicodes' import { ReactNode } from 'react' import { styled } from 'styled-components' -import { DottedName } from '@/../../modele-social' import Value, { Condition, WhenNotApplicable } from '@/components/EngineValue' import RuleLink from '@/components/RuleLink' import { HelpIcon } from '@/design-system/icons' diff --git a/site/source/pages/simulateurs/comparaison-statuts/components/TableRow.tsx b/site/source/pages/simulateurs/comparaison-statuts/components/TableRow.tsx index 6cfb44c02..1ddb023b1 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/components/TableRow.tsx +++ b/site/source/pages/simulateurs/comparaison-statuts/components/TableRow.tsx @@ -1,7 +1,7 @@ +import { DottedName } from 'modele-social' import Engine from 'publicodes' import { ComponentProps } from 'react' -import { DottedName } from '@/../../modele-social' import Value from '@/components/EngineValue' import { H3 } from '@/design-system/typography/heading' diff --git a/site/source/pages/simulateurs/comparaison-statuts/utils.ts b/site/source/pages/simulateurs/comparaison-statuts/utils.ts index c78d29307..547e984b7 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/utils.ts +++ b/site/source/pages/simulateurs/comparaison-statuts/utils.ts @@ -1,6 +1,6 @@ +import { DottedName } from 'modele-social' import Engine, { Evaluation } from 'publicodes' -import { DottedName } from '@/../../modele-social' import { StatutType } from '@/components/StatutTag' export type OptionType = { diff --git a/site/source/store/selectors/simulationSelectors.ts b/site/source/store/selectors/simulationSelectors.ts index 929b540b3..bde7b4d9e 100644 --- a/site/source/store/selectors/simulationSelectors.ts +++ b/site/source/store/selectors/simulationSelectors.ts @@ -1,3 +1,4 @@ +import { useWorkerEngine, WorkerEngine } from '@publicodes/worker-react' import { DottedName } from 'modele-social' import { utils } from 'publicodes' import { useSelector } from 'react-redux' @@ -6,7 +7,6 @@ import { createSelector } from 'reselect' import { usePromise } from '@/hooks/usePromise' // import { useEngine } from '@/components/utils/EngineContext' import { RootState, Situation } from '@/store/reducers/rootReducer' -import { useWorkerEngine, WorkerEngine } from '@/worker/workerEngineClientReact' export const configSelector = (state: RootState) => state.simulation?.config ?? {}