Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Role being displayed in Pop, Plan and Fac #1854

Merged
merged 39 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3822313
changes localizations
abishekTa-egov Nov 18, 2024
b5f2394
Adding userName and their roles
abishekTa-egov Nov 18, 2024
5ab2a6c
Merge branch 'console' into abi-18-11
abishekTa-egov Nov 18, 2024
ade3ee0
resolved conflict
abishekTa-egov Nov 18, 2024
458205c
css package update
abishekTa-egov Nov 18, 2024
bf6034f
UIcustomization dropdown changes
abishekTa-egov Nov 18, 2024
3d5b770
pop-inbox changes
abishekTa-egov Nov 19, 2024
8f2e7f4
Merge branch 'console' into abi-18-11
abishekTa-egov Nov 19, 2024
1b6d691
package update
abishekTa-egov Nov 19, 2024
19b744a
loc added
abishekTa-egov Nov 19, 2024
8ef6e83
loc changes
abishekTa-egov Nov 19, 2024
9dc0f60
dropdown options changed
abishekTa-egov Nov 19, 2024
67bb03f
UICust making same as in example
abishekTa-egov Nov 19, 2024
51a7dca
UnassignPopup
abishekTa-egov Nov 19, 2024
2066e5d
comments
abishekTa-egov Nov 19, 2024
d51223c
loc
abishekTa-egov Nov 19, 2024
e4945cd
Loader added
abishekTa-egov Nov 19, 2024
ef9b370
changes
abishekTa-egov Nov 19, 2024
41cfcef
Merge branch 'console' into abi-18-11
abishekTa-egov Nov 19, 2024
c108593
changes to roletablecomposer for unassign popup
abishekTa-egov Nov 19, 2024
0a7326b
changes
abishekTa-egov Nov 19, 2024
6643d8b
Facility Catchment
abishekTa-egov Nov 19, 2024
d25b9ed
reverted facility popup
abishekTa-egov Nov 19, 2024
6b1baf2
Changes
abishekTa-egov Nov 19, 2024
6ff4507
KPI Card
abishekTa-egov Nov 20, 2024
f55d10f
Merge branch 'console' into abi-18-11
abishekTa-egov Nov 20, 2024
46bad03
package update
abishekTa-egov Nov 20, 2024
b09ccdf
Facility data keys
abishekTa-egov Nov 20, 2024
067a049
changes according to comments
abishekTa-egov Nov 20, 2024
bfe4a77
Changes
abishekTa-egov Nov 20, 2024
25e154a
rowOn click redirection
abishekTa-egov Nov 20, 2024
c050503
Merge branch 'console' into abi-18-11
nipunarora-eGov Nov 20, 2024
b713318
Dummy Data removed
abishekTa-egov Nov 20, 2024
3bfb19a
removed import
abishekTa-egov Nov 21, 2024
3026ab0
removed for residing boundary
abishekTa-egov Nov 21, 2024
5240361
Merge branch 'console' into abi-18-11
nipunarora-eGov Nov 21, 2024
2414749
removed 5000
abishekTa-egov Nov 21, 2024
dc8860f
Merge branch 'console' into abi-18-11
abishekTa-egov Nov 21, 2024
33c3dd2
package update for css
abishekTa-egov Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/[email protected]/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].37/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].38/dist/index.css" />
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved

<!-- added below css for hcm-workbench module inclusion-->
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" /> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,9 +803,9 @@ export const UICustomizations = {
let options = [];

if (row?.status == "DRAFT") {
options = [{ code: "1", name: "Edit Setup" }];
options = [{ code: "1", name: "MP_ACTIONS_EDIT_SETUP" }];
} else {
options = [{ code: "1", name: "View Summary" }];
options = [{ code: "1", name: "MP_ACTIONS_VIEW_SUMMARY" }];
}

