Skip to content

Commit 397f356

Browse files
FEATURE/HCMPRE-1681: Handled the case where capacity is 0 and tested full flow (#2111)
handled the case where capacity is 0 and tested full flow
1 parent cf8a7c9 commit 397f356

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js

+5
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,11 @@ export const UICustomizations = {
13001300
const VillageHierarchyTooltipWrapper = Digit.ComponentRegistryService.getComponent("VillageHierarchyTooltipWrapper");
13011301

13021302
switch (key) {
1303+
case `MICROPLAN_FACILITY_${column?.projectType}_CAPACITY`:
1304+
if (row?.additionalDetails?.capacity || row?.additionalDetails?.capacity === 0) {
1305+
return row?.additionalDetails?.capacity;
1306+
}
1307+
return t("NA");
13031308
case "MICROPLAN_FACILITY_SERVINGPOPULATION":
13041309
return row?.additionalDetails?.servingPopulation;
13051310
case "MICROPLAN_FACILITY_RESIDINGVILLAGE":

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/FacilityMappingConfig.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useMyContext } from "../utils/context";
22

3+
//ProjectType will be ["LLIN-mz","MR-DN"] for microplan
34
const facilityMappingConfig = (projectType, disabledAction) => {
45

56
const { state, dispatch } = useMyContext();
@@ -124,6 +125,8 @@ const facilityMappingConfig = (projectType, disabledAction) => {
124125
{
125126
label: `MICROPLAN_FACILITY_${projectType}_CAPACITY`,
126127
jsonPath: "additionalDetails.capacity",
128+
additionalCustomization: true,
129+
projectType: projectType,
127130
},
128131
{
129132
label: "MICROPLAN_FACILITY_ASSIGNED_VILLAGES",

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js

+5
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,11 @@ export const UICustomizations = {
582582
const VillageHierarchyTooltipWrapper = Digit.ComponentRegistryService.getComponent("VillageHierarchyTooltipWrapper");
583583

584584
switch (key) {
585+
case `MICROPLAN_FACILITY_${column?.projectType}_CAPACITY`:
586+
if (row?.additionalDetails?.capacity || row?.additionalDetails?.capacity === 0) {
587+
return row?.additionalDetails?.capacity;
588+
}
589+
return t("NA");
585590
case "MICROPLAN_FACILITY_SERVINGPOPULATION":
586591
return row?.additionalDetails?.servingPopulation;
587592
case "MICROPLAN_FACILITY_RESIDINGVILLAGE":

0 commit comments

Comments
 (0)