Skip to content

Commit

Permalink
FEATURE/HCMPRE-1681: Handled the case where capacity is 0 and tested …
Browse files Browse the repository at this point in the history
…full flow (#2111)

handled the case where capacity is 0 and tested full flow
  • Loading branch information
nipunarora-eGov committed Jan 15, 2025
1 parent ff7bda3 commit da701f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,11 @@ export const UICustomizations = {
const VillageHierarchyTooltipWrapper = Digit.ComponentRegistryService.getComponent("VillageHierarchyTooltipWrapper");

switch (key) {
case `MICROPLAN_FACILITY_${column?.projectType}_CAPACITY`:
if (row?.additionalDetails?.capacity || row?.additionalDetails?.capacity === 0) {
return row?.additionalDetails?.capacity;
}
return t("NA");
case "MICROPLAN_FACILITY_SERVINGPOPULATION":
return row?.additionalDetails?.servingPopulation;
case "MICROPLAN_FACILITY_RESIDINGVILLAGE":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useMyContext } from "../utils/context";

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

const { state, dispatch } = useMyContext();
Expand Down Expand Up @@ -124,6 +125,8 @@ const facilityMappingConfig = (projectType, disabledAction) => {
{
label: `MICROPLAN_FACILITY_${projectType}_CAPACITY`,
jsonPath: "additionalDetails.capacity",
additionalCustomization: true,
projectType: projectType,
},
{
label: "MICROPLAN_FACILITY_ASSIGNED_VILLAGES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,11 @@ export const UICustomizations = {
const VillageHierarchyTooltipWrapper = Digit.ComponentRegistryService.getComponent("VillageHierarchyTooltipWrapper");

switch (key) {
case `MICROPLAN_FACILITY_${column?.projectType}_CAPACITY`:
if (row?.additionalDetails?.capacity || row?.additionalDetails?.capacity === 0) {
return row?.additionalDetails?.capacity;
}
return t("NA");
case "MICROPLAN_FACILITY_SERVINGPOPULATION":
return row?.additionalDetails?.servingPopulation;
case "MICROPLAN_FACILITY_RESIDINGVILLAGE":
Expand Down

0 comments on commit da701f8

Please sign in to comment.