flowcore-fn 9.2.9 → 9.3.1
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.
- package/dist/pkg-index.js +496 -431
- package/dist/pkg-index.mjs +161 -96
- package/package.json +1 -1
package/dist/pkg-index.mjs
CHANGED
|
@@ -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
|
);
|
|
@@ -946,6 +999,25 @@ function Workflow() {
|
|
|
946
999
|
const [modalOpen, setModalOpen] = useState5(false);
|
|
947
1000
|
const [pageSize, setPageSize] = useState5(10);
|
|
948
1001
|
const [searchQuery, setSearchQuery] = useState5("");
|
|
1002
|
+
const [apiData, setApiData] = useState5([]);
|
|
1003
|
+
useEffect3(() => {
|
|
1004
|
+
(async () => {
|
|
1005
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1006
|
+
try {
|
|
1007
|
+
const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflow) == null ? void 0 : _c.getList;
|
|
1008
|
+
if (!endpoint) throw Error("Workflow list endpoint is not configured.");
|
|
1009
|
+
const result = await getApiService().get(endpoint);
|
|
1010
|
+
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;
|
|
1011
|
+
const rows = Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || [];
|
|
1012
|
+
setApiData(rows.map((item) => {
|
|
1013
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j;
|
|
1014
|
+
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: (_h = (_g2 = item.type) != null ? _g2 : item.workflowTypeName) != null ? _h : item.WorkflowTypeName, status: (_j = (_i = item.status) != null ? _i : item.isActive) != null ? _j : item.IsActive });
|
|
1015
|
+
}));
|
|
1016
|
+
} catch (error) {
|
|
1017
|
+
await Swal.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 workflows.", "error");
|
|
1018
|
+
}
|
|
1019
|
+
})();
|
|
1020
|
+
}, [refreshKey]);
|
|
949
1021
|
const tableRef = useRef2(null);
|
|
950
1022
|
const handleRefresh = () => {
|
|
951
1023
|
console.log("Table data refreshed!");
|
|
@@ -1011,6 +1083,7 @@ function Workflow() {
|
|
|
1011
1083
|
/* @__PURE__ */ jsx9("div", { className: "fc:flex-1 fc:overflow-hidden", children: /* @__PURE__ */ jsx9("div", { ref: tableRef, children: /* @__PURE__ */ jsx9(
|
|
1012
1084
|
WorkflowTable,
|
|
1013
1085
|
{
|
|
1086
|
+
apiData,
|
|
1014
1087
|
pageSize,
|
|
1015
1088
|
searchQuery
|
|
1016
1089
|
},
|
|
@@ -1029,7 +1102,8 @@ function Workflow() {
|
|
|
1029
1102
|
}
|
|
1030
1103
|
|
|
1031
1104
|
// src/components/workflow-type/WorkflowTypeMains.js
|
|
1032
|
-
import React15, { useState as useState9, useRef as useRef3 } from "react";
|
|
1105
|
+
import React15, { useState as useState9, useRef as useRef3, useEffect as useEffect6 } from "react";
|
|
1106
|
+
import Swal3 from "sweetalert2";
|
|
1033
1107
|
|
|
1034
1108
|
// src/components/workflow-type/SearchBar.jsx
|
|
1035
1109
|
import React10 from "react";
|
|
@@ -1056,7 +1130,7 @@ function SearchBar2({
|
|
|
1056
1130
|
}
|
|
1057
1131
|
|
|
1058
1132
|
// src/components/workflow-type/WorkflowTypeTable.jsx
|
|
1059
|
-
import React13, { useState as useState7, useEffect as
|
|
1133
|
+
import React13, { useState as useState7, useEffect as useEffect5 } from "react";
|
|
1060
1134
|
|
|
1061
1135
|
// src/components/workflow-type/DeleteWorkflowType.jsx
|
|
1062
1136
|
import React11 from "react";
|
|
@@ -1096,7 +1170,7 @@ var DeleteWorkflowType = ({
|
|
|
1096
1170
|
var DeleteWorkflowType_default = DeleteWorkflowType;
|
|
1097
1171
|
|
|
1098
1172
|
// src/components/workflow-type/EditWorkflowType.jsx
|
|
1099
|
-
import React12, { useState as useState6, useEffect as
|
|
1173
|
+
import React12, { useState as useState6, useEffect as useEffect4 } from "react";
|
|
1100
1174
|
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1101
1175
|
var EditWorkflowType = ({
|
|
1102
1176
|
isOpen,
|
|
@@ -1110,7 +1184,7 @@ var EditWorkflowType = ({
|
|
|
1110
1184
|
description: "",
|
|
1111
1185
|
isActive: true
|
|
1112
1186
|
});
|
|
1113
|
-
|
|
1187
|
+
useEffect4(() => {
|
|
1114
1188
|
var _a, _b;
|
|
1115
1189
|
if (selectedData) {
|
|
1116
1190
|
setFormData({
|
|
@@ -1176,7 +1250,8 @@ function WorkflowTypeTable({
|
|
|
1176
1250
|
searchQuery = "",
|
|
1177
1251
|
currentPage,
|
|
1178
1252
|
setCurrentPage,
|
|
1179
|
-
setTotalEntries
|
|
1253
|
+
setTotalEntries,
|
|
1254
|
+
apiData
|
|
1180
1255
|
}) {
|
|
1181
1256
|
const initialData = [{
|
|
1182
1257
|
workflowTypeId: 1,
|
|
@@ -1429,7 +1504,10 @@ function WorkflowTypeTable({
|
|
|
1429
1504
|
updatedOn: "2026-01-29",
|
|
1430
1505
|
updatedBy: "Officer"
|
|
1431
1506
|
}];
|
|
1432
|
-
const [data, setData] = useState7(initialData);
|
|
1507
|
+
const [data, setData] = useState7(apiData || initialData);
|
|
1508
|
+
useEffect5(() => {
|
|
1509
|
+
if (apiData) setData(apiData);
|
|
1510
|
+
}, [apiData]);
|
|
1433
1511
|
const [sortOrder, setSortOrder] = useState7("asc");
|
|
1434
1512
|
const [sortKey, setSortKey] = useState7("workflowTypeId");
|
|
1435
1513
|
const [selectedItem, setSelectedItem] = useState7(null);
|
|
@@ -1450,7 +1528,7 @@ function WorkflowTypeTable({
|
|
|
1450
1528
|
const query = (searchQuery || "").toLowerCase();
|
|
1451
1529
|
return item.workflowTypeName.toLowerCase().includes(query) || item.workflowTypeCode.toLowerCase().includes(query) || item.description.toLowerCase().includes(query);
|
|
1452
1530
|
});
|
|
1453
|
-
|
|
1531
|
+
useEffect5(() => {
|
|
1454
1532
|
if (setTotalEntries) setTotalEntries(filteredData.length);
|
|
1455
1533
|
}, [filteredData.length, setTotalEntries]);
|
|
1456
1534
|
const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
|
|
@@ -1525,56 +1603,7 @@ function WorkflowTypeTable({
|
|
|
1525
1603
|
|
|
1526
1604
|
// src/components/workflow-type/AddWorkflowTypeModal.jsx
|
|
1527
1605
|
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
|
|
1606
|
+
import Swal2 from "sweetalert2";
|
|
1578
1607
|
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1579
1608
|
var initialFormData = {
|
|
1580
1609
|
workflowTypeCode: "",
|
|
@@ -1620,7 +1649,7 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
|
|
|
1620
1649
|
setIsSubmitting(true);
|
|
1621
1650
|
setSubmitError("");
|
|
1622
1651
|
const endpoints = getApiEndpoints();
|
|
1623
|
-
const endpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.
|
|
1652
|
+
const endpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.workflowType) == null ? void 0 : _b.create;
|
|
1624
1653
|
if (!endpoint) throw new Error("Create workflow type endpoint is not configured.");
|
|
1625
1654
|
const response = await getApiService().post(endpoint, payload);
|
|
1626
1655
|
await (onSave == null ? void 0 : onSave((_c = response == null ? void 0 : response.data) != null ? _c : response));
|
|
@@ -1628,9 +1657,9 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
|
|
|
1628
1657
|
setErrors({});
|
|
1629
1658
|
onClose();
|
|
1630
1659
|
} catch (error) {
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
);
|
|
1660
|
+
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.";
|
|
1661
|
+
setSubmitError(message);
|
|
1662
|
+
await Swal2.fire("Error", message, "error");
|
|
1634
1663
|
} finally {
|
|
1635
1664
|
setIsSubmitting(false);
|
|
1636
1665
|
}
|
|
@@ -1692,6 +1721,21 @@ function WorkflowTypeMains() {
|
|
|
1692
1721
|
const [isEditOpen, setIsEditOpen] = useState9(false);
|
|
1693
1722
|
const [isDeleteOpen, setIsDeleteOpen] = useState9(false);
|
|
1694
1723
|
const [selectedItem, setSelectedItem] = useState9(null);
|
|
1724
|
+
const [apiData, setApiData] = useState9([]);
|
|
1725
|
+
useEffect6(() => {
|
|
1726
|
+
(async () => {
|
|
1727
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1728
|
+
try {
|
|
1729
|
+
const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflowType) == null ? void 0 : _c.getList;
|
|
1730
|
+
if (!endpoint) throw new Error("Workflow type list endpoint is not configured.");
|
|
1731
|
+
const result = await getApiService().get(endpoint);
|
|
1732
|
+
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;
|
|
1733
|
+
setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
|
|
1734
|
+
} catch (error) {
|
|
1735
|
+
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");
|
|
1736
|
+
}
|
|
1737
|
+
})();
|
|
1738
|
+
}, [refreshkey]);
|
|
1695
1739
|
const handlePageSizeChange = (e) => {
|
|
1696
1740
|
setPageSize(Number(e.target.value));
|
|
1697
1741
|
setCurrentPage(1);
|
|
@@ -1736,7 +1780,7 @@ function WorkflowTypeMains() {
|
|
|
1736
1780
|
] })
|
|
1737
1781
|
] }),
|
|
1738
1782
|
/* @__PURE__ */ jsxs14("div", { ref: tableRef, children: [
|
|
1739
|
-
/* @__PURE__ */ jsx15(WorkflowTypeTable, { pageSize, searchQuery, currentPage, setCurrentPage, setTotalEntries, onEdit: handleEdit, onDelete: handleDelete }, refreshkey),
|
|
1783
|
+
/* @__PURE__ */ jsx15(WorkflowTypeTable, { apiData, pageSize, searchQuery, currentPage, setCurrentPage, setTotalEntries, onEdit: handleEdit, onDelete: handleDelete }, refreshkey),
|
|
1740
1784
|
" "
|
|
1741
1785
|
] })
|
|
1742
1786
|
] }) }),
|
|
@@ -3041,10 +3085,10 @@ function MappingSearchBar({
|
|
|
3041
3085
|
}
|
|
3042
3086
|
|
|
3043
3087
|
// src/components/user-hierarchy-node-mapping/userhierarchynodetable.jsx
|
|
3044
|
-
import React25, { useState as useState15, useEffect as
|
|
3088
|
+
import React25, { useState as useState15, useEffect as useEffect8 } from "react";
|
|
3045
3089
|
|
|
3046
3090
|
// src/components/user-hierarchy-node-mapping/edit-mapping.jsx
|
|
3047
|
-
import React23, { useEffect as
|
|
3091
|
+
import React23, { useEffect as useEffect7, useState as useState14 } from "react";
|
|
3048
3092
|
import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3049
3093
|
function EditUserHierarchyNodeMappingModal({
|
|
3050
3094
|
isOpen,
|
|
@@ -3059,7 +3103,7 @@ function EditUserHierarchyNodeMappingModal({
|
|
|
3059
3103
|
effectiveFrom: "",
|
|
3060
3104
|
effectiveTo: ""
|
|
3061
3105
|
});
|
|
3062
|
-
|
|
3106
|
+
useEffect7(() => {
|
|
3063
3107
|
if (selectedMapping) {
|
|
3064
3108
|
setFormData({
|
|
3065
3109
|
hierarchyNodeId: selectedMapping.hierarchyNodeId || "",
|
|
@@ -3563,7 +3607,7 @@ function UserHierarchyNodeMappingTable({
|
|
|
3563
3607
|
const query = (searchQuery || "").toLowerCase();
|
|
3564
3608
|
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
3609
|
});
|
|
3566
|
-
|
|
3610
|
+
useEffect8(() => {
|
|
3567
3611
|
if (setTotalEntries) setTotalEntries(filteredData.length);
|
|
3568
3612
|
}, [filteredData.length, setTotalEntries]);
|
|
3569
3613
|
const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
|
|
@@ -3756,10 +3800,10 @@ function SearchBar3({
|
|
|
3756
3800
|
}
|
|
3757
3801
|
|
|
3758
3802
|
// src/components/document-configuration/DocumentConfigurationTable.jsx
|
|
3759
|
-
import React30, { useState as useState18, useEffect as
|
|
3803
|
+
import React30, { useState as useState18, useEffect as useEffect10 } from "react";
|
|
3760
3804
|
|
|
3761
3805
|
// src/components/document-configuration/Edit.jsx
|
|
3762
|
-
import React28, { useState as useState17, useEffect as
|
|
3806
|
+
import React28, { useState as useState17, useEffect as useEffect9 } from "react";
|
|
3763
3807
|
import { jsx as jsx28, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3764
3808
|
function EditDocumentConfiguration({
|
|
3765
3809
|
isOpen,
|
|
@@ -3777,7 +3821,7 @@ function EditDocumentConfiguration({
|
|
|
3777
3821
|
status: "Active"
|
|
3778
3822
|
});
|
|
3779
3823
|
const [errors, setErrors] = useState17({});
|
|
3780
|
-
|
|
3824
|
+
useEffect9(() => {
|
|
3781
3825
|
if (initialData) {
|
|
3782
3826
|
const sizeParts = (initialData.maxSize || "10 MB").split(" ");
|
|
3783
3827
|
setFormData({
|
|
@@ -4207,7 +4251,7 @@ function DocumentConfigTable({
|
|
|
4207
4251
|
const query = (searchQuery || "").toLowerCase();
|
|
4208
4252
|
return item.docName.toLowerCase().includes(query) || item.extensions.toLowerCase().includes(query) || item.stepId.toLowerCase().includes(query);
|
|
4209
4253
|
});
|
|
4210
|
-
|
|
4254
|
+
useEffect10(() => {
|
|
4211
4255
|
if (setTotalEntries) setTotalEntries(filteredData.length);
|
|
4212
4256
|
}, [filteredData.length, setTotalEntries]);
|
|
4213
4257
|
const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
|
|
@@ -4628,7 +4672,7 @@ function SearchBar4({
|
|
|
4628
4672
|
}
|
|
4629
4673
|
|
|
4630
4674
|
// src/components/audit-log/AuditLogTable.jsx
|
|
4631
|
-
import React34, { useState as useState21, useEffect as
|
|
4675
|
+
import React34, { useState as useState21, useEffect as useEffect11 } from "react";
|
|
4632
4676
|
import { jsx as jsx34, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4633
4677
|
function AuditLogTable({
|
|
4634
4678
|
pageSize,
|
|
@@ -4856,7 +4900,7 @@ function AuditLogTable({
|
|
|
4856
4900
|
const query = (searchQuery || "").toLowerCase();
|
|
4857
4901
|
return item.logId.toLowerCase().includes(query) || item.user.toLowerCase().includes(query) || item.section.toLowerCase().includes(query) || item.action.toLowerCase().includes(query);
|
|
4858
4902
|
});
|
|
4859
|
-
|
|
4903
|
+
useEffect11(() => {
|
|
4860
4904
|
if (setTotalEntries) setTotalEntries(filteredData.length);
|
|
4861
4905
|
}, [filteredData.length, setTotalEntries]);
|
|
4862
4906
|
const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
|
|
@@ -5144,7 +5188,7 @@ function SearchBar5({
|
|
|
5144
5188
|
}
|
|
5145
5189
|
|
|
5146
5190
|
// src/components/movement-history/MovementHistoryTable.jsx
|
|
5147
|
-
import React38, { useState as useState24, useEffect as
|
|
5191
|
+
import React38, { useState as useState24, useEffect as useEffect12 } from "react";
|
|
5148
5192
|
import { jsx as jsx38, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5149
5193
|
function MovementHistoryTable({
|
|
5150
5194
|
pageSize,
|
|
@@ -5372,7 +5416,7 @@ function MovementHistoryTable({
|
|
|
5372
5416
|
const query = (searchQuery || "").toLowerCase();
|
|
5373
5417
|
return item.movementHistoryId.toLowerCase().includes(query) || item.name.toLowerCase().includes(query) || item.toStepId.toLowerCase().includes(query);
|
|
5374
5418
|
});
|
|
5375
|
-
|
|
5419
|
+
useEffect12(() => {
|
|
5376
5420
|
if (setTotalEntries) setTotalEntries(filteredData.length);
|
|
5377
5421
|
}, [filteredData.length, setTotalEntries]);
|
|
5378
5422
|
const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
|
|
@@ -5654,7 +5698,7 @@ function SearchBar6({
|
|
|
5654
5698
|
}
|
|
5655
5699
|
|
|
5656
5700
|
// src/components/task-permission/Table.js
|
|
5657
|
-
import React42, { useState as useState27, useEffect as
|
|
5701
|
+
import React42, { useState as useState27, useEffect as useEffect13 } from "react";
|
|
5658
5702
|
import { jsx as jsx42, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
5659
5703
|
function Table({
|
|
5660
5704
|
pageSize,
|
|
@@ -5901,7 +5945,7 @@ function Table({
|
|
|
5901
5945
|
}
|
|
5902
5946
|
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
5947
|
});
|
|
5904
|
-
|
|
5948
|
+
useEffect13(() => {
|
|
5905
5949
|
if (setTotalEntries) setTotalEntries(filteredData.length);
|
|
5906
5950
|
}, [filteredData.length, setTotalEntries]);
|
|
5907
5951
|
const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
|
|
@@ -6238,7 +6282,7 @@ function SearchBar7({
|
|
|
6238
6282
|
}
|
|
6239
6283
|
|
|
6240
6284
|
// src/components/Workflow-Setting/Table.js
|
|
6241
|
-
import React46, { useState as useState30, useEffect as
|
|
6285
|
+
import React46, { useState as useState30, useEffect as useEffect14 } from "react";
|
|
6242
6286
|
import { jsx as jsx46, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
6243
6287
|
function Table2({
|
|
6244
6288
|
pageSize,
|
|
@@ -6485,7 +6529,7 @@ function Table2({
|
|
|
6485
6529
|
}
|
|
6486
6530
|
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
6531
|
});
|
|
6488
|
-
|
|
6532
|
+
useEffect14(() => {
|
|
6489
6533
|
if (setTotalEntries) setTotalEntries(filteredData.length);
|
|
6490
6534
|
}, [filteredData.length, setTotalEntries]);
|
|
6491
6535
|
const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
|
|
@@ -6761,7 +6805,7 @@ function SearchBar8({
|
|
|
6761
6805
|
}
|
|
6762
6806
|
|
|
6763
6807
|
// src/components/notification/Table.js
|
|
6764
|
-
import React50, { useState as useState33, useEffect as
|
|
6808
|
+
import React50, { useState as useState33, useEffect as useEffect15 } from "react";
|
|
6765
6809
|
import { jsx as jsx50, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
6766
6810
|
function Table3({
|
|
6767
6811
|
pageSize,
|
|
@@ -7008,7 +7052,7 @@ function Table3({
|
|
|
7008
7052
|
}
|
|
7009
7053
|
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
7054
|
});
|
|
7011
|
-
|
|
7055
|
+
useEffect15(() => {
|
|
7012
7056
|
if (setTotalEntries) setTotalEntries(filteredData.length);
|
|
7013
7057
|
}, [filteredData.length, setTotalEntries]);
|
|
7014
7058
|
const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
|
|
@@ -7294,10 +7338,10 @@ function TaskInstanceSearchBar({
|
|
|
7294
7338
|
}
|
|
7295
7339
|
|
|
7296
7340
|
// src/components/task-instance/taskinstancetable.jsx
|
|
7297
|
-
import React56, { useState as useState37, useEffect as
|
|
7341
|
+
import React56, { useState as useState37, useEffect as useEffect17 } from "react";
|
|
7298
7342
|
|
|
7299
7343
|
// src/components/task-instance/edit-instance.jsx
|
|
7300
|
-
import React54, { useEffect as
|
|
7344
|
+
import React54, { useEffect as useEffect16, useState as useState36 } from "react";
|
|
7301
7345
|
import { jsx as jsx54, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
7302
7346
|
function EditTaskInstanceModal({
|
|
7303
7347
|
isOpen,
|
|
@@ -7313,7 +7357,7 @@ function EditTaskInstanceModal({
|
|
|
7313
7357
|
escalatedOn: "",
|
|
7314
7358
|
slaStatus: ""
|
|
7315
7359
|
});
|
|
7316
|
-
|
|
7360
|
+
useEffect16(() => {
|
|
7317
7361
|
if (selectedTask) {
|
|
7318
7362
|
setFormData({
|
|
7319
7363
|
assignedUserId: selectedTask.assignedUserId || selectedTask.assigned_user_id || "",
|
|
@@ -7834,7 +7878,7 @@ function TaskInstanceTable({
|
|
|
7834
7878
|
const query = (searchQuery || "").toLowerCase();
|
|
7835
7879
|
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
7880
|
});
|
|
7837
|
-
|
|
7881
|
+
useEffect17(() => {
|
|
7838
7882
|
if (setTotalEntries) setTotalEntries(filteredData.length);
|
|
7839
7883
|
}, [filteredData.length, setTotalEntries]);
|
|
7840
7884
|
const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
|
|
@@ -8203,7 +8247,7 @@ function CommentSearchBar({
|
|
|
8203
8247
|
}
|
|
8204
8248
|
|
|
8205
8249
|
// src/components/comment/commenttable.jsx
|
|
8206
|
-
import React60, { useState as useState39, useEffect as
|
|
8250
|
+
import React60, { useState as useState39, useEffect as useEffect18 } from "react";
|
|
8207
8251
|
import { jsx as jsx60, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
8208
8252
|
function CommentTable({
|
|
8209
8253
|
pageSize,
|
|
@@ -8431,7 +8475,7 @@ function CommentTable({
|
|
|
8431
8475
|
const query = (searchQuery || "").toLowerCase();
|
|
8432
8476
|
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
8477
|
});
|
|
8434
|
-
|
|
8478
|
+
useEffect18(() => {
|
|
8435
8479
|
if (setTotalEntries) setTotalEntries(filteredData.length);
|
|
8436
8480
|
}, [filteredData.length, setTotalEntries]);
|
|
8437
8481
|
const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
|
|
@@ -8766,7 +8810,8 @@ function Comment_main() {
|
|
|
8766
8810
|
}
|
|
8767
8811
|
|
|
8768
8812
|
// src/components/hierarchy-node/HierarchyNodeMain.jsx
|
|
8769
|
-
import React68, { useState as useState44, useRef as useRef15 } from "react";
|
|
8813
|
+
import React68, { useState as useState44, useRef as useRef15, useEffect as useEffect21 } from "react";
|
|
8814
|
+
import Swal4 from "sweetalert2";
|
|
8770
8815
|
|
|
8771
8816
|
// src/components/hierarchy-node/SearchBar.jsx
|
|
8772
8817
|
import React63 from "react";
|
|
@@ -8805,10 +8850,10 @@ function SearchBar9({ searchQuery, setSearchQuery }) {
|
|
|
8805
8850
|
}
|
|
8806
8851
|
|
|
8807
8852
|
// src/components/hierarchy-node/HierarchyTable.jsx
|
|
8808
|
-
import React66, { useState as useState43, useEffect as
|
|
8853
|
+
import React66, { useState as useState43, useEffect as useEffect20 } from "react";
|
|
8809
8854
|
|
|
8810
8855
|
// src/components/hierarchy-node/AddEditModal.jsx
|
|
8811
|
-
import React64, { useEffect as
|
|
8856
|
+
import React64, { useEffect as useEffect19, useState as useState42 } from "react";
|
|
8812
8857
|
import { jsx as jsx64, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
8813
8858
|
function AddEditModal2({
|
|
8814
8859
|
isOpen,
|
|
@@ -8826,7 +8871,7 @@ function AddEditModal2({
|
|
|
8826
8871
|
externalEntityId: "",
|
|
8827
8872
|
isActive: true
|
|
8828
8873
|
});
|
|
8829
|
-
|
|
8874
|
+
useEffect19(() => {
|
|
8830
8875
|
if (editData) {
|
|
8831
8876
|
setFormData(editData);
|
|
8832
8877
|
}
|
|
@@ -9030,6 +9075,7 @@ function DeleteModal2({
|
|
|
9030
9075
|
// src/components/hierarchy-node/HierarchyTable.jsx
|
|
9031
9076
|
import { jsx as jsx66, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
9032
9077
|
function HierarchyTable({
|
|
9078
|
+
apiData,
|
|
9033
9079
|
pageSize,
|
|
9034
9080
|
searchQuery
|
|
9035
9081
|
}) {
|
|
@@ -9126,7 +9172,10 @@ function HierarchyTable({
|
|
|
9126
9172
|
}];
|
|
9127
9173
|
const [currentPage, setCurrentPage] = useState43(1);
|
|
9128
9174
|
;
|
|
9129
|
-
const [data, setData] = useState43(hierarchyData);
|
|
9175
|
+
const [data, setData] = useState43(apiData || hierarchyData);
|
|
9176
|
+
useEffect20(() => {
|
|
9177
|
+
if (apiData) setData(apiData);
|
|
9178
|
+
}, [apiData]);
|
|
9130
9179
|
const filteredData = data.filter(
|
|
9131
9180
|
(item) => (item.nodeName || "").toLowerCase().includes((searchQuery || "").toLowerCase()) || (item.nodeType || "").toLowerCase().includes((searchQuery || "").toLowerCase()) || String(item.hierarchyNodeId).includes(searchQuery || "")
|
|
9132
9181
|
);
|
|
@@ -9141,7 +9190,7 @@ function HierarchyTable({
|
|
|
9141
9190
|
const [editOpen, setEditOpen] = useState43(false);
|
|
9142
9191
|
const [deleteOpen, setDeleteOpen] = useState43(false);
|
|
9143
9192
|
const [selectedNode, setSelectedNode] = useState43(null);
|
|
9144
|
-
|
|
9193
|
+
useEffect20(() => {
|
|
9145
9194
|
setCurrentPage(1);
|
|
9146
9195
|
}, [searchQuery, pageSize]);
|
|
9147
9196
|
const handleSort = (column) => {
|
|
@@ -9424,6 +9473,21 @@ function HierarchyNodeMain() {
|
|
|
9424
9473
|
const [pageSize, setPageSize] = useState44(5);
|
|
9425
9474
|
const tableRef = useRef15(null);
|
|
9426
9475
|
const [searchQuery, setSearchQuery] = useState44("");
|
|
9476
|
+
const [apiData, setApiData] = useState44([]);
|
|
9477
|
+
useEffect21(() => {
|
|
9478
|
+
(async () => {
|
|
9479
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
9480
|
+
try {
|
|
9481
|
+
const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.hierarchyNode) == null ? void 0 : _c.getList;
|
|
9482
|
+
if (!endpoint) throw Error("Hierarchy node list endpoint is not configured.");
|
|
9483
|
+
const result = await getApiService().get(endpoint);
|
|
9484
|
+
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;
|
|
9485
|
+
setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
|
|
9486
|
+
} catch (error) {
|
|
9487
|
+
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");
|
|
9488
|
+
}
|
|
9489
|
+
})();
|
|
9490
|
+
}, [modalOpen]);
|
|
9427
9491
|
const handleRefresh = () => {
|
|
9428
9492
|
console.log("Refresh clicked");
|
|
9429
9493
|
};
|
|
@@ -9474,6 +9538,7 @@ function HierarchyNodeMain() {
|
|
|
9474
9538
|
/* @__PURE__ */ jsx68("div", { ref: tableRef, className: "fc:flex-1 fc:overflow-hidden", children: /* @__PURE__ */ jsx68(
|
|
9475
9539
|
HierarchyTable,
|
|
9476
9540
|
{
|
|
9541
|
+
apiData,
|
|
9477
9542
|
pageSize,
|
|
9478
9543
|
searchQuery
|
|
9479
9544
|
}
|
|
@@ -11163,7 +11228,7 @@ function SearchBar12({
|
|
|
11163
11228
|
}
|
|
11164
11229
|
|
|
11165
11230
|
// src/components/assignment-rule/Table.js
|
|
11166
|
-
import React82, { useState as useState53, useEffect as
|
|
11231
|
+
import React82, { useState as useState53, useEffect as useEffect22 } from "react";
|
|
11167
11232
|
import { jsx as jsx82, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
11168
11233
|
function Table4({
|
|
11169
11234
|
pageSize,
|
|
@@ -11329,7 +11394,7 @@ function Table4({
|
|
|
11329
11394
|
const query = searchQuery.toLowerCase().trim();
|
|
11330
11395
|
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
11396
|
});
|
|
11332
|
-
|
|
11397
|
+
useEffect22(() => {
|
|
11333
11398
|
if (setTotalEntries) setTotalEntries(filteredData.length);
|
|
11334
11399
|
}, [filteredData.length, setTotalEntries]);
|
|
11335
11400
|
const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
|