From 390e17ca7919c4bca42af5bf9e4f80e26a2fe95a Mon Sep 17 00:00:00 2001 From: Vio Date: Sat, 22 Jan 2022 13:57:52 +0100 Subject: [PATCH] fix(ui): Summary - pass budget data to SummaryItem --- packages/ui/src/app/app.jsx | 141 ------------------ .../ui/src/components/summary/summary.jsx | 2 +- 2 files changed, 1 insertion(+), 142 deletions(-) diff --git a/packages/ui/src/app/app.jsx b/packages/ui/src/app/app.jsx index 6605858e7d..6093da5ec0 100644 --- a/packages/ui/src/app/app.jsx +++ b/packages/ui/src/app/app.jsx @@ -176,7 +176,6 @@ const AppComponent = ({ version, jobs }) => { ); } -<<<<<<< HEAD return ( @@ -187,146 +186,6 @@ const AppComponent = ({ version, jobs }) => { data={jobs[0].summary} budgets={jobs[0].insights?.webpack?.budgets} showSummaryItemDelta={jobs.length !== 1} -======= - const { summary, insights } = useMemo(() => jobs[0], jobs); - - const { duplicatePackagesCount } = summary.webpack; - const duplicatePackagesInsights = Boolean( - duplicatePackagesCount.current || duplicatePackagesCount.baseline, - ); - - return ( - - - - - - - - - {I18N.OVERVIEW} - - - {I18N.ASSETS} - - - {I18N.MODULES} - - - {I18N.PACKAGES} - - - - -
- - ( - - - - - - - - - )} - /> - ( - - - - - - - - - )} - /> - ( - - - - - - - - - )} - /> - ( - - {duplicatePackagesInsights && ( - - 1} - /> - - )} - {insights?.webpack?.budgets && ( - - - - )} - - - - - - - - - - - )} ->>>>>>> 7812671e (refactor(ui): App - memo summary, insights) /> diff --git a/packages/ui/src/components/summary/summary.jsx b/packages/ui/src/components/summary/summary.jsx index 3064dd1be5..212fdbdf3d 100644 --- a/packages/ui/src/components/summary/summary.jsx +++ b/packages/ui/src/components/summary/summary.jsx @@ -34,7 +34,7 @@ export const Summary = ({ size={size} id={metricId} data={get(data, metricId)} - budget={get(budgets, metricId)} + budget={get(budgets, getSourceMetricId(metricId))} loading={loading} showMetricDescription showDelta={showSummaryItemDelta && metricOptions.showDelta !== false}