flowcore-fn 9.2.9 → 9.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,56 @@ import { useRouter } from "next/router";
25
25
 
26
26
  // src/components/workflow/WorkflowMain.jsx
27
27
  import React9, { useState as useState5, useRef as useRef2 } from "react";
28
+ import { useEffect as useEffect3 } from "react";
29
+ import Swal from "sweetalert2";
30
+
31
+ // src/components/Service/ApiEndpointsProvider.js
32
+ var STORAGE_KEY = "FLOWCORE_API_ENDPOINTS";
33
+ var apiEndpoints = null;
34
+ var ApiEndpointsProvider = ({ apiEndpoints: endpoints }) => {
35
+ if (typeof window !== "undefined" && endpoints) {
36
+ apiEndpoints = endpoints;
37
+ sessionStorage.setItem(
38
+ STORAGE_KEY,
39
+ JSON.stringify(endpoints)
40
+ );
41
+ }
42
+ return null;
43
+ };
44
+ var getApiEndpoints = () => {
45
+ if (apiEndpoints) {
46
+ return apiEndpoints;
47
+ }
48
+ if (typeof window !== "undefined") {
49
+ const data = sessionStorage.getItem(STORAGE_KEY);
50
+ if (data) {
51
+ apiEndpoints = JSON.parse(data);
52
+ return apiEndpoints;
53
+ }
54
+ }
55
+ throw new Error(
56
+ "Api Endpoints not initialized. Please render <ApiEndpointsProvider apiEndpoints={ApiEndPoints} /> once before using FlowCore."
57
+ );
58
+ };
59
+ var ApiEndpointsProvider_default = ApiEndpointsProvider;
60
+
61
+ // src/components/Service/ApiServicepackage.js
62
+ var apiService = null;
63
+ var ApiServicepackage = ({ apiService: service }) => {
64
+ if (service) {
65
+ apiService = service;
66
+ }
67
+ return null;
68
+ };
69
+ var getApiService = () => {
70
+ if (apiService) {
71
+ return apiService;
72
+ }
73
+ throw new Error(
74
+ "ApiService not initialized. Please render <ApiServicepackage apiService={ApiService} /> once before using FlowCore."
75
+ );
76
+ };
77
+ var ApiServicepackage_default = ApiServicepackage;
28
78
 
29
79
  // src/components/workflow/SearchBar.jsx
30
80
  import React from "react";
