diff --git a/src/frontend/src/tables/build/BuildLineTable.tsx b/src/frontend/src/tables/build/BuildLineTable.tsx index 7bdfb844c5..27e68a38ed 100644 --- a/src/frontend/src/tables/build/BuildLineTable.tsx +++ b/src/frontend/src/tables/build/BuildLineTable.tsx @@ -1,6 +1,7 @@ import { ActionButton } from '@lib/components/ActionButton'; import { ProgressBar } from '@lib/components/ProgressBar'; import { RowEditAction, RowViewAction } from '@lib/components/RowActions'; +import { YesNoButton } from '@lib/components/YesNoButton'; import { ApiEndpoints } from '@lib/enums/ApiEndpoints'; import { ModelType } from '@lib/enums/ModelType'; import { UserRoles } from '@lib/enums/Roles'; @@ -10,7 +11,7 @@ import useTable from '@lib/hooks/UseTable'; import type { TableFilter } from '@lib/types/Filters'; import type { RowAction, TableColumn } from '@lib/types/Tables'; import { t } from '@lingui/core/macro'; -import { Alert, Group, Paper, Text } from '@mantine/core'; +import { Alert, Center, Group, Paper, Text } from '@mantine/core'; import { IconArrowRight, IconCircleCheck, @@ -54,6 +55,16 @@ import { InvenTreeTable } from '../InvenTreeTable'; import RowExpansionIcon from '../RowExpansionIcon'; import { TableHoverCard } from '../TableHoverCard'; +/** + * Return true if the given build line record is "effectively consumable" - + * i.e. either the BOM line itself, or the underlying part, is marked as consumable. + */ +function isLineConsumable(record: any): boolean { + return ( + !!record?.bom_item_detail?.consumable || !!record?.part_detail?.consumable + ); +} + /** * Render a sub-table of allocated stock against a particular build line. * @@ -366,7 +377,12 @@ export default function BuildLineTable({ ordering: 'consumable', filter: 'consumable', hidden: hasOutput, - defaultVisible: false + defaultVisible: false, + render: (record: any) => ( +