From 7ca95e3877f5ae681c6cf65e164eae6198e68048 Mon Sep 17 00:00:00 2001 From: 9sneha-n <9sneha.n@gmail.com> Date: Mon, 30 Sep 2024 21:00:53 +0530 Subject: [PATCH 1/2] fix: d2-api version update --- package.json | 2 +- .../repositories/PerformanceOverviewD2Repository.ts | 13 +++++-------- yarn.lock | 8 ++++---- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 951510c6..32c84ab4 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@dhis2/ui": "6.12.0", "@emotion/react": "11.11.4", "@emotion/styled": "11.11.5", - "@eyeseetea/d2-api": "1.16.0-beta.9", + "@eyeseetea/d2-api": "1.16.0-beta.12", "@eyeseetea/d2-ui-components": "v2.9.0-beta.2", "@eyeseetea/feedback-component": "0.0.3", "@material-ui/core": "4.12.4", diff --git a/src/data/repositories/PerformanceOverviewD2Repository.ts b/src/data/repositories/PerformanceOverviewD2Repository.ts index ba285f19..71d434a1 100644 --- a/src/data/repositories/PerformanceOverviewD2Repository.ts +++ b/src/data/repositories/PerformanceOverviewD2Repository.ts @@ -16,6 +16,7 @@ import { TotalCardCounts, HazardNames, PerformanceOverviewMetrics, + DiseaseNames, } from "../../domain/entities/disease-outbreak-event/PerformanceOverviewMetrics"; import { AlertSynchronizationData } from "../../domain/entities/alert/AlertData"; import { OrgUnit } from "../../domain/entities/OrgUnit"; @@ -135,7 +136,6 @@ export class PerformanceOverviewD2Repository implements PerformanceOverviewRepos this.mapRowToBaseIndicator( row, indicatorsProgramFuture.headers, - //@ts-ignore indicatorsProgramFuture.metaData ) ) || []; @@ -196,7 +196,6 @@ export class PerformanceOverviewD2Repository implements PerformanceOverviewRepos private mapRowToBaseIndicator( row: string[], headers: { name: string; column: string }[], - //@ts-ignore metaData: AnalyticsResponse["metaData"] ): Partial { return headers.reduce((acc, header, index) => { @@ -208,14 +207,12 @@ export class PerformanceOverviewD2Repository implements PerformanceOverviewRepos if (key === "suspectedDisease") { acc[key] = - //@ts-ignore - Object.values(metaData.items).find(item => item.code === row[index])?.name || - ""; + (Object.values(metaData.items).find(item => item.code === row[index]) + ?.name as DiseaseNames) || ""; } else if (key === "hazardType") { acc[key] = - //@ts-ignore - Object.values(metaData.items).find(item => item.code === row[index])?.name || - ""; + (Object.values(metaData.items).find(item => item.code === row[index]) + ?.name as HazardNames) || ""; } else if (key === "nationalIncidentStatus") { acc[key] = row[index] as NationalIncidentStatus; } else { diff --git a/yarn.lock b/yarn.lock index 2c1fe8a4..89e95e32 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3419,10 +3419,10 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== -"@eyeseetea/d2-api@1.16.0-beta.9": - version "1.16.0-beta.9" - resolved "https://registry.yarnpkg.com/@eyeseetea/d2-api/-/d2-api-1.16.0-beta.9.tgz#bd318b62d8c94ea4e490c8e9b90461869f748c25" - integrity sha512-ASOcekMZoOOAZ9+Aq4I34qkiHW4sZFWoB5V8V51WAgYTv0ONoS8uLdFpmc1kFXJ5jsWC7IgSnE79rkLLZ9h9mg== +"@eyeseetea/d2-api@1.16.0-beta.12": + version "1.16.0-beta.12" + resolved "https://registry.yarnpkg.com/@eyeseetea/d2-api/-/d2-api-1.16.0-beta.12.tgz#02fd26e7a28f2debf7d890364a077020e4eab7b7" + integrity sha512-5VlaiWPrpuIHlCKGB75H4ndd7W0s203CR7qBSmfcqAMhmKnybPI7tTB97DJxF+VnIxwRvfsZ0g8ATKVlUTz0Vg== dependencies: "@babel/runtime" "^7.5.4" "@dhis2/d2-i18n" "^1.0.5" From 99bad440514bfa55fa61e6bb84c8597576db1811 Mon Sep 17 00:00:00 2001 From: 9sneha-n <9sneha.n@gmail.com> Date: Mon, 30 Sep 2024 21:01:42 +0530 Subject: [PATCH 2/2] chore: fixing warn --- src/webapp/pages/dashboard/usePerformanceOverview.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webapp/pages/dashboard/usePerformanceOverview.ts b/src/webapp/pages/dashboard/usePerformanceOverview.ts index bf0dbec5..44dddddf 100644 --- a/src/webapp/pages/dashboard/usePerformanceOverview.ts +++ b/src/webapp/pages/dashboard/usePerformanceOverview.ts @@ -75,7 +75,7 @@ export function usePerformanceOverview(): State { event: programIndicator.event, }; }, - [] + [getNationalIncidentStatusString] ); useEffect(() => { setIsLoading(true);