Skip to content

Commit

Permalink
chore: merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierJp committed Nov 6, 2024
2 parents 60a251c + 81c939f commit 2a6679d
Show file tree
Hide file tree
Showing 127 changed files with 4,440 additions and 2,371 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-cluster-full.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deployment to staging and then to production - not continuous deployment
name: 'Deploy : production'

on:
workflow_dispatch:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-cluster-staging.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continuous deployment to staging only
name: 'Deploy : staging [CD]'

on:
push:
Expand Down Expand Up @@ -47,6 +47,6 @@ jobs:
- name: Notify deploy success
uses: ./.github/actions/notify
with:
message: '✅ ${{ github.event.repository.name }} : successfully deploy production cluster'
message: '✅ ${{ github.event.repository.name }} : successfully deploy staging cluster'
hook: ${{ secrets.TCHAP_HOOK }}
id: ${{ secrets.TCHAP_ROOM_ID }}
3 changes: 3 additions & 0 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,14 @@ jobs:
needs: [dependencies]
env:
NEXT_PUBLIC_END2END_MOCKING: enabled
NEXT_PUBLIC_BASE_URL: http://localhost:3000
AGENTCONNECT_CLIENT_ID: ${{ secrets.AGENTCONNECT_CLIENT_ID }}
AGENTCONNECT_CLIENT_SECRET: ${{ secrets.AGENTCONNECT_CLIENT_SECRET }}
AGENTCONNECT_URL_DISCOVER: https://fca.integ01.dev-agentconnect.fr/api/v2/.well-known/openid-configuration
AGENTCONNECT_REDIRECT_URI: http://localhost:3000/api/auth/agent-connect/callback
AGENTCONNECT_POST_LOGOUT_REDIRECT_URI: http://localhost:3000/api/auth/agent-connect/logout-callback
API_ENTREPRISE_TOKEN: ${{ secrets.API_ENTREPRISE_TOKEN }}
API_ENTREPRISE_URL: ${{ secrets.API_ENTREPRISE_URL }}
steps:
- name: Checkout 🛎
uses: actions/checkout@v3
Expand Down
7 changes: 2 additions & 5 deletions app/(header-connexion)/connexion/au-revoir/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ConnexionSubLayout } from '#components-ui/connexion-layout';
import logoutPicture from '#components-ui/illustrations/logout';
import { Metadata } from 'next';
import { NextPageWithLayout } from 'pages/_app';

