From fc8356600e0ea804bbd649fa811981c66a935fd8 Mon Sep 17 00:00:00 2001 From: abishekTa-egov Date: Sat, 23 Nov 2024 15:15:48 +0530 Subject: [PATCH] Latest KPI values and Heading change (#1883) * Popup changed to alert type * UserName to name * userName to name * changes to heading font wieght * css package update * Removed i icon * changes * removed comments * removed comments * changes * isLoading removed * updated css --------- Co-authored-by: Nipun Arora --- .../example/public/index.html | 2 +- .../packages/css/package.json | 2 +- .../css/src/components/microplan.scss | 3 ++ .../microplan/src/components/FacilityPopup.js | 53 ++++++++++++------- .../src/components/RoleTableComposer.js | 10 ++-- .../microplan/src/components/UserAccess.js | 10 ++-- .../employee/FacilityCatchmentMapping.js | 2 +- .../microplan/src/pages/employee/PlanInbox.js | 2 +- .../microplan/src/pages/employee/PopInbox.js | 2 +- health/micro-ui/web/public/index.html | 2 +- 10 files changed, 48 insertions(+), 40 deletions(-) diff --git a/health/micro-ui/web/micro-ui-internals/example/public/index.html b/health/micro-ui/web/micro-ui-internals/example/public/index.html index 5b3c93dca09..2675e763252 100644 --- a/health/micro-ui/web/micro-ui-internals/example/public/index.html +++ b/health/micro-ui/web/micro-ui-internals/example/public/index.html @@ -12,7 +12,7 @@ DIGIT - + diff --git a/health/micro-ui/web/micro-ui-internals/packages/css/package.json b/health/micro-ui/web/micro-ui-internals/packages/css/package.json index 67330e9a778..60169264802 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/css/package.json +++ b/health/micro-ui/web/micro-ui-internals/packages/css/package.json @@ -1,6 +1,6 @@ { "name": "@egovernments/digit-ui-health-css", - "version": "0.1.41", + "version": "0.1.42", "license": "MIT", "main": "dist/index.css", "author": "Jagankumar ", diff --git a/health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss b/health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss index 8e9921dcf57..9448810212e 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss +++ b/health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss @@ -417,3 +417,6 @@ tbody tr:last-child td:last-child .digit-dropdown-employee-select-wrap .digit-dr position: relative; } +.mp-heading-bold{ + font-weight: 700; +} diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FacilityPopup.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FacilityPopup.js index a76db77b141..f7f867dbdb9 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FacilityPopup.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FacilityPopup.js @@ -1,8 +1,8 @@ import React, { useState, Fragment, useEffect } from "react"; import { useTranslation } from "react-i18next"; -import { PopUp, Button, Tab, CheckBox, Card, Toast, SVG,TooltipWrapper } from "@egovernments/digit-ui-components"; +import { PopUp, Button, Tab, CheckBox, Card, Toast, SVG, TooltipWrapper } from "@egovernments/digit-ui-components"; import SearchJurisdiction from "./SearchJurisdiction"; -import { LoaderWithGap, Loader,InfoBannerIcon } from "@egovernments/digit-ui-react-components"; +import { LoaderWithGap, Loader, InfoBannerIcon } from "@egovernments/digit-ui-react-components"; import DataTable from "react-data-table-component"; import AccessibilityPopUp from "./accessbilityPopUP"; import SecurityPopUp from "./securityPopUp"; @@ -159,6 +159,26 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => { }; const mutationForCensusSearch = Digit.Hooks.useCustomAPIMutationHook(censusSearchMutaionConfig); + const reqCriteria = { + url: `/plan-service/plan/facility/_search`, + params: {}, + body: { + PlanFacilitySearchCriteria: { + "tenantId": Digit.ULBService.getCurrentTenantId(), + "planConfigurationId": details.planConfigurationId, + "facilityId": details.facilityId, + + }, + }, + config: { + select: (data) => data, + }, + }; + + + const { isLoading:iskpiDataLoading, data: latestKpiData, refetch, revalidate } = Digit.Hooks.useCustomAPIHook(reqCriteria); + + const censusSearch = async (data) => { @@ -208,12 +228,12 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => { } useEffect(() => { - if (isLoadingPlanEmployee || isLoadingCampaign || isProcessLoading) { + if (isLoadingPlanEmployee || isLoadingCampaign || isProcessLoading || iskpiDataLoading) { setLoader(true); } else { setLoader(false); } - }, [isLoadingPlanEmployee, isLoadingCampaign, isProcessLoading]); + }, [isLoadingPlanEmployee, isLoadingCampaign, isProcessLoading,iskpiDataLoading]); const handleRowSelect = (event) => { // Extract the IDs of all selected rows @@ -340,7 +360,8 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => { await mutationForPlanFacilitySearch.mutate( {}, { - onSuccess: async (result) => { + onSuccess: async (result) => { + refetch(); updateDetails(result?.PlanFacility?.[0]); }, onError: async (result) => { @@ -417,24 +438,16 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => { setKpiParams([ { key: "facilityName", value: details?.additionalDetails?.facilityName || t("NA") }, { key: "facilityType", value: details?.additionalDetails?.facilityType || t("NA") }, - { key: "facilityStatus", value: details?.additionalDetails?.facilityStatus || t("NA")}, + { key: "facilityStatus", value: details?.additionalDetails?.facilityStatus || t("NA") }, { key: "capacity", value: details?.additionalDetails?.capacity || t("NA") }, - { key: "servingPopulation", value: details?.additionalDetails?.servingPopulation || t("NA") }, + { key: "servingPopulation", value: latestKpiData?.PlanFacility[0]?.additionalDetails?.servingPopulation || t("NA")}, { key: "fixedPost", value: details?.additionalDetails?.fixedPost || t("NA") }, - { key: "residingVillage", value: t(details?.residingBoundary) || t("NA")} + { key: "residingVillage", value: t(details?.residingBoundary) || t("NA") } ]); } - }, [details]); - - const customRenderers = { + }, [details, latestKpiData]); - residingVillage: (value) => ( -

- {t(value)}{" "} - -

- )}; return ( @@ -447,16 +460,16 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => { heading={`${t(`MICROPLAN_ASSIGNMENT_FACILITY`)} ${details?.additionalDetails?.facilityName}`} children={[
- + {iskpiDataLoading? :
{kpiParams.map(({ key, value }) => (
- {customRenderers[key] ? customRenderers[key](value) :

{value}

} +

{value}

{t(`MICROPLAN_${key.toUpperCase()}`)}

))}
-
+
}
- {t("USERTAG_CONFIRM_TO_UNASSIGN_DESC")} -
, - ]} onOverlayClick={() => { setUnassignPopup(false); }} diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js index c944f4492ec..2da47e08392 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js @@ -368,14 +368,10 @@ function UserAccess({ category, setData, nationalRoles }) { {unassignPopup && ( - {t("USERTAG_CONFIRM_TO_UNASSIGN_DESC")} -
, - ]} onOverlayClick={() => { setUnassignPopup(false); }} 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 6fc96906ccf..8e860114e05 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 @@ -172,7 +172,7 @@ const FacilityCatchmentMapping = () => {
{t("MICROPLAN_ASSIGN_CATCHMENT_VILLAGES")}
-
+
{`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`}
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js index 4a9567daafb..b814d54a311 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js @@ -719,7 +719,7 @@ const PlanInbox = () => {
{t(`HCM_MICROPLAN_VALIDATE_AND_APPROVE_MICROPLAN_ESTIMATIONS`)}
-
+
{`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${campaignObject?.campaignName || t("NO_NAME_AVAILABLE")}`}
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js index 7b9f9ecb278..c2d3ecb0e75 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js @@ -547,7 +547,7 @@ const PopInbox = () => {
{t(`VALIDATE_APPROVE_POPULATIONDATA`)}
-
+
{`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`}
diff --git a/health/micro-ui/web/public/index.html b/health/micro-ui/web/public/index.html index 67db78f7312..fc9b836ad53 100644 --- a/health/micro-ui/web/public/index.html +++ b/health/micro-ui/web/public/index.html @@ -10,7 +10,7 @@ - + DIGIT HCM