Skip to content

Commit

Permalink
Merge branch 'console' into qquickfix
Browse files Browse the repository at this point in the history
  • Loading branch information
NabeelAyubee committed Nov 25, 2024
2 parents 8ad815c + fc83566 commit 7314d8b
Show file tree
Hide file tree
Showing 17 changed files with 247 additions and 73 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.40/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.40",
"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
Expand Up @@ -2677,6 +2677,10 @@ $border-color: rgba(214, 213, 212, 1);
max-width: unset !important;
max-height: 15rem !important;
width: 14rem !important;

.category-selectAll-label{
display: none;
}
}
}

Expand All @@ -2685,12 +2689,12 @@ $border-color: rgba(214, 213, 212, 1);
max-width: unset !important;
}

.digit-card-component.primary.microPlanBulkTable {
/*.digit-card-component.primary.microPlanBulkTable {
overflow: hidden;
>div:first-child {
overflow: auto;
}
}
}*/

.loader-overlay {
position: fixed;
Expand Down Expand Up @@ -2766,11 +2770,6 @@ $border-color: rgba(214, 213, 212, 1);
width: 100%;
}

.rdt_Table{
overflow: scroll !important;
scrollbar-width: none !important;
}

.microPlanBulkTable {
overflow: scroll; /* Enables scrolling */
-ms-overflow-style: none; /* Internet Explorer 10+ */
Expand Down Expand Up @@ -2803,4 +2802,8 @@ $border-color: rgba(214, 213, 212, 1);
width: 30rem;
margin-left: auto;
}
}

.digit-popup-alert-message{
line-height: normal !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,84 @@
.sc-fzXfPc::-webkit-scrollbar-thumb {
background-color: #d6d5d4;
border-radius: 0.563rem;
}

.rdt_TableHead{
z-index: 13 !important;
}

.rdt_TableRow > .rdt_TableCell:first-of-type {
position: sticky;
z-index: 10;
left: 0rem;
background-color: #ffffff;
}

.rdt_TableRow:hover > .rdt_TableCell:first-of-type {
position: sticky;
z-index: 10;
left: 0rem;
background-color: #FBEEE8;
}


.rdt_TableRow.selectedRow > .rdt_TableCell:first-of-type {
position: sticky;
z-index: 10;
left: 0rem;
background-color: #FBEEE8;
}

.rdt_TableHeadRow > .rdt_TableCol:first-of-type {
position: sticky;
z-index: 12;
left: 0rem;
top: 0rem;
background-color: #eeeeee;
}

.microPlanBulkTable{
.selectable{
.rdt_TableRow > .rdt_TableCell:nth-of-type(2) {
position: sticky;
z-index: 10;
left: 48px;
background-color: #ffffff;
}

.rdt_TableRow:hover > .rdt_TableCell:nth-of-type(2) {
position: sticky;
z-index: 10;
left: 48px;
background-color: #FBEEE8;
}


.rdt_TableRow.selectedRow > .rdt_TableCell:nth-of-type(2) {
position: sticky;
z-index: 10;
left: 48px;
background-color: #FBEEE8;
}

.rdt_TableHeadRow > .rdt_TableCol:nth-of-type(2) {
position: sticky;
z-index: 12;
left: 48px;
top: 0rem;
background-color: #eeeeee;
}
}
}

.rdt_TableHeadRow{
justify-content: space-between;
}

.rdt_TableRow{
justify-content: space-between;
}

.village-hierarchy-tooltip-wrapper-class{
position: static;
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const CampaignDetails = ({ onSelect, props: customProps, ...props }) => {
<Header styles={{ marginBottom: "0rem" }}>{t(`HCM_CAMPAIGN_DETAILS_HEADER`)}</Header>
<p className="campaign-details-description">{t(`HCM_CAMPAIGN_DETAILS_DESC`)}</p>
<LabelFieldPair style={{ marginBottom: "0rem" }}>
<div className="campaign-type-label-pair" style={{ minWidth: "17rem" }}>
<div className="campaign-type-label-pair" style={{ minWidth: "20%" }}>
<span className="campaign-type-label">{`${t("HCM_DISEASE_TYPE")}`}</span>
<span className="mandatory-span">*</span>
</div>
Expand All @@ -103,7 +103,7 @@ const CampaignDetails = ({ onSelect, props: customProps, ...props }) => {
/>
</LabelFieldPair>
<LabelFieldPair style={{ marginBottom: "0rem" }}>
<div className="campaign-type-label-pair" style={{ minWidth: "17rem" }}>
<div className="campaign-type-label-pair" style={{ minWidth: "20%" }}>
<span className="campaign-type-label">{`${t("HCM_CAMPAIGN_TYPE_OF")}`}</span>
<span className="mandatory-span">*</span>
</div>
Expand All @@ -121,7 +121,7 @@ const CampaignDetails = ({ onSelect, props: customProps, ...props }) => {
/>
</LabelFieldPair>
<LabelFieldPair style={{ marginBottom: "0rem" }}>
<div className="campaign-type-label-pair" style={{ minWidth: "17rem" }}>
<div className="campaign-type-label-pair" style={{ minWidth: "20%" }}>
<span className="campaign-type-label">{`${t("HCM_CAMPAIGN_RESOURCE_DIST_STRAT")}`}</span>
<span className="mandatory-span">*</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
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";
import { tableCustomStyle } from "./tableCustomStyle";

import { getTableCustomStyle, tableCustomStyle } from "./tableCustomStyle";
import VillageHierarchyTooltipWrapper from "./VillageHierarchyTooltipWrapper";
import { CustomSVG } from "@egovernments/digit-ui-components";
const FacilityPopUp = ({ details, onClose, updateDetails }) => {
const { t } = useTranslation();
const url = Digit.Hooks.useQueryParams();
Expand Down Expand Up @@ -158,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 @@ -207,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 @@ -243,7 +264,14 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
</div>
),
//selector: (row) => t(row.boundaryCode), // Replace with the appropriate field from your data
sortable: false,
sortable: true,
sortFunction: (rowA, rowB) => {
const boundaryCodeA = t(rowA.boundaryCode).toLowerCase();
const boundaryCodeB = t(rowB.boundaryCode).toLowerCase();
if (boundaryCodeA < boundaryCodeB) return -1;
if (boundaryCodeA > boundaryCodeB) return 1;
return 0;
},
},
{
name: t("MP_VILLAGE_ACCESSIBILITY_LEVEL"), // Change to your column type
Expand All @@ -262,7 +290,7 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
{
name: t("MP_FACILITY_TOTALPOPULATION"), // Change to your column type
selector: (row) => row.totalPopulation, // Replace with the appropriate field from your data
sortable: false,
sortable: true,
},
// Add more columns as needed
];
Expand Down Expand Up @@ -332,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 @@ -409,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]);
}, [details, latestKpiData]);

