2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-04-25 04:23:33 +00:00

Simplify BOM table rendering (#11795)

This commit is contained in:
Oliver
2026-04-24 10:52:27 +10:00
committed by GitHub
parent 03508cd15b
commit fef0fdf99b
+21 -22
View File
@@ -13,12 +13,11 @@ import useTable from '@lib/hooks/UseTable';
import type { TableFilter } from '@lib/types/Filters'; import type { TableFilter } from '@lib/types/Filters';
import type { TableColumn } from '@lib/types/Tables'; import type { TableColumn } from '@lib/types/Tables';
import { t } from '@lingui/core/macro'; import { t } from '@lingui/core/macro';
import { ActionIcon, Alert, Group, Stack, Text, Tooltip } from '@mantine/core'; import { Alert, Group, Stack, Text } from '@mantine/core';
import { showNotification } from '@mantine/notifications'; import { showNotification } from '@mantine/notifications';
import { import {
IconArrowRight, IconArrowRight,
IconCircleCheck, IconCircleCheck,
IconExclamationCircle,
IconFileUpload, IconFileUpload,
IconLock, IconLock,
IconPlus, IconPlus,
@@ -99,28 +98,28 @@ export function BomTable({
); );
} }
if (!record.validated) {
extra.push(
<Text key='not-validated' c='red'>
{t`This BOM item has not been validated`}
</Text>
);
}
return ( return (
part && ( part && (
<Group gap='xs' justify='space-between' wrap='nowrap'> <TableHoverCard
<TableHoverCard value={
value={ <Thumbnail
<Thumbnail src={part.thumbnail || part.image}
src={part.thumbnail || part.image} alt={part.description}
alt={part.description} text={part.full_name}
text={part.full_name} />
/> }
} iconColor={record.validated ? undefined : 'red'}
extra={extra} extra={extra}
title={t`Part Information`} title={t`Part Information`}
/> />
{!record.validated && (
<Tooltip label={t`This BOM item has not been validated`}>
<ActionIcon color='red' variant='transparent' size='sm'>
<IconExclamationCircle />
</ActionIcon>
</Tooltip>
)}
</Group>
) )
); );
} }