flowcore-fn 9.2.6 → 9.2.7

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,7 +1029,8 @@ function Workflow() {
1029
1029
  }
1030
1030
 
1031
1031
  // src/components/workflow-type/WorkflowTypeMains.js
1032
- import React15, { useState as useState9, useRef as useRef3 } from "react";
1032
+ import React15, { useCallback, useEffect as useEffect5, useRef as useRef3, useState as useState9 } from "react";
1033
+ import Swal2 from "sweetalert2";
1033
1034
 
1034
1035
  // src/components/workflow-type/SearchBar.jsx
1035
1036
  import React10 from "react";
@@ -1056,475 +1057,89 @@ function SearchBar2({
1056
1057
  }
1057
1058
 
1058
1059
  // src/components/workflow-type/WorkflowTypeTable.jsx
1059
- import React13, { useState as useState7, useEffect as useEffect4 } from "react";
1060
-
1061
- // src/components/workflow-type/DeleteWorkflowType.jsx
1062
- import React11 from "react";
1060
+ import React11, { useEffect as useEffect3, useMemo, useState as useState6 } from "react";
1063
1061
  import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
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);
1062
+ function WorkflowTypeTable({ data = [], isLoading, pageSize, searchQuery = "", currentPage, setCurrentPage, setTotalEntries, onEdit, onDelete }) {
1063
+ const [sortOrder, setSortOrder] = useState6("asc");
1064
+ const [sortKey, setSortKey] = useState6("workflowTypeId");
1438
1065
  const handleSort = (columnKey) => {
1439
1066
  const isAsc = sortKey === columnKey && sortOrder === "asc";
1440
1067
  setSortOrder(isAsc ? "desc" : "asc");
1441
1068
  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);
1448
1069
  };
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);
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);
1455
1084
  }, [filteredData.length, setTotalEntries]);
1456
- const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
1085
+ const totalPages = Math.ceil(sortedData.length / pageSize) || 1;
1086
+ useEffect3(() => {
1087
+ if (currentPage > totalPages) setCurrentPage(totalPages);
1088
+ }, [currentPage, setCurrentPage, totalPages]);
1457
1089
  const startIndex = (currentPage - 1) * pageSize;
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: [
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: [
1481
1097
  "ID ",
1482
- sortKey === "workflowTypeId" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
1098
+ sortIcon("workflowTypeId")
1483
1099
  ] }),
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: [
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: [
1485
1101
  "Code ",
1486
- sortKey === "workflowTypeCode" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
1102
+ sortIcon("workflowTypeCode")
1487
1103
  ] }),
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: [
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: [
1489
1105
  "Name ",
1490
- sortKey === "workflowTypeName" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
1106
+ sortIcon("workflowTypeName")
1491
1107
  ] }),
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: [
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: [
1493
1109
  "Description ",
1494
- sortKey === "description" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
1110
+ sortIcon("description")
1495
1111
  ] }),
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: [
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: [
1498
1114
  "Created On ",
1499
- sortKey === "createdOn" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
1115
+ sortIcon("createdOn")
1500
1116
  ] }),
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" })
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" })
1502
1118
  ] }) }),
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" })
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" })
1513
1129
  ] }) })
1514
1130
  ] }, item.workflowTypeId)) })
1515
1131
  ] }) }),
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 })
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
+ ] })
1523
1137
  ] });
1524
1138
  }
1525
1139
 
1526
1140
  // src/components/workflow-type/AddWorkflowTypeModal.jsx
1527
- import React14, { useState as useState8 } from "react";
1141
+ import React12, { useState as useState7 } from "react";
1142
+ import Swal from "sweetalert2";
1528
1143
 
1529
1144
  // src/components/Service/ApiEndpointsProvider.js
1530
1145
  var STORAGE_KEY = "FLOWCORE_API_ENDPOINTS";
