Skip to content

Commit

Permalink
feat(dashboard): affiche les Autres pseudos dans les tableaux de pass…
Browse files Browse the repository at this point in the history
…ages/rencontres/actions/consultations des comptes rendus
  • Loading branch information
Arnaud AMBROSELLI committed Oct 5, 2023
1 parent ad8ea00 commit a918023
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
5 changes: 3 additions & 2 deletions dashboard/src/components/PersonName.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { personsObjectSelector } from '../recoil/selectors';
export default function PersonName({ item, onClick = null, redirectToTab = 'Résumé' }) {
const history = useHistory();
const persons = useRecoilValue(personsObjectSelector);
const personName = item?.personPopulated?.name || persons[item.person]?.name;
const person = item?.personPopulated ?? persons[item.person];
return (
<span
className="hover:tw-cursor-zoom-in hover:tw-bg-yellow-400"
Expand All @@ -15,7 +15,8 @@ export default function PersonName({ item, onClick = null, redirectToTab = 'Rés
if (onClick) return onClick();
if (item.person) history.push(`/person/${item.person}?tab=${redirectToTab}`);
}}>
{personName}
{person.name}
{person.otherNames ? <small className="tw-text-main75"> - {person.otherNames}</small> : null}
</span>
);
}
16 changes: 10 additions & 6 deletions dashboard/src/scenes/report/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ const ActionCompletedAt = ({ date, status, actions, setSortOrder, setSortBy, sor
onSortBy: setSortBy,
sortBy,
sortOrder,
render: (action) => <PersonName item={action} />,
render: (action) => <PersonName showOtherNames item={action} />,
},
{
title: 'Statut',
Expand Down Expand Up @@ -1256,7 +1256,7 @@ const ActionCreatedAt = ({ date, actions, setSortOrder, setSortBy, sortBy, sortO
onSortBy: setSortBy,
sortBy,
sortOrder,
render: (action) => <PersonName item={action} />,
render: (action) => <PersonName showOtherNames item={action} />,
},
{
title: 'Statut',
Expand Down Expand Up @@ -1358,7 +1358,7 @@ const Consultations = ({ date, status, consultations, setSortOrder, setSortBy, s
onSortBy: setSortBy,
sortBy,
sortOrder,
render: (consultation) => <PersonName item={consultation} />,
render: (consultation) => <PersonName showOtherNames item={consultation} />,
},
{
title: 'Statut',
Expand Down Expand Up @@ -1423,7 +1423,7 @@ const ConsultationsCreatedAt = ({ date, consultations }) => {
{
title: 'Personne suivie',
dataKey: 'person',
render: (action) => <PersonName item={action} />,
render: (action) => <PersonName showOtherNames item={action} />,
},
{ title: 'Statut', dataKey: 'status', render: (action) => <ActionStatus status={action.status} /> },
]}
Expand Down Expand Up @@ -1643,7 +1643,7 @@ const PassagesCreatedAt = ({ date, passages, selectedTeams }) => {
title: 'Personne suivie',
dataKey: 'person',
render: (passage) =>
passage.person ? <PersonName item={passage} /> : <span style={{ opacity: 0.3, fontStyle: 'italic' }}>Anonyme</span>,
passage.person ? <PersonName showOtherNames item={passage} /> : <span style={{ opacity: 0.3, fontStyle: 'italic' }}>Anonyme</span>,
},
{
title: 'Enregistré par',
Expand Down Expand Up @@ -1723,7 +1723,11 @@ const RencontresCreatedAt = ({ date, rencontres, selectedTeams }) => {
title: 'Personne suivie',
dataKey: 'person',
render: (rencontre) =>
rencontre.person ? <PersonName item={rencontre} /> : <span style={{ opacity: 0.3, fontStyle: 'italic' }}>Anonyme</span>,
rencontre.person ? (
<PersonName showOtherNames item={rencontre} />
) : (
<span style={{ opacity: 0.3, fontStyle: 'italic' }}>Anonyme</span>
),
},
{
title: 'Enregistrée par',
Expand Down

0 comments on commit a918023

Please sign in to comment.