From 1929fe47e5b79a947c54479cc75f6191b400d09b Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:58:11 +0530 Subject: [PATCH] ISTE-10 Validation added while creating employee --- .../components/pageComponents/jurisdiction.js | 28 ++----------------- .../modules/hrms/src/pages/createEmployee.js | 2 ++ 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js index dda9ea449..79587f625 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js @@ -311,7 +311,7 @@ const Jurisdictions = ({ t, config, onSelect, userType, formData }) => { ); }; -// ------------------------------------------------------------------------------------- + function Jurisdiction({ t, formData, @@ -350,18 +350,6 @@ function Jurisdiction({ return defaultjurisdiction; } - // useEffect(() => { - // selectBoundaryType( - // data?.MdmsRes?.["egov-location"]["TenantBoundary"] - // .filter((ele) => { - // return ele?.hierarchyType?.code == hierarchylist[0]?.code; - // }) - // .map((item) => { - // return { ...item.boundary, i18text: Digit.Utils.locale.convertToLocale(item.boundary.label, "EGOV_LOCATION_BOUNDARYTYPE") }; - // }) - // ); - // }, [jurisdiction?.hierarchy, data?.MdmsRes]); - useEffect(() => { setDivision( divisions?.map((item) => { @@ -371,17 +359,6 @@ function Jurisdiction({ }, [divisions]); const tenant = Digit.ULBService.getCurrentTenantId(); - // useEffect(() => { - // console.log("ssss") - // let cities = userDetails?.roles.map((role) => role.tenantId)?.filter((value, index, array) => array.indexOf(value) === index); - // selectboundary( - // data?.MdmsRes?.tenant?.tenants - // ?.filter((city) => city.code != Digit.ULBService.getStateId() && cities?.includes(city.code)) - // ?.map((city) => { - // return { ...city, i18text: Digit.Utils.locale.getCityLocale(city.code) }; - // }) - // ); - // }, [data]); useEffect(() => { if (Boundary?.length > 0) { @@ -451,7 +428,7 @@ function Jurisdiction({ }); res?.forEach((resData) => { - resData.labelKey = "ACCESSCONTROL_ROLES_ROLES_" + resData.code; + resData.i18text = "ACCESSCONTROL_ROLES_ROLES_" + resData.code; }); if (isEdit && STATE_ADMIN) setJuristictionsData((pre) => pre.map((item) => (item.key === jurisdiction.key ? { ...item, roles: res } : item))); @@ -473,6 +450,7 @@ function Jurisdiction({ [...data].filter((value) => Object.keys(value).length !== 0) ); setjurisdictions((pre) => pre.map((item) => (item.key === jurisdiction.key ? { ...item, roles: res } : item))); + selectedboundary(jurisdiction?.boundary?jurisdiction?.boundary:defaultjurisdiction()); }; const selectDivisionBoundary = (e) => { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js index c259087ef..de6c904a8 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js @@ -112,6 +112,8 @@ const CreateEmployee = () => { formData?.SelectEmployeeGender?.gender.code && formData?.SelectEmployeeName?.employeeName && formData?.SelectEmployeePhoneNumber?.mobileNumber && + formData?.Jurisdictions.length && + formData?.Jurisdictions.filter((juris) => juris?.roles?.length).length > 0 && checkfield && phonecheck && checkMailNameNum(formData)