flowcore-fn 9.4.8 → 9.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,15 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1
+ import {
2
+ ApiEndpointsProvider_default,
3
+ getApiEndpoints
4
+ } from "./chunk-3NI4QKQW.mjs";
5
+ import {
6
+ ApiServicepackage_default,
7
+ getApiService
8
+ } from "./chunk-HRODB3L2.mjs";
9
+ import {
10
+ __spreadProps,
11
+ __spreadValues
12
+ } from "./chunk-I4E63NIC.mjs";
20
13
 
21
14
  // src/components/Sidebar.jsx
22
15
  import { useState as useState62 } from "react";
@@ -27,54 +20,6 @@ import { useRouter } from "next/router";
27
20
  import React9, { useState as useState6, useRef as useRef2, useEffect as useEffect5 } from "react";
28
21
  import Swal3 from "sweetalert2";
29
22
 
30
- // src/components/Service/ApiEndpointsProvider.js
31
- var STORAGE_KEY = "FLOWCORE_API_ENDPOINTS";
32
- var apiEndpoints = null;
33
- var ApiEndpointsProvider = ({ apiEndpoints: endpoints }) => {
34
- if (typeof window !== "undefined" && endpoints) {
35
- apiEndpoints = endpoints;
36
- sessionStorage.setItem(
37
- STORAGE_KEY,
38
- JSON.stringify(endpoints)
39
- );
40
- }
41
- return null;
42
- };
43
- var getApiEndpoints = () => {
44
- if (apiEndpoints) {
45
- return apiEndpoints;
46
- }
47
- if (typeof window !== "undefined") {
48
- const data = sessionStorage.getItem(STORAGE_KEY);
49
- if (data) {
50
- apiEndpoints = JSON.parse(data);
51
- return apiEndpoints;
52
- }
53
- }
54
- throw new Error(
55
- "Api Endpoints not initialized. Please render <ApiEndpointsProvider apiEndpoints={ApiEndPoints} /> once before using FlowCore."
56
- );
57
- };
58
- var ApiEndpointsProvider_default = ApiEndpointsProvider;
59
-
60
- // src/components/Service/ApiServicepackage.js
61
- var apiService = null;
62
- var ApiServicepackage = ({ apiService: service }) => {
63
- if (service) {
64
- apiService = service;
65
- }
66
- return null;
67
- };
68
- var getApiService = () => {
69
- if (apiService) {
70
- return apiService;
71
- }
72
- throw new Error(
73
- "ApiService not initialized. Please render <ApiServicepackage apiService={ApiService} /> once before using FlowCore."
74
- );
75
- };
76
- var ApiServicepackage_default = ApiServicepackage;
77
-
78
23
  // src/components/workflow/SearchBar.jsx
79
24
  import React from "react";
