diff --git a/frontend/micro-ui/web/micro-ui-internals/example/package.json b/frontend/micro-ui/web/micro-ui-internals/example/package.json
index 42e213ce3b..c7ad666d91 100644
--- a/frontend/micro-ui/web/micro-ui-internals/example/package.json
+++ b/frontend/micro-ui/web/micro-ui-internals/example/package.json
@@ -12,7 +12,7 @@
"@egovernments/digit-ui-react-components": "1.5.12",
"@egovernments/digit-ui-components": "0.0.2-beta.47",
"@egovernments/digit-ui-libraries": "1.5.0",
- "@egovernments/digit-ui-module-core": "1.8.2-beta.22",
+ "@egovernments/digit-ui-module-core": "1.8.2-beta.24",
"@egovernments/digit-ui-module-hrms": "1.5.26",
"@egovernments/digit-ui-module-dss": "1.5.52",
"@egovernments/digit-ui-module-attendencemgmt": "0.4.12",
@@ -22,8 +22,8 @@
"@egovernments/digit-ui-module-masters": "0.4.17",
"@egovernments/digit-ui-module-project": "0.4.13",
"@egovernments/digit-ui-module-expenditure": "0.4.14",
- "@egovernments/digit-ui-customisation-mukta": "0.2.9",
- "@egovernments/digit-ui-module-rate-analysis": "0.4.11",
+ "@egovernments/digit-ui-customisation-mukta": "0.2.10",
+ "@egovernments/digit-ui-module-rate-analysis": "0.4.12",
"http-proxy-middleware": "^1.0.5",
"react": "17.0.2",
"react-dom": "17.0.2",
diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/Mukta/package.json b/frontend/micro-ui/web/micro-ui-internals/packages/Mukta/package.json
index 8c4e5b11ca..877527f0a9 100644
--- a/frontend/micro-ui/web/micro-ui-internals/packages/Mukta/package.json
+++ b/frontend/micro-ui/web/micro-ui-internals/packages/Mukta/package.json
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-customisation-mukta",
- "version": "0.2.9",
+ "version": "0.2.10",
"description": "MUKTA Customisation of Works UI",
"main": "dist/index.js",
"module": "dist/index.modern.js",
diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/Mukta/src/Module.js b/frontend/micro-ui/web/micro-ui-internals/packages/Mukta/src/Module.js
index 72866d71ba..ad806ac88f 100644
--- a/frontend/micro-ui/web/micro-ui-internals/packages/Mukta/src/Module.js
+++ b/frontend/micro-ui/web/micro-ui-internals/packages/Mukta/src/Module.js
@@ -8,6 +8,7 @@ import { UICustomizations } from "./configs/UICustomizations";
import HRMSCard from "./components/HRMSCard";
import Captcha from "./components/Captcha";
import DSSCard from "./components/DSSCard";
+import Jurisdictions from "./components/jurisdiction";
const MuktaModule = ({ stateCode, userType, tenants }) => {
const moduleCode = ["Mukta"];
@@ -34,6 +35,7 @@ const componentsToRegister = {
AttendenceMgmtCard:null , // TO HIDE THE Attendance Mgmt CARD IN HOME SCREEN as per MUKTA
HRMSCard, // Overridden the HRMS card as per MUKTA
MeasurementCard:null,
+ Jurisdictions,
DSSCard
};
diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/Mukta/src/components/jurisdiction.js b/frontend/micro-ui/web/micro-ui-internals/packages/Mukta/src/components/jurisdiction.js
new file mode 100644
index 0000000000..2c7ce87060
--- /dev/null
+++ b/frontend/micro-ui/web/micro-ui-internals/packages/Mukta/src/components/jurisdiction.js
@@ -0,0 +1,338 @@
+import { CardLabel, Dropdown, LabelFieldPair, Loader, RemoveableTag ,MultiSelectDropdown} from "@egovernments/digit-ui-react-components";
+import React, { useEffect, useState } from "react";
+// import MultiSelectDropdown from "./Multiselect";
+
+
+const cleanup = (payload) => {
+ if (payload) {
+ return Object.keys(payload).reduce((acc, key) => {
+ if (payload[key] === undefined) {
+ return acc;
+ }
+
+ // todo: find a better way to check object
+ acc[key] = typeof payload[key] === "object" ? cleanup(payload[key]) : payload[key];
+ return acc;
+ }, {});
+ }
+ };
+
+const makeDefaultValues = (sessionFormData) => {
+ return sessionFormData?.Jurisdictions?.map((ele,index)=>{
+ return {
+ key: index,
+ hierarchy: {
+ code: ele?.hierarchy,
+ name: ele?.hierarchy,
+ },
+ boundaryType: { label: ele?.boundaryType, i18text:ele.boundaryType ?`EGOV_LOCATION_BOUNDARYTYPE_${ele.boundaryType?.toUpperCase()}`:null },
+ boundary: { code: ele?.boundary },
+ roles: ele?.roles,
+ }
+ })
+}
+
+const Jurisdictions = ({ t, config, onSelect, userType, formData }) => {
+ console.log("Jurisdictions")
+ const tenantId = Digit.ULBService.getCurrentTenantId();
+ const [inactiveJurisdictions, setInactiveJurisdictions] = useState([]);
+ const { data: data = {}, isLoading } = Digit.Hooks.hrms.useHrmsMDMS(tenantId, "egov-hrms", "HRMSRolesandDesignation") || {};
+
+ const employeeCreateSession = Digit.Hooks.useSessionStorage("NEW_EMPLOYEE_CREATE", {});
+ const [sessionFormData,setSessionFormData, clearSessionFormData] = employeeCreateSession;
+ const isEdit = window.location.href.includes("hrms/edit")
+ const [jurisdictions, setjurisdictions] = useState(
+ !isEdit && sessionFormData?.Jurisdictions?.length>0 ? makeDefaultValues(sessionFormData) : ( formData?.Jurisdictions || [
+ {
+ id: undefined,
+ key: 1,
+ hierarchy: null,
+ boundaryType: null,
+ boundary: null,
+ roles: [],
+ },
+ ])
+ );
+
+ useEffect(() => {
+ const jurisdictionsData = jurisdictions?.map((jurisdiction) => {
+ let res = {
+ id: jurisdiction?.id,
+ hierarchy: jurisdiction?.hierarchy?.code,
+ boundaryType: jurisdiction?.boundaryType?.label,
+ boundary: jurisdiction?.boundary?.code,
+ tenantId: jurisdiction?.boundary?.code,
+ auditDetails: jurisdiction?.auditDetails,
+ };
+ res = cleanup(res);
+ if (jurisdiction?.roles) {
+ res["roles"] = jurisdiction?.roles.map((ele) => {
+ delete ele.description;
+ return ele;
+ });
+ }
+ return res;
+ });
+
+ onSelect(
+ config.key,
+ [...jurisdictionsData, ...inactiveJurisdictions].filter((value) => Object.keys(value).length !== 0)
+ );
+ }, [jurisdictions]);
+
+ const reviseIndexKeys = () => {
+ setjurisdictions((prev) => prev.map((unit, index) => ({ ...unit, key: index })));
+ };
+
+ const handleAddUnit = () => {
+ setjurisdictions((prev) => [
+ ...prev,
+ {
+ key: prev.length + 1,
+ hierarchy: null,
+ boundaryType: null,
+ boundary: null,
+ roles: [],
+ },
+ ]);
+ };
+ const handleRemoveUnit = (unit) => {
+ if (unit.id) {
+ let res = {
+ id: unit?.id,
+ hierarchy: unit?.hierarchy?.code,
+ boundaryType: unit?.boundaryType?.label,
+ boundary: unit?.boundary?.code,
+ tenantId: unit?.boundary?.code,
+ auditDetails: unit?.auditDetails,
+ isdeleted: true,
+ isActive: false,
+ };
+ res = cleanup(res);
+ if (unit?.roles) {
+ res["roles"] = unit?.roles.map((ele) => {
+ delete ele.description;
+ return ele;
+ });
+ }
+ setInactiveJurisdictions([...inactiveJurisdictions, res]);
+ }
+ setjurisdictions((prev) => prev.filter((el) => el.key !== unit.key));
+ if (FormData.errors?.Jurisdictions?.type == unit.key) {
+ clearErrors("Jurisdictions");
+ }
+ reviseIndexKeys();
+ };
+ let hierarchylist = [];
+ let boundaryTypeoption = [];
+ const [focusIndex, setFocusIndex] = useState(-1);
+
+ function gethierarchylistdata() {
+ return data?.MdmsRes?.["common-masters"]["hierarchyType"];
+ }
+
+ function getboundarydata() {
+ return [];
+ }
+
+ function getroledata() {
+ return data?.MdmsRes?.["ACCESSCONTROL-ROLES"].roles.map(role => { return { code: role.code, name: role?.name ? role?.name : " " , labelKey: 'ACCESSCONTROL_ROLES_ROLES_' + role.code } });
+ }
+
+ if (isLoading) {
+ return