const handleDownload = () => {
Expand Down Expand Up @@ -833,15 +833,15 @@ export const UICustomizations = {
<Dropdown
option={options}
select={(e) => {
if (e.name == "Edit Setup") {
if (e.name == "MP_ACTIONS_EDIT_SETUP") {
window.location.href = `/${window.contextPath}/employee/microplan/setup-microplan?key=${1}&microplanId=${row.id}&campaignId=${row.campaignDetails.id}`;
}
if (e.name == "View Summary") {
if (e.name == "MP_ACTIONS_VIEW_SUMMARY") {
window.location.href = `/${window.contextPath}/employee/microplan/setup-microplan?key=${10}&microplanId=${row.id}&campaignId=${row.campaignDetails.id}&setup-completed=true`;
}
}}
optionKey={"name"}
selected={{ code: "1", name: "Actions" }}
selected={{ code: "1", name: "MP_ACTIONS_FOR_MICROPLAN_SEARCH" }}
/>
)}
</div>
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.37",
"version": "0.1.38",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <[email protected]>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,4 +347,69 @@
text-align: -webkit-center;
gap: 24px;
margin-right: 3rem;
}
}

.role-summary-sub-heading {

color: theme(digitv2.lightTheme.primary-2) !important;
margin-bottom: 0rem;
font-size: 1rem;
display:flex;
justify-content: space-between;




abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved
}

.fac-middle-child {
border: 1px solid #ddd;
border-radius: 0.1rem;
padding: 1rem;
background-color: #FAFAFA;
margin: 1rem 0;
}

.fac-kpi-container {
display: flex;
justify-content: space-between; /* Spread items evenly */
gap: 0rem; /* Add spacing between items */
align-items: center;
}

.fac-kpi-card {
flex: 1; /* Ensure equal width for all items */
text-align: center;
padding: 0.5rem;
}

.fac-kpi-card:last-child {
border-right: none; /* Remove border from the last item */
}

.fac-kpi-card .highlighted {
color: #d9534f; /* Red color for emphasis (like "5500") */
font-weight: bold;
}

.mp-fac-key{
font-family: Roboto, sans-serif; /* Fallback to sans-serif in case Roboto isn't available */
font-size: 1rem; /* 16px */
font-weight: 400; /* Regular weight */

text-align: center; /* Center-align text */
text-underline-position: from-font; /* Preserve font-based underline position */
text-decoration-skip-ink: none; /* Ensure underlines do not skip over glyphs */
}
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved

