-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
607 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
app/(header-default)/dirigeants/_component/sections/service-public-subservices.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
'use client'; | ||
|
||
import NonRenseigne from '#components/non-renseigne'; | ||
import { DataSectionClient } from '#components/section/data-section'; | ||
import { FullTable } from '#components/table/full'; | ||
import { EAdministration } from '#models/administrations/EAdministration'; | ||
import { | ||
IAPINotRespondingError, | ||
isAPINotResponding, | ||
} from '#models/api-not-responding'; | ||
import { IUniteLegale } from '#models/core/types'; | ||
import { IServicePublic } from '#models/service-public'; | ||
import { useFetchServicePublicSubServices } from 'hooks/fetch/service-public-subservices'; | ||
|
||
function SubServicesDataSection({ | ||
servicePublic, | ||
uniteLegale, | ||
}: { | ||
servicePublic: IServicePublic; | ||
uniteLegale: IUniteLegale; | ||
}) { | ||
const subServices = useFetchServicePublicSubServices( | ||
servicePublic, | ||
uniteLegale | ||
); | ||
|
||
return ( | ||
<DataSectionClient | ||
id="subservices-service-public" | ||
title="Département(s)" | ||
sources={[EAdministration.DILA]} | ||
data={subServices} | ||
> | ||
{(subServices) => ( | ||
<> | ||
<p> | ||
Ce service public se compose de {subServices.length} départements : | ||
</p> | ||
<FullTable | ||
head={['Nom du département', 'Responsable(s)']} | ||
body={subServices.map((service) => { | ||
return [ | ||
service.urlServicePublic ? ( | ||
<a | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
aria-label={`Voir ${service.nom}, nouvelle fenêtre`} | ||
href={service.urlServicePublic} | ||
> | ||
{service.nom} | ||
</a> | ||
) : ( | ||
service.nom | ||
), | ||
service.affectationPersonne?.length === 0 ? ( | ||
<NonRenseigne /> | ||
) : service?.affectationPersonne && | ||
service?.affectationPersonne.length > 0 ? ( | ||
service?.affectationPersonne.map((personne, index) => ( | ||
<> | ||
{index !== 0 && ', '} | ||
<b>{personne.nom}</b> {personne.fonction} | ||
</> | ||
)) | ||
) : ( | ||
<NonRenseigne /> | ||
), | ||
]; | ||
})} | ||
/> | ||
</> | ||
)} | ||
</DataSectionClient> | ||
); | ||
} | ||
|
||
export default function SubServicesSection({ | ||
servicePublic, | ||
uniteLegale, | ||
}: { | ||
servicePublic: IServicePublic | IAPINotRespondingError; | ||
uniteLegale: IUniteLegale; | ||
}) { | ||
if ( | ||
isAPINotResponding(servicePublic) || | ||
servicePublic.subServicesId?.length === 0 | ||
) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<SubServicesDataSection | ||
servicePublic={servicePublic} | ||
uniteLegale={uniteLegale} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
app/api/data-fetching/espace-agent/documents/[slug]/route.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.