Skip to content

Commit

Permalink
Merge pull request #1084 from annuaire-entreprises-data-gouv-fr/rever…
Browse files Browse the repository at this point in the history
…t-1083-TMP-improve-navigation

Revert "Rétabli les link et utilise les routes parallèles pour /documents"
  • Loading branch information
johangirod authored May 29, 2024
2 parents 12aedc4 + fddd7ce commit f3602a9
Show file tree
Hide file tree
Showing 21 changed files with 239 additions and 344 deletions.
8 changes: 0 additions & 8 deletions app/(header-default)/documents/[slug]/@actes/common.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions app/(header-default)/documents/[slug]/@actes/layout.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions app/(header-default)/documents/[slug]/@actes/loading.tsx

This file was deleted.

95 changes: 0 additions & 95 deletions app/(header-default)/documents/[slug]/@actes/page.tsx

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions app/(header-default)/documents/[slug]/@conformite/common.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions app/(header-default)/documents/[slug]/@conformite/layout.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions app/(header-default)/documents/[slug]/@conformite/loading.tsx

This file was deleted.

46 changes: 0 additions & 46 deletions app/(header-default)/documents/[slug]/@conformite/page.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { Metadata } from 'next';
import { HorizontalSeparator } from '#components-ui/horizontal-separator';
import { CarteProfessionnelleTravauxPublicsSection } from '#components/carte-professionnelle-travaux-publics-section';
import ConformiteSection from '#components/espace-agent-components/conformite-section';
import ActesSection from '#components/espace-agent-components/documents/actes-walled';
import Title from '#components/title-section';
import { FICHE } from '#components/title-section/tabs';
import { isAPI404 } from '#models/api-not-responding';
import { getCarteProfessionnelleTravauxPublic } from '#models/espace-agent/carte-professionnelle-travaux-publics';
import { EScope, hasRights } from '#models/user/rights';
import {
uniteLegalePageDescription,
uniteLegalePageTitle,
Expand Down Expand Up @@ -34,17 +41,20 @@ export const generateMetadata = async (
};
};

const UniteLegaleDocumentPage = async (
props: AppRouterProps & {
conformite: React.ReactNode;
carteProfessionnelleTP: React.ReactNode;
actes: React.ReactNode;
}
) => {
const UniteLegaleDocumentPage = async (props: AppRouterProps) => {
const session = await getSession();
const { slug, isBot } = extractParamsAppRouter(props);
const uniteLegale = await cachedGetUniteLegale(slug, isBot);

const carteProfessionnelleTravauxPublics = hasRights(
session,
EScope.carteProfessionnelleTravauxPublics
)
? await getCarteProfessionnelleTravauxPublic(
uniteLegale.siren,
session?.user
)
: null;
return (
<>
<div className="content-container">
Expand All @@ -53,10 +63,21 @@ const UniteLegaleDocumentPage = async (
ficheType={FICHE.DOCUMENTS}
session={session}
/>

{props.conformite}
{props.actes}
{props.carteProfessionnelleTP}
{hasRights(session, EScope.conformite) && (
<>
<ConformiteSection uniteLegale={uniteLegale} session={session} />
<HorizontalSeparator />
</>
)}
<ActesSection uniteLegale={uniteLegale} session={session} />
{carteProfessionnelleTravauxPublics &&
!isAPI404(carteProfessionnelleTravauxPublics) && (
<CarteProfessionnelleTravauxPublicsSection
carteProfessionnelleTravauxPublics={
carteProfessionnelleTravauxPublics
}
/>
)}
</div>
</>
);
Expand Down
1 change: 1 addition & 0 deletions components/espace-agent-components/agent-wall/document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const AgentWallDocuments: React.FC<
title: string;
id: string;
uniteLegale: IUniteLegale;
condition: boolean;
}>
> = ({ uniteLegale, id, title }) => (
<AgentWall
Expand Down
Loading

0 comments on commit f3602a9

Please sign in to comment.