Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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