From 4bb1354b68db9cd83bef2c91f7494b4c315c44dd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 16:27:24 +1100 Subject: [PATCH] Fix for pricing display (#10804) (#10805) (cherry picked from commit 77f80385c95de093ea3d229bb1cb2e3b51bdfacc) Co-authored-by: Oliver --- .../pages/part/pricing/BomPricingPanel.tsx | 43 +------------------ 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx b/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx index 7138ef60a5..b67706dc89 100644 --- a/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx +++ b/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx @@ -1,9 +1,8 @@ import { t } from '@lingui/core/macro'; -import { BarChart, type ChartTooltipProps, DonutChart } from '@mantine/charts'; +import { BarChart, DonutChart } from '@mantine/charts'; import { Center, Group, - Paper, SegmentedControl, SimpleGrid, Stack, @@ -17,40 +16,12 @@ import { apiUrl } from '@lib/functions/Api'; import type { TableColumn } from '@lib/types/Tables'; import { CHART_COLORS } from '../../../components/charts/colors'; import { tooltipFormatter } from '../../../components/charts/tooltipFormatter'; -import { - formatCurrency, - formatDecimal, - formatPriceRange -} from '../../../defaults/formatters'; +import { formatDecimal, formatPriceRange } from '../../../defaults/formatters'; import { useTable } from '../../../hooks/UseTable'; import { DateColumn, PartColumn } from '../../../tables/ColumnRenderers'; import { InvenTreeTable } from '../../../tables/InvenTreeTable'; import { LoadingPricingData, NoPricingData } from './PricingPanel'; -/* - * Render a tooltip for the chart, with correct date information - */ -function ChartTooltip({ label, payload }: ChartTooltipProps) { - if (!payload) { - return null; - } - - const data = payload[0] ?? {}; - - return ( - - - - {data.name} - - - {formatCurrency(data.payload?.value)} - - - - ); -} - // Display BOM data as a pie chart function BomPieChart({ data, @@ -86,11 +57,6 @@ function BomPieChart({ tooltipDataSource='segment' chartLabel={t`Total Price`} valueFormatter={(value) => tooltipFormatter(value, currency)} - tooltipProps={{ - content: ({ label, payload }) => ( - - ) - }} /> ); @@ -116,11 +82,6 @@ function BomBarChart({ { name: 'total_price_max', label: t`Maximum Price`, color: 'teal.6' } ]} valueFormatter={(value) => tooltipFormatter(value, currency)} - tooltipProps={{ - content: ({ label, payload }) => ( - - ) - }} /> ); }