mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 19:04:38 +00:00
apply gustav feedback
This commit is contained in:
parent
9e32479c1c
commit
253b39b3c9
@ -56,9 +56,9 @@ const Body = () => {
|
||||
const currentTime = useRef(Date.now());
|
||||
|
||||
const getFieldInfo = (atField, byField) => {
|
||||
const user = initialData[byField] ?? {};
|
||||
|
||||
const displayName = user ? getDisplayName(user, formatMessage) : '-';
|
||||
const displayName = initialData[byField]
|
||||
? getDisplayName(initialData[byField], formatMessage)
|
||||
: '-';
|
||||
const timestamp = initialData[atField] ? new Date(initialData[atField]).getTime() : Date.now();
|
||||
const elapsed = timestamp - currentTime.current;
|
||||
const { unit, value } = getUnits(-elapsed);
|
||||
|
||||
@ -797,19 +797,8 @@ function ListView({
|
||||
|
||||
if (['createdBy', 'updatedBy'].includes(name.split('.')[0])) {
|
||||
// Display the users full name
|
||||
return (
|
||||
<Td key={key}>
|
||||
<Typography textColor="neutral800">
|
||||
{rowData[name.split('.')[0]]
|
||||
? getDisplayName(rowData[name.split('.')[0]], formatMessage)
|
||||
: '-'}
|
||||
</Typography>
|
||||
</Td>
|
||||
);
|
||||
}
|
||||
|
||||
if (['createdBy', 'updatedBy'].includes(name.split('.')[0])) {
|
||||
// Display the users full name
|
||||
// Some entries doesn't have a user assigned as creator/updater (ex: entries created through content API)
|
||||
// In this case, we display a dash
|
||||
return (
|
||||
<Td key={key}>
|
||||
<Typography textColor="neutral800">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user