@@ -1575,7 +1190,7 @@ var getApiService = () => {
1575
1190
  var ApiServicepackage_default = ApiServicepackage;
1576
1191
 
1577
1192
  // src/components/workflow-type/AddWorkflowTypeModal.jsx
1578
- import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1193
+ import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1579
1194
  var initialFormData = {
1580
1195
  workflowTypeCode: "",
1581
1196
  workflowTypeName: "",
@@ -1583,12 +1198,12 @@ var initialFormData = {
1583
1198
  createdBy: ""
1584
1199
  };
1585
1200
  var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1586
- const [formData, setFormData] = useState8(__spreadProps(__spreadValues({}, initialFormData), {
1201
+ const [formData, setFormData] = useState7(__spreadProps(__spreadValues({}, initialFormData), {
1587
1202
  createdBy
1588
1203
  }));
1589
- const [errors, setErrors] = useState8({});
1590
- const [isSubmitting, setIsSubmitting] = useState8(false);
1591
- const [submitError, setSubmitError] = useState8("");
1204
+ const [errors, setErrors] = useState7({});
1205
+ const [isSubmitting, setIsSubmitting] = useState7(false);
1206
+ const [submitError, setSubmitError] = useState7("");
1592
1207
  const handleChange = ({ target: { name, value } }) => {
1593
1208
  if (name === "description" && value.length > 500) return;
1594
1209
  setFormData((previous) => __spreadProps(__spreadValues({}, previous), { [name]: value }));
@@ -1607,7 +1222,7 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1607
1222
  if (!isSubmitting) onClose();
1608
1223
  };
1609
1224
  const handleSubmit = async (event) => {
1610
- var _a, _b, _c, _d, _e;
1225
+ var _a, _b, _c, _d, _e, _f, _g;
1611
1226
  event.preventDefault();
1612
1227
  if (!validateForm()) return;
1613
1228
  const payload = {
@@ -1620,7 +1235,7 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1620
1235
  setIsSubmitting(true);
1621
1236
  setSubmitError("");
1622
1237
  const endpoints = getApiEndpoints();
1623
- const endpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.workflow) == null ? void 0 : _b.createWorkflowList;
1238
+ const endpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.workflowType) == null ? void 0 : _b.create;
1624
1239
  if (!endpoint) throw new Error("Create workflow type endpoint is not configured.");
1625
1240
  const response = await getApiService().post(endpoint, payload);
1626
1241
  await (onSave == null ? void 0 : onSave((_c = response == null ? void 0 : response.data) != null ? _c : response));
@@ -1628,99 +1243,305 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1628
1243
  setErrors({});
1629
1244
  onClose();
1630
1245
  } catch (error) {
1631
- setSubmitError(
1632
- ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to create workflow type. Please try again."
1633
- );
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");
1634
1249
  } finally {
1635
1250
  setIsSubmitting(false);
1636
1251
  }
1637
1252
  };
1638
1253
  if (!isOpen) return null;
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" })
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" })
1644
1259
  ] }),
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" })
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" })
1646
1261
  ] }),
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) }) })
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) }) })
1651
1266
  ] }),
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: [
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: [
1656
1271
  formData.description.length,
1657
1272
  "/500"
1658
1273
  ] })
1659
1274
  ] }) }),
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" })
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" })
1664
1279
  ] })
1665
1280
  ] })
1666
1281
  ] }) });
1667
1282
  };
1668
1283
  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"}`;
1669
- var FormField = ({ label, required, error, children }) => /* @__PURE__ */ jsxs13("label", { className: "fc:block fc:text-xs fc:font-semibold fc:text-gray-700", children: [
1284
+ var FormField = ({ label, required, error, children }) => /* @__PURE__ */ jsxs11("label", { className: "fc:block fc:text-xs fc:font-semibold fc:text-gray-700", children: [
1670
1285
  label,
1671
1286
  " ",
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 })
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 })
1675
1290
  ] });
1676
1291
  var AddWorkflowTypeModal_default = AddWorkflowTypeModal;
1677
1292
 
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
+
1678
1403
  // src/components/workflow-type/WorkflowTypeMains.js
1679
1404
  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
+ };
1680
1432
  function WorkflowTypeMains() {
1681
1433
  const [refreshkey, setRefreshKey] = useState9(0);
1682
- const handleRefresh = () => {
1683
- console.log("Table data refreshed!");
1684
- setRefreshKey((prev) => prev + 1);
1685
- };
1686
1434
  const tableRef = useRef3(null);
1687
1435
  const [modalOpen, setModalOpen] = useState9(false);
1688
1436
  const [pageSize, setPageSize] = useState9(10);
1689
1437
  const [searchQuery, setSearchQuery] = useState9("");
1690
1438
  const [currentPage, setCurrentPage] = useState9(1);
1691
- const [totalEntries, setTotalEntries] = useState9(0);
1439
+ const [, setTotalEntries] = useState9(0);
1440
+ const [data, setData] = useState9([]);
1441
+ const [isLoading, setIsLoading] = useState9(false);
1692
1442
  const [isEditOpen, setIsEditOpen] = useState9(false);
1693
1443
  const [isDeleteOpen, setIsDeleteOpen] = useState9(false);
1694
1444
  const [selectedItem, setSelectedItem] = useState9(null);
1695
- const handlePageSizeChange = (e) => {
1696
- setPageSize(Number(e.target.value));
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));
1697
1469
  setCurrentPage(1);
