From 92b263a0efca258c6f5b8d2b4a785401da1586ba Mon Sep 17 00:00:00 2001 From: thehighestprimenumber Date: Thu, 27 Feb 2025 11:43:10 -0300 Subject: [PATCH 1/3] bug: [ON-3483] remove unused param --- app/src/app/[lng]/[inventory]/data/[step]/SourceDrawer.tsx | 1 - .../[lng]/[inventory]/data/[step]/SourceDrawerActivityTable.tsx | 2 -- 2 files changed, 3 deletions(-) diff --git a/app/src/app/[lng]/[inventory]/data/[step]/SourceDrawer.tsx b/app/src/app/[lng]/[inventory]/data/[step]/SourceDrawer.tsx index 82916668c..de65c165f 100644 --- a/app/src/app/[lng]/[inventory]/data/[step]/SourceDrawer.tsx +++ b/app/src/app/[lng]/[inventory]/data/[step]/SourceDrawer.tsx @@ -197,7 +197,6 @@ export function SourceDrawer({ {t("disaggregated-analysis")} {sourceData?.records && ( diff --git a/app/src/app/[lng]/[inventory]/data/[step]/SourceDrawerActivityTable.tsx b/app/src/app/[lng]/[inventory]/data/[step]/SourceDrawerActivityTable.tsx index 584985c29..85d86fbe7 100644 --- a/app/src/app/[lng]/[inventory]/data/[step]/SourceDrawerActivityTable.tsx +++ b/app/src/app/[lng]/[inventory]/data/[step]/SourceDrawerActivityTable.tsx @@ -15,13 +15,11 @@ import { Overline } from "@/components/Texts/Overline"; interface SourceDrawerActivityTableProps { activities: DataSourceActivityDataRecord[]; t: TFunction; - sectorId: string | undefined; } export function SourceDrawerActivityTable({ activities, t, - sectorId, }: SourceDrawerActivityTableProps) { const getTotalEmissions = () => { const emissions = activities.reduce((acc, activity) => { From b00ae165cdbd619fa1fb9edab1c33554d79766cb Mon Sep 17 00:00:00 2001 From: thehighestprimenumber Date: Mon, 3 Mar 2025 11:30:54 -0300 Subject: [PATCH 2/3] bug: [ON-3484] fix total emissions --- .../data/[step]/SourceDrawerActivityTable.tsx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/app/src/app/[lng]/[inventory]/data/[step]/SourceDrawerActivityTable.tsx b/app/src/app/[lng]/[inventory]/data/[step]/SourceDrawerActivityTable.tsx index 85d86fbe7..bcbbaa572 100644 --- a/app/src/app/[lng]/[inventory]/data/[step]/SourceDrawerActivityTable.tsx +++ b/app/src/app/[lng]/[inventory]/data/[step]/SourceDrawerActivityTable.tsx @@ -21,14 +21,9 @@ export function SourceDrawerActivityTable({ activities, t, }: SourceDrawerActivityTableProps) { - const getTotalEmissions = () => { - const emissions = activities.reduce((acc, activity) => { - return ( - acc + - activity.gases.reduce((acc, gas) => { - return acc + gas.emissions_value_100yr; - }, 0) - ); + const getTotalEmissions = (activity: DataSourceActivityDataRecord) => { + const emissions = activity.gases.reduce((acc, gas) => { + return acc + gas.emissions_value_100yr; }, 0); return convertKgToTonnes(emissions); }; @@ -55,7 +50,7 @@ export function SourceDrawerActivityTable({ .map((e) => t(e)) .join(" > ")} - {`${t("total")} ${getTotalEmissions()}`} + {`${t("total")} ${getTotalEmissions(activity)}`} From a3a807b545f9e892ed1a6e1a502b7d9dbdc7ab69 Mon Sep 17 00:00:00 2001 From: thehighestprimenumber Date: Mon, 3 Mar 2025 11:31:11 -0300 Subject: [PATCH 3/3] bug: missing translation string --- app/src/i18n/locales/en/dashboard.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/i18n/locales/en/dashboard.json b/app/src/i18n/locales/en/dashboard.json index d34d2d51d..a32beb749 100644 --- a/app/src/i18n/locales/en/dashboard.json +++ b/app/src/i18n/locales/en/dashboard.json @@ -174,5 +174,6 @@ "afolu-land": "Land", "rate": "rate", "sector": "sector", - "an-error-occurred": "An error occurred" + "an-error-occurred": "An error occurred", + "error-fetching-sector-breakdown": "Error fetching sector breakdown" }