Skip to content

Commit

Permalink
chore: merge with maps
Browse files Browse the repository at this point in the history
  • Loading branch information
9sneha-n committed Oct 1, 2024
2 parents f2272d0 + 4fad063 commit ed62321
Show file tree
Hide file tree
Showing 127 changed files with 7,985 additions and 1,067 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.14.2
v18.19.0
47 changes: 43 additions & 4 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-09-16T15:12:17.095Z\n"
"PO-Revision-Date: 2024-09-16T15:12:17.095Z\n"
"POT-Creation-Date: 2024-09-30T07:39:32.843Z\n"
"PO-Revision-Date: 2024-09-30T07:39:32.843Z\n"

msgid "Low"
msgstr ""
Expand Down Expand Up @@ -48,6 +48,12 @@ msgstr ""
msgid "Available at national with support required from international"
msgstr ""

msgid "Capability 1"
msgstr ""

msgid "Capability 2"
msgstr ""

msgid "Grade 1"
msgstr ""

Expand Down Expand Up @@ -81,9 +87,21 @@ msgstr ""
msgid "Edit Details"
msgstr ""

msgid "Notes"
msgstr ""

msgid "Notes"
msgstr ""

msgid "Create Event"
msgstr ""

msgid "The map with these filters could not be found."
msgstr ""

msgid "Map not found."
msgstr ""

msgid "Close"
msgstr ""

Expand All @@ -108,9 +126,15 @@ msgstr ""
msgid "Respond, alert, watch"
msgstr ""

msgid "Select duration"
msgstr ""

msgid "Duration"
msgstr ""

msgid "All public health events"
msgstr ""

msgid "7-1-7 performance"
msgstr ""

Expand All @@ -123,10 +147,19 @@ msgstr ""
msgid "Event Tracker"
msgstr ""

msgid "Districts Affected"
msgstr ""

msgid "Create Risk Assessment"
msgstr ""

msgid "Add new Assessment"
msgstr ""

msgid "Page Not Found"
msgid "N/A"
msgstr ""

msgid "Add another"
msgstr ""

msgid "Create Event form cannot be loaded"
Expand All @@ -135,7 +168,13 @@ msgstr ""
msgid "Disease Outbreak saved successfully"
msgstr ""

msgid "N/A"
msgid "Risk Assessment Grading saved successfully"
msgstr ""

msgid "Risk Assessment Summary saved successfully"
msgstr ""

msgid "Risk Assessment Questionnaire saved successfully"
msgstr ""

msgid "Incident Action Plan"
Expand Down
41 changes: 34 additions & 7 deletions i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ msgstr ""
msgid "Available at national with support required from international"
msgstr ""

msgid "Capability 1"
msgstr ""

msgid "Capability 2"
msgstr ""

msgid "Grade 1"
msgstr ""

Expand Down Expand Up @@ -77,15 +83,18 @@ msgstr ""
msgid "Cancel"
msgstr ""

msgid "Save"
msgstr ""

msgid "Edit Details"
msgstr ""

msgid "Create Event"
msgstr ""

msgid "The map with these filters could not be found."
msgstr ""

msgid "Map not found."
msgstr ""

msgid "Close"
msgstr ""

Expand All @@ -110,13 +119,16 @@ msgstr ""
msgid "Respond, alert, watch"
msgstr ""

msgid "Select duration"
msgstr ""

msgid "Duration"
msgstr ""

msgid "7-1-7 performance"
msgid "All public health events"
msgstr ""

msgid "events"
msgid "7-1-7 performance"
msgstr ""

msgid "Performance overview"
Expand All @@ -125,10 +137,19 @@ msgstr ""
msgid "Event Tracker"
msgstr ""

msgid "Districts Affected"
msgstr ""

msgid "Create Risk Assessment"
msgstr ""

msgid "Add new Assessment"
msgstr ""

msgid "Page Not Found"
msgid "N/A"
msgstr ""

msgid "Add another"
msgstr ""

msgid "Create Event form cannot be loaded"
Expand All @@ -137,7 +158,13 @@ msgstr ""
msgid "Disease Outbreak saved successfully"
msgstr ""

msgid "N/A"
msgid "Risk Assessment Grading saved successfully"
msgstr ""

msgid "Risk Assessment Summary saved successfully"
msgstr ""

msgid "Risk Assessment Questionnaire saved successfully"
msgstr ""

