-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* content: idcc and banner update * chore: migration dirigeants and elus * refactor: use date fermeture * style: smaller info banner * chore: update footer
- Loading branch information
Showing
29 changed files
with
420 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Metadata> => { | ||
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 ( | ||
<> | ||
<div className="content-container"> | ||
<Title | ||
uniteLegale={uniteLegale} | ||
ficheType={FICHE.DIRIGEANTS} | ||
session={session} | ||
/> | ||
{servicePublic ? ( | ||
<ResponsableSection servicePublic={servicePublic} /> | ||
) : ( | ||
<DirigeantInformation uniteLegale={uniteLegale} /> | ||
)} | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default DirigeantsPage; |
2 changes: 2 additions & 0 deletions
2
...ents/dirigeants-section/beneficiaires.tsx → ...nts/_component/sections/beneficiaires.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
app/(header-default)/dirigeants/_component/sections/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 /> | ||
)} | ||
</> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
...nts/dirigeants-section/rne-dirigeants.tsx → ...ts/_component/sections/rne-dirigeants.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.