export const metadata: Metadata = {
title: 'Vous êtes bien deconnecté',
Expand All @@ -11,14 +10,12 @@ export const metadata: Metadata = {
robots: 'noindex, nofollow',
};

const ConnexionGoodbye: NextPageWithLayout = () => {
export default function ConnexionGoodbyePage() {
return (
<ConnexionSubLayout img={logoutPicture}>
<h1>Vous êtes bien déconnecté(e)</h1>
<p>Merci de votre visite</p>
<a href="/">← Revenir au moteur de recherche</a>
</ConnexionSubLayout>
);
};

export default ConnexionGoodbye;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const metadata: Metadata = {
robots: 'noindex, nofollow',
};

const ConnexionRefused = () => {
export default function ConnexionRefusedPage() {
return (
<ConnexionSubLayout img={connexionRefusedPicture}>
<h1>Vous n’êtes pas autorisé(e) à accéder à cette partie du site</h1>
Expand All @@ -25,6 +25,4 @@ const ConnexionRefused = () => {
<a href="/">← Retourner au moteur de recherche</a>
</ConnexionSubLayout>
);
};

export default ConnexionRefused;
}
6 changes: 2 additions & 4 deletions app/(header-connexion)/connexion/echec-connexion/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const metadata: Metadata = {
robots: 'noindex, nofollow',
};

const ConnexionFailure = () => {
export default function ConnexionFailurePage() {
return (
<ConnexionSubLayout img={connexionFailedPicture}>
<h1>Votre tentative de connexion a échouée</h1>
Expand All @@ -23,6 +23,4 @@ const ConnexionFailure = () => {
<a href="/">← Retourner au moteur de recherche</a>
</ConnexionSubLayout>
);
};

export default ConnexionFailure;
}
19 changes: 10 additions & 9 deletions app/(header-default)/administration/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Metadata } from 'next';
import { notFound } from 'next/navigation';
import { cache } from 'react';
import TextWrapper from '#components-ui/text-wrapper';
import AdministrationDescription from '#components/administrations/administration-description';
import { administrationsMetaData } from '#models/administrations';
import { EAdministration } from '#models/administrations/EAdministration';
import { getFaqArticlesByTag } from '#models/article/faq';
import { AppRouterProps } from '#utils/server-side-helper/app/extract-params';
import { Metadata } from 'next';
import { notFound } from 'next/navigation';
import { cache } from 'react';

const cachedGetAdministrations = cache((slug: string) => {
const slugs = slug.split('_');
Expand All @@ -30,7 +30,9 @@ const cachedGetAdministrations = cache((slug: string) => {
export const generateMetadata = async (
props: AppRouterProps
): Promise<Metadata> => {
const slug = props.params.slug as EAdministration;
const params = await props.params;
const slug = params.slug as EAdministration;

const { title } = cachedGetAdministrations(slug);

return {
Expand All @@ -42,8 +44,9 @@ export const generateMetadata = async (
};
};

const AdministrationPage = (props: AppRouterProps) => {
const slug = props.params.slug as EAdministration;
export default async function AdministrationPage(props: AppRouterProps) {
const params = await props.params;
const slug = params.slug as EAdministration;

const { administrations, articles } = cachedGetAdministrations(slug);

Expand Down Expand Up @@ -72,6 +75,4 @@ const AdministrationPage = (props: AppRouterProps) => {
)}
</TextWrapper>
);
};

export default AdministrationPage;
}
4 changes: 2 additions & 2 deletions app/(header-default)/annonces/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ObservationsRNE } from './_components/observations-rne';
export const generateMetadata = async (
props: AppRouterProps
): Promise<Metadata> => {
const { slug, isBot } = extractParamsAppRouter(props);
const { slug, isBot } = await extractParamsAppRouter(props);

const uniteLegale = await cachedGetUniteLegale(slug, isBot);

Expand All @@ -38,7 +38,7 @@ export const generateMetadata = async (
};
const AnnoncesPage = async (props: AppRouterProps) => {
const session = await getSession();
const { slug, isBot } = extractParamsAppRouter(props);
const { slug, isBot } = await extractParamsAppRouter(props);
const uniteLegale = await cachedGetUniteLegale(slug, isBot);

return (
Expand Down
6 changes: 3 additions & 3 deletions app/(header-default)/carte/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Metadata } from 'next';
import { Info } from '#components-ui/alerts';
import HiddenH1 from '#components/a11y-components/hidden-h1';
import MapEtablissement from '#components/map/map-etablissement';
Expand All @@ -8,11 +7,12 @@ import { getEtablissementWithLatLongFromSlug } from '#models/core/etablissement'
import extractParamsAppRouter, {
AppRouterProps,
} from '#utils/server-side-helper/app/extract-params';
import { Metadata } from 'next';

export const generateMetadata = async (
props: AppRouterProps
): Promise<Metadata> => {
const { slug } = extractParamsAppRouter(props);
const { slug } = await extractParamsAppRouter(props);

return {
title: `Voir le siret ${slug} sur la carte`,
Expand All @@ -24,7 +24,7 @@ export const generateMetadata = async (
};

const EtablissementMapPage = async (props: AppRouterProps) => {
const { slug } = extractParamsAppRouter(props);
const { slug } = await extractParamsAppRouter(props);
const etablissement = await getEtablissementWithLatLongFromSlug(slug);

return (
Expand Down
26 changes: 13 additions & 13 deletions app/(header-default)/definitions/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { RenderMarkdownServerOnly } from '#components/markdown';
import { allDefinitions, getDefinition } from '#models/article/definitions';
import { Exception } from '#models/exceptions';
import { logWarningInSentry } from '#utils/sentry';
import {
AppRouterProps,
IParams,
} from '#utils/server-side-helper/app/extract-params';
import { Metadata } from 'next';
import { notFound } from 'next/navigation';
import { cache } from 'react';

type IParams = {
slug: string;
};
import { cache, use } from 'react';

const cachedGetDefinition = cache((slug: string) => {
const definition = getDefinition(slug);
Expand All @@ -28,12 +28,11 @@ const cachedGetDefinition = cache((slug: string) => {
return definition;
});

export const generateMetadata = function ({
export const generateMetadata = async ({
params,
}: {
params: IParams;
}): Metadata {
const definition = cachedGetDefinition(params.slug);
}: AppRouterProps): Promise<Metadata> => {
const { slug } = await params;
const definition = cachedGetDefinition(slug);

return {
title: definition.seo.title || definition.title,
Expand All @@ -45,8 +44,9 @@ export const generateMetadata = function ({
};
};

export default (function DefinitionPage({ params }: { params: IParams }) {
const definition = cachedGetDefinition(params.slug);
export default function DefinitionPage({ params }: AppRouterProps) {
const { slug } = use(params);
const definition = cachedGetDefinition(slug);

return (
<TextWrapper>
Expand Down Expand Up @@ -80,7 +80,7 @@ export default (function DefinitionPage({ params }: { params: IParams }) {
) : null}
</TextWrapper>
);
});
}

export async function generateStaticParams(): Promise<Array<IParams>> {
return allDefinitions.map(({ slug }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type IProps = {
};

const NoDirigeants = () => (
<>Aucun(e) dirigeant(e) n’a été retrouvé pour cette association.</>
<>Aucun(e) dirigeant(e) n’a été retrouvé(e) pour cette association.</>
);

/**
Expand Down Expand Up @@ -87,7 +87,7 @@ function DirigeantsAssociationSection({ uniteLegale, session }: IProps) {
}
/>
<FullTable
head={['Etablissement', 'Role', 'Détails']}
head={['Établissement', 'Rôle', 'Détails']}
body={associationProtected.dirigeants
.filter((d) =>
selectedSiret.length > 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { MultiChoice } from '#components-ui/multi-choice';
import { UseCase } from '#models/user/agent';
import { useState } from 'react';

export function AskUseCase({
onUseCaseChanged,
Expand All @@ -15,7 +15,7 @@ export function AskUseCase({
return (
<>
<form>
<label>Dans quel cadre souhaitez vous accéder à ces données ?</label>
<label>Dans quel cadre souhaitez-vous accéder à ces données ?</label>
<br />
<MultiChoice
idPrefix="user-type"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ const BeneficiairesSection: React.FC<{
Les agents publics peuvent y accéder uniquement dans les cas d’usages
justifiant d’un intérêt légitime. En déclarant le cadre juridique dans
lequel vous accédez à ces données, vous vous engagez{' '}
<a href="/cgu">à respecter nos conditions générales d’utilisations</a>.
<a href="/cgu">à respecter nos conditions générales d’utilisation</a>.
</p>
<p>
Toute demande d’accès aux données est tracée et envoyée à la comission
Toute demande d’accès aux données est tracée et envoyée à la commission
européeene.
</p>
{useCase === UseCase.autre ? (
<>
<strong>
Les informations des bénénficiaires effectifs ne vous sont pas
Les informations des bénéficiaires effectifs ne vous sont pas
accessibles.
</strong>
</>
Expand Down
4 changes: 2 additions & 2 deletions app/(header-default)/dirigeants/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import ResponsablesServicePublicSection from './_component/sections/service-publ
export const generateMetadata = async (
props: AppRouterProps
): Promise<Metadata> => {
const { slug, page, isBot } = extractParamsAppRouter(props);
const { slug, page, isBot } = await extractParamsAppRouter(props);

const uniteLegale = await cachedGetUniteLegale(slug, isBot, page);

Expand All @@ -36,7 +36,7 @@ export const generateMetadata = async (
};

const DirigeantsPage = async (props: AppRouterProps) => {
const { slug, isBot } = extractParamsAppRouter(props);
const { slug, isBot } = await extractParamsAppRouter(props);

const uniteLegale = await cachedGetUniteLegale(slug, isBot);

Expand Down
10 changes: 5 additions & 5 deletions app/(header-default)/divers/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Metadata } from 'next';
import ConventionsCollectivesSection from '#components/conventions-collectives-section';
import Title from '#components/title-section';
import { FICHE } from '#components/title-section/tabs';
Expand All @@ -12,11 +11,12 @@ import extractParamsAppRouter, {
AppRouterProps,
} from '#utils/server-side-helper/app/extract-params';
import getSession from '#utils/server-side-helper/app/get-session';
import { Metadata } from 'next';

export const generateMetadata = async (
props: AppRouterProps
): Promise<Metadata> => {
const { slug, page, isBot } = extractParamsAppRouter(props);
const { slug, page, isBot } = await extractParamsAppRouter(props);

const uniteLegale = await cachedGetUniteLegale(slug, isBot, page);

Expand All @@ -32,19 +32,19 @@ export const generateMetadata = async (

export default async function ConventionCollectivePage(props: AppRouterProps) {
const session = await getSession();
const { slug, page, isBot } = extractParamsAppRouter(props);
const { slug, page, isBot } = await extractParamsAppRouter(props);
const uniteLegale = await cachedGetUniteLegale(slug, isBot, page);

const ccWithMetadata = await getAllIdccWithMetadata(uniteLegale.siren);

return (
<>
<div className="content-container">
<Title
ficheType={FICHE.DIVERS}
uniteLegale={uniteLegale}
session={session}
/>
<ConventionsCollectivesSection ccWithMetadata={ccWithMetadata} />
</>
</div>
);
}
4 changes: 2 additions & 2 deletions app/(header-default)/documents/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { SummaryDocuments } from './_components/summary-documents';
export const generateMetadata = async (
props: AppRouterProps
): Promise<Metadata> => {
const { slug, isBot } = extractParamsAppRouter(props);
const { slug, isBot } = await extractParamsAppRouter(props);

const uniteLegale = await cachedGetUniteLegale(slug, isBot);

Expand All @@ -39,7 +39,7 @@ export const generateMetadata = async (

const UniteLegaleDocumentPage = async (props: AppRouterProps) => {
const session = await getSession();
const { slug, isBot } = extractParamsAppRouter(props);
const { slug, isBot } = await extractParamsAppRouter(props);
const uniteLegale = await cachedGetUniteLegale(slug, isBot);

return (
Expand Down
Loading

0 comments on commit 2a6679d

Please sign in to comment.