diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/EmployeeDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/EmployeeDetails.js index bf886caa0..2ed3fa7b1 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/EmployeeDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/EmployeeDetails.js @@ -33,6 +33,8 @@ const Details = () => { const [successData, setsuccessData, clearSuccessData] = Digit.Hooks.useSessionStorage("EMPLOYEE_HRMS_MUTATION_SUCCESS_DATA", false); const isMobile = window.Digit.Utils.browser.isMobile(); const STATE_ADMIN = Digit.UserService.hasAccess(["STATE_ADMIN"]); + const DIVISION_ADMIN = Digit.UserService.hasAccess(["DIV_ADMIN"]); + const { data: mdmsData = {} } = Digit.Hooks.hrms.useHrmsMDMS(tenantId, "egov-hrms", "HRMSRolesandDesignation") || {}; mdmsData?.MdmsRes?.["tenant"]["tenants"]?.map((items) => { @@ -42,7 +44,6 @@ const Details = () => { } }); }); - // console.log(data, "data"); useEffect(() => { setMutationHappened(false); @@ -65,7 +66,7 @@ const Details = () => { window.open(documentLink, "_blank"); }; - const submitAction = (data) => { }; + const submitAction = (data) => {}; useEffect(() => { switch (selectedAction) { @@ -117,14 +118,9 @@ const Details = () => { - - + + + {DIVISION_ADMIN === 1 && } {data?.Employees?.[0]?.isActive == false ? ( @@ -139,8 +135,8 @@ const Details = () => { text={ t( "EGOV_HRMS_DEACTIVATIONREASON_" + - data?.Employees?.[0]?.deactivationDetails?.sort((a, b) => new Date(a.effectiveFrom) - new Date(b.effectiveFrom))[0] - .reasonForDeactivation + data?.Employees?.[0]?.deactivationDetails?.sort((a, b) => new Date(a.effectiveFrom) - new Date(b.effectiveFrom))[0] + .reasonForDeactivation ) || "NA" } /> @@ -183,41 +179,41 @@ const Details = () => { {data?.Employees?.[0]?.jurisdictions?.length > 0 ? data?.Employees?.[0]?.jurisdictions?.map((element, index) => { - return ( - -
- {" "} - {t("HR_JURISDICTION")} {index + 1} -
- {STATE_ADMIN ? ( - - ) : null} - - {!STATE_ADMIN ? ( - ele.tenantId == element?.boundary) - ?.map((ele) => t(`ACCESSCONTROL_ROLES_ROLES_` + ele?.code))} - /> - ) : null} -
- ); - }) + return ( + +
+ {" "} + {t("HR_JURISDICTION")} {index + 1} +
+ {STATE_ADMIN ? ( + + ) : null} + + {!STATE_ADMIN ? ( + ele.tenantId == element?.boundary) + ?.map((ele) => t(`ACCESSCONTROL_ROLES_ROLES_` + ele?.code))} + /> + ) : null} +
+ ); + }) : null} @@ -240,4 +236,4 @@ const Details = () => { ); }; -export default Details; \ No newline at end of file +export default Details;