From 84c52847e954d35210a85e03fb14bd9d69cf86bc Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Tue, 16 Apr 2024 22:01:19 +0200 Subject: [PATCH] add disabled state to panels --- src/frontend/src/pages/part/PartPricingPanel.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/frontend/src/pages/part/PartPricingPanel.tsx b/src/frontend/src/pages/part/PartPricingPanel.tsx index 0f570e681e..2cc6b5aae2 100644 --- a/src/frontend/src/pages/part/PartPricingPanel.tsx +++ b/src/frontend/src/pages/part/PartPricingPanel.tsx @@ -61,6 +61,9 @@ export default function PartPricingPanel({ part }: { part: any }) { label="purchase" title={t`Purchase History`} visible={purchaseOrderPricing} + disabled={ + !pricing?.purchase_cost_min || !pricing?.purchase_cost_max + } /> } label="supplier" title={t`Supplier Pricing`} visible={purchaseOrderPricing} + disabled={ + !pricing?.supplier_price_min || !pricing?.supplier_price_max + } /> } label="bom" title={t`BOM Pricing`} visible={part?.assembly} + disabled={!pricing?.bom_cost_min || !pricing?.bom_cost_max} /> } label="variant" title={t`Variant Pricing`} visible={part?.is_template} + disabled={!pricing?.variant_cost_min || !pricing?.variant_cost_max} /> } label="sale-history" title={t`Sale History`} visible={salesOrderPricing} + disabled={!pricing?.sale_history_min || !pricing?.sale_history_max} /> )}