Skip to content

Commit

Permalink
[v10.4.x] Users: Add back check for undefined / null for value for `l…
Browse files Browse the repository at this point in the history
…astSeenAtAge` in table view (#84285)

Users: Add back check for undefined / null for value for `lastSeenAtAge` in table view (#84265)

bug: add check for undefined / null for value
(cherry picked from commit 0cb9f2b)

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
  • Loading branch information
grafana-delivery-bot[bot] and eleijonmarck committed Mar 12, 2024
1 parent 0a0e9f7 commit 1d58241
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/app/features/admin/Users/OrgUsersTable.tsx
Expand Up @@ -109,7 +109,7 @@ export const OrgUsersTable = ({
id: 'lastSeenAtAge',
header: 'Last active',
cell: ({ cell: { value } }: Cell<'lastSeenAtAge'>) => {
return <>{value && value === '10 years' ? <Text color={'disabled'}>Never</Text> : value}</>;
return <>{value && <>{value === '10 years' ? <Text color={'disabled'}>Never</Text> : value}</>}</>;
},
sortType: (a, b) => new Date(a.original.lastSeenAt).getTime() - new Date(b.original.lastSeenAt).getTime(),
},
Expand Down
2 changes: 1 addition & 1 deletion public/app/features/admin/Users/UsersTable.tsx
Expand Up @@ -117,7 +117,7 @@ export const UsersTable = ({
iconName: 'question-circle',
},
cell: ({ cell: { value } }: Cell<'lastSeenAtAge'>) => {
return <>{value && value === '10 years' ? <Text color={'disabled'}>Never</Text> : value}</>;
return <>{value && <>{value === '10 years' ? <Text color={'disabled'}>Never</Text> : value}</>}</>;
},
sortType: (a, b) => new Date(a.original.lastSeenAt!).getTime() - new Date(b.original.lastSeenAt!).getTime(),
},
Expand Down

0 comments on commit 1d58241

Please sign in to comment.