mirror of
https://github.com/inventree/InvenTree.git
synced 2025-09-13 14:11:37 +00:00
Consolidate rendering of inline items (#10189)
* Consolidate rendering of inline items * Bug fix for user rendering
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { Text } from '@mantine/core';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
import { ModelType } from '@lib/enums/ModelType';
|
||||
@@ -38,7 +37,7 @@ export function RenderCompany(
|
||||
{...props}
|
||||
image={instance.thumbnail || instance.image}
|
||||
primary={instance.name}
|
||||
secondary={instance.description}
|
||||
suffix={instance.description}
|
||||
url={
|
||||
props.link ? getDetailUrl(ModelType.company, instance.pk) : undefined
|
||||
}
|
||||
@@ -73,9 +72,7 @@ export function RenderSupplierPart(
|
||||
image={
|
||||
part?.thumbnail ?? part?.image ?? supplier?.thumbnail ?? supplier?.image
|
||||
}
|
||||
suffix={
|
||||
part.full_name ? <Text size='sm'>{part.full_name}</Text> : undefined
|
||||
}
|
||||
suffix={part.full_name}
|
||||
url={
|
||||
props.link
|
||||
? getDetailUrl(ModelType.supplierpart, instance.pk)
|
||||
@@ -100,9 +97,7 @@ export function RenderManufacturerPart(
|
||||
{...props}
|
||||
primary={manufacturer.name}
|
||||
secondary={instance.MPN}
|
||||
suffix={
|
||||
part.full_name ? <Text size='sm'>{part.full_name}</Text> : undefined
|
||||
}
|
||||
suffix={part.full_name}
|
||||
image={manufacturer?.thumbnail ?? manufacturer.image}
|
||||
url={
|
||||
props.link
|
||||
|
@@ -119,7 +119,7 @@ export function RenderSalesOrderShipment({
|
||||
return (
|
||||
<RenderInlineModel
|
||||
primary={order.reference}
|
||||
suffix={<Text size='sm'>{`${t`Shipment`} ${instance.reference}`}</Text>}
|
||||
suffix={<Text size='xs'>{`${t`Shipment`} ${instance.reference}`}</Text>}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ export function RenderUser({
|
||||
primary={instance.username}
|
||||
secondary={
|
||||
<Group gap='xs'>
|
||||
{!instance.is_active && (
|
||||
{instance.is_active === false && (
|
||||
<Badge autoContrast color='red'>{t`Inactive`}</Badge>
|
||||
)}
|
||||
</Group>
|
||||
|
Reference in New Issue
Block a user