From 2c8afdbb93f9473578ced1f567d94ae7f9563148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Thu, 2 Mar 2023 15:29:29 +0100 Subject: [PATCH] =?UTF-8?q?Transform=20and=20refacto=20cr=C3=A9er=20to=20a?= =?UTF-8?q?ssistants/choix-du-statut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/prerender.ts | 2 +- site/source/components/App.tsx | 5 - .../components/layout/Footer/useFeedback.ts | 2 +- site/source/pages/Creer/index.tsx | 41 -------- site/source/pages/Landing/SearchOrCreate.tsx | 6 +- site/source/pages/Plan.tsx | 15 ++- site/source/pages/Simulateurs/NextSteps.tsx | 3 +- site/source/pages/Simulateurs/index.tsx | 5 +- site/source/pages/Simulateurs/metadata-src.ts | 6 +- .../économie-collaborative/VotreSituation.tsx | 5 +- .../choix-du-statut}/AfterRegistration.tsx | 5 +- .../choix-du-statut}/CreationChecklist.tsx | 4 +- .../GuideStatut/AutoEntrepreneur.tsx | 0 .../GuideStatut/DirectorStatus.tsx | 0 .../GuideStatut/MinorityDirector.tsx | 0 .../GuideStatut/NumberOfAssociate.tsx | 0 .../GuideStatut/PickLegalStatus.tsx | 6 +- .../GuideStatut/PreviousAnswers.tsx | 2 +- .../GuideStatut/SoleProprietorship.tsx | 0 .../choix-du-statut}/GuideStatut/index.tsx | 41 ++++++-- .../choix-du-statut}/StatutDescription.tsx | 0 .../choix-statut-juridique}/config.ts | 25 +++-- .../choix-statut-juridique}/créer.svg | 0 .../choix-statut-juridique/index.tsx} | 13 ++- .../assistants/choix-du-statut/index.tsx | 41 ++++++++ .../choix-du-statut}/siret.jpg | Bin site/source/pages/assistants/index.tsx | 88 ++++++++++-------- site/source/sitePaths.ts | 84 ++++++++--------- .../store/selectors/companyStatusSelectors.ts | 6 +- 29 files changed, 233 insertions(+), 172 deletions(-) delete mode 100644 site/source/pages/Creer/index.tsx rename site/source/pages/{Creer => assistants/choix-du-statut}/AfterRegistration.tsx (97%) rename site/source/pages/{Creer => assistants/choix-du-statut}/CreationChecklist.tsx (99%) rename site/source/pages/{Creer => assistants/choix-du-statut}/GuideStatut/AutoEntrepreneur.tsx (100%) rename site/source/pages/{Creer => assistants/choix-du-statut}/GuideStatut/DirectorStatus.tsx (100%) rename site/source/pages/{Creer => assistants/choix-du-statut}/GuideStatut/MinorityDirector.tsx (100%) rename site/source/pages/{Creer => assistants/choix-du-statut}/GuideStatut/NumberOfAssociate.tsx (100%) rename site/source/pages/{Creer => assistants/choix-du-statut}/GuideStatut/PickLegalStatus.tsx (97%) rename site/source/pages/{Creer => assistants/choix-du-statut}/GuideStatut/PreviousAnswers.tsx (97%) rename site/source/pages/{Creer => assistants/choix-du-statut}/GuideStatut/SoleProprietorship.tsx (100%) rename site/source/pages/{Creer => assistants/choix-du-statut}/GuideStatut/index.tsx (73%) rename site/source/pages/{Creer => assistants/choix-du-statut}/StatutDescription.tsx (100%) rename site/source/pages/{Creer/choix-statut => assistants/choix-du-statut/choix-statut-juridique}/config.ts (54%) rename site/source/pages/{Creer/choix-statut => assistants/choix-du-statut/choix-statut-juridique}/créer.svg (100%) rename site/source/pages/{Creer/choix-statut/Home.tsx => assistants/choix-du-statut/choix-statut-juridique/index.tsx} (90%) create mode 100644 site/source/pages/assistants/choix-du-statut/index.tsx rename site/source/pages/{Creer => assistants/choix-du-statut}/siret.jpg (100%) diff --git a/site/prerender.ts b/site/prerender.ts index 33c40c4ae..d26a07dc7 100644 --- a/site/prerender.ts +++ b/site/prerender.ts @@ -17,7 +17,7 @@ export const pagesToPrerender: { } = { 'mon-entreprise': [ sitePathFr.index, - sitePathFr.créer.index, + sitePathFr.assistants['choix-du-statut'].index, sitePathFr.simulateurs.index, sitePathFr.simulateurs.salarié, sitePathFr.simulateurs['chômage-partiel'], diff --git a/site/source/components/App.tsx b/site/source/components/App.tsx index 378957bdd..b8cc1f9d3 100644 --- a/site/source/components/App.tsx +++ b/site/source/components/App.tsx @@ -23,7 +23,6 @@ import { useIsEmbedded } from '@/hooks/useIsEmbedded' import { useSaveAndRestoreScrollPosition } from '@/hooks/useSaveAndRestoreScrollPosition' import Accessibilité from '@/pages/Accessibilité' import Budget from '@/pages/Budget/Budget' -import Créer from '@/pages/Creer' import IntegrationTest from '@/pages/Dev/IntegrationTest' import Documentation from '@/pages/Documentation' import Iframes from '@/pages/Iframes' @@ -166,10 +165,6 @@ const App = () => { - } - /> } diff --git a/site/source/components/layout/Footer/useFeedback.ts b/site/source/components/layout/Footer/useFeedback.ts index 2a0a7db96..f26b374f2 100644 --- a/site/source/components/layout/Footer/useFeedback.ts +++ b/site/source/components/layout/Footer/useFeedback.ts @@ -30,7 +30,7 @@ export const useFeedback = () => { ![ absoluteSitePaths.documentation.index, absoluteSitePaths.assistants.index, - absoluteSitePaths.créer.index, + absoluteSitePaths.assistants['choix-du-statut'].index, absoluteSitePaths.nouveautés, absoluteSitePaths.stats, absoluteSitePaths.développeur.index, diff --git a/site/source/pages/Creer/index.tsx b/site/source/pages/Creer/index.tsx deleted file mode 100644 index 59cc5e20e..000000000 --- a/site/source/pages/Creer/index.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { Route, Routes, useLocation } from 'react-router-dom' - -import { TrackChapter } from '@/components/ATInternetTracking' -import { ScrollToTop } from '@/components/utils/Scroll' - -import { LANDING_LEGAL_STATUS_LIST, useSitePaths } from '../../sitePaths' -import AfterRegistration from './AfterRegistration' -import CreationChecklist from './CreationChecklist' -import GuideStatut from './GuideStatut' -import Home from './choix-statut/Home' - -export default function CreateMyCompany() { - const { relativeSitePaths } = useSitePaths() - const location = useLocation() - - return ( - <> - - - - } /> - {LANDING_LEGAL_STATUS_LIST.map((statut) => ( - } - /> - ))} - } - /> - } - /> - - - - ) -} diff --git a/site/source/pages/Landing/SearchOrCreate.tsx b/site/source/pages/Landing/SearchOrCreate.tsx index 41da08f4c..2aa8391d2 100644 --- a/site/source/pages/Landing/SearchOrCreate.tsx +++ b/site/source/pages/Landing/SearchOrCreate.tsx @@ -99,8 +99,10 @@ export default function SearchOrCreate() { role="link" to={ statutChoisi - ? absoluteSitePaths.créer[statutChoisi] - : absoluteSitePaths.créer.index + ? absoluteSitePaths.assistants['choix-du-statut'][ + statutChoisi + ] + : absoluteSitePaths.assistants['choix-du-statut'].index } aria-label={t( 'landing.choice.create.aria-label', diff --git a/site/source/pages/Plan.tsx b/site/source/pages/Plan.tsx index c1a215ed9..0e4fbb21f 100644 --- a/site/source/pages/Plan.tsx +++ b/site/source/pages/Plan.tsx @@ -40,7 +40,9 @@ export default function Plan() {
  • - + Créer une entreprise

    @@ -48,14 +50,21 @@ export default function Plan() {
    • - + Après la création

    • - + Choix du statut juridique

      diff --git a/site/source/pages/Simulateurs/NextSteps.tsx b/site/source/pages/Simulateurs/NextSteps.tsx index 4e7df4c22..128c6e91e 100644 --- a/site/source/pages/Simulateurs/NextSteps.tsx +++ b/site/source/pages/Simulateurs/NextSteps.tsx @@ -5,12 +5,13 @@ import { useEngine } from '@/components/utils/EngineContext' import { Grid } from '@/design-system/layout' import { H2 } from '@/design-system/typography/heading' import { MergedSimulatorDataValues } from '@/hooks/useCurrentSimulatorData' -import { FAQAutoEntrepreneurArticle } from '@/pages/Creer/CreationChecklist' import { GuideURSSAFCard } from '@/pages/Simulateurs/cards/GuideURSSAFCard' import { IframeIntegrationCard } from '@/pages/Simulateurs/cards/IframeIntegrationCard' import { SimulatorRessourceCard } from '@/pages/Simulateurs/cards/SimulatorRessourceCard' import { useSitePaths } from '@/sitePaths' +import { FAQAutoEntrepreneurArticle } from '../assistants/choix-du-statut/CreationChecklist' + interface NextStepsProps { iframePath?: MergedSimulatorDataValues['iframePath'] nextSteps: MergedSimulatorDataValues['nextSteps'] diff --git a/site/source/pages/Simulateurs/index.tsx b/site/source/pages/Simulateurs/index.tsx index 60dc62dc1..3c981c6e8 100644 --- a/site/source/pages/Simulateurs/index.tsx +++ b/site/source/pages/Simulateurs/index.tsx @@ -60,7 +60,10 @@ export default function Simulateurs() { Retour à mon activité ) : lastState?.fromCréer ? ( - + Retour à la création ) : !isEmbedded ? ( diff --git a/site/source/pages/Simulateurs/metadata-src.ts b/site/source/pages/Simulateurs/metadata-src.ts index b3a8334f0..139a9cf00 100644 --- a/site/source/pages/Simulateurs/metadata-src.ts +++ b/site/source/pages/Simulateurs/metadata-src.ts @@ -1,6 +1,6 @@ import { ImmutableType } from '@/types/utils' -import { choixStatutConfig } from '../Creer/choix-statut/config' +import { choixStatutJuridiqueConfig } from '../assistants/choix-du-statut/choix-statut-juridique/config' import { déclarationChargesSocialesIndépendantConfig } from '../assistants/declaration-charges-sociales-independant/config' import { déclarationRevenuIndépendantBetaConfig } from '../assistants/declaration-revenu-independants/config' import { demandeMobilitéConfig } from '../assistants/demande-mobilité/config' @@ -51,7 +51,6 @@ const getMetadataSrc = (params: SimulatorsDataParams) => { ...chômagePartielConfig(params), ...comparaisonStatutsConfig(params), ...économieCollaborativeConfig(params), - ...choixStatutConfig(params), ...pharmacienConfig(params), ...médecinConfig(params), ...chirurgienDentisteConfig(params), @@ -67,11 +66,12 @@ const getMetadataSrc = (params: SimulatorsDataParams) => { ...cipavConfig(params), // assistants: + ...choixStatutJuridiqueConfig(params), ...déclarationChargesSocialesIndépendantConfig(params), ...déclarationRevenuIndépendantBetaConfig(params), ...demandeMobilitéConfig(params), - ...rechercheCodeApeConfig(params), ...pourMonEntrepriseConfig(params), + ...rechercheCodeApeConfig(params), } as const return data satisfies ImmutableType> diff --git a/site/source/pages/Simulateurs/économie-collaborative/VotreSituation.tsx b/site/source/pages/Simulateurs/économie-collaborative/VotreSituation.tsx index fbb39f0cb..c322e8811 100644 --- a/site/source/pages/Simulateurs/économie-collaborative/VotreSituation.tsx +++ b/site/source/pages/Simulateurs/économie-collaborative/VotreSituation.tsx @@ -82,7 +82,10 @@ export default function VotreSituation() { concernées (et le changer si besoin). Sinon, vous aurez à créer une nouvelle entreprise. - diff --git a/site/source/pages/Creer/AfterRegistration.tsx b/site/source/pages/assistants/choix-du-statut/AfterRegistration.tsx similarity index 97% rename from site/source/pages/Creer/AfterRegistration.tsx rename to site/source/pages/assistants/choix-du-statut/AfterRegistration.tsx index a94ebf46d..c47171c9a 100644 --- a/site/source/pages/Creer/AfterRegistration.tsx +++ b/site/source/pages/assistants/choix-du-statut/AfterRegistration.tsx @@ -28,7 +28,10 @@ export default function AfterRegistration() { - + Retour à la création

      diff --git a/site/source/pages/Creer/CreationChecklist.tsx b/site/source/pages/assistants/choix-du-statut/CreationChecklist.tsx similarity index 99% rename from site/source/pages/Creer/CreationChecklist.tsx rename to site/source/pages/assistants/choix-du-statut/CreationChecklist.tsx index 0bb721056..4eb076301 100644 --- a/site/source/pages/Creer/CreationChecklist.tsx +++ b/site/source/pages/assistants/choix-du-statut/CreationChecklist.tsx @@ -76,7 +76,7 @@ export default function CreateCompany({ statut }: CreateCompanyProps) { { dispatch(resetCompanyStatusChoice()) }} @@ -547,7 +547,7 @@ export default function CreateCompany({ statut }: CreateCompanyProps) {

      } - to={absoluteSitePaths.créer.après} + to={absoluteSitePaths.assistants['choix-du-statut'].après} ctaLabel={t('entreprise.ressources.après.cta', 'Voir le glossaire')} > diff --git a/site/source/pages/Creer/GuideStatut/AutoEntrepreneur.tsx b/site/source/pages/assistants/choix-du-statut/GuideStatut/AutoEntrepreneur.tsx similarity index 100% rename from site/source/pages/Creer/GuideStatut/AutoEntrepreneur.tsx rename to site/source/pages/assistants/choix-du-statut/GuideStatut/AutoEntrepreneur.tsx diff --git a/site/source/pages/Creer/GuideStatut/DirectorStatus.tsx b/site/source/pages/assistants/choix-du-statut/GuideStatut/DirectorStatus.tsx similarity index 100% rename from site/source/pages/Creer/GuideStatut/DirectorStatus.tsx rename to site/source/pages/assistants/choix-du-statut/GuideStatut/DirectorStatus.tsx diff --git a/site/source/pages/Creer/GuideStatut/MinorityDirector.tsx b/site/source/pages/assistants/choix-du-statut/GuideStatut/MinorityDirector.tsx similarity index 100% rename from site/source/pages/Creer/GuideStatut/MinorityDirector.tsx rename to site/source/pages/assistants/choix-du-statut/GuideStatut/MinorityDirector.tsx diff --git a/site/source/pages/Creer/GuideStatut/NumberOfAssociate.tsx b/site/source/pages/assistants/choix-du-statut/GuideStatut/NumberOfAssociate.tsx similarity index 100% rename from site/source/pages/Creer/GuideStatut/NumberOfAssociate.tsx rename to site/source/pages/assistants/choix-du-statut/GuideStatut/NumberOfAssociate.tsx diff --git a/site/source/pages/Creer/GuideStatut/PickLegalStatus.tsx b/site/source/pages/assistants/choix-du-statut/GuideStatut/PickLegalStatus.tsx similarity index 97% rename from site/source/pages/Creer/GuideStatut/PickLegalStatus.tsx rename to site/source/pages/assistants/choix-du-statut/GuideStatut/PickLegalStatus.tsx index d8e4b737b..6b09c1787 100644 --- a/site/source/pages/Creer/GuideStatut/PickLegalStatus.tsx +++ b/site/source/pages/assistants/choix-du-statut/GuideStatut/PickLegalStatus.tsx @@ -24,7 +24,11 @@ const StatutButton = ({ statut }: StatutButtonProps) => { const { t } = useTranslation() return ( -