1698
1470
  };
1699
- const handleEdit = (item) => {
1700
- setSelectedItem(item);
1701
- setIsEditOpen(true);
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
+ }
1702
1486
  };
1703
- const handleSaveEdit = (updatedData) => {
1704
- console.log("Updated Data:", updatedData);
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
+ }
1705
1510
  };
1706
1511
  const handleDelete = (item) => {
1707
1512
  setSelectedItem(item);
1708
1513
  setIsDeleteOpen(true);
1709
1514
  };
1710
- const handleConfirmDelete = (itemToDelete) => {
1711
- console.log("Deleted Item:", itemToDelete);
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();
1712
1542
  };
1713
1543
  return /* @__PURE__ */ jsxs14("div", { className: "fc:h-screen fc:overflow-hidden fc:bg-slate-50 fc:p-4 md:fc:fc:p-6", children: [
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) }),
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) }),
1724
1545
  /* @__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: [
1725
1546
  /* @__PURE__ */ jsxs14("div", { className: "fc:flex fc:justify-between fc:items-center fc:w-full fc:gap-4", children: [
1726
1547
  /* @__PURE__ */ jsx15("div", { className: "fc:w-full fc:max-w-xs", children: /* @__PURE__ */ jsx15(SearchBar2, { searchQuery, setSearchQuery, setCurrentPage }) }),
@@ -1735,12 +1556,9 @@ function WorkflowTypeMains() {
1735
1556
  ] })
1736
1557
  ] })
1737
1558
  ] }),
1738
- /* @__PURE__ */ jsxs14("div", { ref: tableRef, children: [
1739
- /* @__PURE__ */ jsx15(WorkflowTypeTable, { pageSize, searchQuery, currentPage, setCurrentPage, setTotalEntries, onEdit: handleEdit, onDelete: handleDelete }, refreshkey),
1740
- " "
1741
- ] })
1559
+ /* @__PURE__ */ jsx15("div", { ref: tableRef, children: /* @__PURE__ */ jsx15(WorkflowTypeTable, { data, isLoading, pageSize, searchQuery, currentPage, setCurrentPage, setTotalEntries, onEdit: handleEdit, onDelete: handleDelete }) })
1742
1560
  ] }) }),
1743
- /* @__PURE__ */ jsx15(AddWorkflowTypeModal_default, { isOpen: modalOpen, onClose: () => setModalOpen(false) }),
1561
+ /* @__PURE__ */ jsx15(AddWorkflowTypeModal_default, { isOpen: modalOpen, onClose: () => setModalOpen(false), onSave: handleCreateSuccess }),
1744
1562
  /* @__PURE__ */ jsx15(EditWorkflowType_default, { isOpen: isEditOpen, onClose: () => setIsEditOpen(false), onSave: handleSaveEdit, selectedData: selectedItem }),
1745
1563
  /* @__PURE__ */ jsx15(DeleteWorkflowType_default, { isOpen: isDeleteOpen, onClose: () => setIsDeleteOpen(false), onConfirm: handleConfirmDelete, itemData: selectedItem })
1746
1564
  ] });
