From 14fe69bb9dd92ff63b2d1400b907b7408618eba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Mon, 10 Aug 2026 10:26:53 -0300 Subject: [PATCH] Align supply material actions --- src/pages/Supplies.tsx | 79 +++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 32 deletions(-) diff --git a/src/pages/Supplies.tsx b/src/pages/Supplies.tsx index 7927e8f..4151572 100644 --- a/src/pages/Supplies.tsx +++ b/src/pages/Supplies.tsx @@ -2110,23 +2110,14 @@ const AffectedProducts = ({ products }: { products: SupplyPurchaseNeed['products
Produtos afetados {products.slice(0, 3).map(product => ( -
- - #{product.productId} · {product.name} - - - - -
+ + #{product.productId} · {product.name} + ))} {products.length > 3 && +{products.length - 3} SKUs}
@@ -2136,10 +2127,11 @@ const AffectedProducts = ({ products }: { products: SupplyPurchaseNeed['products const PurchaseMaterialQueue = ({ needs, onEditMaterial }: { needs: SupplyPurchaseNeed[]; onEditMaterial: (need: SupplyPurchaseNeed) => void }) => ( <>
-
- Material e impacto +
+ Material Como a compra foi calculada - Decisão + Impacto + Ações
@@ -2166,7 +2158,7 @@ const PurchaseMaterialQueue = ({ needs, onEditMaterial }: { needs: SupplyPurchas return (
-
+

{getNeedDisplayName(need)}

@@ -2202,15 +2194,25 @@ const PurchaseMaterialQueue = ({ needs, onEditMaterial }: { needs: SupplyPurchas

Impacto

{products.length} {products.length === 1 ? 'SKU' : 'SKUs'} dependem

{formatNumber(sumNeedProducts(need, 'suggestedQuantity'))} un. planejadas

+
+
+ + +
@@ -2225,10 +2227,11 @@ const PurchaseMaterialQueue = ({ needs, onEditMaterial }: { needs: SupplyPurchas const PurchaseServiceQueue = ({ needs, onEditMaterial }: { needs: SupplyPurchaseNeed[]; onEditMaterial: (need: SupplyPurchaseNeed) => void }) => ( <>
-
- Serviço e impacto +
+ Serviço Volume a programar - Próximo passo + Impacto + Ações
@@ -2238,7 +2241,7 @@ const PurchaseServiceQueue = ({ needs, onEditMaterial }: { needs: SupplyPurchase return (
-
+

{getNeedDisplayName(need)}

@@ -2268,15 +2271,25 @@ const PurchaseServiceQueue = ({ needs, onEditMaterial }: { needs: SupplyPurchase

Impacto

{products.length} {products.length === 1 ? 'SKU' : 'SKUs'} dependem

{formatNumber(sumNeedProducts(need, 'suggestedQuantity'))} un. planejadas

+
+
+ + +
@@ -2293,6 +2306,12 @@ const getMaterialRegistrationSku = (material: string) => { return /^[A-Z0-9_-]{2,}$/i.test(candidate) ? candidate : ''; }; +const getMaterialRegistrationPath = (material: string) => buildSkuEditPath({ + sku: getMaterialRegistrationSku(material), + name: material, + type: 'raw_material', +}); + const MaterialDetailsModal = ({ need, onClose, @@ -2309,11 +2328,7 @@ const MaterialDetailsModal = ({ }); const [isSaving, setIsSaving] = useState(false); const [error, setError] = useState(''); - const registrationPath = buildSkuEditPath({ - sku: getMaterialRegistrationSku(need.material), - name: need.material, - type: 'raw_material', - }); + const registrationPath = getMaterialRegistrationPath(need.material); const submit = async (event: FormEvent) => { event.preventDefault();