2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-13 22:21:37 +00:00

Fix api_url for 'user' type (#10182)

* Fix api_url for 'user' type

* Added regression test
This commit is contained in:
Oliver
2025-08-16 08:10:02 +10:00
committed by GitHub
parent 0bed5cf511
commit fa15466ce4
3 changed files with 36 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
import { Badge, Group, Text } from '@mantine/core';
import { IconUser, IconUsersGroup } from '@tabler/icons-react';
import type { ReactNode } from 'react';
import { t } from '@lingui/core/macro';
import { type InstanceRenderInterface, RenderInlineModel } from './Instance';
export function RenderOwner({
@@ -29,7 +31,21 @@ export function RenderUser({
instance && (
<RenderInlineModel
primary={instance.username}
secondary={`${instance.first_name} ${instance.last_name}`}
secondary={
<Group gap='xs'>
{!instance.is_active && (
<Badge autoContrast color='red'>{t`Inactive`}</Badge>
)}
</Group>
}
suffix={
<Group gap='xs'>
<Text size='sm'>
{instance.first_name} {instance.last_name}
</Text>
<IconUser size={16} />
</Group>
}
/>
)
);