@@ -270,7 +320,7 @@ function DeleteModal({
270
320
 
271
321
  // src/components/workflow/WorkflowTable.jsx
272
322
  import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
273
- function WorkflowTable({ pageSize, searchQuery }) {
323
+ function WorkflowTable({ pageSize, searchQuery, apiData }) {
274
324
  const initialData = [
275
325
  {
276
326
  id: "1",
@@ -381,7 +431,10 @@ function WorkflowTable({ pageSize, searchQuery }) {
381
431
  status: true
382
432
  }
383
433
  ];
384
- const [data, setData] = useState2(initialData);
434
+ const [data, setData] = useState2(apiData || initialData);
435
+ React4.useEffect(() => {
436
+ if (apiData) setData(apiData);
437
+ }, [apiData]);
385
438
  const filteredData = data.filter(
386
439
  (item) => item.name.toLowerCase().includes((searchQuery || "").toLowerCase()) || item.code.toLowerCase().includes((searchQuery || "").toLowerCase())
387
440
  );
@@ -617,10 +670,11 @@ function WorkflowTable({ pageSize, searchQuery }) {
617
670
 
618
671
  // src/components/workflow/AddWorkflowModal.jsx
619
672
  import React5 from "react";
620
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
673
+ import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
621
674
  function AddWorkflowModal({
622
675
  isOpen,
623
- onClose
676
+ onClose,
677
+ workflowTypes = []
624
678
  }) {
625
679
  if (!isOpen) return null;
626
680
  return /* @__PURE__ */ jsxs5("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:p-4", children: [
@@ -650,9 +704,11 @@ function AddWorkflowModal({
650
704
  ] }),
651
705
  /* @__PURE__ */ jsxs5("select", { className: "fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-white fc:text-slate-700 focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-indigo-500/10 focus:fc:fc:border-indigo-500", children: [
652
706
  /* @__PURE__ */ jsx5("option", { value: "", children: "Select workflow type" }),
653
- /* @__PURE__ */ jsx5("option", { value: "petition", children: "Petition" }),
654
- /* @__PURE__ */ jsx5("option", { value: "building", children: "Building Permission" }),
655
- /* @__PURE__ */ jsx5("option", { value: "leave", children: "Leave" })
707
+ workflowTypes.length > 0 ? workflowTypes.map((type) => /* @__PURE__ */ jsx5("option", { value: type.workflowTypeId || type.WorkflowTypeId, children: type.workflowTypeName || type.WorkflowTypeName }, type.workflowTypeId || type.WorkflowTypeId)) : /* @__PURE__ */ jsxs5(Fragment2, { children: [
708
+ /* @__PURE__ */ jsx5("option", { value: "petition", children: "Petition" }),
709
+ /* @__PURE__ */ jsx5("option", { value: "building", children: "Building Permission" }),
710
+ /* @__PURE__ */ jsx5("option", { value: "leave", children: "Leave" })
711
+ ] })
656
712
  ] }),
657
713
  /* @__PURE__ */ jsx5("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Choose the category this workflow belongs to" })
658
714
  ] }),
@@ -946,6 +1002,30 @@ function Workflow() {
946
1002
  const [modalOpen, setModalOpen] = useState5(false);
947
1003
  const [pageSize, setPageSize] = useState5(10);
948
1004
  const [searchQuery, setSearchQuery] = useState5("");
1005
+ const [apiData, setApiData] = useState5([]);
1006
+ const [workflowTypes, setWorkflowTypes] = useState5([]);
1007
+ useEffect3(() => {
1008
+ (async () => {
1009
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
1010
+ try {
1011
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflow) == null ? void 0 : _c.getList;
1012
+ const typeEndpoint = (_f = (_e = (_d = getApiEndpoints()) == null ? void 0 : _d.flowCore) == null ? void 0 : _e.workflowType) == null ? void 0 : _f.getList;
1013
+ if (!endpoint) throw Error("Workflow list endpoint is not configured.");
1014
+ const [result, types] = await Promise.all([getApiService().get(endpoint), typeEndpoint ? getApiService().get(typeEndpoint) : Promise.resolve([])]);
1015
+ const value = ((_g = result == null ? void 0 : result.data) == null ? void 0 : _g.data) || ((_h = result == null ? void 0 : result.data) == null ? void 0 : _h.result) || (result == null ? void 0 : result.data) || result;
1016
+ const rows = Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || [];
1017
+ const typeValue = ((_i = types == null ? void 0 : types.data) == null ? void 0 : _i.data) || ((_j = types == null ? void 0 : types.data) == null ? void 0 : _j.result) || (types == null ? void 0 : types.data) || types;
1018
+ const typeRows = Array.isArray(typeValue) ? typeValue : (typeValue == null ? void 0 : typeValue.items) || (typeValue == null ? void 0 : typeValue.records) || [];
1019
+ setWorkflowTypes(typeRows);
1020
+ setApiData(rows.map((item) => {
1021
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2;
1022
+ return __spreadProps(__spreadValues({}, item), { id: (_b2 = (_a2 = item.id) != null ? _a2 : item.workflowId) != null ? _b2 : item.WorkflowId, name: (_d2 = (_c2 = item.name) != null ? _c2 : item.workflowName) != null ? _d2 : item.WorkflowName, code: (_f2 = (_e2 = item.code) != null ? _e2 : item.workflowCode) != null ? _f2 : item.WorkflowCode, type: (_h2 = (_g2 = item.type) != null ? _g2 : item.workflowTypeName) != null ? _h2 : item.WorkflowTypeName, status: (_j2 = (_i2 = item.status) != null ? _i2 : item.isActive) != null ? _j2 : item.IsActive });
1023
+ }));
1024
+ } catch (error) {
1025
+ await Swal.fire("Error", ((_l = (_k = error == null ? void 0 : error.response) == null ? void 0 : _k.data) == null ? void 0 : _l.message) || (error == null ? void 0 : error.message) || "Unable to load workflows.", "error");
1026
+ }
1027
+ })();
1028
+ }, [refreshKey]);
949
1029
  const tableRef = useRef2(null);
950
1030
  const handleRefresh = () => {
951
1031
  console.log("Table data refreshed!");
@@ -1011,6 +1091,7 @@ function Workflow() {
1011
1091
  /* @__PURE__ */ jsx9("div", { className: "fc:flex-1 fc:overflow-hidden", children: /* @__PURE__ */ jsx9("div", { ref: tableRef, children: /* @__PURE__ */ jsx9(
1012
1092
  WorkflowTable,
1013
1093
  {
1094
+ apiData,
1014
1095
  pageSize,
1015
1096
  searchQuery
1016
1097
  },
@@ -1022,14 +1103,16 @@ function Workflow() {
1022
1103
  AddWorkflowModal,
1023
1104
  {
1024
1105
  isOpen: modalOpen,
1025
- onClose: () => setModalOpen(false)
1106
+ onClose: () => setModalOpen(false),
1107
+ workflowTypes
1026
1108
  }
1027
1109
  )
1028
1110
  ] });
1029
1111
  }
1030
1112
 
1031
1113
  // src/components/workflow-type/WorkflowTypeMains.js
1032
- import React15, { useState as useState9, useRef as useRef3 } from "react";
1114
+ import React15, { useState as useState9, useRef as useRef3, useEffect as useEffect6 } from "react";
1115
+ import Swal3 from "sweetalert2";
1033
1116
 
1034
1117
  // src/components/workflow-type/SearchBar.jsx
1035
1118
  import React10 from "react";
@@ -1056,7 +1139,7 @@ function SearchBar2({
1056
1139
  }
1057
1140
 
1058
1141
  // src/components/workflow-type/WorkflowTypeTable.jsx
1059
- import React13, { useState as useState7, useEffect as useEffect4 } from "react";
1142
+ import React13, { useState as useState7, useEffect as useEffect5 } from "react";
1060
1143
 
1061
1144
  // src/components/workflow-type/DeleteWorkflowType.jsx
1062
1145
  import React11 from "react";
@@ -1096,7 +1179,7 @@ var DeleteWorkflowType = ({
1096
1179
  var DeleteWorkflowType_default = DeleteWorkflowType;
1097
1180
 
1098
1181
  // src/components/workflow-type/EditWorkflowType.jsx
1099
- import React12, { useState as useState6, useEffect as useEffect3 } from "react";
1182
+ import React12, { useState as useState6, useEffect as useEffect4 } from "react";
1100
1183
  import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1101
1184
  var EditWorkflowType = ({
1102
1185
  isOpen,
@@ -1110,7 +1193,7 @@ var EditWorkflowType = ({
1110
1193
  description: "",
1111
1194
  isActive: true
1112
1195
  });
1113
- useEffect3(() => {
1196
+ useEffect4(() => {
1114
1197
  var _a, _b;
1115
1198
  if (selectedData) {
1116
1199
  setFormData({
@@ -1176,7 +1259,11 @@ function WorkflowTypeTable({
1176
1259
  searchQuery = "",
1177
1260
  currentPage,
1178
1261
  setCurrentPage,
1179
- setTotalEntries
1262
+ setTotalEntries,
1263
+ apiData,
1264
+ onUpdate,
1265
+ onDeleteApi,
1266
+ onEdit
1180
1267
  }) {
1181
1268
  const initialData = [{
1182
1269
  workflowTypeId: 1,
@@ -1429,7 +1516,10 @@ function WorkflowTypeTable({
1429
1516
  updatedOn: "2026-01-29",
1430
1517
  updatedBy: "Officer"
1431
1518
  }];
1432
- const [data, setData] = useState7(initialData);
1519
+ const [data, setData] = useState7(apiData || initialData);
1520
+ useEffect5(() => {
1521
+ if (apiData) setData(apiData);
1522
+ }, [apiData]);
1433
1523
  const [sortOrder, setSortOrder] = useState7("asc");
1434
1524
  const [sortKey, setSortKey] = useState7("workflowTypeId");
1435
1525
  const [selectedItem, setSelectedItem] = useState7(null);
@@ -1450,7 +1540,7 @@ function WorkflowTypeTable({
1450
1540
  const query = (searchQuery || "").toLowerCase();
1451
1541
  return item.workflowTypeName.toLowerCase().includes(query) || item.workflowTypeCode.toLowerCase().includes(query) || item.description.toLowerCase().includes(query);
1452
1542
  });
1453
- useEffect4(() => {
1543
+ useEffect5(() => {
1454
1544
  if (setTotalEntries) setTotalEntries(filteredData.length);
1455
1545
  }, [filteredData.length, setTotalEntries]);
1456
1546
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -1460,6 +1550,10 @@ function WorkflowTypeTable({
1460
1550
  length: totalPages
1461
1551
  }, (_, i) => i + 1);
1462
1552
  const handleEdit = (item) => {
1553
+ if (onEdit) {
1554
+ onEdit(item);
1555
+ return;
1556
+ }
1463
1557
  setSelectedItem(item);
1464
1558
  setIsEditOpen(true);
1465
1559
  };
@@ -1468,10 +1562,18 @@ function WorkflowTypeTable({
1468
1562
  setIsDeleteOpen(false);
1469
1563
  setIsDeleteOpen(true);
1470
1564
  };
1471
- const handleConfirmDelete = (itemToDelete) => {
1565
+ const handleConfirmDelete = async (itemToDelete) => {
1566
+ if (onDeleteApi) {
1567
+ await onDeleteApi(itemToDelete);
1568
+ return;
1569
+ }
1472
1570
  setData((prevData) => prevData.filter((i) => i.workflowTypeId !== itemToDelete.workflowTypeId));
1473
1571
  };
1474
- const handleSaveEdit = (updatedItem) => {
1572
+ const handleSaveEdit = async (updatedItem) => {
1573
+ if (onUpdate) {
1574
+ await onUpdate(updatedItem);
1575
+ return;
1576
+ }
1475
1577
  setData((prevData) => prevData.map((item) => item.workflowTypeId === updatedItem.workflowTypeId ? updatedItem : item));
1476
1578
  };
1477
1579
  return /* @__PURE__ */ jsxs12("div", { className: "fc:space-y-5", children: [
@@ -1525,56 +1627,7 @@ function WorkflowTypeTable({
1525
1627
 
1526
1628
  // src/components/workflow-type/AddWorkflowTypeModal.jsx
1527
1629
  import React14, { useState as useState8 } from "react";
1528
-
1529
- // src/components/Service/ApiEndpointsProvider.js
1530
- var STORAGE_KEY = "FLOWCORE_API_ENDPOINTS";
1531
- var apiEndpoints = null;
1532
- var ApiEndpointsProvider = ({ apiEndpoints: endpoints }) => {
1533
- if (typeof window !== "undefined" && endpoints) {
1534
- apiEndpoints = endpoints;
1535
- sessionStorage.setItem(
1536
- STORAGE_KEY,
1537
- JSON.stringify(endpoints)
1538
- );
1539
- }
1540
- return null;
1541
- };
1542
- var getApiEndpoints = () => {
1543
- if (apiEndpoints) {
1544
- return apiEndpoints;
1545
- }
1546
- if (typeof window !== "undefined") {
1547
- const data = sessionStorage.getItem(STORAGE_KEY);
1548
- if (data) {
1549
- apiEndpoints = JSON.parse(data);
1550
- return apiEndpoints;
1551
- }
1552
- }
1553
- throw new Error(
1554
- "Api Endpoints not initialized. Please render <ApiEndpointsProvider apiEndpoints={ApiEndPoints} /> once before using FlowCore."
1555
- );
1556
- };
1557
- var ApiEndpointsProvider_default = ApiEndpointsProvider;
1558
-
1559
- // src/components/Service/ApiServicepackage.js
1560
- var apiService = null;
1561
- var ApiServicepackage = ({ apiService: service }) => {
1562
- if (service) {
1563
- apiService = service;
1564
- }
1565
- return null;
1566
- };
1567
- var getApiService = () => {
1568
- if (apiService) {
1569
- return apiService;
1570
- }
1571
- throw new Error(
1572
- "ApiService not initialized. Please render <ApiServicepackage apiService={ApiService} /> once before using FlowCore."
1573
- );
1574
- };
1575
- var ApiServicepackage_default = ApiServicepackage;
1576
-
1577
- // src/components/workflow-type/AddWorkflowTypeModal.jsx
1630
+ import Swal2 from "sweetalert2";
1578
1631
  import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1579
1632
  var initialFormData = {
1580
1633
  workflowTypeCode: "",
@@ -1620,7 +1673,7 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1620
1673
  setIsSubmitting(true);
1621
1674
  setSubmitError("");
1622
1675
  const endpoints = getApiEndpoints();
1623
- const endpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.workflow) == null ? void 0 : _b.createWorkflowList;
1676
+ const endpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.workflowType) == null ? void 0 : _b.create;
1624
1677
  if (!endpoint) throw new Error("Create workflow type endpoint is not configured.");
1625
1678
  const response = await getApiService().post(endpoint, payload);
1626
1679
  await (onSave == null ? void 0 : onSave((_c = response == null ? void 0 : response.data) != null ? _c : response));
@@ -1628,9 +1681,9 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1628
1681
  setErrors({});
1629
1682
  onClose();
1630
1683
  } catch (error) {
1631
- setSubmitError(
1632
- ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to create workflow type. Please try again."
1633
- );
1684
+ const message = ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to create workflow type. Please try again.";
1685
+ setSubmitError(message);
1686
+ await Swal2.fire("Error", message, "error");
1634
1687
  } finally {
1635
1688
  setIsSubmitting(false);
1636
1689
  }
@@ -1683,6 +1736,23 @@ function WorkflowTypeMains() {
1683
1736
  console.log("Table data refreshed!");
1684
1737
  setRefreshKey((prev) => prev + 1);
1685
1738
  };
1739
+ const handleUpdateApi = async (item) => {
1740
+ var _a, _b, _c, _d, _e;
1741
+ try {
1742
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflowType) == null ? void 0 : _c.update;
1743
+ if (!endpoint) throw new Error("Workflow type update endpoint is not configured.");
1744
+ await getApiService().put(endpoint, { workflowTypeId: item.workflowTypeId, workflowTypeCode: item.workflowTypeCode.trim().toUpperCase(), workflowTypeName: item.workflowTypeName.trim(), description: (item.description || "").trim(), isActive: Boolean(item.isActive), updatedBy: item.updatedBy || item.createdBy || "System" });
1745
+ await Swal3.fire("Success", "Workflow type updated successfully.", "success");
1746
+ handleRefresh();
1747
+ return true;
1748
+ } catch (error) {
1749
+ await Swal3.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to update workflow type.", "error");
1750
+ return false;
1751
+ }
1752
+ };
1753
+ const handleDeleteApi = async (item) => {
1754
+ return handleUpdateApi(__spreadProps(__spreadValues({}, item), { isActive: false }));
1755
+ };
1686
1756
  const tableRef = useRef3(null);
1687
1757
  const [modalOpen, setModalOpen] = useState9(false);
1688
1758
  const [pageSize, setPageSize] = useState9(10);
@@ -1692,6 +1762,21 @@ function WorkflowTypeMains() {
1692
1762
  const [isEditOpen, setIsEditOpen] = useState9(false);
1693
1763
  const [isDeleteOpen, setIsDeleteOpen] = useState9(false);
1694
1764
  const [selectedItem, setSelectedItem] = useState9(null);
1765
+ const [apiData, setApiData] = useState9([]);
1766
+ useEffect6(() => {
1767
+ (async () => {
1768
+ var _a, _b, _c, _d, _e, _f, _g;
1769
+ try {
1770
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflowType) == null ? void 0 : _c.getList;
1771
+ if (!endpoint) throw new Error("Workflow type list endpoint is not configured.");
1772
+ const result = await getApiService().get(endpoint);
1773
+ const value = ((_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) || ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) || (result == null ? void 0 : result.data) || result;
1774
+ setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
1775
+ } catch (error) {
1776
+ await Swal3.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load workflow types.", "error");
1777
+ }
1778
+ })();
1779
+ }, [refreshkey]);
1695
1780
  const handlePageSizeChange = (e) => {
1696
1781
  setPageSize(Number(e.target.value));
1697
1782
  setCurrentPage(1);
@@ -1736,12 +1821,15 @@ function WorkflowTypeMains() {
1736
1821
  ] })
1737
1822
  ] }),
1738
1823
  /* @__PURE__ */ jsxs14("div", { ref: tableRef, children: [
1739
- /* @__PURE__ */ jsx15(WorkflowTypeTable, { pageSize, searchQuery, currentPage, setCurrentPage, setTotalEntries, onEdit: handleEdit, onDelete: handleDelete }, refreshkey),
1824
+ /* @__PURE__ */ jsx15(WorkflowTypeTable, { apiData, pageSize, searchQuery, currentPage, setCurrentPage, setTotalEntries, onEdit: handleEdit, onUpdate: handleUpdateApi, onDeleteApi: handleDeleteApi }, refreshkey),
1740
1825
  " "
1741
1826
  ] })
1742
1827
  ] }) }),
1743
- /* @__PURE__ */ jsx15(AddWorkflowTypeModal_default, { isOpen: modalOpen, onClose: () => setModalOpen(false) }),
1744
- /* @__PURE__ */ jsx15(EditWorkflowType_default, { isOpen: isEditOpen, onClose: () => setIsEditOpen(false), onSave: handleSaveEdit, selectedData: selectedItem }),
1828
+ /* @__PURE__ */ jsx15(AddWorkflowTypeModal_default, { isOpen: modalOpen, onClose: () => setModalOpen(false), onSave: async () => {
1829
+ await Swal3.fire("Success", "Workflow type created successfully.", "success");
1830
+ handleRefresh();
1831
+ } }),
1832
+ /* @__PURE__ */ jsx15(EditWorkflowType_default, { isOpen: isEditOpen, onClose: () => setIsEditOpen(false), onSave: handleUpdateApi, selectedData: selectedItem }),
1745
1833
  /* @__PURE__ */ jsx15(DeleteWorkflowType_default, { isOpen: isDeleteOpen, onClose: () => setIsDeleteOpen(false), onConfirm: handleConfirmDelete, itemData: selectedItem })
1746
1834
  ] });
1747
1835
  }
@@ -2133,7 +2221,7 @@ function AddWorkflowStepModal({ onClose }) {
2133
2221
  }
2134
2222
 
2135
2223
  // src/components/WorkflowStep/main.js
2136
- import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
2224
+ import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
2137
2225
  var workflowSteps = [{
2138
2226
  workflowStepId: 1,
2139
2227
  workflowId: 1,
@@ -2279,7 +2367,7 @@ function WorkflowStep() {
2279
2367
  direction
2280
2368
  });
2281
2369
  };
2282
- return /* @__PURE__ */ jsxs17(Fragment2, { children: [
2370
+ return /* @__PURE__ */ jsxs17(Fragment3, { children: [
2283
2371
  /* @__PURE__ */ jsxs17("div", { className: "fc:p-5 fc:bg-[#f5f7fb] fc:min-h-screen fc:font-sans fc:text-slate-700 fc:flex fc:flex-col", children: [
2284
2372
  /* @__PURE__ */ jsx18(CommonHeader, { title: "Workflow Step", breadcrumbs: [{
2285
2373
  label: "Dashboard",
@@ -2737,7 +2825,7 @@ function AddWorkTransitionStepModal({ onClose, onSubmit }) {
2737
2825
  }
2738
2826
 
2739
2827
  // src/components/WorkFlowTransition/Transitiontable.js
2740
- import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
2828
+ import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
2741
2829
  var WorkflowTransition = [{
2742
2830
  TransitionId: 1,
2743
2831
  workflowId: 1,
@@ -2833,7 +2921,7 @@ function WorkFlowTransition() {
2833
2921
  direction
2834
2922
  });
2835
2923
  };
2836
- return /* @__PURE__ */ jsxs19(Fragment3, { children: [
2924
+ return /* @__PURE__ */ jsxs19(Fragment4, { children: [
2837
2925
  /* @__PURE__ */ jsxs19("div", { className: "fc:p-5 fc:bg-[#f5f7fb] fc:min-h-screen fc:font-sans fc:text-slate-700 fc:flex fc:flex-col", children: [
2838
2926
  /* @__PURE__ */ jsx20(CommonHeader, { title: "WorkFlow Transition", breadcrumbs: [{
2839
2927
  label: "Dashboard",
@@ -3041,10 +3129,10 @@ function MappingSearchBar({
3041
3129
  }
3042
3130
 
3043
3131
  // src/components/user-hierarchy-node-mapping/userhierarchynodetable.jsx
3044
- import React25, { useState as useState15, useEffect as useEffect6 } from "react";
3132
+ import React25, { useState as useState15, useEffect as useEffect8 } from "react";
3045
3133
 
3046
3134
  // src/components/user-hierarchy-node-mapping/edit-mapping.jsx
3047
- import React23, { useEffect as useEffect5, useState as useState14 } from "react";
3135
+ import React23, { useEffect as useEffect7, useState as useState14 } from "react";
3048
3136
  import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
3049
3137
  function EditUserHierarchyNodeMappingModal({
3050
3138
  isOpen,
@@ -3059,7 +3147,7 @@ function EditUserHierarchyNodeMappingModal({
3059
3147
  effectiveFrom: "",
3060
3148
  effectiveTo: ""
3061
3149
  });
3062
- useEffect5(() => {
3150
+ useEffect7(() => {
3063
3151
  if (selectedMapping) {
3064
3152
  setFormData({
3065
3153
  hierarchyNodeId: selectedMapping.hierarchyNodeId || "",
@@ -3563,7 +3651,7 @@ function UserHierarchyNodeMappingTable({
3563
3651
  const query = (searchQuery || "").toLowerCase();
3564
3652
  return String(item.mappingId).toLowerCase().includes(query) || String(item.externalUserId).toLowerCase().includes(query) || String(item.hierarchyNodeId).toLowerCase().includes(query) || item.roleCode.toLowerCase().includes(query);
3565
3653
  });
3566
- useEffect6(() => {
3654
+ useEffect8(() => {
3567
3655
  if (setTotalEntries) setTotalEntries(filteredData.length);
3568
3656
  }, [filteredData.length, setTotalEntries]);
3569
3657
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -3756,10 +3844,10 @@ function SearchBar3({
3756
3844
  }
3757
3845
 
3758
3846
  // src/components/document-configuration/DocumentConfigurationTable.jsx
3759
- import React30, { useState as useState18, useEffect as useEffect8 } from "react";
3847
+ import React30, { useState as useState18, useEffect as useEffect10 } from "react";
3760
3848
 
3761
3849
  // src/components/document-configuration/Edit.jsx
3762
- import React28, { useState as useState17, useEffect as useEffect7 } from "react";
3850
+ import React28, { useState as useState17, useEffect as useEffect9 } from "react";
3763
3851
  import { jsx as jsx28, jsxs as jsxs27 } from "react/jsx-runtime";
3764
3852
  function EditDocumentConfiguration({
3765
3853
  isOpen,
@@ -3777,7 +3865,7 @@ function EditDocumentConfiguration({
3777
3865
  status: "Active"
3778
3866
  });
3779
3867
  const [errors, setErrors] = useState17({});
3780
- useEffect7(() => {
3868
+ useEffect9(() => {
3781
3869
  if (initialData) {
3782
3870
  const sizeParts = (initialData.maxSize || "10 MB").split(" ");
3783
3871
  setFormData({
@@ -4207,7 +4295,7 @@ function DocumentConfigTable({
4207
4295
  const query = (searchQuery || "").toLowerCase();
4208
4296
  return item.docName.toLowerCase().includes(query) || item.extensions.toLowerCase().includes(query) || item.stepId.toLowerCase().includes(query);
4209
4297
  });
4210
- useEffect8(() => {
4298
+ useEffect10(() => {
4211
4299
  if (setTotalEntries) setTotalEntries(filteredData.length);
4212
4300
  }, [filteredData.length, setTotalEntries]);
4213
4301
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -4628,7 +4716,7 @@ function SearchBar4({
4628
4716
  }
4629
4717
 
4630
4718
  // src/components/audit-log/AuditLogTable.jsx
4631
- import React34, { useState as useState21, useEffect as useEffect9 } from "react";
4719
+ import React34, { useState as useState21, useEffect as useEffect11 } from "react";
4632
4720
  import { jsx as jsx34, jsxs as jsxs33 } from "react/jsx-runtime";
4633
4721
  function AuditLogTable({
4634
4722
  pageSize,
@@ -4856,7 +4944,7 @@ function AuditLogTable({
4856
4944
  const query = (searchQuery || "").toLowerCase();
4857
4945
  return item.logId.toLowerCase().includes(query) || item.user.toLowerCase().includes(query) || item.section.toLowerCase().includes(query) || item.action.toLowerCase().includes(query);
4858
4946
  });
4859
- useEffect9(() => {
4947
+ useEffect11(() => {
4860
4948
  if (setTotalEntries) setTotalEntries(filteredData.length);
4861
4949
  }, [filteredData.length, setTotalEntries]);
4862
4950
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -5144,7 +5232,7 @@ function SearchBar5({
5144
5232
  }
5145
5233
 
5146
5234
  // src/components/movement-history/MovementHistoryTable.jsx
5147
- import React38, { useState as useState24, useEffect as useEffect10 } from "react";
5235
+ import React38, { useState as useState24, useEffect as useEffect12 } from "react";
5148
5236
  import { jsx as jsx38, jsxs as jsxs37 } from "react/jsx-runtime";
5149
5237
  function MovementHistoryTable({
5150
5238
  pageSize,
@@ -5372,7 +5460,7 @@ function MovementHistoryTable({
5372
5460
  const query = (searchQuery || "").toLowerCase();
5373
5461
  return item.movementHistoryId.toLowerCase().includes(query) || item.name.toLowerCase().includes(query) || item.toStepId.toLowerCase().includes(query);
5374
5462
  });
5375
- useEffect10(() => {
5463
+ useEffect12(() => {
5376
5464
  if (setTotalEntries) setTotalEntries(filteredData.length);
5377
5465
  }, [filteredData.length, setTotalEntries]);
5378
5466
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -5654,7 +5742,7 @@ function SearchBar6({
5654
5742
  }
5655
5743
 
5656
5744
  // src/components/task-permission/Table.js
5657
- import React42, { useState as useState27, useEffect as useEffect11 } from "react";
5745
+ import React42, { useState as useState27, useEffect as useEffect13 } from "react";
5658
5746
  import { jsx as jsx42, jsxs as jsxs41 } from "react/jsx-runtime";
5659
5747
  function Table({
5660
5748
  pageSize,
@@ -5901,7 +5989,7 @@ function Table({
5901
5989
  }
5902
5990
  return item.taskId && item.taskId.toString().toLowerCase().includes(query) || item.role && item.role.toLowerCase().includes(query) || item.taskName && item.taskName.toLowerCase().includes(query) || item.permissionType && item.permissionType.toLowerCase().includes(query);
5903
5991
  });
5904
- useEffect11(() => {
5992
+ useEffect13(() => {
5905
5993
  if (setTotalEntries) setTotalEntries(filteredData.length);
5906
5994
  }, [filteredData.length, setTotalEntries]);
5907
5995
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -6238,7 +6326,7 @@ function SearchBar7({
6238
6326
  }
6239
6327
 
6240
6328
  // src/components/Workflow-Setting/Table.js
6241
- import React46, { useState as useState30, useEffect as useEffect12 } from "react";
6329
+ import React46, { useState as useState30, useEffect as useEffect14 } from "react";
6242
6330
  import { jsx as jsx46, jsxs as jsxs45 } from "react/jsx-runtime";
6243
6331
  function Table2({
6244
6332
  pageSize,
@@ -6485,7 +6573,7 @@ function Table2({
6485
6573
  }
6486
6574
  return item.settingId && item.settingId.toString().toLowerCase().includes(query) || item.moduleName && item.moduleName.toLowerCase().includes(query) || item.executionOrder && item.executionOrder.toString().toLowerCase().includes(query) || item.SLA && item.SLA.toLowerCase().includes(query);
6487
6575
  });
6488
- useEffect12(() => {
6576
+ useEffect14(() => {
6489
6577
  if (setTotalEntries) setTotalEntries(filteredData.length);
6490
6578
  }, [filteredData.length, setTotalEntries]);
6491
6579
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -6761,7 +6849,7 @@ function SearchBar8({
6761
6849
  }
6762
6850
 
6763
6851
  // src/components/notification/Table.js
6764
- import React50, { useState as useState33, useEffect as useEffect13 } from "react";
6852
+ import React50, { useState as useState33, useEffect as useEffect15 } from "react";
6765
6853
  import { jsx as jsx50, jsxs as jsxs49 } from "react/jsx-runtime";
6766
6854
  function Table3({
6767
6855
  pageSize,
@@ -7008,7 +7096,7 @@ function Table3({
7008
7096
  }
7009
7097
  return item.notificationId && item.notificationId.toString().toLowerCase().includes(query) || item.eventTrigger && item.eventTrigger.toLowerCase().includes(query) || item.channelType && item.channelType.toLowerCase().includes(query) || item.recipientGroup && item.recipientGroup.toLowerCase().includes(query);
7010
7098
  });
7011
- useEffect13(() => {
7099
+ useEffect15(() => {
7012
7100
  if (setTotalEntries) setTotalEntries(filteredData.length);
7013
7101
  }, [filteredData.length, setTotalEntries]);
7014
7102
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -7294,10 +7382,10 @@ function TaskInstanceSearchBar({
7294
7382
  }
7295
7383
 
7296
7384
  // src/components/task-instance/taskinstancetable.jsx
7297
- import React56, { useState as useState37, useEffect as useEffect15 } from "react";
7385
+ import React56, { useState as useState37, useEffect as useEffect17 } from "react";
7298
7386
 
7299
7387
  // src/components/task-instance/edit-instance.jsx
7300
- import React54, { useEffect as useEffect14, useState as useState36 } from "react";
7388
+ import React54, { useEffect as useEffect16, useState as useState36 } from "react";
7301
7389
  import { jsx as jsx54, jsxs as jsxs53 } from "react/jsx-runtime";
7302
7390
  function EditTaskInstanceModal({
7303
7391
  isOpen,
@@ -7313,7 +7401,7 @@ function EditTaskInstanceModal({
7313
7401
  escalatedOn: "",
7314
7402
  slaStatus: ""
7315
7403
  });
7316
- useEffect14(() => {
7404
+ useEffect16(() => {
7317
7405
  if (selectedTask) {
7318
7406
  setFormData({
7319
7407
  assignedUserId: selectedTask.assignedUserId || selectedTask.assigned_user_id || "",
@@ -7834,7 +7922,7 @@ function TaskInstanceTable({
7834
7922
  const query = (searchQuery || "").toLowerCase();
7835
7923
  return String(item.taskInstanceId).includes(query) || String(item.fileInstanceId).includes(query) || String(item.workflowStepId).includes(query) || String(item.assignedUserId).includes(query) || item.status.toLowerCase().includes(query);
7836
7924
  });
7837
- useEffect15(() => {
7925
+ useEffect17(() => {
7838
7926
  if (setTotalEntries) setTotalEntries(filteredData.length);
7839
7927
  }, [filteredData.length, setTotalEntries]);
7840
7928
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -8203,7 +8291,7 @@ function CommentSearchBar({
8203
8291
  }
8204
8292
 
8205
8293
  // src/components/comment/commenttable.jsx
8206
- import React60, { useState as useState39, useEffect as useEffect16 } from "react";
8294
+ import React60, { useState as useState39, useEffect as useEffect18 } from "react";
8207
8295
  import { jsx as jsx60, jsxs as jsxs59 } from "react/jsx-runtime";
8208
8296
  function CommentTable({
8209
8297
  pageSize,
@@ -8431,7 +8519,7 @@ function CommentTable({
8431
8519
  const query = (searchQuery || "").toLowerCase();
8432
8520
  return String(item.commentId).toLowerCase().includes(query) || String(item.taskInstanceId).toLowerCase().includes(query) || item.comment.toLowerCase().includes(query) || String(item.commentedBy).toLowerCase().includes(query);
8433
8521
  });
8434
- useEffect16(() => {
8522
+ useEffect18(() => {
8435
8523
  if (setTotalEntries) setTotalEntries(filteredData.length);
8436
8524
  }, [filteredData.length, setTotalEntries]);
8437
8525
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -8766,7 +8854,8 @@ function Comment_main() {
8766
8854
  }
8767
8855
 
8768
8856
  // src/components/hierarchy-node/HierarchyNodeMain.jsx
8769
- import React68, { useState as useState44, useRef as useRef15 } from "react";
8857
+ import React68, { useState as useState44, useRef as useRef15, useEffect as useEffect21 } from "react";
8858
+ import Swal4 from "sweetalert2";
8770
8859
 
8771
8860
  // src/components/hierarchy-node/SearchBar.jsx
8772
8861
  import React63 from "react";
@@ -8805,10 +8894,10 @@ function SearchBar9({ searchQuery, setSearchQuery }) {
8805
8894
  }
8806
8895
 
8807
8896
  // src/components/hierarchy-node/HierarchyTable.jsx
8808
- import React66, { useState as useState43, useEffect as useEffect18 } from "react";
8897
+ import React66, { useState as useState43, useEffect as useEffect20 } from "react";
8809
8898
 
8810
8899
  // src/components/hierarchy-node/AddEditModal.jsx
8811
- import React64, { useEffect as useEffect17, useState as useState42 } from "react";
8900
+ import React64, { useEffect as useEffect19, useState as useState42 } from "react";
8812
8901
  import { jsx as jsx64, jsxs as jsxs63 } from "react/jsx-runtime";
8813
8902
  function AddEditModal2({
8814
8903
  isOpen,
@@ -8826,7 +8915,7 @@ function AddEditModal2({
8826
8915
  externalEntityId: "",
8827
8916
  isActive: true
8828
8917
  });
8829
- useEffect17(() => {
8918
+ useEffect19(() => {
8830
8919
  if (editData) {
8831
8920
  setFormData(editData);
8832
8921
  }
@@ -9030,6 +9119,7 @@ function DeleteModal2({
9030
9119
  // src/components/hierarchy-node/HierarchyTable.jsx
9031
9120
  import { jsx as jsx66, jsxs as jsxs65 } from "react/jsx-runtime";
9032
9121
  function HierarchyTable({
9122
+ apiData,
9033
9123
  pageSize,
9034
9124
  searchQuery
9035
9125
  }) {
@@ -9126,7 +9216,10 @@ function HierarchyTable({
9126
9216
  }];
9127
9217
  const [currentPage, setCurrentPage] = useState43(1);
9128
9218
  ;
9129
- const [data, setData] = useState43(hierarchyData);
9219
+ const [data, setData] = useState43(apiData || hierarchyData);
9220
+ useEffect20(() => {
9221
+ if (apiData) setData(apiData);
9222
+ }, [apiData]);
9130
9223
  const filteredData = data.filter(
9131
9224
  (item) => (item.nodeName || "").toLowerCase().includes((searchQuery || "").toLowerCase()) || (item.nodeType || "").toLowerCase().includes((searchQuery || "").toLowerCase()) || String(item.hierarchyNodeId).includes(searchQuery || "")
9132
9225
  );
@@ -9141,7 +9234,7 @@ function HierarchyTable({
9141
9234
  const [editOpen, setEditOpen] = useState43(false);
9142
9235
  const [deleteOpen, setDeleteOpen] = useState43(false);
9143
9236
  const [selectedNode, setSelectedNode] = useState43(null);
9144
- useEffect18(() => {
9237
+ useEffect20(() => {
9145
9238
  setCurrentPage(1);
9146
9239
  }, [searchQuery, pageSize]);
9147
9240
  const handleSort = (column) => {
@@ -9424,6 +9517,21 @@ function HierarchyNodeMain() {
9424
9517
  const [pageSize, setPageSize] = useState44(5);
9425
9518
  const tableRef = useRef15(null);
9426
9519
  const [searchQuery, setSearchQuery] = useState44("");
9520
+ const [apiData, setApiData] = useState44([]);
9521
+ useEffect21(() => {
9522
+ (async () => {
9523
+ var _a, _b, _c, _d, _e, _f, _g;
9524
+ try {
9525
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.hierarchyNode) == null ? void 0 : _c.getList;
9526
+ if (!endpoint) throw Error("Hierarchy node list endpoint is not configured.");
9527
+ const result = await getApiService().get(endpoint);
9528
+ const value = ((_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) || ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) || (result == null ? void 0 : result.data) || result;
9529
+ setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
9530
+ } catch (error) {
9531
+ await Swal4.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.", "error");
9532
+ }
9533
+ })();
9534
+ }, [modalOpen]);
9427
9535
  const handleRefresh = () => {
9428
9536
  console.log("Refresh clicked");
9429
9537
  };
@@ -9474,6 +9582,7 @@ function HierarchyNodeMain() {
9474
9582
  /* @__PURE__ */ jsx68("div", { ref: tableRef, className: "fc:flex-1 fc:overflow-hidden", children: /* @__PURE__ */ jsx68(
9475
9583
  HierarchyTable,
9476
9584
  {
9585
+ apiData,
9477
9586
  pageSize,
9478
9587
  searchQuery
9479
9588
  }
@@ -10433,7 +10542,7 @@ function AddBusinessEntityModal({ onClose }) {
10433
10542
  }
10434
10543
 
10435
10544
  // src/components/BuisnessEntity/BusinessEntitymain.js
10436
- import { Fragment as Fragment4, jsx as jsx78, jsxs as jsxs77 } from "react/jsx-runtime";
10545
+ import { Fragment as Fragment5, jsx as jsx78, jsxs as jsxs77 } from "react/jsx-runtime";
10437
10546
  var BusinessEntitys = [{
10438
10547
  BusinessEntityId: 1,
10439
10548
  EntityType: "Application",
@@ -10537,7 +10646,7 @@ function BusinessEntity() {
10537
10646
  direction
10538
10647
  });
10539
10648
  };
10540
- return /* @__PURE__ */ jsx78(Fragment4, { children: /* @__PURE__ */ jsxs77("div", { className: "fc:p-5 fc:bg-[#f5f7fb] fc:min-h-screen fc:font-sans fc:text-slate-700 fc:flex fc:flex-col", children: [
10649
+ return /* @__PURE__ */ jsx78(Fragment5, { children: /* @__PURE__ */ jsxs77("div", { className: "fc:p-5 fc:bg-[#f5f7fb] fc:min-h-screen fc:font-sans fc:text-slate-700 fc:flex fc:flex-col", children: [
10541
10650
  /* @__PURE__ */ jsx78(CommonHeader, { title: "Business Entity", breadcrumbs: [{
10542
10651
  label: "Dashboard",
10543
10652
  href: "/dashboard"
@@ -10890,7 +10999,7 @@ function AddFileInstanceModal({ onClose }) {
10890
10999
  }
10891
11000
 
10892
11001
  // src/components/FileInstance/FileInstancemain.js
10893
- import { Fragment as Fragment5, jsx as jsx80, jsxs as jsxs79 } from "react/jsx-runtime";
11002
+ import { Fragment as Fragment6, jsx as jsx80, jsxs as jsxs79 } from "react/jsx-runtime";
10894
11003
  var FileInstances = [{
10895
11004
  FileInstanceId: 1,
10896
11005
  workflowId: 1,
@@ -11046,7 +11155,7 @@ function FileInstance() {
11046
11155
  direction
11047
11156
  });
11048
11157
  };
11049
- return /* @__PURE__ */ jsxs79(Fragment5, { children: [
11158
+ return /* @__PURE__ */ jsxs79(Fragment6, { children: [
11050
11159
  /* @__PURE__ */ jsxs79("div", { className: "fc:p-5 fc:bg-[#f5f7fb] fc:font-sans fc:text-slate-700 fc:flex fc:flex-col", children: [
11051
11160
  /* @__PURE__ */ jsx80(CommonHeader, { title: "File Instance ", breadcrumbs: [{
11052
11161
  label: "Dashboard",
@@ -11163,7 +11272,7 @@ function SearchBar12({
11163
11272
  }
11164
11273
 
11165
11274
  // src/components/assignment-rule/Table.js
11166
- import React82, { useState as useState53, useEffect as useEffect19 } from "react";
11275
+ import React82, { useState as useState53, useEffect as useEffect22 } from "react";
11167
11276
  import { jsx as jsx82, jsxs as jsxs81 } from "react/jsx-runtime";
11168
11277
  function Table4({
11169
11278
  pageSize,
@@ -11329,7 +11438,7 @@ function Table4({
11329
11438
  const query = searchQuery.toLowerCase().trim();
11330
11439
  return item.workflowStepId && item.workflowStepId.toString().toLowerCase().includes(query) || item.assignmentType && item.assignmentType.toLowerCase().includes(query) || item.hierarchyNodeType && item.hierarchyNodeType.toLowerCase().includes(query) || item.dynamicFunctionId && item.dynamicFunctionId.toString().toLowerCase().includes(query);
11331
11440
  });
11332
- useEffect19(() => {
11441
+ useEffect22(() => {
11333
11442
  if (setTotalEntries) setTotalEntries(filteredData.length);
11334
11443
  }, [filteredData.length, setTotalEntries]);
11335
11444
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -11599,7 +11708,7 @@ function AssignmentRuleMain() {
11599
11708
  }
11600
11709
 
11601
11710
  // src/components/Sidebar.jsx
11602
- import { Fragment as Fragment6, jsx as jsx85, jsxs as jsxs84 } from "react/jsx-runtime";
11711
+ import { Fragment as Fragment7, jsx as jsx85, jsxs as jsxs84 } from "react/jsx-runtime";
11603
11712
  var workflowItems = [
11604
11713
  // Menu Name testing // component or page-Use function name
11605
11714
  {
@@ -11786,7 +11895,7 @@ function Sidebar({
11786
11895
  open && /* @__PURE__ */ jsx85("div", { className: "fc:ml-[2px] fc:border-l fc:border-[#E5E9F1] fc:pl-[2px]", children: items.map(renderMenuItem) })
11787
11896
  ] });
11788
11897
  };
11789
- return /* @__PURE__ */ jsxs84(Fragment6, { children: [
11898
+ return /* @__PURE__ */ jsxs84(Fragment7, { children: [
11790
11899
  /* @__PURE__ */ jsxs84("aside", { className: `fc:flex fc:h-screen fc:flex-col fc:overflow-hidden fc:border-r fc:border-[#E5E9F1] fc:bg-white fc:font-sans fc:text-[#273657] fc:transition-all fc:duration-300 fc:ease-in-out ${isOpen ? "fc:w-[285px] fc:min-w-[285px] fc:translate-x-0 fc:opacity-100" : "fc:w-0 fc:min-w-0 fc:-translate-x-full fc:opacity-0"}`, children: [
11791
11900
  /* @__PURE__ */ jsxs84("header", { className: "fc:flex fc:h-[84px] fc:items-center fc:justify-between fc:border-b fc:border-[#EDF0F5] fc:px-[14px]", children: [
11792
11901
  /* @__PURE__ */ jsxs84("div", { className: "fc:flex fc:items-center fc:gap-2", children: [