flowcore-fn 9.5.3 → 10.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pkg-index.css +148 -258
- package/dist/pkg-index.js +146 -43
- package/dist/pkg-index.mjs +144 -43
- package/package.json +1 -1
package/dist/pkg-index.mjs
CHANGED
|
@@ -3771,47 +3771,66 @@ function WorkFlowTransition() {
|
|
|
3771
3771
|
|
|
3772
3772
|
// src/components/user-hierarchy-node-mapping/user_hierarachy_node_main.jsx
|
|
3773
3773
|
import React27, { useState as useState19, useRef as useRef6, useEffect as useEffect15 } from "react";
|
|
3774
|
-
import
|
|
3774
|
+
import Swal10 from "sweetalert2";
|
|
3775
3775
|
|
|
3776
3776
|
// src/components/user-hierarchy-node-mapping/adduserhierarchynode.jsx
|
|
3777
3777
|
import React22, { useEffect as useEffect12, useState as useState16 } from "react";
|
|
3778
|
+
import Swal9 from "sweetalert2";
|
|
3778
3779
|
import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3779
3780
|
function AddUserHierarchyNodeMappingModal({
|
|
3780
3781
|
isOpen,
|
|
3781
3782
|
onClose,
|
|
3782
3783
|
onSave
|
|
3783
3784
|
}) {
|
|
3784
|
-
const [formData, setFormData] = useState16({ mappingId: "", externalUserId: "", hierarchyNodeId: "", roleCode: "", isPrimary: "", effectiveFrom: "", effectiveTo: "" });
|
|
3785
|
+
const [formData, setFormData] = useState16({ mappingId: "", externalUserId: "", workflowStepId: "", hierarchyNodeId: "", roleCode: "", isPrimary: "", effectiveFrom: "", effectiveTo: "" });
|
|
3785
3786
|
const [isSubmitting, setIsSubmitting] = useState16(false);
|
|
3786
3787
|
const [hierarchyNodes, setHierarchyNodes] = useState16([]);
|
|
3788
|
+
const [workflowSteps, setWorkflowSteps] = useState16([]);
|
|
3787
3789
|
const [isLoadingHierarchyNodes, setIsLoadingHierarchyNodes] = useState16(false);
|
|
3790
|
+
const [isLoadingWorkflowSteps, setIsLoadingWorkflowSteps] = useState16(false);
|
|
3788
3791
|
const [hierarchyNodesError, setHierarchyNodesError] = useState16("");
|
|
3792
|
+
const [workflowStepsError, setWorkflowStepsError] = useState16("");
|
|
3789
3793
|
useEffect12(() => {
|
|
3790
3794
|
if (!isOpen) return;
|
|
3791
|
-
const
|
|
3792
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
3795
|
+
const loadData = async () => {
|
|
3796
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
3797
|
+
const flowCore = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore;
|
|
3798
|
+
const hierarchyEndpoint = (_b = flowCore == null ? void 0 : flowCore.hierarchyNode) == null ? void 0 : _b.getList;
|
|
3799
|
+
const workflowStepEndpoint = ((_c = flowCore == null ? void 0 : flowCore.workflowStep) == null ? void 0 : _c.getList) || ((_d = flowCore == null ? void 0 : flowCore.WorkFlowStep) == null ? void 0 : _d.getList) || ((_e = flowCore == null ? void 0 : flowCore.workFlowStep) == null ? void 0 : _e.getList);
|
|
3793
3800
|
setIsLoadingHierarchyNodes(true);
|
|
3801
|
+
setIsLoadingWorkflowSteps(true);
|
|
3794
3802
|
setHierarchyNodesError("");
|
|
3803
|
+
setWorkflowStepsError("");
|
|
3795
3804
|
try {
|
|
3796
|
-
const
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3805
|
+
const [hierarchyResult, workflowStepResult] = await Promise.all([
|
|
3806
|
+
hierarchyEndpoint ? getApiService().get(hierarchyEndpoint) : Promise.resolve(null),
|
|
3807
|
+
workflowStepEndpoint ? getApiService().get(workflowStepEndpoint) : Promise.resolve(null)
|
|
3808
|
+
]);
|
|
3809
|
+
const hierarchyValue = ((_f = hierarchyResult == null ? void 0 : hierarchyResult.data) == null ? void 0 : _f.data) || ((_g = hierarchyResult == null ? void 0 : hierarchyResult.data) == null ? void 0 : _g.result) || (hierarchyResult == null ? void 0 : hierarchyResult.data) || hierarchyResult;
|
|
3810
|
+
const workflowStepValue = ((_h = workflowStepResult == null ? void 0 : workflowStepResult.data) == null ? void 0 : _h.data) || ((_i = workflowStepResult == null ? void 0 : workflowStepResult.data) == null ? void 0 : _i.result) || (workflowStepResult == null ? void 0 : workflowStepResult.data) || workflowStepResult;
|
|
3811
|
+
setHierarchyNodes(Array.isArray(hierarchyValue) ? hierarchyValue : (hierarchyValue == null ? void 0 : hierarchyValue.items) || (hierarchyValue == null ? void 0 : hierarchyValue.records) || []);
|
|
3812
|
+
setWorkflowSteps(Array.isArray(workflowStepValue) ? workflowStepValue : (workflowStepValue == null ? void 0 : workflowStepValue.items) || (workflowStepValue == null ? void 0 : workflowStepValue.records) || []);
|
|
3801
3813
|
} catch (error) {
|
|
3802
3814
|
setHierarchyNodes([]);
|
|
3803
|
-
|
|
3815
|
+
setWorkflowSteps([]);
|
|
3816
|
+
setHierarchyNodesError(((_k = (_j = error == null ? void 0 : error.response) == null ? void 0 : _j.data) == null ? void 0 : _k.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.");
|
|
3817
|
+
setWorkflowStepsError(((_m = (_l = error == null ? void 0 : error.response) == null ? void 0 : _l.data) == null ? void 0 : _m.message) || (error == null ? void 0 : error.message) || "Unable to load workflow steps.");
|
|
3804
3818
|
} finally {
|
|
3805
3819
|
setIsLoadingHierarchyNodes(false);
|
|
3820
|
+
setIsLoadingWorkflowSteps(false);
|
|
3806
3821
|
}
|
|
3807
3822
|
};
|
|
3808
|
-
|
|
3823
|
+
loadData();
|
|
3809
3824
|
}, [isOpen]);
|
|
3810
3825
|
const handleChange = (event) => setFormData((previous) => __spreadProps(__spreadValues({}, previous), { [event.target.name]: event.target.value }));
|
|
3811
3826
|
const handleSave = async () => {
|
|
3812
3827
|
if (!onSave) return;
|
|
3828
|
+
if (!formData.workflowStepId) {
|
|
3829
|
+
await Swal9.fire("Required field", "Please select a workflow step.", "warning");
|
|
3830
|
+
return;
|
|
3831
|
+
}
|
|
3813
3832
|
setIsSubmitting(true);
|
|
3814
|
-
const success = await onSave({ externalUserId: Number(formData.externalUserId), hierarchyNodeId: Number(formData.hierarchyNodeId), roleCode: formData.roleCode, isPrimary: formData.isPrimary === "true", effectiveFrom: formData.effectiveFrom, effectiveTo: formData.effectiveTo || null, createdBy: "System" });
|
|
3833
|
+
const success = await onSave({ externalUserId: Number(formData.externalUserId), workflowStepId: Number(formData.workflowStepId), hierarchyNodeId: Number(formData.hierarchyNodeId), roleCode: formData.roleCode, isPrimary: formData.isPrimary === "true", effectiveFrom: formData.effectiveFrom, effectiveTo: formData.effectiveTo || null, createdBy: "System" });
|
|
3815
3834
|
setIsSubmitting(false);
|
|
3816
3835
|
if (success) onClose();
|
|
3817
3836
|
};
|
|
@@ -3853,6 +3872,25 @@ function AddUserHierarchyNodeMappingModal({
|
|
|
3853
3872
|
/* @__PURE__ */ jsx22("p", { className: "fc:text-[10px] fc:text-slate-400 fc:mt-1", children: "Enter the consumer user ID" })
|
|
3854
3873
|
] })
|
|
3855
3874
|
] }),
|
|
3875
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
3876
|
+
/* @__PURE__ */ jsxs21("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
|
|
3877
|
+
"Workflow Step ",
|
|
3878
|
+
/* @__PURE__ */ jsx22("span", { className: "fc:text-red-500", children: "*" })
|
|
3879
|
+
] }),
|
|
3880
|
+
/* @__PURE__ */ jsxs21("select", { name: "workflowStepId", value: formData.workflowStepId, onChange: handleChange, disabled: isLoadingWorkflowSteps, className: "fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-white fc:text-slate-700 disabled:fc:fc:bg-slate-100 disabled:fc:fc:cursor-not-allowed focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-indigo-500/10 focus:fc:fc:border-indigo-500", children: [
|
|
3881
|
+
/* @__PURE__ */ jsx22("option", { value: "", children: isLoadingWorkflowSteps ? "Loading workflow steps..." : "Select workflow step" }),
|
|
3882
|
+
workflowSteps.map((step) => {
|
|
3883
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3884
|
+
const id = (_b = (_a = step.workflowStepId) != null ? _a : step.WorkflowStepId) != null ? _b : step.id;
|
|
3885
|
+
const name = (_f = (_e = (_d = (_c = step.stepName) != null ? _c : step.StepName) != null ? _d : step.name) != null ? _e : step.workflowStepName) != null ? _f : step.WorkflowStepName;
|
|
3886
|
+
return /* @__PURE__ */ jsxs21("option", { value: id, children: [
|
|
3887
|
+
id,
|
|
3888
|
+
name ? ` - ${name}` : ""
|
|
3889
|
+
] }, id);
|
|
3890
|
+
})
|
|
3891
|
+
] }),
|
|
3892
|
+
/* @__PURE__ */ jsx22("p", { className: `fc:text-[10px] fc:mt-1 ${workflowStepsError ? "fc:text-red-500" : "fc:text-slate-400"}`, children: workflowStepsError || "Select the workflow step for this mapping" })
|
|
3893
|
+
] }),
|
|
3856
3894
|
/* @__PURE__ */ jsxs21("div", { children: [
|
|
3857
3895
|
/* @__PURE__ */ jsxs21("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
|
|
3858
3896
|
"Hierarchy Node ID ",
|
|
@@ -3957,15 +3995,47 @@ function EditUserHierarchyNodeMappingModal({
|
|
|
3957
3995
|
onSave
|
|
3958
3996
|
}) {
|
|
3959
3997
|
const [formData, setFormData] = useState17({
|
|
3998
|
+
workflowStepId: "",
|
|
3960
3999
|
hierarchyNodeId: "",
|
|
3961
4000
|
roleCode: "",
|
|
3962
4001
|
isPrimary: "",
|
|
3963
4002
|
effectiveFrom: "",
|
|
3964
4003
|
effectiveTo: ""
|
|
3965
4004
|
});
|
|
4005
|
+
const [workflowSteps, setWorkflowSteps] = useState17([]);
|
|
4006
|
+
const [isLoadingWorkflowSteps, setIsLoadingWorkflowSteps] = useState17(false);
|
|
4007
|
+
const [workflowStepsError, setWorkflowStepsError] = useState17("");
|
|
3966
4008
|
useEffect13(() => {
|
|
4009
|
+
if (!isOpen) return;
|
|
4010
|
+
const loadWorkflowSteps = async () => {
|
|
4011
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4012
|
+
const flowCore = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore;
|
|
4013
|
+
const workflowStepEndpoint = ((_b = flowCore == null ? void 0 : flowCore.workflowStep) == null ? void 0 : _b.getList) || ((_c = flowCore == null ? void 0 : flowCore.WorkFlowStep) == null ? void 0 : _c.getList) || ((_d = flowCore == null ? void 0 : flowCore.workFlowStep) == null ? void 0 : _d.getList);
|
|
4014
|
+
if (!workflowStepEndpoint) {
|
|
4015
|
+
setWorkflowSteps([]);
|
|
4016
|
+
setWorkflowStepsError("Workflow step list endpoint is not configured.");
|
|
4017
|
+
return;
|
|
4018
|
+
}
|
|
4019
|
+
setIsLoadingWorkflowSteps(true);
|
|
4020
|
+
setWorkflowStepsError("");
|
|
4021
|
+
try {
|
|
4022
|
+
const result = await getApiService().get(workflowStepEndpoint);
|
|
4023
|
+
const value = ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.data) || ((_f = result == null ? void 0 : result.data) == null ? void 0 : _f.result) || (result == null ? void 0 : result.data) || result;
|
|
4024
|
+
setWorkflowSteps(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
|
|
4025
|
+
} catch (error) {
|
|
4026
|
+
setWorkflowSteps([]);
|
|
4027
|
+
setWorkflowStepsError(((_h = (_g = error == null ? void 0 : error.response) == null ? void 0 : _g.data) == null ? void 0 : _h.message) || (error == null ? void 0 : error.message) || "Unable to load workflow steps.");
|
|
4028
|
+
} finally {
|
|
4029
|
+
setIsLoadingWorkflowSteps(false);
|
|
4030
|
+
}
|
|
4031
|
+
};
|
|
4032
|
+
loadWorkflowSteps();
|
|
4033
|
+
}, [isOpen]);
|
|
4034
|
+
useEffect13(() => {
|
|
4035
|
+
var _a, _b;
|
|
3967
4036
|
if (selectedMapping) {
|
|
3968
4037
|
setFormData({
|
|
4038
|
+
workflowStepId: (_b = (_a = selectedMapping.workflowStepId) != null ? _a : selectedMapping.WorkflowStepId) != null ? _b : "",
|
|
3969
4039
|
hierarchyNodeId: selectedMapping.hierarchyNodeId || "",
|
|
3970
4040
|
roleCode: selectedMapping.roleCode || "",
|
|
3971
4041
|
isPrimary: selectedMapping.isPrimary === true || selectedMapping.isPrimary === 1 || selectedMapping.isPrimary === "1" || selectedMapping.isPrimary === "Yes" ? "true" : "false",
|
|
@@ -3984,10 +4054,15 @@ function EditUserHierarchyNodeMappingModal({
|
|
|
3984
4054
|
const handleSubmit = async (event) => {
|
|
3985
4055
|
var _a, _b, _c;
|
|
3986
4056
|
event.preventDefault();
|
|
4057
|
+
if (!formData.workflowStepId) {
|
|
4058
|
+
alert("Please select a workflow step.");
|
|
4059
|
+
return;
|
|
4060
|
+
}
|
|
3987
4061
|
if (onSave) {
|
|
3988
4062
|
const success = await onSave({
|
|
3989
4063
|
mappingId: Number((_a = selectedMapping.mappingId) != null ? _a : selectedMapping.id),
|
|
3990
4064
|
externalUserId: Number(selectedMapping.externalUserId),
|
|
4065
|
+
workflowStepId: Number(formData.workflowStepId),
|
|
3991
4066
|
hierarchyNodeId: Number(formData.hierarchyNodeId),
|
|
3992
4067
|
roleCode: formData.roleCode,
|
|
3993
4068
|
isPrimary: formData.isPrimary === "true",
|
|
@@ -4054,6 +4129,32 @@ function EditUserHierarchyNodeMappingModal({
|
|
|
4054
4129
|
/* @__PURE__ */ jsx24("span", { children: "Edit Mapping" })
|
|
4055
4130
|
] }),
|
|
4056
4131
|
/* @__PURE__ */ jsxs23("div", { className: "fc:grid fc:grid-cols-1 fc:gap-5 fc:md:grid-cols-2", children: [
|
|
4132
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
4133
|
+
/* @__PURE__ */ jsx24("label", { className: "mb-1.5 block text-xs font-bold text-slate-700", children: "Workflow Step" }),
|
|
4134
|
+
/* @__PURE__ */ jsxs23(
|
|
4135
|
+
"select",
|
|
4136
|
+
{
|
|
4137
|
+
name: "workflowStepId",
|
|
4138
|
+
value: formData.workflowStepId,
|
|
4139
|
+
onChange: handleChange,
|
|
4140
|
+
disabled: isLoadingWorkflowSteps,
|
|
4141
|
+
className: "fc:w-full fc:rounded-xl fc:border fc:border-slate-200 fc:bg-white fc:p-2.5 fc:text-xs fc:text-slate-700 fc:focus:border-indigo-500 fc:focus:outline-none fc:focus:ring-2 fc:focus:ring-indigo-500/10 disabled:fc:bg-slate-100 disabled:fc:cursor-not-allowed",
|
|
4142
|
+
children: [
|
|
4143
|
+
/* @__PURE__ */ jsx24("option", { value: "", children: isLoadingWorkflowSteps ? "Loading workflow steps..." : "Select workflow step" }),
|
|
4144
|
+
workflowSteps.map((step) => {
|
|
4145
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4146
|
+
const id = (_b = (_a = step.workflowStepId) != null ? _a : step.WorkflowStepId) != null ? _b : step.id;
|
|
4147
|
+
const name = (_f = (_e = (_d = (_c = step.stepName) != null ? _c : step.StepName) != null ? _d : step.name) != null ? _e : step.workflowStepName) != null ? _f : step.WorkflowStepName;
|
|
4148
|
+
return /* @__PURE__ */ jsxs23("option", { value: id, children: [
|
|
4149
|
+
id,
|
|
4150
|
+
name ? ` - ${name}` : ""
|
|
4151
|
+
] }, id);
|
|
4152
|
+
})
|
|
4153
|
+
]
|
|
4154
|
+
}
|
|
4155
|
+
),
|
|
4156
|
+
workflowStepsError ? /* @__PURE__ */ jsx24("p", { className: "fc:mt-1 fc:text-[10px] fc:text-red-500", children: workflowStepsError }) : null
|
|
4157
|
+
] }),
|
|
4057
4158
|
/* @__PURE__ */ jsxs23("div", { children: [
|
|
4058
4159
|
/* @__PURE__ */ jsx24("label", { className: "mb-1.5 block text-xs font-bold text-slate-700", children: "Hierarchy Node ID" }),
|
|
4059
4160
|
/* @__PURE__ */ jsx24(
|
|
@@ -4371,7 +4472,7 @@ function User_hierarchy_mapping_main() {
|
|
|
4371
4472
|
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;
|
|
4372
4473
|
setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
|
|
4373
4474
|
} catch (error) {
|
|
4374
|
-
await
|
|
4475
|
+
await Swal10.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load Workflow Step Hierarchy Mappings.", "error");
|
|
4375
4476
|
}
|
|
4376
4477
|
})();
|
|
4377
4478
|
}, [refreshkey]);
|
|
@@ -4394,11 +4495,11 @@ function User_hierarchy_mapping_main() {
|
|
|
4394
4495
|
const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.WorkflowStepUserMapping) == null ? void 0 : _c[isEdit ? "update" : "create"];
|
|
4395
4496
|
if (!endpoint) throw new Error(`Workflow Step Hierarchy Mapping ${isEdit ? "update" : "create"} endpoint is not configured.`);
|
|
4396
4497
|
await getApiService()[isEdit ? "put" : "post"](endpoint, payload);
|
|
4397
|
-
await
|
|
4498
|
+
await Swal10.fire("Success", `Workflow Step Hierarchy Mapping ${isEdit ? "updated" : "created"} successfully.`, "success");
|
|
4398
4499
|
handleRefresh();
|
|
4399
4500
|
return true;
|
|
4400
4501
|
} catch (error) {
|
|
4401
|
-
await
|
|
4502
|
+
await Swal10.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"} Workflow Step Hierarchy Mapping.`, "error");
|
|
4402
4503
|
return false;
|
|
4403
4504
|
}
|
|
4404
4505
|
};
|
|
@@ -4440,7 +4541,7 @@ function User_hierarchy_mapping_main() {
|
|
|
4440
4541
|
|
|
4441
4542
|
// src/components/user-hierarchy-node-mapping/Workflow_Step_Hierarchy_Mapping.jsx
|
|
4442
4543
|
import React28, { useEffect as useEffect16, useMemo, useRef as useRef7, useState as useState20 } from "react";
|
|
4443
|
-
import
|
|
4544
|
+
import Swal11 from "sweetalert2";
|
|
4444
4545
|
import { jsx as jsx28, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
4445
4546
|
var emptyForm = { workflowStepId: "", hierarchyNodeId: "", isActive: "true" };
|
|
4446
4547
|
var getRows = (result) => {
|
|
@@ -4512,7 +4613,7 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4512
4613
|
hierarchyNodeResult ? getRows(hierarchyNodeResult) : []
|
|
4513
4614
|
);
|
|
4514
4615
|
} catch (error) {
|
|
4515
|
-
await
|
|
4616
|
+
await Swal11.fire(
|
|
4516
4617
|
"Error",
|
|
4517
4618
|
((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to load workflow step hierarchy mappings.",
|
|
4518
4619
|
"error"
|
|
@@ -4543,7 +4644,7 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4543
4644
|
var _a, _b, _c, _d;
|
|
4544
4645
|
event.preventDefault();
|
|
4545
4646
|
if (!formData.workflowStepId || !formData.hierarchyNodeId)
|
|
4546
|
-
return
|
|
4647
|
+
return Swal11.fire(
|
|
4547
4648
|
"Required fields",
|
|
4548
4649
|
"Please select a workflow step and hierarchy node.",
|
|
4549
4650
|
"warning"
|
|
@@ -4564,7 +4665,7 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4564
4665
|
updatedBy: "System"
|
|
4565
4666
|
} : { createdBy: "System" });
|
|
4566
4667
|
await getApiService()[editingMapping ? "put" : "post"](endpoint, payload);
|
|
4567
|
-
await
|
|
4668
|
+
await Swal11.fire(
|
|
4568
4669
|
"Success",
|
|
4569
4670
|
`Workflow step hierarchy mapping ${editingMapping ? "updated" : "created"} successfully.`,
|
|
4570
4671
|
"success"
|
|
@@ -4572,7 +4673,7 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4572
4673
|
setIsModalOpen(false);
|
|
4573
4674
|
setRefreshKey((previous) => previous + 1);
|
|
4574
4675
|
} catch (error) {
|
|
4575
|
-
await
|
|
4676
|
+
await Swal11.fire(
|
|
4576
4677
|
"Error",
|
|
4577
4678
|
((_d = (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message) || (error == null ? void 0 : error.message) || "Unable to save workflow step hierarchy mapping.",
|
|
4578
4679
|
"error"
|
|
@@ -4583,7 +4684,7 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4583
4684
|
};
|
|
4584
4685
|
const handleDelete = async (mapping) => {
|
|
4585
4686
|
var _a, _b, _c, _d, _e, _f;
|
|
4586
|
-
const confirmation = await
|
|
4687
|
+
const confirmation = await Swal11.fire({
|
|
4587
4688
|
title: "Delete mapping?",
|
|
4588
4689
|
text: "This mapping will be marked inactive.",
|
|
4589
4690
|
icon: "warning",
|
|
@@ -4609,14 +4710,14 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4609
4710
|
isActive: false,
|
|
4610
4711
|
updatedBy: "System"
|
|
4611
4712
|
});
|
|
4612
|
-
await
|
|
4713
|
+
await Swal11.fire(
|
|
4613
4714
|
"Deleted",
|
|
4614
4715
|
"Workflow step hierarchy mapping has been deactivated.",
|
|
4615
4716
|
"success"
|
|
4616
4717
|
);
|
|
4617
4718
|
setRefreshKey((previous) => previous + 1);
|
|
4618
4719
|
} catch (error) {
|
|
4619
|
-
await
|
|
4720
|
+
await Swal11.fire(
|
|
4620
4721
|
"Error",
|
|
4621
4722
|
((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to delete workflow step hierarchy mapping.",
|
|
4622
4723
|
"error"
|
|
@@ -4919,7 +5020,7 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4919
5020
|
|
|
4920
5021
|
// src/components/document-configuration/DocumentConfigurationmain.jsx
|
|
4921
5022
|
import React34, { useState as useState24, useRef as useRef8 } from "react";
|
|
4922
|
-
import
|
|
5023
|
+
import Swal13 from "sweetalert2";
|
|
4923
5024
|
|
|
4924
5025
|
// src/components/document-configuration/SearchBar.jsx
|
|
4925
5026
|
import React29 from "react";
|
|
@@ -4940,7 +5041,7 @@ function SearchBar3({
|
|
|
4940
5041
|
|
|
4941
5042
|
// src/components/document-configuration/DocumentConfigurationTable.jsx
|
|
4942
5043
|
import React32, { useState as useState22, useEffect as useEffect18 } from "react";
|
|
4943
|
-
import
|
|
5044
|
+
import Swal12 from "sweetalert2";
|
|
4944
5045
|
|
|
4945
5046
|
// src/components/document-configuration/Edit.jsx
|
|
4946
5047
|
import React30, { useState as useState21, useEffect as useEffect17 } from "react";
|
|
@@ -5438,7 +5539,7 @@ function DocumentConfigTable({
|
|
|
5438
5539
|
setData(unwrapRows(result).map(toUiItem));
|
|
5439
5540
|
} catch (error) {
|
|
5440
5541
|
setData([]);
|
|
5441
|
-
await
|
|
5542
|
+
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 load document configurations.", "error");
|
|
5442
5543
|
} finally {
|
|
5443
5544
|
setIsLoading(false);
|
|
5444
5545
|
}
|
|
@@ -5488,7 +5589,7 @@ function DocumentConfigTable({
|
|
|
5488
5589
|
setSelectedItem(toUiItem(value != null ? value : item));
|
|
5489
5590
|
setIsEditOpen(true);
|
|
5490
5591
|
} catch (error) {
|
|
5491
|
-
await
|
|
5592
|
+
await Swal12.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");
|
|
5492
5593
|
}
|
|
5493
5594
|
};
|
|
5494
5595
|
const handleDelete = (item) => {
|
|
@@ -5513,12 +5614,12 @@ function DocumentConfigTable({
|
|
|
5513
5614
|
isActive: updatedData.status === "Active",
|
|
5514
5615
|
updatedBy: "System"
|
|
5515
5616
|
});
|
|
5516
|
-
await
|
|
5617
|
+
await Swal12.fire("Success", "Document configuration updated successfully.", "success");
|
|
5517
5618
|
setIsEditOpen(false);
|
|
5518
5619
|
await loadData();
|
|
5519
5620
|
return true;
|
|
5520
5621
|
} catch (error) {
|
|
5521
|
-
await
|
|
5622
|
+
await Swal12.fire("Error", ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to update document configuration.", "error");
|
|
5522
5623
|
return false;
|
|
5523
5624
|
}
|
|
5524
5625
|
};
|
|
@@ -5916,12 +6017,12 @@ function DocumentConfigurationmain() {
|
|
|
5916
6017
|
const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.documentConfiguration) == null ? void 0 : _c.create;
|
|
5917
6018
|
if (!endpoint) throw new Error("Document Configuration create endpoint is not configured.");
|
|
5918
6019
|
await getApiService().post(endpoint, payload);
|
|
5919
|
-
await
|
|
6020
|
+
await Swal13.fire("Success", "Document configuration created successfully.", "success");
|
|
5920
6021
|
setModalOpen(false);
|
|
5921
6022
|
handleRefresh();
|
|
5922
6023
|
return true;
|
|
5923
6024
|
} catch (error) {
|
|
5924
|
-
await
|
|
6025
|
+
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 create document configuration.", "error");
|
|
5925
6026
|
return false;
|
|
5926
6027
|
}
|
|
5927
6028
|
};
|
|
@@ -6980,7 +7081,7 @@ function MovementHistorymain() {
|
|
|
6980
7081
|
|
|
6981
7082
|
// src/components/task-permission/TaskPermissionMain.jsx
|
|
6982
7083
|
import React47, { useState as useState34, useRef as useRef11 } from "react";
|
|
6983
|
-
import
|
|
7084
|
+
import Swal15 from "sweetalert2";
|
|
6984
7085
|
|
|
6985
7086
|
// src/components/task-permission/SearchBar.js
|
|
6986
7087
|
import React43 from "react";
|
|
@@ -7249,7 +7350,7 @@ function Table({
|
|
|
7249
7350
|
|
|
7250
7351
|
// src/components/task-permission/Popup.js
|
|
7251
7352
|
import React45, { useState as useState32, useEffect as useEffect23 } from "react";
|
|
7252
|
-
import
|
|
7353
|
+
import Swal14 from "sweetalert2";
|
|
7253
7354
|
import { jsx as jsx45, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
7254
7355
|
function Popup({ isOpen, onClose, onSave }) {
|
|
7255
7356
|
const [formData, setFormData] = useState32({
|
|
@@ -7319,7 +7420,7 @@ function Popup({ isOpen, onClose, onSave }) {
|
|
|
7319
7420
|
await (onSave == null ? void 0 : onSave());
|
|
7320
7421
|
} catch (error) {
|
|
7321
7422
|
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.";
|
|
7322
|
-
await
|
|
7423
|
+
await Swal14.fire("Error", msg, "error");
|
|
7323
7424
|
} finally {
|
|
7324
7425
|
setIsSubmitting(false);
|
|
7325
7426
|
}
|
|
@@ -7718,13 +7819,13 @@ function TaskPermissionMain() {
|
|
|
7718
7819
|
handleRefresh();
|
|
7719
7820
|
return true;
|
|
7720
7821
|
} catch (error) {
|
|
7721
|
-
await
|
|
7822
|
+
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 update task permission.", "error");
|
|
7722
7823
|
return false;
|
|
7723
7824
|
}
|
|
7724
7825
|
};
|
|
7725
7826
|
const handleDeleteApi = async (item) => {
|
|
7726
7827
|
var _a;
|
|
7727
|
-
const confirm = await
|
|
7828
|
+
const confirm = await Swal15.fire({
|
|
7728
7829
|
title: "Delete Task Permission?",
|
|
7729
7830
|
text: `Permission #${(_a = item.taskPermissionId) != null ? _a : item.TaskPermissionId} will be marked as inactive.`,
|
|
7730
7831
|
icon: "warning",
|
|
@@ -7734,7 +7835,7 @@ function TaskPermissionMain() {
|
|
|
7734
7835
|
});
|
|
7735
7836
|
if (!confirm.isConfirmed) return;
|
|
7736
7837
|
const ok = await handleUpdateApi(__spreadProps(__spreadValues({}, item), { isActive: false }));
|
|
7737
|
-
if (ok) await
|
|
7838
|
+
if (ok) await Swal15.fire("Deleted", "Task permission has been deactivated.", "success");
|
|
7738
7839
|
};
|
|
7739
7840
|
return /* @__PURE__ */ jsxs46("div", { className: "fc:h-screen fc:overflow-hidden fc:bg-slate-50 fc:p-4 md:fc:fc:p-6", children: [
|
|
7740
7841
|
/* @__PURE__ */ jsxs46("div", { className: "fc:w-full fc:space-y-5", children: [
|
|
@@ -7787,7 +7888,7 @@ function TaskPermissionMain() {
|
|
|
7787
7888
|
isOpen: showModal,
|
|
7788
7889
|
onClose: () => setShowModal(false),
|
|
7789
7890
|
onSave: async () => {
|
|
7790
|
-
await
|
|
7891
|
+
await Swal15.fire("Success", "Task permission created successfully.", "success");
|
|
7791
7892
|
handleRefresh();
|
|
7792
7893
|
}
|
|
7793
7894
|
}
|
|
@@ -7799,7 +7900,7 @@ function TaskPermissionMain() {
|
|
|
7799
7900
|
onClose: () => setIsEditOpen(false),
|
|
7800
7901
|
selectedData: selectedItem,
|
|
7801
7902
|
onSave: async () => {
|
|
7802
|
-
await
|
|
7903
|
+
await Swal15.fire("Success", "Task permission updated successfully.", "success");
|
|
7803
7904
|
handleRefresh();
|
|
7804
7905
|
},
|
|
7805
7906
|
onUpdate: handleUpdateApi
|
|
@@ -10369,7 +10470,7 @@ function Comment_main() {
|
|
|
10369
10470
|
|
|
10370
10471
|
// src/components/hierarchy-node/HierarchyNodeMain.jsx
|
|
10371
10472
|
import React71, { useState as useState50, useRef as useRef16, useEffect as useEffect32 } from "react";
|
|
10372
|
-
import
|
|
10473
|
+
import Swal16 from "sweetalert2";
|
|
10373
10474
|
|
|
10374
10475
|
// src/components/hierarchy-node/SearchBar.jsx
|
|
10375
10476
|
import React66 from "react";
|
|
@@ -10973,7 +11074,7 @@ function HierarchyNodeMain() {
|
|
|
10973
11074
|
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;
|
|
10974
11075
|
setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
|
|
10975
11076
|
} catch (error) {
|
|
10976
|
-
await
|
|
11077
|
+
await Swal16.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");
|
|
10977
11078
|
}
|
|
10978
11079
|
})();
|
|
10979
11080
|
}, [refreshKey]);
|
|
@@ -10986,11 +11087,11 @@ function HierarchyNodeMain() {
|
|
|
10986
11087
|
const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.hierarchyNode) == null ? void 0 : _c[isEdit ? "update" : "create"];
|
|
10987
11088
|
if (!endpoint) throw new Error(`Hierarchy node ${isEdit ? "update" : "create"} endpoint is not configured.`);
|
|
10988
11089
|
await getApiService()[isEdit ? "put" : "post"](endpoint, payload);
|
|
10989
|
-
await
|
|
11090
|
+
await Swal16.fire("Success", `Hierarchy node ${isEdit ? "updated" : "created"} successfully.`, "success");
|
|
10990
11091
|
handleRefresh();
|
|
10991
11092
|
return true;
|
|
10992
11093
|
} catch (error) {
|
|
10993
|
-
await
|
|
11094
|
+
await Swal16.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");
|
|
10994
11095
|
return false;
|
|
10995
11096
|
}
|
|
10996
11097
|
};
|