From d4e5092a58b1d7391110cae1eac990c6805e25ed Mon Sep 17 00:00:00 2001 From: Chukwudumebi Onwuli <37223065+deeonwuli@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:19:14 +0100 Subject: [PATCH] fix: show only items with "ALL" incident status --- src/data/repositories/PerformanceOverviewD2Repository.ts | 4 ++-- .../disease-outbreak-event/PerformanceOverviewMetrics.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/repositories/PerformanceOverviewD2Repository.ts b/src/data/repositories/PerformanceOverviewD2Repository.ts index c0dc874b..a002f144 100644 --- a/src/data/repositories/PerformanceOverviewD2Repository.ts +++ b/src/data/repositories/PerformanceOverviewD2Repository.ts @@ -109,7 +109,7 @@ export class PerformanceOverviewD2Repository implements PerformanceOverviewRepos existingEntry.total += totalCardCount.total; acc[totalCardCount.name] = existingEntry; } else { - acc[totalCardCount.name] = totalCardCount; + acc[totalCardCount.name] = { ...totalCardCount }; } return acc; }, {} as Record); @@ -190,7 +190,7 @@ export class PerformanceOverviewD2Repository implements PerformanceOverviewRepos if (filters && Object.entries(filters).length) { return Object.entries(filters).every(([key, value]) => { if (!value) { - return true; + return item.incidentStatus === "ALL"; } if (key === "incidentStatus") { return value === item.incidentStatus; diff --git a/src/domain/entities/disease-outbreak-event/PerformanceOverviewMetrics.ts b/src/domain/entities/disease-outbreak-event/PerformanceOverviewMetrics.ts index 9a1c3634..59596a6b 100644 --- a/src/domain/entities/disease-outbreak-event/PerformanceOverviewMetrics.ts +++ b/src/domain/entities/disease-outbreak-event/PerformanceOverviewMetrics.ts @@ -53,7 +53,7 @@ export type PerformanceOverviewMetrics = { nationalIncidentStatus: string; }; -export type IncidentStatus = "Watch" | "Alert" | "Respond" | "All"; +export type IncidentStatus = "Watch" | "Alert" | "Respond" | "ALL"; type BaseCounts = { name: DiseaseNames | HazardNames;