Skip to content

Commit

Permalink
OrgUsers: Refactor change LastSeenAtAge from '10 years' to 'Never' (#…
Browse files Browse the repository at this point in the history
…84247)

* refactor: change lastseenatage to Never

* removed unncessecary fragments

(cherry picked from commit fbfaf8e)
  • Loading branch information
eleijonmarck authored and grafana-delivery-bot[bot] committed Mar 12, 2024
1 parent 9bbd9cf commit f56cc0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion public/app/features/admin/Users/OrgUsersTable.tsx
Expand Up @@ -15,6 +15,7 @@ import {
Pagination,
Stack,
Tag,
Text,
Tooltip,
} from '@grafana/ui';
import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker';
Expand Down Expand Up @@ -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(),
},
{
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 f56cc0d

Please sign in to comment.