.mp-fac-value {
font-family: Roboto, sans-serif; /* Fallback to sans-serif in case Roboto isn't available */
font-size: 1.5rem; /* 24px */
font-weight: 700; /* Bold weight */

text-align: center; /* Center-align text */
text-underline-position: from-font; /* Preserve font-based underline position */
text-decoration-skip-ink: none; /* Ensure underlines do not skip over glyphs */
color:#0B4B66;
}

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React, { useState, Fragment, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { PopUp, Button, Tab, CheckBox, Card, Toast, SVG } from "@egovernments/digit-ui-components";
import { PopUp, Button, Tab, CheckBox, Card, Toast, SVG,TooltipWrapper } from "@egovernments/digit-ui-components";
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved
import SearchJurisdiction from "./SearchJurisdiction";
import { LoaderWithGap, Loader } 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 { getTableCustomStyle, tableCustomStyle } from "./tableCustomStyle";
import VillageHierarchyTooltipWrapper from "./VillageHierarchyTooltipWrapper";
import { tableCustomStyle } from "./tableCustomStyle";

const FacilityPopUp = ({ details, onClose, updateDetails }) => {
const { t } = useTranslation();
const url = Digit.Hooks.useQueryParams();
const currentUserUuid = Digit.UserService.getUser().info.uuid;
const tenantId = Digit.ULBService.getCurrentTenantId();
const [facilityAssignedStatus, setFacilityAssignedStatus] = useState(false);
Expand All @@ -31,6 +31,8 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
const [rowsPerPage, setRowsPerPage] = useState(10);
const [disabledAction, setDisabledAction] = useState(false);
const [boundaryData, setBoundaryData] = useState([]);
const VillageHierarchyTooltipWrapper = Digit.ComponentRegistryService.getComponent("VillageHierarchyTooltipWrapper");
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved
const [kpiParams, setKpiParams] = useState([]);
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved
const configNavItem = [
{
code: t(`MICROPLAN_UNASSIGNED_FACILITIES`),
Expand Down Expand Up @@ -68,18 +70,18 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
}, [currentPage, rowsPerPage])

// fetch the process instance for the current microplan to check if we need to disabled actions or not
const { isLoading:isProcessLoading, data: processData, } = Digit.Hooks.useCustomAPIHook({
const { isLoading: isProcessLoading, data: processData, } = Digit.Hooks.useCustomAPIHook({
url: "/egov-workflow-v2/egov-wf/process/_search",
params: {
tenantId: tenantId,
history: true,
businessIds: microplanId,
},
tenantId: tenantId,
history: true,
businessIds: microplanId,
},
config: {
enabled: true,
select: (data) => {
return data?.ProcessInstances;
},
enabled: true,
select: (data) => {
return data?.ProcessInstances;
},
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved
},
});

Expand Down Expand Up @@ -231,7 +233,7 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {

const columns = [
{
name: t("MP_FACILITY_VILLAGE"),
name: t("MP_FACILITY_VILLAGE"),
cell: (row) => (
<div style={{ display: "flex", alignItems: "center", gap: ".5rem" }}>
<span>{t(`${row.boundaryCode}`)}</span>
Expand Down Expand Up @@ -305,12 +307,12 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
onSuccess: async (result) => {
setSelectedRows([]);
updateDetails(newDetails);
if(facilityAssignedStatus){
setShowToast({ key: "success", label: `${ t("UNASSIGNED_SUCESS")} ${details?.additionalDetails?.facilityName}`, transitionTime: 5000 });
if (facilityAssignedStatus) {
setShowToast({ key: "success", label: `${t("UNASSIGNED_SUCESS")} ${details?.additionalDetails?.facilityName}`, transitionTime: 5000 });



}else{
setShowToast({ key: "success", label: `${ t("ASSIGNED_SUCESS")} ${details?.additionalDetails?.facilityName}`, transitionTime: 5000 });
} else {
setShowToast({ key: "success", label: `${t("ASSIGNED_SUCESS")} ${details?.additionalDetails?.facilityName}`, transitionTime: 5000 });
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved
}
},
onError: async (result) => {
Expand Down Expand Up @@ -356,6 +358,31 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
},
];

useEffect(() => {
if (details) {
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: "capacity", value: details?.additionalDetails?.capacity || t("NA") },
{ key: "servingPopulation", value: details?.additionalDetails?.servingPopulation || t("NA") },
{ key: "fixedPost", value: details?.additionalDetails?.fixedPost || t("NA") },
{ key: "residingVillage", value: details?.residingBoundary || t("NA")}
]);
}
}, [details]);

nipunarora-eGov marked this conversation as resolved.
Show resolved Hide resolved
const customRenderers = {

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

)};
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved


return (
<>
{loader ? (
Expand All @@ -366,6 +393,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">
<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-key">{t(`MICROPLAN_${key.toUpperCase()}`)}</p>
</div>
))}
</div>
</Card>
<div className="facilitypopup-tab-serach-wrapper">
<Tab
activeLink={activeLink.code}
Expand Down Expand Up @@ -487,4 +524,4 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
);
};

export default FacilityPopUp;
export default FacilityPopUp;
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ const FormulaConfigWrapper = ({ onSelect, props: customProps }) => {

<div className="card-container" style={{ width: "77vw", marginBottom: "2.5rem" }}>
<FormulaConfiguration
category={ruleConfigurationCategories[formulaInternalKey - 1]?.category}
category={`FORMULA_${ruleConfigurationCategories[formulaInternalKey - 1]?.category}`}
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved
formulas={[...filteredFormulas?.filter((item) => !deletedFormulas?.includes(item.output)), ...customFormula]}
onSelect={onSelect}
customProps={customProps}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,10 @@ const FormulaConfiguration = ({ onSelect, category, customProps, formulas: initi
return (
<>
<Card className="middle-child">
<Header className="uploader-sub-heading">{t(`SUB_HEADING_${category}`)}</Header>
<Header className="uploader-sub-heading">{t(category)}</Header>
{(category==="FORMULA_CAMPAIGN_VEHICLES")? <p className="mp-description">{t(`FORMULA_VEHICLE_DESCRIPTION`)}</p>:
<p className="mp-description">{t(`FORMULA_CONFIGURATION_DESCRIPTION`)}</p>
}
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved
</Card>
<Card>
{filteredFormulas.map((formula, index) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Card, Dropdown, Loader, MultiSelectDropdown, TableMolecule, Toast } from "@egovernments/digit-ui-components";
import { Button, Card, Dropdown, Loader, MultiSelectDropdown, TableMolecule, Toast, CardText,PopUp } from "@egovernments/digit-ui-components";
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved
import React, { Fragment, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import DataTable from "react-data-table-component";
Expand Down Expand Up @@ -60,6 +60,7 @@ function RoleTableComposer({ nationalRoles }) {
const { mutate: planEmployeeCreate } = Digit.Hooks.microplanv1.usePlanEmployeeCreate();
const { mutate: planEmployeeUpdate } = Digit.Hooks.microplanv1.usePlanEmployeeUpdate();
const [isLoading, setIsLoading] = useState(null);
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved
const [unassignPopup, setUnassignPopup] = useState(false); //true when set to rows
const topBoundary = state?.boundaryHierarchy.find((boundary) => boundary.parentBoundaryType === null);
const topBoundaryCode = topBoundary?.boundaryType;
const topBoundaryValue = totalFormData?.BOUNDARY?.boundarySelection?.boundaryData?.[topBoundaryCode]
Expand Down Expand Up @@ -309,14 +310,16 @@ function RoleTableComposer({ nationalRoles }) {
onSuccess: (data) => {
queryClient.invalidateQueries("PLAN_SEARCH_EMPLOYEE_WITH_TAGGING");
refetchHrms();
setIsLoading(false);
setShowToast({ key: "success", label: t("UNASSIGNED_SUCCESSFULLY") });
setIsLoading(false);
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved
},
onError: (error, variables) => {
setIsLoading(false);
setShowToast({ key: "error", label: error?.message ? error.message : t("FAILED_TO_UPDATE_RESOURCE") });
setIsLoading(false);
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved
},
});

setUnassignPopup(false);
nipunarora-eGov marked this conversation as resolved.
Show resolved Hide resolved
};

const columns = [
Expand Down Expand Up @@ -423,7 +426,7 @@ function RoleTableComposer({ nationalRoles }) {
label={isUserAlreadyAssignedActive ? t(`UNASSIGN`) : t(`ASSIGN`)}
icon={isUserAlreadyAssignedActive ? "Close" : "DoubleArrow"}
isSuffix={isUserAlreadyAssignedActive ? false : true}
onClick={(value) => (isUserAlreadyAssignedActive ? handleUpdateAssignEmployee(row) : handleAssignEmployee(row))}
onClick={(value) => (isUserAlreadyAssignedActive ? setUnassignPopup(row) : handleAssignEmployee(row))}
/>
);
},
Expand Down Expand Up @@ -549,6 +552,40 @@ function RoleTableComposer({ nationalRoles }) {
onClose={closeToast}
/>
)}

{unassignPopup && (
<PopUp
className={"popUpClass"}
type={"default"}
heading={t("USERTAG_CONFIRM_TO_UNASSIGN")}
equalWidthButtons={true}
children={[
<div>
<CardText style={{ margin: 0 }}>{t("USERTAG_CONFIRM_TO_UNASSIGN_DESC")}</CardText>
</div>,
]}
onOverlayClick={() => {
setUnassignPopup(false);
}}
footerChildren={[
<Button
type={"button"}
size={"large"}
variation={"primary"}
label={t("YES")}
onClick={() => {
handleUpdateAssignEmployee(unassignPopup);
}}
/>,
<Button type={"button"} size={"large"} variation={"secondary"} label={t("NO")} onClick={() => { setUnassignPopup(false); }} />,
]}
sortFooterChildren={true}
onClose={() => {
setUnassignPopup(false);
}}
></PopUp>
)}
abishekTa-egov marked this conversation as resolved.
Show resolved Hide resolved

</>
);
}
Expand Down
Loading