From 40afff1dd28e1c8951cac81da34ab44e5e1d1b73 Mon Sep 17 00:00:00 2001 From: Xavier Jp Date: Fri, 26 Apr 2024 11:43:05 +0200 Subject: [PATCH] 1019 (#1022) * content: idcc and banner update * chore: migration dirigeants and elus * refactor: use date fermeture * style: smaller info banner * chore: update footer --- .../dirigeants/[slug]/page.tsx | 66 +++++++++ .../_component/sections}/beneficiaires.tsx | 2 + .../dirigeants/_component/sections/index.tsx | 45 ++++++ .../sections}/is-personne-morale.ts | 0 .../sections}/responsables-service-public.tsx | 0 .../_component/sections}/rne-dirigeants.tsx | 2 + .../_component/sections}/summary.tsx | 0 app/(header-default)/elus/[slug]/page.tsx | 63 +++++++++ .../elus/_component/section}/elus-section.tsx | 53 +++---- .../[slug]/_components/summary.tsx | 4 +- clients/sirene-insee/siren.ts | 12 +- components-ui/icon/index.tsx | 47 ++----- components/banner/info-banner.tsx | 22 +-- components/footer/index.tsx | 133 +++++++++++------- components/header/header-core/index.tsx | 46 +----- .../header/header-core/styles.module.css | 26 ---- components/header/menu/index.tsx | 49 +++++++ components/header/menu/styles.module.css | 25 ++++ .../advanced-search-tutorial/index.tsx | 2 +- components/search-results/map/index.tsx | 2 +- components/search-results/results-list.tsx | 4 +- components/unite-legale-description/index.tsx | 12 +- components/unite-legale-section/index.tsx | 9 +- data/administrations/mtpei.yml | 1 + data/faq/convention-collective.yml | 2 + middleware.ts | 2 +- models/search-filter-params.ts | 2 +- pages/dirigeants/[slug].tsx | 117 --------------- pages/elus/[slug].tsx | 56 -------- 29 files changed, 420 insertions(+), 384 deletions(-) create mode 100644 app/(header-default)/dirigeants/[slug]/page.tsx rename {components/dirigeants-section => app/(header-default)/dirigeants/_component/sections}/beneficiaires.tsx (99%) create mode 100644 app/(header-default)/dirigeants/_component/sections/index.tsx rename {components/dirigeants-section => app/(header-default)/dirigeants/_component/sections}/is-personne-morale.ts (100%) rename {components/dirigeants-section => app/(header-default)/dirigeants/_component/sections}/responsables-service-public.tsx (100%) rename {components/dirigeants-section => app/(header-default)/dirigeants/_component/sections}/rne-dirigeants.tsx (99%) rename {components/dirigeants-section => app/(header-default)/dirigeants/_component/sections}/summary.tsx (100%) create mode 100644 app/(header-default)/elus/[slug]/page.tsx rename {components/dirigeants-section => app/(header-default)/elus/_component/section}/elus-section.tsx (64%) create mode 100644 components/header/menu/index.tsx create mode 100644 components/header/menu/styles.module.css delete mode 100644 pages/dirigeants/[slug].tsx delete mode 100644 pages/elus/[slug].tsx diff --git a/app/(header-default)/dirigeants/[slug]/page.tsx b/app/(header-default)/dirigeants/[slug]/page.tsx new file mode 100644 index 000000000..4b2008cb4 --- /dev/null +++ b/app/(header-default)/dirigeants/[slug]/page.tsx @@ -0,0 +1,66 @@ +import { Metadata } from 'next'; +import Title from '#components/title-section'; +import { FICHE } from '#components/title-section/tabs'; +import { getServicePublicByUniteLegale } from '#models/service-public'; +import { + uniteLegalePageDescription, + uniteLegalePageTitle, +} from '#utils/helpers'; +import { cachedGetUniteLegale } from '#utils/server-side-helper/app/cached-methods'; +import extractParamsAppRouter, { + AppRouterProps, +} from '#utils/server-side-helper/app/extract-params'; +import getSession from '#utils/server-side-helper/app/get-session'; +import ResponsableSection from 'app/(header-default)/dirigeants/_component/sections/responsables-service-public'; +import { DirigeantInformation } from '../_component/sections'; + +export const generateMetadata = async ( + props: AppRouterProps +): Promise => { + const { slug, page, isBot } = extractParamsAppRouter(props); + + const session = await getSession(); + const uniteLegale = await cachedGetUniteLegale(slug, isBot, page); + + return { + title: `Dirigeants de la structure - ${uniteLegalePageTitle( + uniteLegale, + session + )}`, + description: uniteLegalePageDescription(uniteLegale, session), + robots: 'noindex, nofollow', + alternates: { + canonical: `https://annuaire-entreprises.data.gouv.fr/dirigeants/${uniteLegale.siren}`, + }, + }; +}; + +const DirigeantsPage = async (props: AppRouterProps) => { + const { slug, isBot } = extractParamsAppRouter(props); + + const uniteLegale = await cachedGetUniteLegale(slug, isBot); + const servicePublic = await getServicePublicByUniteLegale(uniteLegale, { + isBot, + }); + + const session = await getSession(); + + return ( + <> +
+ + {servicePublic ? ( + <ResponsableSection servicePublic={servicePublic} /> + ) : ( + <DirigeantInformation uniteLegale={uniteLegale} /> + )} + </div> + </> + ); +}; + +export default DirigeantsPage; diff --git a/components/dirigeants-section/beneficiaires.tsx b/app/(header-default)/dirigeants/_component/sections/beneficiaires.tsx similarity index 99% rename from components/dirigeants-section/beneficiaires.tsx rename to app/(header-default)/dirigeants/_component/sections/beneficiaires.tsx index 31b624bc4..76fd1e637 100644 --- a/components/dirigeants-section/beneficiaires.tsx +++ b/app/(header-default)/dirigeants/_component/sections/beneficiaires.tsx @@ -1,3 +1,5 @@ +'use client'; + import React from 'react'; import routes from '#clients/routes'; import InpiPartiallyDownWarning from '#components-ui/alerts-with-explanations/inpi-partially-down'; diff --git a/app/(header-default)/dirigeants/_component/sections/index.tsx b/app/(header-default)/dirigeants/_component/sections/index.tsx new file mode 100644 index 000000000..3746e15e7 --- /dev/null +++ b/app/(header-default)/dirigeants/_component/sections/index.tsx @@ -0,0 +1,45 @@ +'use client'; + +import BreakPageForPrint from '#components-ui/print-break-page'; +import { DonneesPriveesSection } from '#components/donnees-privees-section'; +import { estDiffusible } from '#models/core/statut-diffusion'; +import { IUniteLegale } from '#models/core/types'; +import { EScope, hasRights } from '#models/user/rights'; +import { useFetchImmatriculationRNE } from 'hooks'; +import useSession from 'hooks/use-session'; +import BeneficiairesSection from './beneficiaires'; +import DirigeantsSection from './rne-dirigeants'; +import DirigeantSummary from './summary'; + +export function DirigeantInformation({ + uniteLegale, +}: { + uniteLegale: IUniteLegale; +}) { + const immatriculationRNE = useFetchImmatriculationRNE(uniteLegale); + const session = useSession(); + return ( + <> + <DirigeantSummary + uniteLegale={uniteLegale} + immatriculationRNE={immatriculationRNE} + /> + {estDiffusible(uniteLegale) || + hasRights(session, EScope.nonDiffusible) ? ( + <> + <DirigeantsSection + immatriculationRNE={immatriculationRNE} + uniteLegale={uniteLegale} + /> + <BreakPageForPrint /> + <BeneficiairesSection + immatriculationRNE={immatriculationRNE} + uniteLegale={uniteLegale} + /> + </> + ) : ( + <DonneesPriveesSection /> + )} + </> + ); +} diff --git a/components/dirigeants-section/is-personne-morale.ts b/app/(header-default)/dirigeants/_component/sections/is-personne-morale.ts similarity index 100% rename from components/dirigeants-section/is-personne-morale.ts rename to app/(header-default)/dirigeants/_component/sections/is-personne-morale.ts diff --git a/components/dirigeants-section/responsables-service-public.tsx b/app/(header-default)/dirigeants/_component/sections/responsables-service-public.tsx similarity index 100% rename from components/dirigeants-section/responsables-service-public.tsx rename to app/(header-default)/dirigeants/_component/sections/responsables-service-public.tsx diff --git a/components/dirigeants-section/rne-dirigeants.tsx b/app/(header-default)/dirigeants/_component/sections/rne-dirigeants.tsx similarity index 99% rename from components/dirigeants-section/rne-dirigeants.tsx rename to app/(header-default)/dirigeants/_component/sections/rne-dirigeants.tsx index 7ebe6424f..5252d5dbc 100644 --- a/components/dirigeants-section/rne-dirigeants.tsx +++ b/app/(header-default)/dirigeants/_component/sections/rne-dirigeants.tsx @@ -1,3 +1,5 @@ +'use client'; + import React from 'react'; import routes from '#clients/routes'; import InpiPartiallyDownWarning from '#components-ui/alerts-with-explanations/inpi-partially-down'; diff --git a/components/dirigeants-section/summary.tsx b/app/(header-default)/dirigeants/_component/sections/summary.tsx similarity index 100% rename from components/dirigeants-section/summary.tsx rename to app/(header-default)/dirigeants/_component/sections/summary.tsx diff --git a/app/(header-default)/elus/[slug]/page.tsx b/app/(header-default)/elus/[slug]/page.tsx new file mode 100644 index 000000000..ff62208de --- /dev/null +++ b/app/(header-default)/elus/[slug]/page.tsx @@ -0,0 +1,63 @@ +import { GetServerSideProps, Metadata } from 'next'; +import Meta from '#components/meta/meta-client'; +import Title from '#components/title-section'; +import { FICHE } from '#components/title-section/tabs'; +import { getNomComplet } from '#models/core/statut-diffusion'; +import { IUniteLegale } from '#models/core/types'; +import { getUniteLegaleFromSlug } from '#models/core/unite-legale'; +import extractParamsPageRouter from '#utils/server-side-helper/page/extract-params'; +import { + IPropsWithMetadata, + postServerSideProps, +} from '#utils/server-side-helper/page/post-server-side-props'; +import ElusSection from 'app/(header-default)/elus/_component/section/elus-section'; +import { NextPageWithLayout } from 'pages/_app'; +import extractParamsAppRouter, { + AppRouterProps, +} from '#utils/server-side-helper/app/extract-params'; +import { cachedGetUniteLegale } from '#utils/server-side-helper/app/cached-methods'; +import getSession from '#utils/server-side-helper/app/get-session'; +import { + uniteLegalePageDescription, + uniteLegalePageTitle, +} from '#utils/helpers'; + +export const generateMetadata = async ( + props: AppRouterProps +): Promise<Metadata> => { + const { slug, page, isBot } = extractParamsAppRouter(props); + + const session = await getSession(); + const uniteLegale = await cachedGetUniteLegale(slug, isBot, page); + + return { + title: `Élus de ${getNomComplet(uniteLegale, session)} - ${ + uniteLegale.siren + }`, + description: uniteLegalePageDescription(uniteLegale, session), + robots: 'noindex, nofollow', + alternates: { + canonical: `https://annuaire-entreprises.data.gouv.fr/elus/${uniteLegale.siren}`, + }, + }; +}; + +const ElusPage = async (props: AppRouterProps) => { + const { slug, isBot } = extractParamsAppRouter(props); + + const uniteLegale = await cachedGetUniteLegale(slug, isBot); + const session = await getSession(); + + return ( + <div className="content-container"> + <Title + uniteLegale={uniteLegale} + ficheType={FICHE.ELUS} + session={session} + /> + <ElusSection uniteLegale={uniteLegale} /> + </div> + ); +}; + +export default ElusPage; diff --git a/components/dirigeants-section/elus-section.tsx b/app/(header-default)/elus/_component/section/elus-section.tsx similarity index 64% rename from components/dirigeants-section/elus-section.tsx rename to app/(header-default)/elus/_component/section/elus-section.tsx index b5412edd2..0c3267e6b 100644 --- a/components/dirigeants-section/elus-section.tsx +++ b/app/(header-default)/elus/_component/section/elus-section.tsx @@ -1,11 +1,11 @@ import React from 'react'; import NonRenseigne from '#components/non-renseigne'; +import { Section } from '#components/section'; +import { FullTable } from '#components/table/full'; import { EAdministration } from '#models/administrations/EAdministration'; import { isCollectiviteTerritoriale, IUniteLegale } from '#models/core/types'; import { IEtatCivil } from '#models/immatriculation'; import { capitalize, formatDatePartial } from '#utils/helpers'; -import { Section } from '../section'; -import { FullTable } from '../table/full'; /** * Elus section @@ -42,36 +42,29 @@ const ElusSection: React.FC<{ uniteLegale: IUniteLegale }> = ({ const plural = elus.length > 1 ? 's' : ''; return ( - <> - <Section - id="collectivite-elus" - title={`Élu${plural}`} - sources={[EAdministration.MI, EAdministration.DINUM]} - > - {elus.length > 0 ? ( - <> - <p> - Cette collectivité possède {elus.length} élu{plural} enregistré - {plural} au Répertoire National des Élus : - </p> - <FullTable - head={['Role', 'Élu(e)', 'Date de naissance']} - body={elus.sort(sortByRole).map((elu) => formatElus(elu))} - /> - </> - ) : ( + <Section + id="collectivite-elus" + title={`Élu${plural}`} + sources={[EAdministration.MI, EAdministration.DINUM]} + > + {elus.length > 0 ? ( + <> <p> - Cette collectivité ne possède aucun élu enregistré au Répertoire - National des Élus + Cette collectivité possède {elus.length} élu{plural} enregistré + {plural} au Répertoire National des Élus : </p> - )} - </Section> - <style jsx>{` - table > tbody > tr > td { - min-width: 30%; - } - `}</style> - </> + <FullTable + head={['Role', 'Élu(e)', 'Date de naissance']} + body={elus.sort(sortByRole).map((elu) => formatElus(elu))} + /> + </> + ) : ( + <p> + Cette collectivité ne possède aucun élu enregistré au Répertoire + National des Élus + </p> + )} + </Section> ); }; export default ElusSection; diff --git a/app/(header-default)/justificatif/[slug]/_components/summary.tsx b/app/(header-default)/justificatif/[slug]/_components/summary.tsx index 2b8afd5f5..e4cd8f81f 100644 --- a/app/(header-default)/justificatif/[slug]/_components/summary.tsx +++ b/app/(header-default)/justificatif/[slug]/_components/summary.tsx @@ -34,8 +34,8 @@ const ImmatriculationSummary: React.FC<IJustificatifs> = ({ ) : ( <a href="#insee"> <strong>Cessée</strong> auprès de l’Insee - {uniteLegale.dateDebutActivite - ? `, depuis le ${formatDateLong(uniteLegale.dateDebutActivite)}` + {uniteLegale.dateFermeture + ? `, depuis le ${formatDateLong(uniteLegale.dateFermeture)}` : ''} </a> )} diff --git a/clients/sirene-insee/siren.ts b/clients/sirene-insee/siren.ts index 4593279c4..7cb241a7c 100644 --- a/clients/sirene-insee/siren.ts +++ b/clients/sirene-insee/siren.ts @@ -1,6 +1,7 @@ import routes from '#clients/routes'; import stubClientWithSnapshots from '#clients/stub-client-with-snaphots'; import { createEtablissementsList } from '#models/core/etablissements-list'; +import { estActif } from '#models/core/etat-administratif'; import { createDefaultEtablissement, createDefaultUniteLegale, @@ -168,6 +169,11 @@ const mapToDomainObject = ( 'T' )[0]; + const etatAdministratif = etatFromEtatAdministratifInsee( + etatAdministratifUniteLegale, + siren + ); + return { ...defaultUniteLegale, siren, @@ -186,10 +192,8 @@ const mapToDomainObject = ( dateMiseAJourInsee: dateDernierTraitement, dateMiseAJourInpi: '', dateDebutActivite: dateDebut, - etatAdministratif: etatFromEtatAdministratifInsee( - etatAdministratifUniteLegale, - siren - ), + dateFermeture: !estActif({ etatAdministratif }) ? dateDebut : '', + etatAdministratif, statutDiffusion: statuDiffusionFromStatutDiffusionInsee( statutDiffusionUniteLegale, siren diff --git a/components-ui/icon/index.tsx b/components-ui/icon/index.tsx index de491b4f1..0a46c1dfc 100644 --- a/components-ui/icon/index.tsx +++ b/components-ui/icon/index.tsx @@ -16,19 +16,6 @@ const communityFill = ( </svg> ); -const humanPin = ( - <svg - xmlns="http://www.w3.org/2000/svg" - viewBox="0 0 24 24" - width="100%" - height="100%" - fill="currentColor" - stroke="currentColor" - strokeWidth="0" - > - <path d="M12 2c5.523 0 10 4.477 10 10 0 4.747-3.308 8.722-7.745 9.745L12 24l-2.255-2.255C5.308 20.722 2 16.747 2 12 2 6.477 6.477 2 12 2Zm.16 14c-2.036 0-3.87.87-5.148 2.257a7.953 7.953 0 0 0 3.182 1.539l.56.129L12 21.172l1.247-1.247.56-.13a7.956 7.956 0 0 0 3.36-1.686A6.979 6.979 0 0 0 12.16 16ZM6.554 6.14a8 8 0 0 0-.938 10.681v-.001A8.975 8.975 0 0 1 12.16 14a8.972 8.972 0 0 1 6.362 2.634A8 8 0 0 0 6.554 6.141ZM12 5a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm0 2a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z" /> - </svg> -); const user = ( <svg xmlns="http://www.w3.org/2000/svg" @@ -36,10 +23,8 @@ const user = ( width="100%" height="100%" fill="currentColor" - stroke="currentColor" - strokeWidth="0" > - <path d="M4 22a8 8 0 1 1 16 0H4Zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6 6 2.685 6 6-2.685 6-6 6Z" /> + <path d="M12 14a8 8 0 0 1 8 8h-2a6 6 0 1 0-12 0H4a8 8 0 0 1 8-8Zm0-13c3.315 0 6 2.685 6 6s-2.685 6-6 6-6-2.685-6-6 2.685-6 6-6Zm0 2C9.79 3 8 4.79 8 7s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4Z" /> </svg> ); @@ -126,20 +111,6 @@ const building = ( </svg> ); -const questionnaire = ( - <svg - xmlns="http://www.w3.org/2000/svg" - width="100%" - height="100%" - viewBox="0 0 24 24" - fill="currentColor" - stroke="currentColor" - strokeWidth="0" - > - <path d="M21 3a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1h18Zm-1 2H4v13.385L5.763 17H20V5Zm-7 9v2h-2v-2h2Zm-.54-7.972A3.501 3.501 0 0 1 12 13h-1v-2h1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393a3.501 3.501 0 0 1 3.892-2.785Z" /> - </svg> -); - const alertFill = ( <svg xmlns="http://www.w3.org/2000/svg" @@ -441,9 +412,23 @@ const discussion = ( </svg> ); +const accountLine = ( + <svg + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 24 24" + width="100%" + height="100%" + stroke="none" + fill="currentColor" + > + <path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10Zm-4.987-3.744A7.966 7.966 0 0 0 12 20a7.97 7.97 0 0 0 5.167-1.892A6.979 6.979 0 0 0 12.16 16a6.981 6.981 0 0 0-5.147 2.256ZM5.616 16.82A8.975 8.975 0 0 1 12.16 14a8.972 8.972 0 0 1 6.362 2.634 8 8 0 1 0-12.906.187v-.001ZM12 13a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm0-2a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" /> + </svg> +); + export type IIconsSlug = keyof typeof icons; export const icons = { + accountLine, errorFill, lightbulbFill, lockFill, @@ -455,7 +440,6 @@ export const icons = { buildingFill, open, closed, - humanPin, file, building, moneyCircle, @@ -471,7 +455,6 @@ export const icons = { download, questionFill, alertFill, - questionnaire, successFill, discussion, }; diff --git a/components/banner/info-banner.tsx b/components/banner/info-banner.tsx index 7f4150e12..979961fb7 100644 --- a/components/banner/info-banner.tsx +++ b/components/banner/info-banner.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { Icon } from '#components-ui/icon/wrapper'; import { PrintNever } from '#components-ui/print-visibility'; import { INSEE } from '#components/administrations'; import constants from '#models/constants'; @@ -10,21 +11,24 @@ export const InfoBanner: React.FC<{}> = () => ( role="dialog" aria-label="Instabilité des services de nos partenaires" style={{ - paddingTop: '15px', - paddingBottom: '15px', + paddingTop: '10px', + paddingBottom: '5px', width: '100%', backgroundColor: '#e5f3ff', borderBottom: `2px solid ${constants.colors.frBlue}`, + fontSize: '0.9rem', }} > <div className="fr-container"> - ℹ️ Suite à la mise à jour{' '} - <a href="https://www.data.gouv.fr/fr/datasets/base-sirene-des-entreprises-et-de-leurs-etablissements-siren-siret/"> - de la base Sirene - </a>{' '} - de l’ - <INSEE />, les données sont désormais à jour à l’exception de la qualité - Société à mission. + <Icon slug="information" color={constants.colors.frBlue} size={14}> + Suite à la mise à jour{' '} + <a href="https://www.data.gouv.fr/fr/datasets/base-sirene-des-entreprises-et-de-leurs-etablissements-siren-siret/"> + de la base Sirene + </a>{' '} + de l’ + <INSEE />, les données des sociétés à mission sont temporairement + manquantes. + </Icon> </div> </div> </PrintNever> diff --git a/components/footer/index.tsx b/components/footer/index.tsx index 40556f461..f973c0348 100644 --- a/components/footer/index.tsx +++ b/components/footer/index.tsx @@ -56,32 +56,15 @@ const Footer = () => ( </ul> </div> <div className="fr-col-12 fr-col-sm-4 fr-col-md-4"> - <strong className="fr-footer__top-cat">Aide</strong> - <ul className="fr-footer__top-list"> - <li> - <a className="fr-footer__top-link" href="/faq"> - Questions fréquentes - </a> - </li> - <li> - <a className="fr-footer__top-link" href="/definitions"> - Définitions - </a> - </li> - <li> - <a - className="fr-footer__top-link" - href="/formulaire/supprimer-donnees-personnelles-entreprise" - > - Supprimer ses données personnelles - </a> - </li> - </ul> - <br /> <strong className="fr-footer__top-cat"> Développeurs & développeuses </strong> <ul className="fr-footer__top-list"> + <li> + <a className="fr-footer__top-link" href="/partager"> + Réutiliser & partager + </a> + </li> <li> <a className="fr-footer__top-link" @@ -111,8 +94,75 @@ const Footer = () => ( </a> </li> </ul> + <br /> + <ul className="fr-footer__top-list"> + <strong className="fr-footer__top-cat">Autres sites</strong> + <li className="fr-footer__content-item"> + <a + className="fr-footer__top-link" + href="https://entreprises.gouv.fr" + target="_blank" + rel="noreferrer noopener" + > + entreprises.gouv.fr + </a> + </li> + <li className="fr-footer__content-item"> + <a + className="fr-footer__top-link" + target="_blank" + rel="noreferrer noopener" + href="https://entreprendre.service-public.fr/" + > + entreprendre.service-public.fr + </a> + </li> + <li className="fr-footer__content-item"> + <a + className="fr-footer__top-link" + target="_blank" + rel="noreferrer noopener" + href="https://mon-entreprise.fr" + > + mon-entreprise.fr + </a> + </li> + + <li className="fr-footer__content-item"> + <a + className="fr-footer__top-link" + target="_blank" + rel="noreferrer noopener" + href="https://formalites.entreprises.gouv.fr" + > + formalites.entreprises.gouv.fr + </a> + </li> + </ul> </div> <div className="fr-col-12 fr-col-sm-4 fr-col-md-4"> + <strong className="fr-footer__top-cat">Aide</strong> + <ul className="fr-footer__top-list"> + <li> + <a className="fr-footer__top-link" href="/faq"> + Questions fréquentes + </a> + </li> + <li> + <a className="fr-footer__top-link" href="/definitions"> + Définitions + </a> + </li> + <li> + <a + className="fr-footer__top-link" + href="/formulaire/supprimer-donnees-personnelles-entreprise" + > + Supprimer ses données personnelles + </a> + </li> + </ul> + <br /> <strong className="fr-footer__top-cat"> Annuaire des Entreprises </strong> @@ -150,11 +200,6 @@ const Footer = () => ( Équipe </a> </li> - <li> - <a className="fr-footer__top-link" href="/partager"> - Réutiliser & partager - </a> - </li> </ul> </div> </div> @@ -205,53 +250,47 @@ const Footer = () => ( <li className="fr-footer__content-item"> <a className="fr-footer__content-link" - href="https://entreprises.gouv.fr" target="_blank" - rel="noreferrer noopener" + rel="noopener external" + title="Legifrance - nouvelle fenêtre" + href="https://legifrance.gouv.fr" > - entreprises.gouv.fr + legifrance.gouv.fr </a> </li> <li className="fr-footer__content-item"> <a className="fr-footer__content-link" target="_blank" - rel="noreferrer noopener" - href="https://entreprendre.service-public.fr/" + rel="noopener external" + title="Info.gouv.fr - nouvelle fenêtre" + href="https://info.gouv.fr" > - entreprendre.service-public.fr + info.gouv.fr </a> </li> <li className="fr-footer__content-item"> <a className="fr-footer__content-link" target="_blank" - rel="noreferrer noopener" - href="https://mon-entreprise.fr" + rel="noopener external" + title="Service Public - nouvelle fenêtre" + href="https://service-public.fr" > - mon-entreprise.fr + service-public.fr </a> </li> <li className="fr-footer__content-item"> <a className="fr-footer__content-link" target="_blank" - rel="noreferrer noopener" + rel="noopener external" + title="Data.gouv.fr - nouvelle fenêtre" href="https://data.gouv.fr" > data.gouv.fr </a> </li> - <li className="fr-footer__content-item"> - <a - className="fr-footer__content-link" - target="_blank" - rel="noreferrer noopener" - href="https://formalites.entreprises.gouv.fr" - > - formalites.entreprises.gouv.fr - </a> - </li> </ul> </div> </div> diff --git a/components/header/header-core/index.tsx b/components/header/header-core/index.tsx index 38ae1229e..c09a880e2 100644 --- a/components/header/header-core/index.tsx +++ b/components/header/header-core/index.tsx @@ -1,12 +1,10 @@ import React from 'react'; -import { Icon } from '#components-ui/icon/wrapper'; import { PrintNever } from '#components-ui/print-visibility'; import { InfoBanner } from '#components/banner/info-banner'; import LoadBar from '#components/load-bar'; import SearchBar from '#components/search-bar'; -import constants from '#models/constants'; -import { isLoggedIn } from '#models/user/rights'; import { ISession } from '#models/user/session'; +import Menu from '../menu'; import styles from './styles.module.css'; type IProps = { @@ -104,43 +102,11 @@ export const HeaderCore: React.FC<IProps> = ({ <div className="fr-header__tools-links"> <ul className="fr-links-group"> <li> - {isLoggedIn(session) ? ( - <div className={styles.menuLogout + ' fr-link'}> - <div> - <Icon slug="user"> - {session?.user?.fullName || - session?.user?.email || - 'Utilisateur inconnu'} -  ( - <strong - style={{ - fontVariant: 'small-caps', - color: constants.colors.espaceAgent, - }} - > - agent public - </strong> - ) - </Icon> - </div> - <a - href={`/api/auth/agent-connect/logout?pathFrom=${encodeURIComponent( - pathFrom - )}`} - > - <div>Se déconnecter</div> - </a> - </div> - ) : useAgentCTA ? ( - <a - href={`/lp/agent-public?pathFrom=${encodeURIComponent( - pathFrom - )}`} - className="fr-link" - > - <Icon slug="user">Espace agent public</Icon> - </a> - ) : null} + <Menu + session={session} + useAgentCTA={useAgentCTA} + pathFrom={pathFrom} + /> </li> </ul> </div> diff --git a/components/header/header-core/styles.module.css b/components/header/header-core/styles.module.css index 445880fc9..2b70b2c5e 100644 --- a/components/header/header-core/styles.module.css +++ b/components/header/header-core/styles.module.css @@ -9,29 +9,3 @@ margin-top: 0; } } - -.menuLogout { - position: relative; -} -.menuLogout:hover { - background-color: #eee !important; - cursor: default; -} - -.menuLogout > a { - position: absolute; - top: 100%; - left: 0; - display: none; - width: 100%; - background-color: #fff; - padding: 5px 15px; - box-shadow: 0 10px 15px -10px rgba(0, 0, 0, 0.5); -} -.menuLogout > a:hover { - background-color: #f8f8f8 !important; -} - -.menuLogout:hover > a { - display: block; -} diff --git a/components/header/menu/index.tsx b/components/header/menu/index.tsx new file mode 100644 index 000000000..c371e820c --- /dev/null +++ b/components/header/menu/index.tsx @@ -0,0 +1,49 @@ +import { Icon } from '#components-ui/icon/wrapper'; +import constants from '#models/constants'; +import { isLoggedIn } from '#models/user/rights'; +import { ISession } from '#models/user/session'; +import styles from './styles.module.css'; + +const Menu: React.FC<{ + session: ISession | null; + pathFrom: string; + useAgentCTA: boolean; +}> = ({ session, pathFrom, useAgentCTA }) => { + return isLoggedIn(session) ? ( + <div className={styles.menuLogout + ' fr-link'}> + <div> + <Icon slug="accountLine"> + {session?.user?.fullName || + session?.user?.email || + 'Utilisateur inconnu'} +  ( + <strong + style={{ + fontVariant: 'small-caps', + color: constants.colors.espaceAgent, + }} + > + agent public + </strong> + ) + </Icon> + </div> + <a + href={`/api/auth/agent-connect/logout?pathFrom=${encodeURIComponent( + pathFrom + )}`} + > + <div>Se déconnecter</div> + </a> + </div> + ) : useAgentCTA ? ( + <a + href={`/lp/agent-public?pathFrom=${encodeURIComponent(pathFrom)}`} + className="fr-link" + > + <Icon slug="accountLine">Espace agent public</Icon> + </a> + ) : null; +}; + +export default Menu; diff --git a/components/header/menu/styles.module.css b/components/header/menu/styles.module.css new file mode 100644 index 000000000..fa934a207 --- /dev/null +++ b/components/header/menu/styles.module.css @@ -0,0 +1,25 @@ +.menuLogout { + position: relative; +} +.menuLogout:hover { + background-color: #eee !important; + cursor: default; +} + +.menuLogout > a { + position: absolute; + top: 100%; + left: 0; + display: none; + width: 100%; + background-color: #fff; + padding: 5px 15px; + box-shadow: 0 10px 15px -10px rgba(0, 0, 0, 0.5); +} +.menuLogout > a:hover { + background-color: #f8f8f8 !important; +} + +.menuLogout:hover > a { + display: block; +} diff --git a/components/search-results/advanced-search-tutorial/index.tsx b/components/search-results/advanced-search-tutorial/index.tsx index 84bd811fd..ae3d4d7c0 100644 --- a/components/search-results/advanced-search-tutorial/index.tsx +++ b/components/search-results/advanced-search-tutorial/index.tsx @@ -33,7 +33,7 @@ export const AdvancedSearchTutorial = () => { </Icon> </li> <li> - <Icon color={constants.colors.frBlue} slug="humanPin"> + <Icon color={constants.colors.frBlue} slug="user"> <strong>Dirigeant :</strong> filtrez par le nom ou le prénom d’un(e) dirigeant(e) </Icon> diff --git a/components/search-results/map/index.tsx b/components/search-results/map/index.tsx index 2dd6b396c..0f9378849 100644 --- a/components/search-results/map/index.tsx +++ b/components/search-results/map/index.tsx @@ -13,7 +13,7 @@ const SearchResultsMap: React.FC<{ results: ISearchResults; searchFilterParams?: IParams; }> = ({ results, searchTerm = '', searchFilterParams = {} }) => { - const height = 'calc(100vh - 280px)'; + const height = 'calc(100vh - 260px)'; if (searchTerm && results.notEnoughParams) { return ( diff --git a/components/search-results/results-list.tsx b/components/search-results/results-list.tsx index bc386f461..2d4dd4670 100644 --- a/components/search-results/results-list.tsx +++ b/components/search-results/results-list.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { Icon } from '#components-ui/icon/wrapper'; import IsActiveTag from '#components-ui/is-active-tag'; -import { isPersonneMorale } from '#components/dirigeants-section/is-personne-morale'; import UniteLegaleBadge from '#components/unite-legale-badge'; import { estActif } from '#models/core/etat-administratif'; import { @@ -11,6 +10,7 @@ import { import { isCollectiviteTerritoriale } from '#models/core/types'; import { IDirigeant } from '#models/immatriculation'; import { ISearchResult } from '#models/search'; +import { isPersonneMorale } from 'app/(header-default)/dirigeants/_component/sections/is-personne-morale'; import styles from './style.module.css'; type IProps = { @@ -32,7 +32,7 @@ const DirigeantsOrElusList: React.FC<{ return ( <div className={styles['dirigeants-or-elus']}> - <Icon slug="humanPin"> + <Icon slug="user"> {firstFive .map((dirigeantOrElu) => isPersonneMorale(dirigeantOrElu) diff --git a/components/unite-legale-description/index.tsx b/components/unite-legale-description/index.tsx index 533b299a1..d7557cb8a 100644 --- a/components/unite-legale-description/index.tsx +++ b/components/unite-legale-description/index.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import { estActif } from '#models/core/etat-administratif'; import { getAdresseUniteLegale, getNomComplet, @@ -24,10 +23,9 @@ export const UniteLegaleDescription: React.FC<{ ? formatAge(uniteLegale.dateCreation) : null; - const ageFermeture = - uniteLegale.dateDebutActivite && !estActif(uniteLegale) - ? formatAge(uniteLegale.dateDebutActivite) - : null; + const ageFermeture = uniteLegale.dateFermeture + ? formatAge(uniteLegale.dateFermeture) + : null; return ( <> @@ -46,10 +44,10 @@ export const UniteLegaleDescription: React.FC<{ ) : ( <> n’a pas de date de création connue. </> )} - {uniteLegale.dateDebutActivite && !estActif(uniteLegale) && ( + {uniteLegale.dateFermeture && ( <> Elle a été fermée le{' '} - <strong>{formatDateLong(uniteLegale.dateDebutActivite)}</strong> + <strong>{formatDateLong(uniteLegale.dateFermeture)}</strong> {ageFermeture && <>, il y a {ageFermeture}</>}.{' '} </> )} diff --git a/components/unite-legale-section/index.tsx b/components/unite-legale-section/index.tsx index f68f90fad..81c1e20a6 100644 --- a/components/unite-legale-section/index.tsx +++ b/components/unite-legale-section/index.tsx @@ -88,14 +88,7 @@ const UniteLegaleSection: React.FC<{ ] : []), ...(!estActif(uniteLegale) - ? [ - [ - 'Date de fermeture', - formatDate( - uniteLegale.dateDebutActivite || uniteLegale.dateFermeture - ), - ], - ] + ? [['Date de fermeture', formatDate(uniteLegale.dateFermeture)]] : []), ['', <br />], [ diff --git a/data/administrations/mtpei.yml b/data/administrations/mtpei.yml index 95b01eb67..48c39c413 100644 --- a/data/administrations/mtpei.yml +++ b/data/administrations/mtpei.yml @@ -22,6 +22,7 @@ dataSources: datagouvLink: https://www.data.gouv.fr/fr/datasets/liste-des-conventions-collectives-par-entreprise-siret/ data: - label: Conventions Collectives + form: https://www.net-entreprises.fr/astuces-net-entreprises/idcc-comment-faire-sa-declaration-selon-la-norme-dsn-2023/ - label: Liste des organismes de formation et des certifications Qualiopi apiSlug: qualiopi datagouvLink: https://www.data.gouv.fr/fr/datasets/liste-publique-des-organismes-de-formation-l-6351-7-1-du-code-du-travail/ diff --git a/data/faq/convention-collective.yml b/data/faq/convention-collective.yml index f46128615..f02e0b08a 100644 --- a/data/faq/convention-collective.yml +++ b/data/faq/convention-collective.yml @@ -30,3 +30,5 @@ cta: more: - label: Définition d’une convention collective sur service-public.fr href: https://www.service-public.fr/particuliers/vosdroits/F78 + - label: Comment faire sa déclaration IDCC ? + href: https://www.net-entreprises.fr/astuces-net-entreprises/idcc-comment-faire-sa-declaration-selon-la-norme-dsn-2023/ diff --git a/middleware.ts b/middleware.ts index c727d7323..845586d3a 100644 --- a/middleware.ts +++ b/middleware.ts @@ -119,6 +119,6 @@ export const config = { '/rechercher/:path*', '/rechercher/carte/:path*', '/justificatif/:path*', - '/dirigeant/:path*', + '/dirigeants/:path*', ], }; diff --git a/models/search-filter-params.ts b/models/search-filter-params.ts index 4865623b8..724a95992 100644 --- a/models/search-filter-params.ts +++ b/models/search-filter-params.ts @@ -144,7 +144,7 @@ class SearchFilterParams { public extractFilters = () => { const f = { dirigeantFilter: { - icon: 'humanPin', + icon: 'user', label: '', excludeParams: ['fn', 'n', 'dmin', 'dmax'], }, diff --git a/pages/dirigeants/[slug].tsx b/pages/dirigeants/[slug].tsx deleted file mode 100644 index 820018f48..000000000 --- a/pages/dirigeants/[slug].tsx +++ /dev/null @@ -1,117 +0,0 @@ -import { GetServerSideProps } from 'next'; -import BreakPageForPrint from '#components-ui/print-break-page'; -import BeneficiairesSection from '#components/dirigeants-section/beneficiaires'; -import ResponsableSection from '#components/dirigeants-section/responsables-service-public'; -import DirigeantsSection from '#components/dirigeants-section/rne-dirigeants'; -import DirigeantSummary from '#components/dirigeants-section/summary'; -import { DonneesPriveesSection } from '#components/donnees-privees-section'; -import Meta from '#components/meta/meta-client'; -import Title from '#components/title-section'; -import { FICHE } from '#components/title-section/tabs'; -import { IAPINotRespondingError } from '#models/api-not-responding'; -import { estDiffusible } from '#models/core/statut-diffusion'; -import { IUniteLegale } from '#models/core/types'; -import { getUniteLegaleFromSlug } from '#models/core/unite-legale'; -import { - IServicePublic, - getServicePublicByUniteLegale, -} from '#models/service-public'; -import { EScope, hasRights } from '#models/user/rights'; -import { - uniteLegalePageDescription, - uniteLegalePageTitle, -} from '#utils/helpers'; -import extractParamsPageRouter from '#utils/server-side-helper/page/extract-params'; -import { - IPropsWithMetadata, - postServerSideProps, -} from '#utils/server-side-helper/page/post-server-side-props'; -import { useFetchImmatriculationRNE } from 'hooks'; -import useSession from 'hooks/use-session'; -import { NextPageWithLayout } from 'pages/_app'; - -interface IProps extends IPropsWithMetadata { - uniteLegale: IUniteLegale; - servicePublic: IServicePublic | IAPINotRespondingError | null; -} - -const DirigeantsPage: NextPageWithLayout<IProps> = ({ - uniteLegale, - servicePublic, - metadata: { session }, -}) => { - return ( - <> - <Meta - canonical={`https://annuaire-entreprises.data.gouv.fr/dirigeants/${uniteLegale.siren}`} - noIndex={true} - title={`Dirigeants de la structure - ${uniteLegalePageTitle( - uniteLegale, - session - )}`} - description={uniteLegalePageDescription(uniteLegale, session)} - /> - <div className="content-container"> - <Title - uniteLegale={uniteLegale} - ficheType={FICHE.DIRIGEANTS} - session={session} - /> - {servicePublic ? ( - <ResponsableSection servicePublic={servicePublic} /> - ) : ( - <DirigeantInformation uniteLegale={uniteLegale} /> - )} - </div> - </> - ); -}; - -function DirigeantInformation({ uniteLegale }: { uniteLegale: IUniteLegale }) { - const immatriculationRNE = useFetchImmatriculationRNE(uniteLegale); - const session = useSession(); - return ( - <> - <DirigeantSummary - uniteLegale={uniteLegale} - immatriculationRNE={immatriculationRNE} - /> - {estDiffusible(uniteLegale) || - hasRights(session, EScope.nonDiffusible) ? ( - <> - <DirigeantsSection - immatriculationRNE={immatriculationRNE} - uniteLegale={uniteLegale} - /> - <BreakPageForPrint /> - <BeneficiairesSection - immatriculationRNE={immatriculationRNE} - uniteLegale={uniteLegale} - /> - </> - ) : ( - <DonneesPriveesSection /> - )} - </> - ); -} - -export const getServerSideProps: GetServerSideProps = postServerSideProps( - async (context) => { - const { slug, isBot } = extractParamsPageRouter(context); - - const uniteLegale = await getUniteLegaleFromSlug(slug, { isBot }); - const servicePublic = await getServicePublicByUniteLegale(uniteLegale, { - isBot, - }); - - return { - props: { - uniteLegale: await getUniteLegaleFromSlug(slug, { isBot }), - servicePublic, - }, - }; - } -); - -export default DirigeantsPage; diff --git a/pages/elus/[slug].tsx b/pages/elus/[slug].tsx deleted file mode 100644 index 592f695e4..000000000 --- a/pages/elus/[slug].tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { GetServerSideProps } from 'next'; -import ElusSection from '#components/dirigeants-section/elus-section'; -import Meta from '#components/meta/meta-client'; -import Title from '#components/title-section'; -import { FICHE } from '#components/title-section/tabs'; -import { getNomComplet } from '#models/core/statut-diffusion'; -import { IUniteLegale } from '#models/core/types'; -import { getUniteLegaleFromSlug } from '#models/core/unite-legale'; -import extractParamsPageRouter from '#utils/server-side-helper/page/extract-params'; -import { - IPropsWithMetadata, - postServerSideProps, -} from '#utils/server-side-helper/page/post-server-side-props'; -import { NextPageWithLayout } from 'pages/_app'; - -interface IProps extends IPropsWithMetadata { - uniteLegale: IUniteLegale; -} - -const ElusPage: NextPageWithLayout<IProps> = ({ - uniteLegale, - metadata: { session }, -}) => { - return ( - <> - <Meta - title={`Élus de ${getNomComplet(uniteLegale, session)} - ${ - uniteLegale.siren - }`} - canonical={`https://annuaire-entreprises.data.gouv.fr/elus/${uniteLegale.siren}`} - noIndex={true} - /> - <div className="content-container"> - <Title - uniteLegale={uniteLegale} - ficheType={FICHE.ELUS} - session={session} - /> - <ElusSection uniteLegale={uniteLegale} /> - </div> - </> - ); -}; - -export const getServerSideProps: GetServerSideProps = postServerSideProps( - async (context) => { - const { slug, isBot } = extractParamsPageRouter(context); - const uniteLegale = await getUniteLegaleFromSlug(slug, { isBot }); - - return { - props: { uniteLegale }, - }; - } -); - -export default ElusPage;