const customRenderers = {

residingVillage: (value) => (
<p className="mp-fac-value">
<span style={{ color: "#0B4B66" }}>{t(value)}</span>{" "}
<VillageHierarchyTooltipWrapper boundaryCode={details?.residingBoundary} placement={"bottom"} />
</p>

)};


return (
Expand All @@ -439,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 Expand Up @@ -525,6 +546,9 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
selectableRowsComponent={CheckBox}
selectableRowsComponentProps={selectProps}
conditionalRowStyles={conditionalRowStyles}
fixedHeader={true}
fixedHeaderScrollHeight={"100vh"}
sortIcon={<CustomSVG.SortUp width={"16px"} height={"16px"} fill={"#0b4b66"} />}
/>
)
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const PopInboxTable = ({ ...props }) => {
{
name: t(`INBOX_VILLAGE`),
cell: (row, index, column, id) => (
<div style={{display:"flex", gap:".5rem"}}>
<div style={{display:"flex", gap:".5rem"}} className="village-tooltip-wrap">
<Button
label={t(`${row.boundaryCode}`)}
onClick={() =>
Expand All @@ -41,7 +41,7 @@ const PopInboxTable = ({ ...props }) => {
size={"medium"}
style={{ minWidth: "unset" }}
/>
<VillageHierarchyTooltipWrapper boundaryCode={row?.boundaryCode}/>
<VillageHierarchyTooltipWrapper boundaryCode={row?.boundaryCode} wrapperClassName={"village-hierarchy-tooltip-wrapper-class"}/>
</div>
),
// selector:(row, index)=>row.boundaryCode,
Expand Down Expand Up @@ -175,6 +175,7 @@ const PopInboxTable = ({ ...props }) => {
<DataTable
columns={columns}
data={props.censusData}
className={!props.disabledAction ? "selectable" : "unselectable"}
selectableRows={!props.disabledAction}
selectableRowsHighlight
noContextMenu
Expand Down
Loading

0 comments on commit 7314d8b

Please sign in to comment.