From ffc60cb189562b89c9d4108863f8e47993d2cf57 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 27 Jun 2026 12:25:10 +1000 Subject: [PATCH] [UI] Stock column fix (#12268) (#12269) * [UI] Fix StockColumn component * stock table rendering tweaks (cherry picked from commit 1da71ca3b90718d71e42ddd09c0a1ff7d71c4e3f) Co-authored-by: Oliver --- src/frontend/src/tables/ColumnRenderers.tsx | 20 +++++++++---------- src/frontend/src/tables/TableHoverCard.tsx | 2 +- .../src/tables/stock/StockItemTable.tsx | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/frontend/src/tables/ColumnRenderers.tsx b/src/frontend/src/tables/ColumnRenderers.tsx index b2d4eb4f81..8d947bbe32 100644 --- a/src/frontend/src/tables/ColumnRenderers.tsx +++ b/src/frontend/src/tables/ColumnRenderers.tsx @@ -156,7 +156,7 @@ export function StockColumn(props: StockColumnProps): TableColumn { text = `# ${stock_item.serial}`; } - if (record.is_building) { + if (stock_item.is_building) { color = 'blue'; extra.push( {t`This stock item is in production`} ); - } else if (record.sales_order) { + } else if (stock_item.sales_order) { extra.push( {t`This stock item has been assigned to a sales order`} ); - } else if (record.customer) { + } else if (stock_item.customer) { extra.push( {t`This stock item has been assigned to a customer`} ); - } else if (record.belongs_to) { + } else if (stock_item.belongs_to) { extra.push( {t`This stock item is installed in another stock item`} ); - } else if (record.consumed_by) { + } else if (stock_item.consumed_by) { extra.push( {t`This stock item has been consumed by a build order`} ); - } else if (!record.in_stock) { + } else if (!stock_item.in_stock) { extra.push( {t`This stock item has expired`} ); - } else if (record.stale) { + } else if (stock_item.stale) { extra.push( {t`This stock item is stale`} ); } - if (record.in_stock) { + if (stock_item.in_stock) { if (allocated > 0) { if (allocated > quantity) { color = 'red'; @@ -267,7 +267,7 @@ export function StockColumn(props: StockColumnProps): TableColumn { } } - if (!record.in_stock) { + if (!stock_item.in_stock) { color = 'red'; } diff --git a/src/frontend/src/tables/TableHoverCard.tsx b/src/frontend/src/tables/TableHoverCard.tsx index 363af61133..913c6ced9b 100644 --- a/src/frontend/src/tables/TableHoverCard.tsx +++ b/src/frontend/src/tables/TableHoverCard.tsx @@ -68,7 +68,7 @@ export function TableHoverCard({ zIndex={zIndex} > - + {value}