msgid "Incident Action Plan"
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -29,6 +29,7 @@
"classnames": "2.3.1",
"d2": "31.10.2",
"d2-manifest": "1.0.0",
"dotenv": "^16.4.5",
"font-awesome": "4.7.0",
"moment": "^2.30.1",
"purify-ts": "1.2.0",
Expand Down Expand Up @@ -111,7 +112,8 @@
"localize": "yarn update-po && d2-i18n-generate -n dhis2-skeleton-app -p ./i18n/ -o ./src/locales/",
"update-po": "yarn extract-pot && find i18n/ -name '*.po' -exec msgmerge --backup=off -U {} i18n/en.pot \\;",
"prepare": "husky install",
"script-example": "npx ts-node src/scripts/example.ts"
"script-example": "npx ts-node src/scripts/example.ts",
"script-map-outbreak-to-alerts": "npx ts-node -r dotenv/config src/scripts/mapDiseaseOutbreakToAlerts.ts"
},
"manifest.webapp": {
"name": "ZEBRA",
Expand Down
69 changes: 53 additions & 16 deletions src/CompositionRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,61 +18,95 @@ import { OptionsTestRepository } from "./data/repositories/test/OptionsTestRepos
import { TeamMemberTestRepository } from "./data/repositories/test/TeamMemberTestRepository";
import { OrgUnitTestRepository } from "./data/repositories/test/OrgUnitTestRepository";
import { GetAllDiseaseOutbreaksUseCase } from "./domain/usecases/GetAllDiseaseOutbreaksUseCase";
import { SaveDiseaseOutbreakUseCase } from "./domain/usecases/SaveDiseaseOutbreakUseCase";
import { GetDiseaseOutbreakWithOptionsUseCase } from "./domain/usecases/GetDiseaseOutbreakWithOptionsUseCase";
import { AnalyticsRepository } from "./domain/repositories/AnalyticsRepository";
import { GetAllProgramIndicatorsUseCase } from "./domain/usecases/GetAllProgramIndicatorsUseCase";
import { AnalyticsD2Repository } from "./data/repositories/AnalyticsD2Repository";
import { ProgramIndicatorsTestRepository } from "./data/repositories/test/ProgramIndicatorsTestRepository";
import { GetDiseasesTotalUseCase } from "./domain/usecases/GetDiseasesTotalUseCase";
import { MapDiseaseOutbreakToAlertsUseCase } from "./domain/usecases/MapDiseaseOutbreakToAlertsUseCase";
import { AlertRepository } from "./domain/repositories/AlertRepository";
import { AlertTestRepository } from "./data/repositories/test/AlertTestRepository";
import { Get717PerformanceUseCase } from "./domain/usecases/Get717PerformanceUseCase";
import { GetEntityWithOptionsUseCase } from "./domain/usecases/GetEntityWithOptionsUseCase";
import { SaveEntityUseCase } from "./domain/usecases/SaveEntityUseCase";
import { RiskAssessmentRepository } from "./domain/repositories/RiskAssessmentRepository";
import { RiskAssessmentD2Repository } from "./data/repositories/RiskAssessmentD2Repository";
import { RiskAssessmentTestRepository } from "./data/repositories/test/RiskAssessmentTestRepository";
import { MapConfigRepository } from "./domain/repositories/MapConfigRepository";
import { MapConfigD2Repository } from "./data/repositories/MapConfigD2Repository";
import { MapConfigTestRepository } from "./data/repositories/test/MapConfigTestRepository";
import { GetMapConfigUseCase } from "./domain/usecases/GetMapConfigUseCase";
import { GetProvincesOrgUnits } from "./domain/usecases/GetProvincesOrgUnits";
import { GetAllOrgUnits } from "./domain/usecases/GetAllOrgUnits";
import { PerformanceOverviewRepository } from "./domain/repositories/PerformanceOverviewRepository";
import { GetAllPerformanceOverviewMetricsUseCase } from "./domain/usecases/GetAllPerformanceOverviewMetricsUseCase";
import { PerformanceOverviewD2Repository } from "./data/repositories/PerformanceOverviewD2Repository";
import { PerformanceOverviewTestRepository } from "./data/repositories/test/PerformanceOverviewTestRepository";
import { GetTotalCardCountsUseCase } from "./domain/usecases/GetDiseasesTotalUseCase";
import { AlertSyncDataStoreRepository } from "./data/repositories/AlertSyncDataStoreRepository";
import { AlertSyncDataStoreTestRepository } from "./data/repositories/test/AlertSyncDataStoreTestRepository";
import { AlertSyncRepository } from "./domain/repositories/AlertSyncRepository";
import { DataStoreClient } from "./data/DataStoreClient";

export type CompositionRoot = ReturnType<typeof getCompositionRoot>;

type Repositories = {
usersRepository: UserRepository;
diseaseOutbreakEventRepository: DiseaseOutbreakEventRepository;
alertRepository: AlertRepository;
alertSyncRepository: AlertSyncRepository;
optionsRepository: OptionsRepository;
teamMemberRepository: TeamMemberRepository;
orgUnitRepository: OrgUnitRepository;
analytics: AnalyticsRepository;
riskAssessmentRepository: RiskAssessmentRepository;
mapConfigRepository: MapConfigRepository;
performanceOverviewRepository: PerformanceOverviewRepository;
};

function getCompositionRoot(repositories: Repositories) {
return {
getWithOptions: new GetEntityWithOptionsUseCase(repositories),
save: new SaveEntityUseCase(
repositories.diseaseOutbreakEventRepository,
repositories.riskAssessmentRepository
),
users: {
getCurrent: new GetCurrentUserUseCase(repositories.usersRepository),
},
diseaseOutbreakEvent: {
get: new GetDiseaseOutbreakByIdUseCase(repositories),
getWithOptions: new GetDiseaseOutbreakWithOptionsUseCase(repositories),
getAll: new GetAllDiseaseOutbreaksUseCase(repositories.diseaseOutbreakEventRepository),
save: new SaveDiseaseOutbreakUseCase(repositories.diseaseOutbreakEventRepository),
mapDiseaseOutbreakEventToAlerts: new MapDiseaseOutbreakToAlertsUseCase(
repositories.alertRepository
repositories.alertRepository,
repositories.alertSyncRepository,
repositories.optionsRepository
),
},
analytics: {
getProgramIndicators: new GetAllProgramIndicatorsUseCase(repositories),
getDiseasesTotal: new GetDiseasesTotalUseCase(repositories),
performanceOverview: {
getPerformanceOverviewMetrics: new GetAllPerformanceOverviewMetricsUseCase(
repositories
),
getTotalCardCounts: new GetTotalCardCountsUseCase(repositories),
get717Performance: new Get717PerformanceUseCase(repositories),
},
maps: {
getConfig: new GetMapConfigUseCase(repositories.mapConfigRepository),
},
orgUnits: {
getAll: new GetAllOrgUnits(repositories.orgUnitRepository),
getProvinces: new GetProvincesOrgUnits(repositories.orgUnitRepository),
},
};
}

export function getWebappCompositionRoot(api: D2Api) {
const dataStoreClient = new DataStoreClient(api);
const repositories: Repositories = {
usersRepository: new UserD2Repository(api),
diseaseOutbreakEventRepository: new DiseaseOutbreakEventD2Repository(api),
alertRepository: new AlertD2Repository(api),
alertSyncRepository: new AlertSyncDataStoreRepository(api),
optionsRepository: new OptionsD2Repository(api),
teamMemberRepository: new TeamMemberD2Repository(api),
orgUnitRepository: new OrgUnitD2Repository(api),
analytics: new AnalyticsD2Repository(api),
riskAssessmentRepository: new RiskAssessmentD2Repository(api),
mapConfigRepository: new MapConfigD2Repository(api),
performanceOverviewRepository: new PerformanceOverviewD2Repository(api, dataStoreClient),
};

return getCompositionRoot(repositories);
Expand All @@ -83,10 +117,13 @@ export function getTestCompositionRoot() {
usersRepository: new UserTestRepository(),
diseaseOutbreakEventRepository: new DiseaseOutbreakEventTestRepository(),
alertRepository: new AlertTestRepository(),
alertSyncRepository: new AlertSyncDataStoreTestRepository(),
optionsRepository: new OptionsTestRepository(),
teamMemberRepository: new TeamMemberTestRepository(),
orgUnitRepository: new OrgUnitTestRepository(),
analytics: new ProgramIndicatorsTestRepository(),
riskAssessmentRepository: new RiskAssessmentTestRepository(),
mapConfigRepository: new MapConfigTestRepository(),
performanceOverviewRepository: new PerformanceOverviewTestRepository(),
};

return getCompositionRoot(repositories);
Expand Down
Loading

0 comments on commit ed62321

Please sign in to comment.