Skip to content

Commit

Permalink
Merge branch 'development' into feature/user-upload-case-data
Browse files Browse the repository at this point in the history
  • Loading branch information
anagperal committed Dec 26, 2024
2 parents ebdd21e + cd68605 commit c715317
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
21 changes: 10 additions & 11 deletions src/data/repositories/PerformanceOverviewD2Repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,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<string, TotalCardCounts>);
Expand Down Expand Up @@ -196,16 +196,15 @@ export class PerformanceOverviewD2Repository implements PerformanceOverviewRepos

const filteredCounts: TotalCardCounts[] = counts.filter(item => {
if (filters && Object.entries(filters).length) {
return Object.entries(filters).every(([key, value]) => {
if (!value) {
return true;
}
if (key === "incidentStatus") {
return value === item.incidentStatus;
} else if (key === "disease" || key === "hazard") {
return value === item.name;
}
});
const matchesDisease =
!filters.disease || (item.type === "disease" && item.name === filters.disease);
const matchesHazard =
!filters.hazard || (item.type === "hazard" && item.name === filters.hazard);
const matchesIncidentStatus = !filters.incidentStatus
? item.incidentStatus === "ALL"
: item.incidentStatus === filters.incidentStatus;

return matchesDisease && matchesHazard && matchesIncidentStatus;
}
return true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/webapp/components/layout/side-bar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export const SideBar: React.FC<SideBarProps> = React.memo(
);

const StyledDrawer = styled(Drawer)`
.MuiBackdrop-root {
background-color: transparent;
}
.MuiDrawer-paper {
height: calc(100% - 48px);
top: 48px;
Expand Down
7 changes: 7 additions & 0 deletions src/webapp/components/visualisation/Visualisation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,11 @@ async function setChartStyling(iframe: HTMLIFrameElement) {

iframeDocument.querySelectorAll(".main-center-titlebar").forEach(el => el.remove());
iFrameRoot?.querySelectorAll(".main-center-titlebar").forEach(el => el.remove());

iframeDocument
.querySelectorAll('div[data-test="dhis2-analytics-toolbar"]')
.forEach(el => el.remove());
iFrameRoot
?.querySelectorAll('div[data-test="dhis2-analytics-toolbar"]')
.forEach(el => el.remove());
}
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,8 @@ function getInitialFormStateForDiseaseOutbreakEvent(
mainSections.casesDataFile,
mainSections.dataSource,
mainSections.hazardType,
mainSections.mainSyndrome,
mainSections.suspectedDisease,
mainSections.mainSyndrome,
mainSections.notificationSource,
mainSections.incidentStatus,
mainSections.dateEmerged,
Expand Down

0 comments on commit c715317

Please sign in to comment.