diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 529fde905..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "extends": [ - "next/core-web-vitals", - "plugin:prettier/recommended", - "plugin:jsx-a11y/strict" - ], - "overrides": [ - { - "files": [ - "*.ts", - "*.tsx" - ], - "parserOptions": { - "project": "./tsconfig.*?.json" - }, - "rules": { - "import/no-unresolved": "error", - "import/order": [ - "error", - { - "alphabetize": { - "order": "asc", - "caseInsensitive": true - }, - "newlines-between": "always", - "groups": [ - "builtin", - "external", - "parent", - "sibling", - "index" - ], - "pathGroupsExcludedImportTypes": [ - "builtin" - ] - } - ], - "jsx-a11y/no-noninteractive-tabindex": [ - "error", - { - "roles": [ - "tabpanel" - ] - } - ], - "jsx-a11y/no-noninteractive-element-to-interactive-role": [ - "error", - { - "ul": [ - "tablist" - ] - } - ] - } - } - ], - "settings": { - "jsx-a11y": { - "components": { - "Table": "table", - "TR": "tr", - "TH": "th", - "TD": "td", - "TDLink": "td", - "IconComponent": "svg", - "Input": "input", - "Select": "select", - "Textarea": "textarea", - "SelectButton": "select" - } - } - } -} diff --git a/app/(connected)/(full-page)/consentement-cgu/ConsentementCguPage.tsx b/app/(connected)/(full-page)/consentement-cgu/ConsentementCguPage.tsx index 8b518434a..1ccf426ba 100644 --- a/app/(connected)/(full-page)/consentement-cgu/ConsentementCguPage.tsx +++ b/app/(connected)/(full-page)/consentement-cgu/ConsentementCguPage.tsx @@ -55,7 +55,7 @@ function ConsentementCguPage({ returnTo }: ConsentementCguProps) { try { await modifierDateSignatureCGU(DateTime.now()) router.push(returnTo) - } catch (e) { + } catch { setShowErrorValidation(true) } } diff --git a/app/(connected)/(full-page)/emargement/[idEvenement]/EmargementRdvPage.tsx b/app/(connected)/(full-page)/emargement/[idEvenement]/EmargementRdvPage.tsx index c5ed806af..a3ea7d786 100644 --- a/app/(connected)/(full-page)/emargement/[idEvenement]/EmargementRdvPage.tsx +++ b/app/(connected)/(full-page)/emargement/[idEvenement]/EmargementRdvPage.tsx @@ -18,7 +18,7 @@ import { Evenement } from 'interfaces/evenement' import { Session, StatutBeneficiaire } from 'interfaces/session' import { toFrenchDateTime } from 'utils/date' -type EmargementRdvPageProps = { +export type EmargementRdvPageProps = { evenement: Evenement | Session agence?: string } diff --git a/app/(connected)/(full-page)/emargement/[idEvenement]/page.tsx b/app/(connected)/(full-page)/emargement/[idEvenement]/page.tsx index fd918dfc1..b4d61cd63 100644 --- a/app/(connected)/(full-page)/emargement/[idEvenement]/page.tsx +++ b/app/(connected)/(full-page)/emargement/[idEvenement]/page.tsx @@ -1,9 +1,11 @@ import { Metadata } from 'next' import { notFound, redirect } from 'next/navigation' -import EmargementRdvPage from 'app/(connected)/(full-page)/emargement/[idEvenement]/EmargementRdvPage' +import EmargementRdvPage, { + EmargementRdvPageProps, +} from 'app/(connected)/(full-page)/emargement/[idEvenement]/EmargementRdvPage' import { PageHeaderPortal } from 'components/PageNavigationPortals' -import { Conseiller, estUserMilo } from 'interfaces/conseiller' +import { estUserMilo } from 'interfaces/conseiller' import { Evenement } from 'interfaces/evenement' import { Session } from 'interfaces/session' import { getConseillerServerSide } from 'services/conseiller.service' @@ -11,74 +13,60 @@ import { getDetailsEvenement } from 'services/evenements.service' import { getDetailsSession } from 'services/sessions.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' -type EmargementRdvParams = { idEvenement: string } -type EmargementRdvSearchParams = { type: string } - -export async function generateMetadata({ - params, - searchParams, -}: { +type EmargementRdvParams = Promise<{ idEvenement: string }> +type EmargementRdvSearchParams = Promise<{ type: string }> +type RouteProps = { params: EmargementRdvParams - searchParams: EmargementRdvSearchParams -}): Promise { - const evenementTypeSession = searchParams.type === 'session' - if (!params?.idEvenement) notFound() - - const props = await buildProps(params.idEvenement, evenementTypeSession) - - const titre = evenementTypeSession - ? (props.evenement as Session).session.nom - : (props.evenement as Evenement).titre - - return { - title: `Emargement - ${titre}`, - } + searchParams?: EmargementRdvSearchParams } -export default async function EmargementRdv({ - params, - searchParams, -}: { - params?: EmargementRdvParams - searchParams: EmargementRdvSearchParams -}) { - const evenementTypeSession = searchParams.type === 'session' - if (!params?.idEvenement) notFound() +export async function generateMetadata( + routeProps: RouteProps +): Promise { + const { titre } = await buildProps(routeProps) - const props = await buildProps(params.idEvenement, evenementTypeSession) + return { title: titre } +} - const titre = evenementTypeSession - ? (props.evenement as Session).session.nom - : (props.evenement as Evenement).titre +export default async function EmargementRdv(routeProps: RouteProps) { + const { titre, ...props } = await buildProps(routeProps) return ( <> - + - + ) } -async function buildProps( - idEvenement: string, - evenementSession: boolean -): Promise<{ - evenement: Evenement | Session - conseiller: Conseiller -}> { +async function buildProps({ + params, + searchParams, +}: { + params: EmargementRdvParams + searchParams?: EmargementRdvSearchParams +}): Promise<{ titre: string } & EmargementRdvPageProps> { const { user, accessToken } = await getMandatorySessionServerSide() if (!estUserMilo(user)) redirect('/mes-jeunes') + const { idEvenement } = await params + const { type } = (await searchParams) ?? {} + const isSession = type === 'session' + const conseiller = await getConseillerServerSide(user, accessToken) - const evenement = evenementSession + const evenement = isSession ? await getDetailsSession(user.id, idEvenement, accessToken) : await getDetailsEvenement(idEvenement, accessToken) if (!evenement) notFound() + const titreEvenement = isSession + ? (evenement as Session).session.nom + : (evenement as Evenement).titre - return { evenement, conseiller } + return { + titre: 'Emargement - ' + titreEvenement, + evenement, + agence: conseiller.structureMilo?.nom, + } } diff --git a/app/(connected)/(with-sidebar)/(with-chat)/(index)/page.tsx b/app/(connected)/(with-sidebar)/(with-chat)/(index)/page.tsx index 4b62aa5cc..27c989c87 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/(index)/page.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/(index)/page.tsx @@ -14,32 +14,31 @@ import { getMandatorySessionServerSide } from 'utils/auth/auth' export const metadata: Metadata = { title: 'Accueil' } -type HomeSearchParams = Partial<{ - redirectUrl: string - source: string - onboarding: boolean -}> +type HomeSearchParams = Promise< + Partial<{ + redirectUrl: string + source: string + onboarding: boolean + }> +> export default async function Home({ searchParams, }: { searchParams?: HomeSearchParams }) { const { user, accessToken } = await getMandatorySessionServerSide() - const sourceQueryParam = searchParams?.source - ? `?source=${searchParams.source}` - : '' - const conseiller = await getConseillerServerSide(user, accessToken) if (doitSignerLesCGU(conseiller)) redirect('/consentement-cgu') - const redirectUrl = - searchParams?.redirectUrl ?? '/mes-jeunes' + sourceQueryParam + const { source, redirectUrl, onboarding } = (await searchParams) ?? {} + const sourceQueryParam = source ? `?source=${source}` : '' + const targetPage = redirectUrl ?? '/mes-jeunes' + sourceQueryParam - const afficherModaleOnboarding = Boolean(searchParams?.onboarding) + const afficherModaleOnboarding = Boolean(onboarding) const emailEstManquant = estMilo(conseiller) && !conseiller.email const agenceEstManquante = !aEtablissement(conseiller) if (!afficherModaleOnboarding && !emailEstManquant && !agenceEstManquante) - redirect(`${redirectUrl}`) + redirect(targetPage) let referentielAgences = undefined if (!estMilo(conseiller)) { @@ -57,7 +56,7 @@ export default async function Home({ afficherModaleOnboarding={afficherModaleOnboarding} afficherModaleAgence={agenceEstManquante} afficherModaleEmail={emailEstManquant} - redirectUrl={redirectUrl} + redirectUrl={targetPage} referentielAgences={referentielAgences} /> diff --git a/app/(connected)/(with-sidebar)/(with-chat)/agenda/page.tsx b/app/(connected)/(with-sidebar)/(with-chat)/agenda/page.tsx index 5622ce246..dee6d8742 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/agenda/page.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/agenda/page.tsx @@ -10,10 +10,10 @@ export const metadata: Metadata = { title: 'Tableau de bord - Agenda', } -type AgendaSearchParams = { +type AgendaSearchParams = Promise<{ periodeIndex?: string onglet?: string -} +}> export default async function Agenda({ searchParams, }: { @@ -22,17 +22,15 @@ export default async function Agenda({ const { user } = await getMandatorySessionServerSide() if (!estUserMilo(user)) notFound() - const periodeIndex = searchParams?.periodeIndex - ? parseInt(searchParams.periodeIndex) - : 0 - const onglet = - searchParams?.onglet === 'conseiller' ? 'CONSEILLER' : 'ETABLISSEMENT' - + const { periodeIndex, onglet } = (await searchParams) ?? {} return ( <> - + ) } diff --git a/app/(connected)/(with-sidebar)/(with-chat)/etablissement/EtablissementPage.tsx b/app/(connected)/(with-sidebar)/(with-chat)/etablissement/EtablissementPage.tsx index 611c55be7..0d616c368 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/etablissement/EtablissementPage.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/etablissement/EtablissementPage.tsx @@ -164,7 +164,7 @@ function EtablissementPage() { diff --git a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/FicheBeneficiairePage.tsx b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/FicheBeneficiairePage.tsx index 3df9f79ca..7e1a0c5e9 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/FicheBeneficiairePage.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/FicheBeneficiairePage.tsx @@ -32,20 +32,16 @@ import { useConseiller } from 'utils/conseiller/conseillerContext' import { usePortefeuille } from 'utils/portefeuilleContext' const FicheBeneficiaireMilo = dynamic( - () => import('components/jeune/FicheBeneficiaireMilo'), - { ssr: false } + () => import('components/jeune/FicheBeneficiaireMilo') ) const FicheBeneficiairePasMilo = dynamic( - () => import('components/jeune/FicheBeneficiairePasMilo'), - { ssr: false } + () => import('components/jeune/FicheBeneficiairePasMilo') ) const DeleteBeneficiaireActifModal = dynamic( - () => import('components/jeune/DeleteBeneficiaireActifModal'), - { ssr: false } + () => import('components/jeune/DeleteBeneficiaireActifModal') ) const DeleteJeuneInactifModal = dynamic( - () => import('components/jeune/DeleteJeuneInactifModal'), - { ssr: false } + () => import('components/jeune/DeleteJeuneInactifModal') ) function FicheBeneficiairePage(props: FicheBeneficiaireProps) { @@ -151,7 +147,7 @@ function FicheBeneficiairePage(props: FicheBeneficiaireProps) { removeBeneficiaireFromPortefeuille(beneficiaire.id) setShowModaleSuccesDeleteBeneficiaire(true) - } catch (e) { + } catch { setShowSuppressionCompteBeneficiaireError(true) setTrackingLabel(`${pageTracking} - Erreur suppr. compte`) } finally { @@ -168,7 +164,7 @@ function FicheBeneficiairePage(props: FicheBeneficiaireProps) { removeBeneficiaireFromPortefeuille(beneficiaire.id) setShowModaleSuccesDeleteBeneficiaire(true) - } catch (e) { + } catch { setShowSuppressionCompteBeneficiaireError(true) setTrackingLabel(`${pageTracking} - Erreur suppr. compte`) } finally { diff --git a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/actions/[idAction]/DetailActionPage.tsx b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/actions/[idAction]/DetailActionPage.tsx index d182a6a5f..26c240771 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/actions/[idAction]/DetailActionPage.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/actions/[idAction]/DetailActionPage.tsx @@ -27,7 +27,7 @@ import { toLongMonthDate } from 'utils/date' import { unsafeRandomId } from 'utils/helpers' import { usePortefeuille } from 'utils/portefeuilleContext' -type DetailActionProps = { +export type DetailActionProps = { action: Action jeune: BaseBeneficiaire lectureSeule: boolean diff --git a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/actions/[idAction]/page.tsx b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/actions/[idAction]/page.tsx index 87ceed262..57e2e6c4f 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/actions/[idAction]/page.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/actions/[idAction]/page.tsx @@ -3,7 +3,9 @@ import { headers } from 'next/headers' import { notFound } from 'next/navigation' import React from 'react' -import DetailActionPage from 'app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/actions/[idAction]/DetailActionPage' +import DetailActionPage, { + DetailActionProps, +} from 'app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/actions/[idAction]/DetailActionPage' import { PageFilArianePortal, PageHeaderPortal, @@ -12,21 +14,14 @@ import { estUserMilo } from 'interfaces/conseiller' import { getAction } from 'services/actions.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' -type DetailActionParams = { idJeune: string; idAction: string } +type DetailActionParams = Promise<{ idJeune: string; idAction: string }> export async function generateMetadata({ params, }: { params: DetailActionParams }): Promise { - const { user, accessToken } = await getMandatorySessionServerSide() - if (!estUserMilo(user)) notFound() - - const actionEtJeune = await getAction(params.idAction, accessToken) - if (!actionEtJeune) notFound() - - const { action, jeune } = actionEtJeune - const lectureSeule = jeune.idConseiller !== user.id + const { action, jeune, lectureSeule } = await buildProps(params) return { title: `${action.titre} - Actions de ${jeune.prenom} ${jeune.nom} - ${ @@ -40,33 +35,35 @@ export default async function DetailAction({ }: { params: DetailActionParams }) { - const { user, accessToken } = await getMandatorySessionServerSide() - if (!estUserMilo(user)) notFound() - const { idJeune, idAction } = params + const props = await buildProps(params) - const actionEtJeune = await getAction(idAction, accessToken) - if (!actionEtJeune) notFound() - if (idJeune !== actionEtJeune.jeune.id) notFound() - - const { action, jeune } = actionEtJeune - const lectureSeule = jeune.idConseiller !== user.id - - const referer = headers().get('referer') - const refererEstPilotage = /\/pilotage$/ + const referer = (await headers()).get('referer') const from = - referer && refererEstPilotage.test(referer) ? 'pilotage' : 'beneficiaire' + referer && /\/pilotage$/.test(referer) ? 'pilotage' : 'beneficiaire' return ( <> - + ) } + +async function buildProps( + params: DetailActionParams +): Promise> { + const { user, accessToken } = await getMandatorySessionServerSide() + if (!estUserMilo(user)) notFound() + const { idJeune, idAction } = await params + + const actionEtJeune = await getAction(idAction, accessToken) + if (!actionEtJeune) notFound() + if (idJeune !== actionEtJeune.jeune.id) notFound() + + const { action, jeune } = actionEtJeune + const lectureSeule = jeune.idConseiller !== user.id + + return { action, jeune, lectureSeule } +} diff --git a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/demarches/[idDemarche]/DetailDemarchePage.tsx b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/demarches/[idDemarche]/DetailDemarchePage.tsx index f6a377657..e910989c1 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/demarches/[idDemarche]/DetailDemarchePage.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/demarches/[idDemarche]/DetailDemarchePage.tsx @@ -10,7 +10,7 @@ import useMatomo from 'utils/analytics/useMatomo' import { toLongMonthDate } from 'utils/date' import { usePortefeuille } from 'utils/portefeuilleContext' -type DetailDemarcheProps = { +export type DetailDemarcheProps = { demarche: Demarche lectureSeule: boolean isStale: boolean diff --git a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/demarches/[idDemarche]/page.tsx b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/demarches/[idDemarche]/page.tsx index 2bec44438..bb74fb648 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/demarches/[idDemarche]/page.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/demarches/[idDemarche]/page.tsx @@ -3,11 +3,14 @@ import { Metadata } from 'next' import { notFound } from 'next/navigation' import React from 'react' -import DetailDemarchePage from 'app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/demarches/[idDemarche]/DetailDemarchePage' +import DetailDemarchePage, { + DetailDemarcheProps, +} from 'app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/demarches/[idDemarche]/DetailDemarchePage' import { PageFilArianePortal, PageHeaderPortal, } from 'components/PageNavigationPortals' +import { BaseBeneficiaire } from 'interfaces/beneficiaire' import { estUserCD } from 'interfaces/conseiller' import { getDemarchesBeneficiaire, @@ -15,7 +18,7 @@ import { } from 'services/beneficiaires.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' -type DetailDemarcheParams = { idJeune: string; idDemarche: string } +type DetailDemarcheParams = Promise<{ idJeune: string; idDemarche: string }> export async function generateMetadata({ params, @@ -37,27 +40,26 @@ export default async function DetailDemarche({ }: { params: DetailDemarcheParams }) { - const { demarche, lectureSeule, isStale } = await getDemarcheProps(params) + const { beneficiaire, ...props } = await getDemarcheProps(params) return ( <> - + ) } -async function getDemarcheProps({ idJeune, idDemarche }: DetailDemarcheParams) { +async function getDemarcheProps( + params: DetailDemarcheParams +): Promise { const { user, accessToken } = await getMandatorySessionServerSide() if (!estUserCD(user)) notFound() const trenteJoursAvant = DateTime.now().minus({ day: 30 }).startOf('day') + const { idJeune, idDemarche } = await params const demarches = await getDemarchesBeneficiaire( idJeune, diff --git a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/favoris/page.tsx b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/favoris/page.tsx index 5c13b3c0e..86e9f7c60 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/favoris/page.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/favoris/page.tsx @@ -12,7 +12,8 @@ import { getOffres, getRecherchesSauvegardees } from 'services/favoris.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' import { ApiError } from 'utils/httpClient' -type FavorisParams = { idJeune: string } +type FavorisParams = Promise<{ idJeune: string }> + export async function generateMetadata({ params, }: { @@ -20,7 +21,8 @@ export async function generateMetadata({ }): Promise { const { user, accessToken } = await getMandatorySessionServerSide() - const beneficiaire = await getJeuneDetails(params.idJeune, accessToken) + const { idJeune } = await params + const beneficiaire = await getJeuneDetails(idJeune, accessToken) if (!beneficiaire) notFound() const lectureSeule = beneficiaire.idConseiller !== user.id @@ -32,7 +34,7 @@ export async function generateMetadata({ export default async function Favoris({ params }: { params: FavorisParams }) { const { user, accessToken } = await getMandatorySessionServerSide() - const idJeune = params.idJeune + const { idJeune } = await params const beneficiaire = await getJeuneDetails(idJeune, accessToken) if (!beneficiaire) notFound() diff --git a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/informations/page.tsx b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/informations/page.tsx index a01c50cae..114082530 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/informations/page.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/informations/page.tsx @@ -18,16 +18,19 @@ import { } from 'services/beneficiaires.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' -type InformationsParams = { idJeune: string } -type InformationsSearchParams = Partial<{ onglet: Onglet }> +type InformationsParams = Promise<{ idJeune: string }> +type InformationsSearchParams = Promise> +type RouteProps = { + params: InformationsParams + searchParams?: InformationsSearchParams +} export async function generateMetadata({ params, -}: { - params: InformationsParams -}): Promise { +}: RouteProps): Promise { const { user, accessToken } = await getMandatorySessionServerSide() - const beneficiaire = await getJeuneDetails(params.idJeune, accessToken) + const { idJeune } = await params + const beneficiaire = await getJeuneDetails(idJeune, accessToken) if (!beneficiaire) notFound() const lectureSeule = user.id !== beneficiaire.idConseiller @@ -39,20 +42,19 @@ export async function generateMetadata({ export default async function Informations({ params, searchParams, -}: { - params: InformationsParams - searchParams?: InformationsSearchParams -}) { +}: RouteProps) { const { user, accessToken } = await getMandatorySessionServerSide() - const beneficiaire = await getJeuneDetails(params.idJeune, accessToken) + const { idJeune } = await params + const beneficiaire = await getJeuneDetails(idJeune, accessToken) if (!beneficiaire) notFound() const [metadonneesJeune, conseillers] = await Promise.all([ - getMetadonneesFavorisJeune(params.idJeune, accessToken), + getMetadonneesFavorisJeune(idJeune, accessToken), getConseillersDuJeuneServerSide(beneficiaire.id, accessToken), ]) const lectureSeule = beneficiaire.idConseiller !== user.id + const { onglet } = (await searchParams) ?? {} return ( <> @@ -65,7 +67,7 @@ export default async function Informations({ lectureSeule={lectureSeule} beneficiaire={beneficiaire} metadonneesFavoris={metadonneesJeune} - onglet={searchParamToOnglet(searchParams?.onglet, !estUserMilo(user))} + onglet={searchParamToOnglet(onglet, !estUserMilo(user))} /> ) diff --git a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/page.tsx b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/page.tsx index f9f46f131..ee58924ec 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/page.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/page.tsx @@ -42,16 +42,19 @@ import { getSessionsMiloBeneficiaire } from 'services/sessions.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' import { compareDates } from 'utils/date' -type FicheBeneficiaireParams = { idJeune: string } -type FicheBeneficiaireSearchParams = { page?: string; onglet?: string } +type FicheBeneficiaireParams = Promise<{ idJeune: string }> +type FicheBeneficiaireSearchParams = Promise<{ page?: string; onglet?: string }> +type RouteProps = { + params: FicheBeneficiaireParams + searchParams?: FicheBeneficiaireSearchParams +} export async function generateMetadata({ params, -}: { - params: FicheBeneficiaireParams -}): Promise { +}: RouteProps): Promise { const { user, accessToken } = await getMandatorySessionServerSide() - const jeune = await getJeuneDetails(params.idJeune, accessToken) + const { idJeune } = await params + const jeune = await getJeuneDetails(idJeune, accessToken) if (!jeune) notFound() if (jeune.idConseiller !== user.id) { @@ -59,29 +62,22 @@ export async function generateMetadata({ } return { title: `Portefeuille - ${jeune.prenom} ${jeune.nom}` } } - export default async function FicheBeneficiaire({ params, searchParams, -}: { - params: FicheBeneficiaireParams - searchParams?: FicheBeneficiaireSearchParams -}) { +}: RouteProps) { const { user, accessToken } = await getMandatorySessionServerSide() + const { idJeune } = await params const [conseiller, beneficiaire, metadonneesFavoris] = await Promise.all([ getConseillerServerSide(user, accessToken), - getJeuneDetails(params.idJeune, accessToken), - getMetadonneesFavorisJeune(params.idJeune, accessToken), + getJeuneDetails(idJeune, accessToken), + getMetadonneesFavorisJeune(idJeune, accessToken), ]) if (!beneficiaire) notFound() - const page = searchParams?.page ? parseInt(searchParams.page) : 1 - const ongletInitial = getOngletInitial( - searchParams?.onglet, - user, - metadonneesFavoris - ) + const { page, onglet } = (await searchParams) ?? {} + const ongletInitial = getOngletInitial(onglet, user, metadonneesFavoris) return ( <> @@ -93,7 +89,7 @@ export default async function FicheBeneficiaire({ conseiller, beneficiaire, accessToken, - page, + page ? parseInt(page) : 1, ongletInitial, metadonneesFavoris ))} @@ -153,7 +149,7 @@ async function renderFicheMilo( accessToken, DateTime.now().startOf('day') ) - } catch (e) { + } catch { erreurSessions = true } } diff --git a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/rendez-vous-passes/page.tsx b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/rendez-vous-passes/page.tsx index aef9d5aaa..317239c16 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/rendez-vous-passes/page.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/[idJeune]/rendez-vous-passes/page.tsx @@ -13,7 +13,7 @@ import { getJeuneDetails } from 'services/beneficiaires.service' import { getRendezVousJeune } from 'services/evenements.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' -type RendezVousPassesParams = { idJeune: string } +type RendezVousPassesParams = Promise<{ idJeune: string }> export async function generateMetadata({ params, @@ -21,7 +21,8 @@ export async function generateMetadata({ params: RendezVousPassesParams }): Promise { const { accessToken } = await getMandatorySessionServerSide() - const beneficiaire = await getJeuneDetails(params.idJeune, accessToken) + const { idJeune } = await params + const beneficiaire = await getJeuneDetails(idJeune, accessToken) if (!beneficiaire) notFound() return { @@ -35,15 +36,12 @@ export default async function RendezVousPasses({ params: RendezVousPassesParams }) { const { accessToken, user } = await getMandatorySessionServerSide() + const { idJeune } = await params const [beneficiaire, rdvs] = await Promise.all([ - getJeuneDetails(params.idJeune, accessToken), + getJeuneDetails(idJeune, accessToken), estUserMilo(user) - ? await getRendezVousJeune( - params.idJeune, - PeriodeEvenements.PASSES, - accessToken - ) + ? await getRendezVousJeune(idJeune, PeriodeEvenements.PASSES, accessToken) : [], ]) if (!beneficiaire) notFound() diff --git a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/listes-de-diffusion/ListesDiffusionPage.tsx b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/listes-de-diffusion/ListesDiffusionPage.tsx index 78889f71a..2d460077f 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/listes-de-diffusion/ListesDiffusionPage.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/listes-de-diffusion/ListesDiffusionPage.tsx @@ -1,7 +1,7 @@ 'use client' import { withTransaction } from '@elastic/apm-rum-react' -import React, { useEffect, useState } from 'react' +import React, { ReactElement, useEffect, useState } from 'react' import EmptyState from 'components/EmptyState' import PageActionsPortal from 'components/PageActionsPortal' @@ -151,7 +151,7 @@ function ListesDiffusionPage({ listesDiffusion }: ListesDiffusionPageProps) { ) } -function TitreListe({ liste }: { liste: ListeDeDiffusion }): JSX.Element { +function TitreListe({ liste }: { liste: ListeDeDiffusion }): ReactElement { const informationLabel = 'Un ou plusieurs bénéficiaires de cette liste ont été réaffectés temporairement.' diff --git a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/page.tsx b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/page.tsx index 54d8644f8..e320b04af 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/page.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/mes-jeunes/page.tsx @@ -15,7 +15,7 @@ import { getMandatorySessionServerSide } from 'utils/auth/auth' export const metadata: Metadata = { title: 'Portefeuille' } -type PortfeuilleSearchParams = Partial<{ source: string }> +type PortfeuilleSearchParams = Promise> export default async function Portefeuille({ searchParams, }: { @@ -58,14 +58,16 @@ export default async function Portefeuille({ })) } - beneficiairesAvecCompteurs.sort(compareBeneficiairesByNom) + const beneficiairesAlphabetiques = beneficiairesAvecCompteurs.toSorted( + compareBeneficiairesByNom + ) return ( <> ) diff --git a/app/(connected)/(with-sidebar)/(with-chat)/offres/RechercheOffresPage.tsx b/app/(connected)/(with-sidebar)/(with-chat)/offres/RechercheOffresPage.tsx index 3758e5119..988a952c7 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/offres/RechercheOffresPage.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/offres/RechercheOffresPage.tsx @@ -150,7 +150,7 @@ function RechercheOffresPage() { setPageCourante(page) setNbPages(nombrePages) setTrackingTitle(pageTracking + ' - Résultats') - } catch (e) { + } catch { nettoyerResultats() setSearchError('Une erreur est survenue. Vous pouvez réessayer') setTrackingTitle(pageTracking + ' - Erreur') diff --git a/app/(connected)/(with-sidebar)/(with-chat)/offres/[typeOffre]/[idOffre]/page.tsx b/app/(connected)/(with-sidebar)/(with-chat)/offres/[typeOffre]/[idOffre]/page.tsx index 60ea7e178..b58c3a703 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/offres/[typeOffre]/[idOffre]/page.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/offres/[typeOffre]/[idOffre]/page.tsx @@ -13,7 +13,7 @@ import { getOffreEmploiServerSide } from 'services/offres-emploi.service' import { getServiceCiviqueServerSide } from 'services/services-civiques.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' -type OffreParams = { typeOffre: string; idOffre: string } +type OffreParams = Promise<{ typeOffre: string; idOffre: string }> export async function generateMetadata({ params, @@ -37,11 +37,11 @@ export default async function Offre({ params }: { params: OffreParams }) { ) } -async function fetchOffre({ - typeOffre, - idOffre, -}: OffreParams): Promise<{ offre: DetailOffre; header: string }> { +async function fetchOffre( + params: OffreParams +): Promise<{ offre: DetailOffre; header: string }> { const { accessToken } = await getMandatorySessionServerSide() + const { idOffre, typeOffre } = await params let offre: DetailOffre | undefined let header: string diff --git a/app/(connected)/(with-sidebar)/(with-chat)/pilotage/page.tsx b/app/(connected)/(with-sidebar)/(with-chat)/pilotage/page.tsx index 53198b23e..0ddbc451d 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/pilotage/page.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/pilotage/page.tsx @@ -27,7 +27,7 @@ export const metadata: Metadata = { title: 'Pilotage', } -type PilotageSearchParams = Partial<{ onglet: string }> +type PilotageSearchParams = Promise> export default async function Pilotage({ searchParams, }: { @@ -60,13 +60,13 @@ export default async function Pilotage({ if (peutAccederAuxSessions(conseiller)) { try { sessions = await getSessionsACloreServerSide(user.id, accessToken) - } catch (_e) { + } catch { sessions = undefined } } let onglet: Onglet = 'ACTIONS' - switch (searchParams?.onglet) { + switch ((await searchParams)?.onglet) { case 'animationsCollectives': onglet = 'ANIMATIONS_COLLECTIVES' break diff --git a/app/(connected)/(with-sidebar)/(with-chat)/plan-du-site/page.tsx b/app/(connected)/(with-sidebar)/(with-chat)/plan-du-site/page.tsx index a7f60ff49..75c5b9098 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/plan-du-site/page.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/plan-du-site/page.tsx @@ -13,7 +13,7 @@ export const metadata: Metadata = { } export default async function PlanDuSite() { - const referer = headers().get('referer') + const referer = (await headers()).get('referer') const returnTo = referer && !redirectedFromHome(referer) ? referer : '/mes-jeunes' diff --git a/app/(connected)/(with-sidebar)/(with-chat)/profil/ProfilPage.tsx b/app/(connected)/(with-sidebar)/(with-chat)/profil/ProfilPage.tsx index 953a0ae07..ea171ec10 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/profil/ProfilPage.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/profil/ProfilPage.tsx @@ -19,12 +19,10 @@ import { useConseiller } from 'utils/conseiller/conseillerContext' import { usePortefeuille } from 'utils/portefeuilleContext' const ConfirmationDeleteConseillerModal = dynamic( - () => import('components/ConfirmationDeleteConseillerModal'), - { ssr: false } + () => import('components/ConfirmationDeleteConseillerModal') ) const ConfirmationSuppressionCompteConseillerModal = dynamic( - () => import('components/ConfirmationSuppressionCompteConseillerModal'), - { ssr: false } + () => import('components/ConfirmationSuppressionCompteConseillerModal') ) type ProfilProps = { diff --git a/app/(connected)/(with-sidebar)/(with-chat)/reaffectation/ReaffectationPage.tsx b/app/(connected)/(with-sidebar)/(with-chat)/reaffectation/ReaffectationPage.tsx index 6cbdbdab6..3e05ca275 100644 --- a/app/(connected)/(with-sidebar)/(with-chat)/reaffectation/ReaffectationPage.tsx +++ b/app/(connected)/(with-sidebar)/(with-chat)/reaffectation/ReaffectationPage.tsx @@ -42,8 +42,7 @@ type StructureReaffectation = | StructureConseiller.POLE_EMPLOI_AIJ const ConseillerIntrouvableSuggestionModal = dynamic( - () => import('components/ConseillerIntrouvableSuggestionModal'), - { ssr: false } + () => import('components/ConseillerIntrouvableSuggestionModal') ) type ReaffectationProps = { @@ -306,7 +305,7 @@ function ReaffectationPage({ estSuperviseurResponsable }: ReaffectationProps) { resetAll() setAlerte(AlerteParam.reaffectation) setTrackingTitle('Réaffectation jeunes – Etape 1 – Succès réaff.') - } catch (erreur) { + } catch { setErreurReaffectation( 'Suite à un problème inconnu la réaffectation a échoué. Vous pouvez réessayer.' ) @@ -317,7 +316,7 @@ function ReaffectationPage({ estSuperviseurResponsable }: ReaffectationProps) { } function getErreurs(): LigneErreur[] { - let erreurs = [] + const erreurs = [] if (isReaffectationTemporaire.error) erreurs.push({ ancre: '#structure-reaffectation--CEJ', diff --git a/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/DetailsSessionPage.tsx b/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/DetailsSessionPage.tsx index 9a82b271e..bc9214215 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/DetailsSessionPage.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/DetailsSessionPage.tsx @@ -30,8 +30,7 @@ import { toFrenchDateTime, toShortDate } from 'utils/date' import { usePortefeuille } from 'utils/portefeuilleContext' const DesinscriptionBeneficiaireModal = dynamic( - () => import('components/session-imilo/DesinscriptionBeneficiaireModal'), - { ssr: false } + () => import('components/session-imilo/DesinscriptionBeneficiaireModal') ) type DetailSessionProps = { diff --git a/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/cloture/ClotureSessionPage.tsx b/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/cloture/ClotureSessionPage.tsx index ade54f564..29720facf 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/cloture/ClotureSessionPage.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/cloture/ClotureSessionPage.tsx @@ -138,7 +138,7 @@ function ClotureSessionPage({ liste: InformationBeneficiaireSession[] ) { liste.forEach((beneficiaire: InformationBeneficiaireSession) => { - return setEmargements((currentEmargements: any) => { + return setEmargements((currentEmargements) => { return metAJourListeBeneficiairesEmarges( currentEmargements, beneficiaire diff --git a/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/cloture/page.tsx b/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/cloture/page.tsx index a23cb2205..258e8c626 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/cloture/page.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/cloture/page.tsx @@ -12,23 +12,20 @@ import { getConseillerServerSide } from 'services/conseiller.service' import { getDetailsSession } from 'services/sessions.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' -type ClotureSessionParams = { - idSession: string +type ClotureSessionParams = Promise<{ idSession: string }> +type ClotureSessionSearchParams = Promise> +type RouteProps = { + params: ClotureSessionParams + searchParams?: ClotureSessionSearchParams } -type ClotureSessionSearchParams = Partial<{ redirectUrl: string }> export async function generateMetadata({ params, -}: { - params: ClotureSessionParams -}): Promise { +}: RouteProps): Promise { const { user, accessToken } = await getMandatorySessionServerSide() + const { idSession } = await params - const session = await getDetailsSession( - user.id, - params.idSession, - accessToken - ) + const session = await getDetailsSession(user.id, idSession, accessToken) if (!session) notFound() @@ -36,24 +33,17 @@ export async function generateMetadata({ title: `Clore - Session ${session.offre.titre}`, } } - export default async function ClotureSession({ params, searchParams, -}: { - params: ClotureSessionParams - searchParams?: ClotureSessionSearchParams -}) { +}: RouteProps) { const { user, accessToken } = await getMandatorySessionServerSide() const conseiller = await getConseillerServerSide(user, accessToken) if (!peutAccederAuxSessions(conseiller)) redirect('/mes-jeunes') - const session = await getDetailsSession( - user.id, - params.idSession, - accessToken - ) + const { idSession } = await params + const session = await getDetailsSession(user.id, idSession, accessToken) if (!session) notFound() if (session?.session.statut !== StatutAnimationCollective.AClore) notFound() @@ -61,9 +51,8 @@ export default async function ClotureSession({ return { idJeune: inscription.idJeune, statut: inscription.statut } }) - const redirectParam = searchParams?.redirectUrl - ? `?redirectUrl=${searchParams.redirectUrl}` - : '' + const { redirectUrl } = (await searchParams) ?? {} + const redirectParam = redirectUrl ? `?redirectUrl=${redirectUrl}` : '' const returnTo = `/agenda/sessions/${session.session.id}${redirectParam}` return ( diff --git a/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/page.tsx b/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/page.tsx index 7fe7157cc..c3fdaf384 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/page.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/agenda/sessions/[idSession]/page.tsx @@ -14,45 +14,39 @@ import { getDetailsSession } from 'services/sessions.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' import { redirectedFromHome } from 'utils/helpers' -type DetailsSessionParams = { - idSession: string +type DetailsSessionParams = Promise<{ idSession: string }> +type DetailsSessionSearchParams = Promise> +type RouteProps = { + params: DetailsSessionParams + searchParams?: DetailsSessionSearchParams } -type DetailsSessionSearchParams = Partial<{ redirectUrl: string }> export async function generateMetadata({ params, -}: { - params: DetailsSessionParams -}): Promise { +}: RouteProps): Promise { const { user, accessToken } = await getMandatorySessionServerSide() + const { idSession } = await params - const session = await getDetailsSession( - user.id, - params.idSession, - accessToken - ) + const session = await getDetailsSession(user.id, idSession, accessToken) return { title: `Détail session ${session?.session.nom} - Agenda`, } } - export default async function DetailsSession({ params, searchParams, -}: { - params: DetailsSessionParams - searchParams?: DetailsSessionSearchParams -}) { +}: RouteProps) { const { user, accessToken } = await getMandatorySessionServerSide() if (!estUserMilo(user)) notFound() - const idSession = params.idSession + const { idSession } = await params + const { redirectUrl } = (await searchParams) ?? {} - let redirectTo = searchParams?.redirectUrl + let redirectTo = redirectUrl if (!redirectTo) { - const referer = headers().get('referer') + const referer = (await headers()).get('referer') redirectTo = referer && !redirectedFromHome(referer) ? referer : '/mes-jeunes' } diff --git a/app/(connected)/(with-sidebar)/(without-chat)/evenements/[id_evenement]/cloture/CloturePage.tsx b/app/(connected)/(with-sidebar)/(without-chat)/evenements/[idEvenement]/cloture/CloturePage.tsx similarity index 100% rename from app/(connected)/(with-sidebar)/(without-chat)/evenements/[id_evenement]/cloture/CloturePage.tsx rename to app/(connected)/(with-sidebar)/(without-chat)/evenements/[idEvenement]/cloture/CloturePage.tsx diff --git a/app/(connected)/(with-sidebar)/(without-chat)/evenements/[id_evenement]/cloture/page.tsx b/app/(connected)/(with-sidebar)/(without-chat)/evenements/[idEvenement]/cloture/page.tsx similarity index 74% rename from app/(connected)/(with-sidebar)/(without-chat)/evenements/[id_evenement]/cloture/page.tsx rename to app/(connected)/(with-sidebar)/(without-chat)/evenements/[idEvenement]/cloture/page.tsx index 1f39fbe96..af402f3fa 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/evenements/[id_evenement]/cloture/page.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/evenements/[idEvenement]/cloture/page.tsx @@ -1,7 +1,7 @@ import { Metadata } from 'next' import { notFound, redirect } from 'next/navigation' -import CloturePage from 'app/(connected)/(with-sidebar)/(without-chat)/evenements/[id_evenement]/cloture/CloturePage' +import CloturePage from 'app/(connected)/(with-sidebar)/(without-chat)/evenements/[idEvenement]/cloture/CloturePage' import { PageHeaderPortal, PageRetourPortal, @@ -15,8 +15,8 @@ export const metadata: Metadata = { title: 'Clore - Mes événements', } -type ClotureParams = { id_evenement: string } -type ClotureSearchParams = Partial<{ redirectUrl: string }> +type ClotureParams = Promise<{ idEvenement: string }> +type ClotureSearchParams = Promise> export default async function Cloture({ params, searchParams, @@ -27,12 +27,12 @@ export default async function Cloture({ const { user, accessToken } = await getMandatorySessionServerSide() if (!estUserMilo(user)) redirect('/mes-jeunes') - const evenement = await getDetailsEvenement(params.id_evenement, accessToken) + const { idEvenement } = await params + const evenement = await getDetailsEvenement(idEvenement, accessToken) if (evenement?.statut !== StatutAnimationCollective.AClore) notFound() - const redirectParam = searchParams?.redirectUrl - ? `&redirectUrl=${searchParams.redirectUrl}` - : '' + const { redirectUrl } = (await searchParams) ?? {} + const redirectParam = redirectUrl ? `&redirectUrl=${redirectUrl}` : '' const returnTo = `/mes-jeunes/edition-rdv?idRdv=${evenement.id}${redirectParam}` return ( diff --git a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/[idJeune]/actions/[idAction]/modification/page.tsx b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/[idJeune]/actions/[idAction]/modification/page.tsx index 55bdf44d1..88aa453ee 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/[idJeune]/actions/[idAction]/modification/page.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/[idJeune]/actions/[idAction]/modification/page.tsx @@ -17,7 +17,7 @@ import { getActionsPredefinies } from 'services/referentiel.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' import { unsafeRandomId } from 'utils/helpers' -type ModificationActionParams = { idAction: string } +type ModificationActionParams = Promise<{ idAction: string }> export async function generateMetadata({ params, @@ -25,25 +25,26 @@ export async function generateMetadata({ params: ModificationActionParams }): Promise { const { accessToken } = await getMandatorySessionServerSide() - const actionContent = await getAction(params.idAction, accessToken) + const { idAction } = await params + const actionContent = await getAction(idAction, accessToken) return { title: `Modifier l’action ${actionContent?.action.titre} - ${actionContent?.jeune.prenom} ${actionContent?.jeune.nom}`, } } -type ModificationParams = { idAction: string } export default async function ModificationAction({ params, }: { - params: ModificationParams + params: ModificationActionParams }) { const { user, accessToken } = await getMandatorySessionServerSide() if (!estUserMilo(user)) notFound() + const { idAction } = await params const [actionContent, situationsNonProfessionnelles, actionsPredefinies] = await Promise.all([ - getAction(params.idAction, accessToken), + getAction(idAction, accessToken), getSituationsNonProfessionnelles({ avecNonSNP: false }, accessToken), getActionsPredefinies(accessToken), ]) diff --git a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/[idJeune]/actions/[idAction]/qualification/page.tsx b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/[idJeune]/actions/[idAction]/qualification/page.tsx index dda277f9a..dd7c48b63 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/[idJeune]/actions/[idAction]/qualification/page.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/[idJeune]/actions/[idAction]/qualification/page.tsx @@ -12,18 +12,21 @@ import { estUserMilo } from 'interfaces/conseiller' import { getMandatorySessionServerSide } from 'utils/auth/auth' import { unsafeRandomId } from 'utils/helpers' -type QualificationParams = { idAction: string } -type QualificationSearchParams = Partial<{ liste: string }> +type QualificationParams = Promise<{ idAction: string }> +type QualificationSearchParams = Promise> +type RouteProps = { + params: QualificationParams + searchParams?: QualificationSearchParams +} export async function generateMetadata({ params, -}: { - params: QualificationParams -}): Promise { +}: RouteProps): Promise { const { accessToken } = await getMandatorySessionServerSide() const { getAction } = await import('services/actions.service') - const actionContent = await getAction(params.idAction, accessToken) + const { idAction } = await params + const actionContent = await getAction(idAction, accessToken) return { title: `Qualifier l’action ${actionContent?.action.titre} - ${actionContent?.jeune.prenom} ${actionContent?.jeune.prenom}`, @@ -32,18 +35,16 @@ export async function generateMetadata({ export default async function Qualification({ params, searchParams, -}: { - params: QualificationParams - searchParams?: QualificationSearchParams -}) { +}: RouteProps) { const { user, accessToken } = await getMandatorySessionServerSide() if (!estUserMilo(user)) notFound() const { getAction, getSituationsNonProfessionnelles } = await import( 'services/actions.service' ) + const { idAction } = await params const [actionContent, categories] = await Promise.all([ - getAction(params.idAction, accessToken), + getAction(idAction, accessToken), getSituationsNonProfessionnelles({ avecNonSNP: true }, accessToken), ]) if (!actionContent) notFound() @@ -52,9 +53,10 @@ export default async function Qualification({ if (action.status !== StatutAction.Terminee) notFound() // FIXME : dirty fix, problème de l’action + const { liste } = (await searchParams) ?? {} const returnTo = `/mes-jeunes/${jeune.id}/actions/${action.id}?misc=${unsafeRandomId()}` const returnToListe = - searchParams?.liste === 'pilotage' + liste === 'pilotage' ? '/pilotage' : `/mes-jeunes/${jeune.id}?onglet=actions` diff --git a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/[idJeune]/actions/nouvelle-action/page.tsx b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/[idJeune]/actions/nouvelle-action/page.tsx index fc7d364cd..7ceafddf2 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/[idJeune]/actions/nouvelle-action/page.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/[idJeune]/actions/nouvelle-action/page.tsx @@ -11,7 +11,7 @@ import { getIdentitesBeneficiairesServerSide } from 'services/beneficiaires.serv import { getActionsPredefinies } from 'services/referentiel.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' -type NouvelleActionParams = { idJeune: string } +type NouvelleActionParams = Promise<{ idJeune: string }> export async function generateMetadata({ params, @@ -19,8 +19,9 @@ export async function generateMetadata({ params: NouvelleActionParams }): Promise { const { user, accessToken } = await getMandatorySessionServerSide() + const { idJeune } = await params const [beneficiaire] = await getIdentitesBeneficiairesServerSide( - [params.idJeune], + [idJeune], user.id, accessToken ) @@ -41,14 +42,15 @@ export default async function NouvelleAction({ getActionsPredefinies(accessToken), ]) - const returnTo = `/mes-jeunes/${params.idJeune}?onglet=actions` + const { idJeune } = await params + const returnTo = `/mes-jeunes/${idJeune}?onglet=actions` return ( <> import('components/ConfirmationUpdateRdvModal'), - { ssr: false } + () => import('components/ConfirmationUpdateRdvModal') ) const LeavePageConfirmationModal = dynamic( - () => import('components/LeavePageConfirmationModal'), - { ssr: false } + () => import('components/LeavePageConfirmationModal') ) -const DeleteRdvModal = dynamic(() => import('components/rdv/DeleteRdvModal'), { - ssr: false, -}) +const DeleteRdvModal = dynamic(() => import('components/rdv/DeleteRdvModal')) export type EditionRdvProps = { conseillerEstObservateur: boolean @@ -197,7 +193,7 @@ function EditionRdvPage({ : AlerteParam.suppressionRDV setAlerte(alertType) router.push(returnTo) - } catch (e) { + } catch { setShowDeleteRdvError(true) } } diff --git a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/edition-rdv/page.tsx b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/edition-rdv/page.tsx index 04169ae99..b789705e5 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/edition-rdv/page.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/edition-rdv/page.tsx @@ -29,13 +29,14 @@ import { import { getMandatorySessionServerSide } from 'utils/auth/auth' import { redirectedFromHome } from 'utils/helpers' -type EditionRdvSearchParams = Partial<{ - idRdv: string - type: string - idJeune: string - redirectUrl: string -}> - +type EditionRdvSearchParams = Promise< + Partial<{ + idRdv: string + type: string + idJeune: string + redirectUrl: string + }> +> export async function generateMetadata({ searchParams, }: { @@ -65,8 +66,8 @@ export default async function EditionRdv({ searchParams?: EditionRdvSearchParams }) { const props = await buildProps(searchParams) - const referer = headers().get('referer') - const redirectUrl = searchParams?.redirectUrl + const referer = (await headers()).get('referer') + const redirectUrl = (await searchParams)?.redirectUrl const returnTo = redirectUrl || @@ -106,13 +107,15 @@ export default async function EditionRdv({ } async function buildProps( - searchParams: EditionRdvSearchParams | undefined + searchParams?: EditionRdvSearchParams ): Promise> { const { user, accessToken } = await getMandatorySessionServerSide() if (!estUserMilo(user)) redirect('/mes-jeunes') - if (searchParams?.idRdv) { - const evenement = await getDetailsEvenement(searchParams.idRdv, accessToken) + const { idRdv, idJeune, type } = (await searchParams) ?? {} + + if (idRdv) { + const evenement = await getDetailsEvenement(idRdv, accessToken) if (!evenement) notFound() const beneficiaires = await getBeneficiairesDuConseillerServerSide( @@ -123,11 +126,7 @@ async function buildProps( } const typesEvenements = await getTypesRendezVous(accessToken) - return buildPropsCreationEvenement( - typesEvenements, - searchParams?.type === 'ac', - searchParams?.idJeune - ) + return buildPropsCreationEvenement(typesEvenements, type === 'ac', idJeune) } function buildPropsModificationEvenement( diff --git a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/envoi-message-groupe/EnvoiMessageGroupePage.tsx b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/envoi-message-groupe/EnvoiMessageGroupePage.tsx index 81381778d..a5aa24b42 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/envoi-message-groupe/EnvoiMessageGroupePage.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/envoi-message-groupe/EnvoiMessageGroupePage.tsx @@ -35,8 +35,7 @@ import { ApiError } from 'utils/httpClient' import { usePortefeuille } from 'utils/portefeuilleContext' const LeavePageConfirmationModal = dynamic( - () => import('components/LeavePageConfirmationModal'), - { ssr: false } + () => import('components/LeavePageConfirmationModal') ) type EnvoiMessageGroupeProps = { @@ -233,7 +232,7 @@ function EnvoiMessageGroupePage({ } function getErreurs(): LigneErreur[] { - let erreurs = [] + const erreurs = [] if (selectionError) erreurs.push({ ancre: '#select-beneficiaires', diff --git a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/envoi-message-groupe/page.tsx b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/envoi-message-groupe/page.tsx index 92e04344a..6a8fdbaa7 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/envoi-message-groupe/page.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/envoi-message-groupe/page.tsx @@ -24,7 +24,7 @@ export default async function EnvoiMessageGroupe() { accessToken ) - const referer = headers().get('referer') + const referer = (await headers()).get('referer') const previousUrl = referer && !redirectedFromHome(referer) ? referer : '/mes-jeunes' diff --git a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/listes-de-diffusion/edition-liste/EditionListeDiffusionPage.tsx b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/listes-de-diffusion/edition-liste/EditionListeDiffusionPage.tsx index d272cab55..dfe0929d1 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/listes-de-diffusion/edition-liste/EditionListeDiffusionPage.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/listes-de-diffusion/edition-liste/EditionListeDiffusionPage.tsx @@ -34,8 +34,7 @@ import { unsafeRandomId } from 'utils/helpers' import { usePortefeuille } from 'utils/portefeuilleContext' const ConfirmationDeleteListeDiffusionModal = dynamic( - () => import('components/ConfirmationDeleteListeDiffusionModal'), - { ssr: false } + () => import('components/ConfirmationDeleteListeDiffusionModal') ) type EditionListeDiffusionProps = { @@ -199,7 +198,7 @@ function EditionListeDiffusionPage({ } function getErreurs(): LigneErreur[] { - let erreurs = [] + const erreurs = [] if (titre.error) erreurs.push({ ancre: '#titre-liste', @@ -282,7 +281,7 @@ function EditionListeDiffusionPage({ defaultBeneficiaires={defaultBeneficiaires} required={true} error={idsBeneficiaires.error} - renderIndication={BeneficiaireIndicationReaffectaction} + Indication={BeneficiaireIndicationReaffectaction} />
diff --git a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/listes-de-diffusion/edition-liste/page.tsx b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/listes-de-diffusion/edition-liste/page.tsx index 5bedf6350..825fd41d7 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/listes-de-diffusion/edition-liste/page.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/mes-jeunes/listes-de-diffusion/edition-liste/page.tsx @@ -11,7 +11,7 @@ import { recupererListeDeDiffusion } from 'services/listes-de-diffusion.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' import { redirectedFromHome } from 'utils/helpers' -type EditionListeDiffusionSearchParams = Partial<{ idListe: string }> +type EditionListeDiffusionSearchParams = Promise> export async function generateMetadata({ searchParams, @@ -19,12 +19,10 @@ export async function generateMetadata({ searchParams?: EditionListeDiffusionSearchParams }): Promise { const { accessToken } = await getMandatorySessionServerSide() + const { idListe } = (await searchParams) ?? {} - if (searchParams?.idListe) { - const liste = await recupererListeDeDiffusion( - searchParams.idListe, - accessToken - ) + if (idListe) { + const liste = await recupererListeDeDiffusion(idListe, accessToken) if (!liste) notFound() return { title: `Modifier liste de diffusion ${liste.titre} - Portefeuille`, @@ -41,17 +39,15 @@ export default async function EditionListeDiffusion({ }) { const { accessToken } = await getMandatorySessionServerSide() - const referer = headers().get('referer') + const referer = (await headers()).get('referer') const previousUrl = referer && !redirectedFromHome(referer) ? referer : '/mes-jeunes/listes-de-diffusion' + const { idListe } = (await searchParams) ?? {} - if (searchParams?.idListe) { - const liste = await recupererListeDeDiffusion( - searchParams.idListe, - accessToken - ) + if (idListe) { + const liste = await recupererListeDeDiffusion(idListe, accessToken) if (!liste) notFound() return ( diff --git a/app/(connected)/(with-sidebar)/(without-chat)/offres/[typeOffre]/[idOffre]/partage/PartageOffrePage.tsx b/app/(connected)/(with-sidebar)/(without-chat)/offres/[typeOffre]/[idOffre]/partage/PartageOffrePage.tsx index 1b14e2f1f..d839b07f8 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/offres/[typeOffre]/[idOffre]/partage/PartageOffrePage.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/offres/[typeOffre]/[idOffre]/partage/PartageOffrePage.tsx @@ -2,7 +2,7 @@ import { withTransaction } from '@elastic/apm-rum-react' import { useRouter } from 'next/navigation' -import React, { FormEvent, useState } from 'react' +import React, { FormEvent, ReactElement, useState } from 'react' import BeneficiairesMultiselectAutocomplete, { OptionBeneficiaire, @@ -95,7 +95,7 @@ function PartageOffrePage({ offre, returnTo }: PartageOffrePageProps) { } } - function getCardOffre(): JSX.Element { + function OffreCard(): ReactElement { switch (offre.type) { case TypeOffre.EMPLOI: case TypeOffre.ALTERNANCE: @@ -111,7 +111,7 @@ function PartageOffrePage({ offre, returnTo }: PartageOffrePageProps) { return ( <> - {getCardOffre()} +
diff --git a/app/(connected)/(with-sidebar)/(without-chat)/offres/[typeOffre]/[idOffre]/partage/page.tsx b/app/(connected)/(with-sidebar)/(without-chat)/offres/[typeOffre]/[idOffre]/partage/page.tsx index ddf951cfe..2aebe79bb 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/offres/[typeOffre]/[idOffre]/partage/page.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/offres/[typeOffre]/[idOffre]/partage/page.tsx @@ -16,7 +16,7 @@ import { getServiceCiviqueServerSide } from 'services/services-civiques.service' import { getMandatorySessionServerSide } from 'utils/auth/auth' import { redirectedFromHome } from 'utils/helpers' -type PartageOffreParams = { typeOffre: string; idOffre: string } +type PartageOffreParams = Promise<{ typeOffre: string; idOffre: string }> export async function generateMetadata({ params, @@ -37,7 +37,7 @@ export default async function PartageOffre({ const offre = await fetchOffre(params) - const referer = headers().get('referer') + const referer = (await headers()).get('referer') const redirectTo = referer && !redirectedFromHome(referer) ? referer : '/offres' @@ -51,11 +51,10 @@ export default async function PartageOffre({ ) } -async function fetchOffre({ - typeOffre, - idOffre, -}: PartageOffreParams): Promise { +async function fetchOffre(params: PartageOffreParams): Promise { const { accessToken } = await getMandatorySessionServerSide() + const { typeOffre, idOffre } = await params + let offre: DetailOffre | undefined switch (typeOffre) { case 'emploi': diff --git a/app/(connected)/(with-sidebar)/(without-chat)/offres/[typeOffre]/partage-recherche/page.tsx b/app/(connected)/(with-sidebar)/(without-chat)/offres/[typeOffre]/partage-recherche/page.tsx index 1311a5926..9148691da 100644 --- a/app/(connected)/(with-sidebar)/(without-chat)/offres/[typeOffre]/partage-recherche/page.tsx +++ b/app/(connected)/(with-sidebar)/(without-chat)/offres/[typeOffre]/partage-recherche/page.tsx @@ -12,26 +12,26 @@ export const metadata: Metadata = { title: 'Partager une recherche - Recherche d’offres', } -type PartageRechercheParams = { typeOffre: string } +type PartageRechercheParams = Promise<{ typeOffre: string }> export default async function PartageRecherche({ params, searchParams, }: { params: PartageRechercheParams - searchParams: CriteresRecherche + searchParams?: Promise }) { - const referer = headers().get('referer') + const referer = (await headers()).get('referer') const redirectTo = referer ?? '/offres' - const typeOffre = urlParamToTypeOffre(params.typeOffre) + const { typeOffre } = await params return ( <> diff --git a/app/(connexion)/login/cej/page.tsx b/app/(connexion)/login/cej/page.tsx index ae61a067c..656d095ea 100644 --- a/app/(connexion)/login/cej/page.tsx +++ b/app/(connexion)/login/cej/page.tsx @@ -15,9 +15,9 @@ export const metadata: Metadata = { export default async function LoginCEJ({ searchParams, }: { - searchParams?: LoginSearchParams + searchParams?: Promise }) { - await redirectIfAlreadyConnected(searchParams) + await redirectIfAlreadyConnected(await searchParams) return } diff --git a/app/(connexion)/login/page.tsx b/app/(connexion)/login/page.tsx index 55e58fdfc..d7b291f06 100644 --- a/app/(connexion)/login/page.tsx +++ b/app/(connexion)/login/page.tsx @@ -15,9 +15,9 @@ export const metadata: Metadata = { export default async function LoginHub({ searchParams, }: { - searchParams?: LoginSearchParams + searchParams?: Promise }) { - await redirectIfAlreadyConnected(searchParams) + await redirectIfAlreadyConnected(await searchParams) return } diff --git a/app/(connexion)/login/passemploi/page.tsx b/app/(connexion)/login/passemploi/page.tsx index 37726464e..7066b831a 100644 --- a/app/(connexion)/login/passemploi/page.tsx +++ b/app/(connexion)/login/passemploi/page.tsx @@ -14,9 +14,9 @@ export const metadata: Metadata = { export default async function LoginPassEmploi({ searchParams, }: { - searchParams?: LoginSearchParams + searchParams?: Promise }) { - await redirectIfAlreadyConnected(searchParams) + await redirectIfAlreadyConnected(await searchParams) return ( } ) { const { accessToken } = await getMandatorySessionServerSide() try { - const fichierId = params.idFichier + const { idFichier } = await params redirect( - `${process.env.NEXT_PUBLIC_API_ENDPOINT}/fichiers/${fichierId}?token=${accessToken}` + `${process.env.NEXT_PUBLIC_API_ENDPOINT}/fichiers/${idFichier}?token=${accessToken}` ) } catch (error) { if (isRedirectError(error)) throw error diff --git a/app/api/milo/[numeroDossier]/route.tsx b/app/api/milo/[numeroDossier]/route.tsx index 2823534d2..67ff86779 100644 --- a/app/api/milo/[numeroDossier]/route.tsx +++ b/app/api/milo/[numeroDossier]/route.tsx @@ -8,15 +8,15 @@ import { getMandatorySessionServerSide } from 'utils/auth/auth' export async function GET( _: Request, - { params }: { params: { numeroDossier: string } } + { params }: { params: Promise<{ numeroDossier: string }> } ) { const { user, accessToken } = await getMandatorySessionServerSide() if (!estUserMilo(user)) redirect('/mes-jeunes') - const numeroDossier = params.numeroDossier + const { numeroDossier } = await params const idJeune = await getIdJeuneMilo(numeroDossier, accessToken) - const refererUrl = headers().get('referer') ?? undefined + const refererUrl = (await headers()).get('referer') ?? undefined trackSSR({ structure: StructureConseiller.MILO, diff --git a/app/autherror/page.tsx b/app/autherror/page.tsx index a98ae84d2..d9c73ccd4 100644 --- a/app/autherror/page.tsx +++ b/app/autherror/page.tsx @@ -1,14 +1,14 @@ -import { StructureConseiller } from '../../interfaces/conseiller' - import AuthErrorPage from 'app/autherror/AuthErrorPage' +import { StructureConseiller } from 'interfaces/conseiller' -type AuthErrorSearchParams = Partial<{ - reason?: string - typeUtilisateur?: string - structureUtilisateur?: string -}> - -export default function AuthError({ +type AuthErrorSearchParams = Promise< + Partial<{ + reason?: string + typeUtilisateur?: string + structureUtilisateur?: string + }> +> +export default async function AuthError({ searchParams, }: { searchParams?: AuthErrorSearchParams @@ -16,7 +16,10 @@ export default function AuthError({ let erreur: string let codeErreur: string | undefined let lienFormulaire: string | undefined - switch (searchParams?.reason) { + const { reason, typeUtilisateur, structureUtilisateur } = + (await searchParams) ?? {} + + switch (reason) { case 'UTILISATEUR_INEXISTANT': erreur = "Votre compte n'est pas enregistré sur l'application, veuillez contacter votre conseiller." @@ -42,15 +45,14 @@ export default function AuthError({ break default: { - let contacterConseiller = - searchParams?.typeUtilisateur === 'JEUNE' || - searchParams?.typeUtilisateur === 'BENEFICIAIRE' + const ouContacterConseiller = + typeUtilisateur === 'JEUNE' || typeUtilisateur === 'BENEFICIAIRE' ? ' ou contacter votre conseiller' : '' - if (searchParams?.reason === 'Callback') { + if (reason === 'Callback') { let idpName = '' - switch (searchParams?.structureUtilisateur) { + switch (structureUtilisateur) { case 'MILO': idpName = 'i-Milo' break @@ -65,21 +67,17 @@ export default function AuthError({ default: idpName = "du fournisseur d'identité" } - erreur = `Une erreur ${idpName} est survenue, veuillez réessayer ultérieurement${contacterConseiller}.` - searchParams.reason = undefined - } else if ( - searchParams?.reason === 'VerificationConseillerDepartemental' - ) { + erreur = `Une erreur ${idpName} est survenue, veuillez réessayer ultérieurement${ouContacterConseiller}.` + } else if (reason === 'VerificationConseillerDepartemental') { erreur = `Vous n'êtes pas autorisé à vous connecter. Veuiller contacter le support.` - searchParams.reason = undefined } else { - erreur = `Une erreur est survenue, veuillez fermer cette page et retenter de vous connecter.\n\nSi le problème persiste, veuillez supprimer le cache de votre navigateur${contacterConseiller}.` - codeErreur = searchParams?.reason + erreur = `Une erreur est survenue, veuillez fermer cette page et retenter de vous connecter.\n\nSi le problème persiste, veuillez supprimer le cache de votre navigateur${ouContacterConseiller}.` + codeErreur = reason } } - if (searchParams?.typeUtilisateur === 'CONSEILLER') { + if (typeUtilisateur === 'CONSEILLER') { lienFormulaire = ((): string | undefined => { - switch (searchParams.structureUtilisateur) { + switch (structureUtilisateur) { case StructureConseiller.MILO: return ( (process.env.NEXT_PUBLIC_FAQ_MILO_EXTERNAL_LINK as string) + diff --git a/components/EmptyState.tsx b/components/EmptyState.tsx index 947a5d098..dd87ef404 100644 --- a/components/EmptyState.tsx +++ b/components/EmptyState.tsx @@ -29,13 +29,19 @@ type EmptyStateWithButtonProps = EmptyStateProps & { } export function hasLien( - props: {} | { lien: EmptyStateLinkProps } | { bouton: EmptyStateButtonProps } + props: + | { lien: EmptyStateLinkProps } + | { bouton: EmptyStateButtonProps } + | object ): props is { lien: EmptyStateLinkProps } { return Object.prototype.hasOwnProperty.call(props, 'lien') } export function hasBouton( - props: {} | { lien: EmptyStateLinkProps } | { bouton: EmptyStateButtonProps } + props: + | { lien: EmptyStateLinkProps } + | { bouton: EmptyStateButtonProps } + | object ): props is { bouton: EmptyStateButtonProps } { return Object.prototype.hasOwnProperty.call(props, 'bouton') } diff --git a/components/EncartAgenceRequise.tsx b/components/EncartAgenceRequise.tsx index fb631c84b..1332b76b5 100644 --- a/components/EncartAgenceRequise.tsx +++ b/components/EncartAgenceRequise.tsx @@ -1,5 +1,5 @@ import dynamic from 'next/dynamic' -import React, { useState } from 'react' +import React, { ReactElement, useState } from 'react' import Button, { ButtonStyle } from 'components/ui/Button/Button' import IconComponent, { IconName } from 'components/ui/IconComponent' @@ -9,8 +9,7 @@ import { trackEvent } from 'utils/analytics/matomo' import { usePortefeuille } from 'utils/portefeuilleContext' const RenseignementAgenceModal = dynamic( - () => import('components/RenseignementAgenceModal'), - { ssr: false } + () => import('components/RenseignementAgenceModal') ) type EncartAgenceRequiseProps = { @@ -24,7 +23,7 @@ export default function EncartAgenceRequise({ getAgences, onAgenceChoisie, onChangeAffichageModal, -}: EncartAgenceRequiseProps): JSX.Element { +}: EncartAgenceRequiseProps): ReactElement { const [portefeuille] = usePortefeuille() const [agences, setAgences] = useState([]) const [showAgenceModal, setShowAgenceModal] = useState(false) diff --git a/components/ModalContainer.tsx b/components/ModalContainer.tsx index e9066f8a2..c60337a1f 100644 --- a/components/ModalContainer.tsx +++ b/components/ModalContainer.tsx @@ -34,12 +34,9 @@ function ModalContainer( })) const [isRendered, setIsRendered] = useState(false) const previousFocusedElement = useRef(null) - const keyListeners = useRef( - new Map([ - ['Tab', handleTabKey], - ['Escape', handleClose], - ]) - ) + const keyListeners = useRef<{ + [key: string]: (e: KeyboardEvent) => void + }>({ Tab: handleTabKey, Escape: handleClose }) function focusClose() { if (!previousFocusedElement.current) @@ -78,7 +75,7 @@ function ModalContainer( } function keyListener(e: KeyboardEvent) { - const listener = keyListeners.current.get(e.key) + const listener = keyListeners.current[e.key] return listener && listener(e) } @@ -114,7 +111,7 @@ function ModalContainer( } } -function isExternal(title: { id: string } | any): title is { id: string } { +function isExternal(title: { id: string } | object): title is { id: string } { return Object.prototype.hasOwnProperty.call(title, 'id') } diff --git a/components/chat/ChatRoom.tsx b/components/chat/ChatRoom.tsx index 612bf9f41..78f71401d 100644 --- a/components/chat/ChatRoom.tsx +++ b/components/chat/ChatRoom.tsx @@ -26,8 +26,7 @@ import { useConseiller } from 'utils/conseiller/conseillerContext' import { usePortefeuille } from 'utils/portefeuilleContext' const MessageImportantModal = dynamic( - () => import('components/chat/MessageImportantModal'), - { ssr: false } + () => import('components/chat/MessageImportantModal') ) type ChatRoomProps = { @@ -127,7 +126,7 @@ function ChatRoom( setMessageImportantPreRempli(nouveauMessageImportant) setSuccesEnvoiMessageImportant(true) - } catch (error) { + } catch { setSuccesEnvoiMessageImportant(false) } finally { setMessageImportantIsLoading(false) @@ -146,7 +145,7 @@ function ChatRoom( setMessageImportantPreRempli(undefined) setSuccesDesactivationMessageImportant(true) - } catch (error) { + } catch { setSuccesDesactivationMessageImportant(false) } finally { setMessageImportantIsLoading(false) diff --git a/components/chat/Conversation.tsx b/components/chat/Conversation.tsx index f45786d8f..33e32db19 100644 --- a/components/chat/Conversation.tsx +++ b/components/chat/Conversation.tsx @@ -345,13 +345,16 @@ export function Conversation({ }, [uploadedFileInfo]) useEffect(() => { - if (isFirstRender.current) return () => (isFirstRender.current = true) + if (isFirstRender.current) return if (messagerieEstVisible) focusDernierMessage() return () => {} }, [messagerieEstVisible]) useEffect(() => { isFirstRender.current = false + return () => { + isFirstRender.current = true + } }, []) useEffect(() => { @@ -575,8 +578,6 @@ export function Conversation({ )} - {/* onClick pour faciliter le focus sur la textarea, mouse only donc pas d'impact sur la navigation au clavier */} - {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}
inputRef.current!.focus()} diff --git a/components/chat/TexteAvecLien.tsx b/components/chat/TexteAvecLien.tsx index 6c82b3d06..61e79e0bd 100644 --- a/components/chat/TexteAvecLien.tsx +++ b/components/chat/TexteAvecLien.tsx @@ -1,4 +1,10 @@ -import parse, { domToReact } from 'html-react-parser' +import { isTag } from 'domhandler' +import { Node } from 'domhandler/lib/node' +import parse, { + DOMNode, + domToReact, + HTMLReactParserOptions, +} from 'html-react-parser' import React from 'react' import sanitizeHtml from 'sanitize-html' @@ -27,25 +33,26 @@ export default function TexteAvecLien({ function formateTexteAvecLien(texteAFormater: string) { const messageFormate = texteAFormater.split(/\r?\n|\s+/).map((mot) => { if (detecteLien(mot)) { - return ` - ${mot} - - - - ` + return ( + `` + + `${mot}` + + `` + + `` + + `` + + `` + ) } else { return mot } }) - const options = { - replace: ({ attribs, children }: any) => { - if (!attribs) { - return - } + const options: HTMLReactParserOptions = { + replace: (domNode: Node) => { + if (!isTag(domNode)) return + const { attribs, children } = domNode if (attribs.id === 'lienExterne') { - const lien = children[1] ? children[1].children[0].data : '' + const lien = (children[0] as unknown as Text).data return ( confirmationRedirectionLienExterne(e, lien)} > - {domToReact(children, options)} + {domToReact(children as DOMNode[], options)} ) } diff --git a/components/jeune/BeneficiairesMultiselectAutocomplete.tsx b/components/jeune/BeneficiairesMultiselectAutocomplete.tsx index edf7f5e00..f7882cbc0 100644 --- a/components/jeune/BeneficiairesMultiselectAutocomplete.tsx +++ b/components/jeune/BeneficiairesMultiselectAutocomplete.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef, useState } from 'react' +import React, { ReactElement, useEffect, useRef, useState } from 'react' import { ButtonStyle } from '../ui/Button/Button' import ButtonLink from '../ui/Button/ButtonLink' @@ -31,7 +31,7 @@ interface BeneficiairesMultiselectAutocompleteProps { defaultBeneficiaires?: OptionBeneficiaire[] error?: string disabled?: boolean - renderIndication?: (props: { value: string; id: string }) => JSX.Element + Indication?: (props: { value: string; id: string }) => ReactElement ariaDescribedBy?: string lienExport?: string trackExport?: () => void @@ -56,7 +56,7 @@ export default function BeneficiairesMultiselectAutocomplete({ error, defaultBeneficiaires = [], disabled, - renderIndication, + Indication, ariaDescribedBy, trackExport, lienExport, @@ -327,7 +327,7 @@ export default function BeneficiairesMultiselectAutocomplete({ typeSelection='beneficiaire' unselect={deselectionnerOption} onYieldFocus={() => inputRef.current!.focus()} - renderIndication={renderIndication} + Indication={Indication} disabled={disabled} /> )} diff --git a/components/jeune/DetailsJeune.tsx b/components/jeune/DetailsJeune.tsx index e833781ea..3c8df8389 100644 --- a/components/jeune/DetailsJeune.tsx +++ b/components/jeune/DetailsJeune.tsx @@ -21,8 +21,7 @@ import { useAlerte } from 'utils/alerteContext' import { trackEvent } from 'utils/analytics/matomo' const UpdateIdentifiantPartenaireModal = dynamic( - () => import('components/jeune/UpdateIdentifiantPartenaireModal'), - { ssr: false } + () => import('components/jeune/UpdateIdentifiantPartenaireModal') ) interface DetailsJeuneProps { diff --git a/components/jeune/DossierBeneficiaireMilo.tsx b/components/jeune/DossierBeneficiaireMilo.tsx index cc978ddac..794b880f2 100644 --- a/components/jeune/DossierBeneficiaireMilo.tsx +++ b/components/jeune/DossierBeneficiaireMilo.tsx @@ -183,7 +183,7 @@ function DossierBeneficiaireMilo(
- {getRechercheMain()} - - {typeOffre && showFilters && ( + {typeOffre && ( <> -
- -
+ {getRechercheMain(typeOffre)} - {showMoreFilters && getRechercheSecondary()} - - )} + {showFilters && ( + <> +
+ +
+ + {showMoreFilters && getRechercheSecondary(typeOffre)} + + )} - {typeOffre && ( - <>

[{countCriteres}] filtre{countCriteres > 1 && 's'} sélectionné {countCriteres > 1 && 's'} @@ -252,6 +254,7 @@ export default function FormRechercheOffres({ )}

+ {collapsed && (
{labelTypeOffre && ( @@ -280,8 +283,8 @@ export default function FormRechercheOffres({ ) - function getRechercheMain(): JSX.Element | null { - switch (typeOffre) { + function getRechercheMain(forType: TypeOffre): ReactElement { + switch (forType) { case TypeOffre.EMPLOI: return ( ) - case undefined: - return null } } - function getRechercheSecondary(): JSX.Element | null { - switch (typeOffre) { + function getRechercheSecondary(forType: TypeOffre): ReactElement { + switch (forType) { case TypeOffre.EMPLOI: return ( ) - case undefined: - return null } } } diff --git a/components/offres/OffreEmploiDetail.tsx b/components/offres/OffreEmploiDetail.tsx index 0f5ecf8cf..c09345d29 100644 --- a/components/offres/OffreEmploiDetail.tsx +++ b/components/offres/OffreEmploiDetail.tsx @@ -273,9 +273,7 @@ export default function OffreEmploiDetail({

- - Informations de l' - Entreprise + Informations de l'Entreprise

diff --git a/components/onboarding/OnboardingMobileModal.tsx b/components/onboarding/OnboardingMobileModal.tsx index a78c56c62..50a137944 100644 --- a/components/onboarding/OnboardingMobileModal.tsx +++ b/components/onboarding/OnboardingMobileModal.tsx @@ -1,4 +1,4 @@ -import React, { useRef, useState } from 'react' +import React, { ReactElement, useRef, useState } from 'react' import Modal, { ModalHandles } from 'components/Modal' import { TutorielRaccourci } from 'components/TutorielRaccourci' @@ -16,7 +16,7 @@ export default function OnboardingMobileModal({ const [etape, setEtape] = useState(1) - function accueil(): JSX.Element { + function Accueil(): ReactElement { return ( <>

@@ -46,7 +46,7 @@ export default function OnboardingMobileModal({ title='Bienvenue sur l’espace mobile du conseiller' onClose={onClose} > - {etape === 1 && accueil()} + {etape === 1 && } {etape === 2 && }
)} diff --git a/components/ui/Form/SelectAutocompleteWithFetch.tsx b/components/ui/Form/SelectAutocompleteWithFetch.tsx index 0acdde9b5..546ec5aec 100644 --- a/components/ui/Form/SelectAutocompleteWithFetch.tsx +++ b/components/ui/Form/SelectAutocompleteWithFetch.tsx @@ -1,14 +1,21 @@ -import React, { useEffect, useState } from 'react' +import React, { useEffect, useRef, useState } from 'react' import { InputError } from 'components/ui/Form/InputError' import SelectAutocomplete from 'components/ui/Form/SelectAutocomplete' import { useDebounce } from 'utils/hooks/useDebounce' type WithSimplifiedLabel = T & { upperCaseAlphaLabel: string } + +type PickStringFields = { + [P in keyof T as T[P] extends string ? P : never]: T[P] +} type SelectAutocompleteWithFetchProps = { id: string fetch: (search: string) => Promise - fieldNames: { id: string; value: string } + fieldNames: { + id: keyof PickStringFields + value: keyof PickStringFields + } onUpdateSelected: (value: { selected?: T; hasError: boolean }) => void errorMessage: string defaultValue?: string @@ -25,10 +32,12 @@ export default function SelectAutocompleteWithFetch({ required, disabled = false, }: SelectAutocompleteWithFetchProps) { + const isFirstRender = useRef(true) + const [entites, setEntites] = useState[]>([]) const options: Array<{ id: string; value: string }> = entites.map( (entite) => ({ - id: (entite as any)[fieldNames.id], + id: entite[fieldNames.id] as string, value: entite.upperCaseAlphaLabel, }) ) @@ -67,12 +76,16 @@ export default function SelectAutocompleteWithFetch({ } useEffect(() => { + if (isFirstRender.current) return + if (debouncedInput) { fetch(debouncedInput).then((newEntites) => { const simplifiedEntities: WithSimplifiedLabel[] = newEntites.map( (e) => ({ ...e, - upperCaseAlphaLabel: toUpperCaseAlpha((e as any)[fieldNames.value]), + upperCaseAlphaLabel: toUpperCaseAlpha( + e[fieldNames.value] as string + ), }) ) setEntites(simplifiedEntities) @@ -85,6 +98,13 @@ export default function SelectAutocompleteWithFetch({ } }, [debouncedInput]) + useEffect(() => { + isFirstRender.current = false + return () => { + isFirstRender.current = true + } + }, []) + return ( <> {input.error && ( diff --git a/components/ui/Form/Textarea.tsx b/components/ui/Form/Textarea.tsx index c006dee22..a510c05e3 100644 --- a/components/ui/Form/Textarea.tsx +++ b/components/ui/Form/Textarea.tsx @@ -72,7 +72,7 @@ const TextArea = forwardRef( } function provideDescription(): string | undefined { - let descriptions = [] + const descriptions = [] if (invalid) descriptions.push(id + '--error') if (maxLength) descriptions.push(id + '--length') return descriptions.length ? descriptions.join(' ') : undefined diff --git a/components/ui/IconComponent.tsx b/components/ui/IconComponent.tsx index 7fd8611a0..f2fc34d1c 100644 --- a/components/ui/IconComponent.tsx +++ b/components/ui/IconComponent.tsx @@ -1,4 +1,4 @@ -import { ComponentPropsWithoutRef } from 'react' +import { ComponentPropsWithoutRef, FC, SVGProps } from 'react' import AddIcon from 'assets/icons/actions/add.svg' import ArrowForwardIcon from 'assets/icons/actions/arrow_forward.svg' @@ -158,7 +158,7 @@ export enum IconName { Warning = 'Warning', } -const iconsByName: { [key in IconName]: any } = { +const iconsByName: { [key in IconName]: FC> } = { [IconName.AccountCircleFill]: AccountCircleFillIcon, [IconName.AccountCircleOutline]: AccountCircleOutlineIcon, [IconName.ArrowBackward]: ArrowBackwardIcon, diff --git a/components/ui/IllustrationComponent.tsx b/components/ui/IllustrationComponent.tsx index bd025ada0..d664d374c 100644 --- a/components/ui/IllustrationComponent.tsx +++ b/components/ui/IllustrationComponent.tsx @@ -1,4 +1,4 @@ -import { ComponentPropsWithoutRef } from 'react' +import { ComponentPropsWithoutRef, FC, SVGProps } from 'react' import IllustrationArrowForward from 'assets/images/illustration-arrow-forward.svg' import IllustrationCheck from 'assets/images/illustration-check.svg' @@ -52,7 +52,9 @@ export enum IllustrationName { SendWhite = 'SendWhite', } -const illustrationsByName: { [key in IllustrationName]: any } = { +const illustrationsByName: { + [key in IllustrationName]: FC> +} = { [IllustrationName.ArrowForward]: IllustrationArrowForward, [IllustrationName.Check]: IllustrationCheck, [IllustrationName.Checklist]: IllustrationChecklist, diff --git a/components/ui/Table/TDLink.tsx b/components/ui/Table/TDLink.tsx index 735db60fc..641182db4 100644 --- a/components/ui/Table/TDLink.tsx +++ b/components/ui/Table/TDLink.tsx @@ -25,7 +25,7 @@ export default function TDLink({ .filter((cellVisibleText) => cellVisibleText !== null) setLabel(labelPrefix + ' ' + rowVisibleText.join(' ')) - }, [tdRef.current]) + }, []) // a11y card : https://kittygiraudel.com/2022/04/02/accessible-cards/ // absolute position in grandparent : https://stackoverflow.com/a/25768682 diff --git a/components/ui/Table/TH.tsx b/components/ui/Table/TH.tsx index 15b176d44..2614e53ae 100644 --- a/components/ui/Table/TH.tsx +++ b/components/ui/Table/TH.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode } from 'react' +import React, { ReactElement, ReactNode } from 'react' interface THProps { children: ReactNode @@ -10,7 +10,7 @@ export function TH({ children, estCliquable = false, title, -}: THProps): React.JSX.Element { +}: THProps): ReactElement { const style = `text-s-medium text-left text-content_color ${ estCliquable ? 'hover:rounded-base hover:bg-primary_lighten' : 'p-4' }` diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..b11a1f180 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,75 @@ +import path from 'node:path' +import { fileURLToPath } from 'node:url' + +import { FlatCompat } from '@eslint/eslintrc' +import js from '@eslint/js' +import prettierConfigRecommended from 'eslint-plugin-prettier/recommended' +import reactCompiler from 'eslint-plugin-react-compiler' + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}) + +const eslintConfig = [ + ...compat.extends('next/core-web-vitals', 'next/typescript'), + prettierConfigRecommended, + { + rules: { + 'import/no-unresolved': 'error', + 'import/order': [ + 'error', + { + alphabetize: { + order: 'asc', + caseInsensitive: true, + }, + + 'newlines-between': 'always', + groups: ['builtin', 'external', 'parent', 'sibling', 'index'], + pathGroupsExcludedImportTypes: ['builtin'], + }, + ], + '@typescript-eslint/no-unused-vars': [ + 'error', + { varsIgnorePattern: '^_', ignoreRestSiblings: true }, + ], + 'jsx-a11y/no-noninteractive-tabindex': ['error', { roles: ['tabpanel'] }], + 'jsx-a11y/no-noninteractive-element-to-interactive-role': [ + 'error', + { ul: ['tablist'] }, + ], + }, + }, + { + plugins: { + 'react-compiler': reactCompiler, + }, + rules: { + 'react-compiler/react-compiler': 'error', + }, + }, + { + settings: { + 'jsx-a11y': { + components: { + Table: 'table', + TR: 'tr', + TH: 'th', + TD: 'td', + TDLink: 'td', + IconComponent: 'svg', + Input: 'input', + Select: 'select', + Textarea: 'textarea', + SelectButton: 'select', + }, + }, + }, + }, +] + +export default eslintConfig diff --git a/interfaces/pageProps.ts b/interfaces/pageProps.ts deleted file mode 100644 index 52159c645..000000000 --- a/interfaces/pageProps.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface PageProps { - pageTitle: string - pageHeader?: string - returnTo?: string - withoutChat?: true -} diff --git a/next.config.js b/next.config.ts similarity index 89% rename from next.config.js rename to next.config.ts index a6a1ae049..6598e0092 100644 --- a/next.config.js +++ b/next.config.ts @@ -1,4 +1,4 @@ -/** @type {import('next').NextConfig} */ +import { NextConfig } from 'next' const withBundleAnalyzer = require('@next/bundle-analyzer')({ enabled: process.env.ANALYZE === 'true', @@ -6,9 +6,8 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({ openAnalyzer: false, }) -module.exports = withBundleAnalyzer({ +const nextConfig: NextConfig = { reactStrictMode: true, - swcMinify: true, productionBrowserSourceMaps: true, env: { @@ -58,6 +57,8 @@ module.exports = withBundleAnalyzer({ destination: '/mes-jeunes/:path*', }, ], + afterFiles: [], + fallback: [], }), compiler: { @@ -65,7 +66,7 @@ module.exports = withBundleAnalyzer({ reactRemoveProperties: true, }, - webpack(config) { + webpack(config: any) { // https://react-svgr.com/docs/next/ config.module.rules.push({ test: /\.svg$/i, @@ -76,10 +77,12 @@ module.exports = withBundleAnalyzer({ const { EnvironmentPlugin } = require('webpack') config.plugins.push( new EnvironmentPlugin({ - NODE_ENV: 'production', + NODE_ENV: process.env.NODE_ENV, }) ) return config }, -}) +} + +export default withBundleAnalyzer(nextConfig) diff --git a/package.json b/package.json index f64774dab..2a4d8bcf1 100644 --- a/package.json +++ b/package.json @@ -16,35 +16,37 @@ "test:watch": "jest --config jest.config.js --watch" }, "dependencies": { - "@elastic/apm-rum": "5.16.0", - "@elastic/apm-rum-react": "2.0.2", - "@next/bundle-analyzer": "14.2.18", + "@elastic/apm-rum": "5.16.1", + "@elastic/apm-rum-react": "2.0.3", + "@next/bundle-analyzer": "15.0.4", "crypto-js": "4.2.0", - "dotenv": "16.4.5", + "dotenv": "16.4.7", "elastic-apm-node": "4.8.1", "firebase": "11.0.2", - "html-react-parser": "5.1.18", + "html-react-parser": "5.2.0", "jsonwebtoken": "9.0.2", "lodash.isequal": "4.5.0", "luxon": "3.5.0", "matomo-tracker": "2.2.4", - "next": "14.2.18", - "next-auth": "4.24.10", + "next": "15.0.4", + "next-auth": "4.24.11", "next-logger": "5.0.1", - "next-themes": "0.4.3", + "next-themes": "0.4.4", "nextjs-toploader": "3.7.15", "pino": "9.5.0", - "react": "18.3.1", - "react-dom": "18.3.1", + "react": "19.0.0", + "react-dom": "19.0.0", "react-router-dom": "6.28.0", - "sanitize-html": "^2.13.1", + "sanitize-html": "2.13.1", "sharp": "0.33.5" }, "devDependencies": { - "@svgr/webpack": "8.1.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "^9.16.0", + "@svgr/webpack": "^8.1.0", "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.6.3", - "@testing-library/react": "^16.0.1", + "@testing-library/react": "^16.1.0", "@testing-library/user-event": "^14.5.2", "@types/crypto-js": "^4.2.2", "@types/jest": "^29.5.14", @@ -52,29 +54,32 @@ "@types/jsonwebtoken": "^9.0.7", "@types/lodash.isequal": "^4.5.8", "@types/luxon": "^3.4.2", - "@types/react": "^18.3.12", - "@types/react-dom": "^18.3.1", + "@types/react": "^19.0.1", + "@types/react-dom": "^19.0.2", "@types/sanitize-html": "^2.13.0", "autoprefixer": "^10.4.20", "css-loader": "^7.1.2", - "eslint": "^8.57.1", - "eslint-config-next": "14.2.18", + "eslint": "^9.16.0", + "eslint-config-next": "^15.0.4", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-react-compiler": "19.0.0-beta-37ed2a7-20241206", "jest": "^29.7.0", "jest-axe": "^9.0.0", "jest-environment-jsdom": "^29.7.0", "pino-pretty": "^13.0.0", "postcss": "^8.4.49", - "prettier": "^3.4.1", + "prettier": "^3.4.2", "source-map-explorer": "^2.5.3", "style-loader": "^4.0.0", - "tailwindcss": "^3.4.15", + "tailwindcss": "^3.4.16", "ts-loader": "^9.5.1", "tsconfig-paths-webpack-plugin": "^4.2.0", "typescript": "^5.7.2" }, + "resolutions": { + "@types/react-dom/@types/react": "^19" + }, "browser": { "elastic-apm-node": false }, diff --git a/tests/api/dossier-milo.api.test.tsx b/tests/api/dossier-milo.api.test.tsx index 889cc2f95..d132ecf3e 100644 --- a/tests/api/dossier-milo.api.test.tsx +++ b/tests/api/dossier-milo.api.test.tsx @@ -28,7 +28,7 @@ describe('GET /api/milo/[numeroDossier]', () => { // When const promise = GET(new Request('https://www.perdu.com'), { - params: { numeroDossier: '123456' }, + params: Promise.resolve({ numeroDossier: '123456' }), }) // Then @@ -57,7 +57,7 @@ describe('GET /api/milo/[numeroDossier]', () => { // When const promise = GET(new Request('https://www.perdu.com'), { - params: { numeroDossier: '123456' }, + params: Promise.resolve({ numeroDossier: '123456' }), }) // Then @@ -86,7 +86,7 @@ describe('GET /api/milo/[numeroDossier]', () => { // When const promise = GET(new Request('https://www.perdu.com'), { - params: { numeroDossier: '123456' }, + params: Promise.resolve({ numeroDossier: '123456' }), }) // Then diff --git a/tests/api/fichiers.api.test.tsx b/tests/api/fichiers.api.test.tsx index 7127da1a2..ed97f3531 100644 --- a/tests/api/fichiers.api.test.tsx +++ b/tests/api/fichiers.api.test.tsx @@ -20,7 +20,7 @@ describe('GET api/fichier/[idFichier]', () => { // When const promise = GET(new Request('https://www.perdu.com'), { - params: { idFichier: 'idFichier' }, + params: Promise.resolve({ idFichier: 'idFichier' }), }) // Then diff --git a/tests/components/ChatContainer.test.tsx b/tests/components/ChatContainer.test.tsx index daf291980..b8df581d5 100644 --- a/tests/components/ChatContainer.test.tsx +++ b/tests/components/ChatContainer.test.tsx @@ -9,11 +9,7 @@ import { unBeneficiaireChat, } from 'fixtures/beneficiaire' import { desListesDeDiffusion } from 'fixtures/listes-de-diffusion' -import { - BaseBeneficiaire, - BeneficiaireEtChat, - ConseillerHistorique, -} from 'interfaces/beneficiaire' +import { BaseBeneficiaire, BeneficiaireEtChat } from 'interfaces/beneficiaire' import { getConseillersDuJeuneClientSide } from 'services/beneficiaires.service' import { getListesDeDiffusionClientSide } from 'services/listes-de-diffusion.service' import { getMessageImportant } from 'services/messages.service' @@ -36,11 +32,8 @@ describe('', () => { ) let beneficiairesChats: BeneficiaireEtChat[] - let conseillers: ConseillerHistorique[] beforeEach(async () => { - ;(getConseillersDuJeuneClientSide as jest.Mock).mockResolvedValue( - conseillers - ) + ;(getConseillersDuJeuneClientSide as jest.Mock).mockResolvedValue([]) ;(getListesDeDiffusionClientSide as jest.Mock).mockResolvedValue( desListesDeDiffusion() ) diff --git a/tests/components/ChatRoom.test.tsx b/tests/components/ChatRoom.test.tsx index 689af564a..57e84d053 100644 --- a/tests/components/ChatRoom.test.tsx +++ b/tests/components/ChatRoom.test.tsx @@ -375,8 +375,7 @@ describe('', () => { onAccesConversation={accederConversation} onAccesListesDiffusion={() => {}} onOuvertureMenu={() => {}} - />, - {} + /> )) }) }) @@ -394,7 +393,7 @@ describe('', () => { it('affiche les alertes sur petit écran', () => { expect(AlerteDisplayer).toHaveBeenCalledWith( { hideOnLargeScreen: true }, - {} + undefined ) }) @@ -471,8 +470,7 @@ describe('', () => { onAccesConversation={() => {}} onAccesListesDiffusion={() => {}} onOuvertureMenu={() => {}} - />, - {} + /> )) }) @@ -501,8 +499,7 @@ describe('', () => { onAccesConversation={() => {}} onAccesListesDiffusion={() => {}} onOuvertureMenu={() => {}} - />, - {} + /> ) // When diff --git a/tests/components/DisplayMessageConseiller.test.tsx b/tests/components/DisplayMessageConseiller.test.tsx index fd5457275..a001d1b0e 100644 --- a/tests/components/DisplayMessageConseiller.test.tsx +++ b/tests/components/DisplayMessageConseiller.test.tsx @@ -20,14 +20,14 @@ describe('', () => { }) const message = unMessage({ sentBy: 'conseiller', - content: 'coucou', + content: 'coucou http://perdu.com', conseillerId: customConseiller.id, creationDate: DateTime.fromISO('2023-04-12T05:21'), }) const supprimerMessage = jest.fn() const modifierMessage = jest.fn() - describe('', () => { + describe('affiche le message', () => { beforeEach(async () => { //When await act(async () => { @@ -57,6 +57,15 @@ describe('', () => { ).not.toBeInTheDocument() }) + it('transforme les liens', async () => { + const lienExterne = screen.getByRole('link', { + name: 'http://perdu.com (nouvelle fenêtre)', + }) + expect(lienExterne).toHaveAttribute('href', 'http://perdu.com') + expect(lienExterne).toHaveAttribute('target', '_blank') + expect(lienExterne).toHaveAttribute('rel', 'noreferrer noopener') + }) + it('permet de supprimer le message', async () => { // When await userEvent.click( diff --git a/tests/components/SelectAutocompleteWithFetch.test.tsx b/tests/components/SelectAutocompleteWithFetch.test.tsx index 18b811acf..d3f186561 100644 --- a/tests/components/SelectAutocompleteWithFetch.test.tsx +++ b/tests/components/SelectAutocompleteWithFetch.test.tsx @@ -15,7 +15,6 @@ describe('SelectAutocompleteWithFetch', () => { const getOptions = () => screen.getByRole('listbox', { hidden: true }) const getSelect = () => screen.getByRole('combobox', { name: 'Label autocomplete' }) - const callInitComponent = 1 beforeEach(() => { // Given @@ -102,9 +101,7 @@ describe('SelectAutocompleteWithFetch', () => { await userEvent.type(getSelect(), 'pouet') // Then - expect(onUpdateSelected).toHaveBeenCalledTimes( - callInitComponent + 'pouet'.length - ) + expect(onUpdateSelected).toHaveBeenCalledTimes('pouet'.length) expect(onUpdateSelected).toHaveBeenCalledWith({ hasError: true }) }) @@ -114,9 +111,7 @@ describe('SelectAutocompleteWithFetch', () => { await userEvent.clear(getSelect()) // Then - expect(onUpdateSelected).toHaveBeenCalledTimes( - callInitComponent + 'pouet'.length + 1 - ) + expect(onUpdateSelected).toHaveBeenCalledTimes('pouet'.length + 1) expect(onUpdateSelected).toHaveBeenLastCalledWith({ hasError: false }) }) }) @@ -129,7 +124,7 @@ describe('SelectAutocompleteWithFetch', () => { // Then expect(onUpdateSelected).toHaveBeenCalledTimes( - callInitComponent + 'valeur-avec-tiret'.length + 1 + 'valeur-avec-tiret'.length + 1 ) expect(onUpdateSelected).toHaveBeenLastCalledWith({ selected: { @@ -146,9 +141,7 @@ describe('SelectAutocompleteWithFetch', () => { await waitForDebounce(500) // Then - expect(onUpdateSelected).toHaveBeenCalledTimes( - callInitComponent + 'valeu'.length + 1 - ) + expect(onUpdateSelected).toHaveBeenCalledTimes('valeu'.length + 1) expect(onUpdateSelected).toHaveBeenLastCalledWith({ selected: undefined, hasError: true, diff --git a/tests/pages/CloturePage.server.test.tsx b/tests/pages/CloturePage.server.test.tsx index 163fdb468..cff0ef9c4 100644 --- a/tests/pages/CloturePage.server.test.tsx +++ b/tests/pages/CloturePage.server.test.tsx @@ -1,8 +1,8 @@ import { render } from '@testing-library/react' import { notFound, redirect } from 'next/navigation' -import CloturePage from 'app/(connected)/(with-sidebar)/(without-chat)/evenements/[id_evenement]/cloture/CloturePage' -import Cloture from 'app/(connected)/(with-sidebar)/(without-chat)/evenements/[id_evenement]/cloture/page' +import CloturePage from 'app/(connected)/(with-sidebar)/(without-chat)/evenements/[idEvenement]/cloture/CloturePage' +import Cloture from 'app/(connected)/(with-sidebar)/(without-chat)/evenements/[idEvenement]/cloture/page' import { unEvenement } from 'fixtures/evenement' import { StructureConseiller } from 'interfaces/conseiller' import { StatutAnimationCollective } from 'interfaces/evenement' @@ -14,7 +14,7 @@ jest.mock('utils/auth/auth', () => ({ })) jest.mock('services/evenements.service') jest.mock( - 'app/(connected)/(with-sidebar)/(without-chat)/evenements/[id_evenement]/cloture/CloturePage' + 'app/(connected)/(with-sidebar)/(without-chat)/evenements/[idEvenement]/cloture/CloturePage' ) describe('CloturePage server side', () => { @@ -34,8 +34,8 @@ describe('CloturePage server side', () => { // When render( await Cloture({ - params: { id_evenement: 'id-animation-collective' }, - searchParams: { redirectUrl: 'redirectUrl' }, + params: Promise.resolve({ idEvenement: 'id-animation-collective' }), + searchParams: Promise.resolve({ redirectUrl: 'redirectUrl' }), }) ) @@ -51,7 +51,7 @@ describe('CloturePage server side', () => { }), returnTo: '/mes-jeunes/edition-rdv?idRdv=1&redirectUrl=redirectUrl', }, - {} + undefined ) }) @@ -61,7 +61,7 @@ describe('CloturePage server side', () => { // When const promise = Cloture({ - params: { id_evenement: 'id-animation-collective' }, + params: Promise.resolve({ idEvenement: 'id-animation-collective' }), }) // Then @@ -77,7 +77,7 @@ describe('CloturePage server side', () => { // When const promise = Cloture({ - params: { id_evenement: 'id-animation-collective' }, + params: Promise.resolve({ idEvenement: 'id-animation-collective' }), }) // Then @@ -95,7 +95,7 @@ describe('CloturePage server side', () => { // When const promise = Cloture({ - params: { id_evenement: 'id-animation-collective' }, + params: Promise.resolve({ idEvenement: 'id-animation-collective' }), }) // Then diff --git a/tests/pages/CloturePage.test.tsx b/tests/pages/CloturePage.test.tsx index 79c807390..c70ce9fdd 100644 --- a/tests/pages/CloturePage.test.tsx +++ b/tests/pages/CloturePage.test.tsx @@ -5,7 +5,7 @@ import { axe } from 'jest-axe' import { useRouter } from 'next/navigation' import React from 'react' -import CloturePage from 'app/(connected)/(with-sidebar)/(without-chat)/evenements/[id_evenement]/cloture/CloturePage' +import CloturePage from 'app/(connected)/(with-sidebar)/(without-chat)/evenements/[idEvenement]/cloture/CloturePage' import { unEvenement } from 'fixtures/evenement' import { AlerteParam } from 'referentiel/alerteParam' import { cloreAnimationCollective } from 'services/evenements.service' diff --git a/tests/pages/ClotureSessionPage.server.test.tsx b/tests/pages/ClotureSessionPage.server.test.tsx index 99d714da9..b9d734793 100644 --- a/tests/pages/ClotureSessionPage.server.test.tsx +++ b/tests/pages/ClotureSessionPage.server.test.tsx @@ -83,8 +83,8 @@ describe('Cloture Session server side', () => { // When render( await ClotureSession({ - params: params, - searchParams: searchParams, + params: Promise.resolve(params), + searchParams: Promise.resolve(searchParams), }) ) @@ -102,7 +102,7 @@ describe('Cloture Session server side', () => { inscriptionsInitiales: inscriptionsInitiales, returnTo: `/agenda/sessions/session-1?redirectUrl=redirectUrl`, }, - {} + undefined ) }) @@ -112,8 +112,8 @@ describe('Cloture Session server side', () => { // When const promise = ClotureSession({ - params: params, - searchParams: searchParams, + params: Promise.resolve(params), + searchParams: Promise.resolve(searchParams), }) // Then @@ -143,8 +143,8 @@ describe('Cloture Session server side', () => { //When const promise = ClotureSession({ - params: params, - searchParams: searchParams, + params: Promise.resolve(params), + searchParams: Promise.resolve(searchParams), }) // Then @@ -165,8 +165,8 @@ describe('Cloture Session server side', () => { //When const promise = ClotureSession({ - params: params, - searchParams: searchParams, + params: Promise.resolve(params), + searchParams: Promise.resolve(searchParams), }) // Then diff --git a/tests/pages/ConsentementCguPage.server.test.tsx b/tests/pages/ConsentementCguPage.server.test.tsx index 9e9d4e7a8..56622be0e 100644 --- a/tests/pages/ConsentementCguPage.server.test.tsx +++ b/tests/pages/ConsentementCguPage.server.test.tsx @@ -34,7 +34,7 @@ describe('ConsentementCGUPage server side', () => { expect(metadata).toEqual({ title: 'Consentement CGU' }) expect(ConsentementCguPage).toHaveBeenCalledWith( { returnTo: '/?onboarding=true' }, - {} + undefined ) }) @@ -47,6 +47,9 @@ describe('ConsentementCGUPage server side', () => { // Then expect(metadata).toEqual({ title: 'Consentement CGU' }) - expect(ConsentementCguPage).toHaveBeenCalledWith({ returnTo: '/?' }, {}) + expect(ConsentementCguPage).toHaveBeenCalledWith( + { returnTo: '/?' }, + undefined + ) }) }) diff --git a/tests/pages/DetailActionPage.server.test.tsx b/tests/pages/DetailActionPage.server.test.tsx index 6bc5687de..7f9e3727a 100644 --- a/tests/pages/DetailActionPage.server.test.tsx +++ b/tests/pages/DetailActionPage.server.test.tsx @@ -33,7 +33,7 @@ describe('ActionPage server side', () => { // When const promise = DetailAction({ - params: { idJeune: 'id-jeune', idAction: 'id-action' }, + params: Promise.resolve({ idJeune: 'id-jeune', idAction: 'id-action' }), }) // Then @@ -66,8 +66,10 @@ describe('ActionPage server side', () => { // When const params = { idJeune: 'beneficiaire-1', idAction: 'id-action' } - const metadata = await generateMetadata({ params }) - render(await DetailAction({ params })) + const metadata = await generateMetadata({ + params: Promise.resolve(params), + }) + render(await DetailAction({ params: Promise.resolve(params) })) // Then expect(getAction).toHaveBeenCalledWith('id-action', 'accessToken') @@ -81,7 +83,7 @@ describe('ActionPage server side', () => { lectureSeule: false, from: 'beneficiaire', }, - {} + undefined ) }) @@ -104,8 +106,10 @@ describe('ActionPage server side', () => { // When const params = { idJeune: 'beneficiaire-1', idAction: 'id-action' } - const metadata = await generateMetadata({ params }) - render(await DetailAction({ params })) + const metadata = await generateMetadata({ + params: Promise.resolve(params), + }) + render(await DetailAction({ params: Promise.resolve(params) })) // Then expect(getAction).toHaveBeenCalledWith('id-action', 'accessToken') @@ -119,7 +123,7 @@ describe('ActionPage server side', () => { lectureSeule: false, from: 'pilotage', }, - {} + undefined ) }) }) @@ -128,7 +132,10 @@ describe('ActionPage server side', () => { it('renvoie une 404', async () => { // When const promise = DetailAction({ - params: { idJeune: 'id-jeune', idAction: 'id-action' }, + params: Promise.resolve({ + idJeune: 'id-jeune', + idAction: 'id-action', + }), }) // Then @@ -150,7 +157,10 @@ describe('ActionPage server side', () => { // When const promise = DetailAction({ - params: { idJeune: 'id-jeune', idAction: 'id-action' }, + params: Promise.resolve({ + idJeune: 'id-jeune', + idAction: 'id-action', + }), }) // Then diff --git a/tests/pages/DetailDemarchePage.server.test.tsx b/tests/pages/DetailDemarchePage.server.test.tsx index 01e23a248..afb4b021e 100644 --- a/tests/pages/DetailDemarchePage.server.test.tsx +++ b/tests/pages/DetailDemarchePage.server.test.tsx @@ -38,7 +38,10 @@ describe('DetailDemarchePage server side', () => { // When const promise = DetailDemarche({ - params: { idJeune: 'id-jeune', idDemarche: 'id-demarche' }, + params: Promise.resolve({ + idJeune: 'id-jeune', + idDemarche: 'id-demarche', + }), }) // Then @@ -73,8 +76,10 @@ describe('DetailDemarchePage server side', () => { // When const params = { idJeune: 'beneficiaire-1', idDemarche: 'id-demarche' } - const metadata = await generateMetadata({ params }) - render(await DetailDemarche({ params })) + const metadata = await generateMetadata({ + params: Promise.resolve(params), + }) + render(await DetailDemarche({ params: Promise.resolve(params) })) // Then expect(getDemarchesBeneficiaire).toHaveBeenCalledWith( @@ -91,7 +96,7 @@ describe('DetailDemarchePage server side', () => { demarche, lectureSeule: false, }, - {} + undefined ) }) @@ -105,10 +110,10 @@ describe('DetailDemarchePage server side', () => { it('renvoie une 404', async () => { // When const promise = DetailDemarche({ - params: { + params: Promise.resolve({ idJeune: 'id-jeune', idDemarche: 'id-demarche-inexistante', - }, + }), }) // Then @@ -124,7 +129,10 @@ describe('DetailDemarchePage server side', () => { // When const promise = DetailDemarche({ - params: { idJeune: 'id-jeune', idDemarche: 'id-demarche' }, + params: Promise.resolve({ + idJeune: 'id-jeune', + idDemarche: 'id-demarche', + }), }) // Then diff --git a/tests/pages/DetailsSessionPage.server.test.tsx b/tests/pages/DetailsSessionPage.server.test.tsx index 269218efc..026298922 100644 --- a/tests/pages/DetailsSessionPage.server.test.tsx +++ b/tests/pages/DetailsSessionPage.server.test.tsx @@ -44,8 +44,8 @@ describe('Détails Session Page Server', () => { //When const promise = DetailsSession({ - params: params, - searchParams: searchParams, + params: Promise.resolve(params), + searchParams: Promise.resolve(searchParams), }) // Then @@ -107,8 +107,8 @@ describe('Détails Session Page Server', () => { //When render( await DetailsSession({ - params: params, - searchParams: searchParams, + params: Promise.resolve(params), + searchParams: Promise.resolve(searchParams), }) ) }) @@ -132,7 +132,7 @@ describe('Détails Session Page Server', () => { session: session, returnTo: 'redirectUrl', }, - {} + undefined ) }) }) diff --git a/tests/pages/EditionListeDiffusionPage.server.test.tsx b/tests/pages/EditionListeDiffusionPage.server.test.tsx index 57dbcd537..9ad736286 100644 --- a/tests/pages/EditionListeDiffusionPage.server.test.tsx +++ b/tests/pages/EditionListeDiffusionPage.server.test.tsx @@ -40,7 +40,7 @@ describe('Page d’édition d’une liste de diffusion', () => { { returnTo: '/mes-jeunes/listes-de-diffusion', }, - {} + undefined ) }) @@ -53,8 +53,14 @@ describe('Page d’édition d’une liste de diffusion', () => { // When const searchParams = { idListe: '1' } - const metadata = await generateMetadata({ searchParams }) - render(await EditionListeDiffusion({ searchParams })) + const metadata = await generateMetadata({ + searchParams: Promise.resolve(searchParams), + }) + render( + await EditionListeDiffusion({ + searchParams: Promise.resolve(searchParams), + }) + ) // Then expect(recupererListeDeDiffusion).toHaveBeenCalledWith('1', 'accessToken') @@ -67,7 +73,7 @@ describe('Page d’édition d’une liste de diffusion', () => { liste: listeDeDiffusion, returnTo: '/mes-jeunes/listes-de-diffusion', }, - {} + undefined ) }) }) diff --git a/tests/pages/EmargementRdvPage.server.test.tsx b/tests/pages/EmargementRdvPage.server.test.tsx index bf93362f8..15c6d10e6 100644 --- a/tests/pages/EmargementRdvPage.server.test.tsx +++ b/tests/pages/EmargementRdvPage.server.test.tsx @@ -51,14 +51,14 @@ describe('EmargementRdvPage server side', () => { it('prépare la page', async () => { // When const metadata = await generateMetadata({ - params: { idEvenement: 'id-evenement' }, - searchParams: { type: 'ac' }, + params: Promise.resolve({ idEvenement: 'id-evenement' }), + searchParams: Promise.resolve({ type: 'ac' }), }) render( await EmargementRdv({ - params: { idEvenement: 'id-evenement' }, - searchParams: { type: 'ac' }, + params: Promise.resolve({ idEvenement: 'id-evenement' }), + searchParams: Promise.resolve({ type: 'ac' }), }) ) @@ -72,7 +72,7 @@ describe('EmargementRdvPage server side', () => { evenement: acAEmarger, agence: 'Montastruc-la-Conseillère', }, - {} + undefined ) }) }) @@ -81,14 +81,14 @@ describe('EmargementRdvPage server side', () => { it('prépare la page', async () => { // When const metadata = await generateMetadata({ - params: { idEvenement: 'id-evenement' }, - searchParams: { type: 'session' }, + params: Promise.resolve({ idEvenement: 'id-evenement' }), + searchParams: Promise.resolve({ type: 'session' }), }) render( await EmargementRdv({ - params: { idEvenement: 'id-evenement' }, - searchParams: { type: 'session' }, + params: Promise.resolve({ idEvenement: 'id-evenement' }), + searchParams: Promise.resolve({ type: 'session' }), }) ) @@ -102,7 +102,7 @@ describe('EmargementRdvPage server side', () => { evenement: sessionAEmarger, agence: 'Montastruc-la-Conseillère', }, - {} + undefined ) }) }) @@ -120,8 +120,8 @@ describe('EmargementRdvPage server side', () => { // When const promise = EmargementRdv({ - params: { idEvenement: 'id-evenement' }, - searchParams: { type: 'ac' }, + params: Promise.resolve({ idEvenement: 'id-evenement' }), + searchParams: Promise.resolve({ type: 'ac' }), }) //Then diff --git a/tests/pages/EnvoiMessageGroupePage.server.test.tsx b/tests/pages/EnvoiMessageGroupePage.server.test.tsx index db786b55d..40aa79b04 100644 --- a/tests/pages/EnvoiMessageGroupePage.server.test.tsx +++ b/tests/pages/EnvoiMessageGroupePage.server.test.tsx @@ -58,7 +58,7 @@ describe('EnvoiMessageGroupePage server side', () => { listesDiffusion: listesDeDiffusion, returnTo: 'http://localhost:3000/agenda', }, - {} + undefined ) }) @@ -83,7 +83,7 @@ describe('EnvoiMessageGroupePage server side', () => { listesDiffusion: listesDeDiffusion, returnTo: '/mes-jeunes', }, - {} + undefined ) }) }) diff --git a/tests/pages/EtablissementPage.server.test.tsx b/tests/pages/EtablissementPage.server.test.tsx index fd3579da2..214994822 100644 --- a/tests/pages/EtablissementPage.server.test.tsx +++ b/tests/pages/EtablissementPage.server.test.tsx @@ -40,7 +40,7 @@ describe('EtablissementPage server side', () => { // Then - expect(EtablissementPage).toHaveBeenCalledWith({}, {}) + expect(EtablissementPage).toHaveBeenCalledWith({}, undefined) }) it('prépare la page en tant que MILO', async () => { @@ -53,7 +53,7 @@ describe('EtablissementPage server side', () => { // Then - expect(EtablissementPage).toHaveBeenCalledWith({}, {}) + expect(EtablissementPage).toHaveBeenCalledWith({}, undefined) }) }) }) diff --git a/tests/pages/EtablissementPage.test.tsx b/tests/pages/EtablissementPage.test.tsx index 96f4224b5..58695f450 100644 --- a/tests/pages/EtablissementPage.test.tsx +++ b/tests/pages/EtablissementPage.test.tsx @@ -170,7 +170,7 @@ describe('EtablissementPage client side', () => { screen.getByRole('link', { name: 'Accéder à la fiche de Page 1 Albert Emploi Le 01/03/2023 à 15:11 Carlo Le Calamar', }) - ).toHaveAttribute('href', 'etablissement/beneficiaires/id-jeune') + ).toHaveAttribute('href', '/etablissement/beneficiaires/id-jeune') expect( within(tableauDeBeneficiaires).getByText(`Page 1 Albert`) ).toBeInTheDocument() diff --git a/tests/pages/FavorisPage.server.test.tsx b/tests/pages/FavorisPage.server.test.tsx index 8a5bec64c..a5d448346 100644 --- a/tests/pages/FavorisPage.server.test.tsx +++ b/tests/pages/FavorisPage.server.test.tsx @@ -41,8 +41,8 @@ describe('Favoris', () => { // When const params = { idJeune: 'id-jeune' } - const metadata = await generateMetadata({ params }) - render(await Favoris({ params })) + const metadata = await generateMetadata({ params: Promise.resolve(params) }) + render(await Favoris({ params: Promise.resolve(params) })) // Then expect(getOffres).toHaveBeenCalledWith('id-jeune', 'accessToken') @@ -59,7 +59,7 @@ describe('Favoris', () => { recherches, lectureSeule: false, }, - {} + undefined ) }) }) @@ -73,7 +73,9 @@ describe('Quand la ressource n’est pas accessible au conseiller', () => { ) // When - const promise = Favoris({ params: { idJeune: 'id-jeune' } }) + const promise = Favoris({ + params: Promise.resolve({ idJeune: 'id-jeune' }), + }) // Then diff --git a/tests/pages/HistoriquePage.server.test.tsx b/tests/pages/HistoriquePage.server.test.tsx index 73239e614..4c967e60b 100644 --- a/tests/pages/HistoriquePage.server.test.tsx +++ b/tests/pages/HistoriquePage.server.test.tsx @@ -56,8 +56,8 @@ describe('HistoriquePage server side', () => { // When const params = { idJeune: 'id-beneficiaire' } - metadata = await generateMetadata({ params }) - render(await Informations({ params })) + metadata = await generateMetadata({ params: Promise.resolve(params) }) + render(await Informations({ params: Promise.resolve(params) })) }) it('prépare la page', async () => { @@ -88,7 +88,7 @@ describe('HistoriquePage server side', () => { beneficiaire: detailBeneficiaire, onglet: 'INFORMATIONS', }, - {} + undefined ) }) }) diff --git a/tests/pages/HomePage.server.test.tsx b/tests/pages/HomePage.server.test.tsx index 5a4c22d10..667aaf575 100644 --- a/tests/pages/HomePage.server.test.tsx +++ b/tests/pages/HomePage.server.test.tsx @@ -52,7 +52,9 @@ describe('HomePage server side', () => { it('redirige vers l’url renseignée', async () => { // When - const promise = Home({ searchParams: { redirectUrl: '/agenda' } }) + const promise = Home({ + searchParams: Promise.resolve({ redirectUrl: '/agenda' }), + }) //Then await expect(promise).rejects.toEqual(new Error('NEXT REDIRECT /agenda')) @@ -81,7 +83,7 @@ describe('HomePage server side', () => { afficherModaleOnboarding: false, redirectUrl: '/mes-jeunes', }, - {} + undefined ) }) }) @@ -100,7 +102,11 @@ describe('HomePage server side', () => { ) // When - render(await Home({ searchParams: { redirectUrl: '/agenda' } })) + render( + await Home({ + searchParams: Promise.resolve({ redirectUrl: '/agenda' }), + }) + ) // Then expect(HomePage).toHaveBeenCalledWith( @@ -111,7 +117,7 @@ describe('HomePage server side', () => { redirectUrl: '/agenda', referentielAgences: uneListeDAgencesFranceTravail(), }, - {} + undefined ) }) }) @@ -144,7 +150,7 @@ describe('HomePage server side', () => { redirectUrl: '/mes-jeunes', referentielAgences: undefined, }, - {} + undefined ) }) }) @@ -162,7 +168,10 @@ describe('HomePage server side', () => { // When render( await Home({ - searchParams: { onboarding: true, redirectUrl: '/agenda' }, + searchParams: Promise.resolve({ + onboarding: true, + redirectUrl: '/agenda', + }), }) ) @@ -175,7 +184,7 @@ describe('HomePage server side', () => { redirectUrl: '/agenda', referentielAgences: uneListeDAgencesFranceTravail(), }, - {} + undefined ) }) }) diff --git a/tests/pages/ListesDiffusionPage.server.test.tsx b/tests/pages/ListesDiffusionPage.server.test.tsx index 8f3151e66..81b6c915b 100644 --- a/tests/pages/ListesDiffusionPage.server.test.tsx +++ b/tests/pages/ListesDiffusionPage.server.test.tsx @@ -37,7 +37,7 @@ describe('Page Listes de Diffusion', () => { { listesDiffusion: desListesDeDiffusion(), }, - {} + undefined ) }) }) diff --git a/tests/pages/LoginCEJPage.server.test.tsx b/tests/pages/LoginCEJPage.server.test.tsx index cdbaf073e..94e8b8b54 100644 --- a/tests/pages/LoginCEJPage.server.test.tsx +++ b/tests/pages/LoginCEJPage.server.test.tsx @@ -15,7 +15,7 @@ describe('LoginCEJPage server side', () => { // When const promise = LoginCEJ({ - searchParams: { redirectUrl: 'vers-linfini-et-au-dela' }, + searchParams: Promise.resolve({ redirectUrl: 'vers-linfini-et-au-dela' }), }) // Then @@ -30,13 +30,17 @@ describe('LoginCEJPage server side', () => { ;(getServerSession as jest.Mock).mockResolvedValue(null) // When - render(await LoginCEJ({ searchParams: { source: 'notif-mail' } })) + render( + await LoginCEJ({ + searchParams: Promise.resolve({ source: 'notif-mail' }), + }) + ) // Then expect(metadata).toEqual({ title: "Connexion dans l'espace conseiller - Outil du Contrat d’Engagement Jeune", }) - expect(LoginCEJPage).toHaveBeenCalledWith({}, {}) + expect(LoginCEJPage).toHaveBeenCalledWith({}, undefined) }) }) diff --git a/tests/pages/LoginHubPage.server.test.tsx b/tests/pages/LoginHubPage.server.test.tsx index 370c977f4..987e04692 100644 --- a/tests/pages/LoginHubPage.server.test.tsx +++ b/tests/pages/LoginHubPage.server.test.tsx @@ -15,7 +15,7 @@ describe('LoginPage server side', () => { // When const promise = LoginHub({ - searchParams: { redirectUrl: 'vers-linfini-et-au-dela' }, + searchParams: Promise.resolve({ redirectUrl: 'vers-linfini-et-au-dela' }), }) // Then @@ -30,13 +30,17 @@ describe('LoginPage server side', () => { ;(getServerSession as jest.Mock).mockResolvedValue(null) // When - render(await LoginHub({ searchParams: { source: 'notif-mail' } })) + render( + await LoginHub({ + searchParams: Promise.resolve({ source: 'notif-mail' }), + }) + ) // Then expect(metadata).toEqual({ title: 'Sélection de l’espace de connexion - Outil du Contrat d’Engagement Jeune et du pass emploi', }) - expect(LoginHubPage).toHaveBeenCalledWith({}, {}) + expect(LoginHubPage).toHaveBeenCalledWith({}, undefined) }) }) diff --git a/tests/pages/LoginPassEmploiPage.server.test.tsx b/tests/pages/LoginPassEmploiPage.server.test.tsx index 3982bab44..628bc0587 100644 --- a/tests/pages/LoginPassEmploiPage.server.test.tsx +++ b/tests/pages/LoginPassEmploiPage.server.test.tsx @@ -17,7 +17,7 @@ describe('LoginPassEmploiPage server side', () => { // When const promise = LoginPassEmploi({ - searchParams: { redirectUrl: 'vers-linfini-et-au-dela' }, + searchParams: Promise.resolve({ redirectUrl: 'vers-linfini-et-au-dela' }), }) // Then @@ -32,7 +32,11 @@ describe('LoginPassEmploiPage server side', () => { ;(getServerSession as jest.Mock).mockResolvedValue(null) // When - render(await LoginPassEmploi({ searchParams: { source: 'notif-mail' } })) + render( + await LoginPassEmploi({ + searchParams: Promise.resolve({ source: 'notif-mail' }), + }) + ) // Then expect(metadata).toEqual({ @@ -40,7 +44,7 @@ describe('LoginPassEmploiPage server side', () => { }) expect(LoginPassEmploiPage).toHaveBeenCalledWith( { ssoAvenirProEstActif: true }, - {} + undefined ) }) }) diff --git a/tests/pages/LogoutPage.server.test.tsx b/tests/pages/LogoutPage.server.test.tsx index 41362801b..78501ed7b 100644 --- a/tests/pages/LogoutPage.server.test.tsx +++ b/tests/pages/LogoutPage.server.test.tsx @@ -19,7 +19,7 @@ describe('LogoutPage server side', () => { render(await Logout()) // Then - expect(LogoutPage).toHaveBeenCalledWith({ callbackUrl: '/login/cej' }, {}) + expect(LogoutPage).toHaveBeenCalledWith({ callbackUrl: '/login/cej' }, undefined) }) }) @@ -36,7 +36,7 @@ describe('LogoutPage server side', () => { // Then expect(LogoutPage).toHaveBeenCalledWith( { callbackUrl: '/login/passemploi' }, - {} + undefined ) }) }) diff --git a/tests/pages/MessageriePage.test.tsx b/tests/pages/MessageriePage.test.tsx index ffc8f84df..8f0c7b60e 100644 --- a/tests/pages/MessageriePage.test.tsx +++ b/tests/pages/MessageriePage.test.tsx @@ -10,14 +10,9 @@ import { } from 'fixtures/beneficiaire' import { desListesDeDiffusion } from 'fixtures/listes-de-diffusion' import { desMessagesListeDeDiffusionParJour } from 'fixtures/message' -import { - BaseBeneficiaire, - BeneficiaireEtChat, - ConseillerHistorique, -} from 'interfaces/beneficiaire' +import { BaseBeneficiaire, BeneficiaireEtChat } from 'interfaces/beneficiaire' import { StructureConseiller } from 'interfaces/conseiller' import { ByDay, MessageListeDiffusion } from 'interfaces/message' -import { getConseillersDuJeuneClientSide } from 'services/beneficiaires.service' import { getListesDeDiffusionClientSide } from 'services/listes-de-diffusion.service' import { getMessagesListeDeDiffusion, @@ -36,14 +31,10 @@ describe('MessageriePage client side', () => { ) let beneficiairesChats: BeneficiaireEtChat[] - let conseillers: ConseillerHistorique[] let updateChatsRef: (chats: BeneficiaireEtChat[]) => void let messages: ByDay beforeEach(async () => { - ;(getConseillersDuJeuneClientSide as jest.Mock).mockResolvedValue( - conseillers - ) messages = desMessagesListeDeDiffusionParJour() ;(observeConseillerChats as jest.Mock).mockImplementation( (_jeune, _cle, fn) => { diff --git a/tests/pages/ModificationActionPage.server.test.tsx b/tests/pages/ModificationActionPage.server.test.tsx index 1f0824b2b..cf0d705f0 100644 --- a/tests/pages/ModificationActionPage.server.test.tsx +++ b/tests/pages/ModificationActionPage.server.test.tsx @@ -54,8 +54,10 @@ describe('ModificationActionPage server side', () => { ;(getAction as jest.Mock).mockResolvedValue({ action, jeune }) // When - const metadata = await generateMetadata({ params }) - render(await ModificationAction({ params })) + const metadata = await generateMetadata({ + params: Promise.resolve(params), + }) + render(await ModificationAction({ params: Promise.resolve(params) })) // Then expect(metadata).toEqual({ @@ -72,7 +74,7 @@ describe('ModificationActionPage server side', () => { '/mes-jeunes/beneficiaire-1/actions/id-action-1' ), }, - {} + undefined ) }) @@ -81,7 +83,7 @@ describe('ModificationActionPage server side', () => { ;(getAction as jest.Mock).mockResolvedValue(undefined) // When - const promise = ModificationAction({ params }) + const promise = ModificationAction({ params: Promise.resolve(params) }) // Then await expect(promise).rejects.toEqual(new Error('NEXT NOT_FOUND')) @@ -96,7 +98,7 @@ describe('ModificationActionPage server side', () => { }) // When - const promise = ModificationAction({ params }) + const promise = ModificationAction({ params: Promise.resolve(params) }) // Then await expect(promise).rejects.toEqual(new Error('NEXT NOT_FOUND')) @@ -112,7 +114,9 @@ describe('ModificationActionPage server side', () => { }) // When - const promise = ModificationAction({ params: { idAction: 'id-action' } }) + const promise = ModificationAction({ + params: Promise.resolve({ idAction: 'id-action' }), + }) // Then await expect(promise).rejects.toEqual(new Error('NEXT NOT_FOUND')) diff --git a/tests/pages/NouvelleActionPage.server.test.tsx b/tests/pages/NouvelleActionPage.server.test.tsx index 47bd956c4..6724e51a7 100644 --- a/tests/pages/NouvelleActionPage.server.test.tsx +++ b/tests/pages/NouvelleActionPage.server.test.tsx @@ -38,7 +38,7 @@ describe('NouvelleActionPage server side', () => { // When const metadata = await generateMetadata({ - params: { idJeune: 'id-beneficiaire' }, + params: Promise.resolve({ idJeune: 'id-beneficiaire' }), }) // Then @@ -70,7 +70,7 @@ describe('NouvelleActionPage server side', () => { // When render( await NouvelleAction({ - params: { idJeune: 'id-beneficiaire' }, + params: Promise.resolve({ idJeune: 'id-beneficiaire' }), }) ) @@ -88,7 +88,7 @@ describe('NouvelleActionPage server side', () => { ], returnTo: '/mes-jeunes/id-beneficiaire?onglet=actions', }, - {} + undefined ) }) }) diff --git a/tests/pages/OffrePage.server.page.test.tsx b/tests/pages/OffrePage.server.page.test.tsx index 93a2a7108..ae8909cc4 100644 --- a/tests/pages/OffrePage.server.page.test.tsx +++ b/tests/pages/OffrePage.server.page.test.tsx @@ -40,8 +40,10 @@ describe('OffrePage server side', () => { // When const params = { typeOffre: 'emploi', idOffre: 'id-offre' } - const metadata = await generateMetadata({ params }) - render(await Offre({ params })) + const metadata = await generateMetadata({ + params: Promise.resolve(params), + }) + render(await Offre({ params: Promise.resolve(params) })) // Then expect(getOffreEmploiServerSide).toHaveBeenCalledWith( @@ -55,7 +57,7 @@ describe('OffrePage server side', () => { { offre: detailEmploi, }, - {} + undefined ) }) @@ -65,7 +67,7 @@ describe('OffrePage server side', () => { // When const promise = Offre({ - params: { typeOffre: 'emploi', idOffre: 'offre-id' }, + params: Promise.resolve({ typeOffre: 'emploi', idOffre: 'offre-id' }), }) // Then @@ -82,8 +84,10 @@ describe('OffrePage server side', () => { // When const params = { typeOffre: 'immersion', idOffre: 'id-offre' } - const metadata = await generateMetadata({ params }) - render(await Offre({ params })) + const metadata = await generateMetadata({ + params: Promise.resolve(params), + }) + render(await Offre({ params: Promise.resolve(params) })) // Then expect(getImmersionServerSide).toHaveBeenCalledWith( @@ -98,7 +102,7 @@ describe('OffrePage server side', () => { { offre: detailImmersion, }, - {} + undefined ) }) @@ -108,7 +112,10 @@ describe('OffrePage server side', () => { // When const promise = Offre({ - params: { typeOffre: 'immersion', idOffre: 'offre-id' }, + params: Promise.resolve({ + typeOffre: 'immersion', + idOffre: 'offre-id', + }), }) // Then @@ -127,8 +134,10 @@ describe('OffrePage server side', () => { // When const params = { typeOffre: 'service-civique', idOffre: 'id-offre' } - const metadata = await generateMetadata({ params }) - render(await Offre({ params })) + const metadata = await generateMetadata({ + params: Promise.resolve(params), + }) + render(await Offre({ params: Promise.resolve(params) })) // Then expect(getServiceCiviqueServerSide).toHaveBeenCalledWith( @@ -142,7 +151,7 @@ describe('OffrePage server side', () => { { offre: detailServiceCivique, }, - {} + undefined ) }) @@ -152,7 +161,10 @@ describe('OffrePage server side', () => { // When const promise = Offre({ - params: { typeOffre: 'service-civique', idOffre: 'offre-id' }, + params: Promise.resolve({ + typeOffre: 'service-civique', + idOffre: 'offre-id', + }), }) // Then diff --git a/tests/pages/PartageOffrePage.server.test.tsx b/tests/pages/PartageOffrePage.server.test.tsx index 4a1b083a8..074c597e1 100644 --- a/tests/pages/PartageOffrePage.server.test.tsx +++ b/tests/pages/PartageOffrePage.server.test.tsx @@ -63,7 +63,7 @@ describe('Page Partage Offre', () => { // When render( await PartageOffre({ - params: { typeOffre: 'emploi', idOffre: 'offre-id' }, + params: Promise.resolve({ typeOffre: 'emploi', idOffre: 'offre-id' }), }) ) @@ -77,7 +77,7 @@ describe('Page Partage Offre', () => { offre: offreEmploi, returnTo: 'referer-url', }, - {} + undefined ) }) @@ -85,7 +85,10 @@ describe('Page Partage Offre', () => { // When render( await PartageOffre({ - params: { typeOffre: 'service-civique', idOffre: 'offre-id' }, + params: Promise.resolve({ + typeOffre: 'service-civique', + idOffre: 'offre-id', + }), }) ) @@ -99,7 +102,7 @@ describe('Page Partage Offre', () => { offre: serviceCivique, returnTo: 'referer-url', }, - {} + undefined ) }) @@ -107,7 +110,10 @@ describe('Page Partage Offre', () => { // When render( await PartageOffre({ - params: { typeOffre: 'immersion', idOffre: 'offre-id' }, + params: Promise.resolve({ + typeOffre: 'immersion', + idOffre: 'offre-id', + }), }) ) @@ -121,7 +127,7 @@ describe('Page Partage Offre', () => { offre: immersion, returnTo: 'referer-url', }, - {} + undefined ) }) @@ -131,7 +137,7 @@ describe('Page Partage Offre', () => { // When const promise = PartageOffre({ - params: { typeOffre: 'emploi', idOffre: 'offre-id' }, + params: Promise.resolve({ typeOffre: 'emploi', idOffre: 'offre-id' }), }) // Then @@ -153,7 +159,7 @@ describe('Page Partage Offre', () => { // When render( await PartageOffre({ - params: { typeOffre: 'emploi', idOffre: 'offre-id' }, + params: Promise.resolve({ typeOffre: 'emploi', idOffre: 'offre-id' }), }) ) @@ -162,7 +168,7 @@ describe('Page Partage Offre', () => { expect.objectContaining({ returnTo: '/offres', }), - {} + undefined ) }) }) diff --git a/tests/pages/PartageRecherchePage.server.test.tsx b/tests/pages/PartageRecherchePage.server.test.tsx index 76980a3fe..f1fd02342 100644 --- a/tests/pages/PartageRecherchePage.server.test.tsx +++ b/tests/pages/PartageRecherchePage.server.test.tsx @@ -40,14 +40,14 @@ describe('Partage Recherche', () => { // When render( await PartageRecherche({ - params: { typeOffre: 'emploi' }, - searchParams: { + params: Promise.resolve({ typeOffre: 'emploi' }), + searchParams: Promise.resolve({ titre: TITRE, motsCles: MOTS_CLES, typeLocalite: TYPE_LOCALITE, labelLocalite: LABEL_LOCALITE, codeLocalite: CODE_LOCALITE, - }, + }), }) ) @@ -64,7 +64,7 @@ describe('Partage Recherche', () => { }, returnTo: 'referer-url', }, - {} + undefined ) }) @@ -72,14 +72,14 @@ describe('Partage Recherche', () => { // When render( await PartageRecherche({ - params: { typeOffre: 'alternance' }, - searchParams: { + params: Promise.resolve({ typeOffre: 'alternance' }), + searchParams: Promise.resolve({ titre: TITRE, motsCles: MOTS_CLES, typeLocalite: TYPE_LOCALITE, labelLocalite: LABEL_LOCALITE, codeLocalite: CODE_LOCALITE, - }, + }), }) ) @@ -96,7 +96,7 @@ describe('Partage Recherche', () => { }, returnTo: 'referer-url', }, - {} + undefined ) }) @@ -104,15 +104,15 @@ describe('Partage Recherche', () => { // When render( await PartageRecherche({ - params: { typeOffre: 'immersion' }, - searchParams: { + params: Promise.resolve({ typeOffre: 'immersion' }), + searchParams: Promise.resolve({ titre: TITRE, labelMetier: LABEL_METIER, codeMetier: CODE_METIER, labelLocalite: LABEL_LOCALITE, latitude: LATITUDE, longitude: LONGITUDE, - }, + }), }) ) @@ -130,7 +130,7 @@ describe('Partage Recherche', () => { }, returnTo: 'referer-url', }, - {} + undefined ) }) @@ -138,13 +138,13 @@ describe('Partage Recherche', () => { // When render( await PartageRecherche({ - params: { typeOffre: 'service-civique' }, - searchParams: { + params: Promise.resolve({ typeOffre: 'service-civique' }), + searchParams: Promise.resolve({ titre: TITRE, labelLocalite: LABEL_LOCALITE, latitude: LATITUDE, longitude: LONGITUDE, - }, + }), }) ) @@ -160,7 +160,7 @@ describe('Partage Recherche', () => { }, returnTo: 'referer-url', }, - {} + undefined ) }) }) diff --git a/tests/pages/PlanDuSite.server.test.tsx b/tests/pages/PlanDuSite.server.test.tsx index 276862b8c..032d6545b 100644 --- a/tests/pages/PlanDuSite.server.test.tsx +++ b/tests/pages/PlanDuSite.server.test.tsx @@ -30,6 +30,6 @@ describe('PlanDuSite server side', () => { // Then expect(metadata).toEqual({ title: 'Plan du site' }) - expect(PlanDuSitePage).toHaveBeenCalledWith({}, {}) + expect(PlanDuSitePage).toHaveBeenCalledWith({}, undefined) }) }) diff --git a/tests/pages/PortefeuillePage.server.test.tsx b/tests/pages/PortefeuillePage.server.test.tsx index cbdc59b86..e46354db2 100644 --- a/tests/pages/PortefeuillePage.server.test.tsx +++ b/tests/pages/PortefeuillePage.server.test.tsx @@ -83,7 +83,7 @@ describe('PortefeuillePage server side', () => { })) .sort(compareBeneficiairesByNom), }), - {} + undefined ) }) }) @@ -127,7 +127,7 @@ describe('PortefeuillePage server side', () => { .sort(compareBeneficiairesByNom), isFromEmail: false, }, - {} + undefined ) }) }) diff --git a/tests/pages/ProfilPage.server.test.tsx b/tests/pages/ProfilPage.server.test.tsx index daf47dd6e..aa8973db6 100644 --- a/tests/pages/ProfilPage.server.test.tsx +++ b/tests/pages/ProfilPage.server.test.tsx @@ -29,7 +29,7 @@ describe('ProfilPage server side', () => { // Then expect(getAgencesServerSide).not.toHaveBeenCalled() - expect(ProfilPage).toHaveBeenCalledWith({ referentielAgences: [] }, {}) + expect(ProfilPage).toHaveBeenCalledWith({ referentielAgences: [] }, undefined) }) }) @@ -45,7 +45,7 @@ describe('ProfilPage server side', () => { await renderPageForConseiller(conseiller) // Then - expect(ProfilPage).toHaveBeenCalledWith({ referentielAgences: [] }, {}) + expect(ProfilPage).toHaveBeenCalledWith({ referentielAgences: [] }, undefined) }) }) @@ -60,7 +60,7 @@ describe('ProfilPage server side', () => { // Then expect(ProfilPage).toHaveBeenCalledWith( { referentielAgences: uneListeDAgencesMILO() }, - {} + undefined ) }) }) diff --git a/tests/pages/QualificationPage.server.test.tsx b/tests/pages/QualificationPage.server.test.tsx index 8ce50f7a4..ca51dc6f3 100644 --- a/tests/pages/QualificationPage.server.test.tsx +++ b/tests/pages/QualificationPage.server.test.tsx @@ -32,7 +32,7 @@ describe('QualificationPage server side', () => { // When const promise = Qualification({ - params: { idAction: 'id-action' }, + params: Promise.resolve({ idAction: 'id-action' }), }) // Then @@ -55,7 +55,7 @@ describe('QualificationPage server side', () => { // When const promise = Qualification({ - params: { idAction: 'id-action' }, + params: Promise.resolve({ idAction: 'id-action' }), }) // Then @@ -77,7 +77,7 @@ describe('QualificationPage server side', () => { // When const promise = Qualification({ - params: { idAction: 'id-action' }, + params: Promise.resolve({ idAction: 'id-action' }), }) // Then @@ -106,7 +106,7 @@ describe('QualificationPage server side', () => { // When const promise = Qualification({ - params: { idAction: 'id-action' }, + params: Promise.resolve({ idAction: 'id-action' }), }) // Then @@ -121,7 +121,7 @@ describe('QualificationPage server side', () => { const action = uneAction({ status: StatutAction.Terminee }) const beneficiaire = uneBaseBeneficiaire() const situationsNonProfessionnelles = desCategoriesAvecNONSNP() - const params = { idAction: 'id-action' } + const params = Promise.resolve({ idAction: 'id-action' }) ;(getAction as jest.Mock).mockResolvedValue({ action, jeune: beneficiaire, @@ -134,8 +134,8 @@ describe('QualificationPage server side', () => { const metadata = await generateMetadata({ params }) render( await Qualification({ - params: { idAction: action.id }, - searchParams: { liste: 'pilotage' }, + params: Promise.resolve({ idAction: action.id }), + searchParams: Promise.resolve({ liste: 'pilotage' }), }) ) @@ -157,7 +157,7 @@ describe('QualificationPage server side', () => { ), returnToListe: '/pilotage', }, - {} + undefined ) }) }) diff --git a/tests/pages/RaccourciPage.server.test.tsx b/tests/pages/RaccourciPage.server.test.tsx index eb3c9a0bc..6eb13c6cd 100644 --- a/tests/pages/RaccourciPage.server.test.tsx +++ b/tests/pages/RaccourciPage.server.test.tsx @@ -13,6 +13,6 @@ describe("Page Détail d'une action d'un jeune", () => { render(Raccourci()) // Then - expect(RaccourciPage).toHaveBeenCalledWith({}, {}) + expect(RaccourciPage).toHaveBeenCalledWith({}, undefined) }) }) diff --git a/tests/pages/ReaffectationPage.server.test.tsx b/tests/pages/ReaffectationPage.server.test.tsx index 93deb0108..b52a479fe 100644 --- a/tests/pages/ReaffectationPage.server.test.tsx +++ b/tests/pages/ReaffectationPage.server.test.tsx @@ -40,7 +40,7 @@ describe('Reaffectation', () => { render(await Reaffectation()) // Then - expect(ReaffectationPage).toHaveBeenCalledWith({}, {}) + expect(ReaffectationPage).toHaveBeenCalledWith({}, undefined) }) }) }) diff --git a/tests/pages/RendezvousPassesPage.server.test.tsx b/tests/pages/RendezvousPassesPage.server.test.tsx index bf3cd64c5..ab5694c66 100644 --- a/tests/pages/RendezvousPassesPage.server.test.tsx +++ b/tests/pages/RendezvousPassesPage.server.test.tsx @@ -38,8 +38,10 @@ describe('RendezVousPassesPage server side', () => { // When const params = { idJeune: 'id-jeune' } - const metadata = await generateMetadata({ params }) - render(await RendezVousPasses({ params })) + const metadata = await generateMetadata({ + params: Promise.resolve(params), + }) + render(await RendezVousPasses({ params: Promise.resolve(params) })) // Then expect(getJeuneDetails).toHaveBeenCalledWith('id-jeune', 'accessToken') @@ -55,7 +57,7 @@ describe('RendezVousPassesPage server side', () => { rdvs: [unEvenementListItem()], lectureSeule: false, }, - {} + undefined ) }) }) @@ -68,13 +70,17 @@ describe('RendezVousPassesPage server side', () => { }) // When - render(await RendezVousPasses({ params: { idJeune: 'id-jeune' } })) + render( + await RendezVousPasses({ + params: Promise.resolve({ idJeune: 'id-jeune' }), + }) + ) // Then expect(getRendezVousJeune).not.toHaveBeenCalled() expect(RendezVousPassesPage).toHaveBeenCalledWith( expect.objectContaining({ rdvs: [] }), - {} + undefined ) }) }) diff --git a/tests/pages/agenda/AgendaPage.sever.test.tsx b/tests/pages/agenda/AgendaPage.server.test.tsx similarity index 90% rename from tests/pages/agenda/AgendaPage.sever.test.tsx rename to tests/pages/agenda/AgendaPage.server.test.tsx index a8e369163..4caa88935 100644 --- a/tests/pages/agenda/AgendaPage.sever.test.tsx +++ b/tests/pages/agenda/AgendaPage.server.test.tsx @@ -35,12 +35,16 @@ describe('AgendaPage server side', () => { }) // When - render(await Agenda({ searchParams: { onglet: 'etablissement' } })) + render( + await Agenda({ + searchParams: Promise.resolve({ onglet: 'etablissement' }), + }) + ) // Then expect(AgendaPage).toHaveBeenCalledWith( { onglet: 'ETABLISSEMENT', periodeIndexInitial: 0 }, - {} + undefined ) }) }) diff --git a/tests/pages/aide/AidePage.server.test.tsx b/tests/pages/aide/AidePage.server.test.tsx index ed8dd5f57..0989508e9 100644 --- a/tests/pages/aide/AidePage.server.test.tsx +++ b/tests/pages/aide/AidePage.server.test.tsx @@ -17,6 +17,6 @@ describe('Aide server side', () => { // Then expect(metadata).toEqual({ title: 'Aide et ressources' }) - expect(AidePage).toHaveBeenCalledWith({}, {}) + expect(AidePage).toHaveBeenCalledWith({}, undefined) }) }) diff --git a/tests/pages/edition-rdv/EditionRdvPage.server.test.tsx b/tests/pages/edition-rdv/EditionRdvPage.server.test.tsx index 48bd3c9ee..695af14b5 100644 --- a/tests/pages/edition-rdv/EditionRdvPage.server.test.tsx +++ b/tests/pages/edition-rdv/EditionRdvPage.server.test.tsx @@ -53,7 +53,7 @@ describe('EditionRdvPage server side', () => { expect.objectContaining({ returnTo: '/agenda', }), - {} + undefined ) }) @@ -75,7 +75,7 @@ describe('EditionRdvPage server side', () => { expect.objectContaining({ returnTo: '/mes-jeunes', }), - {} + undefined ) }) @@ -95,18 +95,22 @@ describe('EditionRdvPage server side', () => { conseillerEstObservateur: false, lectureSeule: false, }, - {} + undefined ) }) it('récupère le jeune concerné', async () => { // When - render(await EditionRdv({ searchParams: { idJeune: 'id-jeune' } })) + render( + await EditionRdv({ + searchParams: Promise.resolve({ idJeune: 'id-jeune' }), + }) + ) // Then expect(EditionRdvPage).toHaveBeenCalledWith( expect.objectContaining({ idBeneficiaire: 'id-jeune' }), - {} + undefined ) }) @@ -120,8 +124,10 @@ describe('EditionRdvPage server side', () => { // When const searchParams = { idRdv: 'id-rdv' } - const metadata = await generateMetadata({ searchParams }) - render(await EditionRdv({ searchParams })) + const metadata = await generateMetadata({ + searchParams: Promise.resolve(searchParams), + }) + render(await EditionRdv({ searchParams: Promise.resolve(searchParams) })) // Then expect(getDetailsEvenement).toHaveBeenCalledWith('id-rdv', 'accessToken') @@ -131,7 +137,7 @@ describe('EditionRdvPage server side', () => { }) expect(EditionRdvPage).toHaveBeenCalledWith( expect.objectContaining({ evenement }), - {} + undefined ) }) @@ -140,7 +146,9 @@ describe('EditionRdvPage server side', () => { ;(getDetailsEvenement as jest.Mock).mockResolvedValue(undefined) // When - const promise = EditionRdv({ searchParams: { idRdv: 'id-rdv' } }) + const promise = EditionRdv({ + searchParams: Promise.resolve({ idRdv: 'id-rdv' }), + }) // Then await expect(promise).rejects.toEqual(new Error('NEXT NOT_FOUND')) @@ -164,8 +172,10 @@ describe('EditionRdvPage server side', () => { it('prépare la page', async () => { // When const searchParams = { type: 'ac' } - const metadata = await generateMetadata({ searchParams }) - render(await EditionRdv({ searchParams })) + const metadata = await generateMetadata({ + searchParams: Promise.resolve(searchParams), + }) + render(await EditionRdv({ searchParams: Promise.resolve(searchParams) })) // Then expect(metadata).toEqual({ title: 'Créer une animation collective' }) @@ -177,13 +187,15 @@ describe('EditionRdvPage server side', () => { conseillerEstObservateur: false, lectureSeule: false, }, - {} + undefined ) }) it('récupère le référentiel des types d’événements de catégorie AC', async () => { // When - render(await EditionRdv({ searchParams: { type: 'ac' } })) + render( + await EditionRdv({ searchParams: Promise.resolve({ type: 'ac' }) }) + ) // Then expect(getTypesRendezVous).toHaveBeenCalledWith('accessToken') @@ -191,18 +203,22 @@ describe('EditionRdvPage server side', () => { expect.objectContaining({ typesRendezVous: typesAnimationCollective(), }), - {} + undefined ) }) it('récupère le jeune concerné', async () => { // When - render(await EditionRdv({ searchParams: { idJeune: 'id-jeune' } })) + render( + await EditionRdv({ + searchParams: Promise.resolve({ idJeune: 'id-jeune' }), + }) + ) // Then expect(EditionRdvPage).toHaveBeenCalledWith( expect.objectContaining({ idBeneficiaire: 'id-jeune' }), - {} + undefined ) }) @@ -216,8 +232,10 @@ describe('EditionRdvPage server side', () => { // When const searchParams = { idRdv: 'id-rdv', type: 'ac' } - const metadata = await generateMetadata({ searchParams }) - render(await EditionRdv({ searchParams })) + const metadata = await generateMetadata({ + searchParams: Promise.resolve(searchParams), + }) + render(await EditionRdv({ searchParams: Promise.resolve(searchParams) })) // Then expect(getDetailsEvenement).toHaveBeenCalledWith('id-rdv', 'accessToken') @@ -229,7 +247,7 @@ describe('EditionRdvPage server side', () => { evenement: animationCollective, evenementTypeAC: true, }), - {} + undefined ) }) @@ -239,7 +257,7 @@ describe('EditionRdvPage server side', () => { // When const promise = EditionRdv({ - searchParams: { idRdv: 'id-rdv', type: 'ac' }, + searchParams: Promise.resolve({ idRdv: 'id-rdv', type: 'ac' }), }) // Then diff --git a/tests/pages/fiche-jeune/FicheBeneficiairePage.server.test.tsx b/tests/pages/fiche-jeune/FicheBeneficiairePage.server.test.tsx index 038454d1e..67532b9c2 100644 --- a/tests/pages/fiche-jeune/FicheBeneficiairePage.server.test.tsx +++ b/tests/pages/fiche-jeune/FicheBeneficiairePage.server.test.tsx @@ -105,7 +105,11 @@ describe('FicheBeneficiairePage server side', () => { describe('Quand la session est valide', () => { beforeEach(async () => { // When - render(await FicheBeneficiaire({ params: { idJeune: 'id-jeune' } })) + render( + await FicheBeneficiaire({ + params: Promise.resolve({ idJeune: 'id-jeune' }), + }) + ) }) it('récupère les infos du jeune', async () => { @@ -124,7 +128,7 @@ describe('FicheBeneficiairePage server side', () => { lectureSeule: false, erreurSessions: false, }, - {} + undefined ) }) @@ -142,7 +146,7 @@ describe('FicheBeneficiairePage server side', () => { ) expect(FicheBeneficiairePage).toHaveBeenCalledWith( expect.objectContaining({ rdvs: [rdvAVenir, sessionsAVenir] }), - {} + undefined ) }) @@ -154,7 +158,7 @@ describe('FicheBeneficiairePage server side', () => { ) expect(FicheBeneficiairePage).toHaveBeenCalledWith( expect.objectContaining({ metadonneesFavoris: uneMetadonneeFavoris() }), - {} + undefined ) }) @@ -178,7 +182,7 @@ describe('FicheBeneficiairePage server side', () => { metadonnees: { nombreTotal: 14, nombrePages: 2 }, }, }), - {} + undefined ) }) }) @@ -188,8 +192,8 @@ describe('FicheBeneficiairePage server side', () => { // When render( await FicheBeneficiaire({ - params: { idJeune: 'id-jeune' }, - searchParams: { page: '3' }, + params: Promise.resolve({ idJeune: 'id-jeune' }), + searchParams: Promise.resolve({ page: '3' }), }) ) @@ -205,7 +209,7 @@ describe('FicheBeneficiairePage server side', () => { page: 3, }), }), - {} + undefined ) }) }) @@ -215,15 +219,15 @@ describe('FicheBeneficiairePage server side', () => { // When render( await FicheBeneficiaire({ - params: { idJeune: 'id-jeune' }, - searchParams: { onglet: 'rdvs' }, + params: Promise.resolve({ idJeune: 'id-jeune' }), + searchParams: Promise.resolve({ onglet: 'rdvs' }), }) ) // Then expect(FicheBeneficiairePage).toHaveBeenCalledWith( expect.objectContaining({ ongletInitial: 'rdvs' }), - {} + undefined ) }) }) @@ -243,7 +247,11 @@ describe('FicheBeneficiairePage server side', () => { ) // When - render(await FicheBeneficiaire({ params: { idJeune: 'id-jeune' } })) + render( + await FicheBeneficiaire({ + params: Promise.resolve({ idJeune: 'id-jeune' }), + }) + ) }) it('ne recupère pas les rendez-vous', async () => { @@ -252,7 +260,7 @@ describe('FicheBeneficiairePage server side', () => { expect(getSessionsMiloBeneficiaire).not.toHaveBeenCalled() expect(FicheBeneficiairePage).toHaveBeenCalledWith( expect.not.objectContaining({ rdvs: expect.arrayContaining([]) }), - {} + undefined ) }) @@ -265,7 +273,7 @@ describe('FicheBeneficiairePage server side', () => { actions: expect.arrayContaining([]), }), }), - {} + undefined ) }) @@ -275,7 +283,7 @@ describe('FicheBeneficiairePage server side', () => { expect.objectContaining({ favorisOffres: uneListeDOffres(), }), - {} + undefined ) }) @@ -288,7 +296,7 @@ describe('FicheBeneficiairePage server side', () => { expect.objectContaining({ favorisRecherches: uneListeDeRecherches(), }), - {} + undefined ) }) }) @@ -308,7 +316,11 @@ describe('FicheBeneficiairePage server side', () => { ) // When - render(await FicheBeneficiaire({ params: { idJeune: 'id-jeune' } })) + render( + await FicheBeneficiaire({ + params: Promise.resolve({ idJeune: 'id-jeune' }), + }) + ) // Then expect(getDemarchesBeneficiaire).toHaveBeenCalledWith( @@ -324,7 +336,7 @@ describe('FicheBeneficiairePage server side', () => { isStale: false, }, }), - {} + undefined ) }) }) @@ -337,14 +349,18 @@ describe('FicheBeneficiairePage server side', () => { ) // When - render(await FicheBeneficiaire({ params: { idJeune: 'id-jeune' } })) + render( + await FicheBeneficiaire({ + params: Promise.resolve({ idJeune: 'id-jeune' }), + }) + ) // Then expect(getJeuneDetails).toHaveBeenCalledWith('id-jeune', 'accessToken') expect(FicheBeneficiairePage).toHaveBeenCalledWith( expect.objectContaining({ lectureSeule: true }), - {} + undefined ) }) }) diff --git a/tests/pages/layouts/LayoutWhenConnected.test.tsx b/tests/pages/layouts/LayoutWhenConnected.test.tsx index 6f27ad049..96e0663c2 100644 --- a/tests/pages/layouts/LayoutWhenConnected.test.tsx +++ b/tests/pages/layouts/LayoutWhenConnected.test.tsx @@ -108,7 +108,7 @@ describe('LayoutWhenConnected', () => { ) expect(ConseillerProvider).toHaveBeenCalledWith( expect.objectContaining({ conseiller }), - {} + undefined ) }) @@ -124,7 +124,7 @@ describe('LayoutWhenConnected', () => { extractBaseBeneficiaire ), }), - {} + undefined ) }) }) diff --git a/tests/pages/offres/RechercheOffresPage.test.tsx b/tests/pages/offres/RechercheOffresPage.test.tsx index 0dada6bda..801dac5d7 100644 --- a/tests/pages/offres/RechercheOffresPage.test.tsx +++ b/tests/pages/offres/RechercheOffresPage.test.tsx @@ -61,7 +61,7 @@ describe('Page Recherche Offres', () => { expect( screen .getAllByRole('alert') - .find((pouet) => /Une erreur est survenue/.test(pouet.textContent!)) + .find((alerte) => /Une erreur est survenue/.test(alerte.textContent!)) ).toBeInTheDocument() }) diff --git a/tests/pages/pilotage/PilotagePage.server.test.tsx b/tests/pages/pilotage/PilotagePage.server.test.tsx index aa3826517..7199cec78 100644 --- a/tests/pages/pilotage/PilotagePage.server.test.tsx +++ b/tests/pages/pilotage/PilotagePage.server.test.tsx @@ -126,7 +126,7 @@ describe('PilotagePage server side', () => { sessions: uneListeDeSessionsAClore(), onglet: 'ACTIONS', }, - {} + undefined ) }) @@ -145,7 +145,7 @@ describe('PilotagePage server side', () => { // When render( await Pilotage({ - searchParams: { onglet: 'sessionsImilo' }, + searchParams: Promise.resolve({ onglet: 'sessionsImilo' }), }) ) @@ -162,7 +162,7 @@ describe('PilotagePage server side', () => { animationsCollectives: undefined, sessions: undefined, }, - {} + undefined ) }) @@ -173,7 +173,7 @@ describe('PilotagePage server side', () => { // When render( await Pilotage({ - searchParams: { onglet: 'animationsCollectives' }, + searchParams: Promise.resolve({ onglet: 'animationsCollectives' }), }) ) @@ -190,7 +190,7 @@ describe('PilotagePage server side', () => { animationsCollectives: undefined, sessions: undefined, }, - {} + undefined ) }) }) diff --git a/tests/utils/chatsContext.test.tsx b/tests/utils/chatsContext.test.tsx index 40379885a..0a24d2387 100644 --- a/tests/utils/chatsContext.test.tsx +++ b/tests/utils/chatsContext.test.tsx @@ -1,4 +1,4 @@ -import { RenderResult, act, render, screen } from '@testing-library/react' +import { act, render, RenderResult } from '@testing-library/react' import React from 'react' import { @@ -93,9 +93,10 @@ describe('ChatsProvider', () => { it('affiche une notification dans l’onglet s’il y a des messages non lus', async () => { // Then - expect( - renderResult.container.querySelector("link[rel='icon']") - ).toHaveProperty('href', 'http://localhost/cej-favicon-notif.png') + expect(document.querySelector("link[rel='icon']")).toHaveProperty( + 'href', + 'http://localhost/cej-favicon-notif.png' + ) expect(document.title).toMatch(/Nouveau\(x\) message\(s\) - /) }) diff --git a/tsconfig.json b/tsconfig.json index e1b91f586..66e4079c8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,6 +26,7 @@ ] }, "include": [ + "types/svgr.d.ts", "next-env.d.ts", "**/*.ts", "**/*.tsx", diff --git a/types/components.d.ts b/types/components.d.ts index 0570f4491..4c2f5775e 100644 --- a/types/components.d.ts +++ b/types/components.d.ts @@ -1,6 +1,4 @@ -import { ReactElement, ReactNode } from 'react' - -export type MandatoryNode = Exclude +import { ReactElement } from 'react' type ElementOnly = ReactElement | null | undefined export type ElementsOnly = ElementOnly | Iterable diff --git a/types/svgr.d.ts b/types/svgr.d.ts new file mode 100644 index 000000000..7cec3a619 --- /dev/null +++ b/types/svgr.d.ts @@ -0,0 +1,5 @@ +declare module '*.svg' { + import { FC, SVGProps } from 'react' + const content: FC> + export default content +} diff --git a/yarn.lock b/yarn.lock index 3cbaa7815..f6e1b77b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -47,7 +47,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.21.3, @babel/core@npm:^7.23.9": +"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.21.3, @babel/core@npm:^7.23.9, @babel/core@npm:^7.24.4": version: 7.26.0 resolution: "@babel/core@npm:7.26.0" dependencies: @@ -115,7 +115,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.25.9": +"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.25.9": version: 7.25.9 resolution: "@babel/helper-create-class-features-plugin@npm:7.25.9" dependencies: @@ -308,6 +308,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.24.4": + version: 7.26.3 + resolution: "@babel/parser@npm:7.26.3" + dependencies: + "@babel/types": "npm:^7.26.3" + bin: + parser: ./bin/babel-parser.js + checksum: 10c0/48f736374e61cfd10ddbf7b80678514ae1f16d0e88bc793d2b505d73d9b987ea786fc8c2f7ee8f8b8c467df062030eb07fd0eb2168f0f541ca1f542775852cad + languageName: node + linkType: hard + "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.25.9": version: 7.25.9 resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.25.9" @@ -367,6 +378,18 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-proposal-private-methods@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-proposal-private-methods@npm:7.18.6" + dependencies: + "@babel/helper-create-class-features-plugin": "npm:^7.18.6" + "@babel/helper-plugin-utils": "npm:^7.18.6" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10c0/1c273d0ec3d49d0fe80bd754ec0191016e5b3ab4fb1e162ac0c014e9d3c1517a5d973afbf8b6dc9f9c98a8605c79e5f9e8b5ee158a4313fa68d1ff7b02084b6a + languageName: node + linkType: hard + "@babel/plugin-proposal-private-property-in-object@npm:7.21.0-placeholder-for-preset-env.2": version: 7.21.0-placeholder-for-preset-env.2 resolution: "@babel/plugin-proposal-private-property-in-object@npm:7.21.0-placeholder-for-preset-env.2" @@ -1418,6 +1441,16 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.26.3": + version: 7.26.3 + resolution: "@babel/types@npm:7.26.3" + dependencies: + "@babel/helper-string-parser": "npm:^7.25.9" + "@babel/helper-validator-identifier": "npm:^7.25.9" + checksum: 10c0/966c5242c5e55c8704bf7a7418e7be2703a0afa4d19a8480999d5a4ef13d095dd60686615fe5983cb7593b4b06ba3a7de8d6ca501c1d78bdd233a10d90be787b + languageName: node + linkType: hard + "@bcoe/v8-coverage@npm:^0.2.3": version: 0.2.3 resolution: "@bcoe/v8-coverage@npm:0.2.3" @@ -1432,7 +1465,7 @@ __metadata: languageName: node linkType: hard -"@elastic/apm-rum-core@npm:^5.21.0, @elastic/apm-rum-core@npm:^5.21.1": +"@elastic/apm-rum-core@npm:^5.21.1": version: 5.21.1 resolution: "@elastic/apm-rum-core@npm:5.21.1" dependencies: @@ -1443,29 +1476,20 @@ __metadata: languageName: node linkType: hard -"@elastic/apm-rum-react@npm:2.0.2": - version: 2.0.2 - resolution: "@elastic/apm-rum-react@npm:2.0.2" +"@elastic/apm-rum-react@npm:2.0.3": + version: 2.0.3 + resolution: "@elastic/apm-rum-react@npm:2.0.3" dependencies: - "@elastic/apm-rum": "npm:^5.16.0" + "@elastic/apm-rum": "npm:^5.16.1" hoist-non-react-statics: "npm:^3.3.0" peerDependencies: react: ">16.0.0" react-router-dom: ">=6.0.0" - checksum: 10c0/e32505f6b29761ff989ea52b4440acb330bd0455dfb225a28cada55b2127082f623465a5936b14201b016090a96d4140c65ca76fb9aa362cf47b25b1e547f9e3 + checksum: 10c0/f2e3fd0575f94336ef06efa4fa6d86f3d25f78cfec1348303464a05f73d1a10f17169c9818070499f466501eb68a72864e54b1138696240c1eb3fa880ffb5b7f languageName: node linkType: hard -"@elastic/apm-rum@npm:5.16.0": - version: 5.16.0 - resolution: "@elastic/apm-rum@npm:5.16.0" - dependencies: - "@elastic/apm-rum-core": "npm:^5.21.0" - checksum: 10c0/34c9b241c20290353d7f64abb041cd7380d50991a74464bd4fba6902d781d6039454ef838603c9a4da6746e9e7021afd01d13a3f84d8967f8260ac5f449a6192 - languageName: node - linkType: hard - -"@elastic/apm-rum@npm:^5.16.0": +"@elastic/apm-rum@npm:5.16.1, @elastic/apm-rum@npm:^5.16.1": version: 5.16.1 resolution: "@elastic/apm-rum@npm:5.16.1" dependencies: @@ -1510,34 +1534,70 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.6.1": +"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.12.1": version: 4.12.1 resolution: "@eslint-community/regexpp@npm:4.12.1" checksum: 10c0/a03d98c246bcb9109aec2c08e4d10c8d010256538dcb3f56610191607214523d4fb1b00aa81df830b6dffb74c5fa0be03642513a289c567949d3e550ca11cdf6 languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.1.4": - version: 2.1.4 - resolution: "@eslint/eslintrc@npm:2.1.4" +"@eslint/config-array@npm:^0.19.0": + version: 0.19.1 + resolution: "@eslint/config-array@npm:0.19.1" + dependencies: + "@eslint/object-schema": "npm:^2.1.5" + debug: "npm:^4.3.1" + minimatch: "npm:^3.1.2" + checksum: 10c0/43b01f596ddad404473beae5cf95c013d29301c72778d0f5bf8a6699939c8a9a5663dbd723b53c5f476b88b0c694f76ea145d1aa9652230d140fe1161e4a4b49 + languageName: node + linkType: hard + +"@eslint/core@npm:^0.9.0": + version: 0.9.1 + resolution: "@eslint/core@npm:0.9.1" + dependencies: + "@types/json-schema": "npm:^7.0.15" + checksum: 10c0/638104b1b5833a9bbf2329f0c0ddf322e4d6c0410b149477e02cd2b78c04722be90c14b91b8ccdef0d63a2404dff72a17b6b412ce489ea429ae6a8fcb8abff28 + languageName: node + linkType: hard + +"@eslint/eslintrc@npm:^3.2.0": + version: 3.2.0 + resolution: "@eslint/eslintrc@npm:3.2.0" dependencies: ajv: "npm:^6.12.4" debug: "npm:^4.3.2" - espree: "npm:^9.6.0" - globals: "npm:^13.19.0" + espree: "npm:^10.0.1" + globals: "npm:^14.0.0" ignore: "npm:^5.2.0" import-fresh: "npm:^3.2.1" js-yaml: "npm:^4.1.0" minimatch: "npm:^3.1.2" strip-json-comments: "npm:^3.1.1" - checksum: 10c0/32f67052b81768ae876c84569ffd562491ec5a5091b0c1e1ca1e0f3c24fb42f804952fdd0a137873bc64303ba368a71ba079a6f691cee25beee9722d94cc8573 + checksum: 10c0/43867a07ff9884d895d9855edba41acf325ef7664a8df41d957135a81a477ff4df4196f5f74dc3382627e5cc8b7ad6b815c2cea1b58f04a75aced7c43414ab8b + languageName: node + linkType: hard + +"@eslint/js@npm:9.16.0, @eslint/js@npm:^9.16.0": + version: 9.16.0 + resolution: "@eslint/js@npm:9.16.0" + checksum: 10c0/a55846a4ddade720662d36682f3eaaf38eac06eeee12c83bb837bba2b7d550dadcb3445b104219f0bc1da2e09b4fe5fb5ba123b8338c8c787bcfbd540878df75 languageName: node linkType: hard -"@eslint/js@npm:8.57.1": - version: 8.57.1 - resolution: "@eslint/js@npm:8.57.1" - checksum: 10c0/b489c474a3b5b54381c62e82b3f7f65f4b8a5eaaed126546520bf2fede5532a8ed53212919fed1e9048dcf7f37167c8561d58d0ba4492a4244004e7793805223 +"@eslint/object-schema@npm:^2.1.5": + version: 2.1.5 + resolution: "@eslint/object-schema@npm:2.1.5" + checksum: 10c0/5320691ed41ecd09a55aff40ce8e56596b4eb81f3d4d6fe530c50fdd6552d88102d1c1a29d970ae798ce30849752a708772de38ded07a6f25b3da32ebea081d8 + languageName: node + linkType: hard + +"@eslint/plugin-kit@npm:^0.2.3": + version: 0.2.4 + resolution: "@eslint/plugin-kit@npm:0.2.4" + dependencies: + levn: "npm:^0.4.1" + checksum: 10c0/1bcfc0a30b1df891047c1d8b3707833bded12a057ba01757a2a8591fdc8d8fe0dbb8d51d4b0b61b2af4ca1d363057abd7d2fb4799f1706b105734f4d3fa0dbf1 languageName: node linkType: hard @@ -2103,14 +2163,20 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.13.0": - version: 0.13.0 - resolution: "@humanwhocodes/config-array@npm:0.13.0" +"@humanfs/core@npm:^0.19.1": + version: 0.19.1 + resolution: "@humanfs/core@npm:0.19.1" + checksum: 10c0/aa4e0152171c07879b458d0e8a704b8c3a89a8c0541726c6b65b81e84fd8b7564b5d6c633feadc6598307d34564bd53294b533491424e8e313d7ab6c7bc5dc67 + languageName: node + linkType: hard + +"@humanfs/node@npm:^0.16.6": + version: 0.16.6 + resolution: "@humanfs/node@npm:0.16.6" dependencies: - "@humanwhocodes/object-schema": "npm:^2.0.3" - debug: "npm:^4.3.1" - minimatch: "npm:^3.0.5" - checksum: 10c0/205c99e756b759f92e1f44a3dc6292b37db199beacba8f26c2165d4051fe73a4ae52fdcfd08ffa93e7e5cb63da7c88648f0e84e197d154bbbbe137b2e0dd332e + "@humanfs/core": "npm:^0.19.1" + "@humanwhocodes/retry": "npm:^0.3.0" + checksum: 10c0/8356359c9f60108ec204cbd249ecd0356667359b2524886b357617c4a7c3b6aace0fd5a369f63747b926a762a88f8a25bc066fa1778508d110195ce7686243e1 languageName: node linkType: hard @@ -2121,10 +2187,17 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^2.0.3": - version: 2.0.3 - resolution: "@humanwhocodes/object-schema@npm:2.0.3" - checksum: 10c0/80520eabbfc2d32fe195a93557cef50dfe8c8905de447f022675aaf66abc33ae54098f5ea78548d925aa671cd4ab7c7daa5ad704fe42358c9b5e7db60f80696c +"@humanwhocodes/retry@npm:^0.3.0": + version: 0.3.1 + resolution: "@humanwhocodes/retry@npm:0.3.1" + checksum: 10c0/f0da1282dfb45e8120480b9e2e275e2ac9bbe1cf016d046fdad8e27cc1285c45bb9e711681237944445157b430093412b4446c1ab3fc4bb037861b5904101d3b + languageName: node + linkType: hard + +"@humanwhocodes/retry@npm:^0.4.1": + version: 0.4.1 + resolution: "@humanwhocodes/retry@npm:0.4.1" + checksum: 10c0/be7bb6841c4c01d0b767d9bb1ec1c9359ee61421ce8ba66c249d035c5acdfd080f32d55a5c9e859cdd7868788b8935774f65b2caf24ec0b7bd7bf333791f063b languageName: node linkType: hard @@ -2609,90 +2682,83 @@ __metadata: languageName: node linkType: hard -"@next/bundle-analyzer@npm:14.2.18": - version: 14.2.18 - resolution: "@next/bundle-analyzer@npm:14.2.18" +"@next/bundle-analyzer@npm:15.0.4": + version: 15.0.4 + resolution: "@next/bundle-analyzer@npm:15.0.4" dependencies: webpack-bundle-analyzer: "npm:4.10.1" - checksum: 10c0/c80e947af9c44f0f3961b285513cc62bd133e34262b39cc46fd5868172a0756617c6bc3ee5146b9a8594cfe82eca31b11acf2c7f240fb1d4c9baf5136f40e34c + checksum: 10c0/cbeddac527697faee19de87a84ff2b2a3a9986562ef4986b255c219d51eb78277350a63219472eaf6754183c2c9e8208139cbb2949d9c5aed7a37b07893554a2 languageName: node linkType: hard -"@next/env@npm:14.2.18": - version: 14.2.18 - resolution: "@next/env@npm:14.2.18" - checksum: 10c0/b075fb54873de7cd977b4e07af186af60251e71ea6a905445c4fc14f076e46e3f9b51f489e1363c946c8807388cfc834dd7bf96a3257d5ba4d4ffa94610c96e7 +"@next/env@npm:15.0.4": + version: 15.0.4 + resolution: "@next/env@npm:15.0.4" + checksum: 10c0/114f5404798017ab9438ed9e90cb0057d8a42167995cf702ba938613e869e59869e55d7cebdbb19a5f5f89aa5d1899bc8849ea20e0902101196c66f63f5580fb languageName: node linkType: hard -"@next/eslint-plugin-next@npm:14.2.18": - version: 14.2.18 - resolution: "@next/eslint-plugin-next@npm:14.2.18" +"@next/eslint-plugin-next@npm:15.0.4": + version: 15.0.4 + resolution: "@next/eslint-plugin-next@npm:15.0.4" dependencies: - glob: "npm:10.3.10" - checksum: 10c0/1696974728438e7f37a36664003d87e81c4c30f802a1d91c023d54bc771b2d5c169df08ff36d9d11ab19f62fb29464f424c48ee1cfc0e17332726c0f2ab6ea80 + fast-glob: "npm:3.3.1" + checksum: 10c0/ce55e4102712baac47d79f4b6ed8962b472d1a9aafe2ec0fcb7160e818fd2768d806c7a6cd95e122e1c32ac1897bc10cb39f70b6c53f7b36589269177f88f66f languageName: node linkType: hard -"@next/swc-darwin-arm64@npm:14.2.18": - version: 14.2.18 - resolution: "@next/swc-darwin-arm64@npm:14.2.18" +"@next/swc-darwin-arm64@npm:15.0.4": + version: 15.0.4 + resolution: "@next/swc-darwin-arm64@npm:15.0.4" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@next/swc-darwin-x64@npm:14.2.18": - version: 14.2.18 - resolution: "@next/swc-darwin-x64@npm:14.2.18" +"@next/swc-darwin-x64@npm:15.0.4": + version: 15.0.4 + resolution: "@next/swc-darwin-x64@npm:15.0.4" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@next/swc-linux-arm64-gnu@npm:14.2.18": - version: 14.2.18 - resolution: "@next/swc-linux-arm64-gnu@npm:14.2.18" +"@next/swc-linux-arm64-gnu@npm:15.0.4": + version: 15.0.4 + resolution: "@next/swc-linux-arm64-gnu@npm:15.0.4" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-arm64-musl@npm:14.2.18": - version: 14.2.18 - resolution: "@next/swc-linux-arm64-musl@npm:14.2.18" +"@next/swc-linux-arm64-musl@npm:15.0.4": + version: 15.0.4 + resolution: "@next/swc-linux-arm64-musl@npm:15.0.4" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@next/swc-linux-x64-gnu@npm:14.2.18": - version: 14.2.18 - resolution: "@next/swc-linux-x64-gnu@npm:14.2.18" +"@next/swc-linux-x64-gnu@npm:15.0.4": + version: 15.0.4 + resolution: "@next/swc-linux-x64-gnu@npm:15.0.4" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-x64-musl@npm:14.2.18": - version: 14.2.18 - resolution: "@next/swc-linux-x64-musl@npm:14.2.18" +"@next/swc-linux-x64-musl@npm:15.0.4": + version: 15.0.4 + resolution: "@next/swc-linux-x64-musl@npm:15.0.4" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@next/swc-win32-arm64-msvc@npm:14.2.18": - version: 14.2.18 - resolution: "@next/swc-win32-arm64-msvc@npm:14.2.18" +"@next/swc-win32-arm64-msvc@npm:15.0.4": + version: 15.0.4 + resolution: "@next/swc-win32-arm64-msvc@npm:15.0.4" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@next/swc-win32-ia32-msvc@npm:14.2.18": - version: 14.2.18 - resolution: "@next/swc-win32-ia32-msvc@npm:14.2.18" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - -"@next/swc-win32-x64-msvc@npm:14.2.18": - version: 14.2.18 - resolution: "@next/swc-win32-x64-msvc@npm:14.2.18" +"@next/swc-win32-x64-msvc@npm:15.0.4": + version: 15.0.4 + resolution: "@next/swc-win32-x64-msvc@npm:15.0.4" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -2714,7 +2780,7 @@ __metadata: languageName: node linkType: hard -"@nodelib/fs.walk@npm:^1.2.3, @nodelib/fs.walk@npm:^1.2.8": +"@nodelib/fs.walk@npm:^1.2.3": version: 1.2.8 resolution: "@nodelib/fs.walk@npm:1.2.8" dependencies: @@ -2917,7 +2983,7 @@ __metadata: languageName: node linkType: hard -"@rushstack/eslint-patch@npm:^1.3.3": +"@rushstack/eslint-patch@npm:^1.10.3": version: 1.10.4 resolution: "@rushstack/eslint-patch@npm:1.10.4" checksum: 10c0/de312bd7a3cb0f313c9720029eb719d8762fe54946cce2d33ac142b1cbb5817c4a5a92518dfa476c26311602d37f5a8f7caa90a0c73e3d6a56f9a05d2799c172 @@ -3089,7 +3155,7 @@ __metadata: languageName: node linkType: hard -"@svgr/webpack@npm:8.1.0": +"@svgr/webpack@npm:^8.1.0": version: 8.1.0 resolution: "@svgr/webpack@npm:8.1.0" dependencies: @@ -3105,20 +3171,19 @@ __metadata: languageName: node linkType: hard -"@swc/counter@npm:^0.1.3": +"@swc/counter@npm:0.1.3": version: 0.1.3 resolution: "@swc/counter@npm:0.1.3" checksum: 10c0/8424f60f6bf8694cfd2a9bca45845bce29f26105cda8cf19cdb9fd3e78dc6338699e4db77a89ae449260bafa1cc6bec307e81e7fb96dbf7dcfce0eea55151356 languageName: node linkType: hard -"@swc/helpers@npm:0.5.5": - version: 0.5.5 - resolution: "@swc/helpers@npm:0.5.5" +"@swc/helpers@npm:0.5.13": + version: 0.5.13 + resolution: "@swc/helpers@npm:0.5.13" dependencies: - "@swc/counter": "npm:^0.1.3" tslib: "npm:^2.4.0" - checksum: 10c0/21a9b9cfe7e00865f9c9f3eb4c1cc5b397143464f7abee76a2c5366e591e06b0155b5aac93fe8269ef8d548df253f6fd931e9ddfc0fd12efd405f90f45506e7d + checksum: 10c0/b9df578401fc62405da9a6c31e79e447a2fd90f68b25b1daee12f2caf2821991bb89106f0397bc1acb4c4d84a8ce079d04b60b65f534496952e3bf8c9a52f40f languageName: node linkType: hard @@ -3153,23 +3218,23 @@ __metadata: languageName: node linkType: hard -"@testing-library/react@npm:^16.0.1": - version: 16.0.1 - resolution: "@testing-library/react@npm:16.0.1" +"@testing-library/react@npm:^16.1.0": + version: 16.1.0 + resolution: "@testing-library/react@npm:16.1.0" dependencies: "@babel/runtime": "npm:^7.12.5" peerDependencies: "@testing-library/dom": ^10.0.0 - "@types/react": ^18.0.0 - "@types/react-dom": ^18.0.0 - react: ^18.0.0 - react-dom: ^18.0.0 + "@types/react": ^18.0.0 || ^19.0.0 + "@types/react-dom": ^18.0.0 || ^19.0.0 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 peerDependenciesMeta: "@types/react": optional: true "@types/react-dom": optional: true - checksum: 10c0/67d05dec5ad5a2e6f92b6a3234af785435c7bb62bdbf12f3bfc89c9bca0c871a189e88c4ba023ed4cea504704c87c6ac7e86e24a3962df6c521ae89b62f48ff7 + checksum: 10c0/8451dcc76ba0d4f3504af78f2a4aacc13117691f4b7a3c279f3e047d5ea817ff686496ad53e7f65f6183112aef2be3f318af609b1f5d666eed42b1014d1c68d5 languageName: node linkType: hard @@ -3251,6 +3316,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:^1.0.6": + version: 1.0.6 + resolution: "@types/estree@npm:1.0.6" + checksum: 10c0/cdfd751f6f9065442cd40957c07fd80361c962869aa853c1c2fd03e101af8b9389d8ff4955a43a6fcfa223dd387a089937f95be0f3eec21ca527039fd2d9859a + languageName: node + linkType: hard + "@types/graceful-fs@npm:^4.1.3": version: 4.1.9 resolution: "@types/graceful-fs@npm:4.1.9" @@ -3316,6 +3388,13 @@ __metadata: languageName: node linkType: hard +"@types/json-schema@npm:^7.0.15": + version: 7.0.15 + resolution: "@types/json-schema@npm:7.0.15" + checksum: 10c0/a996a745e6c5d60292f36731dd41341339d4eeed8180bb09226e5c8d23759067692b1d88e5d91d72ee83dfc00d3aca8e7bd43ea120516c17922cbcb7c3e252db + languageName: node + linkType: hard + "@types/json5@npm:^0.0.29": version: 0.0.29 resolution: "@types/json5@npm:0.0.29" @@ -3364,29 +3443,21 @@ __metadata: languageName: node linkType: hard -"@types/prop-types@npm:*": - version: 15.7.13 - resolution: "@types/prop-types@npm:15.7.13" - checksum: 10c0/1b20fc67281902c6743379960247bc161f3f0406ffc0df8e7058745a85ea1538612109db0406290512947f9632fe9e10e7337bf0ce6338a91d6c948df16a7c61 - languageName: node - linkType: hard - -"@types/react-dom@npm:^18.3.1": - version: 18.3.1 - resolution: "@types/react-dom@npm:18.3.1" - dependencies: - "@types/react": "npm:*" - checksum: 10c0/8b416551c60bb6bd8ec10e198c957910cfb271bc3922463040b0d57cf4739cdcd24b13224f8d68f10318926e1ec3cd69af0af79f0291b599a992f8c80d47f1eb +"@types/react-dom@npm:^19.0.2": + version: 19.0.2 + resolution: "@types/react-dom@npm:19.0.2" + peerDependencies: + "@types/react": ^19.0.0 + checksum: 10c0/3d0c7b78dbe8df64ea769f30af990a5950173a8321c745fe11094d765423f7964c3519dca6e7cd36b4be6521c8efc690bdd3b79b327b229dd1e9d5a8bad677dd languageName: node linkType: hard -"@types/react@npm:*, @types/react@npm:^18.3.12": - version: 18.3.12 - resolution: "@types/react@npm:18.3.12" +"@types/react@npm:^19.0.1": + version: 19.0.1 + resolution: "@types/react@npm:19.0.1" dependencies: - "@types/prop-types": "npm:*" csstype: "npm:^3.0.2" - checksum: 10c0/8bae8d9a41619804561574792e29112b413044eb0d53746dde2b9720c1f9a59f71c895bbd7987cd8ce9500b00786e53bc032dced38cddf42910458e145675290 + checksum: 10c0/25eb69114abb9a6d5fc4414ee584388275bbc9ac32976449cf58b95fe9880efe6b3f936c3842be9bed8c571546a9752e8d3e2095288381e9c809269f5f574f2e languageName: node linkType: hard @@ -3550,13 +3621,6 @@ __metadata: languageName: node linkType: hard -"@ungap/structured-clone@npm:^1.2.0": - version: 1.2.0 - resolution: "@ungap/structured-clone@npm:1.2.0" - checksum: 10c0/8209c937cb39119f44eb63cf90c0b73e7c754209a6411c707be08e50e29ee81356dca1a848a405c8bdeebfe2f5e4f831ad310ae1689eeef65e7445c090c6657d - languageName: node - linkType: hard - "abab@npm:^2.0.6": version: 2.0.6 resolution: "abab@npm:2.0.6" @@ -3617,7 +3681,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.4, acorn@npm:^8.1.0, acorn@npm:^8.11.0, acorn@npm:^8.8.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": +"acorn@npm:^8.0.4, acorn@npm:^8.1.0, acorn@npm:^8.11.0, acorn@npm:^8.14.0, acorn@npm:^8.8.1, acorn@npm:^8.8.2": version: 8.14.0 resolution: "acorn@npm:8.14.0" bin: @@ -4592,7 +4656,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.5": version: 7.0.6 resolution: "cross-spawn@npm:7.0.6" dependencies: @@ -4928,15 +4992,6 @@ __metadata: languageName: node linkType: hard -"doctrine@npm:^3.0.0": - version: 3.0.0 - resolution: "doctrine@npm:3.0.0" - dependencies: - esutils: "npm:^2.0.2" - checksum: 10c0/c96bdccabe9d62ab6fea9399fdff04a66e6563c1d6fb3a3a063e8d53c3bb136ba63e84250bbf63d00086a769ad53aef92d2bd483f03f837fc97b71cbee6b2520 - languageName: node - linkType: hard - "dom-accessibility-api@npm:^0.5.9": version: 0.5.16 resolution: "dom-accessibility-api@npm:0.5.16" @@ -5008,10 +5063,10 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:16.4.5": - version: 16.4.5 - resolution: "dotenv@npm:16.4.5" - checksum: 10c0/48d92870076832af0418b13acd6e5a5a3e83bb00df690d9812e94b24aff62b88ade955ac99a05501305b8dc8f1b0ee7638b18493deb6fe93d680e5220936292f +"dotenv@npm:16.4.7": + version: 16.4.7 + resolution: "dotenv@npm:16.4.7" + checksum: 10c0/be9f597e36a8daf834452daa1f4cc30e5375a5968f98f46d89b16b983c567398a330580c88395069a77473943c06b877d1ca25b4afafcdd6d4adb549e8293462 languageName: node linkType: hard @@ -5384,27 +5439,27 @@ __metadata: languageName: node linkType: hard -"eslint-config-next@npm:14.2.18": - version: 14.2.18 - resolution: "eslint-config-next@npm:14.2.18" +"eslint-config-next@npm:^15.0.4": + version: 15.0.4 + resolution: "eslint-config-next@npm:15.0.4" dependencies: - "@next/eslint-plugin-next": "npm:14.2.18" - "@rushstack/eslint-patch": "npm:^1.3.3" + "@next/eslint-plugin-next": "npm:15.0.4" + "@rushstack/eslint-patch": "npm:^1.10.3" "@typescript-eslint/eslint-plugin": "npm:^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0" "@typescript-eslint/parser": "npm:^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0" eslint-import-resolver-node: "npm:^0.3.6" eslint-import-resolver-typescript: "npm:^3.5.2" - eslint-plugin-import: "npm:^2.28.1" - eslint-plugin-jsx-a11y: "npm:^6.7.1" - eslint-plugin-react: "npm:^7.33.2" - eslint-plugin-react-hooks: "npm:^4.5.0 || 5.0.0-canary-7118f5dd7-20230705" + eslint-plugin-import: "npm:^2.31.0" + eslint-plugin-jsx-a11y: "npm:^6.10.0" + eslint-plugin-react: "npm:^7.35.0" + eslint-plugin-react-hooks: "npm:^5.0.0" peerDependencies: - eslint: ^7.23.0 || ^8.0.0 + eslint: ^7.23.0 || ^8.0.0 || ^9.0.0 typescript: ">=3.3.1" peerDependenciesMeta: typescript: optional: true - checksum: 10c0/325f467e9d4686fbafd3ec3843fc32267f999eb9854d59a1170fe14ae710f40c36c3a8f6f32d3319b43e2aacd6cf8c849135e54b0298887237ac11b11635e889 + checksum: 10c0/2259c19da18f3376814bd344a6b07168345c97a376ebadef8cf6f82d69f88d87c8a5162b91e98fb928b9cc675b498ab6de3981d191be72891216733b3ebd94c2 languageName: node linkType: hard @@ -5467,7 +5522,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-import@npm:^2.28.1": +"eslint-plugin-import@npm:^2.31.0": version: 2.31.0 resolution: "eslint-plugin-import@npm:2.31.0" dependencies: @@ -5496,7 +5551,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-jsx-a11y@npm:^6.10.2, eslint-plugin-jsx-a11y@npm:^6.7.1": +"eslint-plugin-jsx-a11y@npm:^6.10.0": version: 6.10.2 resolution: "eslint-plugin-jsx-a11y@npm:6.10.2" dependencies: @@ -5541,16 +5596,32 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-react-hooks@npm:^4.5.0 || 5.0.0-canary-7118f5dd7-20230705": - version: 5.0.0-canary-7118f5dd7-20230705 - resolution: "eslint-plugin-react-hooks@npm:5.0.0-canary-7118f5dd7-20230705" +"eslint-plugin-react-compiler@npm:19.0.0-beta-37ed2a7-20241206": + version: 19.0.0-beta-37ed2a7-20241206 + resolution: "eslint-plugin-react-compiler@npm:19.0.0-beta-37ed2a7-20241206" + dependencies: + "@babel/core": "npm:^7.24.4" + "@babel/parser": "npm:^7.24.4" + "@babel/plugin-proposal-private-methods": "npm:^7.18.6" + hermes-parser: "npm:^0.25.1" + zod: "npm:^3.22.4" + zod-validation-error: "npm:^3.0.3" peerDependencies: - eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 - checksum: 10c0/554c4e426bfeb126155510dcba8345391426af147ee629f1c56c9ef6af08340d11008213e4e15b0138830af2c4439d7158da2091987f7efb01aeab662c44b274 + eslint: ">=7" + checksum: 10c0/072413c7a9a4959fc5e7bb65e1107498c0d940acd993112be338719138fada20f3dcf21900e6a17978a3de6a700ad8f1b9073f873b97ed6ca5be9c63ca32ed06 languageName: node linkType: hard -"eslint-plugin-react@npm:^7.33.2": +"eslint-plugin-react-hooks@npm:^5.0.0": + version: 5.1.0 + resolution: "eslint-plugin-react-hooks@npm:5.1.0" + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 + checksum: 10c0/37ef76e1d916d46ab8e93a596078efcf2162e2c653614437e0c54e31d02a5dadabec22802fab717effe257aeb4bdc20c2a710666a89ab1cf07e01e614dde75d8 + languageName: node + linkType: hard + +"eslint-plugin-react@npm:^7.35.0": version: 7.37.2 resolution: "eslint-plugin-react@npm:7.37.2" dependencies: @@ -5578,17 +5649,17 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^7.2.2": - version: 7.2.2 - resolution: "eslint-scope@npm:7.2.2" +"eslint-scope@npm:^8.2.0": + version: 8.2.0 + resolution: "eslint-scope@npm:8.2.0" dependencies: esrecurse: "npm:^4.3.0" estraverse: "npm:^5.2.0" - checksum: 10c0/613c267aea34b5a6d6c00514e8545ef1f1433108097e857225fed40d397dd6b1809dffd11c2fde23b37ca53d7bf935fe04d2a18e6fc932b31837b6ad67e1c116 + checksum: 10c0/8d2d58e2136d548ac7e0099b1a90d9fab56f990d86eb518de1247a7066d38c908be2f3df477a79cf60d70b30ba18735d6c6e70e9914dca2ee515a729975d70d6 languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": +"eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" checksum: 10c0/92708e882c0a5ffd88c23c0b404ac1628cf20104a108c745f240a13c332a11aac54f49a22d5762efbffc18ecbc9a580d1b7ad034bf5f3cc3307e5cbff2ec9820 @@ -5602,62 +5673,63 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.57.1": - version: 8.57.1 - resolution: "eslint@npm:8.57.1" +"eslint@npm:^9.16.0": + version: 9.16.0 + resolution: "eslint@npm:9.16.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.2.0" - "@eslint-community/regexpp": "npm:^4.6.1" - "@eslint/eslintrc": "npm:^2.1.4" - "@eslint/js": "npm:8.57.1" - "@humanwhocodes/config-array": "npm:^0.13.0" + "@eslint-community/regexpp": "npm:^4.12.1" + "@eslint/config-array": "npm:^0.19.0" + "@eslint/core": "npm:^0.9.0" + "@eslint/eslintrc": "npm:^3.2.0" + "@eslint/js": "npm:9.16.0" + "@eslint/plugin-kit": "npm:^0.2.3" + "@humanfs/node": "npm:^0.16.6" "@humanwhocodes/module-importer": "npm:^1.0.1" - "@nodelib/fs.walk": "npm:^1.2.8" - "@ungap/structured-clone": "npm:^1.2.0" + "@humanwhocodes/retry": "npm:^0.4.1" + "@types/estree": "npm:^1.0.6" + "@types/json-schema": "npm:^7.0.15" ajv: "npm:^6.12.4" chalk: "npm:^4.0.0" - cross-spawn: "npm:^7.0.2" + cross-spawn: "npm:^7.0.5" debug: "npm:^4.3.2" - doctrine: "npm:^3.0.0" escape-string-regexp: "npm:^4.0.0" - eslint-scope: "npm:^7.2.2" - eslint-visitor-keys: "npm:^3.4.3" - espree: "npm:^9.6.1" - esquery: "npm:^1.4.2" + eslint-scope: "npm:^8.2.0" + eslint-visitor-keys: "npm:^4.2.0" + espree: "npm:^10.3.0" + esquery: "npm:^1.5.0" esutils: "npm:^2.0.2" fast-deep-equal: "npm:^3.1.3" - file-entry-cache: "npm:^6.0.1" + file-entry-cache: "npm:^8.0.0" find-up: "npm:^5.0.0" glob-parent: "npm:^6.0.2" - globals: "npm:^13.19.0" - graphemer: "npm:^1.4.0" ignore: "npm:^5.2.0" imurmurhash: "npm:^0.1.4" is-glob: "npm:^4.0.0" - is-path-inside: "npm:^3.0.3" - js-yaml: "npm:^4.1.0" json-stable-stringify-without-jsonify: "npm:^1.0.1" - levn: "npm:^0.4.1" lodash.merge: "npm:^4.6.2" minimatch: "npm:^3.1.2" natural-compare: "npm:^1.4.0" optionator: "npm:^0.9.3" - strip-ansi: "npm:^6.0.1" - text-table: "npm:^0.2.0" + peerDependencies: + jiti: "*" + peerDependenciesMeta: + jiti: + optional: true bin: eslint: bin/eslint.js - checksum: 10c0/1fd31533086c1b72f86770a4d9d7058ee8b4643fd1cfd10c7aac1ecb8725698e88352a87805cf4b2ce890aa35947df4b4da9655fb7fdfa60dbb448a43f6ebcf1 + checksum: 10c0/f36d12652c6f20bab8a77375b8ad29a6af030c3840deb0a5f9dd4cee49d68a2d68d7dc73b0c25918df59d83cd686dd5712e11387e696e1f3842e8dde15cd3255 languageName: node linkType: hard -"espree@npm:^9.6.0, espree@npm:^9.6.1": - version: 9.6.1 - resolution: "espree@npm:9.6.1" +"espree@npm:^10.0.1, espree@npm:^10.3.0": + version: 10.3.0 + resolution: "espree@npm:10.3.0" dependencies: - acorn: "npm:^8.9.0" + acorn: "npm:^8.14.0" acorn-jsx: "npm:^5.3.2" - eslint-visitor-keys: "npm:^3.4.1" - checksum: 10c0/1a2e9b4699b715347f62330bcc76aee224390c28bb02b31a3752e9d07549c473f5f986720483c6469cf3cfb3c9d05df612ffc69eb1ee94b54b739e67de9bb460 + eslint-visitor-keys: "npm:^4.2.0" + checksum: 10c0/272beeaca70d0a1a047d61baff64db04664a33d7cfb5d144f84bc8a5c6194c6c8ebe9cc594093ca53add88baa23e59b01e69e8a0160ab32eac570482e165c462 languageName: node linkType: hard @@ -5671,7 +5743,7 @@ __metadata: languageName: node linkType: hard -"esquery@npm:^1.4.2": +"esquery@npm:^1.5.0": version: 1.6.0 resolution: "esquery@npm:1.6.0" dependencies: @@ -5782,6 +5854,19 @@ __metadata: languageName: node linkType: hard +"fast-glob@npm:3.3.1": + version: 3.3.1 + resolution: "fast-glob@npm:3.3.1" + dependencies: + "@nodelib/fs.stat": "npm:^2.0.2" + "@nodelib/fs.walk": "npm:^1.2.3" + glob-parent: "npm:^5.1.2" + merge2: "npm:^1.3.0" + micromatch: "npm:^4.0.4" + checksum: 10c0/b68431128fb6ce4b804c5f9622628426d990b66c75b21c0d16e3d80e2d1398bf33f7e1724e66a2e3f299285dcf5b8d745b122d0304e7dd66f5231081f33ec67c + languageName: node + linkType: hard + "fast-glob@npm:^3.3.2": version: 3.3.2 resolution: "fast-glob@npm:3.3.2" @@ -5859,12 +5944,12 @@ __metadata: languageName: node linkType: hard -"file-entry-cache@npm:^6.0.1": - version: 6.0.1 - resolution: "file-entry-cache@npm:6.0.1" +"file-entry-cache@npm:^8.0.0": + version: 8.0.0 + resolution: "file-entry-cache@npm:8.0.0" dependencies: - flat-cache: "npm:^3.0.4" - checksum: 10c0/58473e8a82794d01b38e5e435f6feaf648e3f36fdb3a56e98f417f4efae71ad1c0d4ebd8a9a7c50c3ad085820a93fc7494ad721e0e4ebc1da3573f4e1c3c7cdd + flat-cache: "npm:^4.0.0" + checksum: 10c0/9e2b5938b1cd9b6d7e3612bdc533afd4ac17b2fc646569e9a8abbf2eb48e5eb8e316bc38815a3ef6a1b456f4107f0d0f055a614ca613e75db6bf9ff4d72c1638 languageName: node linkType: hard @@ -5942,14 +6027,13 @@ __metadata: languageName: node linkType: hard -"flat-cache@npm:^3.0.4": - version: 3.2.0 - resolution: "flat-cache@npm:3.2.0" +"flat-cache@npm:^4.0.0": + version: 4.0.1 + resolution: "flat-cache@npm:4.0.1" dependencies: flatted: "npm:^3.2.9" - keyv: "npm:^4.5.3" - rimraf: "npm:^3.0.2" - checksum: 10c0/b76f611bd5f5d68f7ae632e3ae503e678d205cf97a17c6ab5b12f6ca61188b5f1f7464503efae6dc18683ed8f0b41460beb48ac4b9ac63fe6201296a91ba2f75 + keyv: "npm:^4.5.4" + checksum: 10c0/2c59d93e9faa2523e4fda6b4ada749bed432cfa28c8e251f33b25795e426a1c6dbada777afb1f74fcfff33934fdbdea921ee738fcc33e71adc9d6eca984a1cfc languageName: node linkType: hard @@ -6153,21 +6237,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:10.3.10": - version: 10.3.10 - resolution: "glob@npm:10.3.10" - dependencies: - foreground-child: "npm:^3.1.0" - jackspeak: "npm:^2.3.5" - minimatch: "npm:^9.0.1" - minipass: "npm:^5.0.0 || ^6.0.2 || ^7.0.0" - path-scurry: "npm:^1.10.1" - bin: - glob: dist/esm/bin.mjs - checksum: 10c0/13d8a1feb7eac7945f8c8480e11cd4a44b24d26503d99a8d8ac8d5aefbf3e9802a2b6087318a829fad04cb4e829f25c5f4f1110c68966c498720dd261c7e344d - languageName: node - linkType: hard - "glob@npm:^10.2.2, glob@npm:^10.3.10": version: 10.4.5 resolution: "glob@npm:10.4.5" @@ -6205,12 +6274,10 @@ __metadata: languageName: node linkType: hard -"globals@npm:^13.19.0": - version: 13.24.0 - resolution: "globals@npm:13.24.0" - dependencies: - type-fest: "npm:^0.20.2" - checksum: 10c0/d3c11aeea898eb83d5ec7a99508600fbe8f83d2cf00cbb77f873dbf2bcb39428eff1b538e4915c993d8a3b3473fa71eeebfe22c9bb3a3003d1e26b1f2c8a42cd +"globals@npm:^14.0.0": + version: 14.0.0 + resolution: "globals@npm:14.0.0" + checksum: 10c0/b96ff42620c9231ad468d4c58ff42afee7777ee1c963013ff8aabe095a451d0ceeb8dcd8ef4cbd64d2538cef45f787a78ba3a9574f4a634438963e334471302d languageName: node linkType: hard @@ -6233,7 +6300,7 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": +"graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: 10c0/386d011a553e02bc594ac2ca0bd6d9e4c22d7fa8cfbfc448a6d148c59ea881b092db9dbe3547ae4b88e55f1b01f7c4a2ecc53b310c042793e63aa44cf6c257f2 @@ -6320,6 +6387,22 @@ __metadata: languageName: node linkType: hard +"hermes-estree@npm:0.25.1": + version: 0.25.1 + resolution: "hermes-estree@npm:0.25.1" + checksum: 10c0/48be3b2fa37a0cbc77a112a89096fa212f25d06de92781b163d67853d210a8a5c3784fac23d7d48335058f7ed283115c87b4332c2a2abaaccc76d0ead1a282ac + languageName: node + linkType: hard + +"hermes-parser@npm:^0.25.1": + version: 0.25.1 + resolution: "hermes-parser@npm:0.25.1" + dependencies: + hermes-estree: "npm:0.25.1" + checksum: 10c0/3abaa4c6f1bcc25273f267297a89a4904963ea29af19b8e4f6eabe04f1c2c7e9abd7bfc4730ddb1d58f2ea04b6fee74053d8bddb5656ec6ebf6c79cc8d14202c + languageName: node + linkType: hard + "hoist-non-react-statics@npm:^3.3.0": version: 3.3.2 resolution: "hoist-non-react-statics@npm:3.3.2" @@ -6329,13 +6412,13 @@ __metadata: languageName: node linkType: hard -"html-dom-parser@npm:5.0.10": - version: 5.0.10 - resolution: "html-dom-parser@npm:5.0.10" +"html-dom-parser@npm:5.0.11": + version: 5.0.11 + resolution: "html-dom-parser@npm:5.0.11" dependencies: domhandler: "npm:5.0.3" htmlparser2: "npm:9.1.0" - checksum: 10c0/cc81f276cd90c4583a79eca13c4c29dfe5b049c06235f8259a007855f3f69cb30c44ee8ff7f7ac64114de6c7bc4ea47c394780a61b670e4b01814822e3f69b5e + checksum: 10c0/752c962663d9873d90d15d1c0b5721dd16816b2ee307b660e5d579d962674d9aec10d7b532607349df21a6ee8c0f308821480b1fe664fbefad76fe94ca96d086 languageName: node linkType: hard @@ -6355,21 +6438,21 @@ __metadata: languageName: node linkType: hard -"html-react-parser@npm:5.1.18": - version: 5.1.18 - resolution: "html-react-parser@npm:5.1.18" +"html-react-parser@npm:5.2.0": + version: 5.2.0 + resolution: "html-react-parser@npm:5.2.0" dependencies: domhandler: "npm:5.0.3" - html-dom-parser: "npm:5.0.10" + html-dom-parser: "npm:5.0.11" react-property: "npm:2.0.2" style-to-js: "npm:1.1.16" peerDependencies: - "@types/react": 0.14 || 15 || 16 || 17 || 18 - react: 0.14 || 15 || 16 || 17 || 18 + "@types/react": 0.14 || 15 || 16 || 17 || 18 || 19 + react: 0.14 || 15 || 16 || 17 || 18 || 19 peerDependenciesMeta: "@types/react": optional: true - checksum: 10c0/22b69abdfe8211375a2522e39b888b6b2bce220e10c6c1ba4251aac9e6709873216d0082230f98a80ef3fba57f802e6334bbf664d3cb755a7a603bc6160fbe6f + checksum: 10c0/7c70ce8c5557a32c944a6408ef058f47369923e7d618c6713b7c3f2b90ace39bcdae52e6728119383c3ee582969e779189a4f3ea0116f2451f87f446ef476553 languageName: node linkType: hard @@ -6824,13 +6907,6 @@ __metadata: languageName: node linkType: hard -"is-path-inside@npm:^3.0.3": - version: 3.0.3 - resolution: "is-path-inside@npm:3.0.3" - checksum: 10c0/cf7d4ac35fb96bab6a1d2c3598fe5ebb29aafb52c0aaa482b5a3ed9d8ba3edc11631e3ec2637660c44b3ce0e61a08d54946e8af30dec0b60a7c27296c68ffd05 - languageName: node - linkType: hard - "is-plain-object@npm:^5.0.0": version: 5.0.0 resolution: "is-plain-object@npm:5.0.0" @@ -7042,19 +7118,6 @@ __metadata: languageName: node linkType: hard -"jackspeak@npm:^2.3.5": - version: 2.3.6 - resolution: "jackspeak@npm:2.3.6" - dependencies: - "@isaacs/cliui": "npm:^8.0.2" - "@pkgjs/parseargs": "npm:^0.11.0" - dependenciesMeta: - "@pkgjs/parseargs": - optional: true - checksum: 10c0/f01d8f972d894cd7638bc338e9ef5ddb86f7b208ce177a36d718eac96ec86638a6efa17d0221b10073e64b45edc2ce15340db9380b1f5d5c5d000cbc517dc111 - languageName: node - linkType: hard - "jackspeak@npm:^3.1.2": version: 3.4.3 resolution: "jackspeak@npm:3.4.3" @@ -7782,7 +7845,7 @@ __metadata: languageName: node linkType: hard -"keyv@npm:^4.5.3": +"keyv@npm:^4.5.4": version: 4.5.4 resolution: "keyv@npm:4.5.4" dependencies: @@ -7831,13 +7894,6 @@ __metadata: languageName: node linkType: hard -"lilconfig@npm:^2.1.0": - version: 2.1.0 - resolution: "lilconfig@npm:2.1.0" - checksum: 10c0/64645641aa8d274c99338e130554abd6a0190533c0d9eb2ce7ebfaf2e05c7d9961f3ffe2bfa39efd3b60c521ba3dd24fa236fe2775fc38501bf82bf49d4678b8 - languageName: node - linkType: hard - "lilconfig@npm:^3.0.0, lilconfig@npm:^3.1.2": version: 3.1.2 resolution: "lilconfig@npm:3.1.2" @@ -7845,6 +7901,13 @@ __metadata: languageName: node linkType: hard +"lilconfig@npm:^3.1.3": + version: 3.1.3 + resolution: "lilconfig@npm:3.1.3" + checksum: 10c0/f5604e7240c5c275743561442fbc5abf2a84ad94da0f5adc71d25e31fa8483048de3dcedcb7a44112a942fed305fd75841cdf6c9681c7f640c63f1049e9a5dcc + languageName: node + linkType: hard + "lines-and-columns@npm:^1.1.6": version: 1.2.4 resolution: "lines-and-columns@npm:1.2.4" @@ -7968,7 +8031,7 @@ __metadata: languageName: node linkType: hard -"loose-envify@npm:^1.1.0, loose-envify@npm:^1.4.0": +"loose-envify@npm:^1.4.0": version: 1.4.0 resolution: "loose-envify@npm:1.4.0" dependencies: @@ -8178,7 +8241,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": +"minimatch@npm:^3.0.4, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -8196,7 +8259,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^9.0.1, minimatch@npm:^9.0.4": +"minimatch@npm:^9.0.4": version: 9.0.5 resolution: "minimatch@npm:9.0.5" dependencies: @@ -8378,9 +8441,9 @@ __metadata: languageName: node linkType: hard -"next-auth@npm:4.24.10": - version: 4.24.10 - resolution: "next-auth@npm:4.24.10" +"next-auth@npm:4.24.11": + version: 4.24.11 + resolution: "next-auth@npm:4.24.11" dependencies: "@babel/runtime": "npm:^7.20.13" "@panva/hkdf": "npm:^1.0.2" @@ -8395,14 +8458,14 @@ __metadata: "@auth/core": 0.34.2 next: ^12.2.5 || ^13 || ^14 || ^15 nodemailer: ^6.6.5 - react: ^17.0.2 || ^18 - react-dom: ^17.0.2 || ^18 + react: ^17.0.2 || ^18 || ^19 + react-dom: ^17.0.2 || ^18 || ^19 peerDependenciesMeta: "@auth/core": optional: true nodemailer: optional: true - checksum: 10c0/055c953ec4b98389b61e4026d07d6c27ff3942bde5e0ac15b5e0b32f1d58097fb58a32f114624fd7606ee9e1aaec63f335305a472609e78e3fba336eb4ac18ad + checksum: 10c0/56142678cfb8e751ae24f1396b3659aac7b1831f4f2283bcb2035224ebfd7ae82b62839383cf4029835d511cec339aad9665afcd1e711a631359fe123d970c0d languageName: node linkType: hard @@ -8431,41 +8494,42 @@ __metadata: languageName: node linkType: hard -"next-themes@npm:0.4.3": - version: 0.4.3 - resolution: "next-themes@npm:0.4.3" +"next-themes@npm:0.4.4": + version: 0.4.4 + resolution: "next-themes@npm:0.4.4" peerDependencies: react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc - checksum: 10c0/81dbe9efed2b10169e4ecd2ff59f3dedc091518c92a79354b863ccdcc444a061125de975af5c0c123ce9a1ebd7b20b05a1fdbfcf2aaeeb337fec03fe38fd8cb0 + checksum: 10c0/45d82f968ccfc90f6e6e3cdb95962132f6d1e19eaf614c4e824fc5d079ec522dd50cc196c58da2f000d755b81dbb0caf378c4f512a9e6b6c0a0daa3f99f1a2c7 languageName: node linkType: hard -"next@npm:14.2.18": - version: 14.2.18 - resolution: "next@npm:14.2.18" +"next@npm:15.0.4": + version: 15.0.4 + resolution: "next@npm:15.0.4" dependencies: - "@next/env": "npm:14.2.18" - "@next/swc-darwin-arm64": "npm:14.2.18" - "@next/swc-darwin-x64": "npm:14.2.18" - "@next/swc-linux-arm64-gnu": "npm:14.2.18" - "@next/swc-linux-arm64-musl": "npm:14.2.18" - "@next/swc-linux-x64-gnu": "npm:14.2.18" - "@next/swc-linux-x64-musl": "npm:14.2.18" - "@next/swc-win32-arm64-msvc": "npm:14.2.18" - "@next/swc-win32-ia32-msvc": "npm:14.2.18" - "@next/swc-win32-x64-msvc": "npm:14.2.18" - "@swc/helpers": "npm:0.5.5" + "@next/env": "npm:15.0.4" + "@next/swc-darwin-arm64": "npm:15.0.4" + "@next/swc-darwin-x64": "npm:15.0.4" + "@next/swc-linux-arm64-gnu": "npm:15.0.4" + "@next/swc-linux-arm64-musl": "npm:15.0.4" + "@next/swc-linux-x64-gnu": "npm:15.0.4" + "@next/swc-linux-x64-musl": "npm:15.0.4" + "@next/swc-win32-arm64-msvc": "npm:15.0.4" + "@next/swc-win32-x64-msvc": "npm:15.0.4" + "@swc/counter": "npm:0.1.3" + "@swc/helpers": "npm:0.5.13" busboy: "npm:1.6.0" caniuse-lite: "npm:^1.0.30001579" - graceful-fs: "npm:^4.2.11" postcss: "npm:8.4.31" - styled-jsx: "npm:5.1.1" + sharp: "npm:^0.33.5" + styled-jsx: "npm:5.1.6" peerDependencies: "@opentelemetry/api": ^1.1.0 "@playwright/test": ^1.41.2 - react: ^18.2.0 - react-dom: ^18.2.0 + babel-plugin-react-compiler: "*" + react: ^18.2.0 || 19.0.0-rc-66855b96-20241106 || ^19.0.0 + react-dom: ^18.2.0 || 19.0.0-rc-66855b96-20241106 || ^19.0.0 sass: ^1.3.0 dependenciesMeta: "@next/swc-darwin-arm64": @@ -8482,20 +8546,22 @@ __metadata: optional: true "@next/swc-win32-arm64-msvc": optional: true - "@next/swc-win32-ia32-msvc": - optional: true "@next/swc-win32-x64-msvc": optional: true + sharp: + optional: true peerDependenciesMeta: "@opentelemetry/api": optional: true "@playwright/test": optional: true + babel-plugin-react-compiler: + optional: true sass: optional: true bin: next: dist/bin/next - checksum: 10c0/9aa1cf6a3238735a80fae32c217b0312dcb46c12ab9da19855c1344d7256ca797b286b78902c4d6488e7eb806e53c5bb21521cec38f793fb74f17513e2382838 + checksum: 10c0/80b2296f33d865bf4f30f5df3d6fa461de13ef383dd9e32f33f5c05f21c766eb7f7573431235b9f3d51a5f09614cf431f8fcf925272b9524faced802961ff37b languageName: node linkType: hard @@ -8929,13 +8995,15 @@ __metadata: version: 0.0.0-use.local resolution: "pass-emploi-web@workspace:." dependencies: - "@elastic/apm-rum": "npm:5.16.0" - "@elastic/apm-rum-react": "npm:2.0.2" - "@next/bundle-analyzer": "npm:14.2.18" - "@svgr/webpack": "npm:8.1.0" + "@elastic/apm-rum": "npm:5.16.1" + "@elastic/apm-rum-react": "npm:2.0.3" + "@eslint/eslintrc": "npm:^3.2.0" + "@eslint/js": "npm:^9.16.0" + "@next/bundle-analyzer": "npm:15.0.4" + "@svgr/webpack": "npm:^8.1.0" "@testing-library/dom": "npm:^10.4.0" "@testing-library/jest-dom": "npm:^6.6.3" - "@testing-library/react": "npm:^16.0.1" + "@testing-library/react": "npm:^16.1.0" "@testing-library/user-event": "npm:^14.5.2" "@types/crypto-js": "npm:^4.2.2" "@types/jest": "npm:^29.5.14" @@ -8943,21 +9011,21 @@ __metadata: "@types/jsonwebtoken": "npm:^9.0.7" "@types/lodash.isequal": "npm:^4.5.8" "@types/luxon": "npm:^3.4.2" - "@types/react": "npm:^18.3.12" - "@types/react-dom": "npm:^18.3.1" + "@types/react": "npm:^19.0.1" + "@types/react-dom": "npm:^19.0.2" "@types/sanitize-html": "npm:^2.13.0" autoprefixer: "npm:^10.4.20" crypto-js: "npm:4.2.0" css-loader: "npm:^7.1.2" - dotenv: "npm:16.4.5" + dotenv: "npm:16.4.7" elastic-apm-node: "npm:4.8.1" - eslint: "npm:^8.57.1" - eslint-config-next: "npm:14.2.18" + eslint: "npm:^9.16.0" + eslint-config-next: "npm:^15.0.4" eslint-config-prettier: "npm:^9.1.0" - eslint-plugin-jsx-a11y: "npm:^6.10.2" eslint-plugin-prettier: "npm:^5.2.1" + eslint-plugin-react-compiler: "npm:19.0.0-beta-37ed2a7-20241206" firebase: "npm:11.0.2" - html-react-parser: "npm:5.1.18" + html-react-parser: "npm:5.2.0" jest: "npm:^29.7.0" jest-axe: "npm:^9.0.0" jest-environment-jsdom: "npm:^29.7.0" @@ -8965,23 +9033,23 @@ __metadata: lodash.isequal: "npm:4.5.0" luxon: "npm:3.5.0" matomo-tracker: "npm:2.2.4" - next: "npm:14.2.18" - next-auth: "npm:4.24.10" + next: "npm:15.0.4" + next-auth: "npm:4.24.11" next-logger: "npm:5.0.1" - next-themes: "npm:0.4.3" + next-themes: "npm:0.4.4" nextjs-toploader: "npm:3.7.15" pino: "npm:9.5.0" pino-pretty: "npm:^13.0.0" postcss: "npm:^8.4.49" - prettier: "npm:^3.4.1" - react: "npm:18.3.1" - react-dom: "npm:18.3.1" + prettier: "npm:^3.4.2" + react: "npm:19.0.0" + react-dom: "npm:19.0.0" react-router-dom: "npm:6.28.0" - sanitize-html: "npm:^2.13.1" + sanitize-html: "npm:2.13.1" sharp: "npm:0.33.5" source-map-explorer: "npm:^2.5.3" style-loader: "npm:^4.0.0" - tailwindcss: "npm:^3.4.15" + tailwindcss: "npm:^3.4.16" ts-loader: "npm:^9.5.1" tsconfig-paths-webpack-plugin: "npm:^4.2.0" typescript: "npm:^5.7.2" @@ -9016,7 +9084,7 @@ __metadata: languageName: node linkType: hard -"path-scurry@npm:^1.10.1, path-scurry@npm:^1.11.1": +"path-scurry@npm:^1.11.1": version: 1.11.1 resolution: "path-scurry@npm:1.11.1" dependencies: @@ -9355,12 +9423,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^3.4.1": - version: 3.4.1 - resolution: "prettier@npm:3.4.1" +"prettier@npm:^3.4.2": + version: 3.4.2 + resolution: "prettier@npm:3.4.2" bin: prettier: bin/prettier.cjs - checksum: 10c0/2d6cc3101ad9de72b49c59339480b0983e6ff6742143da0c43f476bf3b5ef88ede42ebd9956d7a0a8fa59f7a5990e8ef03c9ad4c37f7e4c9e5db43ee0853156c + checksum: 10c0/99e076a26ed0aba4ebc043880d0f08bbb8c59a4c6641cdee6cdadf2205bdd87aa1d7823f50c3aea41e015e99878d37c58d7b5f0e663bba0ef047f94e36b96446 languageName: node linkType: hard @@ -9533,15 +9601,14 @@ __metadata: languageName: node linkType: hard -"react-dom@npm:18.3.1": - version: 18.3.1 - resolution: "react-dom@npm:18.3.1" +"react-dom@npm:19.0.0": + version: 19.0.0 + resolution: "react-dom@npm:19.0.0" dependencies: - loose-envify: "npm:^1.1.0" - scheduler: "npm:^0.23.2" + scheduler: "npm:^0.25.0" peerDependencies: - react: ^18.3.1 - checksum: 10c0/a752496c1941f958f2e8ac56239172296fcddce1365ce45222d04a1947e0cc5547df3e8447f855a81d6d39f008d7c32eab43db3712077f09e3f67c4874973e85 + react: ^19.0.0 + checksum: 10c0/a36ce7ab507b237ae2759c984cdaad4af4096d8199fb65b3815c16825e5cfeb7293da790a3fc2184b52bfba7ba3ff31c058c01947aff6fd1a3701632aabaa6a9 languageName: node linkType: hard @@ -9597,12 +9664,10 @@ __metadata: languageName: node linkType: hard -"react@npm:18.3.1": - version: 18.3.1 - resolution: "react@npm:18.3.1" - dependencies: - loose-envify: "npm:^1.1.0" - checksum: 10c0/283e8c5efcf37802c9d1ce767f302dd569dd97a70d9bb8c7be79a789b9902451e0d16334b05d73299b20f048cbc3c7d288bbbde10b701fa194e2089c237dbea3 +"react@npm:19.0.0": + version: 19.0.0 + resolution: "react@npm:19.0.0" + checksum: 10c0/9cad8f103e8e3a16d15cb18a0d8115d8bd9f9e1ce3420310aea381eb42aa0a4f812cf047bb5441349257a05fba8a291515691e3cb51267279b2d2c3253f38471 languageName: node linkType: hard @@ -9891,17 +9956,6 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.2": - version: 3.0.2 - resolution: "rimraf@npm:3.0.2" - dependencies: - glob: "npm:^7.1.3" - bin: - rimraf: bin.js - checksum: 10c0/9cb7757acb489bd83757ba1a274ab545eafd75598a9d817e0c3f8b164238dd90eba50d6b848bd4dcc5f3040912e882dc7ba71653e35af660d77b25c381d402e8 - languageName: node - linkType: hard - "rimraf@npm:~2.6.2": version: 2.6.3 resolution: "rimraf@npm:2.6.3" @@ -9973,7 +10027,7 @@ __metadata: languageName: node linkType: hard -"sanitize-html@npm:^2.13.1": +"sanitize-html@npm:2.13.1": version: 2.13.1 resolution: "sanitize-html@npm:2.13.1" dependencies: @@ -9996,12 +10050,10 @@ __metadata: languageName: node linkType: hard -"scheduler@npm:^0.23.2": - version: 0.23.2 - resolution: "scheduler@npm:0.23.2" - dependencies: - loose-envify: "npm:^1.1.0" - checksum: 10c0/26383305e249651d4c58e6705d5f8425f153211aef95f15161c151f7b8de885f24751b377e4a0b3dd42cce09aad3f87a61dab7636859c0d89b7daf1a1e2a5c78 +"scheduler@npm:^0.25.0": + version: 0.25.0 + resolution: "scheduler@npm:0.25.0" + checksum: 10c0/a4bb1da406b613ce72c1299db43759526058fdcc413999c3c3e0db8956df7633acf395cb20eb2303b6a65d658d66b6585d344460abaee8080b4aa931f10eaafe languageName: node linkType: hard @@ -10063,7 +10115,7 @@ __metadata: languageName: node linkType: hard -"sharp@npm:0.33.5": +"sharp@npm:0.33.5, sharp@npm:^0.33.5": version: 0.33.5 resolution: "sharp@npm:0.33.5" dependencies: @@ -10601,19 +10653,19 @@ __metadata: languageName: node linkType: hard -"styled-jsx@npm:5.1.1": - version: 5.1.1 - resolution: "styled-jsx@npm:5.1.1" +"styled-jsx@npm:5.1.6": + version: 5.1.6 + resolution: "styled-jsx@npm:5.1.6" dependencies: client-only: "npm:0.0.1" peerDependencies: - react: ">= 16.8.0 || 17.x.x || ^18.0.0-0" + react: ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0" peerDependenciesMeta: "@babel/core": optional: true babel-plugin-macros: optional: true - checksum: 10c0/42655cdadfa5388f8a48bb282d6b450df7d7b8cf066ac37038bd0499d3c9f084815ebd9ff9dfa12a218fd4441338851db79603498d7557207009c1cf4d609835 + checksum: 10c0/ace50e7ea5ae5ae6a3b65a50994c51fca6ae7df9c7ecfd0104c36be0b4b3a9c5c1a2374d16e2a11e256d0b20be6d47256d768ecb4f91ab390f60752a075780f5 languageName: node linkType: hard @@ -10701,9 +10753,9 @@ __metadata: languageName: node linkType: hard -"tailwindcss@npm:^3.4.15": - version: 3.4.15 - resolution: "tailwindcss@npm:3.4.15" +"tailwindcss@npm:^3.4.16": + version: 3.4.16 + resolution: "tailwindcss@npm:3.4.16" dependencies: "@alloc/quick-lru": "npm:^5.2.0" arg: "npm:^5.0.2" @@ -10714,7 +10766,7 @@ __metadata: glob-parent: "npm:^6.0.2" is-glob: "npm:^4.0.3" jiti: "npm:^1.21.6" - lilconfig: "npm:^2.1.0" + lilconfig: "npm:^3.1.3" micromatch: "npm:^4.0.8" normalize-path: "npm:^3.0.0" object-hash: "npm:^3.0.0" @@ -10730,7 +10782,7 @@ __metadata: bin: tailwind: lib/cli.js tailwindcss: lib/cli.js - checksum: 10c0/709058837c5adf0b7e1386ba353983dcf2af3d390e8822fac8d53ecaaad0f6f040fd3050b1db636e2abd46ae775317a89b350ce925477ea96cca8f6c56d901df + checksum: 10c0/f716ff38e0ea6f25c2b3d811e0aaac07f627193e8527d8ad945d5088d4a188ac1eb1e8ee9aef76d8525e756ffbb8369d717013d3ffc2f49fabaa94cb1e6784c1 languageName: node linkType: hard @@ -10776,13 +10828,6 @@ __metadata: languageName: node linkType: hard -"text-table@npm:^0.2.0": - version: 0.2.0 - resolution: "text-table@npm:0.2.0" - checksum: 10c0/02805740c12851ea5982686810702e2f14369a5f4c5c40a836821e3eefc65ffeec3131ba324692a37608294b0fd8c1e55a2dd571ffed4909822787668ddbee5c - languageName: node - linkType: hard - "thenify-all@npm:^1.0.0": version: 1.6.0 resolution: "thenify-all@npm:1.6.0" @@ -10962,13 +11007,6 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^0.20.2": - version: 0.20.2 - resolution: "type-fest@npm:0.20.2" - checksum: 10c0/dea9df45ea1f0aaa4e2d3bed3f9a0bfe9e5b2592bddb92eb1bf06e50bcf98dbb78189668cd8bc31a0511d3fc25539b4cd5c704497e53e93e2d40ca764b10bfc3 - languageName: node - linkType: hard - "type-fest@npm:^0.21.3": version: 0.21.3 resolution: "type-fest@npm:0.21.3" @@ -11562,3 +11600,19 @@ __metadata: checksum: 10c0/dceb44c28578b31641e13695d200d34ec4ab3966a5729814d5445b194933c096b7ced71494ce53a0e8820685d1d010df8b2422e5bf2cdea7e469d97ffbea306f languageName: node linkType: hard + +"zod-validation-error@npm:^3.0.3": + version: 3.4.0 + resolution: "zod-validation-error@npm:3.4.0" + peerDependencies: + zod: ^3.18.0 + checksum: 10c0/aaadb0e65c834aacb12fa088663d52d9f4224b5fe6958f09b039f4ab74145fda381c8a7d470bfddf7ddd9bbb5fdfbb52739cd66958ce6d388c256a44094d1fba + languageName: node + linkType: hard + +"zod@npm:^3.22.4": + version: 3.24.1 + resolution: "zod@npm:3.24.1" + checksum: 10c0/0223d21dbaa15d8928fe0da3b54696391d8e3e1e2d0283a1a070b5980a1dbba945ce631c2d1eccc088fdbad0f2dfa40155590bf83732d3ac4fcca2cc9237591b + languageName: node + linkType: hard