flowcore-fn 9.2.7 → 9.2.9

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.
@@ -1029,8 +1029,7 @@ function Workflow() {
1029
1029
  }
1030
1030
 
1031
1031
  // src/components/workflow-type/WorkflowTypeMains.js
1032
- import React15, { useCallback, useEffect as useEffect5, useRef as useRef3, useState as useState9 } from "react";
1033
- import Swal2 from "sweetalert2";
1032
+ import React15, { useState as useState9, useRef as useRef3 } from "react";
1034
1033
 
1035
1034
  // src/components/workflow-type/SearchBar.jsx
1036
1035
  import React10 from "react";
@@ -1057,89 +1056,475 @@ function SearchBar2({
1057
1056
  }
1058
1057
 
1059
1058
  // src/components/workflow-type/WorkflowTypeTable.jsx
1060
- import React11, { useEffect as useEffect3, useMemo, useState as useState6 } from "react";
1059
+ import React13, { useState as useState7, useEffect as useEffect4 } from "react";
1060
+
1061
+ // src/components/workflow-type/DeleteWorkflowType.jsx
1062
+ import React11 from "react";
1061
1063
  import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
1062
- function WorkflowTypeTable({ data = [], isLoading, pageSize, searchQuery = "", currentPage, setCurrentPage, setTotalEntries, onEdit, onDelete }) {
1063
- const [sortOrder, setSortOrder] = useState6("asc");
1064
- const [sortKey, setSortKey] = useState6("workflowTypeId");
1064
+ var DeleteWorkflowType = ({
1065
+ isOpen,
1066
+ onClose,
1067
+ onConfirm,
1068
+ itemData
1069
+ }) => {
1070
+ if (!isOpen) return null;
1071
+ return /* @__PURE__ */ jsx11("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:bg-black/40 fc:backdrop-blur-sm fc:p-4 fc:animate-in fc:fade-in fc:duration-200", children: /* @__PURE__ */ jsxs10("div", { className: "fc:relative fc:w-full fc:max-w-md fc:bg-white fc:rounded-3xl fc:shadow-2xl fc:border fc:border-gray-100 fc:overflow-hidden", children: [
1072
+ /* @__PURE__ */ jsx11("button", { type: "button", onClick: onClose, className: "fc:absolute fc:top-4 fc:right-4 fc:z-10 fc:flex fc:items-center fc:justify-center fc:w-8 fc:h-8 fc:rounded-full fc:text-gray-400 hover:fc:fc:text-gray-600 hover:fc:fc:bg-gray-100 fc:transition", children: "\u2715" }),
1073
+ /* @__PURE__ */ jsxs10("div", { className: "fc:p-8 fc:text-center", children: [
1074
+ /* @__PURE__ */ jsx11("div", { className: "fc:mx-auto fc:mb-4 fc:flex fc:h-14 fc:w-14 fc:items-center fc:justify-center fc:rounded-2xl fc:bg-red-50 fc:border fc:border-red-100 fc:text-red-500 fc:shadow-inner", children: /* @__PURE__ */ jsx11("span", { className: "fc:text-2xl", children: "\u26A0\uFE0F" }) }),
1075
+ /* @__PURE__ */ jsx11("h3", { className: "fc:text-xl fc:font-bold fc:text-gray-900 fc:tracking-tight fc:mb-2", children: "Delete Configuration" }),
1076
+ /* @__PURE__ */ jsxs10("p", { className: "fc:text-sm fc:text-gray-500 fc:leading-relaxed fc:px-2 fc:mb-6", children: [
1077
+ "Are you sure you want to delete",
1078
+ " ",
1079
+ /* @__PURE__ */ jsxs10("span", { className: "fc:font-semibold fc:text-gray-900 fc:bg-gray-100 fc:px-2 fc:py-0.5 fc:rounded-md", children: [
1080
+ '"',
1081
+ (itemData == null ? void 0 : itemData.workflowTypeName) || (itemData == null ? void 0 : itemData.WorkflowTypeName) || "this item",
1082
+ '"'
1083
+ ] }),
1084
+ "? This action cannot be undone."
1085
+ ] }),
1086
+ /* @__PURE__ */ jsxs10("div", { className: "fc:flex fc:items-center fc:gap-3", children: [
1087
+ /* @__PURE__ */ jsx11("button", { type: "button", onClick: onClose, className: "fc:w-1/2 fc:py-2.5 fc:px-4 fc:text-sm fc:font-semibold fc:text-gray-700 fc:bg-gray-100 hover:fc:fc:bg-gray-200 fc:rounded-xl fc:transition", children: "Cancel" }),
1088
+ /* @__PURE__ */ jsx11("button", { type: "button", onClick: () => {
1089
+ onConfirm(itemData);
1090
+ onClose();
1091
+ }, className: "fc:w-1/2 fc:py-2.5 fc:px-4 fc:text-sm fc:font-semibold fc:text-white fc:bg-red-600 hover:fc:fc:bg-red-700 fc:rounded-xl fc:shadow-md fc:shadow-red-500/20 fc:transition", children: "Delete" })
1092
+ ] })
1093
+ ] })
1094
+ ] }) });
1095
+ };
1096
+ var DeleteWorkflowType_default = DeleteWorkflowType;
1097
+
1098
+ // src/components/workflow-type/EditWorkflowType.jsx
1099
+ import React12, { useState as useState6, useEffect as useEffect3 } from "react";
1100
+ import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1101
+ var EditWorkflowType = ({
1102
+ isOpen,
1103
+ onClose,
1104
+ onSave,
1105
+ selectedData
1106
+ }) => {
1107
+ const [formData, setFormData] = useState6({
1108
+ workflowTypeCode: "",
1109
+ workflowTypeName: "",
1110
+ description: "",
1111
+ isActive: true
1112
+ });
1113
+ useEffect3(() => {
1114
+ var _a, _b;
1115
+ if (selectedData) {
1116
+ setFormData({
1117
+ workflowTypeCode: selectedData.workflowTypeCode || selectedData.WorkflowTypeCode || "",
1118
+ workflowTypeName: selectedData.workflowTypeName || selectedData.WorkflowTypeName || "",
1119
+ description: selectedData.description || selectedData.Description || "",
1120
+ isActive: (_b = (_a = selectedData.isActive) != null ? _a : selectedData.IsActive) != null ? _b : true
1121
+ });
1122
+ }
1123
+ }, [selectedData]);
1124
+ if (!isOpen) return null;
1125
+ const handleChange = (e) => {
1126
+ const {
1127
+ name,
1128
+ value,
1129
+ type,
1130
+ checked
1131
+ } = e.target;
1132
+ setFormData((prev) => __spreadProps(__spreadValues({}, prev), {
1133
+ [name]: type === "checkbox" ? checked : value
1134
+ }));
1135
+ };
1136
+ const handleSubmit = (e) => {
1137
+ e.preventDefault();
1138
+ onSave(__spreadValues(__spreadValues({}, selectedData), formData));
1139
+ onClose();
1140
+ };
1141
+ return /* @__PURE__ */ jsx12("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:bg-black/40 fc:backdrop-blur-sm fc:p-4 fc:animate-in fc:fade-in fc:duration-200", children: /* @__PURE__ */ jsxs11("div", { className: "fc:relative fc:w-full fc:max-w-md fc:bg-white fc:rounded-3xl fc:shadow-2xl fc:border fc:border-gray-100 fc:overflow-hidden", children: [
1142
+ /* @__PURE__ */ jsxs11("div", { className: "fc:flex fc:items-center fc:justify-between fc:px-6 fc:py-4 fc:border-b fc:border-gray-100", children: [
1143
+ /* @__PURE__ */ jsx12("h3", { className: "fc:text-lg fc:font-bold fc:text-gray-900", children: "Edit Workflow Type" }),
1144
+ /* @__PURE__ */ jsx12("button", { onClick: onClose, className: "fc:text-gray-400 hover:fc:fc:text-gray-600 fc:w-8 fc:h-8 fc:rounded-full fc:flex fc:items-center fc:justify-center fc:transition", children: "\u2715" })
1145
+ ] }),
1146
+ /* @__PURE__ */ jsxs11("form", { onSubmit: handleSubmit, className: "fc:p-6 fc:space-y-4", children: [
1147
+ /* @__PURE__ */ jsxs11("div", { children: [
1148
+ /* @__PURE__ */ jsx12("label", { className: "fc:block fc:text-xs fc:font-semibold fc:text-gray-700 fc:uppercase fc:tracking-wider fc:mb-1", children: "Workflow Type Code" }),
1149
+ /* @__PURE__ */ jsx12("input", { type: "text", name: "workflowTypeCode", value: formData.workflowTypeCode, onChange: handleChange, className: "fc:w-full fc:rounded-xl fc:border fc:border-gray-200 fc:bg-gray-50 fc:px-3.5 fc:py-2 fc:text-sm fc:text-gray-900 focus:fc:fc:bg-white focus:fc:fc:border-blue-500 focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-blue-500/20 fc:transition", required: true })
1150
+ ] }),
1151
+ /* @__PURE__ */ jsxs11("div", { children: [
1152
+ /* @__PURE__ */ jsx12("label", { className: "fc:block fc:text-xs fc:font-semibold fc:text-gray-700 fc:uppercase fc:tracking-wider fc:mb-1", children: "Workflow Type Name" }),
1153
+ /* @__PURE__ */ jsx12("input", { type: "text", name: "workflowTypeName", value: formData.workflowTypeName, onChange: handleChange, className: "fc:w-full fc:rounded-xl fc:border fc:border-gray-200 fc:bg-gray-50 fc:px-3.5 fc:py-2 fc:text-sm fc:text-gray-900 focus:fc:fc:bg-white focus:fc:fc:border-blue-500 focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-blue-500/20 fc:transition", required: true })
1154
+ ] }),
1155
+ /* @__PURE__ */ jsxs11("div", { children: [
1156
+ /* @__PURE__ */ jsx12("label", { className: "fc:block fc:text-xs fc:font-semibold fc:text-gray-700 fc:uppercase fc:tracking-wider fc:mb-1", children: "Description" }),
1157
+ /* @__PURE__ */ jsx12("textarea", { name: "description", value: formData.description, onChange: handleChange, rows: "3", className: "fc:w-full fc:rounded-xl fc:border fc:border-gray-200 fc:bg-gray-50 fc:px-3.5 fc:py-2 fc:text-sm fc:text-gray-900 focus:fc:fc:bg-white focus:fc:fc:border-blue-500 focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-blue-500/20 fc:transition fc:resize-none" })
1158
+ ] }),
1159
+ /* @__PURE__ */ jsxs11("div", { className: "fc:flex fc:items-center fc:pt-1", children: [
1160
+ /* @__PURE__ */ jsx12("input", { type: "checkbox", id: "isActive", name: "isActive", checked: formData.isActive, onChange: handleChange, className: "fc:h-4 fc:w-4 fc:rounded fc:border-gray-300 fc:text-blue-600 focus:fc:fc:ring-blue-500 fc:cursor-pointer" }),
1161
+ /* @__PURE__ */ jsx12("label", { htmlFor: "isActive", className: "fc:ml-2 fc:text-sm fc:font-medium fc:text-gray-700 fc:cursor-pointer", children: "Is Active" })
1162
+ ] }),
1163
+ /* @__PURE__ */ jsxs11("div", { className: "fc:flex fc:items-center fc:justify-end fc:gap-3 fc:pt-4 fc:border-t fc:border-gray-100", children: [
1164
+ /* @__PURE__ */ jsx12("button", { type: "button", onClick: onClose, className: "fc:py-2 fc:px-4 fc:text-sm fc:font-semibold fc:text-gray-700 fc:bg-gray-100 hover:fc:fc:bg-gray-200 fc:rounded-xl fc:transition", children: "Cancel" }),
1165
+ /* @__PURE__ */ jsx12("button", { type: "submit", className: "fc:py-2 fc:px-5 fc:text-sm fc:font-semibold fc:text-white fc:bg-blue-600 hover:fc:fc:bg-blue-700 fc:rounded-xl fc:shadow-md fc:shadow-blue-500/20 fc:transition", children: "Update" })
1166
+ ] })
1167
+ ] })
1168
+ ] }) });
1169
+ };
1170
+ var EditWorkflowType_default = EditWorkflowType;
1171
+
1172
+ // src/components/workflow-type/WorkflowTypeTable.jsx
1173
+ import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1174
+ function WorkflowTypeTable({
1175
+ pageSize,
1176
+ searchQuery = "",
1177
+ currentPage,
1178
+ setCurrentPage,
1179
+ setTotalEntries
1180
+ }) {
1181
+ const initialData = [{
1182
+ workflowTypeId: 1,
1183
+ workflowTypeCode: "PETITION",
1184
+ workflowTypeName: "Citizen Petition",
1185
+ description: "Petition workflow for citizens",
1186
+ isActive: true,
1187
+ createdOn: "2026-01-01",
1188
+ createdBy: "1",
1189
+ updatedOn: "2026-01-05",
1190
+ updatedBy: "Admin"
1191
+ }, {
1192
+ workflowTypeId: 2,
1193
+ workflowTypeCode: "BUILDING",
1194
+ workflowTypeName: "Building Permission",
1195
+ description: "Building approval process",
1196
+ isActive: true,
1197
+ createdOn: "2026-01-01",
1198
+ createdBy: "1",
1199
+ updatedOn: "2026-01-06",
1200
+ updatedBy: "Admin"
1201
+ }, {
1202
+ workflowTypeId: 3,
1203
+ workflowTypeCode: "LEAVE",
1204
+ workflowTypeName: "Leave Application",
1205
+ description: "Employee leave management",
1206
+ isActive: true,
1207
+ createdOn: "2026-01-02",
1208
+ createdBy: "2",
1209
+ updatedOn: "2026-01-07",
1210
+ updatedBy: "HR"
1211
+ }, {
1212
+ workflowTypeId: 4,
1213
+ workflowTypeCode: "GRIEVANCE",
1214
+ workflowTypeName: "Grievance Redressal",
1215
+ description: "Public grievance workflow",
1216
+ isActive: false,
1217
+ createdOn: "2026-01-03",
1218
+ createdBy: "1",
1219
+ updatedOn: "2026-01-08",
1220
+ updatedBy: "Admin"
1221
+ }, {
1222
+ workflowTypeId: 5,
1223
+ workflowTypeCode: "TRADE",
1224
+ workflowTypeName: "Trade License",
1225
+ description: "Trade license issuance",
1226
+ isActive: true,
1227
+ createdOn: "2026-01-04",
1228
+ createdBy: "3",
1229
+ updatedOn: "2026-01-09",
1230
+ updatedBy: "Manager"
1231
+ }, {
1232
+ workflowTypeId: 6,
1233
+ workflowTypeCode: "DOC_VERIFY",
1234
+ workflowTypeName: "Document Verification",
1235
+ description: "Verification of identity documents",
1236
+ isActive: true,
1237
+ createdOn: "2026-01-05",
1238
+ createdBy: "2",
1239
+ updatedOn: "2026-01-10",
1240
+ updatedBy: "Admin"
1241
+ }, {
1242
+ workflowTypeId: 7,
1243
+ workflowTypeCode: "WATER_CONN",
1244
+ workflowTypeName: "Water Connection Approval",
1245
+ description: "New water connection requests",
1246
+ isActive: true,
1247
+ createdOn: "2026-01-05",
1248
+ createdBy: "1",
1249
+ updatedOn: "2026-01-11",
1250
+ updatedBy: "Admin"
1251
+ }, {
1252
+ workflowTypeId: 8,
1253
+ workflowTypeCode: "TAX_ASSESS",
1254
+ workflowTypeName: "Property Tax Assessment",
1255
+ description: "Annual property tax assessment",
1256
+ isActive: false,
1257
+ createdOn: "2026-01-06",
1258
+ createdBy: "4",
1259
+ updatedOn: "2026-01-12",
1260
+ updatedBy: "Officer"
1261
+ }, {
1262
+ workflowTypeId: 9,
1263
+ workflowTypeCode: "VENDOR_REG",
1264
+ workflowTypeName: "Vendor Registration",
1265
+ description: "Registration of new suppliers",
1266
+ isActive: true,
1267
+ createdOn: "2026-01-07",
1268
+ createdBy: "3",
1269
+ updatedOn: "2026-01-13",
1270
+ updatedBy: "Manager"
1271
+ }, {
1272
+ workflowTypeId: 10,
1273
+ workflowTypeCode: "BIRTH_CERT",
1274
+ workflowTypeName: "Birth Certificate Request",
1275
+ description: "Issuance of birth certificate",
1276
+ isActive: true,
1277
+ createdOn: "2026-01-08",
1278
+ createdBy: "1",
1279
+ updatedOn: "2026-01-14",
1280
+ updatedBy: "Admin"
1281
+ }, {
1282
+ workflowTypeId: 11,
1283
+ workflowTypeCode: "DEATH_CERT",
1284
+ workflowTypeName: "Death Certificate Request",
1285
+ description: "Issuance of death certificate",
1286
+ isActive: true,
1287
+ createdOn: "2026-01-08",
1288
+ createdBy: "1",
1289
+ updatedOn: "2026-01-15",
1290
+ updatedBy: "Admin"
1291
+ }, {
1292
+ workflowTypeId: 12,
1293
+ workflowTypeCode: "ROAD_REPAIR",
1294
+ workflowTypeName: "Road Repair Request",
1295
+ description: "PWD road maintenance flow",
1296
+ isActive: true,
1297
+ createdOn: "2026-01-09",
1298
+ createdBy: "5",
1299
+ updatedOn: "2026-01-16",
1300
+ updatedBy: "Engineer"
1301
+ }, {
1302
+ workflowTypeId: 13,
1303
+ workflowTypeCode: "WASTE_MGMT",
1304
+ workflowTypeName: "Waste Collection Issue",
1305
+ description: "Sanitation complaint tracking",
1306
+ isActive: false,
1307
+ createdOn: "2026-01-10",
1308
+ createdBy: "2",
1309
+ updatedOn: "2026-01-17",
1310
+ updatedBy: "Officer"
1311
+ }, {
1312
+ workflowTypeId: 14,
1313
+ workflowTypeCode: "FIRE_NOC",
1314
+ workflowTypeName: "Fire NOC Approval",
1315
+ description: "Safety clearance certificate",
1316
+ isActive: true,
1317
+ createdOn: "2026-01-11",
1318
+ createdBy: "1",
1319
+ updatedOn: "2026-01-18",
1320
+ updatedBy: "Admin"
1321
+ }, {
1322
+ workflowTypeId: 15,
1323
+ workflowTypeCode: "HEALTH_LIC",
1324
+ workflowTypeName: "Health License Approval",
1325
+ description: "Commercial health license",
1326
+ isActive: true,
1327
+ createdOn: "2026-01-12",
1328
+ createdBy: "3",
1329
+ updatedOn: "2026-01-19",
1330
+ updatedBy: "Manager"
1331
+ }, {
1332
+ workflowTypeId: 16,
1333
+ workflowTypeCode: "ADV_PERMIT",
1334
+ workflowTypeName: "Advertisement Board Perm",
1335
+ description: "Hoarding and billboard permit",
1336
+ isActive: true,
1337
+ createdOn: "2026-01-13",
1338
+ createdBy: "4",
1339
+ updatedOn: "2026-01-20",
1340
+ updatedBy: "Officer"
1341
+ }, {
1342
+ workflowTypeId: 17,
1343
+ workflowTypeCode: "MARRIAGE_REG",
1344
+ workflowTypeName: "Marriage Registration",
1345
+ description: "Legal marriage certificate flow",
1346
+ isActive: true,
1347
+ createdOn: "2026-01-14",
1348
+ createdBy: "1",
1349
+ updatedOn: "2026-01-21",
1350
+ updatedBy: "Admin"
1351
+ }, {
1352
+ workflowTypeId: 18,
1353
+ workflowTypeCode: "RTI_APP",
1354
+ workflowTypeName: "RTI Application Flow",
1355
+ description: "Right to information processing",
1356
+ isActive: true,
1357
+ createdOn: "2026-01-15",
1358
+ createdBy: "2",
1359
+ updatedOn: "2026-01-22",
1360
+ updatedBy: "Officer"
1361
+ }, {
1362
+ workflowTypeId: 19,
1363
+ workflowTypeCode: "CONTRACTOR",
1364
+ workflowTypeName: "Contractor Empanelment",
1365
+ description: "Procurement contractor onboarding",
1366
+ isActive: true,
1367
+ createdOn: "2026-01-16",
1368
+ createdBy: "3",
1369
+ updatedOn: "2026-01-23",
1370
+ updatedBy: "Manager"
1371
+ }, {
1372
+ workflowTypeId: 20,
1373
+ workflowTypeCode: "STREET_LIGHT",
1374
+ workflowTypeName: "Streetlight Maintenance",
1375
+ description: "Electrical infrastructure issue",
1376
+ isActive: true,
1377
+ createdOn: "2026-01-17",
1378
+ createdBy: "5",
1379
+ updatedOn: "2026-01-24",
1380
+ updatedBy: "Engineer"
1381
+ }, {
1382
+ workflowTypeId: 21,
1383
+ workflowTypeCode: "PARK_BOOKING",
1384
+ workflowTypeName: "Park Booking Approval",
1385
+ description: "Public event park reservation",
1386
+ isActive: false,
1387
+ createdOn: "2026-01-18",
1388
+ createdBy: "2",
1389
+ updatedOn: "2026-01-25",
1390
+ updatedBy: "Admin"
1391
+ }, {
1392
+ workflowTypeId: 22,
1393
+ workflowTypeCode: "DRAINAGE",
1394
+ workflowTypeName: "Drainage Issue Escalation",
1395
+ description: "Sewerage maintenance request",
1396
+ isActive: true,
1397
+ createdOn: "2026-01-19",
1398
+ createdBy: "5",
1399
+ updatedOn: "2026-01-26",
1400
+ updatedBy: "Engineer"
1401
+ }, {
1402
+ workflowTypeId: 23,
1403
+ workflowTypeCode: "COMM_HALL",
1404
+ workflowTypeName: "Community Hall Booking",
1405
+ description: "Civic facility reservation",
1406
+ isActive: true,
1407
+ createdOn: "2026-01-20",
1408
+ createdBy: "1",
1409
+ updatedOn: "2026-01-27",
1410
+ updatedBy: "Admin"
1411
+ }, {
1412
+ workflowTypeId: 24,
1413
+ workflowTypeCode: "SEISMIC_CLR",
1414
+ workflowTypeName: "Seismic Clearance Flow",
1415
+ description: "Environmental safety check",
1416
+ isActive: false,
1417
+ createdOn: "2026-01-21",
1418
+ createdBy: "4",
1419
+ updatedOn: "2026-01-28",
1420
+ updatedBy: "Officer"
1421
+ }, {
1422
+ workflowTypeId: 25,
1423
+ workflowTypeCode: "TREE_CUTTING",
1424
+ workflowTypeName: "Tree Cutting Permission",
1425
+ description: "Greenery regulation permit",
1426
+ isActive: true,
1427
+ createdOn: "2026-01-22",
1428
+ createdBy: "2",
1429
+ updatedOn: "2026-01-29",
1430
+ updatedBy: "Officer"
1431
+ }];
1432
+ const [data, setData] = useState7(initialData);
1433
+ const [sortOrder, setSortOrder] = useState7("asc");
1434
+ const [sortKey, setSortKey] = useState7("workflowTypeId");
1435
+ const [selectedItem, setSelectedItem] = useState7(null);
1436
+ const [isEditOpen, setIsEditOpen] = useState7(false);
1437
+ const [isDeleteOpen, setIsDeleteOpen] = useState7(false);
1065
1438
  const handleSort = (columnKey) => {
1066
1439
  const isAsc = sortKey === columnKey && sortOrder === "asc";
1067
1440
  setSortOrder(isAsc ? "desc" : "asc");
1068
1441
  setSortKey(columnKey);
1442
+ const sortedData = [...data].sort((a, b) => {
1443
+ if (a[columnKey] < b[columnKey]) return isAsc ? -1 : 1;
1444
+ if (a[columnKey] > b[columnKey]) return isAsc ? 1 : -1;
1445
+ return 0;
1446
+ });
1447
+ setData(sortedData);
1069
1448
  };
1070
- const filteredData = useMemo(() => {
1071
- const query = searchQuery.toLowerCase();
1072
- return data.filter((item) => [item.workflowTypeName, item.workflowTypeCode, item.description].some((value) => String(value || "").toLowerCase().includes(query)));
1073
- }, [data, searchQuery]);
1074
- const sortedData = useMemo(() => [...filteredData].sort((a, b) => {
1075
- var _a, _b;
1076
- const left = (_a = a[sortKey]) != null ? _a : "";
1077
- const right = (_b = b[sortKey]) != null ? _b : "";
1078
- if (left < right) return sortOrder === "asc" ? -1 : 1;
1079
- if (left > right) return sortOrder === "asc" ? 1 : -1;
1080
- return 0;
1081
- }), [filteredData, sortKey, sortOrder]);
1082
- useEffect3(() => {
1083
- setTotalEntries == null ? void 0 : setTotalEntries(filteredData.length);
1449
+ const filteredData = data.filter((item) => {
1450
+ const query = (searchQuery || "").toLowerCase();
1451
+ return item.workflowTypeName.toLowerCase().includes(query) || item.workflowTypeCode.toLowerCase().includes(query) || item.description.toLowerCase().includes(query);
1452
+ });
1453
+ useEffect4(() => {
1454
+ if (setTotalEntries) setTotalEntries(filteredData.length);
1084
1455
  }, [filteredData.length, setTotalEntries]);
1085
- const totalPages = Math.ceil(sortedData.length / pageSize) || 1;
1086
- useEffect3(() => {
1087
- if (currentPage > totalPages) setCurrentPage(totalPages);
1088
- }, [currentPage, setCurrentPage, totalPages]);
1456
+ const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
1089
1457
  const startIndex = (currentPage - 1) * pageSize;
1090
- const visibleData = sortedData.slice(startIndex, startIndex + pageSize);
1091
- const pageNumbers = Array.from({ length: totalPages }, (_, index) => index + 1);
1092
- const sortIcon = (key) => sortKey === key ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2";
1093
- return /* @__PURE__ */ jsxs10("div", { className: "fc:space-y-5", children: [
1094
- /* @__PURE__ */ jsx11("div", { className: "fc:w-full fc:overflow-x-hidden fc:border fc:border-slate-200 fc:rounded-2xl fc:shadow-sm fc:max-h-[420px] fc:overflow-y-auto", children: /* @__PURE__ */ jsxs10("table", { className: "fc:w-full fc:text-left fc:border-collapse fc:bg-white fc:table-fixed", children: [
1095
- /* @__PURE__ */ jsx11("thead", { className: "fc:sticky fc:top-0 fc:z-10 fc:bg-slate-50 fc:shadow-[0_1px_0_0_rgba(226,232,240,1)]", children: /* @__PURE__ */ jsxs10("tr", { className: "fc:text-xs fc:font-bold fc:tracking-wider fc:text-slate-500", children: [
1096
- /* @__PURE__ */ jsxs10("th", { onClick: () => handleSort("workflowTypeId"), className: "fc:py-3 fc:px-2 fc:text-sm fc:text-center fc:bg-slate-50 fc:cursor-pointer fc:select-none fc:w-[6%]", children: [
1458
+ const visibleData = filteredData.slice(startIndex, startIndex + pageSize);
1459
+ const pageNumbers = Array.from({
1460
+ length: totalPages
1461
+ }, (_, i) => i + 1);
1462
+ const handleEdit = (item) => {
1463
+ setSelectedItem(item);
1464
+ setIsEditOpen(true);
1465
+ };
1466
+ const handleDelete = (item) => {
1467
+ setSelectedItem(item);
1468
+ setIsDeleteOpen(false);
1469
+ setIsDeleteOpen(true);
1470
+ };
1471
+ const handleConfirmDelete = (itemToDelete) => {
1472
+ setData((prevData) => prevData.filter((i) => i.workflowTypeId !== itemToDelete.workflowTypeId));
1473
+ };
1474
+ const handleSaveEdit = (updatedItem) => {
1475
+ setData((prevData) => prevData.map((item) => item.workflowTypeId === updatedItem.workflowTypeId ? updatedItem : item));
1476
+ };
1477
+ return /* @__PURE__ */ jsxs12("div", { className: "fc:space-y-5", children: [
1478
+ /* @__PURE__ */ jsx13("div", { className: "fc:w-full fc:overflow-x-hidden fc:border fc:border-slate-200 fc:rounded-2xl fc:shadow-sm fc:max-h-[420px] fc:overflow-y-auto", children: /* @__PURE__ */ jsxs12("table", { className: "fc:w-full fc:text-left fc:border-collapse fc:bg-white fc:table-fixed", children: [
1479
+ /* @__PURE__ */ jsx13("thead", { className: "fc:sticky fc:top-0 fc:z-10 fc:bg-slate-50 fc:shadow-[0_1px_0_0_rgba(226,232,240,1)]", children: /* @__PURE__ */ jsxs12("tr", { className: "fc:text-xs fc:font-bold fc:tracking-wider fc:text-slate-500", children: [
1480
+ /* @__PURE__ */ jsxs12("th", { onClick: () => handleSort("workflowTypeId"), className: "fc:py-3 fc:px-2 fc:text-sm fc:text-center fc:bg-slate-50 fc:cursor-pointer fc:select-none fc:w-[6%]", children: [
1097
1481
  "ID ",
1098
- sortIcon("workflowTypeId")
1482
+ sortKey === "workflowTypeId" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
1099
1483
  ] }),
1100
- /* @__PURE__ */ jsxs10("th", { onClick: () => handleSort("workflowTypeCode"), className: "fc:py-3 fc:px-3 fc:text-sm fc:cursor-pointer fc:select-none hover:fc:fc:text-slate-900 fc:bg-slate-50 fc:w-[16%]", children: [
1484
+ /* @__PURE__ */ jsxs12("th", { onClick: () => handleSort("workflowTypeCode"), className: "fc:py-3 fc:px-3 fc:text-sm fc:cursor-pointer fc:select-none hover:fc:fc:text-slate-900 fc:bg-slate-50 fc:w-[16%]", children: [
1101
1485
  "Code ",
1102
- sortIcon("workflowTypeCode")
1486
+ sortKey === "workflowTypeCode" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
1103
1487
  ] }),
1104
- /* @__PURE__ */ jsxs10("th", { onClick: () => handleSort("workflowTypeName"), className: "fc:py-3 fc:px-3 fc:text-sm fc:cursor-pointer fc:select-none hover:fc:fc:text-slate-900 fc:bg-slate-50 fc:w-[20%]", children: [
1488
+ /* @__PURE__ */ jsxs12("th", { onClick: () => handleSort("workflowTypeName"), className: "fc:py-3 fc:px-3 fc:text-sm fc:cursor-pointer fc:select-none hover:fc:fc:text-slate-900 fc:bg-slate-50 fc:w-[20%]", children: [
1105
1489
  "Name ",
1106
- sortIcon("workflowTypeName")
1490
+ sortKey === "workflowTypeName" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
1107
1491
  ] }),
1108
- /* @__PURE__ */ jsxs10("th", { onClick: () => handleSort("description"), className: "fc:py-3 fc:px-3 fc:text-sm fc:cursor-pointer fc:select-none hover:fc:fc:text-slate-900 fc:bg-slate-50 fc:w-[22%]", children: [
1492
+ /* @__PURE__ */ jsxs12("th", { onClick: () => handleSort("description"), className: "fc:py-3 fc:px-3 fc:text-sm fc:cursor-pointer fc:select-none hover:fc:fc:text-slate-900 fc:bg-slate-50 fc:w-[22%]", children: [
1109
1493
  "Description ",
1110
- sortIcon("description")
1494
+ sortKey === "description" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
1111
1495
  ] }),
1112
- /* @__PURE__ */ jsx11("th", { className: "fc:py-3 fc:px-2 fc:text-sm fc:bg-slate-50 fc:text-center fc:w-[12%]", children: "Status" }),
1113
- /* @__PURE__ */ jsxs10("th", { onClick: () => handleSort("createdOn"), className: "fc:py-3 fc:px-2 fc:text-sm fc:cursor-pointer fc:select-none hover:fc:fc:text-slate-900 fc:bg-slate-50 fc:text-center fc:w-[12%]", children: [
1496
+ /* @__PURE__ */ jsx13("th", { className: "fc:py-3 fc:px-2 fc:text-sm fc:bg-slate-50 fc:text-center fc:w-[12%]", children: "Status" }),
1497
+ /* @__PURE__ */ jsxs12("th", { onClick: () => handleSort("createdOn"), className: "fc:py-3 fc:px-2 fc:text-sm fc:cursor-pointer fc:select-none hover:fc:fc:text-slate-900 fc:bg-slate-50 fc:text-center fc:w-[12%]", children: [
1114
1498
  "Created On ",
1115
- sortIcon("createdOn")
1499
+ sortKey === "createdOn" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
1116
1500
  ] }),
1117
- /* @__PURE__ */ jsx11("th", { className: "fc:py-3 fc:px-2 fc:text-sm fc:bg-slate-50 fc:text-center fc:w-[12%]", children: "Action" })
1501
+ /* @__PURE__ */ jsx13("th", { className: "fc:py-3 fc:px-2 fc:text-sm fc:bg-slate-50 fc:text-center fc:w-[12%]", children: "Action" })
1118
1502
  ] }) }),
1119
- /* @__PURE__ */ jsx11("tbody", { className: "fc:divide-y fc:divide-slate-100 fc:text-xs fc:text-slate-600", children: isLoading ? /* @__PURE__ */ jsx11("tr", { children: /* @__PURE__ */ jsx11("td", { colSpan: "7", className: "fc:py-8 fc:text-center fc:text-sm fc:text-slate-500", children: "Loading..." }) }) : visibleData.length === 0 ? /* @__PURE__ */ jsx11("tr", { children: /* @__PURE__ */ jsx11("td", { colSpan: "7", className: "fc:py-8 fc:text-center fc:text-sm fc:text-slate-500", children: "No workflow types found." }) }) : visibleData.map((item, index) => /* @__PURE__ */ jsxs10("tr", { className: "hover:fc:fc:bg-slate-50/50 fc:transition-colors", children: [
1120
- /* @__PURE__ */ jsx11("td", { className: "fc:py-3 fc:px-2 fc:text-center fc:text-sm fc:font-medium fc:text-slate-700", children: startIndex + index + 1 }),
1121
- /* @__PURE__ */ jsx11("td", { className: "fc:py-3 fc:px-3 fc:font-mono fc:text-sm fc:text-slate-700 fc:font-medium fc:break-words", children: item.workflowTypeCode }),
1122
- /* @__PURE__ */ jsx11("td", { className: "fc:py-3 fc:px-3 fc:font-medium fc:text-slate-700 fc:text-sm fc:break-words", children: item.workflowTypeName }),
1123
- /* @__PURE__ */ jsx11("td", { className: "fc:py-3 fc:px-3 fc:text-slate-700 fc:text-sm fc:break-words", children: item.description }),
1124
- /* @__PURE__ */ jsx11("td", { className: "fc:py-3 fc:px-2 fc:text-center", children: /* @__PURE__ */ jsx11("span", { className: `fc:px-2 fc:py-1 fc:text-[13px] fc:font-semibold fc:rounded-full fc:inline-block ${item.isActive ? "fc:bg-emerald-100 fc:text-emerald-700 fc:border fc:border-emerald-200" : "fc:bg-rose-100 fc:text-rose-700 fc:border fc:border-rose-200"}`, children: item.isActive ? "Active" : "Inactive" }) }),
1125
- /* @__PURE__ */ jsx11("td", { className: "fc:py-3 fc:px-2 fc:text-center fc:text-slate-700 fc:text-[13px] fc:font-mono", children: item.createdOn }),
1126
- /* @__PURE__ */ jsx11("td", { className: "fc:py-3 fc:px-2 fc:text-center", children: /* @__PURE__ */ jsxs10("div", { className: "fc:flex fc:items-center fc:justify-center fc:gap-2", children: [
1127
- /* @__PURE__ */ jsx11("button", { onClick: () => onEdit == null ? void 0 : onEdit(item), className: "fc:px-3 fc:py-1 fc:bg-blue-100/70 hover:fc:fc:bg-blue-200/80 fc:text-blue-600 fc:font-semibold fc:text-xs fc:rounded-full fc:transition-all fc:duration-150 fc:cursor-pointer", children: "Edit" }),
1128
- /* @__PURE__ */ jsx11("button", { onClick: () => onDelete == null ? void 0 : onDelete(item), className: "fc:px-3 fc:py-1 fc:bg-rose-100/70 hover:fc:fc:bg-rose-200/80 fc:text-rose-600 fc:font-semibold fc:text-xs fc:rounded-full fc:transition-all fc:duration-150 fc:cursor-pointer", children: "Delete" })
1503
+ /* @__PURE__ */ jsx13("tbody", { className: "fc:divide-y fc:divide-slate-100 fc:text-xs fc:text-slate-600", children: visibleData.map((item, index) => /* @__PURE__ */ jsxs12("tr", { className: "hover:fc:fc:bg-slate-50/50 fc:transition-colors", children: [
1504
+ /* @__PURE__ */ jsx13("td", { className: "fc:py-3 fc:px-2 fc:text-center fc:text-sm fc:font-medium fc:text-slate-700", children: startIndex + index + 1 }),
1505
+ /* @__PURE__ */ jsx13("td", { className: "fc:py-3 fc:px-3 fc:font-mono fc:text-sm fc:text-slate-700 fc:font-medium fc:break-words", children: item.workflowTypeCode }),
1506
+ /* @__PURE__ */ jsx13("td", { className: "fc:py-3 fc:px-3 fc:font-medium fc:text-slate-700 fc:text-sm fc:break-words", children: item.workflowTypeName }),
1507
+ /* @__PURE__ */ jsx13("td", { className: "fc:py-3 fc:px-3 fc:text-slate-700 fc:text-sm fc:break-words", children: item.description }),
1508
+ /* @__PURE__ */ jsx13("td", { className: "fc:py-3 fc:px-2 fc:text-center", children: /* @__PURE__ */ jsx13("span", { className: `fc:px-2 fc:py-1 fc:text-[13px] fc:font-semibold fc:rounded-full fc:inline-block ${item.isActive ? "fc:bg-emerald-100 fc:text-emerald-700 fc:border fc:border-emerald-200" : "fc:bg-rose-100 fc:text-rose-700 fc:border fc:border-rose-200"}`, children: item.isActive ? "Active" : "Inactive" }) }),
1509
+ /* @__PURE__ */ jsx13("td", { className: "fc:py-3 fc:px-2 fc:text-center fc:text-slate-700 fc:text-[13px] fc:font-mono", children: item.createdOn }),
1510
+ /* @__PURE__ */ jsx13("td", { className: "fc:py-3 fc:px-2 fc:text-center", children: /* @__PURE__ */ jsxs12("div", { className: "fc:flex fc:items-center fc:justify-center fc:gap-2", children: [
1511
+ /* @__PURE__ */ jsx13("button", { onClick: () => handleEdit(item), className: "fc:px-3 fc:py-1 fc:bg-blue-100/70 hover:fc:fc:bg-blue-200/80 fc:text-blue-600 fc:font-semibold fc:text-xs fc:rounded-full fc:transition-all fc:duration-150 fc:cursor-pointer", children: "Edit" }),
1512
+ /* @__PURE__ */ jsx13("button", { onClick: () => handleDelete(item), className: "fc:px-3 fc:py-1 fc:bg-rose-100/70 hover:fc:fc:bg-rose-200/80 fc:text-rose-600 fc:font-semibold fc:text-xs fc:rounded-full fc:transition-all fc:duration-150 fc:cursor-pointer", children: "Delete" })
1129
1513
  ] }) })
1130
1514
  ] }, item.workflowTypeId)) })
1131
1515
  ] }) }),
1132
- /* @__PURE__ */ jsxs10("div", { className: "fc:flex fc:items-center fc:justify-end fc:gap-1 fc:text-[13px] fc:text-slate-700 fc:font-normal fc:mt-4 fc:bg-slate-50/50 fc:p-3 fc:rounded-xl fc:border fc:border-slate-100", children: [
1133
- /* @__PURE__ */ jsx11("button", { onClick: () => setCurrentPage((previous) => Math.max(previous - 1, 1)), disabled: currentPage === 1, className: "fc:px-2 fc:py-1 fc:text-[15px] fc:border fc:border-slate-200 fc:rounded-lg fc:bg-white fc:text-slate-600 fc:shadow-sm fc:transition-all fc:duration-200 fc:hover:bg-blue-600 fc:hover:text-white fc:hover:border-blue-600", children: "\u2039 Prev" }),
1134
- pageNumbers.map((pageNumber) => /* @__PURE__ */ jsx11("button", { onClick: () => setCurrentPage(pageNumber), className: `fc:px-2 fc:py-1 fc:text-[15px] fc:border fc:border-slate-200 fc:rounded-lg fc:bg-white fc:text-slate-600 fc:shadow-sm fc:transition-all fc:duration-200 fc:hover:bg-blue-600 fc:hover:text-white fc:hover:border-blue-600${currentPage === pageNumber ? "bg-blue-600 text-white font-medium shadow-sm" : "text-slate-600 hover:bg-slate-100"}`, children: pageNumber }, pageNumber)),
1135
- /* @__PURE__ */ jsx11("button", { onClick: () => setCurrentPage((previous) => Math.min(previous + 1, totalPages)), disabled: currentPage === totalPages, className: "fc:px-2 fc:py-1 fc:text-[15px] fc:border fc:border-slate-200 fc:rounded-lg fc:bg-white fc:text-slate-600 fc:shadow-sm fc:transition-all fc:duration-200 fc:hover:bg-blue-600 fc:hover:text-white fc:hover:border-blue-600", children: "Next \u203A" })
1136
- ] })
1516
+ /* @__PURE__ */ jsxs12("div", { className: "fc:flex fc:items-center fc:justify-end fc:gap-1 fc:text-[13px] fc:text-slate-700 fc:font-normal fc:mt-4 fc:bg-slate-50/50 fc:p-3 fc:rounded-xl fc:border fc:border-slate-100", children: [
1517
+ /* @__PURE__ */ jsx13("button", { onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)), disabled: currentPage === 1, className: "fc:px-2 fc:py-1 fc:text-[15px] fc:border fc:border-slate-200 fc:rounded-lg fc:bg-white fc:text-slate-600 fc:shadow-sm fc:transition-all fc:duration-200 fc:hover:bg-blue-600 fc:hover:text-white fc:hover:border-blue-600", children: "\u2039 Prev" }),
1518
+ pageNumbers.map((pageNumber) => /* @__PURE__ */ jsx13("button", { onClick: () => setCurrentPage(pageNumber), className: `fc:px-2 fc:py-1 fc:text-[15px] fc:border fc:border-slate-200 fc:rounded-lg fc:bg-white fc:text-slate-600 fc:shadow-sm fc:transition-all fc:duration-200 fc:hover:bg-blue-600 fc:hover:text-white fc:hover:border-blue-600${currentPage === pageNumber ? "bg-blue-600 text-white font-medium shadow-sm" : "text-slate-600 hover:bg-slate-100"}`, children: pageNumber }, pageNumber)),
1519
+ /* @__PURE__ */ jsx13("button", { onClick: () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)), disabled: currentPage === totalPages, className: "fc:px-2 fc:py-1 fc:text-[15px] fc:border fc:border-slate-200 fc:rounded-lg fc:bg-white fc:text-slate-600 fc:shadow-sm fc:transition-all fc:duration-200 fc:hover:bg-blue-600 fc:hover:text-white fc:hover:border-blue-600", children: "Next \u203A" })
1520
+ ] }),
1521
+ /* @__PURE__ */ jsx13(EditWorkflowType_default, { isOpen: isEditOpen, onClose: () => setIsEditOpen(false), selectedData: selectedItem, onSave: handleSaveEdit }),
1522
+ /* @__PURE__ */ jsx13(DeleteWorkflowType_default, { isOpen: isDeleteOpen, onClose: () => setIsDeleteOpen(false), itemData: selectedItem, onConfirm: handleConfirmDelete })
1137
1523
  ] });
1138
1524
  }
1139
1525
 
1140
1526
  // src/components/workflow-type/AddWorkflowTypeModal.jsx
1141
- import React12, { useState as useState7 } from "react";
1142
- import Swal from "sweetalert2";
1527
+ import React14, { useState as useState8 } from "react";
1143
1528
 
1144
1529
  // src/components/Service/ApiEndpointsProvider.js
1145
1530
  var STORAGE_KEY = "FLOWCORE_API_ENDPOINTS";
@@ -1190,7 +1575,7 @@ var getApiService = () => {
1190
1575
  var ApiServicepackage_default = ApiServicepackage;
1191
1576
 
1192
1577
  // src/components/workflow-type/AddWorkflowTypeModal.jsx
1193
- import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1578
+ import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1194
1579
  var initialFormData = {
1195
1580
  workflowTypeCode: "",
1196
1581
  workflowTypeName: "",
@@ -1198,12 +1583,12 @@ var initialFormData = {
1198
1583
  createdBy: ""
1199
1584
  };
1200
1585
  var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1201
- const [formData, setFormData] = useState7(__spreadProps(__spreadValues({}, initialFormData), {
1586
+ const [formData, setFormData] = useState8(__spreadProps(__spreadValues({}, initialFormData), {
1202
1587
  createdBy
1203
1588
  }));
1204
- const [errors, setErrors] = useState7({});
1205
- const [isSubmitting, setIsSubmitting] = useState7(false);
1206
- const [submitError, setSubmitError] = useState7("");
1589
+ const [errors, setErrors] = useState8({});
1590
+ const [isSubmitting, setIsSubmitting] = useState8(false);
1591
+ const [submitError, setSubmitError] = useState8("");
1207
1592
  const handleChange = ({ target: { name, value } }) => {
1208
1593
  if (name === "description" && value.length > 500) return;
1209
1594
  setFormData((previous) => __spreadProps(__spreadValues({}, previous), { [name]: value }));
@@ -1222,7 +1607,7 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1222
1607
  if (!isSubmitting) onClose();
1223
1608
  };
1224
1609
  const handleSubmit = async (event) => {
1225
- var _a, _b, _c, _d, _e, _f, _g;
1610
+ var _a, _b, _c, _d, _e;
1226
1611
  event.preventDefault();
1227
1612
  if (!validateForm()) return;
1228
1613
  const payload = {
@@ -1235,7 +1620,7 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1235
1620
  setIsSubmitting(true);
1236
1621
  setSubmitError("");
1237
1622
  const endpoints = getApiEndpoints();
1238
- const endpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.workflowType) == null ? void 0 : _b.create;
1623
+ const endpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.workflow) == null ? void 0 : _b.createWorkflowList;
1239
1624
  if (!endpoint) throw new Error("Create workflow type endpoint is not configured.");
1240
1625
  const response = await getApiService().post(endpoint, payload);
1241
1626
  await (onSave == null ? void 0 : onSave((_c = response == null ? void 0 : response.data) != null ? _c : response));
@@ -1243,305 +1628,99 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1243
1628
  setErrors({});
1244
1629
  onClose();
1245
1630
  } catch (error) {
1246
- const message = ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.title) || (error == null ? void 0 : error.message) || "Unable to create workflow type. Please try again.";
1247
- setSubmitError(message);
1248
- await Swal.fire("Error", message, "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
+ );
1249
1634
  } finally {
1250
1635
  setIsSubmitting(false);
1251
1636
  }
1252
1637
  };
1253
1638
  if (!isOpen) return null;
1254
- return /* @__PURE__ */ jsx12("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:bg-black/20 fc:p-4 fc:backdrop-blur-sm", children: /* @__PURE__ */ jsxs11("div", { className: "fc:w-full fc:max-w-xl fc:overflow-hidden fc:rounded-2xl fc:border fc:border-gray-100 fc:bg-white fc:shadow-2xl", children: [
1255
- /* @__PURE__ */ jsxs11("div", { className: "fc:flex fc:items-center fc:justify-between fc:border-b fc:border-gray-100 fc:px-6 fc:py-4", children: [
1256
- /* @__PURE__ */ jsxs11("div", { children: [
1257
- /* @__PURE__ */ jsx12("h2", { className: "fc:text-xl fc:font-bold fc:text-gray-800", children: "Add Workflow Type" }),
1258
- /* @__PURE__ */ jsx12("p", { className: "fc:text-xs fc:text-gray-400", children: "Create a new workflow type" })
1639
+ return /* @__PURE__ */ jsx14("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:bg-black/20 fc:p-4 fc:backdrop-blur-sm", children: /* @__PURE__ */ jsxs13("div", { className: "fc:w-full fc:max-w-xl fc:overflow-hidden fc:rounded-2xl fc:border fc:border-gray-100 fc:bg-white fc:shadow-2xl", children: [
1640
+ /* @__PURE__ */ jsxs13("div", { className: "fc:flex fc:items-center fc:justify-between fc:border-b fc:border-gray-100 fc:px-6 fc:py-4", children: [
1641
+ /* @__PURE__ */ jsxs13("div", { children: [
1642
+ /* @__PURE__ */ jsx14("h2", { className: "fc:text-xl fc:font-bold fc:text-gray-800", children: "Add Workflow Type" }),
1643
+ /* @__PURE__ */ jsx14("p", { className: "fc:text-xs fc:text-gray-400", children: "Create a new workflow type" })
1259
1644
  ] }),
1260
- /* @__PURE__ */ jsx12("button", { type: "button", onClick: handleClose, disabled: isSubmitting, "aria-label": "Close", className: "fc:text-xl fc:text-gray-400 hover:fc:text-gray-600", children: "\xD7" })
1645
+ /* @__PURE__ */ jsx14("button", { type: "button", onClick: handleClose, disabled: isSubmitting, "aria-label": "Close", className: "fc:text-xl fc:text-gray-400 hover:fc:text-gray-600", children: "\xD7" })
1261
1646
  ] }),
1262
- /* @__PURE__ */ jsxs11("form", { onSubmit: handleSubmit, className: "fc:space-y-4 fc:p-6", children: [
1263
- /* @__PURE__ */ jsxs11("div", { className: "fc:grid fc:grid-cols-2 fc:gap-4", children: [
1264
- /* @__PURE__ */ jsx12(FormField, { label: "Workflow Type Code", required: true, error: errors.workflowTypeCode, children: /* @__PURE__ */ jsx12("input", { name: "workflowTypeCode", value: formData.workflowTypeCode, onChange: handleChange, placeholder: "e.g. PETITION", className: inputClass(errors.workflowTypeCode) }) }),
1265
- /* @__PURE__ */ jsx12(FormField, { label: "Workflow Type Name", required: true, error: errors.workflowTypeName, children: /* @__PURE__ */ jsx12("input", { name: "workflowTypeName", value: formData.workflowTypeName, onChange: handleChange, placeholder: "Enter workflow type name", className: inputClass(errors.workflowTypeName) }) })
1647
+ /* @__PURE__ */ jsxs13("form", { onSubmit: handleSubmit, className: "fc:space-y-4 fc:p-6", children: [
1648
+ /* @__PURE__ */ jsxs13("div", { className: "fc:grid fc:grid-cols-2 fc:gap-4", children: [
1649
+ /* @__PURE__ */ jsx14(FormField, { label: "Workflow Type Code", required: true, error: errors.workflowTypeCode, children: /* @__PURE__ */ jsx14("input", { name: "workflowTypeCode", value: formData.workflowTypeCode, onChange: handleChange, placeholder: "e.g. PETITION", className: inputClass(errors.workflowTypeCode) }) }),
1650
+ /* @__PURE__ */ jsx14(FormField, { label: "Workflow Type Name", required: true, error: errors.workflowTypeName, children: /* @__PURE__ */ jsx14("input", { name: "workflowTypeName", value: formData.workflowTypeName, onChange: handleChange, placeholder: "Enter workflow type name", className: inputClass(errors.workflowTypeName) }) })
1266
1651
  ] }),
1267
- /* @__PURE__ */ jsx12(FormField, { label: "Created By", required: true, error: errors.createdBy, children: /* @__PURE__ */ jsx12("input", { name: "createdBy", value: formData.createdBy, onChange: handleChange, placeholder: "Enter user name or ID", className: inputClass(errors.createdBy) }) }),
1268
- /* @__PURE__ */ jsx12(FormField, { label: "Description", children: /* @__PURE__ */ jsxs11("div", { className: "fc:relative", children: [
1269
- /* @__PURE__ */ jsx12("textarea", { name: "description", rows: "3", value: formData.description, onChange: handleChange, placeholder: "Enter description", className: "fc:w-full fc:resize-none fc:rounded-xl fc:border fc:border-slate-200 fc:p-3 fc:text-sm fc:text-slate-700 fc:outline-none focus:fc:border-indigo-500" }),
1270
- /* @__PURE__ */ jsxs11("span", { className: "fc:absolute fc:bottom-2 fc:right-3 fc:text-xs fc:text-gray-400", children: [
1652
+ /* @__PURE__ */ jsx14(FormField, { label: "Created By", required: true, error: errors.createdBy, children: /* @__PURE__ */ jsx14("input", { name: "createdBy", value: formData.createdBy, onChange: handleChange, placeholder: "Enter user name or ID", className: inputClass(errors.createdBy) }) }),
1653
+ /* @__PURE__ */ jsx14(FormField, { label: "Description", children: /* @__PURE__ */ jsxs13("div", { className: "fc:relative", children: [
1654
+ /* @__PURE__ */ jsx14("textarea", { name: "description", rows: "3", value: formData.description, onChange: handleChange, placeholder: "Enter description", className: "fc:w-full fc:resize-none fc:rounded-xl fc:border fc:border-slate-200 fc:p-3 fc:text-sm fc:text-slate-700 fc:outline-none focus:fc:border-indigo-500" }),
1655
+ /* @__PURE__ */ jsxs13("span", { className: "fc:absolute fc:bottom-2 fc:right-3 fc:text-xs fc:text-gray-400", children: [
1271
1656
  formData.description.length,
1272
1657
  "/500"
1273
1658
  ] })
1274
1659
  ] }) }),
1275
- submitError && /* @__PURE__ */ jsx12("p", { role: "alert", className: "fc:rounded-lg fc:bg-red-50 fc:p-3 fc:text-sm fc:text-red-600", children: submitError }),
1276
- /* @__PURE__ */ jsxs11("div", { className: "fc:flex fc:justify-end fc:gap-3 fc:border-t fc:border-gray-100 fc:pt-4", children: [
1277
- /* @__PURE__ */ jsx12("button", { type: "button", onClick: handleClose, disabled: isSubmitting, className: "fc:rounded-xl fc:bg-gray-100 fc:px-5 fc:py-2.5 fc:text-sm fc:font-medium fc:text-gray-600 disabled:fc:cursor-not-allowed", children: "Cancel" }),
1278
- /* @__PURE__ */ jsx12("button", { type: "submit", disabled: isSubmitting, className: "fc:flex fc:min-w-32 fc:justify-center fc:rounded-xl fc:bg-[#2563eb] fc:px-6 fc:py-2.5 fc:text-sm fc:font-semibold fc:text-white disabled:fc:cursor-not-allowed disabled:fc:opacity-60", children: isSubmitting ? "Saving..." : "Save Workflow Type" })
1660
+ submitError && /* @__PURE__ */ jsx14("p", { role: "alert", className: "fc:rounded-lg fc:bg-red-50 fc:p-3 fc:text-sm fc:text-red-600", children: submitError }),
1661
+ /* @__PURE__ */ jsxs13("div", { className: "fc:flex fc:justify-end fc:gap-3 fc:border-t fc:border-gray-100 fc:pt-4", children: [
1662
+ /* @__PURE__ */ jsx14("button", { type: "button", onClick: handleClose, disabled: isSubmitting, className: "fc:rounded-xl fc:bg-gray-100 fc:px-5 fc:py-2.5 fc:text-sm fc:font-medium fc:text-gray-600 disabled:fc:cursor-not-allowed", children: "Cancel" }),
1663
+ /* @__PURE__ */ jsx14("button", { type: "submit", disabled: isSubmitting, className: "fc:flex fc:min-w-32 fc:justify-center fc:rounded-xl fc:bg-[#2563eb] fc:px-6 fc:py-2.5 fc:text-sm fc:font-semibold fc:text-white disabled:fc:cursor-not-allowed disabled:fc:opacity-60", children: isSubmitting ? "Saving..." : "Save Workflow Type" })
1279
1664
  ] })
1280
1665
  ] })
1281
1666
  ] }) });
1282
1667
  };
1283
1668
  var inputClass = (hasError) => `fc:w-full fc:rounded-xl fc:border fc:bg-white fc:p-3 fc:text-sm fc:text-slate-700 fc:outline-none focus:fc:border-indigo-500 ${hasError ? "fc:border-red-500" : "fc:border-slate-200"}`;
1284
- var FormField = ({ label, required, error, children }) => /* @__PURE__ */ jsxs11("label", { className: "fc:block fc:text-xs fc:font-semibold fc:text-gray-700", children: [
1669
+ var FormField = ({ label, required, error, children }) => /* @__PURE__ */ jsxs13("label", { className: "fc:block fc:text-xs fc:font-semibold fc:text-gray-700", children: [
1285
1670
  label,
1286
1671
  " ",
1287
- required && /* @__PURE__ */ jsx12("span", { className: "fc:text-red-500", children: "*" }),
1288
- /* @__PURE__ */ jsx12("div", { className: "fc:mt-1.5", children }),
1289
- error && /* @__PURE__ */ jsx12("span", { className: "fc:mt-1 fc:block fc:text-xs fc:text-red-500", children: error })
1672
+ required && /* @__PURE__ */ jsx14("span", { className: "fc:text-red-500", children: "*" }),
1673
+ /* @__PURE__ */ jsx14("div", { className: "fc:mt-1.5", children }),
1674
+ error && /* @__PURE__ */ jsx14("span", { className: "fc:mt-1 fc:block fc:text-xs fc:text-red-500", children: error })
1290
1675
  ] });
1291
1676
  var AddWorkflowTypeModal_default = AddWorkflowTypeModal;
1292
1677
 
1293
- // src/components/workflow-type/EditWorkflowType.jsx
1294
- import React13, { useState as useState8, useEffect as useEffect4 } from "react";
1295
- import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1296
- var EditWorkflowType = ({
1297
- isOpen,
1298
- onClose,
1299
- onSave,
1300
- selectedData
1301
- }) => {
1302
- const [formData, setFormData] = useState8({
1303
- workflowTypeCode: "",
1304
- workflowTypeName: "",
1305
- description: "",
1306
- isActive: true
1307
- });
1308
- useEffect4(() => {
1309
- var _a, _b;
1310
- if (selectedData) {
1311
- setFormData({
1312
- workflowTypeCode: selectedData.workflowTypeCode || selectedData.WorkflowTypeCode || "",
1313
- workflowTypeName: selectedData.workflowTypeName || selectedData.WorkflowTypeName || "",
1314
- description: selectedData.description || selectedData.Description || "",
1315
- isActive: (_b = (_a = selectedData.isActive) != null ? _a : selectedData.IsActive) != null ? _b : true
1316
- });
1317
- }
1318
- }, [selectedData]);
1319
- if (!isOpen) return null;
1320
- const handleChange = (e) => {
1321
- const {
1322
- name,
1323
- value,
1324
- type,
1325
- checked
1326
- } = e.target;
1327
- setFormData((prev) => __spreadProps(__spreadValues({}, prev), {
1328
- [name]: type === "checkbox" ? checked : value
1329
- }));
1330
- };
1331
- const handleSubmit = async (e) => {
1332
- e.preventDefault();
1333
- const wasSaved = await (onSave == null ? void 0 : onSave(__spreadValues(__spreadValues({}, selectedData), formData)));
1334
- if (wasSaved) onClose();
1335
- };
1336
- return /* @__PURE__ */ jsx13("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:bg-black/40 fc:backdrop-blur-sm fc:p-4 fc:animate-in fc:fade-in fc:duration-200", children: /* @__PURE__ */ jsxs12("div", { className: "fc:relative fc:w-full fc:max-w-md fc:bg-white fc:rounded-3xl fc:shadow-2xl fc:border fc:border-gray-100 fc:overflow-hidden", children: [
1337
- /* @__PURE__ */ jsxs12("div", { className: "fc:flex fc:items-center fc:justify-between fc:px-6 fc:py-4 fc:border-b fc:border-gray-100", children: [
1338
- /* @__PURE__ */ jsx13("h3", { className: "fc:text-lg fc:font-bold fc:text-gray-900", children: "Edit Workflow Type" }),
1339
- /* @__PURE__ */ jsx13("button", { onClick: onClose, className: "fc:text-gray-400 hover:fc:fc:text-gray-600 fc:w-8 fc:h-8 fc:rounded-full fc:flex fc:items-center fc:justify-center fc:transition", children: "\u2715" })
1340
- ] }),
1341
- /* @__PURE__ */ jsxs12("form", { onSubmit: handleSubmit, className: "fc:p-6 fc:space-y-4", children: [
1342
- /* @__PURE__ */ jsxs12("div", { children: [
1343
- /* @__PURE__ */ jsx13("label", { className: "fc:block fc:text-xs fc:font-semibold fc:text-gray-700 fc:uppercase fc:tracking-wider fc:mb-1", children: "Workflow Type Code" }),
1344
- /* @__PURE__ */ jsx13("input", { type: "text", name: "workflowTypeCode", value: formData.workflowTypeCode, onChange: handleChange, className: "fc:w-full fc:rounded-xl fc:border fc:border-gray-200 fc:bg-gray-50 fc:px-3.5 fc:py-2 fc:text-sm fc:text-gray-900 focus:fc:fc:bg-white focus:fc:fc:border-blue-500 focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-blue-500/20 fc:transition", required: true })
1345
- ] }),
1346
- /* @__PURE__ */ jsxs12("div", { children: [
1347
- /* @__PURE__ */ jsx13("label", { className: "fc:block fc:text-xs fc:font-semibold fc:text-gray-700 fc:uppercase fc:tracking-wider fc:mb-1", children: "Workflow Type Name" }),
1348
- /* @__PURE__ */ jsx13("input", { type: "text", name: "workflowTypeName", value: formData.workflowTypeName, onChange: handleChange, className: "fc:w-full fc:rounded-xl fc:border fc:border-gray-200 fc:bg-gray-50 fc:px-3.5 fc:py-2 fc:text-sm fc:text-gray-900 focus:fc:fc:bg-white focus:fc:fc:border-blue-500 focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-blue-500/20 fc:transition", required: true })
1349
- ] }),
1350
- /* @__PURE__ */ jsxs12("div", { children: [
1351
- /* @__PURE__ */ jsx13("label", { className: "fc:block fc:text-xs fc:font-semibold fc:text-gray-700 fc:uppercase fc:tracking-wider fc:mb-1", children: "Description" }),
1352
- /* @__PURE__ */ jsx13("textarea", { name: "description", value: formData.description, onChange: handleChange, rows: "3", className: "fc:w-full fc:rounded-xl fc:border fc:border-gray-200 fc:bg-gray-50 fc:px-3.5 fc:py-2 fc:text-sm fc:text-gray-900 focus:fc:fc:bg-white focus:fc:fc:border-blue-500 focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-blue-500/20 fc:transition fc:resize-none" })
1353
- ] }),
1354
- /* @__PURE__ */ jsxs12("div", { className: "fc:flex fc:items-center fc:pt-1", children: [
1355
- /* @__PURE__ */ jsx13("input", { type: "checkbox", id: "isActive", name: "isActive", checked: formData.isActive, onChange: handleChange, className: "fc:h-4 fc:w-4 fc:rounded fc:border-gray-300 fc:text-blue-600 focus:fc:fc:ring-blue-500 fc:cursor-pointer" }),
1356
- /* @__PURE__ */ jsx13("label", { htmlFor: "isActive", className: "fc:ml-2 fc:text-sm fc:font-medium fc:text-gray-700 fc:cursor-pointer", children: "Is Active" })
1357
- ] }),
1358
- /* @__PURE__ */ jsxs12("div", { className: "fc:flex fc:items-center fc:justify-end fc:gap-3 fc:pt-4 fc:border-t fc:border-gray-100", children: [
1359
- /* @__PURE__ */ jsx13("button", { type: "button", onClick: onClose, className: "fc:py-2 fc:px-4 fc:text-sm fc:font-semibold fc:text-gray-700 fc:bg-gray-100 hover:fc:fc:bg-gray-200 fc:rounded-xl fc:transition", children: "Cancel" }),
1360
- /* @__PURE__ */ jsx13("button", { type: "submit", className: "fc:py-2 fc:px-5 fc:text-sm fc:font-semibold fc:text-white fc:bg-blue-600 hover:fc:fc:bg-blue-700 fc:rounded-xl fc:shadow-md fc:shadow-blue-500/20 fc:transition", children: "Update" })
1361
- ] })
1362
- ] })
1363
- ] }) });
1364
- };
1365
- var EditWorkflowType_default = EditWorkflowType;
1366
-
1367
- // src/components/workflow-type/DeleteWorkflowType.jsx
1368
- import React14 from "react";
1369
- import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1370
- var DeleteWorkflowType = ({
1371
- isOpen,
1372
- onClose,
1373
- onConfirm,
1374
- itemData
1375
- }) => {
1376
- if (!isOpen) return null;
1377
- return /* @__PURE__ */ jsx14("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:bg-black/40 fc:backdrop-blur-sm fc:p-4 fc:animate-in fc:fade-in fc:duration-200", children: /* @__PURE__ */ jsxs13("div", { className: "fc:relative fc:w-full fc:max-w-md fc:bg-white fc:rounded-3xl fc:shadow-2xl fc:border fc:border-gray-100 fc:overflow-hidden", children: [
1378
- /* @__PURE__ */ jsx14("button", { type: "button", onClick: onClose, className: "fc:absolute fc:top-4 fc:right-4 fc:z-10 fc:flex fc:items-center fc:justify-center fc:w-8 fc:h-8 fc:rounded-full fc:text-gray-400 hover:fc:fc:text-gray-600 hover:fc:fc:bg-gray-100 fc:transition", children: "\u2715" }),
1379
- /* @__PURE__ */ jsxs13("div", { className: "fc:p-8 fc:text-center", children: [
1380
- /* @__PURE__ */ jsx14("div", { className: "fc:mx-auto fc:mb-4 fc:flex fc:h-14 fc:w-14 fc:items-center fc:justify-center fc:rounded-2xl fc:bg-red-50 fc:border fc:border-red-100 fc:text-red-500 fc:shadow-inner", children: /* @__PURE__ */ jsx14("span", { className: "fc:text-2xl", children: "\u26A0\uFE0F" }) }),
1381
- /* @__PURE__ */ jsx14("h3", { className: "fc:text-xl fc:font-bold fc:text-gray-900 fc:tracking-tight fc:mb-2", children: "Delete Configuration" }),
1382
- /* @__PURE__ */ jsxs13("p", { className: "fc:text-sm fc:text-gray-500 fc:leading-relaxed fc:px-2 fc:mb-6", children: [
1383
- "Are you sure you want to delete",
1384
- " ",
1385
- /* @__PURE__ */ jsxs13("span", { className: "fc:font-semibold fc:text-gray-900 fc:bg-gray-100 fc:px-2 fc:py-0.5 fc:rounded-md", children: [
1386
- '"',
1387
- (itemData == null ? void 0 : itemData.workflowTypeName) || (itemData == null ? void 0 : itemData.WorkflowTypeName) || "this item",
1388
- '"'
1389
- ] }),
1390
- "? This action cannot be undone."
1391
- ] }),
1392
- /* @__PURE__ */ jsxs13("div", { className: "fc:flex fc:items-center fc:gap-3", children: [
1393
- /* @__PURE__ */ jsx14("button", { type: "button", onClick: onClose, className: "fc:w-1/2 fc:py-2.5 fc:px-4 fc:text-sm fc:font-semibold fc:text-gray-700 fc:bg-gray-100 hover:fc:fc:bg-gray-200 fc:rounded-xl fc:transition", children: "Cancel" }),
1394
- /* @__PURE__ */ jsx14("button", { type: "button", onClick: () => {
1395
- onConfirm(itemData);
1396
- }, className: "fc:w-1/2 fc:py-2.5 fc:px-4 fc:text-sm fc:font-semibold fc:text-white fc:bg-red-600 hover:fc:fc:bg-red-700 fc:rounded-xl fc:shadow-md fc:shadow-red-500/20 fc:transition", children: "Delete" })
1397
- ] })
1398
- ] })
1399
- ] }) });
1400
- };
1401
- var DeleteWorkflowType_default = DeleteWorkflowType;
1402
-
1403
1678
  // src/components/workflow-type/WorkflowTypeMains.js
1404
1679
  import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1405
- var getErrorMessage = (error, fallback) => {
1406
- var _a, _b, _c, _d;
1407
- return ((_b = (_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || ((_d = (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.data) == null ? void 0 : _d.title) || (error == null ? void 0 : error.message) || fallback;
1408
- };
1409
- var getResponseData = (response) => {
1410
- var _a;
1411
- return (_a = response == null ? void 0 : response.data) != null ? _a : response;
1412
- };
1413
- var getWorkflowTypes = (response) => {
1414
- const result = getResponseData(response);
1415
- const payload = Array.isArray(result) ? result : (result == null ? void 0 : result.data) || (result == null ? void 0 : result.result) || result;
1416
- const items = Array.isArray(payload) ? payload : (payload == null ? void 0 : payload.items) || (payload == null ? void 0 : payload.records) || (payload == null ? void 0 : payload.data) || (payload == null ? void 0 : payload.result) || [];
1417
- return Array.isArray(items) ? items : [];
1418
- };
1419
- var normalizeWorkflowType = (item) => {
1420
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
1421
- return __spreadProps(__spreadValues({}, item), {
1422
- workflowTypeId: (_a = item == null ? void 0 : item.workflowTypeId) != null ? _a : item == null ? void 0 : item.WorkflowTypeId,
1423
- workflowTypeCode: (_c = (_b = item == null ? void 0 : item.workflowTypeCode) != null ? _b : item == null ? void 0 : item.WorkflowTypeCode) != null ? _c : "",
1424
- workflowTypeName: (_e = (_d = item == null ? void 0 : item.workflowTypeName) != null ? _d : item == null ? void 0 : item.WorkflowTypeName) != null ? _e : "",
1425
- description: (_g = (_f = item == null ? void 0 : item.description) != null ? _f : item == null ? void 0 : item.Description) != null ? _g : "",
1426
- isActive: (_i = (_h = item == null ? void 0 : item.isActive) != null ? _h : item == null ? void 0 : item.IsActive) != null ? _i : true,
1427
- createdOn: (_k = (_j = item == null ? void 0 : item.createdOn) != null ? _j : item == null ? void 0 : item.CreatedOn) != null ? _k : "",
1428
- createdBy: (_m = (_l = item == null ? void 0 : item.createdBy) != null ? _l : item == null ? void 0 : item.CreatedBy) != null ? _m : "",
1429
- updatedBy: (_o = (_n = item == null ? void 0 : item.updatedBy) != null ? _n : item == null ? void 0 : item.UpdatedBy) != null ? _o : ""
1430
- });
1431
- };
1432
1680
  function WorkflowTypeMains() {
1433
1681
  const [refreshkey, setRefreshKey] = useState9(0);
1682
+ const handleRefresh = () => {
1683
+ console.log("Table data refreshed!");
1684
+ setRefreshKey((prev) => prev + 1);
1685
+ };
1434
1686
  const tableRef = useRef3(null);
1435
1687
  const [modalOpen, setModalOpen] = useState9(false);
1436
1688
  const [pageSize, setPageSize] = useState9(10);
1437
1689
  const [searchQuery, setSearchQuery] = useState9("");
1438
1690
  const [currentPage, setCurrentPage] = useState9(1);
1439
- const [, setTotalEntries] = useState9(0);
1440
- const [data, setData] = useState9([]);
1441
- const [isLoading, setIsLoading] = useState9(false);
1691
+ const [totalEntries, setTotalEntries] = useState9(0);
1442
1692
  const [isEditOpen, setIsEditOpen] = useState9(false);
1443
1693
  const [isDeleteOpen, setIsDeleteOpen] = useState9(false);
1444
1694
  const [selectedItem, setSelectedItem] = useState9(null);
1445
- const loadWorkflowTypes = useCallback(async (showError = true) => {
1446
- var _a, _b;
1447
- try {
1448
- setIsLoading(true);
1449
- const endpoints = getApiEndpoints();
1450
- const endpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.workflowType) == null ? void 0 : _b.getList;
1451
- if (!endpoint) throw new Error("Workflow type list endpoint is not configured.");
1452
- const response = await getApiService().get(endpoint);
1453
- setData(getWorkflowTypes(response).map(normalizeWorkflowType));
1454
- } catch (error) {
1455
- setData([]);
1456
- if (showError) {
1457
- await Swal2.fire("Error", getErrorMessage(error, "Unable to load workflow types."), "error");
1458
- }
1459
- } finally {
1460
- setIsLoading(false);
1461
- }
1462
- }, []);
1463
- useEffect5(() => {
1464
- loadWorkflowTypes();
1465
- }, [loadWorkflowTypes, refreshkey]);
1466
- const handleRefresh = () => setRefreshKey((previous) => previous + 1);
1467
- const handlePageSizeChange = (event) => {
1468
- setPageSize(Number(event.target.value));
1695
+ const handlePageSizeChange = (e) => {
1696
+ setPageSize(Number(e.target.value));
1469
1697
  setCurrentPage(1);
1470
1698
  };
1471
- const handleEdit = async (item) => {
1472
- var _a, _b, _c, _d;
1473
- try {
1474
- const endpoints = getApiEndpoints();
1475
- const id = (_a = item == null ? void 0 : item.workflowTypeId) != null ? _a : item == null ? void 0 : item.WorkflowTypeId;
1476
- const endpoint = (_d = (_c = (_b = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _b.workflowType) == null ? void 0 : _c.getById) == null ? void 0 : _d.call(_c, id);
1477
- if (!id || !endpoint) throw new Error("Workflow type details endpoint is not configured.");
1478
- const response = await getApiService().get(endpoint);
1479
- const result = getResponseData(response);
1480
- const record = (result == null ? void 0 : result.data) || (result == null ? void 0 : result.result) || result;
1481
- setSelectedItem(normalizeWorkflowType(record));
1482
- setIsEditOpen(true);
1483
- } catch (error) {
1484
- await Swal2.fire("Error", getErrorMessage(error, "Unable to load workflow type details."), "error");
1485
- }
1699
+ const handleEdit = (item) => {
1700
+ setSelectedItem(item);
1701
+ setIsEditOpen(true);
1486
1702
  };
1487
- const handleSaveEdit = async (updatedData) => {
1488
- var _a, _b, _c;
1489
- try {
1490
- const endpoints = getApiEndpoints();
1491
- const endpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.workflowType) == null ? void 0 : _b.update;
1492
- if (!endpoint) throw new Error("Workflow type update endpoint is not configured.");
1493
- const payload = {
1494
- workflowTypeId: (_c = updatedData.workflowTypeId) != null ? _c : updatedData.WorkflowTypeId,
1495
- workflowTypeCode: updatedData.workflowTypeCode.trim().toUpperCase(),
1496
- workflowTypeName: updatedData.workflowTypeName.trim(),
1497
- description: updatedData.description.trim(),
1498
- isActive: Boolean(updatedData.isActive),
1499
- updatedBy: updatedData.updatedBy || updatedData.createdBy || "System"
1500
- };
1501
- await getApiService().put(endpoint, payload);
1502
- await Swal2.fire("Success", "Workflow type updated successfully.", "success");
1503
- setIsEditOpen(false);
1504
- handleRefresh();
1505
- return true;
1506
- } catch (error) {
1507
- await Swal2.fire("Error", getErrorMessage(error, "Unable to update workflow type."), "error");
1508
- return false;
1509
- }
1703
+ const handleSaveEdit = (updatedData) => {
1704
+ console.log("Updated Data:", updatedData);
1510
1705
  };
1511
1706
  const handleDelete = (item) => {
1512
1707
  setSelectedItem(item);
1513
1708
  setIsDeleteOpen(true);
1514
1709
  };
1515
- const handleConfirmDelete = async (item) => {
1516
- var _a, _b, _c;
1517
- try {
1518
- const endpoints = getApiEndpoints();
1519
- const endpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.workflowType) == null ? void 0 : _b.update;
1520
- if (!endpoint) throw new Error("Workflow type update endpoint is not configured.");
1521
- await getApiService().put(endpoint, {
1522
- workflowTypeId: (_c = item.workflowTypeId) != null ? _c : item.WorkflowTypeId,
1523
- workflowTypeCode: item.workflowTypeCode,
1524
- workflowTypeName: item.workflowTypeName,
1525
- description: item.description || "",
1526
- isActive: false,
1527
- updatedBy: item.updatedBy || item.createdBy || "System"
1528
- });
1529
- await Swal2.fire("Success", "Workflow type has been deactivated successfully.", "success");
1530
- setIsDeleteOpen(false);
1531
- handleRefresh();
1532
- return true;
1533
- } catch (error) {
1534
- await Swal2.fire("Error", getErrorMessage(error, "Unable to deactivate workflow type."), "error");
1535
- return false;
1536
- }
1537
- };
1538
- const handleCreateSuccess = async () => {
1539
- await Swal2.fire("Success", "Workflow type created successfully.", "success");
1540
- setModalOpen(false);
1541
- handleRefresh();
1710
+ const handleConfirmDelete = (itemToDelete) => {
1711
+ console.log("Deleted Item:", itemToDelete);
1542
1712
  };
1543
1713
  return /* @__PURE__ */ jsxs14("div", { className: "fc:h-screen fc:overflow-hidden fc:bg-slate-50 fc:p-4 md:fc:fc:p-6", children: [
1544
- /* @__PURE__ */ jsx15(CommonHeader, { title: "Workflow Type", breadcrumbs: [{ label: "Dashboard", href: "/dashboard" }, { label: "Masters", href: "/masters" }, { label: "Workflow Type", href: "/WorkflowType" }], buttonText: "Add Workflow Type", onButtonClick: () => setModalOpen(true) }),
1714
+ /* @__PURE__ */ jsx15(CommonHeader, { title: "Workflow Type", breadcrumbs: [{
1715
+ label: "Dashboard",
1716
+ href: "/dashboard"
1717
+ }, {
1718
+ label: "Masters",
1719
+ href: "/masters"
1720
+ }, {
1721
+ label: "Workflow Type",
1722
+ href: "/WorkflowType"
1723
+ }], buttonText: "Add Workflow Type", onButtonClick: () => setModalOpen(true) }),
1545
1724
  /* @__PURE__ */ jsx15("div", { className: "fc:w-full fc:space-y-5", children: /* @__PURE__ */ jsxs14("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-200/80 fc:shadow-sm fc:space-y-5", children: [
1546
1725
  /* @__PURE__ */ jsxs14("div", { className: "fc:flex fc:justify-between fc:items-center fc:w-full fc:gap-4", children: [
1547
1726
  /* @__PURE__ */ jsx15("div", { className: "fc:w-full fc:max-w-xs", children: /* @__PURE__ */ jsx15(SearchBar2, { searchQuery, setSearchQuery, setCurrentPage }) }),
@@ -1556,9 +1735,12 @@ function WorkflowTypeMains() {
1556
1735
  ] })
1557
1736
  ] })
1558
1737
  ] }),
1559
- /* @__PURE__ */ jsx15("div", { ref: tableRef, children: /* @__PURE__ */ jsx15(WorkflowTypeTable, { data, isLoading, pageSize, searchQuery, currentPage, setCurrentPage, setTotalEntries, onEdit: handleEdit, onDelete: handleDelete }) })
1738
+ /* @__PURE__ */ jsxs14("div", { ref: tableRef, children: [
1739
+ /* @__PURE__ */ jsx15(WorkflowTypeTable, { pageSize, searchQuery, currentPage, setCurrentPage, setTotalEntries, onEdit: handleEdit, onDelete: handleDelete }, refreshkey),
1740
+ " "
1741
+ ] })
1560
1742
  ] }) }),
1561
- /* @__PURE__ */ jsx15(AddWorkflowTypeModal_default, { isOpen: modalOpen, onClose: () => setModalOpen(false), onSave: handleCreateSuccess }),
1743
+ /* @__PURE__ */ jsx15(AddWorkflowTypeModal_default, { isOpen: modalOpen, onClose: () => setModalOpen(false) }),
1562
1744
  /* @__PURE__ */ jsx15(EditWorkflowType_default, { isOpen: isEditOpen, onClose: () => setIsEditOpen(false), onSave: handleSaveEdit, selectedData: selectedItem }),
1563
1745
  /* @__PURE__ */ jsx15(DeleteWorkflowType_default, { isOpen: isDeleteOpen, onClose: () => setIsDeleteOpen(false), onConfirm: handleConfirmDelete, itemData: selectedItem })
1564
1746
  ] });
@@ -2859,10 +3041,10 @@ function MappingSearchBar({
2859
3041
  }
2860
3042
 
2861
3043
  // src/components/user-hierarchy-node-mapping/userhierarchynodetable.jsx
2862
- import React25, { useState as useState15, useEffect as useEffect7 } from "react";
3044
+ import React25, { useState as useState15, useEffect as useEffect6 } from "react";
2863
3045
 
2864
3046
  // src/components/user-hierarchy-node-mapping/edit-mapping.jsx
2865
- import React23, { useEffect as useEffect6, useState as useState14 } from "react";
3047
+ import React23, { useEffect as useEffect5, useState as useState14 } from "react";
2866
3048
  import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
2867
3049
  function EditUserHierarchyNodeMappingModal({
2868
3050
  isOpen,
@@ -2877,7 +3059,7 @@ function EditUserHierarchyNodeMappingModal({
2877
3059
  effectiveFrom: "",
2878
3060
  effectiveTo: ""
2879
3061
  });
2880
- useEffect6(() => {
3062
+ useEffect5(() => {
2881
3063
  if (selectedMapping) {
2882
3064
  setFormData({
2883
3065
  hierarchyNodeId: selectedMapping.hierarchyNodeId || "",
@@ -3381,7 +3563,7 @@ function UserHierarchyNodeMappingTable({
3381
3563
  const query = (searchQuery || "").toLowerCase();
3382
3564
  return String(item.mappingId).toLowerCase().includes(query) || String(item.externalUserId).toLowerCase().includes(query) || String(item.hierarchyNodeId).toLowerCase().includes(query) || item.roleCode.toLowerCase().includes(query);
3383
3565
  });
3384
- useEffect7(() => {
3566
+ useEffect6(() => {
3385
3567
  if (setTotalEntries) setTotalEntries(filteredData.length);
3386
3568
  }, [filteredData.length, setTotalEntries]);
3387
3569
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -3574,10 +3756,10 @@ function SearchBar3({
3574
3756
  }
3575
3757
 
3576
3758
  // src/components/document-configuration/DocumentConfigurationTable.jsx
3577
- import React30, { useState as useState18, useEffect as useEffect9 } from "react";
3759
+ import React30, { useState as useState18, useEffect as useEffect8 } from "react";
3578
3760
 
3579
3761
  // src/components/document-configuration/Edit.jsx
3580
- import React28, { useState as useState17, useEffect as useEffect8 } from "react";
3762
+ import React28, { useState as useState17, useEffect as useEffect7 } from "react";
3581
3763
  import { jsx as jsx28, jsxs as jsxs27 } from "react/jsx-runtime";
3582
3764
  function EditDocumentConfiguration({
3583
3765
  isOpen,
@@ -3595,7 +3777,7 @@ function EditDocumentConfiguration({
3595
3777
  status: "Active"
3596
3778
  });
3597
3779
  const [errors, setErrors] = useState17({});
3598
- useEffect8(() => {
3780
+ useEffect7(() => {
3599
3781
  if (initialData) {
3600
3782
  const sizeParts = (initialData.maxSize || "10 MB").split(" ");
3601
3783
  setFormData({
@@ -4025,7 +4207,7 @@ function DocumentConfigTable({
4025
4207
  const query = (searchQuery || "").toLowerCase();
4026
4208
  return item.docName.toLowerCase().includes(query) || item.extensions.toLowerCase().includes(query) || item.stepId.toLowerCase().includes(query);
4027
4209
  });
4028
- useEffect9(() => {
4210
+ useEffect8(() => {
4029
4211
  if (setTotalEntries) setTotalEntries(filteredData.length);
4030
4212
  }, [filteredData.length, setTotalEntries]);
4031
4213
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -4446,7 +4628,7 @@ function SearchBar4({
4446
4628
  }
4447
4629
 
4448
4630
  // src/components/audit-log/AuditLogTable.jsx
4449
- import React34, { useState as useState21, useEffect as useEffect10 } from "react";
4631
+ import React34, { useState as useState21, useEffect as useEffect9 } from "react";
4450
4632
  import { jsx as jsx34, jsxs as jsxs33 } from "react/jsx-runtime";
4451
4633
  function AuditLogTable({
4452
4634
  pageSize,
@@ -4674,7 +4856,7 @@ function AuditLogTable({
4674
4856
  const query = (searchQuery || "").toLowerCase();
4675
4857
  return item.logId.toLowerCase().includes(query) || item.user.toLowerCase().includes(query) || item.section.toLowerCase().includes(query) || item.action.toLowerCase().includes(query);
4676
4858
  });
4677
- useEffect10(() => {
4859
+ useEffect9(() => {
4678
4860
  if (setTotalEntries) setTotalEntries(filteredData.length);
4679
4861
  }, [filteredData.length, setTotalEntries]);
4680
4862
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -4962,7 +5144,7 @@ function SearchBar5({
4962
5144
  }
4963
5145
 
4964
5146
  // src/components/movement-history/MovementHistoryTable.jsx
4965
- import React38, { useState as useState24, useEffect as useEffect11 } from "react";
5147
+ import React38, { useState as useState24, useEffect as useEffect10 } from "react";
4966
5148
  import { jsx as jsx38, jsxs as jsxs37 } from "react/jsx-runtime";
4967
5149
  function MovementHistoryTable({
4968
5150
  pageSize,
@@ -5190,7 +5372,7 @@ function MovementHistoryTable({
5190
5372
  const query = (searchQuery || "").toLowerCase();
5191
5373
  return item.movementHistoryId.toLowerCase().includes(query) || item.name.toLowerCase().includes(query) || item.toStepId.toLowerCase().includes(query);
5192
5374
  });
5193
- useEffect11(() => {
5375
+ useEffect10(() => {
5194
5376
  if (setTotalEntries) setTotalEntries(filteredData.length);
5195
5377
  }, [filteredData.length, setTotalEntries]);
5196
5378
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -5472,7 +5654,7 @@ function SearchBar6({
5472
5654
  }
5473
5655
 
5474
5656
  // src/components/task-permission/Table.js
5475
- import React42, { useState as useState27, useEffect as useEffect12 } from "react";
5657
+ import React42, { useState as useState27, useEffect as useEffect11 } from "react";
5476
5658
  import { jsx as jsx42, jsxs as jsxs41 } from "react/jsx-runtime";
5477
5659
  function Table({
5478
5660
  pageSize,
@@ -5719,7 +5901,7 @@ function Table({
5719
5901
  }
5720
5902
  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);
5721
5903
  });
5722
- useEffect12(() => {
5904
+ useEffect11(() => {
5723
5905
  if (setTotalEntries) setTotalEntries(filteredData.length);
5724
5906
  }, [filteredData.length, setTotalEntries]);
5725
5907
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -6056,7 +6238,7 @@ function SearchBar7({
6056
6238
  }
6057
6239
 
6058
6240
  // src/components/Workflow-Setting/Table.js
6059
- import React46, { useState as useState30, useEffect as useEffect13 } from "react";
6241
+ import React46, { useState as useState30, useEffect as useEffect12 } from "react";
6060
6242
  import { jsx as jsx46, jsxs as jsxs45 } from "react/jsx-runtime";
6061
6243
  function Table2({
6062
6244
  pageSize,
@@ -6303,7 +6485,7 @@ function Table2({
6303
6485
  }
6304
6486
  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);
6305
6487
  });
6306
- useEffect13(() => {
6488
+ useEffect12(() => {
6307
6489
  if (setTotalEntries) setTotalEntries(filteredData.length);
6308
6490
  }, [filteredData.length, setTotalEntries]);
6309
6491
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -6579,7 +6761,7 @@ function SearchBar8({
6579
6761
  }
6580
6762
 
6581
6763
  // src/components/notification/Table.js
6582
- import React50, { useState as useState33, useEffect as useEffect14 } from "react";
6764
+ import React50, { useState as useState33, useEffect as useEffect13 } from "react";
6583
6765
  import { jsx as jsx50, jsxs as jsxs49 } from "react/jsx-runtime";
6584
6766
  function Table3({
6585
6767
  pageSize,
@@ -6826,7 +7008,7 @@ function Table3({
6826
7008
  }
6827
7009
  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);
6828
7010
  });
6829
- useEffect14(() => {
7011
+ useEffect13(() => {
6830
7012
  if (setTotalEntries) setTotalEntries(filteredData.length);
6831
7013
  }, [filteredData.length, setTotalEntries]);
6832
7014
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -7112,10 +7294,10 @@ function TaskInstanceSearchBar({
7112
7294
  }
7113
7295
 
7114
7296
  // src/components/task-instance/taskinstancetable.jsx
7115
- import React56, { useState as useState37, useEffect as useEffect16 } from "react";
7297
+ import React56, { useState as useState37, useEffect as useEffect15 } from "react";
7116
7298
 
7117
7299
  // src/components/task-instance/edit-instance.jsx
7118
- import React54, { useEffect as useEffect15, useState as useState36 } from "react";
7300
+ import React54, { useEffect as useEffect14, useState as useState36 } from "react";
7119
7301
  import { jsx as jsx54, jsxs as jsxs53 } from "react/jsx-runtime";
7120
7302
  function EditTaskInstanceModal({
7121
7303
  isOpen,
@@ -7131,7 +7313,7 @@ function EditTaskInstanceModal({
7131
7313
  escalatedOn: "",
7132
7314
  slaStatus: ""
7133
7315
  });
7134
- useEffect15(() => {
7316
+ useEffect14(() => {
7135
7317
  if (selectedTask) {
7136
7318
  setFormData({
7137
7319
  assignedUserId: selectedTask.assignedUserId || selectedTask.assigned_user_id || "",
@@ -7652,7 +7834,7 @@ function TaskInstanceTable({
7652
7834
  const query = (searchQuery || "").toLowerCase();
7653
7835
  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);
7654
7836
  });
7655
- useEffect16(() => {
7837
+ useEffect15(() => {
7656
7838
  if (setTotalEntries) setTotalEntries(filteredData.length);
7657
7839
  }, [filteredData.length, setTotalEntries]);
7658
7840
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -8021,7 +8203,7 @@ function CommentSearchBar({
8021
8203
  }
8022
8204
 
8023
8205
  // src/components/comment/commenttable.jsx
8024
- import React60, { useState as useState39, useEffect as useEffect17 } from "react";
8206
+ import React60, { useState as useState39, useEffect as useEffect16 } from "react";
8025
8207
  import { jsx as jsx60, jsxs as jsxs59 } from "react/jsx-runtime";
8026
8208
  function CommentTable({
8027
8209
  pageSize,
@@ -8249,7 +8431,7 @@ function CommentTable({
8249
8431
  const query = (searchQuery || "").toLowerCase();
8250
8432
  return String(item.commentId).toLowerCase().includes(query) || String(item.taskInstanceId).toLowerCase().includes(query) || item.comment.toLowerCase().includes(query) || String(item.commentedBy).toLowerCase().includes(query);
8251
8433
  });
8252
- useEffect17(() => {
8434
+ useEffect16(() => {
8253
8435
  if (setTotalEntries) setTotalEntries(filteredData.length);
8254
8436
  }, [filteredData.length, setTotalEntries]);
8255
8437
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -8623,10 +8805,10 @@ function SearchBar9({ searchQuery, setSearchQuery }) {
8623
8805
  }
8624
8806
 
8625
8807
  // src/components/hierarchy-node/HierarchyTable.jsx
8626
- import React66, { useState as useState43, useEffect as useEffect19 } from "react";
8808
+ import React66, { useState as useState43, useEffect as useEffect18 } from "react";
8627
8809
 
8628
8810
  // src/components/hierarchy-node/AddEditModal.jsx
8629
- import React64, { useEffect as useEffect18, useState as useState42 } from "react";
8811
+ import React64, { useEffect as useEffect17, useState as useState42 } from "react";
8630
8812
  import { jsx as jsx64, jsxs as jsxs63 } from "react/jsx-runtime";
8631
8813
  function AddEditModal2({
8632
8814
  isOpen,
@@ -8644,7 +8826,7 @@ function AddEditModal2({
8644
8826
  externalEntityId: "",
8645
8827
  isActive: true
8646
8828
  });
8647
- useEffect18(() => {
8829
+ useEffect17(() => {
8648
8830
  if (editData) {
8649
8831
  setFormData(editData);
8650
8832
  }
@@ -8959,7 +9141,7 @@ function HierarchyTable({
8959
9141
  const [editOpen, setEditOpen] = useState43(false);
8960
9142
  const [deleteOpen, setDeleteOpen] = useState43(false);
8961
9143
  const [selectedNode, setSelectedNode] = useState43(null);
8962
- useEffect19(() => {
9144
+ useEffect18(() => {
8963
9145
  setCurrentPage(1);
8964
9146
  }, [searchQuery, pageSize]);
8965
9147
  const handleSort = (column) => {
@@ -10981,7 +11163,7 @@ function SearchBar12({
10981
11163
  }
10982
11164
 
10983
11165
  // src/components/assignment-rule/Table.js
10984
- import React82, { useState as useState53, useEffect as useEffect20 } from "react";
11166
+ import React82, { useState as useState53, useEffect as useEffect19 } from "react";
10985
11167
  import { jsx as jsx82, jsxs as jsxs81 } from "react/jsx-runtime";
10986
11168
  function Table4({
10987
11169
  pageSize,
@@ -11147,7 +11329,7 @@ function Table4({
11147
11329
  const query = searchQuery.toLowerCase().trim();
11148
11330
  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);
11149
11331
  });
11150
- useEffect20(() => {
11332
+ useEffect19(() => {
11151
11333
  if (setTotalEntries) setTotalEntries(filteredData.length);
11152
11334
  }, [filteredData.length, setTotalEntries]);
11153
11335
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;