OrgUsers: Refactor change LastSeenAtAge from '10 years' to 'Never' (#84247)

* refactor: change lastseenatage to Never

* removed unncessecary fragments
This commit is contained in:
Eric Leijonmarck 2024-03-12 12:18:33 +01:00 committed by GitHub
parent c45f96e9de
commit fbfaf8e003
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -15,6 +15,7 @@ import {
Pagination,
Stack,
Tag,
Text,
Tooltip,
} from '@grafana/ui';
import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker';
@ -107,7 +108,9 @@ export const OrgUsersTable = ({
{
id: 'lastSeenAtAge',
header: 'Last active',
cell: ({ cell: { value } }: Cell<'lastSeenAtAge'>) => value,
cell: ({ cell: { value } }: Cell<'lastSeenAtAge'>) => {
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(),
},
{

View File

@ -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(),
},