Reorder columns

This commit is contained in:
SergeantPanda 2025-06-27 21:59:56 -05:00
parent 615956d502
commit 1a8bbb6bb8
2 changed files with 25 additions and 21 deletions

View file

@ -45,6 +45,8 @@ class UserSerializer(serializers.ModelSerializer):
"is_superuser",
"last_login",
"date_joined",
"first_name",
"last_name",
]
def create(self, validated_data):

View file

@ -134,6 +134,16 @@ const UsersTable = () => {
*/
const columns = useMemo(
() => [
{
header: 'User Level',
accessorKey: 'user_level',
size: 120,
cell: ({ getValue }) => (
<Text size="sm">
{USER_LEVEL_LABELS[getValue()]}
</Text>
),
},
{
header: 'Username',
accessorKey: 'username',
@ -195,14 +205,17 @@ const UsersTable = () => {
),
},
{
header: 'User Level',
accessorKey: 'user_level',
size: 120,
cell: ({ getValue }) => (
<Text size="sm">
{USER_LEVEL_LABELS[getValue()]}
</Text>
),
header: 'Date Joined',
accessorKey: 'date_joined',
size: 140,
cell: ({ getValue }) => {
const date = getValue();
return (
<Text size="sm">
{date ? new Date(date).toLocaleDateString() : '-'}
</Text>
);
},
},
{
header: 'Last Login',
@ -217,23 +230,11 @@ const UsersTable = () => {
);
},
},
{
header: 'Date Joined',
accessorKey: 'date_joined',
size: 140,
cell: ({ getValue }) => {
const date = getValue();
return (
<Text size="sm">
{date ? new Date(date).toLocaleDateString() : '-'}
</Text>
);
},
},
{
header: 'XC Password',
accessorKey: 'custom_properties',
size: 120,
enableSorting: false,
cell: ({ getValue, row }) => {
const userId = row.original.id;
const isVisible = visiblePasswords[userId];
@ -270,6 +271,7 @@ const UsersTable = () => {
id: 'actions',
size: 80,
header: 'Actions',
enableSorting: false,
cell: ({ row }) => (
<UserRowActions
theme={theme}