Skip to content

Commit

Permalink
Latest KPI values and Heading change (#1883)
Browse files Browse the repository at this point in the history
* 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 <aroranipun1@gmail.com>
  • Loading branch information
abishekTa-egov and nipunarora-eGov authored Nov 23, 2024
1 parent cd3f2b2 commit fc83566
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<title>DIGIT</title>
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.3/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.41/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.1.41/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.1.42/dist/index.css" />

<!-- added below css for hcm-workbench module inclusion-->
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.5.41/dist/index.css" /> -->
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <jagan.kumar@egov.org.in>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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) => (
<p className="mp-fac-value">
<span style={{ color: "#0B4B66" }}>{t(value)}</span>{" "}
<VillageHierarchyTooltipWrapper boundaryCode={details?.residingBoundary} placement={"bottom"} />
</p>

)};


return (
Expand All @@ -447,16 +460,16 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
heading={`${t(`MICROPLAN_ASSIGNMENT_FACILITY`)} ${details?.additionalDetails?.facilityName}`}
children={[
<div className="facilitypopup-serach-results-wrapper">
<Card className="fac-middle-child">
{iskpiDataLoading? <Loader/>:<Card className="fac-middle-child">
<div className="fac-kpi-container">
{kpiParams.map(({ key, value }) => (
<div key={key} className="fac-kpi-card">
{customRenderers[key] ? customRenderers[key](value) : <p className="mp-fac-value">{value}</p>}
<p className="mp-fac-value">{value}</p>
<p className="mp-fac-key">{t(`MICROPLAN_${key.toUpperCase()}`)}</p>
</div>
))}
</div>
</Card>
</Card>}
<div className="facilitypopup-tab-serach-wrapper">
<Tab
activeLink={activeLink.code}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,14 +579,10 @@ function RoleTableComposer({ nationalRoles }) {
{unassignPopup && (
<PopUp
className={"popUpClass"}
type={"default"}
heading={t("USERTAG_CONFIRM_TO_UNASSIGN")}
type={"alert"}
alertHeading={t("USERTAG_CONFIRM_TO_UNASSIGN")}
alertMessage={t("USERTAG_CONFIRM_TO_UNASSIGN_DESC")}
equalWidthButtons={true}
children={[
<div>
<CardText style={{ margin: 0 }}>{t("USERTAG_CONFIRM_TO_UNASSIGN_DESC")}</CardText>
</div>,
]}
onOverlayClick={() => {
setUnassignPopup(false);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,10 @@ function UserAccess({ category, setData, nationalRoles }) {
{unassignPopup && (
<PopUp
className={"popUpClass"}
type={"default"}
heading={t("USERTAG_CONFIRM_TO_UNASSIGN")}
type={"alert"}
alertHeading={t("USERTAG_CONFIRM_TO_UNASSIGN")}
alertMessage={t("USERTAG_CONFIRM_TO_UNASSIGN_DESC")}
equalWidthButtons={true}
children={[
<div>
<CardText style={{ margin: 0 }}>{t("USERTAG_CONFIRM_TO_UNASSIGN_DESC")}</CardText>
</div>,
]}
onOverlayClick={() => {
setUnassignPopup(false);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const FacilityCatchmentMapping = () => {
<div style={{ marginBottom: isRootApprover && data?.TotalCount === 0 && planObject?.status === "CENSUS_DATA_APPROVED" ?"2.5rem" :"0rem"}}>
<Header styles={{ marginBottom: "1rem" }}>{t("MICROPLAN_ASSIGN_CATCHMENT_VILLAGES")}</Header>
<div className="role-summary-sub-heading" style={{marginBottom:"1.5rem"}}>
<div>
<div className="mp-heading-bold">
{`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`}
</div>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ const PlanInbox = () => {
<div>
<Header styles={{marginBottom:"1rem"}} className="pop-inbox-header">{t(`HCM_MICROPLAN_VALIDATE_AND_APPROVE_MICROPLAN_ESTIMATIONS`)}</Header>
<div className="role-summary-sub-heading">
<div>
<div className="mp-heading-bold">
{`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${campaignObject?.campaignName || t("NO_NAME_AVAILABLE")}`}
</div>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ const PopInbox = () => {
<div>
<Header styles={{ marginBottom: "1rem" }} className="pop-inbox-header">{t(`VALIDATE_APPROVE_POPULATIONDATA`)}</Header>
<div className="role-summary-sub-heading">
<div>
<div className="mp-heading-bold">
{`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`}
</div>
<div>
Expand Down
2 changes: 1 addition & 1 deletion health/micro-ui/web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.3/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.41/dist/index.css" />
<!-- added below css for hcm-workbench module inclusion-->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.1.41/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.1.42/dist/index.css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#00bcd1" />
<title>DIGIT HCM</title>
Expand Down

0 comments on commit fc83566

Please sign in to comment.