80
25
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -4974,6 +4919,7 @@ function Workflow_Step_Hierarchy_Mapping() {
4974
4919
 
4975
4920
  // src/components/document-configuration/DocumentConfigurationmain.jsx
4976
4921
  import React34, { useState as useState24, useRef as useRef8 } from "react";
4922
+ import Swal12 from "sweetalert2";
4977
4923
 
4978
4924
  // src/components/document-configuration/SearchBar.jsx
4979
4925
  import React29 from "react";
@@ -4994,6 +4940,7 @@ function SearchBar3({
4994
4940
 
4995
4941
  // src/components/document-configuration/DocumentConfigurationTable.jsx
4996
4942
  import React32, { useState as useState22, useEffect as useEffect18 } from "react";
4943
+ import Swal11 from "sweetalert2";
4997
4944
 
4998
4945
  // src/components/document-configuration/Edit.jsx
4999
4946
  import React30, { useState as useState21, useEffect as useEffect17 } from "react";
@@ -5014,6 +4961,27 @@ function EditDocumentConfiguration({
5014
4961
  status: "Active"
5015
4962
  });
5016
4963
  const [errors, setErrors] = useState21({});
4964
+ const [workflowSteps, setWorkflowSteps] = useState21([]);
4965
+ const [loadingSteps, setLoadingSteps] = useState21(false);
4966
+ const [isSubmitting, setIsSubmitting] = useState21(false);
4967
+ useEffect17(() => {
4968
+ if (!isOpen) return;
4969
+ (async () => {
4970
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
4971
+ try {
4972
+ setLoadingSteps(true);
4973
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflowStep) == null ? void 0 : _c.getList;
4974
+ if (!endpoint) throw new Error("Workflow step list endpoint is not configured.");
4975
+ const result = await getApiService().get(endpoint);
4976
+ const value = (_h = (_g = (_f = (_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) != null ? _f : (_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) != null ? _g : result == null ? void 0 : result.data) != null ? _h : result;
4977
+ setWorkflowSteps(Array.isArray(value) ? value : (_j = (_i = value == null ? void 0 : value.items) != null ? _i : value == null ? void 0 : value.records) != null ? _j : []);
4978
+ } catch (_) {
4979
+ setWorkflowSteps([]);
4980
+ } finally {
4981
+ setLoadingSteps(false);
4982
+ }
4983
+ })();
4984
+ }, [isOpen]);
5017
4985
  useEffect17(() => {
5018
4986
  if (initialData) {
5019
4987
  const sizeParts = (initialData.maxSize || "10 MB").split(" ");
@@ -5053,19 +5021,24 @@ function EditDocumentConfiguration({
5053
5021
  setErrors(newErrors);
5054
5022
  return Object.keys(newErrors).length === 0;
5055
5023
  };
5056
- const handleSubmit = (e) => {
5024
+ const handleSubmit = async (e) => {
5057
5025
  e.preventDefault();
5058
5026
  if (!validateForm()) return;
5059
5027
  const payload = __spreadProps(__spreadValues({}, initialData), {
5060
5028
  docName: formData.docName.trim(),
5061
- stepId: formData.stepId.trim(),
5029
+ stepId: String(formData.stepId).trim(),
5062
5030
  extensions: formData.extensions.trim(),
5063
5031
  maxSize: `${formData.maxSizeNum} ${formData.maxSizeUnit}`,
5064
5032
  isMandatory: formData.isMandatory,
5065
5033
  status: formData.status
5066
5034
  });
5067
- onSave(payload);
5068
- onClose();
5035
+ setIsSubmitting(true);
5036
+ try {
5037
+ const saved = await onSave(payload);
5038
+ if (saved) onClose();
5039
+ } finally {
5040
+ setIsSubmitting(false);
5041
+ }
5069
5042
  };
5070
5043
  if (!isOpen) return null;
5071
5044
  return /* @__PURE__ */ jsx30("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:bg-black/10 fc:p-4", children: /* @__PURE__ */ jsxs29("div", { className: "fc:bg-white fc:rounded-2xl fc:shadow-2xl fc:border fc:border-gray-100 fc:w-full fc:max-w-2xl fc:overflow-hidden fc:transition-all", children: [
@@ -5094,7 +5067,15 @@ function EditDocumentConfiguration({
5094
5067
  "Workflow Step ID ",
5095
5068
  /* @__PURE__ */ jsx30("span", { className: "fc:text-red-500", children: "*" })
5096
5069
  ] }),
5097
- /* @__PURE__ */ jsx30("input", { type: "text", name: "stepId", placeholder: "e.g. 1", value: formData.stepId, onChange: handleChange, className: `fc:w-full fc:px-3 fc:py-2.5 fc:text-sm fc:bg-white fc:border fc:rounded-lg focus:fc:ring-2 focus:fc:ring-blue-500/20 focus:fc:border-[#2563eb] fc:outline-none fc:transition${errors.stepId ? "border-red-500" : "border-gray-200"}` }),
5070
+ /* @__PURE__ */ jsxs29("select", { name: "stepId", value: formData.stepId, onChange: handleChange, disabled: loadingSteps, className: `fc:w-full fc:px-3 fc:py-2.5 fc:text-sm fc:bg-white fc:border fc:rounded-lg focus:fc:ring-2 focus:fc:ring-blue-500/20 focus:fc:border-[#2563eb] fc:outline-none fc:transition disabled:fc:opacity-60${errors.stepId ? "border-red-500" : "border-gray-200"}`, children: [
5071
+ /* @__PURE__ */ jsx30("option", { value: "", children: loadingSteps ? "Loading workflow steps..." : "Select workflow step" }),
5072
+ workflowSteps.map((step) => {
5073
+ var _a, _b, _c, _d;
5074
+ const id = (_b = (_a = step.workflowStepId) != null ? _a : step.WorkflowStepId) != null ? _b : step.id;
5075
+ const name = (_d = (_c = step.stepName) != null ? _c : step.StepName) != null ? _d : `Step ${id}`;
5076
+ return /* @__PURE__ */ jsx30("option", { value: id, children: name }, id);
5077
+ })
5078
+ ] }),
5098
5079
  errors.stepId && /* @__PURE__ */ jsx30("span", { className: "fc:text-xs fc:text-red-500", children: errors.stepId })
5099
5080
  ] }),
5100
5081
  /* @__PURE__ */ jsxs29("div", { children: [
@@ -5139,7 +5120,7 @@ function EditDocumentConfiguration({
5139
5120
  ] }) }),
5140
5121
  /* @__PURE__ */ jsxs29("div", { className: "fc:flex fc:justify-end fc:items-center fc:gap-3 fc:pt-2", children: [
5141
5122
  /* @__PURE__ */ jsx30("button", { type: "button", onClick: onClose, className: "fc:px-5 fc:py-2.5 fc:text-sm fc:font-medium fc:text-gray-600 fc:bg-gray-100 hover:fc:bg-gray-200 fc:rounded-xl fc:transition", children: "Cancel" }),
5142
- /* @__PURE__ */ jsx30("button", { type: "submit", className: "fc:px-6 fc:py-2.5 fc:text-sm fc:font-semibold fc:text-white fc:bg-[#2563eb] hover:fc:bg-[#1d4ed8] active:fc:scale-95 fc:rounded-xl fc:shadow-md fc:transition-all fc:flex fc:items-center fc:gap-2", children: "Save Document" })
5123
+ /* @__PURE__ */ jsx30("button", { type: "submit", disabled: isSubmitting, className: "fc:px-6 fc:py-2.5 fc:text-sm fc:font-semibold fc:text-white fc:bg-[#2563eb] hover:fc:bg-[#1d4ed8] active:fc:scale-95 fc:rounded-xl fc:shadow-md fc:transition-all fc:flex fc:items-center fc:gap-2 disabled:fc:opacity-60", children: isSubmitting ? "Saving..." : "Save Document" })
5143
5124
  ] })
5144
5125
  ] })
5145
5126
  ] }) });
@@ -5423,12 +5404,48 @@ function DocumentConfigTable({
5423
5404
  status: "Active"
5424
5405
  }
5425
5406
  ];
5426
- const [data, setData] = useState22(initialData);
5407
+ const [data, setData] = useState22([]);
5408
+ const [isLoading, setIsLoading] = useState22(false);
5427
5409
  const [sortOrder, setSortOrder] = useState22("asc");
5428
5410
  const [sortKey, setSortKey] = useState22("docName");
5429
5411
  const [isEditOpen, setIsEditOpen] = useState22(false);
5430
5412
  const [isDeleteOpen, setIsDeleteOpen] = useState22(false);
5431
5413
  const [selectedItem, setSelectedItem] = useState22(null);
5414
+ const unwrapRows = (result) => {
5415
+ var _a, _b, _c, _d, _e, _f, _g;
5416
+ const value = (_e = (_d = (_c = (_a = result == null ? void 0 : result.data) == null ? void 0 : _a.data) != null ? _c : (_b = result == null ? void 0 : result.data) == null ? void 0 : _b.result) != null ? _d : result == null ? void 0 : result.data) != null ? _e : result;
5417
+ return Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
5418
+ };
5419
+ const toUiItem = (item) => {
5420
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
5421
+ return __spreadProps(__spreadValues({}, item), {
5422
+ id: (_b = (_a = item.documentConfigurationId) != null ? _a : item.DocumentConfigurationId) != null ? _b : item.id,
5423
+ docName: (_e = (_d = (_c = item.documentName) != null ? _c : item.DocumentName) != null ? _d : item.docName) != null ? _e : "",
5424
+ stepId: String((_h = (_g = (_f = item.workflowStepId) != null ? _f : item.WorkflowStepId) != null ? _g : item.stepId) != null ? _h : ""),
5425
+ extensions: (_k = (_j = (_i = item.allowedExtensions) != null ? _i : item.AllowedExtensions) != null ? _j : item.extensions) != null ? _k : "",
5426
+ maxSize: `${(_n = (_m = (_l = item.maxSizeMB) != null ? _l : item.MaxSizeMB) != null ? _m : item.maxSize) != null ? _n : ""} MB`,
5427
+ isMandatory: Boolean((_o = item.isMandatory) != null ? _o : item.IsMandatory),
5428
+ status: ((_q = (_p = item.isActive) != null ? _p : item.IsActive) != null ? _q : item.status !== "Inactive") ? "Active" : "Inactive"
5429
+ });
5430
+ };
5431
+ const loadData = async () => {
5432
+ var _a, _b, _c, _d, _e;
5433
+ try {
5434
+ setIsLoading(true);
5435
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.documentConfiguration) == null ? void 0 : _c.getList;
5436
+ if (!endpoint) throw new Error("Document Configuration list endpoint is not configured.");
5437
+ const result = await getApiService().post(endpoint, {});
5438
+ setData(unwrapRows(result).map(toUiItem));
5439
+ } catch (error) {
5440
+ setData([]);
5441
+ await Swal11.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to load document configurations.", "error");
5442
+ } finally {
5443
+ setIsLoading(false);
5444
+ }
5445
+ };
5446
+ useEffect18(() => {
5447
+ loadData();
5448
+ }, []);
5432
5449
  const handleSort = (columnKey) => {
5433
5450
  const isAsc = sortKey === columnKey && sortOrder === "asc";
5434
5451
  setSortOrder(isAsc ? "desc" : "asc");
@@ -5442,7 +5459,7 @@ function DocumentConfigTable({
5442
5459
  };
5443
5460
  const filteredData = data.filter((item) => {
5444
5461
  const query = (searchQuery || "").toLowerCase();
5445
- return item.docName.toLowerCase().includes(query) || item.extensions.toLowerCase().includes(query) || item.stepId.toLowerCase().includes(query);
5462
+ return String(item.docName).toLowerCase().includes(query) || String(item.extensions).toLowerCase().includes(query) || String(item.stepId).toLowerCase().includes(query);
5446
5463
  });
5447
5464
  useEffect18(() => {
5448
5465
  if (setTotalEntries) setTotalEntries(filteredData.length);
@@ -5456,30 +5473,54 @@ function DocumentConfigTable({
5456
5473
  },
5457
5474
  (_, i) => i + 1
5458
5475
  );
5459
- const toggleMandatory = (id) => {
5460
- setData(
5461
- (prev) => prev.map(
5462
- (item) => item.id === id ? __spreadProps(__spreadValues({}, item), {
5463
- isMandatory: !item.isMandatory
5464
- }) : item
5465
- )
5466
- );
5476
+ const buildGetByIdUrl = (endpoint, id) => {
5477
+ if (endpoint.includes("{id}")) return endpoint.replace("{id}", encodeURIComponent(id));
5478
+ return `${endpoint.replace(/\/$/, "")}/${encodeURIComponent(id)}`;
5467
5479
  };
5468
- const handleEdit = (item) => {
5469
- setSelectedItem(item);
5470
- setIsEditOpen(true);
5480
+ const handleEdit = async (item) => {
5481
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5482
+ try {
5483
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.documentConfiguration) == null ? void 0 : _c.getById;
5484
+ if (!endpoint) throw new Error("Document Configuration get-by-id endpoint is not configured.");
5485
+ const result = await getApiService().get(buildGetByIdUrl(endpoint, item.id));
5486
+ const value = (_h = (_g = (_f = (_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) != null ? _f : (_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) != null ? _g : result == null ? void 0 : result.data) != null ? _h : result;
5487
+ setSelectedItem(toUiItem(value != null ? value : item));
5488
+ setIsEditOpen(true);
5489
+ } catch (error) {
5490
+ await Swal11.fire("Error", ((_j = (_i = error == null ? void 0 : error.response) == null ? void 0 : _i.data) == null ? void 0 : _j.message) || (error == null ? void 0 : error.message) || "Unable to load document configuration.", "error");
5491
+ }
5471
5492
  };
5472
5493
  const handleDelete = (item) => {
5473
5494
  setSelectedItem(item);
5474
5495
  setIsDeleteOpen(true);
5475
5496
  };
5476
- const handleSaveEdit = (updatedData) => {
5477
- setData(
5478
- (prev) => prev.map((item) => item.id === updatedData.id ? updatedData : item)
5479
- );
5497
+ const handleSaveEdit = async (updatedData) => {
5498
+ var _a, _b, _c, _d, _e;
5499
+ try {
5500
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.documentConfiguration) == null ? void 0 : _c.update;
5501
+ if (!endpoint) throw new Error("Document Configuration update endpoint is not configured.");
5502
+ await getApiService().put(endpoint, {
5503
+ documentConfigurationId: updatedData.id,
5504
+ documentName: updatedData.docName.trim(),
5505
+ allowedExtensions: updatedData.extensions.trim(),
5506
+ maxSizeMB: Number(updatedData.maxSizeNum),
5507
+ isMandatory: Boolean(updatedData.isMandatory),
5508
+ isActive: updatedData.status === "Active",
5509
+ updatedBy: "System"
5510
+ });
5511
+ await Swal11.fire("Success", "Document configuration updated successfully.", "success");
5512
+ setIsEditOpen(false);
5513
+ await loadData();
5514
+ return true;
5515
+ } catch (error) {
5516
+ await Swal11.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to update document configuration.", "error");
5517
+ return false;
5518
+ }
5480
5519
  };
5481
- const handleConfirmDelete = (id) => {
5482
- setData((prev) => prev.filter((item) => item.id !== id));
5520
+ const handleConfirmDelete = async (id) => {
5521
+ const item = data.find((record) => record.id === id);
5522
+ if (!item) return false;
5523
+ return handleSaveEdit(__spreadProps(__spreadValues({}, item), { maxSizeNum: String(item.maxSize).replace(/\s*MB$/i, ""), status: "Inactive" }));
5483
5524
  };
5484
5525
  return /* @__PURE__ */ jsxs31("div", { className: "fc:space-y-5", children: [
5485
5526
  /* @__PURE__ */ jsx32("div", { className: "fc:w-full fc:overflow-x-auto fc:border fc:border-slate-200 fc:rounded-2xl fc:shadow-sm fc:max-h-[420px] fc:overflow-y-auto fc:custom-scrollbar", children: /* @__PURE__ */ jsxs31("table", { className: "fc:w-full fc:text-left fc:border-collapse fc:bg-white fc:table-fixed fc:min-w-[1050px]", children: [
@@ -5546,7 +5587,7 @@ function DocumentConfigTable({
5546
5587
  ),
5547
5588
  /* @__PURE__ */ jsx32("th", { className: "fc:py-4 fc:px-2 fc:text-sm fc:cursor-pointer fc:select-none hover:fc:text-slate-900 fc:bg-slate-50 fc:text-center fc:w-38", children: "Action" })
5548
5589
  ] }) }),
5549
- /* @__PURE__ */ jsx32("tbody", { className: "fc:divide-y fc:divide-slate-100 fc:text-sm fc:text-slate-600", children: visibleData.map((item, index) => /* @__PURE__ */ jsxs31(
5590
+ /* @__PURE__ */ jsx32("tbody", { className: "fc:divide-y fc:divide-slate-100 fc:text-sm fc:text-slate-600", children: isLoading ? /* @__PURE__ */ jsx32("tr", { children: /* @__PURE__ */ jsx32("td", { colSpan: 8, className: "fc:py-10 fc:text-center fc:text-slate-400", children: "Loading document configurations..." }) }) : visibleData.length === 0 ? /* @__PURE__ */ jsx32("tr", { children: /* @__PURE__ */ jsx32("td", { colSpan: 8, className: "fc:py-10 fc:text-center fc:text-slate-400", children: "No records found." }) }) : visibleData.map((item, index) => /* @__PURE__ */ jsxs31(
5550
5591
  "tr",
5551
5592
  {
5552
5593
  className: "hover:fc:bg-slate-50/50 fc:transition-colors",
@@ -5566,7 +5607,10 @@ function DocumentConfigTable({
5566
5607
  /* @__PURE__ */ jsx32("td", { className: "fc:py-4 fc:px-5 fc:text-center", children: /* @__PURE__ */ jsx32(
5567
5608
  "button",
5568
5609
  {
5569
- onClick: () => toggleMandatory(item.id),
5610
+ onClick: () => handleSaveEdit(__spreadProps(__spreadValues({}, item), {
5611
+ maxSizeNum: String(item.maxSize).replace(/\s*MB$/i, ""),
5612
+ isMandatory: !item.isMandatory
5613
+ })),
5570
5614
  className: `fc:relative fc:inline-flex fc:h-5.5 fc:w-10 fc:shrink-0 fc:cursor-pointer fc:rounded-full fc:border-2 fc:border-transparent fc:transition-colors fc:duration-200 fc:ease-in-out fc:outline-none ${item.isMandatory ? "fc:bg-blue-600" : "fc:bg-gray-200"}`,
5571
5615
  children: /* @__PURE__ */ jsx32(
5572
5616
  "span",
@@ -5650,11 +5694,12 @@ function DocumentConfigTable({
5650
5694
  }
5651
5695
 
5652
5696
  // src/components/document-configuration/AddDocumentConfigurationModal.jsx
5653
- import React33, { useState as useState23 } from "react";
5697
+ import React33, { useEffect as useEffect19, useState as useState23 } from "react";
5654
5698
  import { jsx as jsx33, jsxs as jsxs32 } from "react/jsx-runtime";
5655
5699
  function AddDocumentConfigModal({
5656
5700
  isOpen,
5657
- onClose
5701
+ onClose,
5702
+ onSave
5658
5703
  }) {
5659
5704
  const [isMandatory, setIsMandatory] = useState23(false);
5660
5705
  const [status, setStatus] = useState23("Active");
@@ -5663,7 +5708,41 @@ function AddDocumentConfigModal({
5663
5708
  const [maxSize, setMaxSize] = useState23("");
5664
5709
  const [allowedExtensions, setAllowedExtensions] = useState23("");
5665
5710
  const [errors, setErrors] = useState23({});
5666
- const handleSave = () => {
5711
+ const [workflowSteps, setWorkflowSteps] = useState23([]);
5712
+ const [loadingSteps, setLoadingSteps] = useState23(false);
5713
+ const [isSubmitting, setIsSubmitting] = useState23(false);
5714
+ useEffect19(() => {
5715
+ if (!isOpen) return;
5716
+ (async () => {
5717
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5718
+ try {
5719
+ setLoadingSteps(true);
5720
+ const { getApiEndpoints: getApiEndpoints2 } = await import("./ApiEndpointsProvider-MDQW2LEP.mjs");
5721
+ const { getApiService: getApiService2 } = await import("./ApiServicepackage-PJH24ZGU.mjs");
5722
+ const endpoint = (_c = (_b = (_a = getApiEndpoints2()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflowStep) == null ? void 0 : _c.getList;
5723
+ if (!endpoint) throw new Error("Workflow step list endpoint is not configured.");
5724
+ const result = await getApiService2().get(endpoint);
5725
+ const value = (_h = (_g = (_f = (_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) != null ? _f : (_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) != null ? _g : result == null ? void 0 : result.data) != null ? _h : result;
5726
+ setWorkflowSteps(Array.isArray(value) ? value : (_j = (_i = value == null ? void 0 : value.items) != null ? _i : value == null ? void 0 : value.records) != null ? _j : []);
5727
+ } catch (_) {
5728
+ setWorkflowSteps([]);
5729
+ } finally {
5730
+ setLoadingSteps(false);
5731
+ }
5732
+ })();
5733
+ }, [isOpen]);
5734
+ useEffect19(() => {
5735
+ if (!isOpen) {
5736
+ setDocumentName("");
5737
+ setStepId("");
5738
+ setMaxSize("");
5739
+ setAllowedExtensions("");
5740
+ setIsMandatory(false);
5741
+ setStatus("Active");
5742
+ setErrors({});
5743
+ }
5744
+ }, [isOpen]);
5745
+ const handleSave = async () => {
5667
5746
  let newErrors = {};
5668
5747
  if (!documentName.trim()) {
5669
5748
  newErrors.documentName = "Document Name is required";
@@ -5679,7 +5758,19 @@ function AddDocumentConfigModal({
5679
5758
  }
5680
5759
  setErrors(newErrors);
5681
5760
  if (Object.keys(newErrors).length === 0) {
5682
- onClose();
5761
+ setIsSubmitting(true);
5762
+ try {
5763
+ await (onSave == null ? void 0 : onSave({
5764
+ workflowStepId: Number(stepId),
5765
+ documentName: documentName.trim(),
5766
+ allowedExtensions: allowedExtensions.trim(),
5767
+ maxSizeMB: Number(maxSize),
5768
+ isMandatory: Boolean(isMandatory),
5769
+ createdBy: "System"
5770
+ }));
5771
+ } finally {
5772
+ setIsSubmitting(false);
5773
+ }
5683
5774
  }
5684
5775
  };
5685
5776
  if (!isOpen) return null;
@@ -5711,10 +5802,18 @@ function AddDocumentConfigModal({
5711
5802
  "Workflow Step ID ",
5712
5803
  /* @__PURE__ */ jsx33("span", { className: "fc:text-red-500", children: "*" })
5713
5804
  ] }),
5714
- /* @__PURE__ */ jsx33("input", { type: "number", placeholder: "e.g. 1", value: stepId, onChange: (e) => {
5805
+ /* @__PURE__ */ jsxs32("select", { value: stepId, disabled: loadingSteps, onChange: (e) => {
5715
5806
  setStepId(e.target.value);
5716
5807
  if (errors.stepId) setErrors(__spreadProps(__spreadValues({}, errors), { stepId: "" }));
5717
- }, className: `fc:w-full fc:border fc:p-2.5 fc:pl-9 fc:rounded-xl fc:text-xs fc:bg-white fc:text-align-left fc:focus:outline-none fc:focus:ring-2 fc:focus:ring-indigo-500/10 fc:focus:border-indigo-500 fc:border-slate-200 fc:text-slate-700 ${errors.stepId ? `fc:border-red-500 fc:ring-1 fc:ring-red-500` : `fc:border-slate-200 fc:border-indigo-500`}` }),
5808
+ }, className: `fc:w-full fc:border fc:p-2.5 fc:pl-9 fc:rounded-xl fc:text-xs fc:bg-white fc:text-align-left fc:focus:outline-none fc:focus:ring-2 fc:focus:ring-indigo-500/10 fc:focus:border-indigo-500 fc:text-slate-700 disabled:fc:opacity-60 ${errors.stepId ? `fc:border-red-500 fc:ring-1 fc:ring-red-500` : `fc:border-slate-200 fc:border-indigo-500`}`, children: [
5809
+ /* @__PURE__ */ jsx33("option", { value: "", children: loadingSteps ? "Loading workflow steps..." : "Select workflow step" }),
5810
+ workflowSteps.map((step) => {
5811
+ var _a, _b, _c, _d;
5812
+ const id = (_b = (_a = step.workflowStepId) != null ? _a : step.WorkflowStepId) != null ? _b : step.id;
5813
+ const name = (_d = (_c = step.stepName) != null ? _c : step.StepName) != null ? _d : `Step ${id}`;
5814
+ return /* @__PURE__ */ jsx33("option", { value: id, children: name }, id);
5815
+ })
5816
+ ] }),
5718
5817
  errors.stepId && /* @__PURE__ */ jsx33("p", { className: "fc:text-red-500 fc:text-xs", children: errors.stepId })
5719
5818
  ] })
5720
5819
  ] }),
@@ -5786,7 +5885,7 @@ function AddDocumentConfigModal({
5786
5885
  ] }),
5787
5886
  /* @__PURE__ */ jsxs32("div", { className: "fc:flex fc:justify-end fc:gap-3 fc:px-8 fc:py-4 fc:border-t fc:border-slate-100 fc:bg-white", children: [
5788
5887
  /* @__PURE__ */ jsx33("button", { onClick: onClose, className: "fc:px-5 fc:py-2.5 fc:text-sm fc:font-medium fc:text-gray-600 fc:bg-gray-100 hover:fc:fc:bg-gray-200 fc:rounded-xl fc:transition", children: "\u2715 Cancel" }),
5789
- /* @__PURE__ */ jsx33("button", { onClick: handleSave, className: "fc:px-5 fc:py-2 fc:text-xs fc:font-bold fc:text-white fc:bg-blue-600 hover:fc:bg-blue-700 fc:rounded-xl fc:transition-all fc:shadow-sm", children: "Save Rules" })
5888
+ /* @__PURE__ */ jsx33("button", { onClick: handleSave, disabled: isSubmitting, className: "fc:px-5 fc:py-2 fc:text-xs fc:font-bold fc:text-white fc:bg-blue-600 hover:fc:bg-blue-700 fc:rounded-xl fc:transition-all fc:shadow-sm disabled:fc:opacity-60", children: isSubmitting ? "Saving..." : "Save Rules" })
5790
5889
  ] })
5791
5890
  ] })
5792
5891
  ] });
@@ -5806,6 +5905,21 @@ function DocumentConfigurationmain() {
5806
5905
  const [searchQuery, setSearchQuery] = useState24("");
5807
5906
  const [currentPage, setCurrentPage] = useState24(1);
5808
5907
  const [totalEntries, setTotalEntries] = useState24(0);
5908
+ const handleCreate = async (payload) => {
5909
+ var _a, _b, _c, _d, _e;
5910
+ try {
5911
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.documentConfiguration) == null ? void 0 : _c.create;
5912
+ if (!endpoint) throw new Error("Document Configuration create endpoint is not configured.");
5913
+ await getApiService().post(endpoint, payload);
5914
+ await Swal12.fire("Success", "Document configuration created successfully.", "success");
5915
+ setModalOpen(false);
5916
+ handleRefresh();
5917
+ return true;
5918
+ } catch (error) {
5919
+ await Swal12.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to create document configuration.", "error");
5920
+ return false;
5921
+ }
5922
+ };
5809
5923
  const handlePageSizeChange = (e) => {
5810
5924
  setPageSize(Number(e.target.value));
5811
5925
  setCurrentPage(1);
@@ -5840,7 +5954,7 @@ function DocumentConfigurationmain() {
5840
5954
  ] }),
5841
5955
  /* @__PURE__ */ jsx34("div", { ref: tableRef, children: /* @__PURE__ */ jsx34(DocumentConfigTable, { pageSize, searchQuery, currentPage, setCurrentPage, setTotalEntries }, refreshkey) })
5842
5956
  ] }) }),
5843
- /* @__PURE__ */ jsx34(AddDocumentConfigModal, { isOpen: modalOpen, onClose: () => setModalOpen(false) })
5957
+ /* @__PURE__ */ jsx34(AddDocumentConfigModal, { isOpen: modalOpen, onClose: () => setModalOpen(false), onSave: handleCreate })
5844
5958
  ] });
5845
5959
  }
5846
5960
 
@@ -5865,7 +5979,7 @@ function SearchBar4({
5865
5979
  }
5866
5980
 
5867
5981
  // src/components/audit-log/AuditLogTable.jsx
5868
- import React36, { useState as useState25, useEffect as useEffect19 } from "react";
5982
+ import React36, { useState as useState25, useEffect as useEffect20 } from "react";
5869
5983
  import { jsx as jsx36, jsxs as jsxs35 } from "react/jsx-runtime";
5870
5984
  function AuditLogTable({
5871
5985
  pageSize,
@@ -6093,7 +6207,7 @@ function AuditLogTable({
6093
6207
  const query = (searchQuery || "").toLowerCase();
6094
6208
  return item.logId.toLowerCase().includes(query) || item.user.toLowerCase().includes(query) || item.section.toLowerCase().includes(query) || item.action.toLowerCase().includes(query);
6095
6209
  });
6096
- useEffect19(() => {
6210
+ useEffect20(() => {
6097
6211
  if (setTotalEntries) setTotalEntries(filteredData.length);
6098
6212
  }, [filteredData.length, setTotalEntries]);
6099
6213
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -6381,7 +6495,7 @@ function SearchBar5({
6381
6495
  }
6382
6496
 
6383
6497
  // src/components/movement-history/MovementHistoryTable.jsx
6384
- import React40, { useState as useState28, useEffect as useEffect20 } from "react";
6498
+ import React40, { useState as useState28, useEffect as useEffect21 } from "react";
6385
6499
  import { jsx as jsx40, jsxs as jsxs39 } from "react/jsx-runtime";
6386
6500
  function MovementHistoryTable({
6387
6501
  pageSize,
@@ -6609,7 +6723,7 @@ function MovementHistoryTable({
6609
6723
  const query = (searchQuery || "").toLowerCase();
6610
6724
  return item.movementHistoryId.toLowerCase().includes(query) || item.name.toLowerCase().includes(query) || item.toStepId.toLowerCase().includes(query);
6611
6725
  });
6612
- useEffect20(() => {
6726
+ useEffect21(() => {
6613
6727
  if (setTotalEntries) setTotalEntries(filteredData.length);
6614
6728
  }, [filteredData.length, setTotalEntries]);
6615
6729
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -6861,7 +6975,7 @@ function MovementHistorymain() {
6861
6975
 
6862
6976
  // src/components/task-permission/TaskPermissionMain.jsx
6863
6977
  import React47, { useState as useState34, useRef as useRef11 } from "react";
6864
- import Swal12 from "sweetalert2";
6978
+ import Swal14 from "sweetalert2";
6865
6979
 
6866
6980
  // src/components/task-permission/SearchBar.js
6867
6981
  import React43 from "react";
@@ -6892,7 +7006,7 @@ function SearchBar6({
6892
7006
  }
6893
7007
 
6894
7008
  // src/components/task-permission/Table.js
6895
- import React44, { useState as useState31, useEffect as useEffect21 } from "react";
7009
+ import React44, { useState as useState31, useEffect as useEffect22 } from "react";
6896
7010
  import { jsx as jsx44, jsxs as jsxs43 } from "react/jsx-runtime";
6897
7011
  function Table({
6898
7012
  pageSize,
@@ -6920,7 +7034,7 @@ function Table({
6920
7034
  });
6921
7035
  return map;
6922
7036
  }, [workflowSteps]);
6923
- useEffect21(() => {
7037
+ useEffect22(() => {
6924
7038
  (async () => {
6925
7039
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
6926
7040
  try {
@@ -6971,7 +7085,7 @@ function Table({
6971
7085
  const totalPages = Math.max(Math.ceil(sorted.length / pageSize), 1);
6972
7086
  const startIndex = (currentPage - 1) * pageSize;
6973
7087
  const visibleData = sorted.slice(startIndex, startIndex + pageSize);
6974
- useEffect21(() => {
7088
+ useEffect22(() => {
6975
7089
  if (setTotalEntries) setTotalEntries(filtered.length);
6976
7090
  }, [filtered.length]);
6977
7091
  const pageNumbers = Array.from({ length: totalPages }, (_, i) => i + 1);
@@ -7129,8 +7243,8 @@ function Table({
7129
7243
  }
7130
7244
 
7131
7245
  // src/components/task-permission/Popup.js
7132
- import React45, { useState as useState32, useEffect as useEffect22 } from "react";
7133
- import Swal11 from "sweetalert2";
7246
+ import React45, { useState as useState32, useEffect as useEffect23 } from "react";
7247
+ import Swal13 from "sweetalert2";
7134
7248
  import { jsx as jsx45, jsxs as jsxs44 } from "react/jsx-runtime";
7135
7249
  function Popup({ isOpen, onClose, onSave }) {
7136
7250
  const [formData, setFormData] = useState32({
@@ -7144,7 +7258,7 @@ function Popup({ isOpen, onClose, onSave }) {
7144
7258
  const [isSubmitting, setIsSubmitting] = useState32(false);
7145
7259
  const [workflowSteps, setWorkflowSteps] = useState32([]);
7146
7260
  const [loadingSteps, setLoadingSteps] = useState32(false);
7147
- useEffect22(() => {
7261
+ useEffect23(() => {
7148
7262
  if (!isOpen) return;
7149
7263
  (async () => {
7150
7264
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
@@ -7162,7 +7276,7 @@ function Popup({ isOpen, onClose, onSave }) {
7162
7276
  }
7163
7277
  })();
7164
7278
  }, [isOpen]);
7165
- useEffect22(() => {
7279
+ useEffect23(() => {
7166
7280
  if (!isOpen) {
7167
7281
  setFormData({ workflowStepId: "", canView: false, canEdit: false, canApprove: false, canReject: false });
7168
7282
  setErrors({});
@@ -7200,7 +7314,7 @@ function Popup({ isOpen, onClose, onSave }) {
7200
7314
  await (onSave == null ? void 0 : onSave());
7201
7315
  } catch (error) {
7202
7316
  const msg = ((_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 task permission.";
7203
- await Swal11.fire("Error", msg, "error");
7317
+ await Swal13.fire("Error", msg, "error");
7204
7318
  } finally {
7205
7319
  setIsSubmitting(false);
7206
7320
  }
@@ -7322,7 +7436,7 @@ function Popup({ isOpen, onClose, onSave }) {
7322
7436
  }
7323
7437
 
7324
7438
  // src/components/task-permission/EditTaskPermissionModal.js
7325
- import React46, { useState as useState33, useEffect as useEffect23 } from "react";
7439
+ import React46, { useState as useState33, useEffect as useEffect24 } from "react";
7326
7440
  import { jsx as jsx46, jsxs as jsxs45 } from "react/jsx-runtime";
7327
7441
  function EditTaskPermissionModal({ isOpen, onClose, onSave, selectedData, onUpdate }) {
7328
7442
  var _a;
@@ -7339,7 +7453,7 @@ function EditTaskPermissionModal({ isOpen, onClose, onSave, selectedData, onUpda
7339
7453
  const [isSubmitting, setIsSubmitting] = useState33(false);
7340
7454
  const [workflowSteps, setWorkflowSteps] = useState33([]);
7341
7455
  const [loadingSteps, setLoadingSteps] = useState33(false);
7342
- useEffect23(() => {
7456
+ useEffect24(() => {
7343
7457
  if (!isOpen) return;
7344
7458
  (async () => {
7345
7459
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
@@ -7357,7 +7471,7 @@ function EditTaskPermissionModal({ isOpen, onClose, onSave, selectedData, onUpda
7357
7471
  }
7358
7472
  })();
7359
7473
  }, [isOpen]);
7360
- useEffect23(() => {
7474
+ useEffect24(() => {
7361
7475
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
7362
7476
  if (selectedData) {
7363
7477
  setFormData({
@@ -7599,13 +7713,13 @@ function TaskPermissionMain() {
7599
7713
  handleRefresh();
7600
7714
  return true;
7601
7715
  } catch (error) {
7602
- await Swal12.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to update task permission.", "error");
7716
+ await Swal14.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to update task permission.", "error");
7603
7717
  return false;
7604
7718
  }
7605
7719
  };
7606
7720
  const handleDeleteApi = async (item) => {
7607
7721
  var _a;
7608
- const confirm = await Swal12.fire({
7722
+ const confirm = await Swal14.fire({
7609
7723
  title: "Delete Task Permission?",
7610
7724
  text: `Permission #${(_a = item.taskPermissionId) != null ? _a : item.TaskPermissionId} will be marked as inactive.`,
7611
7725
  icon: "warning",
@@ -7615,7 +7729,7 @@ function TaskPermissionMain() {
7615
7729
  });
7616
7730
  if (!confirm.isConfirmed) return;
7617
7731
  const ok = await handleUpdateApi(__spreadProps(__spreadValues({}, item), { isActive: false }));
7618
- if (ok) await Swal12.fire("Deleted", "Task permission has been deactivated.", "success");
7732
+ if (ok) await Swal14.fire("Deleted", "Task permission has been deactivated.", "success");
7619
7733
  };
7620
7734
  return /* @__PURE__ */ jsxs46("div", { className: "fc:h-screen fc:overflow-hidden fc:bg-slate-50 fc:p-4 md:fc:fc:p-6", children: [
7621
7735
  /* @__PURE__ */ jsxs46("div", { className: "fc:w-full fc:space-y-5", children: [
@@ -7668,7 +7782,7 @@ function TaskPermissionMain() {
7668
7782
  isOpen: showModal,
7669
7783
  onClose: () => setShowModal(false),
7670
7784
  onSave: async () => {
7671
- await Swal12.fire("Success", "Task permission created successfully.", "success");
7785
+ await Swal14.fire("Success", "Task permission created successfully.", "success");
7672
7786
  handleRefresh();
7673
7787
  }
7674
7788
  }
@@ -7680,7 +7794,7 @@ function TaskPermissionMain() {
7680
7794
  onClose: () => setIsEditOpen(false),
7681
7795
  selectedData: selectedItem,
7682
7796
  onSave: async () => {
7683
- await Swal12.fire("Success", "Task permission updated successfully.", "success");
7797
+ await Swal14.fire("Success", "Task permission updated successfully.", "success");
7684
7798
  handleRefresh();
7685
7799
  },
7686
7800
  onUpdate: handleUpdateApi
@@ -7721,7 +7835,7 @@ function SearchBar7({
7721
7835
  }
7722
7836
 
7723
7837
  // src/components/Workflow-Setting/Table.js
7724
- import React49, { useState as useState35, useEffect as useEffect24 } from "react";
7838
+ import React49, { useState as useState35, useEffect as useEffect25 } from "react";
7725
7839
  import { jsx as jsx49, jsxs as jsxs48 } from "react/jsx-runtime";
7726
7840
  function Table2({
7727
7841
  pageSize,
@@ -7968,7 +8082,7 @@ function Table2({
7968
8082
  }
7969
8083
  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);
7970
8084
  });
7971
- useEffect24(() => {
8085
+ useEffect25(() => {
7972
8086
  if (setTotalEntries) setTotalEntries(filteredData.length);
7973
8087
  }, [filteredData.length, setTotalEntries]);
7974
8088
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -8244,7 +8358,7 @@ function SearchBar8({
8244
8358
  }
8245
8359
 
8246
8360
  // src/components/notification/Table.js
8247
- import React53, { useState as useState38, useEffect as useEffect25 } from "react";
8361
+ import React53, { useState as useState38, useEffect as useEffect26 } from "react";
8248
8362
  import { jsx as jsx53, jsxs as jsxs52 } from "react/jsx-runtime";
8249
8363
  function Table3({
8250
8364
  pageSize,
@@ -8491,7 +8605,7 @@ function Table3({
8491
8605
  }
8492
8606
  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);
8493
8607
  });
8494
- useEffect25(() => {
8608
+ useEffect26(() => {
8495
8609
  if (setTotalEntries) setTotalEntries(filteredData.length);
8496
8610
  }, [filteredData.length, setTotalEntries]);
8497
8611
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -8777,10 +8891,10 @@ function TaskInstanceSearchBar({
8777
8891
  }
8778
8892
 
8779
8893
  // src/components/task-instance/taskinstancetable.jsx
8780
- import React59, { useState as useState42, useEffect as useEffect27 } from "react";
8894
+ import React59, { useState as useState42, useEffect as useEffect28 } from "react";
8781
8895
 
8782
8896
  // src/components/task-instance/edit-instance.jsx
8783
- import React57, { useEffect as useEffect26, useState as useState41 } from "react";
8897
+ import React57, { useEffect as useEffect27, useState as useState41 } from "react";
8784
8898
  import { jsx as jsx57, jsxs as jsxs56 } from "react/jsx-runtime";
8785
8899
  function EditTaskInstanceModal({
8786
8900
  isOpen,
@@ -8796,7 +8910,7 @@ function EditTaskInstanceModal({
8796
8910
  escalatedOn: "",
8797
8911
  slaStatus: ""
8798
8912
  });
8799
- useEffect26(() => {
8913
+ useEffect27(() => {
8800
8914
  if (selectedTask) {
8801
8915
  setFormData({
8802
8916
  assignedUserId: selectedTask.assignedUserId || selectedTask.assigned_user_id || "",
@@ -9317,7 +9431,7 @@ function TaskInstanceTable({
9317
9431
  const query = (searchQuery || "").toLowerCase();
9318
9432
  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);
9319
9433
  });
9320
- useEffect27(() => {
9434
+ useEffect28(() => {
9321
9435
  if (setTotalEntries) setTotalEntries(filteredData.length);
9322
9436
  }, [filteredData.length, setTotalEntries]);
9323
9437
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -9686,7 +9800,7 @@ function CommentSearchBar({
9686
9800
  }
9687
9801
 
9688
9802
  // src/components/comment/commenttable.jsx
9689
- import React63, { useState as useState44, useEffect as useEffect28 } from "react";
9803
+ import React63, { useState as useState44, useEffect as useEffect29 } from "react";
9690
9804
  import { jsx as jsx63, jsxs as jsxs62 } from "react/jsx-runtime";
9691
9805
  function CommentTable({
9692
9806
  pageSize,
@@ -9914,7 +10028,7 @@ function CommentTable({
9914
10028
  const query = (searchQuery || "").toLowerCase();
9915
10029
  return String(item.commentId).toLowerCase().includes(query) || String(item.taskInstanceId).toLowerCase().includes(query) || item.comment.toLowerCase().includes(query) || String(item.commentedBy).toLowerCase().includes(query);
9916
10030
  });
9917
- useEffect28(() => {
10031
+ useEffect29(() => {
9918
10032
  if (setTotalEntries) setTotalEntries(filteredData.length);
9919
10033
  }, [filteredData.length, setTotalEntries]);
9920
10034
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -10249,8 +10363,8 @@ function Comment_main() {
10249
10363
  }
10250
10364
 
10251
10365
  // src/components/hierarchy-node/HierarchyNodeMain.jsx
10252
- import React71, { useState as useState50, useRef as useRef16, useEffect as useEffect31 } from "react";
10253
- import Swal13 from "sweetalert2";
10366
+ import React71, { useState as useState50, useRef as useRef16, useEffect as useEffect32 } from "react";
10367
+ import Swal15 from "sweetalert2";
10254
10368
 
10255
10369
  // src/components/hierarchy-node/SearchBar.jsx
10256
10370
  import React66 from "react";
@@ -10289,10 +10403,10 @@ function SearchBar9({ searchQuery, setSearchQuery }) {
10289
10403
  }
10290
10404
 
10291
10405
  // src/components/hierarchy-node/HierarchyTable.jsx
10292
- import React69, { useState as useState48, useEffect as useEffect30 } from "react";
10406
+ import React69, { useState as useState48, useEffect as useEffect31 } from "react";
10293
10407
 
10294
10408
  // src/components/hierarchy-node/AddEditModal.jsx
10295
- import React67, { useEffect as useEffect29, useState as useState47 } from "react";
10409
+ import React67, { useEffect as useEffect30, useState as useState47 } from "react";
10296
10410
  import { jsx as jsx67, jsxs as jsxs66 } from "react/jsx-runtime";
10297
10411
  function AddEditModal({
10298
10412
  isOpen,
@@ -10310,7 +10424,7 @@ function AddEditModal({
10310
10424
  externalEntityId: "",
10311
10425
  isActive: true
10312
10426
  });
10313
- useEffect29(() => {
10427
+ useEffect30(() => {
10314
10428
  if (editData) {
10315
10429
  setFormData(editData);
10316
10430
  }
@@ -10533,7 +10647,7 @@ function HierarchyTable({
10533
10647
  const [currentPage, setCurrentPage] = useState48(1);
10534
10648
  ;
10535
10649
  const [data, setData] = useState48(apiData || []);
10536
- useEffect30(() => {
10650
+ useEffect31(() => {
10537
10651
  setData(apiData || []);
10538
10652
  }, [apiData]);
10539
10653
  const filteredData = data.filter(
@@ -10550,7 +10664,7 @@ function HierarchyTable({
10550
10664
  const [editOpen, setEditOpen] = useState48(false);
10551
10665
  const [deleteOpen, setDeleteOpen] = useState48(false);
10552
10666
  const [selectedNode, setSelectedNode] = useState48(null);
10553
- useEffect30(() => {
10667
+ useEffect31(() => {
10554
10668
  setCurrentPage(1);
10555
10669
  }, [searchQuery, pageSize]);
10556
10670
  const handleSort = (column) => {
@@ -10844,7 +10958,7 @@ function HierarchyNodeMain() {
10844
10958
  const [searchQuery, setSearchQuery] = useState50("");
10845
10959
  const [apiData, setApiData] = useState50([]);
10846
10960
  const [refreshKey, setRefreshKey] = useState50(0);
10847
- useEffect31(() => {
10961
+ useEffect32(() => {
10848
10962
  (async () => {
10849
10963
  var _a, _b, _c, _d, _e, _f, _g;
10850
10964
  try {
@@ -10854,7 +10968,7 @@ function HierarchyNodeMain() {
10854
10968
  const value = ((_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) || ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) || (result == null ? void 0 : result.data) || result;
10855
10969
  setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
10856
10970
  } catch (error) {
10857
- await Swal13.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.", "error");
10971
+ await Swal15.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.", "error");
10858
10972
  }
10859
10973
  })();
10860
10974
  }, [refreshKey]);
@@ -10867,11 +10981,11 @@ function HierarchyNodeMain() {
10867
10981
  const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.hierarchyNode) == null ? void 0 : _c[isEdit ? "update" : "create"];
10868
10982
  if (!endpoint) throw new Error(`Hierarchy node ${isEdit ? "update" : "create"} endpoint is not configured.`);
10869
10983
  await getApiService()[isEdit ? "put" : "post"](endpoint, payload);
10870
- await Swal13.fire("Success", `Hierarchy node ${isEdit ? "updated" : "created"} successfully.`, "success");
10984
+ await Swal15.fire("Success", `Hierarchy node ${isEdit ? "updated" : "created"} successfully.`, "success");
10871
10985
  handleRefresh();
10872
10986
  return true;
10873
10987
  } catch (error) {
10874
- await Swal13.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || `Unable to ${isEdit ? "update" : "create"} hierarchy node.`, "error");
10988
+ await Swal15.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || `Unable to ${isEdit ? "update" : "create"} hierarchy node.`, "error");
10875
10989
  return false;
10876
10990
  }
10877
10991
  };
@@ -12614,7 +12728,7 @@ function SearchBar12({
12614
12728
  }
12615
12729
 
12616
12730
  // src/components/assignment-rule/Table.js
12617
- import React85, { useState as useState59, useEffect as useEffect32 } from "react";
12731
+ import React85, { useState as useState59, useEffect as useEffect33 } from "react";
12618
12732
  import { jsx as jsx85, jsxs as jsxs84 } from "react/jsx-runtime";
12619
12733
  function Table4({
12620
12734
  pageSize,
@@ -12780,7 +12894,7 @@ function Table4({
12780
12894
  const query = searchQuery.toLowerCase().trim();
12781
12895
  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);
12782
12896
  });
12783
- useEffect32(() => {
12897
+ useEffect33(() => {
12784
12898
  if (setTotalEntries) setTotalEntries(filteredData.length);
12785
12899
  }, [filteredData.length, setTotalEntries]);
12786
12900
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;