From fbfaf8e003e6f07de698387dca8ce0d509e2c4dc Mon Sep 17 00:00:00 2001 From: Eric Leijonmarck Date: Tue, 12 Mar 2024 12:18:33 +0100 Subject: [PATCH] OrgUsers: Refactor change `LastSeenAtAge` from '10 years' to 'Never' (#84247) * refactor: change lastseenatage to Never * removed unncessecary fragments --- public/app/features/admin/Users/OrgUsersTable.tsx | 5 ++++- public/app/features/admin/Users/UsersTable.tsx | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/public/app/features/admin/Users/OrgUsersTable.tsx b/public/app/features/admin/Users/OrgUsersTable.tsx index 99f0a9ea40c..55918b8ce95 100644 --- a/public/app/features/admin/Users/OrgUsersTable.tsx +++ b/public/app/features/admin/Users/OrgUsersTable.tsx @@ -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' ? Never : value}; + }, sortType: (a, b) => new Date(a.original.lastSeenAt).getTime() - new Date(b.original.lastSeenAt).getTime(), }, { diff --git a/public/app/features/admin/Users/UsersTable.tsx b/public/app/features/admin/Users/UsersTable.tsx index fd7cdbb6813..18ce295ce75 100644 --- a/public/app/features/admin/Users/UsersTable.tsx +++ b/public/app/features/admin/Users/UsersTable.tsx @@ -117,7 +117,7 @@ export const UsersTable = ({ iconName: 'question-circle', }, cell: ({ cell: { value } }: Cell<'lastSeenAtAge'>) => { - return <>{value && <>{value === '10 years' ? Never : value}}; + return <>{value && value === '10 years' ? Never : value}; }, sortType: (a, b) => new Date(a.original.lastSeenAt!).getTime() - new Date(b.original.lastSeenAt!).getTime(), },