Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dashboard): affiche les Autres pseudos dans les tableaux de passages/rencontres/actions/consultations des comptes rendus #1702

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading