feature(content-manager): display full user names in list view

This commit is contained in:
Jamie Howard 2023-07-12 11:54:11 +01:00 committed by Fernando Chavez
parent dfe799a9ae
commit d0e299595a

View File

@ -15,6 +15,7 @@ import {
useFetchClient,
useAPIErrorHandler,
useQueryParams,
getDisplayName,
} from '@strapi/helper-plugin';
import { Trash, Duplicate, Pencil } from '@strapi/icons';
import { AxiosError } from 'axios';
@ -197,6 +198,17 @@ export const TableRows = ({
return <Td key={key}>{cellFormatter(data, { key, name, ...rest })}</Td>;
}
if (['createdBy', 'updatedBy'].includes(name.split('.')[0])) {
// Display the users full name
return (
<Td key={key}>
<Typography textColor="neutral800">
{getDisplayName(data[name.split('.')[0]], formatMessage)}
</Typography>
</Td>
);
}
return (
<Td key={key}>
<CellContent