--- a/web/src/features/users/types.ts +++ b/web/src/features/users/types.ts @@ -35,6 +35,7 @@ export const userSchema = z.object({ id: z.number(), username: z.string(), + maltai_billing_owner: z.string().nullable().optional(), display_name: z.string(), password: z.string().optional(), github_id: z.string().optional(), --- a/web/src/features/users/components/users-columns.tsx +++ b/web/src/features/users/components/users-columns.tsx @@ -97,15 +97,22 @@ header: t('Username'), cell: ({ row }) => { const username = row.getValue('username') as string + const owner = row.original.maltai_billing_owner const displayName = row.original.display_name const remark = row.original.remark return (
- - {username} - + {owner ? ( + + {owner} + + ) : ( + + {username} + + )} {remark && ( )}
- {displayName && displayName !== username && ( + {displayName && displayName !== username && displayName !== owner && (
{isDisabled ? ( @@ -233,7 +235,7 @@ )} - {isAdmin && !isRoot && ( + {isAdmin && !isRoot && user.maltai_billing_owner === null && ( handleManage('demote')}> {t('Demote')} @@ -242,7 +244,7 @@ )} - {!isAdmin && ( + {!isAdmin && user.maltai_billing_owner === null && ( handleManage('promote')}> {t('Promote')} @@ -303,18 +305,20 @@ - - - - {t('Delete')} - - - - + {!isRoot && user.maltai_billing_owner === null && ( + <> + + + {t('Delete')} + + + + + + )}