Skip to content

Commit

Permalink
Remove areas affected because not needed in form
Browse files Browse the repository at this point in the history
  • Loading branch information
anagperal committed Aug 12, 2024
1 parent f6d2019 commit c9157fd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 56 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Maybe } from "../../../utils/ts-utils";
import { TeamMember } from "../incident-management-team/TeamMember";
import { OrgUnit } from "../OrgUnit";
import { Option } from "../Ref";
import { DiseaseOutbreakEventBaseAttrs } from "./DiseaseOutbreakEvent";

Expand All @@ -9,7 +8,6 @@ export type DiseaseOutbreakEventOptions = {
mainSyndromes: Option[];
suspectedDiseases: Option[];
notificationSources: Option[];
organisationUnits: OrgUnit[];
incidentStatus: Option[];
teamMembers: TeamMember[];
};
Expand Down
5 changes: 0 additions & 5 deletions src/domain/usecases/GetDiseaseOutbreakWithOptionsUseCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Future } from "../entities/generic/Future";
import { Id } from "../entities/Ref";
import { DiseaseOutbreakEventRepository } from "../repositories/DiseaseOutbreakEventRepository";
import { OptionsRepository } from "../repositories/OptionsRepository";
import { OrgUnitRepository } from "../repositories/OrgUnitRepository";
import { TeamMemberRepository } from "../repositories/TeamMemberRepository";

export class GetDiseaseOutbreakWithOptionsUseCase {
Expand All @@ -14,7 +13,6 @@ export class GetDiseaseOutbreakWithOptionsUseCase {
diseaseOutbreakEventRepository: DiseaseOutbreakEventRepository;
optionsRepository: OptionsRepository;
teamMemberRepository: TeamMemberRepository;
orgUnitRepository: OrgUnitRepository;
}
) {}

Expand All @@ -38,7 +36,6 @@ export class GetDiseaseOutbreakWithOptionsUseCase {
mainSyndromes: this.options.optionsRepository.getAllMainSyndromes(),
suspectedDiseases: this.options.optionsRepository.getAllSuspectedDiseases(),
notificationSources: this.options.optionsRepository.getAllNotificationSources(),
organisationUnits: this.options.orgUnitRepository.getAll(),
incidentStatus: this.options.optionsRepository.getAllIncidentStatus(),
teamMembers: this.options.teamMemberRepository.getAll(),
}).flatMap(
Expand All @@ -47,15 +44,13 @@ export class GetDiseaseOutbreakWithOptionsUseCase {
mainSyndromes,
suspectedDiseases,
notificationSources,
organisationUnits,
incidentStatus,
teamMembers,
}) => {
const diseaseOutbreakEventWithOptions: DiseaseOutbreakEventWithOptions = {
diseaseOutbreakEvent: diseaseOutbreakEventBase,
options: {
teamMembers,
organisationUnits,
hazardTypes,
mainSyndromes,
suspectedDiseases,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export function mapEntityToInitialFormState(
const { diseaseOutbreakEvent, options } = diseaseOutbreakEventWithOptions;
const {
teamMembers,
organisationUnits,
hazardTypes,
mainSyndromes,
suspectedDiseases,
Expand All @@ -74,14 +73,6 @@ export function mapEntityToInitialFormState(
alt: tm.photo ? `Photo of ${tm.name}` : undefined,
}));

const provinceOptions: PresentationOption[] = organisationUnits
.filter(ou => ou.level === "Province")
.map(ou => ({ value: ou.id, label: ou.name }));

const districtOptions: PresentationOption[] = organisationUnits
.filter(ou => ou.level === "District")
.map(ou => ({ value: ou.id, label: ou.name }));

const hazardTypesOptions: PresentationOption[] = mapToPresentationOptions(hazardTypes);
const mainSyndromesOptions: PresentationOption[] = mapToPresentationOptions(mainSyndromes);
const suspectedDiseasesOptions: PresentationOption[] =
Expand Down Expand Up @@ -206,46 +197,6 @@ export function mapEntityToInitialFormState(
},
],
},
{
title: "Areas Affected",
id: "areasAffected_section",
isVisible: true,
required: true,
fields: [
{
id: getFieldIdFromIdsDictionary(
"areasAffectedProvinceIds",
diseaseOutbreakEventFieldIds
),
label: "Provinces",
isVisible: true,
errors: [],
type: "select",
multiple: true,
options: provinceOptions,
value: diseaseOutbreakEvent?.areasAffectedProvinceIds || [],
width: "400px",
required: true,
showIsRequired: false,
},
{
id: getFieldIdFromIdsDictionary(
"areasAffectedDistrictIds",
diseaseOutbreakEventFieldIds
),
label: "Districts",
isVisible: true,
errors: [],
type: "select",
multiple: true,
options: districtOptions,
value: diseaseOutbreakEvent?.areasAffectedDistrictIds || [],
width: "400px",
required: true,
showIsRequired: false,
},
],
},
{
title: "Incident Status",
id: "incidentStatus_section",
Expand Down

0 comments on commit c9157fd

Please sign in to comment.