@@ -3041,10 +2859,10 @@ function MappingSearchBar({
3041
2859
  }
3042
2860
 
3043
2861
  // src/components/user-hierarchy-node-mapping/userhierarchynodetable.jsx
3044
- import React25, { useState as useState15, useEffect as useEffect6 } from "react";
2862
+ import React25, { useState as useState15, useEffect as useEffect7 } from "react";
3045
2863
 
3046
2864
  // src/components/user-hierarchy-node-mapping/edit-mapping.jsx
3047
- import React23, { useEffect as useEffect5, useState as useState14 } from "react";
2865
+ import React23, { useEffect as useEffect6, useState as useState14 } from "react";
3048
2866
  import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
3049
2867
  function EditUserHierarchyNodeMappingModal({
3050
2868
  isOpen,
@@ -3059,7 +2877,7 @@ function EditUserHierarchyNodeMappingModal({
3059
2877
  effectiveFrom: "",
3060
2878
  effectiveTo: ""
3061
2879
  });
3062
- useEffect5(() => {
2880
+ useEffect6(() => {
3063
2881
  if (selectedMapping) {
3064
2882
  setFormData({
3065
2883
  hierarchyNodeId: selectedMapping.hierarchyNodeId || "",
@@ -3563,7 +3381,7 @@ function UserHierarchyNodeMappingTable({
3563
3381
  const query = (searchQuery || "").toLowerCase();
3564
3382
  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
3383
  });
3566
- useEffect6(() => {
3384
+ useEffect7(() => {
3567
3385
  if (setTotalEntries) setTotalEntries(filteredData.length);
3568
3386
  }, [filteredData.length, setTotalEntries]);
3569
3387
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -3756,10 +3574,10 @@ function SearchBar3({
3756
3574
  }
3757
3575
 
3758
3576
  // src/components/document-configuration/DocumentConfigurationTable.jsx
3759
- import React30, { useState as useState18, useEffect as useEffect8 } from "react";
3577
+ import React30, { useState as useState18, useEffect as useEffect9 } from "react";
3760
3578
 
3761
3579
  // src/components/document-configuration/Edit.jsx
3762
- import React28, { useState as useState17, useEffect as useEffect7 } from "react";
3580
+ import React28, { useState as useState17, useEffect as useEffect8 } from "react";
3763
3581
  import { jsx as jsx28, jsxs as jsxs27 } from "react/jsx-runtime";
3764
3582
  function EditDocumentConfiguration({
3765
3583
  isOpen,
@@ -3777,7 +3595,7 @@ function EditDocumentConfiguration({
3777
3595
  status: "Active"
3778
3596
  });
3779
3597
  const [errors, setErrors] = useState17({});
3780
- useEffect7(() => {
3598
+ useEffect8(() => {
3781
3599
  if (initialData) {
3782
3600
  const sizeParts = (initialData.maxSize || "10 MB").split(" ");
3783
3601
  setFormData({
@@ -4207,7 +4025,7 @@ function DocumentConfigTable({
4207
4025
  const query = (searchQuery || "").toLowerCase();
4208
4026
  return item.docName.toLowerCase().includes(query) || item.extensions.toLowerCase().includes(query) || item.stepId.toLowerCase().includes(query);
4209
4027
  });
4210
- useEffect8(() => {
4028
+ useEffect9(() => {
4211
4029
  if (setTotalEntries) setTotalEntries(filteredData.length);
4212
4030
  }, [filteredData.length, setTotalEntries]);
4213
4031
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -4628,7 +4446,7 @@ function SearchBar4({
4628
4446
  }
4629
4447
 
4630
4448
  // src/components/audit-log/AuditLogTable.jsx
4631
- import React34, { useState as useState21, useEffect as useEffect9 } from "react";
4449
+ import React34, { useState as useState21, useEffect as useEffect10 } from "react";
4632
4450
  import { jsx as jsx34, jsxs as jsxs33 } from "react/jsx-runtime";
4633
4451
  function AuditLogTable({
4634
4452
  pageSize,
@@ -4856,7 +4674,7 @@ function AuditLogTable({
4856
4674
  const query = (searchQuery || "").toLowerCase();
4857
4675
  return item.logId.toLowerCase().includes(query) || item.user.toLowerCase().includes(query) || item.section.toLowerCase().includes(query) || item.action.toLowerCase().includes(query);
4858
4676
  });
4859
- useEffect9(() => {
4677
+ useEffect10(() => {
4860
4678
  if (setTotalEntries) setTotalEntries(filteredData.length);
4861
4679
  }, [filteredData.length, setTotalEntries]);
4862
4680
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -5144,7 +4962,7 @@ function SearchBar5({
5144
4962
  }
5145
4963
 
5146
4964
  // src/components/movement-history/MovementHistoryTable.jsx
5147
- import React38, { useState as useState24, useEffect as useEffect10 } from "react";
4965
+ import React38, { useState as useState24, useEffect as useEffect11 } from "react";
5148
4966
  import { jsx as jsx38, jsxs as jsxs37 } from "react/jsx-runtime";
5149
4967
  function MovementHistoryTable({
5150
4968
  pageSize,
@@ -5372,7 +5190,7 @@ function MovementHistoryTable({
5372
5190
  const query = (searchQuery || "").toLowerCase();
5373
5191
  return item.movementHistoryId.toLowerCase().includes(query) || item.name.toLowerCase().includes(query) || item.toStepId.toLowerCase().includes(query);
5374
5192
  });
5375
- useEffect10(() => {
5193
+ useEffect11(() => {
5376
5194
  if (setTotalEntries) setTotalEntries(filteredData.length);
5377
5195
  }, [filteredData.length, setTotalEntries]);
5378
5196
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -5654,7 +5472,7 @@ function SearchBar6({
5654
5472
  }
5655
5473
 
5656
5474
  // src/components/task-permission/Table.js
5657
- import React42, { useState as useState27, useEffect as useEffect11 } from "react";
5475
+ import React42, { useState as useState27, useEffect as useEffect12 } from "react";
5658
5476
  import { jsx as jsx42, jsxs as jsxs41 } from "react/jsx-runtime";
5659
5477
  function Table({
5660
5478
  pageSize,
@@ -5901,7 +5719,7 @@ function Table({
5901
5719
  }
5902
5720
  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
5721
  });
5904
- useEffect11(() => {
5722
+ useEffect12(() => {
5905
5723
  if (setTotalEntries) setTotalEntries(filteredData.length);
5906
5724
  }, [filteredData.length, setTotalEntries]);
5907
5725
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -6238,7 +6056,7 @@ function SearchBar7({
6238
6056
  }
6239
6057
 
6240
6058
  // src/components/Workflow-Setting/Table.js
6241
- import React46, { useState as useState30, useEffect as useEffect12 } from "react";
6059
+ import React46, { useState as useState30, useEffect as useEffect13 } from "react";
6242
6060
  import { jsx as jsx46, jsxs as jsxs45 } from "react/jsx-runtime";
6243
6061
  function Table2({
6244
6062
  pageSize,
@@ -6485,7 +6303,7 @@ function Table2({
6485
6303
  }
6486
6304
  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
6305
  });
6488
- useEffect12(() => {
6306
+ useEffect13(() => {
6489
6307
  if (setTotalEntries) setTotalEntries(filteredData.length);
6490
6308
  }, [filteredData.length, setTotalEntries]);
6491
6309
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -6761,7 +6579,7 @@ function SearchBar8({
6761
6579
  }
6762
6580
 
6763
6581
  // src/components/notification/Table.js
6764
- import React50, { useState as useState33, useEffect as useEffect13 } from "react";
6582
+ import React50, { useState as useState33, useEffect as useEffect14 } from "react";
6765
6583
  import { jsx as jsx50, jsxs as jsxs49 } from "react/jsx-runtime";
6766
6584
  function Table3({
6767
6585
  pageSize,
@@ -7008,7 +6826,7 @@ function Table3({
7008
6826
  }
7009
6827
  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
6828
  });
7011
- useEffect13(() => {
6829
+ useEffect14(() => {
7012
6830
  if (setTotalEntries) setTotalEntries(filteredData.length);
7013
6831
  }, [filteredData.length, setTotalEntries]);
7014
6832
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -7294,10 +7112,10 @@ function TaskInstanceSearchBar({
7294
7112
  }
7295
7113
 
7296
7114
  // src/components/task-instance/taskinstancetable.jsx
7297
- import React56, { useState as useState37, useEffect as useEffect15 } from "react";
7115
+ import React56, { useState as useState37, useEffect as useEffect16 } from "react";
7298
7116
 
7299
7117
  // src/components/task-instance/edit-instance.jsx
7300
- import React54, { useEffect as useEffect14, useState as useState36 } from "react";
7118
+ import React54, { useEffect as useEffect15, useState as useState36 } from "react";
7301
7119
  import { jsx as jsx54, jsxs as jsxs53 } from "react/jsx-runtime";
7302
7120
  function EditTaskInstanceModal({
7303
7121
  isOpen,
@@ -7313,7 +7131,7 @@ function EditTaskInstanceModal({
7313
7131
  escalatedOn: "",
7314
7132
  slaStatus: ""
7315
7133
  });
7316
- useEffect14(() => {
7134
+ useEffect15(() => {
7317
7135
  if (selectedTask) {
7318
7136
  setFormData({
7319
7137
  assignedUserId: selectedTask.assignedUserId || selectedTask.assigned_user_id || "",
@@ -7834,7 +7652,7 @@ function TaskInstanceTable({
7834
7652
  const query = (searchQuery || "").toLowerCase();
7835
7653
  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
7654
  });
7837
- useEffect15(() => {
7655
+ useEffect16(() => {
7838
7656
  if (setTotalEntries) setTotalEntries(filteredData.length);
7839
7657
  }, [filteredData.length, setTotalEntries]);
7840
7658
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -8203,7 +8021,7 @@ function CommentSearchBar({
8203
8021
  }
8204
8022
 
8205
8023
  // src/components/comment/commenttable.jsx
8206
- import React60, { useState as useState39, useEffect as useEffect16 } from "react";
8024
+ import React60, { useState as useState39, useEffect as useEffect17 } from "react";
8207
8025
  import { jsx as jsx60, jsxs as jsxs59 } from "react/jsx-runtime";
8208
8026
  function CommentTable({
8209
8027
  pageSize,
@@ -8431,7 +8249,7 @@ function CommentTable({
8431
8249
  const query = (searchQuery || "").toLowerCase();
8432
8250
  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
8251
  });
8434
- useEffect16(() => {
8252
+ useEffect17(() => {
8435
8253
  if (setTotalEntries) setTotalEntries(filteredData.length);
8436
8254
  }, [filteredData.length, setTotalEntries]);
8437
8255
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -8805,10 +8623,10 @@ function SearchBar9({ searchQuery, setSearchQuery }) {
8805
8623
  }
8806
8624
 
8807
8625
  // src/components/hierarchy-node/HierarchyTable.jsx
8808
- import React66, { useState as useState43, useEffect as useEffect18 } from "react";
8626
+ import React66, { useState as useState43, useEffect as useEffect19 } from "react";
8809
8627
 
8810
8628
  // src/components/hierarchy-node/AddEditModal.jsx
8811
- import React64, { useEffect as useEffect17, useState as useState42 } from "react";
8629
+ import React64, { useEffect as useEffect18, useState as useState42 } from "react";
8812
8630
  import { jsx as jsx64, jsxs as jsxs63 } from "react/jsx-runtime";
8813
8631
  function AddEditModal2({
8814
8632
  isOpen,
@@ -8826,7 +8644,7 @@ function AddEditModal2({
8826
8644
  externalEntityId: "",
8827
8645
  isActive: true
8828
8646
  });
8829
- useEffect17(() => {
8647
+ useEffect18(() => {
8830
8648
  if (editData) {
8831
8649
  setFormData(editData);
8832
8650
  }
@@ -9141,7 +8959,7 @@ function HierarchyTable({
9141
8959
  const [editOpen, setEditOpen] = useState43(false);
9142
8960
  const [deleteOpen, setDeleteOpen] = useState43(false);
9143
8961
  const [selectedNode, setSelectedNode] = useState43(null);
9144
- useEffect18(() => {
8962
+ useEffect19(() => {
9145
8963
  setCurrentPage(1);
9146
8964
  }, [searchQuery, pageSize]);
9147
8965
  const handleSort = (column) => {
@@ -11163,7 +10981,7 @@ function SearchBar12({
11163
10981
  }
11164
10982
 
11165
10983
  // src/components/assignment-rule/Table.js
11166
- import React82, { useState as useState53, useEffect as useEffect19 } from "react";
10984
+ import React82, { useState as useState53, useEffect as useEffect20 } from "react";
11167
10985
  import { jsx as jsx82, jsxs as jsxs81 } from "react/jsx-runtime";
11168
10986
  function Table4({
11169
10987
  pageSize,
@@ -11329,7 +11147,7 @@ function Table4({
11329
11147
  const query = searchQuery.toLowerCase().trim();
11330
11148
  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
11149
  });
11332
- useEffect19(() => {
11150
+ useEffect20(() => {
11333
11151
  if (setTotalEntries) setTotalEntries(filteredData.length);
11334
11152
  }, [filteredData.length, setTotalEntries]);
11335
11153
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -11716,7 +11534,7 @@ function Sidebar({
11716
11534
  const Icon = item.icon;
11717
11535
  const handleClick = () => {
11718
11536
  if (item.component) {
11719
- router.push("/", void 0, {
11537
+ router.push("/flowCore", void 0, {
11720
11538
  shallow: true
11721
11539
  });
11722
11540
  setActiveComponent(item.component);