flowcore-fn 9.5.2 → 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 +152 -45
- package/dist/pkg-index.mjs +150 -45
- package/package.json +1 -1
package/dist/pkg-index.js
CHANGED
|
@@ -3901,12 +3901,13 @@ function WorkFlowTransition() {
|
|
|
3901
3901
|
|
|
3902
3902
|
// src/components/user-hierarchy-node-mapping/user_hierarachy_node_main.jsx
|
|
3903
3903
|
var import_react27 = __toESM(require("react"));
|
|
3904
|
-
var
|
|
3904
|
+
var import_sweetalert210 = __toESM(require("sweetalert2"));
|
|
3905
3905
|
init_ApiEndpointsProvider();
|
|
3906
3906
|
init_ApiServicepackage();
|
|
3907
3907
|
|
|
3908
3908
|
// src/components/user-hierarchy-node-mapping/adduserhierarchynode.jsx
|
|
3909
3909
|
var import_react22 = __toESM(require("react"));
|
|
3910
|
+
var import_sweetalert29 = __toESM(require("sweetalert2"));
|
|
3910
3911
|
init_ApiEndpointsProvider();
|
|
3911
3912
|
init_ApiServicepackage();
|
|
3912
3913
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
@@ -3915,37 +3916,55 @@ function AddUserHierarchyNodeMappingModal({
|
|
|
3915
3916
|
onClose,
|
|
3916
3917
|
onSave
|
|
3917
3918
|
}) {
|
|
3918
|
-
const [formData, setFormData] = (0, import_react22.useState)({ mappingId: "", externalUserId: "", hierarchyNodeId: "", roleCode: "", isPrimary: "", effectiveFrom: "", effectiveTo: "" });
|
|
3919
|
+
const [formData, setFormData] = (0, import_react22.useState)({ mappingId: "", externalUserId: "", workflowStepId: "", hierarchyNodeId: "", roleCode: "", isPrimary: "", effectiveFrom: "", effectiveTo: "" });
|
|
3919
3920
|
const [isSubmitting, setIsSubmitting] = (0, import_react22.useState)(false);
|
|
3920
3921
|
const [hierarchyNodes, setHierarchyNodes] = (0, import_react22.useState)([]);
|
|
3922
|
+
const [workflowSteps, setWorkflowSteps] = (0, import_react22.useState)([]);
|
|
3921
3923
|
const [isLoadingHierarchyNodes, setIsLoadingHierarchyNodes] = (0, import_react22.useState)(false);
|
|
3924
|
+
const [isLoadingWorkflowSteps, setIsLoadingWorkflowSteps] = (0, import_react22.useState)(false);
|
|
3922
3925
|
const [hierarchyNodesError, setHierarchyNodesError] = (0, import_react22.useState)("");
|
|
3926
|
+
const [workflowStepsError, setWorkflowStepsError] = (0, import_react22.useState)("");
|
|
3923
3927
|
(0, import_react22.useEffect)(() => {
|
|
3924
3928
|
if (!isOpen) return;
|
|
3925
|
-
const
|
|
3926
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
3929
|
+
const loadData = async () => {
|
|
3930
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
3931
|
+
const flowCore = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore;
|
|
3932
|
+
const hierarchyEndpoint = (_b = flowCore == null ? void 0 : flowCore.hierarchyNode) == null ? void 0 : _b.getList;
|
|
3933
|
+
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);
|
|
3927
3934
|
setIsLoadingHierarchyNodes(true);
|
|
3935
|
+
setIsLoadingWorkflowSteps(true);
|
|
3928
3936
|
setHierarchyNodesError("");
|
|
3937
|
+
setWorkflowStepsError("");
|
|
3929
3938
|
try {
|
|
3930
|
-
const
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3939
|
+
const [hierarchyResult, workflowStepResult] = await Promise.all([
|
|
3940
|
+
hierarchyEndpoint ? getApiService().get(hierarchyEndpoint) : Promise.resolve(null),
|
|
3941
|
+
workflowStepEndpoint ? getApiService().get(workflowStepEndpoint) : Promise.resolve(null)
|
|
3942
|
+
]);
|
|
3943
|
+
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;
|
|
3944
|
+
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;
|
|
3945
|
+
setHierarchyNodes(Array.isArray(hierarchyValue) ? hierarchyValue : (hierarchyValue == null ? void 0 : hierarchyValue.items) || (hierarchyValue == null ? void 0 : hierarchyValue.records) || []);
|
|
3946
|
+
setWorkflowSteps(Array.isArray(workflowStepValue) ? workflowStepValue : (workflowStepValue == null ? void 0 : workflowStepValue.items) || (workflowStepValue == null ? void 0 : workflowStepValue.records) || []);
|
|
3935
3947
|
} catch (error) {
|
|
3936
3948
|
setHierarchyNodes([]);
|
|
3937
|
-
|
|
3949
|
+
setWorkflowSteps([]);
|
|
3950
|
+
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.");
|
|
3951
|
+
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.");
|
|
3938
3952
|
} finally {
|
|
3939
3953
|
setIsLoadingHierarchyNodes(false);
|
|
3954
|
+
setIsLoadingWorkflowSteps(false);
|
|
3940
3955
|
}
|
|
3941
3956
|
};
|
|
3942
|
-
|
|
3957
|
+
loadData();
|
|
3943
3958
|
}, [isOpen]);
|
|
3944
3959
|
const handleChange = (event) => setFormData((previous) => __spreadProps(__spreadValues({}, previous), { [event.target.name]: event.target.value }));
|
|
3945
3960
|
const handleSave = async () => {
|
|
3946
3961
|
if (!onSave) return;
|
|
3962
|
+
if (!formData.workflowStepId) {
|
|
3963
|
+
await import_sweetalert29.default.fire("Required field", "Please select a workflow step.", "warning");
|
|
3964
|
+
return;
|
|
3965
|
+
}
|
|
3947
3966
|
setIsSubmitting(true);
|
|
3948
|
-
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" });
|
|
3967
|
+
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" });
|
|
3949
3968
|
setIsSubmitting(false);
|
|
3950
3969
|
if (success) onClose();
|
|
3951
3970
|
};
|
|
@@ -3987,6 +4006,25 @@ function AddUserHierarchyNodeMappingModal({
|
|
|
3987
4006
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "fc:text-[10px] fc:text-slate-400 fc:mt-1", children: "Enter the consumer user ID" })
|
|
3988
4007
|
] })
|
|
3989
4008
|
] }),
|
|
4009
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
4010
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
|
|
4011
|
+
"Workflow Step ",
|
|
4012
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "fc:text-red-500", children: "*" })
|
|
4013
|
+
] }),
|
|
4014
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("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: [
|
|
4015
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: isLoadingWorkflowSteps ? "Loading workflow steps..." : "Select workflow step" }),
|
|
4016
|
+
workflowSteps.map((step) => {
|
|
4017
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4018
|
+
const id = (_b = (_a = step.workflowStepId) != null ? _a : step.WorkflowStepId) != null ? _b : step.id;
|
|
4019
|
+
const name = (_f = (_e = (_d = (_c = step.stepName) != null ? _c : step.StepName) != null ? _d : step.name) != null ? _e : step.workflowStepName) != null ? _f : step.WorkflowStepName;
|
|
4020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: id, children: [
|
|
4021
|
+
id,
|
|
4022
|
+
name ? ` - ${name}` : ""
|
|
4023
|
+
] }, id);
|
|
4024
|
+
})
|
|
4025
|
+
] }),
|
|
4026
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("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" })
|
|
4027
|
+
] }),
|
|
3990
4028
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
3991
4029
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
|
|
3992
4030
|
"Hierarchy Node ID ",
|
|
@@ -4083,6 +4121,8 @@ var import_react26 = __toESM(require("react"));
|
|
|
4083
4121
|
|
|
4084
4122
|
// src/components/user-hierarchy-node-mapping/edit-mapping.jsx
|
|
4085
4123
|
var import_react24 = __toESM(require("react"));
|
|
4124
|
+
init_ApiEndpointsProvider();
|
|
4125
|
+
init_ApiServicepackage();
|
|
4086
4126
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4087
4127
|
function EditUserHierarchyNodeMappingModal({
|
|
4088
4128
|
isOpen,
|
|
@@ -4091,15 +4131,47 @@ function EditUserHierarchyNodeMappingModal({
|
|
|
4091
4131
|
onSave
|
|
4092
4132
|
}) {
|
|
4093
4133
|
const [formData, setFormData] = (0, import_react24.useState)({
|
|
4134
|
+
workflowStepId: "",
|
|
4094
4135
|
hierarchyNodeId: "",
|
|
4095
4136
|
roleCode: "",
|
|
4096
4137
|
isPrimary: "",
|
|
4097
4138
|
effectiveFrom: "",
|
|
4098
4139
|
effectiveTo: ""
|
|
4099
4140
|
});
|
|
4141
|
+
const [workflowSteps, setWorkflowSteps] = (0, import_react24.useState)([]);
|
|
4142
|
+
const [isLoadingWorkflowSteps, setIsLoadingWorkflowSteps] = (0, import_react24.useState)(false);
|
|
4143
|
+
const [workflowStepsError, setWorkflowStepsError] = (0, import_react24.useState)("");
|
|
4144
|
+
(0, import_react24.useEffect)(() => {
|
|
4145
|
+
if (!isOpen) return;
|
|
4146
|
+
const loadWorkflowSteps = async () => {
|
|
4147
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4148
|
+
const flowCore = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore;
|
|
4149
|
+
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);
|
|
4150
|
+
if (!workflowStepEndpoint) {
|
|
4151
|
+
setWorkflowSteps([]);
|
|
4152
|
+
setWorkflowStepsError("Workflow step list endpoint is not configured.");
|
|
4153
|
+
return;
|
|
4154
|
+
}
|
|
4155
|
+
setIsLoadingWorkflowSteps(true);
|
|
4156
|
+
setWorkflowStepsError("");
|
|
4157
|
+
try {
|
|
4158
|
+
const result = await getApiService().get(workflowStepEndpoint);
|
|
4159
|
+
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;
|
|
4160
|
+
setWorkflowSteps(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
|
|
4161
|
+
} catch (error) {
|
|
4162
|
+
setWorkflowSteps([]);
|
|
4163
|
+
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.");
|
|
4164
|
+
} finally {
|
|
4165
|
+
setIsLoadingWorkflowSteps(false);
|
|
4166
|
+
}
|
|
4167
|
+
};
|
|
4168
|
+
loadWorkflowSteps();
|
|
4169
|
+
}, [isOpen]);
|
|
4100
4170
|
(0, import_react24.useEffect)(() => {
|
|
4171
|
+
var _a, _b;
|
|
4101
4172
|
if (selectedMapping) {
|
|
4102
4173
|
setFormData({
|
|
4174
|
+
workflowStepId: (_b = (_a = selectedMapping.workflowStepId) != null ? _a : selectedMapping.WorkflowStepId) != null ? _b : "",
|
|
4103
4175
|
hierarchyNodeId: selectedMapping.hierarchyNodeId || "",
|
|
4104
4176
|
roleCode: selectedMapping.roleCode || "",
|
|
4105
4177
|
isPrimary: selectedMapping.isPrimary === true || selectedMapping.isPrimary === 1 || selectedMapping.isPrimary === "1" || selectedMapping.isPrimary === "Yes" ? "true" : "false",
|
|
@@ -4118,10 +4190,15 @@ function EditUserHierarchyNodeMappingModal({
|
|
|
4118
4190
|
const handleSubmit = async (event) => {
|
|
4119
4191
|
var _a, _b, _c;
|
|
4120
4192
|
event.preventDefault();
|
|
4193
|
+
if (!formData.workflowStepId) {
|
|
4194
|
+
alert("Please select a workflow step.");
|
|
4195
|
+
return;
|
|
4196
|
+
}
|
|
4121
4197
|
if (onSave) {
|
|
4122
4198
|
const success = await onSave({
|
|
4123
4199
|
mappingId: Number((_a = selectedMapping.mappingId) != null ? _a : selectedMapping.id),
|
|
4124
4200
|
externalUserId: Number(selectedMapping.externalUserId),
|
|
4201
|
+
workflowStepId: Number(formData.workflowStepId),
|
|
4125
4202
|
hierarchyNodeId: Number(formData.hierarchyNodeId),
|
|
4126
4203
|
roleCode: formData.roleCode,
|
|
4127
4204
|
isPrimary: formData.isPrimary === "true",
|
|
@@ -4188,6 +4265,32 @@ function EditUserHierarchyNodeMappingModal({
|
|
|
4188
4265
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "Edit Mapping" })
|
|
4189
4266
|
] }),
|
|
4190
4267
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "fc:grid fc:grid-cols-1 fc:gap-5 fc:md:grid-cols-2", children: [
|
|
4268
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
4269
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { className: "mb-1.5 block text-xs font-bold text-slate-700", children: "Workflow Step" }),
|
|
4270
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4271
|
+
"select",
|
|
4272
|
+
{
|
|
4273
|
+
name: "workflowStepId",
|
|
4274
|
+
value: formData.workflowStepId,
|
|
4275
|
+
onChange: handleChange,
|
|
4276
|
+
disabled: isLoadingWorkflowSteps,
|
|
4277
|
+
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",
|
|
4278
|
+
children: [
|
|
4279
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: isLoadingWorkflowSteps ? "Loading workflow steps..." : "Select workflow step" }),
|
|
4280
|
+
workflowSteps.map((step) => {
|
|
4281
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4282
|
+
const id = (_b = (_a = step.workflowStepId) != null ? _a : step.WorkflowStepId) != null ? _b : step.id;
|
|
4283
|
+
const name = (_f = (_e = (_d = (_c = step.stepName) != null ? _c : step.StepName) != null ? _d : step.name) != null ? _e : step.workflowStepName) != null ? _f : step.WorkflowStepName;
|
|
4284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: id, children: [
|
|
4285
|
+
id,
|
|
4286
|
+
name ? ` - ${name}` : ""
|
|
4287
|
+
] }, id);
|
|
4288
|
+
})
|
|
4289
|
+
]
|
|
4290
|
+
}
|
|
4291
|
+
),
|
|
4292
|
+
workflowStepsError ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "fc:mt-1 fc:text-[10px] fc:text-red-500", children: workflowStepsError }) : null
|
|
4293
|
+
] }),
|
|
4191
4294
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
4192
4295
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { className: "mb-1.5 block text-xs font-bold text-slate-700", children: "Hierarchy Node ID" }),
|
|
4193
4296
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
@@ -4505,7 +4608,7 @@ function User_hierarchy_mapping_main() {
|
|
|
4505
4608
|
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;
|
|
4506
4609
|
setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
|
|
4507
4610
|
} catch (error) {
|
|
4508
|
-
await
|
|
4611
|
+
await import_sweetalert210.default.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");
|
|
4509
4612
|
}
|
|
4510
4613
|
})();
|
|
4511
4614
|
}, [refreshkey]);
|
|
@@ -4528,11 +4631,11 @@ function User_hierarchy_mapping_main() {
|
|
|
4528
4631
|
const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.WorkflowStepUserMapping) == null ? void 0 : _c[isEdit ? "update" : "create"];
|
|
4529
4632
|
if (!endpoint) throw new Error(`Workflow Step Hierarchy Mapping ${isEdit ? "update" : "create"} endpoint is not configured.`);
|
|
4530
4633
|
await getApiService()[isEdit ? "put" : "post"](endpoint, payload);
|
|
4531
|
-
await
|
|
4634
|
+
await import_sweetalert210.default.fire("Success", `Workflow Step Hierarchy Mapping ${isEdit ? "updated" : "created"} successfully.`, "success");
|
|
4532
4635
|
handleRefresh();
|
|
4533
4636
|
return true;
|
|
4534
4637
|
} catch (error) {
|
|
4535
|
-
await
|
|
4638
|
+
await import_sweetalert210.default.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");
|
|
4536
4639
|
return false;
|
|
4537
4640
|
}
|
|
4538
4641
|
};
|
|
@@ -4574,7 +4677,7 @@ function User_hierarchy_mapping_main() {
|
|
|
4574
4677
|
|
|
4575
4678
|
// src/components/user-hierarchy-node-mapping/Workflow_Step_Hierarchy_Mapping.jsx
|
|
4576
4679
|
var import_react28 = __toESM(require("react"));
|
|
4577
|
-
var
|
|
4680
|
+
var import_sweetalert211 = __toESM(require("sweetalert2"));
|
|
4578
4681
|
init_ApiEndpointsProvider();
|
|
4579
4682
|
init_ApiServicepackage();
|
|
4580
4683
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
@@ -4648,7 +4751,7 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4648
4751
|
hierarchyNodeResult ? getRows(hierarchyNodeResult) : []
|
|
4649
4752
|
);
|
|
4650
4753
|
} catch (error) {
|
|
4651
|
-
await
|
|
4754
|
+
await import_sweetalert211.default.fire(
|
|
4652
4755
|
"Error",
|
|
4653
4756
|
((_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.",
|
|
4654
4757
|
"error"
|
|
@@ -4679,7 +4782,7 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4679
4782
|
var _a, _b, _c, _d;
|
|
4680
4783
|
event.preventDefault();
|
|
4681
4784
|
if (!formData.workflowStepId || !formData.hierarchyNodeId)
|
|
4682
|
-
return
|
|
4785
|
+
return import_sweetalert211.default.fire(
|
|
4683
4786
|
"Required fields",
|
|
4684
4787
|
"Please select a workflow step and hierarchy node.",
|
|
4685
4788
|
"warning"
|
|
@@ -4700,7 +4803,7 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4700
4803
|
updatedBy: "System"
|
|
4701
4804
|
} : { createdBy: "System" });
|
|
4702
4805
|
await getApiService()[editingMapping ? "put" : "post"](endpoint, payload);
|
|
4703
|
-
await
|
|
4806
|
+
await import_sweetalert211.default.fire(
|
|
4704
4807
|
"Success",
|
|
4705
4808
|
`Workflow step hierarchy mapping ${editingMapping ? "updated" : "created"} successfully.`,
|
|
4706
4809
|
"success"
|
|
@@ -4708,7 +4811,7 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4708
4811
|
setIsModalOpen(false);
|
|
4709
4812
|
setRefreshKey((previous) => previous + 1);
|
|
4710
4813
|
} catch (error) {
|
|
4711
|
-
await
|
|
4814
|
+
await import_sweetalert211.default.fire(
|
|
4712
4815
|
"Error",
|
|
4713
4816
|
((_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.",
|
|
4714
4817
|
"error"
|
|
@@ -4719,7 +4822,7 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4719
4822
|
};
|
|
4720
4823
|
const handleDelete = async (mapping) => {
|
|
4721
4824
|
var _a, _b, _c, _d, _e, _f;
|
|
4722
|
-
const confirmation = await
|
|
4825
|
+
const confirmation = await import_sweetalert211.default.fire({
|
|
4723
4826
|
title: "Delete mapping?",
|
|
4724
4827
|
text: "This mapping will be marked inactive.",
|
|
4725
4828
|
icon: "warning",
|
|
@@ -4745,14 +4848,14 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
4745
4848
|
isActive: false,
|
|
4746
4849
|
updatedBy: "System"
|
|
4747
4850
|
});
|
|
4748
|
-
await
|
|
4851
|
+
await import_sweetalert211.default.fire(
|
|
4749
4852
|
"Deleted",
|
|
4750
4853
|
"Workflow step hierarchy mapping has been deactivated.",
|
|
4751
4854
|
"success"
|
|
4752
4855
|
);
|
|
4753
4856
|
setRefreshKey((previous) => previous + 1);
|
|
4754
4857
|
} catch (error) {
|
|
4755
|
-
await
|
|
4858
|
+
await import_sweetalert211.default.fire(
|
|
4756
4859
|
"Error",
|
|
4757
4860
|
((_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.",
|
|
4758
4861
|
"error"
|
|
@@ -5055,7 +5158,7 @@ function Workflow_Step_Hierarchy_Mapping() {
|
|
|
5055
5158
|
|
|
5056
5159
|
// src/components/document-configuration/DocumentConfigurationmain.jsx
|
|
5057
5160
|
var import_react34 = __toESM(require("react"));
|
|
5058
|
-
var
|
|
5161
|
+
var import_sweetalert213 = __toESM(require("sweetalert2"));
|
|
5059
5162
|
init_ApiEndpointsProvider();
|
|
5060
5163
|
init_ApiServicepackage();
|
|
5061
5164
|
|
|
@@ -5078,7 +5181,7 @@ function SearchBar3({
|
|
|
5078
5181
|
|
|
5079
5182
|
// src/components/document-configuration/DocumentConfigurationTable.jsx
|
|
5080
5183
|
var import_react32 = __toESM(require("react"));
|
|
5081
|
-
var
|
|
5184
|
+
var import_sweetalert212 = __toESM(require("sweetalert2"));
|
|
5082
5185
|
|
|
5083
5186
|
// src/components/document-configuration/Edit.jsx
|
|
5084
5187
|
var import_react30 = __toESM(require("react"));
|
|
@@ -5580,7 +5683,7 @@ function DocumentConfigTable({
|
|
|
5580
5683
|
setData(unwrapRows(result).map(toUiItem));
|
|
5581
5684
|
} catch (error) {
|
|
5582
5685
|
setData([]);
|
|
5583
|
-
await
|
|
5686
|
+
await import_sweetalert212.default.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");
|
|
5584
5687
|
} finally {
|
|
5585
5688
|
setIsLoading(false);
|
|
5586
5689
|
}
|
|
@@ -5630,7 +5733,7 @@ function DocumentConfigTable({
|
|
|
5630
5733
|
setSelectedItem(toUiItem(value != null ? value : item));
|
|
5631
5734
|
setIsEditOpen(true);
|
|
5632
5735
|
} catch (error) {
|
|
5633
|
-
await
|
|
5736
|
+
await import_sweetalert212.default.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");
|
|
5634
5737
|
}
|
|
5635
5738
|
};
|
|
5636
5739
|
const handleDelete = (item) => {
|
|
@@ -5638,25 +5741,29 @@ function DocumentConfigTable({
|
|
|
5638
5741
|
setIsDeleteOpen(true);
|
|
5639
5742
|
};
|
|
5640
5743
|
const handleSaveEdit = async (updatedData) => {
|
|
5641
|
-
var _a, _b, _c, _d, _e;
|
|
5744
|
+
var _a, _b, _c, _d, _e, _f;
|
|
5642
5745
|
try {
|
|
5643
5746
|
const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.documentConfiguration) == null ? void 0 : _c.update;
|
|
5644
5747
|
if (!endpoint) throw new Error("Document Configuration update endpoint is not configured.");
|
|
5748
|
+
const maxSizeMB = Number.parseFloat((_d = updatedData.maxSizeNum) != null ? _d : updatedData.maxSize);
|
|
5749
|
+
if (!Number.isFinite(maxSizeMB) || maxSizeMB <= 0) {
|
|
5750
|
+
throw new Error("Please enter a valid maximum size in MB.");
|
|
5751
|
+
}
|
|
5645
5752
|
await getApiService().put(endpoint, {
|
|
5646
5753
|
documentConfigurationId: updatedData.id,
|
|
5647
5754
|
documentName: updatedData.docName.trim(),
|
|
5648
5755
|
allowedExtensions: updatedData.extensions.trim(),
|
|
5649
|
-
maxSizeMB
|
|
5756
|
+
maxSizeMB,
|
|
5650
5757
|
isMandatory: Boolean(updatedData.isMandatory),
|
|
5651
5758
|
isActive: updatedData.status === "Active",
|
|
5652
5759
|
updatedBy: "System"
|
|
5653
5760
|
});
|
|
5654
|
-
await
|
|
5761
|
+
await import_sweetalert212.default.fire("Success", "Document configuration updated successfully.", "success");
|
|
5655
5762
|
setIsEditOpen(false);
|
|
5656
5763
|
await loadData();
|
|
5657
5764
|
return true;
|
|
5658
5765
|
} catch (error) {
|
|
5659
|
-
await
|
|
5766
|
+
await import_sweetalert212.default.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");
|
|
5660
5767
|
return false;
|
|
5661
5768
|
}
|
|
5662
5769
|
};
|
|
@@ -6054,12 +6161,12 @@ function DocumentConfigurationmain() {
|
|
|
6054
6161
|
const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.documentConfiguration) == null ? void 0 : _c.create;
|
|
6055
6162
|
if (!endpoint) throw new Error("Document Configuration create endpoint is not configured.");
|
|
6056
6163
|
await getApiService().post(endpoint, payload);
|
|
6057
|
-
await
|
|
6164
|
+
await import_sweetalert213.default.fire("Success", "Document configuration created successfully.", "success");
|
|
6058
6165
|
setModalOpen(false);
|
|
6059
6166
|
handleRefresh();
|
|
6060
6167
|
return true;
|
|
6061
6168
|
} catch (error) {
|
|
6062
|
-
await
|
|
6169
|
+
await import_sweetalert213.default.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");
|
|
6063
6170
|
return false;
|
|
6064
6171
|
}
|
|
6065
6172
|
};
|
|
@@ -7118,7 +7225,7 @@ function MovementHistorymain() {
|
|
|
7118
7225
|
|
|
7119
7226
|
// src/components/task-permission/TaskPermissionMain.jsx
|
|
7120
7227
|
var import_react47 = __toESM(require("react"));
|
|
7121
|
-
var
|
|
7228
|
+
var import_sweetalert215 = __toESM(require("sweetalert2"));
|
|
7122
7229
|
|
|
7123
7230
|
// src/components/task-permission/SearchBar.js
|
|
7124
7231
|
var import_react43 = __toESM(require("react"));
|
|
@@ -7389,7 +7496,7 @@ function Table({
|
|
|
7389
7496
|
|
|
7390
7497
|
// src/components/task-permission/Popup.js
|
|
7391
7498
|
var import_react45 = __toESM(require("react"));
|
|
7392
|
-
var
|
|
7499
|
+
var import_sweetalert214 = __toESM(require("sweetalert2"));
|
|
7393
7500
|
init_ApiEndpointsProvider();
|
|
7394
7501
|
init_ApiServicepackage();
|
|
7395
7502
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
@@ -7461,7 +7568,7 @@ function Popup({ isOpen, onClose, onSave }) {
|
|
|
7461
7568
|
await (onSave == null ? void 0 : onSave());
|
|
7462
7569
|
} catch (error) {
|
|
7463
7570
|
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.";
|
|
7464
|
-
await
|
|
7571
|
+
await import_sweetalert214.default.fire("Error", msg, "error");
|
|
7465
7572
|
} finally {
|
|
7466
7573
|
setIsSubmitting(false);
|
|
7467
7574
|
}
|
|
@@ -7864,13 +7971,13 @@ function TaskPermissionMain() {
|
|
|
7864
7971
|
handleRefresh();
|
|
7865
7972
|
return true;
|
|
7866
7973
|
} catch (error) {
|
|
7867
|
-
await
|
|
7974
|
+
await import_sweetalert215.default.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");
|
|
7868
7975
|
return false;
|
|
7869
7976
|
}
|
|
7870
7977
|
};
|
|
7871
7978
|
const handleDeleteApi = async (item) => {
|
|
7872
7979
|
var _a;
|
|
7873
|
-
const confirm = await
|
|
7980
|
+
const confirm = await import_sweetalert215.default.fire({
|
|
7874
7981
|
title: "Delete Task Permission?",
|
|
7875
7982
|
text: `Permission #${(_a = item.taskPermissionId) != null ? _a : item.TaskPermissionId} will be marked as inactive.`,
|
|
7876
7983
|
icon: "warning",
|
|
@@ -7880,7 +7987,7 @@ function TaskPermissionMain() {
|
|
|
7880
7987
|
});
|
|
7881
7988
|
if (!confirm.isConfirmed) return;
|
|
7882
7989
|
const ok = await handleUpdateApi(__spreadProps(__spreadValues({}, item), { isActive: false }));
|
|
7883
|
-
if (ok) await
|
|
7990
|
+
if (ok) await import_sweetalert215.default.fire("Deleted", "Task permission has been deactivated.", "success");
|
|
7884
7991
|
};
|
|
7885
7992
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "fc:h-screen fc:overflow-hidden fc:bg-slate-50 fc:p-4 md:fc:fc:p-6", children: [
|
|
7886
7993
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "fc:w-full fc:space-y-5", children: [
|
|
@@ -7933,7 +8040,7 @@ function TaskPermissionMain() {
|
|
|
7933
8040
|
isOpen: showModal,
|
|
7934
8041
|
onClose: () => setShowModal(false),
|
|
7935
8042
|
onSave: async () => {
|
|
7936
|
-
await
|
|
8043
|
+
await import_sweetalert215.default.fire("Success", "Task permission created successfully.", "success");
|
|
7937
8044
|
handleRefresh();
|
|
7938
8045
|
}
|
|
7939
8046
|
}
|
|
@@ -7945,7 +8052,7 @@ function TaskPermissionMain() {
|
|
|
7945
8052
|
onClose: () => setIsEditOpen(false),
|
|
7946
8053
|
selectedData: selectedItem,
|
|
7947
8054
|
onSave: async () => {
|
|
7948
|
-
await
|
|
8055
|
+
await import_sweetalert215.default.fire("Success", "Task permission updated successfully.", "success");
|
|
7949
8056
|
handleRefresh();
|
|
7950
8057
|
},
|
|
7951
8058
|
onUpdate: handleUpdateApi
|
|
@@ -10515,7 +10622,7 @@ function Comment_main() {
|
|
|
10515
10622
|
|
|
10516
10623
|
// src/components/hierarchy-node/HierarchyNodeMain.jsx
|
|
10517
10624
|
var import_react71 = __toESM(require("react"));
|
|
10518
|
-
var
|
|
10625
|
+
var import_sweetalert216 = __toESM(require("sweetalert2"));
|
|
10519
10626
|
init_ApiEndpointsProvider();
|
|
10520
10627
|
init_ApiServicepackage();
|
|
10521
10628
|
|
|
@@ -11121,7 +11228,7 @@ function HierarchyNodeMain() {
|
|
|
11121
11228
|
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;
|
|
11122
11229
|
setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
|
|
11123
11230
|
} catch (error) {
|
|
11124
|
-
await
|
|
11231
|
+
await import_sweetalert216.default.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");
|
|
11125
11232
|
}
|
|
11126
11233
|
})();
|
|
11127
11234
|
}, [refreshKey]);
|
|
@@ -11134,11 +11241,11 @@ function HierarchyNodeMain() {
|
|
|
11134
11241
|
const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.hierarchyNode) == null ? void 0 : _c[isEdit ? "update" : "create"];
|
|
11135
11242
|
if (!endpoint) throw new Error(`Hierarchy node ${isEdit ? "update" : "create"} endpoint is not configured.`);
|
|
11136
11243
|
await getApiService()[isEdit ? "put" : "post"](endpoint, payload);
|
|
11137
|
-
await
|
|
11244
|
+
await import_sweetalert216.default.fire("Success", `Hierarchy node ${isEdit ? "updated" : "created"} successfully.`, "success");
|
|
11138
11245
|
handleRefresh();
|
|
11139
11246
|
return true;
|
|
11140
11247
|
} catch (error) {
|
|
11141
|
-
await
|
|
11248
|
+
await import_sweetalert216.default.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");
|
|
11142
11249
|
return false;
|
|
11143
11250
|
}
|
|
11144
11251
|
};
|