diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/GenericKpiFromDSS.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/GenericKpiFromDSS.js index fab2980443..0fec3a83a3 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/GenericKpiFromDSS.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/GenericKpiFromDSS.js @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'; import useKpiDssSearch from '../hooks/useKpiDssSearch'; const GenericKpiFromDSS = (props) => { - const { module, planId, campaignType, config, planEmployee={}, boundariesForKpi=[] } = props; + const { module, planId, campaignType, planEmployee={}, boundariesForKpi=[] } = props; // Create a copy of the boundariesForKpi array const localBoundariesForKpi = [...boundariesForKpi]; @@ -30,7 +30,6 @@ const GenericKpiFromDSS = (props) => { module, planId, campaignType, - config, boundariesForKpi: localBoundariesForKpi }); diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/searchDssChartV2.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/searchDssChartV2.js index bef5a8fbf9..0d3a2aad3c 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/searchDssChartV2.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/searchDssChartV2.js @@ -2,9 +2,9 @@ const searchDssChartV2 = async (module, planId, config, campaignType, boundaries try { // Validate inputs - if (!module || !planId || !campaignType) { - console.error("Invalid module or planId or campaignType provided"); - throw new Error("Invalid module or planId or campaignType provided"); + if (!module || !planId || !campaignType || !config) { + console.error("Any of module, planId, campaignType or config is invalid for searchDssChartV2"); + throw new Error("Any of module, planId, campaignType or config is invalid for searchDssChartV2"); } // Find the configuration for the provided module diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/useKpiDssSearch.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/useKpiDssSearch.js index d1f8ebfc10..3d6f2e2dd6 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/useKpiDssSearch.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/useKpiDssSearch.js @@ -1,12 +1,14 @@ import { useQuery } from "react-query"; +import { useMyContext } from "../utils/context"; import searchDssChartV2 from "./services/searchDssChartV2"; const useKpiDssSearch = (moduleAndPlanConfig) => { + const { state } = useMyContext(); const module = moduleAndPlanConfig?.module; const planId = moduleAndPlanConfig?.planId; const campaignType = moduleAndPlanConfig?.campaignType; const boundaries = moduleAndPlanConfig?.boundariesForKpi; - const config = moduleAndPlanConfig?.config; + const config = state?.DssKpiConfigs;; const queryString = `dss-${module}-${planId}_${campaignType}_${JSON.stringify(boundaries)}`; const { isLoading, data, isFetching, refetch } = useQuery([queryString, "/dashboard-analytics/dashboard/getChartV2"], () => searchDssChartV2(module, planId, config, campaignType, boundaries), { ...{}, diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js index 944b2298f6..e17425b2af 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js @@ -7,12 +7,10 @@ import { Loader, ActionBar, Button } from "@egovernments/digit-ui-components"; import WorkflowCommentPopUp from "../../components/WorkflowCommentPopUp"; import ConfirmationPopUp from "../../components/ConfirmationPopUp"; import GenericKpiFromDSS from "../../components/GenericKpiFromDSS"; -import { useMyContext } from "../../utils/context"; const FacilityCatchmentMapping = () => { const [actionBarPopUp, setactionBarPopUp] = useState(false); const { t } = useTranslation(); - const { state } = useMyContext(); const history = useHistory(); const url = Digit.Hooks.useQueryParams(); const tenantId = Digit.ULBService.getCurrentTenantId(); @@ -200,7 +198,7 @@ const FacilityCatchmentMapping = () => {
- +
{
{`${t("LOGGED_IN_AS")} ${userName} - ${t(userRole)}`}
- + { const { t } = useTranslation(); - const { state } = useMyContext(); const tenantId = Digit.ULBService.getCurrentTenantId(); const history = useHistory(); const url = Digit.Hooks.useQueryParams(); @@ -617,7 +615,7 @@ const PopInbox = () => { - +