2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-04-27 05:23:34 +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
+10 -11
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,9 +98,16 @@ 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
@@ -110,17 +116,10 @@ export function BomTable({
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>
) )
); );
} }