Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
ISTE-10 Validation added while creating employee ( #781 )
Browse files Browse the repository at this point in the history
ISTE-10 Validation added while creating employee
  • Loading branch information
anilsingha-eGov authored Apr 26, 2024
2 parents 2b9459f + 1929fe4 commit f2ae513
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ const Jurisdictions = ({ t, config, onSelect, userType, formData }) => {
</div>
);
};
// -------------------------------------------------------------------------------------

function Jurisdiction({
t,
formData,
Expand Down Expand Up @@ -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) => {
Expand All @@ -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) {
Expand Down Expand Up @@ -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)));
Expand All @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f2ae513

Please sign in to comment.