Skip to content

Commit

Permalink
fix: affichage rncp liste ml (#4013)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pomarom authored Jan 27, 2025
1 parent 0a115d0 commit 08798b2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
15 changes: 6 additions & 9 deletions server/src/common/actions/effectifs.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,6 @@ export const buildEffectifForMissionLocale = (
fonction,
}));

const usersReferentiel =
effectif.organisme.contacts_from_referentiel
?.filter(({ confirmé }) => confirmé)
.map(({ email }) => ({
email,
})) || [];

const result = {
id: effectif._id,
apprenant: {
Expand All @@ -529,9 +522,13 @@ export const buildEffectifForMissionLocale = (
},
statut: effectif._computed?.statut,
formation: effectif.formation,
organisme: effectif._computed?.organisme,
organisme: {
nom: effectif.organisme.nom,
raison_sociale: effectif.organisme.raison_sociale,
adresse: effectif.organisme.adresse,
contacts_from_referentiel: effectif.organisme.contacts_from_referentiel,
},
users: usersCfa,
users_referentiel: usersReferentiel,
organisme_id: effectif.organisme_id,
annee_scolaire: effectif.annee_scolaire,
source: effectif.source,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export const getPaginatedEffectifsByMissionLocaleId = async (
let: { id: "$organisme_id" },
pipeline: [
{ $match: { $expr: { $eq: ["$_id", "$$id"] } } },
{ $project: { _id: 0, contacts_from_referentiel: 1 } },
{ $project: { _id: 0, contacts_from_referentiel: 1, nom: 1, raison_sociale: 1, adresse: 1 } },
],
as: "organisme",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const apprenantsTableColumnsDefs = (
<VStack alignItems="start" spacing={0} width="340px">
<Text noOfLines={1}>{row.original?.formation?.libelle_long || "Libellé manquant"}</Text>
<Text fontSize="xs" color="#777777" whiteSpace="nowrap">
CFD&nbsp;: {row.original?.formation?.cfd} - RNCP&nbsp;: {row.original?.formation?.cfd}
CFD&nbsp;: {row.original?.formation?.cfd} - RNCP&nbsp;: {row.original?.formation?.rncp}
</Text>
</VStack>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ const ApprenantsDetails = ({ row, updateSituationState }) => {
</Tr>
<Tr>
<Td fontWeight="bold">Code postal et ville</Td>
<Td>{getValueOrFallback(organisme.departement)}</Td>
<Td>
{getValueOrFallback(
organisme.adresse ? `${organisme.adresse.code_postal} ${organisme.adresse.commune}` : null
)}
</Td>
</Tr>
{users.map((user, index) => (
<>
Expand Down Expand Up @@ -290,7 +294,7 @@ const ApprenantsDetails = ({ row, updateSituationState }) => {
</Tr>
<Tr>
<Td fontWeight="bold">Code RNCP</Td>
<Td>{getValueOrFallback(formation.code_rncp)}</Td>
<Td>{getValueOrFallback(formation.rncp)}</Td>
</Tr>
</Tbody>
</Table>
Expand Down

0 comments on commit 08798b2

Please sign in to comment.