From fc16895a930a8901e19f2aafa48e8a162b2d2f72 Mon Sep 17 00:00:00 2001 From: Brenda Sukh Date: Wed, 2 Dec 2020 15:07:50 -0500 Subject: [PATCH] Generalize breakdown label --- .../src/components/ProductInsightsCard/ProductEntityDialog.tsx | 2 ++ .../src/components/ProductInsightsCard/ProductInsightsChart.tsx | 1 + plugins/cost-insights/src/types/Entity.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.tsx index df980fe16c..d617c0df35 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.tsx @@ -93,6 +93,7 @@ type ProductEntityDialogOptions = Partial< type ProductEntityDialogProps = { open: boolean; entity?: Entity; + entitiesLabel: string; options?: ProductEntityDialogOptions; onClose: () => void; }; @@ -100,6 +101,7 @@ type ProductEntityDialogProps = { export const ProductEntityDialog = ({ open, entity = defaultEntity, + entitiesLabel, options = {}, onClose, }: ProductEntityDialogProps) => { diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsChart.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsChart.tsx index 69f49991ed..2c26f62574 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsChart.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsChart.tsx @@ -200,6 +200,7 @@ export const ProductInsightsChart = ({ onClose={() => setSelected(undefined)} entity={entity.entities.find(e => e.id === selectLabel)} options={options} + entitiesLabel={entity.entitiesLabel || 'SKU'} /> )} diff --git a/plugins/cost-insights/src/types/Entity.ts b/plugins/cost-insights/src/types/Entity.ts index 83347f05c3..52f6271bb4 100644 --- a/plugins/cost-insights/src/types/Entity.ts +++ b/plugins/cost-insights/src/types/Entity.ts @@ -22,6 +22,7 @@ export interface Entity { aggregation: [number, number]; entities: Entity[]; change: ChangeStatistic; + entitiesLabel?: string; } /*