flowcore-fn 10.3.9 → 10.4.2
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 +12 -0
- package/dist/pkg-index.js +876 -739
- package/dist/pkg-index.mjs +726 -592
- package/package.json +1 -1
package/dist/pkg-index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-I4E63NIC.mjs";
|
|
13
13
|
|
|
14
14
|
// src/components/Sidebar.jsx
|
|
15
|
-
import { useState as
|
|
15
|
+
import { useState as useState82, useEffect as useEffect62 } from "react";
|
|
16
16
|
import {
|
|
17
17
|
RiShieldUserLine,
|
|
18
18
|
RiFolder3Line,
|
|
@@ -7516,7 +7516,7 @@ function DocumentConfigTable({
|
|
|
7516
7516
|
onClick: () => handleSort("workflowName"),
|
|
7517
7517
|
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",
|
|
7518
7518
|
children: [
|
|
7519
|
-
"Workflow
|
|
7519
|
+
"Workflow",
|
|
7520
7520
|
" ",
|
|
7521
7521
|
sortKey === "workflowName" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
|
|
7522
7522
|
]
|
|
@@ -7540,7 +7540,7 @@ function DocumentConfigTable({
|
|
|
7540
7540
|
onClick: () => handleSort("stepId"),
|
|
7541
7541
|
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",
|
|
7542
7542
|
children: [
|
|
7543
|
-
"
|
|
7543
|
+
"Step Name",
|
|
7544
7544
|
" ",
|
|
7545
7545
|
sortKey === "stepId" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
|
|
7546
7546
|
]
|
|
@@ -9050,8 +9050,8 @@ function Table({
|
|
|
9050
9050
|
const q = searchQuery.toLowerCase().trim();
|
|
9051
9051
|
const filtered = apiData.filter(
|
|
9052
9052
|
(item) => {
|
|
9053
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
9054
|
-
return !q || String((_b = (_a = item.stepPermissionId) != null ? _a : item.id) != null ? _b : "").toLowerCase().includes(q) || String((_c = item.workflowStepId) != null ? _c : "").toLowerCase().includes(q) || String((_g = (_f = (
|
|
9053
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
9054
|
+
return !q || String((_b = (_a = item.stepPermissionId) != null ? _a : item.id) != null ? _b : "").toLowerCase().includes(q) || String((_c = item.workflowStepId) != null ? _c : "").toLowerCase().includes(q) || String((_e = (_d = item.workflowName) != null ? _d : item.WorkflowName) != null ? _e : "").toLowerCase().includes(q) || String((_g = (_f = item.workflowTypeName) != null ? _f : item.WorkflowTypeName) != null ? _g : "").toLowerCase().includes(q) || String((_k = (_j = (_i = (_h = item.stepName) != null ? _h : item.StepName) != null ? _i : item.workflowStepName) != null ? _j : item.WorkflowStepName) != null ? _k : "").toLowerCase().includes(q);
|
|
9055
9055
|
}
|
|
9056
9056
|
);
|
|
9057
9057
|
const sorted = [...filtered].sort((a, b) => {
|
|
@@ -9076,7 +9076,9 @@ function Table({
|
|
|
9076
9076
|
);
|
|
9077
9077
|
const columns = [
|
|
9078
9078
|
// { label: "ID", key: "stepPermissionId" },
|
|
9079
|
-
{ label: "Workflow
|
|
9079
|
+
{ label: "Workflow Type", key: "workflowTypeName" },
|
|
9080
|
+
{ label: "Workflow", key: "workflowName" },
|
|
9081
|
+
{ label: "Step Name", key: "workflowStepId" },
|
|
9080
9082
|
{ label: "Can View", key: "canView" },
|
|
9081
9083
|
{ label: "Can Edit", key: "canEdit" },
|
|
9082
9084
|
{ label: "Can Approve", key: "canApprove" },
|
|
@@ -9154,14 +9156,16 @@ function Table({
|
|
|
9154
9156
|
children: "No step permissions found."
|
|
9155
9157
|
}
|
|
9156
9158
|
) }) : visibleData.map((item, index) => {
|
|
9157
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9159
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
9158
9160
|
return /* @__PURE__ */ jsxs39(
|
|
9159
9161
|
"tr",
|
|
9160
9162
|
{
|
|
9161
9163
|
className: "hover:fc:bg-slate-50/50 fc:transition-colors",
|
|
9162
9164
|
children: [
|
|
9163
9165
|
/* @__PURE__ */ jsx40("td", { className: "fc:py-4 fc:px-4 fc:text-center fc:font-medium fc:text-slate-400", children: startIndex + index + 1 }),
|
|
9164
|
-
/* @__PURE__ */ jsx40("td", { className: "fc:py-4 fc:px-5 fc:text-center fc:text-[13px] fc:font-
|
|
9166
|
+
/* @__PURE__ */ jsx40("td", { className: "fc:py-4 fc:px-5 fc:text-center fc:text-[13px] fc:font-medium fc:text-slate-600 fc:whitespace-nowrap", children: (_d = (_c = item.workflowName) != null ? _c : item.WorkflowName) != null ? _d : "-" }),
|
|
9167
|
+
/* @__PURE__ */ jsx40("td", { className: "fc:py-4 fc:px-5 fc:text-center fc:text-[13px] fc:font-medium fc:text-slate-600 fc:whitespace-nowrap", children: (_f = (_e = item.workflowTypeName) != null ? _e : item.WorkflowTypeName) != null ? _f : "-" }),
|
|
9168
|
+
/* @__PURE__ */ jsx40("td", { className: "fc:py-4 fc:px-5 fc:text-center fc:text-[13px] fc:font-bold fc:text-slate-600 fc:whitespace-nowrap", children: (_l = (_i = (_h = (_g = item.stepName) != null ? _g : item.StepName) != null ? _h : item.stepName) != null ? _i : item.stepName) != null ? _l : (_k = (_j = item.stepName) != null ? _j : item.stepName) != null ? _k : "-" }),
|
|
9165
9169
|
/* @__PURE__ */ jsx40("td", { className: "fc:py-4 fc:px-5 fc:text-center", children: /* @__PURE__ */ jsx40(BoolBadge, { val: item.canView }) }),
|
|
9166
9170
|
/* @__PURE__ */ jsx40("td", { className: "fc:py-4 fc:px-5 fc:text-center", children: /* @__PURE__ */ jsx40(BoolBadge, { val: item.canEdit }) }),
|
|
9167
9171
|
/* @__PURE__ */ jsx40("td", { className: "fc:py-4 fc:px-5 fc:text-center", children: /* @__PURE__ */ jsx40(BoolBadge, { val: item.canApprove }) }),
|
|
@@ -9375,21 +9379,21 @@ function Popup({ isOpen, onClose, onSave }) {
|
|
|
9375
9379
|
}
|
|
9376
9380
|
};
|
|
9377
9381
|
const permissionCards = [
|
|
9378
|
-
{
|
|
9379
|
-
{
|
|
9380
|
-
{
|
|
9381
|
-
{
|
|
9382
|
-
{
|
|
9383
|
-
{
|
|
9384
|
-
{
|
|
9385
|
-
{
|
|
9386
|
-
{
|
|
9387
|
-
{
|
|
9382
|
+
{ title: "Can View", field: "canView", labelField: "viewLabel" },
|
|
9383
|
+
{ title: "Can Approve", field: "canApprove", labelField: "approveLabel" },
|
|
9384
|
+
{ title: "Can Edit", field: "canEdit", labelField: "editLabel" },
|
|
9385
|
+
{ title: "Can Reject", field: "canReject", labelField: "rejectLabel" },
|
|
9386
|
+
{ title: "Can Forward", field: "canForward", labelField: "forwardLabel" },
|
|
9387
|
+
{ title: "Can Free Forward", field: "canFreeForward", labelField: "freeForwardLabel" },
|
|
9388
|
+
{ title: "Can Return", field: "canReturn", labelField: "returnLabel" },
|
|
9389
|
+
{ title: "Can Return To Applicant", field: "canReturnToApplicant", labelField: "returnToApplicantLabel" },
|
|
9390
|
+
{ title: "Can Delegate", field: "canDelegate", labelField: "delegateLabel" },
|
|
9391
|
+
{ title: "Can Hold", field: "canHold", labelField: "holdLabel" }
|
|
9388
9392
|
];
|
|
9389
9393
|
return /* @__PURE__ */ jsxs40("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:p-4", children: [
|
|
9390
9394
|
/* @__PURE__ */ jsx41("div", { className: "fc:fixed fc:inset-0 fc:bg-slate-900/50 fc:backdrop-blur-sm fc:transition-opacity fc:duration-200", onClick: onClose }),
|
|
9391
|
-
/* @__PURE__ */ jsxs40("div", { className: "fc:relative fc:w-full fc:max-w-
|
|
9392
|
-
/* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:justify-between fc:items-center fc:px-
|
|
9395
|
+
/* @__PURE__ */ jsxs40("div", { className: "fc:relative fc:w-full fc:max-w-6xl fc:bg-white fc:rounded-3xl fc:shadow-2xl fc:flex fc:flex-col fc:z-10 fc:max-h-[96vh] fc:overflow-hidden fc:animate-in fc:fade-in fc:zoom-in-95 fc:duration-200", children: [
|
|
9396
|
+
/* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:justify-between fc:items-center fc:px-6 fc:py-4 fc:border-b fc:border-slate-100", children: [
|
|
9393
9397
|
/* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-4", children: [
|
|
9394
9398
|
/* @__PURE__ */ jsx41("div", { className: "fc:w-12 fc:h-12 fc:bg-blue-50 fc:text-blue-600 fc:rounded-xl fc:flex fc:items-center fc:justify-center fc:shadow-sm fc:text-xl", children: "\u{1F511}" }),
|
|
9395
9399
|
/* @__PURE__ */ jsxs40("div", { children: [
|
|
@@ -9399,10 +9403,10 @@ function Popup({ isOpen, onClose, onSave }) {
|
|
|
9399
9403
|
] }),
|
|
9400
9404
|
/* @__PURE__ */ jsx41("button", { onClick: onClose, className: "fc:text-slate-400 hover:fc:fc:text-slate-600 hover:fc:fc:bg-slate-100 fc:p-2 fc:rounded-full fc:transition-all fc:text-sm fc:font-semibold", children: "\u2715" })
|
|
9401
9405
|
] }),
|
|
9402
|
-
/* @__PURE__ */ jsxs40("form", { onSubmit: handleSubmit, className: "fc:flex fc:
|
|
9403
|
-
/* @__PURE__ */ jsxs40("div", { className: "fc:
|
|
9404
|
-
/* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-
|
|
9405
|
-
/* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-
|
|
9406
|
+
/* @__PURE__ */ jsxs40("form", { onSubmit: handleSubmit, className: "fc:flex fc:min-h-0 fc:flex-1 fc:flex-col fc:overflow-hidden", children: [
|
|
9407
|
+
/* @__PURE__ */ jsxs40("div", { className: "fc:min-h-0 fc:flex-1 fc:space-y-4 fc:overflow-y-auto fc:bg-slate-50/30 fc:p-4 md:fc:p-5", children: [
|
|
9408
|
+
/* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-4 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-4", children: [
|
|
9409
|
+
/* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-2", children: [
|
|
9406
9410
|
/* @__PURE__ */ jsx41("span", { children: "\u{1F4CB}" }),
|
|
9407
9411
|
/* @__PURE__ */ jsx41("span", { children: "Step Information" })
|
|
9408
9412
|
] }),
|
|
@@ -9435,56 +9439,57 @@ function Popup({ isOpen, onClose, onSave }) {
|
|
|
9435
9439
|
errors.workflowStepId && /* @__PURE__ */ jsx41("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1", children: errors.workflowStepId })
|
|
9436
9440
|
] })
|
|
9437
9441
|
] }),
|
|
9438
|
-
/* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-
|
|
9442
|
+
/* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-4 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-4", children: [
|
|
9439
9443
|
/* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
|
|
9440
9444
|
/* @__PURE__ */ jsx41("span", { children: "\u2699\uFE0F" }),
|
|
9441
9445
|
/* @__PURE__ */ jsx41("span", { children: "Set Initial Matrix Access Rules" })
|
|
9442
9446
|
] }),
|
|
9443
|
-
/* @__PURE__ */ jsx41(
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9447
|
+
/* @__PURE__ */ jsx41(
|
|
9448
|
+
"div",
|
|
9449
|
+
{
|
|
9450
|
+
className: "fc:grid fc:gap-3",
|
|
9451
|
+
style: { gridTemplateColumns: "repeat(auto-fit, minmax(max(200px, calc((100% - 36px) / 4)), 1fr))" },
|
|
9452
|
+
children: permissionCards.map(({ title, field, labelField }) => {
|
|
9453
|
+
var _a, _b;
|
|
9454
|
+
const actionLabel = permissionLabelFields.find((item) => item.field === labelField);
|
|
9455
|
+
return /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:min-w-0 fc:flex-col fc:gap-2 fc:rounded-xl fc:border fc:border-slate-100 fc:bg-slate-50/50 fc:p-3", children: [
|
|
9456
|
+
/* @__PURE__ */ jsx41("p", { className: "fc:text-[11px] fc:font-extrabold fc:text-slate-700", children: title }),
|
|
9457
|
+
/* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2", children: [
|
|
9458
|
+
/* @__PURE__ */ jsx41(
|
|
9459
|
+
"input",
|
|
9460
|
+
{
|
|
9461
|
+
type: "text",
|
|
9462
|
+
"aria-label": (_a = actionLabel == null ? void 0 : actionLabel.label) != null ? _a : `${title} label`,
|
|
9463
|
+
value: (_b = formData[labelField]) != null ? _b : "",
|
|
9464
|
+
placeholder: actionLabel == null ? void 0 : actionLabel.fallback,
|
|
9465
|
+
onChange: (event) => handleChange(labelField, event.target.value),
|
|
9466
|
+
className: "fc:min-w-0 fc:flex-1 fc:rounded-lg fc:border fc:border-slate-200 fc:bg-white fc:px-2 fc:py-1.5 fc:text-[11px] fc:text-slate-700 focus:fc:border-indigo-500 focus:fc:outline-none"
|
|
9467
|
+
}
|
|
9468
|
+
),
|
|
9469
|
+
/* @__PURE__ */ jsx41(
|
|
9470
|
+
"button",
|
|
9471
|
+
{
|
|
9472
|
+
type: "button",
|
|
9473
|
+
"aria-label": `${title}: ${formData[field] ? "enabled" : "disabled"}`,
|
|
9474
|
+
"aria-pressed": Boolean(formData[field]),
|
|
9475
|
+
onClick: () => handleChange(field, !formData[field]),
|
|
9476
|
+
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 ${formData[field] ? "fc:bg-blue-600" : "fc:bg-gray-300"}`,
|
|
9477
|
+
children: /* @__PURE__ */ jsx41(
|
|
9478
|
+
"span",
|
|
9479
|
+
{
|
|
9480
|
+
className: `fc:pointer-events-none fc:inline-block fc:h-4.5 fc:w-4.5 fc:transform fc:rounded-full fc:bg-white fc:shadow fc:ring-0 fc:transition fc:duration-200 fc:ease-in-out ${formData[field] ? "fc:translate-x-4.5" : "fc:translate-x-0"}`
|
|
9481
|
+
}
|
|
9482
|
+
)
|
|
9483
|
+
}
|
|
9484
|
+
)
|
|
9485
|
+
] })
|
|
9486
|
+
] }, field);
|
|
9487
|
+
})
|
|
9488
|
+
}
|
|
9489
|
+
)
|
|
9485
9490
|
] }),
|
|
9486
|
-
/* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-
|
|
9487
|
-
/* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-
|
|
9491
|
+
/* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-4 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-3", children: [
|
|
9492
|
+
/* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-2", children: [
|
|
9488
9493
|
/* @__PURE__ */ jsx41("span", { children: "\u{1F518}" }),
|
|
9489
9494
|
/* @__PURE__ */ jsx41("span", { children: "Status" })
|
|
9490
9495
|
] }),
|
|
@@ -9508,7 +9513,7 @@ function Popup({ isOpen, onClose, onSave }) {
|
|
|
9508
9513
|
)) })
|
|
9509
9514
|
] })
|
|
9510
9515
|
] }),
|
|
9511
|
-
/* @__PURE__ */ jsxs40("div", { className: "fc:
|
|
9516
|
+
/* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:justify-end fc:gap-3 fc:border-t fc:border-slate-100 fc:bg-white fc:px-6 fc:py-3", children: [
|
|
9512
9517
|
/* @__PURE__ */ jsxs40(
|
|
9513
9518
|
"button",
|
|
9514
9519
|
{
|
|
@@ -10285,12 +10290,12 @@ function FormFieldMain() {
|
|
|
10285
10290
|
/* @__PURE__ */ jsx46(
|
|
10286
10291
|
CommonHeader,
|
|
10287
10292
|
{
|
|
10288
|
-
title: "
|
|
10293
|
+
title: "Applicant Form Fields",
|
|
10289
10294
|
breadcrumbs: [
|
|
10290
10295
|
{ label: "Dashboard", href: "/dashboard" },
|
|
10291
10296
|
{ label: "Masters", href: "/masters" },
|
|
10292
10297
|
{ label: "Permissions", href: "/permissions" },
|
|
10293
|
-
{ label: "
|
|
10298
|
+
{ label: "Applicant Form Fields", href: "/form-field" }
|
|
10294
10299
|
],
|
|
10295
10300
|
buttonText: "Add Form Field",
|
|
10296
10301
|
onButtonClick: openCreate
|
|
@@ -16262,7 +16267,9 @@ function Table4({
|
|
|
16262
16267
|
/* @__PURE__ */ jsx85("div", { className: "fc:max-h-[420px] fc:overflow-auto fc:rounded-2xl fc:border fc:border-slate-200", children: /* @__PURE__ */ jsxs84("table", { className: "fc:w-full fc:bg-white fc:text-left", children: [
|
|
16263
16268
|
/* @__PURE__ */ jsx85("thead", { className: "fc:sticky fc:top-0 fc:z-10", children: /* @__PURE__ */ jsxs84("tr", { children: [
|
|
16264
16269
|
/* @__PURE__ */ jsx85("th", { className: "fc:bg-slate-50 fc:px-4 fc:py-4 fc:text-xs", children: "S.NO" }),
|
|
16265
|
-
heading("WORKFLOW
|
|
16270
|
+
heading("WORKFLOW TYPE", "workflowTypeName"),
|
|
16271
|
+
heading("WORKFLOW", "workflowName"),
|
|
16272
|
+
heading("STEP NAME", "stepName"),
|
|
16266
16273
|
heading("ASSIGNMENT TYPE", "assignmentType"),
|
|
16267
16274
|
heading("NODE TYPE", "hierarchyNodeType"),
|
|
16268
16275
|
/* @__PURE__ */ jsx85("th", { className: "fc:bg-slate-50 fc:px-5 fc:py-4 fc:text-xs", children: "POOL ENABLED" }),
|
|
@@ -16271,51 +16278,56 @@ function Table4({
|
|
|
16271
16278
|
/* @__PURE__ */ jsx85("tbody", { children: loading ? /* @__PURE__ */ jsx85("tr", { children: /* @__PURE__ */ jsx85(
|
|
16272
16279
|
"td",
|
|
16273
16280
|
{
|
|
16274
|
-
colSpan: "
|
|
16281
|
+
colSpan: "8",
|
|
16275
16282
|
className: "fc:p-8 fc:text-center fc:text-sm fc:text-slate-500",
|
|
16276
16283
|
children: "Loading assignment rules..."
|
|
16277
16284
|
}
|
|
16278
16285
|
) }) : visibleRows.length === 0 ? /* @__PURE__ */ jsx85("tr", { children: /* @__PURE__ */ jsx85(
|
|
16279
16286
|
"td",
|
|
16280
16287
|
{
|
|
16281
|
-
colSpan: "
|
|
16288
|
+
colSpan: "8",
|
|
16282
16289
|
className: "fc:p-8 fc:text-center fc:text-sm fc:text-slate-400",
|
|
16283
16290
|
children: "No assignment rules found."
|
|
16284
16291
|
}
|
|
16285
|
-
) }) : visibleRows.map((item, index) =>
|
|
16286
|
-
|
|
16287
|
-
|
|
16288
|
-
|
|
16289
|
-
|
|
16290
|
-
|
|
16291
|
-
|
|
16292
|
-
|
|
16293
|
-
|
|
16294
|
-
|
|
16295
|
-
|
|
16296
|
-
/* @__PURE__ */ jsx85(
|
|
16297
|
-
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16301
|
-
|
|
16302
|
-
|
|
16303
|
-
|
|
16304
|
-
|
|
16305
|
-
|
|
16306
|
-
|
|
16307
|
-
|
|
16308
|
-
|
|
16309
|
-
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16292
|
+
) }) : visibleRows.map((item, index) => {
|
|
16293
|
+
var _a, _b;
|
|
16294
|
+
return /* @__PURE__ */ jsxs84(
|
|
16295
|
+
"tr",
|
|
16296
|
+
{
|
|
16297
|
+
className: "fc:border-t fc:border-slate-100",
|
|
16298
|
+
children: [
|
|
16299
|
+
/* @__PURE__ */ jsx85("td", { className: "fc:px-4 fc:py-4 fc:text-center fc:text-sm", children: (currentPage - 1) * pageSize + index + 1 }),
|
|
16300
|
+
/* @__PURE__ */ jsx85("td", { className: "fc:px-5 fc:py-4 fc:text-sm", children: (_a = item.workflowTypeName) != null ? _a : "-" }),
|
|
16301
|
+
/* @__PURE__ */ jsx85("td", { className: "fc:px-5 fc:py-4 fc:text-sm", children: (_b = item.workflowName) != null ? _b : "-" }),
|
|
16302
|
+
/* @__PURE__ */ jsx85("td", { className: "fc:px-5 fc:py-4 fc:text-sm", children: item.stepName }),
|
|
16303
|
+
/* @__PURE__ */ jsx85("td", { className: "fc:px-5 fc:py-4 fc:text-sm", children: item.assignmentType }),
|
|
16304
|
+
/* @__PURE__ */ jsx85("td", { className: "fc:px-5 fc:py-4 fc:text-sm", children: item.hierarchyNodeType }),
|
|
16305
|
+
/* @__PURE__ */ jsx85("td", { className: "fc:px-5 fc:py-4 fc:text-sm", children: item.isPoolEnabled ? "Yes" : "No" }),
|
|
16306
|
+
/* @__PURE__ */ jsxs84("td", { className: "fc:px-5 fc:py-4 fc:text-sm", children: [
|
|
16307
|
+
/* @__PURE__ */ jsx85(
|
|
16308
|
+
"button",
|
|
16309
|
+
{
|
|
16310
|
+
type: "button",
|
|
16311
|
+
onClick: () => onEdit(item),
|
|
16312
|
+
className: "fc:mr-2 fc:rounded-lg fc:bg-blue-50 fc:px-3 fc:py-1 fc:text-blue-600",
|
|
16313
|
+
children: "Edit"
|
|
16314
|
+
}
|
|
16315
|
+
),
|
|
16316
|
+
/* @__PURE__ */ jsx85(
|
|
16317
|
+
"button",
|
|
16318
|
+
{
|
|
16319
|
+
type: "button",
|
|
16320
|
+
onClick: () => onDelete(item),
|
|
16321
|
+
className: "fc:rounded-lg fc:bg-rose-50 fc:px-3 fc:py-1 fc:text-rose-600",
|
|
16322
|
+
children: "Delete"
|
|
16323
|
+
}
|
|
16324
|
+
)
|
|
16325
|
+
] })
|
|
16326
|
+
]
|
|
16327
|
+
},
|
|
16328
|
+
item.assignmentRuleId
|
|
16329
|
+
);
|
|
16330
|
+
}) })
|
|
16319
16331
|
] }) }),
|
|
16320
16332
|
/* @__PURE__ */ jsxs84("div", { className: "fc:flex fc:justify-end fc:gap-2 fc:text-sm", children: [
|
|
16321
16333
|
/* @__PURE__ */ jsx85(
|
|
@@ -16851,7 +16863,7 @@ function Workflow_Step_Hierarchy_Mapping_Main() {
|
|
|
16851
16863
|
}
|
|
16852
16864
|
};
|
|
16853
16865
|
const filteredMappings = mappings.filter((mapping) => {
|
|
16854
|
-
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
16866
|
+
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
16855
16867
|
const query = searchQuery.trim().toLowerCase();
|
|
16856
16868
|
const stepId = (_c2 = (_b2 = (_a2 = mapping.workflowId) != null ? _a2 : mapping.WorkflowId) != null ? _b2 : mapping.workflowStepId) != null ? _c2 : mapping.WorkflowStepId;
|
|
16857
16869
|
const nodeId = (_d = mapping.hierarchyNodeId) != null ? _d : mapping.HierarchyNodeId;
|
|
@@ -16860,6 +16872,7 @@ function Workflow_Step_Hierarchy_Mapping_Main() {
|
|
|
16860
16872
|
const stepCode = (_p = (_o = mapping.workflowCode) != null ? _o : mapping.WorkflowCode) != null ? _p : workflowCodeMap[stepId];
|
|
16861
16873
|
return !query || [
|
|
16862
16874
|
(_q = mapping.workflowHierarchyNodeMappingId) != null ? _q : mapping.WorkflowHierarchyNodeMappingId,
|
|
16875
|
+
(_r = mapping.workflowTypeName) != null ? _r : mapping.WorkflowTypeName,
|
|
16863
16876
|
stepId,
|
|
16864
16877
|
stepName,
|
|
16865
16878
|
stepCode,
|
|
@@ -16946,6 +16959,7 @@ function Workflow_Step_Hierarchy_Mapping_Main() {
|
|
|
16946
16959
|
/* @__PURE__ */ jsx88("div", { ref: tableRef, className: "fc:overflow-x-auto", children: /* @__PURE__ */ jsxs87("table", { className: "fc:w-full fc:text-sm", children: [
|
|
16947
16960
|
/* @__PURE__ */ jsx88("thead", { children: /* @__PURE__ */ jsxs87("tr", { className: "fc:bg-slate-100 fc:text-slate-600", children: [
|
|
16948
16961
|
/* @__PURE__ */ jsx88("th", { className: "fc:p-3 fc:text-left", children: "#" }),
|
|
16962
|
+
/* @__PURE__ */ jsx88("th", { className: "fc:p-3 fc:text-left", children: "Workflow Type" }),
|
|
16949
16963
|
/* @__PURE__ */ jsx88("th", { className: "fc:p-3 fc:text-left", children: "Workflow Name" }),
|
|
16950
16964
|
/* @__PURE__ */ jsx88("th", { className: "fc:p-3 fc:text-left", children: "Workflow Code" }),
|
|
16951
16965
|
/* @__PURE__ */ jsx88("th", { className: "fc:p-3 fc:text-left", children: "Hierarchy Node Name" }),
|
|
@@ -16955,19 +16969,19 @@ function Workflow_Step_Hierarchy_Mapping_Main() {
|
|
|
16955
16969
|
/* @__PURE__ */ jsx88("tbody", { children: isLoading ? /* @__PURE__ */ jsx88("tr", { children: /* @__PURE__ */ jsx88(
|
|
16956
16970
|
"td",
|
|
16957
16971
|
{
|
|
16958
|
-
colSpan:
|
|
16972
|
+
colSpan: 7,
|
|
16959
16973
|
className: "fc:p-8 fc:text-center fc:text-slate-400",
|
|
16960
16974
|
children: "Loading mappings..."
|
|
16961
16975
|
}
|
|
16962
16976
|
) }) : visibleMappings.length === 0 ? /* @__PURE__ */ jsx88("tr", { children: /* @__PURE__ */ jsx88(
|
|
16963
16977
|
"td",
|
|
16964
16978
|
{
|
|
16965
|
-
colSpan:
|
|
16979
|
+
colSpan: 7,
|
|
16966
16980
|
className: "fc:p-8 fc:text-center fc:text-slate-400",
|
|
16967
16981
|
children: "No workflow step hierarchy mappings found."
|
|
16968
16982
|
}
|
|
16969
16983
|
) }) : visibleMappings.map((mapping, index) => {
|
|
16970
|
-
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
16984
|
+
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
16971
16985
|
const mappingId = getMappingId(mapping);
|
|
16972
16986
|
const stepId = (_c2 = (_b2 = (_a2 = mapping.workflowId) != null ? _a2 : mapping.WorkflowId) != null ? _b2 : mapping.workflowStepId) != null ? _c2 : mapping.WorkflowStepId;
|
|
16973
16987
|
const nodeId = (_d = mapping.hierarchyNodeId) != null ? _d : mapping.HierarchyNodeId;
|
|
@@ -16981,6 +16995,7 @@ function Workflow_Step_Hierarchy_Mapping_Main() {
|
|
|
16981
16995
|
className: "fc:border-t fc:border-slate-100 hover:fc:bg-slate-50",
|
|
16982
16996
|
children: [
|
|
16983
16997
|
/* @__PURE__ */ jsx88("td", { className: "fc:p-3", children: (safePage - 1) * pageSize + index + 1 }),
|
|
16998
|
+
/* @__PURE__ */ jsx88("td", { className: "fc:p-3", children: (_v = (_u = mapping.workflowTypeName) != null ? _u : mapping.WorkflowTypeName) != null ? _v : "-" }),
|
|
16984
16999
|
/* @__PURE__ */ jsx88("td", { className: "fc:p-3", children: stepDisplayName }),
|
|
16985
17000
|
/* @__PURE__ */ jsx88("td", { className: "fc:p-3", children: stepCodeDisplayName }),
|
|
16986
17001
|
/* @__PURE__ */ jsx88("td", { className: "fc:p-3", children: nodeDisplayName }),
|
|
@@ -18630,7 +18645,9 @@ function AddStatusModal({
|
|
|
18630
18645
|
isOpen,
|
|
18631
18646
|
onClose,
|
|
18632
18647
|
onSave,
|
|
18633
|
-
modules = []
|
|
18648
|
+
modules = [],
|
|
18649
|
+
actionCodes = [],
|
|
18650
|
+
isLoadingActionCodes = false
|
|
18634
18651
|
}) {
|
|
18635
18652
|
const [formData, setFormData] = useState70(INITIAL_FORM4);
|
|
18636
18653
|
const [errors, setErrors] = useState70({});
|
|
@@ -18678,9 +18695,6 @@ function AddStatusModal({
|
|
|
18678
18695
|
if (!formData.moduleId) {
|
|
18679
18696
|
errs.moduleId = "Module is required.";
|
|
18680
18697
|
}
|
|
18681
|
-
if (!formData.statusName.trim()) {
|
|
18682
|
-
errs.statusName = "Status Name is required.";
|
|
18683
|
-
}
|
|
18684
18698
|
if (!formData.statusCode.trim()) {
|
|
18685
18699
|
errs.statusCode = "Status Code is required.";
|
|
18686
18700
|
}
|
|
@@ -18693,7 +18707,7 @@ function AddStatusModal({
|
|
|
18693
18707
|
if (!validate()) return;
|
|
18694
18708
|
const payload = {
|
|
18695
18709
|
moduleId: Number(formData.moduleId),
|
|
18696
|
-
statusName: formData.
|
|
18710
|
+
statusName: formData.statusCode.trim().toUpperCase(),
|
|
18697
18711
|
statusCode: formData.statusCode.trim().toUpperCase(),
|
|
18698
18712
|
description: formData.description.trim(),
|
|
18699
18713
|
createdBy: "System"
|
|
@@ -18793,15 +18807,21 @@ function AddStatusModal({
|
|
|
18793
18807
|
/* @__PURE__ */ jsx94("span", { className: "fc:text-red-500", children: "*" })
|
|
18794
18808
|
] }),
|
|
18795
18809
|
/* @__PURE__ */ jsxs93("div", { className: "fc:relative", children: [
|
|
18796
|
-
/* @__PURE__ */
|
|
18797
|
-
"
|
|
18810
|
+
/* @__PURE__ */ jsxs93(
|
|
18811
|
+
"select",
|
|
18798
18812
|
{
|
|
18799
|
-
type: "text",
|
|
18800
18813
|
name: "statusCode",
|
|
18801
18814
|
value: formData.statusCode,
|
|
18802
18815
|
onChange: handleChange,
|
|
18803
|
-
|
|
18804
|
-
className: `${inputCls(errors.statusCode)}
|
|
18816
|
+
disabled: isLoadingActionCodes,
|
|
18817
|
+
className: `${inputCls(errors.statusCode)} fc:bg-white disabled:fc:opacity-60`,
|
|
18818
|
+
children: [
|
|
18819
|
+
/* @__PURE__ */ jsx94("option", { value: "", children: isLoadingActionCodes ? "Loading action codes..." : "Select an action code" }),
|
|
18820
|
+
actionCodes.map((action) => {
|
|
18821
|
+
var _a;
|
|
18822
|
+
return /* @__PURE__ */ jsx94("option", { value: action.name, children: action.name }, (_a = action.value) != null ? _a : action.name);
|
|
18823
|
+
})
|
|
18824
|
+
]
|
|
18805
18825
|
}
|
|
18806
18826
|
),
|
|
18807
18827
|
/* @__PURE__ */ jsx94("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx94("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" }) })
|
|
@@ -18809,27 +18829,6 @@ function AddStatusModal({
|
|
|
18809
18829
|
errors.statusCode && /* @__PURE__ */ jsx94("p", { className: "fc:text-[11px] fc:text-red-500 fc:mt-1", children: errors.statusCode })
|
|
18810
18830
|
] })
|
|
18811
18831
|
] }),
|
|
18812
|
-
/* @__PURE__ */ jsxs93("div", { children: [
|
|
18813
|
-
/* @__PURE__ */ jsxs93("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: [
|
|
18814
|
-
"Status Name ",
|
|
18815
|
-
/* @__PURE__ */ jsx94("span", { className: "fc:text-red-500", children: "*" })
|
|
18816
|
-
] }),
|
|
18817
|
-
/* @__PURE__ */ jsxs93("div", { className: "fc:relative", children: [
|
|
18818
|
-
/* @__PURE__ */ jsx94(
|
|
18819
|
-
"input",
|
|
18820
|
-
{
|
|
18821
|
-
type: "text",
|
|
18822
|
-
name: "statusName",
|
|
18823
|
-
value: formData.statusName,
|
|
18824
|
-
onChange: handleChange,
|
|
18825
|
-
placeholder: "Enter status name (e.g. In Progress, Completed)",
|
|
18826
|
-
className: inputCls(errors.statusName)
|
|
18827
|
-
}
|
|
18828
|
-
),
|
|
18829
|
-
/* @__PURE__ */ jsx94("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx94("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) })
|
|
18830
|
-
] }),
|
|
18831
|
-
errors.statusName && /* @__PURE__ */ jsx94("p", { className: "fc:text-[11px] fc:text-red-500 fc:mt-1", children: errors.statusName })
|
|
18832
|
-
] }),
|
|
18833
18832
|
/* @__PURE__ */ jsxs93("div", { children: [
|
|
18834
18833
|
/* @__PURE__ */ jsx94("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: "Description" }),
|
|
18835
18834
|
/* @__PURE__ */ jsxs93("div", { className: "fc:relative", children: [
|
|
@@ -18905,6 +18904,8 @@ function EditStatusModal({
|
|
|
18905
18904
|
onSave,
|
|
18906
18905
|
selectedData,
|
|
18907
18906
|
modules = [],
|
|
18907
|
+
actionCodes = [],
|
|
18908
|
+
isLoadingActionCodes = false,
|
|
18908
18909
|
isFetchingById = false
|
|
18909
18910
|
}) {
|
|
18910
18911
|
const [formData, setFormData] = useState71(() => getInitialFormData3(selectedData));
|
|
@@ -18961,9 +18962,6 @@ function EditStatusModal({
|
|
|
18961
18962
|
if (!formData.moduleId) {
|
|
18962
18963
|
errs.moduleId = "Module is required.";
|
|
18963
18964
|
}
|
|
18964
|
-
if (!String(formData.statusName).trim()) {
|
|
18965
|
-
errs.statusName = "Status Name is required.";
|
|
18966
|
-
}
|
|
18967
18965
|
if (!String(formData.statusCode).trim()) {
|
|
18968
18966
|
errs.statusCode = "Status Code is required.";
|
|
18969
18967
|
}
|
|
@@ -18977,7 +18975,7 @@ function EditStatusModal({
|
|
|
18977
18975
|
const payload = {
|
|
18978
18976
|
statusId: Number(formData.statusId) || 0,
|
|
18979
18977
|
moduleId: Number(formData.moduleId) || 0,
|
|
18980
|
-
statusName: String(formData.
|
|
18978
|
+
statusName: String(formData.statusCode).trim().toUpperCase(),
|
|
18981
18979
|
statusCode: String(formData.statusCode).trim().toUpperCase(),
|
|
18982
18980
|
description: String(formData.description).trim(),
|
|
18983
18981
|
isActive: Boolean(formData.isActive),
|
|
@@ -19083,15 +19081,22 @@ function EditStatusModal({
|
|
|
19083
19081
|
/* @__PURE__ */ jsx95("span", { className: "fc:text-red-500", children: "*" })
|
|
19084
19082
|
] }),
|
|
19085
19083
|
/* @__PURE__ */ jsxs94("div", { className: "fc:relative", children: [
|
|
19086
|
-
/* @__PURE__ */
|
|
19087
|
-
"
|
|
19084
|
+
/* @__PURE__ */ jsxs94(
|
|
19085
|
+
"select",
|
|
19088
19086
|
{
|
|
19089
|
-
type: "text",
|
|
19090
19087
|
name: "statusCode",
|
|
19091
19088
|
value: formData.statusCode,
|
|
19092
19089
|
onChange: handleChange,
|
|
19093
|
-
|
|
19094
|
-
className: `${inputCls(errors.statusCode)}
|
|
19090
|
+
disabled: true,
|
|
19091
|
+
className: `${inputCls(errors.statusCode)} fc:bg-white disabled:fc:opacity-60`,
|
|
19092
|
+
children: [
|
|
19093
|
+
/* @__PURE__ */ jsx95("option", { value: "", children: isLoadingActionCodes ? "Loading action codes..." : "Select an action code" }),
|
|
19094
|
+
formData.statusCode && !actionCodes.some((action) => action.name.toUpperCase() === String(formData.statusCode).toUpperCase()) && /* @__PURE__ */ jsx95("option", { value: formData.statusCode, children: formData.statusCode }),
|
|
19095
|
+
actionCodes.map((action) => {
|
|
19096
|
+
var _a;
|
|
19097
|
+
return /* @__PURE__ */ jsx95("option", { value: action.name, children: action.name }, (_a = action.value) != null ? _a : action.name);
|
|
19098
|
+
})
|
|
19099
|
+
]
|
|
19095
19100
|
}
|
|
19096
19101
|
),
|
|
19097
19102
|
/* @__PURE__ */ jsx95("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx95("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" }) })
|
|
@@ -19099,45 +19104,7 @@ function EditStatusModal({
|
|
|
19099
19104
|
errors.statusCode && /* @__PURE__ */ jsx95("p", { className: "fc:text-[11px] fc:text-red-500 fc:mt-1", children: errors.statusCode })
|
|
19100
19105
|
] })
|
|
19101
19106
|
] }),
|
|
19102
|
-
/* @__PURE__ */
|
|
19103
|
-
/* @__PURE__ */ jsxs94("div", { children: [
|
|
19104
|
-
/* @__PURE__ */ jsxs94("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: [
|
|
19105
|
-
"Status Name ",
|
|
19106
|
-
/* @__PURE__ */ jsx95("span", { className: "fc:text-red-500", children: "*" })
|
|
19107
|
-
] }),
|
|
19108
|
-
/* @__PURE__ */ jsxs94("div", { className: "fc:relative", children: [
|
|
19109
|
-
/* @__PURE__ */ jsx95(
|
|
19110
|
-
"input",
|
|
19111
|
-
{
|
|
19112
|
-
type: "text",
|
|
19113
|
-
name: "statusName",
|
|
19114
|
-
value: formData.statusName,
|
|
19115
|
-
onChange: handleChange,
|
|
19116
|
-
placeholder: "Enter status name",
|
|
19117
|
-
className: inputCls(errors.statusName)
|
|
19118
|
-
}
|
|
19119
|
-
),
|
|
19120
|
-
/* @__PURE__ */ jsx95("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx95("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) })
|
|
19121
|
-
] }),
|
|
19122
|
-
errors.statusName && /* @__PURE__ */ jsx95("p", { className: "fc:text-[11px] fc:text-red-500 fc:mt-1", children: errors.statusName })
|
|
19123
|
-
] }),
|
|
19124
|
-
/* @__PURE__ */ jsxs94("div", { children: [
|
|
19125
|
-
/* @__PURE__ */ jsx95("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: "Status ID" }),
|
|
19126
|
-
/* @__PURE__ */ jsxs94("div", { className: "fc:relative", children: [
|
|
19127
|
-
/* @__PURE__ */ jsx95(
|
|
19128
|
-
"input",
|
|
19129
|
-
{
|
|
19130
|
-
type: "text",
|
|
19131
|
-
name: "statusId",
|
|
19132
|
-
value: formData.statusId,
|
|
19133
|
-
disabled: true,
|
|
19134
|
-
className: "fc:w-full fc:py-2.5 fc:px-3 fc:pl-9 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-slate-100 fc:text-slate-500 fc:cursor-not-allowed"
|
|
19135
|
-
}
|
|
19136
|
-
),
|
|
19137
|
-
/* @__PURE__ */ jsx95("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx95("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M7 20l4-16m2 16l4-16M6 9h14M4 15h14" }) })
|
|
19138
|
-
] })
|
|
19139
|
-
] })
|
|
19140
|
-
] }),
|
|
19107
|
+
/* @__PURE__ */ jsx95("div", { className: "fc:grid fc:grid-cols-2 md:fc:grid-cols-2 fc:gap-3.5" }),
|
|
19141
19108
|
/* @__PURE__ */ jsxs94("div", { children: [
|
|
19142
19109
|
/* @__PURE__ */ jsx95("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: "Description" }),
|
|
19143
19110
|
/* @__PURE__ */ jsxs94("div", { className: "fc:relative", children: [
|
|
@@ -19249,7 +19216,8 @@ var DEFAULT_ENDPOINTS2 = {
|
|
|
19249
19216
|
update: "/api/flowcore/Status/Update",
|
|
19250
19217
|
getList: "/api/flowcore/Status/GetList",
|
|
19251
19218
|
getById: "/api/flowcore/Status/GetById",
|
|
19252
|
-
moduleList: "/api/flowcore/Module/GetList"
|
|
19219
|
+
moduleList: "/api/flowcore/Module/GetList",
|
|
19220
|
+
actionCodeList: "/api/flowcore/WorkflowExecution/GetActionCodeList"
|
|
19253
19221
|
};
|
|
19254
19222
|
function StatusMain() {
|
|
19255
19223
|
const tableRef = useRef24(null);
|
|
@@ -19257,6 +19225,9 @@ function StatusMain() {
|
|
|
19257
19225
|
const [isLoading, setIsLoading] = useState72(false);
|
|
19258
19226
|
const [apiData, setApiData] = useState72([]);
|
|
19259
19227
|
const [modules, setModules] = useState72([]);
|
|
19228
|
+
const [actionCodes, setActionCodes] = useState72([]);
|
|
19229
|
+
const [isLoadingActionCodes, setIsLoadingActionCodes] = useState72(false);
|
|
19230
|
+
const [hasLoadedActionCodes, setHasLoadedActionCodes] = useState72(false);
|
|
19260
19231
|
const [selectedModuleId, setSelectedModuleId] = useState72("");
|
|
19261
19232
|
const [pageSize, setPageSize] = useState72(5);
|
|
19262
19233
|
const [searchQuery, setSearchQuery] = useState72("");
|
|
@@ -19294,9 +19265,50 @@ function StatusMain() {
|
|
|
19294
19265
|
return DEFAULT_ENDPOINTS2.moduleList;
|
|
19295
19266
|
}
|
|
19296
19267
|
};
|
|
19268
|
+
const getActionCodeListEndpoint = () => {
|
|
19269
|
+
var _a, _b;
|
|
19270
|
+
try {
|
|
19271
|
+
const flowCore = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore;
|
|
19272
|
+
return ((_b = flowCore == null ? void 0 : flowCore.inbox) == null ? void 0 : _b.GetPermisiionLabelWithCodeAll) || DEFAULT_ENDPOINTS2.actionCodeList;
|
|
19273
|
+
} catch (e) {
|
|
19274
|
+
return DEFAULT_ENDPOINTS2.actionCodeList;
|
|
19275
|
+
}
|
|
19276
|
+
};
|
|
19297
19277
|
const handleRefresh = () => {
|
|
19298
19278
|
setRefreshKey((prev) => prev + 1);
|
|
19299
19279
|
};
|
|
19280
|
+
const handleOpenAdd = async () => {
|
|
19281
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
19282
|
+
setIsAddOpen(true);
|
|
19283
|
+
if (hasLoadedActionCodes || isLoadingActionCodes) return;
|
|
19284
|
+
try {
|
|
19285
|
+
setIsLoadingActionCodes(true);
|
|
19286
|
+
let endpoint3 = getActionCodeListEndpoint();
|
|
19287
|
+
if (typeof endpoint3 === "function") endpoint3 = endpoint3();
|
|
19288
|
+
const response = await getApiService().get(endpoint3);
|
|
19289
|
+
const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
|
|
19290
|
+
const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
|
|
19291
|
+
setActionCodes(rows.filter((item) => {
|
|
19292
|
+
var _a2;
|
|
19293
|
+
return (_a2 = item == null ? void 0 : item.name) != null ? _a2 : item == null ? void 0 : item.Name;
|
|
19294
|
+
}).map((item) => {
|
|
19295
|
+
var _a2, _b2;
|
|
19296
|
+
return {
|
|
19297
|
+
value: (_a2 = item.value) != null ? _a2 : item.Value,
|
|
19298
|
+
name: String((_b2 = item.name) != null ? _b2 : item.Name)
|
|
19299
|
+
};
|
|
19300
|
+
}));
|
|
19301
|
+
setHasLoadedActionCodes(true);
|
|
19302
|
+
} catch (error) {
|
|
19303
|
+
await Swal29.fire(
|
|
19304
|
+
"Error",
|
|
19305
|
+
((_i = (_h = error == null ? void 0 : error.response) == null ? void 0 : _h.data) == null ? void 0 : _i.message) || (error == null ? void 0 : error.message) || "Unable to load action codes.",
|
|
19306
|
+
"error"
|
|
19307
|
+
);
|
|
19308
|
+
} finally {
|
|
19309
|
+
setIsLoadingActionCodes(false);
|
|
19310
|
+
}
|
|
19311
|
+
};
|
|
19300
19312
|
useEffect50(() => {
|
|
19301
19313
|
let isMounted = true;
|
|
19302
19314
|
(async () => {
|
|
@@ -19511,7 +19523,7 @@ function StatusMain() {
|
|
|
19511
19523
|
{ label: "Status", href: "/status" }
|
|
19512
19524
|
],
|
|
19513
19525
|
buttonText: "Add Status",
|
|
19514
|
-
onButtonClick:
|
|
19526
|
+
onButtonClick: handleOpenAdd
|
|
19515
19527
|
}
|
|
19516
19528
|
),
|
|
19517
19529
|
/* @__PURE__ */ jsxs95("div", { className: "fc:bg-white fc:rounded-3xl fc:shadow-sm fc:border fc:border-slate-100 fc:p-6 fc:flex fc:flex-col fc:gap-6", children: [
|
|
@@ -19644,7 +19656,9 @@ function StatusMain() {
|
|
|
19644
19656
|
isOpen: isAddOpen,
|
|
19645
19657
|
onClose: () => setIsAddOpen(false),
|
|
19646
19658
|
onSave: handleCreate,
|
|
19647
|
-
modules
|
|
19659
|
+
modules,
|
|
19660
|
+
actionCodes,
|
|
19661
|
+
isLoadingActionCodes
|
|
19648
19662
|
}
|
|
19649
19663
|
),
|
|
19650
19664
|
/* @__PURE__ */ jsx96(
|
|
@@ -19657,6 +19671,8 @@ function StatusMain() {
|
|
|
19657
19671
|
},
|
|
19658
19672
|
selectedData: selectedItem,
|
|
19659
19673
|
modules,
|
|
19674
|
+
actionCodes,
|
|
19675
|
+
isLoadingActionCodes,
|
|
19660
19676
|
onSave: handleUpdate
|
|
19661
19677
|
}
|
|
19662
19678
|
)
|
|
@@ -19664,7 +19680,7 @@ function StatusMain() {
|
|
|
19664
19680
|
}
|
|
19665
19681
|
|
|
19666
19682
|
// src/components/inbox/InboxMain.jsx
|
|
19667
|
-
import React111, { useState as
|
|
19683
|
+
import React111, { useState as useState80, useMemo as useMemo8, useRef as useRef28, useEffect as useEffect60 } from "react";
|
|
19668
19684
|
import Swal31 from "sweetalert2";
|
|
19669
19685
|
import {
|
|
19670
19686
|
RiInboxArchiveLine as RiInboxArchiveLine2,
|
|
@@ -20575,7 +20591,7 @@ function NotificationPopover({
|
|
|
20575
20591
|
className: `fc:relative fc:h-9 fc:w-9 fc:flex fc:items-center fc:justify-center fc:border fc:rounded-xl fc:transition-all ${isOpen ? "fc:border-blue-400 fc:bg-blue-50 fc:text-blue-600 fc:shadow-sm" : "fc:border-slate-200 fc:bg-white hover:fc:bg-slate-50 fc:text-slate-600 fc:shadow-sm"}`,
|
|
20576
20592
|
children: [
|
|
20577
20593
|
isOpen ? /* @__PURE__ */ jsx100(RiNotification3Fill, { size: 17 }) : /* @__PURE__ */ jsx100(RiNotification3Line, { size: 17 }),
|
|
20578
|
-
/* @__PURE__ */ jsx100("span", { className: "fc:absolute fc:-top-1.5 fc:-right-1.5 fc:min-w-[18px] fc:h-[18px] fc:px-1 fc:flex fc:items-center fc:justify-center fc:bg-rose-500 fc:text-white fc:text-[10px] fc:font-extrabold fc:rounded-full fc:shadow-sm fc:border-2 fc:border-white fc:leading-none", children: unreadCount >
|
|
20594
|
+
unreadCount > 0 && /* @__PURE__ */ jsx100("span", { className: "fc:absolute fc:-top-1.5 fc:-right-1.5 fc:min-w-[18px] fc:h-[18px] fc:px-1 fc:flex fc:items-center fc:justify-center fc:bg-rose-500 fc:text-white fc:text-[10px] fc:font-extrabold fc:rounded-full fc:shadow-sm fc:border-2 fc:border-white fc:leading-none", children: unreadCount > 99 ? "99+" : unreadCount })
|
|
20579
20595
|
]
|
|
20580
20596
|
}
|
|
20581
20597
|
),
|
|
@@ -20783,12 +20799,118 @@ function NotificationPopover({
|
|
|
20783
20799
|
}
|
|
20784
20800
|
|
|
20785
20801
|
// src/components/inbox/ReviewApplication.jsx
|
|
20786
|
-
import React110, { useState as
|
|
20802
|
+
import React110, { useState as useState79, useEffect as useEffect59 } from "react";
|
|
20787
20803
|
import { RiFileTextLine as RiFileTextLine7, RiCheckboxLine as RiCheckboxLine2, RiArrowGoBackLine as RiArrowGoBackLine4 } from "@remixicon/react";
|
|
20788
20804
|
|
|
20789
20805
|
// src/components/inbox/ReviewHeaderBar.jsx
|
|
20790
|
-
import React101, { useState as
|
|
20806
|
+
import React101, { useState as useState76, useEffect as useEffect56, useRef as useRef26 } from "react";
|
|
20791
20807
|
import { RiArrowRightSLine, RiArrowDownSLine, RiSettings4Line, RiArrowGoBackLine } from "@remixicon/react";
|
|
20808
|
+
|
|
20809
|
+
// src/components/Service/UserProfileService.js
|
|
20810
|
+
import { useState as useState75, useEffect as useEffect55 } from "react";
|
|
20811
|
+
var PROFILE_STORAGE_KEY = "FLOWCORE_USER_PROFILE";
|
|
20812
|
+
var memoryCachedProfile = null;
|
|
20813
|
+
var inflightPromise = null;
|
|
20814
|
+
var getProfileEndpoint = () => {
|
|
20815
|
+
var _a, _b, _c;
|
|
20816
|
+
try {
|
|
20817
|
+
const endpoints = getApiEndpoints();
|
|
20818
|
+
if (endpoints == null ? void 0 : endpoints.ProfileApi) return endpoints.ProfileApi;
|
|
20819
|
+
if (endpoints == null ? void 0 : endpoints.profileApi) return endpoints.profileApi;
|
|
20820
|
+
if ((_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.profileApi) return endpoints.flowCore.profileApi;
|
|
20821
|
+
if ((_b = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _b.ProfileApi) return endpoints.flowCore.ProfileApi;
|
|
20822
|
+
if ((_c = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _c.getDashboardProfile) return endpoints.flowCore.getDashboardProfile;
|
|
20823
|
+
} catch (err) {
|
|
20824
|
+
}
|
|
20825
|
+
return null;
|
|
20826
|
+
};
|
|
20827
|
+
var extractName = (data) => {
|
|
20828
|
+
if (!data || typeof data !== "object") return "";
|
|
20829
|
+
return data.name || data.Name || data.userName || data.fullName || "";
|
|
20830
|
+
};
|
|
20831
|
+
var fetchUserProfile = async (forceRefresh = false) => {
|
|
20832
|
+
if (!forceRefresh) {
|
|
20833
|
+
if (memoryCachedProfile) {
|
|
20834
|
+
return memoryCachedProfile;
|
|
20835
|
+
}
|
|
20836
|
+
if (typeof window !== "undefined") {
|
|
20837
|
+
try {
|
|
20838
|
+
const stored = sessionStorage.getItem(PROFILE_STORAGE_KEY);
|
|
20839
|
+
if (stored) {
|
|
20840
|
+
memoryCachedProfile = JSON.parse(stored);
|
|
20841
|
+
return memoryCachedProfile;
|
|
20842
|
+
}
|
|
20843
|
+
} catch (e) {
|
|
20844
|
+
}
|
|
20845
|
+
}
|
|
20846
|
+
}
|
|
20847
|
+
if (inflightPromise) {
|
|
20848
|
+
return inflightPromise;
|
|
20849
|
+
}
|
|
20850
|
+
inflightPromise = (async () => {
|
|
20851
|
+
var _a, _b, _c, _d, _e;
|
|
20852
|
+
try {
|
|
20853
|
+
const endpoint3 = getProfileEndpoint();
|
|
20854
|
+
if (!endpoint3) return null;
|
|
20855
|
+
const apiService = getApiService();
|
|
20856
|
+
const res = await apiService.get(endpoint3);
|
|
20857
|
+
const data = (_e = (_d = (_c = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.data) != null ? _c : (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.result) != null ? _d : res == null ? void 0 : res.data) != null ? _e : res;
|
|
20858
|
+
if (data && typeof data === "object") {
|
|
20859
|
+
memoryCachedProfile = data;
|
|
20860
|
+
if (typeof window !== "undefined") {
|
|
20861
|
+
try {
|
|
20862
|
+
sessionStorage.setItem(PROFILE_STORAGE_KEY, JSON.stringify(data));
|
|
20863
|
+
} catch (e) {
|
|
20864
|
+
}
|
|
20865
|
+
}
|
|
20866
|
+
return data;
|
|
20867
|
+
}
|
|
20868
|
+
return null;
|
|
20869
|
+
} catch (error) {
|
|
20870
|
+
console.warn("Failed to fetch dashboard profile:", error);
|
|
20871
|
+
return null;
|
|
20872
|
+
} finally {
|
|
20873
|
+
inflightPromise = null;
|
|
20874
|
+
}
|
|
20875
|
+
})();
|
|
20876
|
+
return inflightPromise;
|
|
20877
|
+
};
|
|
20878
|
+
var useUserProfile = () => {
|
|
20879
|
+
const [profile, setProfile] = useState75(() => {
|
|
20880
|
+
if (memoryCachedProfile) return memoryCachedProfile;
|
|
20881
|
+
if (typeof window !== "undefined") {
|
|
20882
|
+
try {
|
|
20883
|
+
const stored = sessionStorage.getItem(PROFILE_STORAGE_KEY);
|
|
20884
|
+
if (stored) return JSON.parse(stored);
|
|
20885
|
+
} catch (e) {
|
|
20886
|
+
}
|
|
20887
|
+
}
|
|
20888
|
+
return null;
|
|
20889
|
+
});
|
|
20890
|
+
const [userName, setUserName] = useState75(() => extractName(profile));
|
|
20891
|
+
useEffect55(() => {
|
|
20892
|
+
let isCurrent = true;
|
|
20893
|
+
fetchUserProfile().then((data) => {
|
|
20894
|
+
if (!isCurrent || !data) return;
|
|
20895
|
+
setProfile(data);
|
|
20896
|
+
const name = extractName(data);
|
|
20897
|
+
if (name) {
|
|
20898
|
+
setUserName(name);
|
|
20899
|
+
}
|
|
20900
|
+
});
|
|
20901
|
+
return () => {
|
|
20902
|
+
isCurrent = false;
|
|
20903
|
+
};
|
|
20904
|
+
}, []);
|
|
20905
|
+
const initial = userName ? userName.trim().charAt(0).toUpperCase() : "U";
|
|
20906
|
+
return {
|
|
20907
|
+
profile,
|
|
20908
|
+
userName,
|
|
20909
|
+
initial
|
|
20910
|
+
};
|
|
20911
|
+
};
|
|
20912
|
+
|
|
20913
|
+
// src/components/inbox/ReviewHeaderBar.jsx
|
|
20792
20914
|
import { jsx as jsx101, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
20793
20915
|
function ReviewHeaderBar({
|
|
20794
20916
|
onBackToInbox,
|
|
@@ -20796,11 +20918,15 @@ function ReviewHeaderBar({
|
|
|
20796
20918
|
activeStepName,
|
|
20797
20919
|
assignedSteps = [],
|
|
20798
20920
|
onSelectWorkflowStepId,
|
|
20799
|
-
refreshKey
|
|
20921
|
+
refreshKey,
|
|
20922
|
+
userName: propUserName
|
|
20800
20923
|
}) {
|
|
20801
|
-
const
|
|
20924
|
+
const { userName: hookUserName, initial: hookInitial } = useUserProfile();
|
|
20925
|
+
const userName = propUserName || hookUserName;
|
|
20926
|
+
const userInitial = userName ? userName.trim().charAt(0).toUpperCase() : hookInitial;
|
|
20927
|
+
const [roleDropdownOpen, setRoleDropdownOpen] = useState76(false);
|
|
20802
20928
|
const roleDropdownRef = useRef26(null);
|
|
20803
|
-
|
|
20929
|
+
useEffect56(() => {
|
|
20804
20930
|
const handleOutsideClick = (e) => {
|
|
20805
20931
|
if (roleDropdownRef.current && !roleDropdownRef.current.contains(e.target)) {
|
|
20806
20932
|
setRoleDropdownOpen(false);
|
|
@@ -20845,12 +20971,12 @@ function ReviewHeaderBar({
|
|
|
20845
20971
|
className: "fc:relative fc:flex fc:items-center fc:gap-2.5 fc:bg-slate-50 fc:border fc:border-slate-200 fc:rounded-xl fc:p-1.5 fc:pr-3",
|
|
20846
20972
|
children: [
|
|
20847
20973
|
/* @__PURE__ */ jsxs100("div", { className: "fc:relative fc:shrink-0", children: [
|
|
20848
|
-
/* @__PURE__ */ jsx101("div", { className: "fc:w-8 fc:h-8 fc:rounded-full fc:bg-blue-600 fc:text-white fc:font-extrabold fc:text-xs fc:flex fc:items-center fc:justify-center fc:shadow-sm", children:
|
|
20974
|
+
/* @__PURE__ */ jsx101("div", { className: "fc:w-8 fc:h-8 fc:rounded-full fc:bg-blue-600 fc:text-white fc:font-extrabold fc:text-xs fc:flex fc:items-center fc:justify-center fc:shadow-sm", children: userInitial }),
|
|
20849
20975
|
/* @__PURE__ */ jsx101("span", { className: "fc:absolute fc:-bottom-0.5 fc:-right-0.5 fc:w-2 fc:h-2 fc:bg-emerald-500 fc:border-2 fc:border-white fc:rounded-full" })
|
|
20850
20976
|
] }),
|
|
20851
20977
|
/* @__PURE__ */ jsxs100("div", { className: "fc:flex fc:flex-col fc:justify-center", children: [
|
|
20852
20978
|
/* @__PURE__ */ jsxs100("div", { className: "fc:flex fc:items-center fc:gap-1.5", children: [
|
|
20853
|
-
/* @__PURE__ */ jsx101("span", { className: "fc:text-xs fc:font-extrabold fc:text-slate-800", children: "
|
|
20979
|
+
/* @__PURE__ */ jsx101("span", { className: "fc:text-xs fc:font-extrabold fc:text-slate-800", children: userName || "User" }),
|
|
20854
20980
|
/* @__PURE__ */ jsxs100(
|
|
20855
20981
|
"button",
|
|
20856
20982
|
{
|
|
@@ -21195,84 +21321,188 @@ import React107 from "react";
|
|
|
21195
21321
|
import { RiEyeLine as RiEyeLine4, RiArrowGoBackLine as RiArrowGoBackLine3, RiCheckLine as RiCheckLine4, RiArrowRightLine as RiArrowRightLine2, RiArrowDownSLine as RiArrowDownSLine3 } from "@remixicon/react";
|
|
21196
21322
|
|
|
21197
21323
|
// src/components/inbox/DynamicFormDisplay.jsx
|
|
21198
|
-
import React106, {
|
|
21324
|
+
import React106, { useEffect as useEffect57, useState as useState77 } from "react";
|
|
21199
21325
|
import { RiFullscreenLine, RiFullscreenExitLine, RiDownload2Line, RiFileTextLine as RiFileTextLine4 } from "@remixicon/react";
|
|
21200
|
-
|
|
21201
|
-
|
|
21202
|
-
|
|
21203
|
-
|
|
21204
|
-
|
|
21205
|
-
|
|
21206
|
-
|
|
21207
|
-
|
|
21208
|
-
|
|
21209
|
-
|
|
21210
|
-
|
|
21211
|
-
|
|
21212
|
-
|
|
21213
|
-
{ id: "mobile-number", label: "Mobile Number", type: "tel", value: "9876543210", colSpan: 1 },
|
|
21214
|
-
{ id: "email-address", label: "Email Address", type: "email", value: "mohit.sharma@example.com", colSpan: 1 },
|
|
21215
|
-
{ id: "address", label: "Address", type: "text", value: "Sector 22, Chandigarh, 160022", colSpan: 1 }
|
|
21216
|
-
]
|
|
21217
|
-
},
|
|
21218
|
-
{
|
|
21219
|
-
id: "petition-details",
|
|
21220
|
-
title: "Petition Details",
|
|
21221
|
-
type: "section",
|
|
21222
|
-
fields: [
|
|
21223
|
-
{ id: "category", label: "Category", type: "text", value: "General", colSpan: 1 },
|
|
21224
|
-
{ id: "payment-challan-number", label: "Payment Challan Number", type: "text", value: "CHN2026001234", colSpan: 1 },
|
|
21225
|
-
{ id: "deposit-date", label: "Deposit Date", type: "date", value: "2026-09-28", displayValue: "28 Sep 2026", colSpan: 1 },
|
|
21226
|
-
{ id: "election-type", label: "Election Type", type: "text", value: "Municipal Election", colSpan: 1 },
|
|
21227
|
-
{ id: "ward-number", label: "Ward Number", type: "number", value: 22, colSpan: 1 },
|
|
21228
|
-
{ id: "description", label: "Description", type: "textarea", value: "Election petition for ward no. 22", colSpan: 2 },
|
|
21229
|
-
{ id: "declaration-accepted", label: "Applicant Declaration Accepted", type: "boolean", value: true, displayValue: "Yes", colSpan: 2 }
|
|
21230
|
-
]
|
|
21231
|
-
},
|
|
21232
|
-
{
|
|
21233
|
-
id: "beneficiaries",
|
|
21234
|
-
title: "Beneficiaries",
|
|
21235
|
-
type: "table",
|
|
21236
|
-
columns: [
|
|
21237
|
-
{ id: "col-1", key: "name", label: "Name", type: "text" },
|
|
21238
|
-
{ id: "col-2", key: "gender", label: "Gender", type: "text" },
|
|
21239
|
-
{ id: "col-3", key: "date-of-birth", label: "Date of Birth", type: "date" },
|
|
21240
|
-
{ id: "col-4", key: "is-active", label: "Is Active", type: "boolean" }
|
|
21241
|
-
],
|
|
21242
|
-
rows: [
|
|
21243
|
-
{ id: "row-1", values: ["Ramesh Kumar", "Male", "1985-01-12", true] },
|
|
21244
|
-
{ id: "row-2", values: ["Priya Devi", "Female", "1990-03-04", true] },
|
|
21245
|
-
{ id: "row-3", values: ["Amit Singh", "Male", "1988-08-21", false] }
|
|
21246
|
-
]
|
|
21247
|
-
},
|
|
21248
|
-
{
|
|
21249
|
-
id: "attachments",
|
|
21250
|
-
title: "Applicant Attachments",
|
|
21251
|
-
type: "attachments",
|
|
21252
|
-
files: [
|
|
21253
|
-
{ id: "file-1", label: "Fee Challan File", fileName: "fee_challan_1234.pdf", contentType: "application/pdf", sizeBytes: 250880, downloadUrl: "/api/applications/TASK-31/files/file-1" },
|
|
21254
|
-
{ id: "file-2", label: "Supporting Document", fileName: "petition_document.pdf", contentType: "application/pdf", sizeBytes: 1258291, downloadUrl: "/api/applications/TASK-31/files/file-2" }
|
|
21255
|
-
]
|
|
21256
|
-
},
|
|
21257
|
-
{
|
|
21258
|
-
id: "additional-information",
|
|
21259
|
-
title: "Additional Information",
|
|
21260
|
-
type: "section",
|
|
21261
|
-
fields: [
|
|
21262
|
-
{ id: "additional-comments", label: "Additional Comments", type: "textarea", value: "Please find the attached documents for election petition.", colSpan: 2 }
|
|
21263
|
-
]
|
|
21264
|
-
}
|
|
21265
|
-
]
|
|
21266
|
-
};
|
|
21267
|
-
var formatSize = (bytes) => {
|
|
21268
|
-
if (bytes >= 1048576) return `${(bytes / 1048576).toFixed(1)} MB`;
|
|
21269
|
-
if (bytes >= 1024) return `${Math.round(bytes / 1024)} KB`;
|
|
21270
|
-
return `${bytes} B`;
|
|
21326
|
+
|
|
21327
|
+
// src/components/inbox/reviewHelpers.js
|
|
21328
|
+
var getAvailableActions2 = (response) => {
|
|
21329
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
21330
|
+
const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
|
|
21331
|
+
const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
|
|
21332
|
+
return rows.map((action) => {
|
|
21333
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
21334
|
+
return {
|
|
21335
|
+
label: (_d2 = (_c2 = (_b2 = (_a2 = action.label) != null ? _a2 : action.Label) != null ? _b2 : action.actionName) != null ? _c2 : action.ActionName) != null ? _d2 : "",
|
|
21336
|
+
actionCode: (_f2 = (_e2 = action.actionCode) != null ? _e2 : action.ActionCode) != null ? _f2 : ""
|
|
21337
|
+
};
|
|
21338
|
+
}).filter((action) => action.label && action.actionCode);
|
|
21271
21339
|
};
|
|
21272
|
-
var
|
|
21273
|
-
var _a;
|
|
21274
|
-
const
|
|
21275
|
-
const
|
|
21340
|
+
var getWorkflowStepsStatusEndpoint = () => {
|
|
21341
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
21342
|
+
const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
|
|
21343
|
+
const endpoint3 = (_k = (_j = (_i = (_g = (_e = (_c = flowCore.getWorkflowStepsBarStatus) == null ? void 0 : _c.getStatus) != null ? _e : (_d = flowCore.workflowStepsBarStatus) == null ? void 0 : _d.getStatus) != null ? _g : (_f = flowCore.GetWorkflowStepsBarStatus) == null ? void 0 : _f.GetStatus) != null ? _i : (_h = flowCore.GetWorkflowStepsBarStatus) == null ? void 0 : _h.getStatus) != null ? _j : flowCore.GetWorkflowStepsBarStatus) != null ? _k : flowCore.getWorkflowStepsBarStatus;
|
|
21344
|
+
if (!endpoint3) throw new Error("Workflow steps bar status endpoint is not configured.");
|
|
21345
|
+
return endpoint3;
|
|
21346
|
+
};
|
|
21347
|
+
var getWorkflowSteps = (response) => {
|
|
21348
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
21349
|
+
const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
|
|
21350
|
+
const steps = (_g = (_f = value == null ? void 0 : value.steps) != null ? _f : value == null ? void 0 : value.Steps) != null ? _g : [];
|
|
21351
|
+
return Array.isArray(steps) ? [...steps].sort((first, second) => {
|
|
21352
|
+
var _a2, _b2, _c2, _d2;
|
|
21353
|
+
return Number((_b2 = (_a2 = first.sequenceNo) != null ? _a2 : first.SequenceNo) != null ? _b2 : 0) - Number((_d2 = (_c2 = second.sequenceNo) != null ? _c2 : second.SequenceNo) != null ? _d2 : 0);
|
|
21354
|
+
}) : [];
|
|
21355
|
+
};
|
|
21356
|
+
var getFileHistoryEndpoint = () => {
|
|
21357
|
+
var _a, _b, _c, _d, _e;
|
|
21358
|
+
const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
|
|
21359
|
+
const configured = (_c = flowCore.getFileHistory) != null ? _c : flowCore.GetFileHistory;
|
|
21360
|
+
const endpoint3 = (_e = (_d = configured == null ? void 0 : configured.getFileHistory) != null ? _d : configured == null ? void 0 : configured.GetFileHistory) != null ? _e : configured;
|
|
21361
|
+
if (!endpoint3) throw new Error("Get File History endpoint is not configured.");
|
|
21362
|
+
return endpoint3;
|
|
21363
|
+
};
|
|
21364
|
+
var getDocumentHistoryEndpoint = () => {
|
|
21365
|
+
var _a, _b, _c, _d, _e;
|
|
21366
|
+
const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
|
|
21367
|
+
const configured = (_c = flowCore.getDocumentAndWorkFlow) != null ? _c : flowCore.GetDocumentAndWorkFlow;
|
|
21368
|
+
const endpoint3 = (_e = (_d = configured == null ? void 0 : configured.getDocumentHistoryByHistoryId) != null ? _d : configured == null ? void 0 : configured.GetDocumentHistoryByHistoryId) != null ? _e : configured;
|
|
21369
|
+
if (!endpoint3) throw new Error("Document history details endpoint is not configured.");
|
|
21370
|
+
return endpoint3;
|
|
21371
|
+
};
|
|
21372
|
+
var getApplicantFormPreviewEndpoint = () => {
|
|
21373
|
+
var _a, _b;
|
|
21374
|
+
const endpoint3 = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.applicantFormPreview;
|
|
21375
|
+
if (!endpoint3) throw new Error("Applicant form preview endpoint is not configured.");
|
|
21376
|
+
return endpoint3;
|
|
21377
|
+
};
|
|
21378
|
+
var getConfigValue = (source, key) => {
|
|
21379
|
+
if (!source || typeof source !== "object") return void 0;
|
|
21380
|
+
const matchingKey = Object.keys(source).find((candidate) => candidate.toLowerCase() === key.toLowerCase());
|
|
21381
|
+
return matchingKey ? source[matchingKey] : void 0;
|
|
21382
|
+
};
|
|
21383
|
+
var findConfigEntry = (source, key, path = [], visited = /* @__PURE__ */ new WeakSet()) => {
|
|
21384
|
+
if (!source || typeof source !== "object" || visited.has(source)) return null;
|
|
21385
|
+
visited.add(source);
|
|
21386
|
+
const entries = Object.entries(source);
|
|
21387
|
+
const matchingEntry = entries.find(([candidate]) => candidate.toLowerCase() === key.toLowerCase());
|
|
21388
|
+
if (matchingEntry) return { value: matchingEntry[1], path: [...path, matchingEntry[0]] };
|
|
21389
|
+
for (const [candidate, value] of entries) {
|
|
21390
|
+
const result = findConfigEntry(value, key, [...path, candidate], visited);
|
|
21391
|
+
if (result) return result;
|
|
21392
|
+
}
|
|
21393
|
+
return null;
|
|
21394
|
+
};
|
|
21395
|
+
var getStepDocumentsEndpoint = () => {
|
|
21396
|
+
var _a, _b, _c;
|
|
21397
|
+
const suppliedEndpoints = getApiEndpoints();
|
|
21398
|
+
const root = (_a = getConfigValue(suppliedEndpoints, "apiEndpoints")) != null ? _a : suppliedEndpoints;
|
|
21399
|
+
const flowCore = (_b = getConfigValue(root, "flowCore")) != null ? _b : root;
|
|
21400
|
+
const inbox = getConfigValue(flowCore, "inbox");
|
|
21401
|
+
const documentConfiguration = getConfigValue(flowCore, "documentConfiguration");
|
|
21402
|
+
const configuredEndpoint = (_c = getConfigValue(inbox, "getDocumentsByWorkFlowStepId")) != null ? _c : getConfigValue(documentConfiguration, "getDocumentsByWorkFlowStepId");
|
|
21403
|
+
const endpoint3 = configuredEndpoint ? { value: configuredEndpoint, path: ["flowCore", "inbox", "getDocumentsByWorkFlowStepId"] } : findConfigEntry(suppliedEndpoints, "getDocumentsByWorkFlowStepId");
|
|
21404
|
+
if (!(endpoint3 == null ? void 0 : endpoint3.value)) {
|
|
21405
|
+
const configKeys = Object.keys(flowCore != null ? flowCore : {}).join(", ") || "none";
|
|
21406
|
+
const inboxKeys = Object.keys(inbox != null ? inbox : {}).join(", ") || "none";
|
|
21407
|
+
throw new Error(`Documents endpoint missing at runtime. flowCore keys: ${configKeys}. inbox keys: ${inboxKeys}.`);
|
|
21408
|
+
}
|
|
21409
|
+
if (typeof endpoint3.value !== "string" && typeof endpoint3.value !== "function") {
|
|
21410
|
+
throw new Error(`Configured document endpoint at ${endpoint3.path.join(".")} must be a URL string or function.`);
|
|
21411
|
+
}
|
|
21412
|
+
return endpoint3.value;
|
|
21413
|
+
};
|
|
21414
|
+
var getUploadDocumentEndpoint = () => {
|
|
21415
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
21416
|
+
const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
|
|
21417
|
+
const execution = (_c = flowCore.workflowExecution) != null ? _c : flowCore.WorkflowExecution;
|
|
21418
|
+
const endpoint3 = (_l = (_j = (_h = (_f = (_d = execution == null ? void 0 : execution.uploadDocument) != null ? _d : execution == null ? void 0 : execution.UploadDocument) != null ? _f : (_e = flowCore.inbox) == null ? void 0 : _e.uploadDocument) != null ? _h : (_g = flowCore.inbox) == null ? void 0 : _g.UploadDocument) != null ? _j : (_i = flowCore.Inbox) == null ? void 0 : _i.uploadDocument) != null ? _l : (_k = flowCore.Inbox) == null ? void 0 : _k.UploadDocument;
|
|
21419
|
+
if (!endpoint3) throw new Error("Workflow document upload endpoint is not configured.");
|
|
21420
|
+
return endpoint3;
|
|
21421
|
+
};
|
|
21422
|
+
var getConfiguredDocuments = (response) => {
|
|
21423
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
21424
|
+
const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
|
|
21425
|
+
const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
|
|
21426
|
+
return rows.map((document2) => {
|
|
21427
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l;
|
|
21428
|
+
return __spreadProps(__spreadValues({}, document2), {
|
|
21429
|
+
documentConfigurationId: Number((_b2 = (_a2 = document2.documentConfigurationId) != null ? _a2 : document2.DocumentConfigurationId) != null ? _b2 : document2.id),
|
|
21430
|
+
documentName: (_d2 = (_c2 = document2.documentName) != null ? _c2 : document2.DocumentName) != null ? _d2 : "Document",
|
|
21431
|
+
allowedExtensions: (_f2 = (_e2 = document2.allowedExtensions) != null ? _e2 : document2.AllowedExtensions) != null ? _f2 : "",
|
|
21432
|
+
maxSizeMB: Number((_h = (_g2 = document2.maxSizeMB) != null ? _g2 : document2.MaxSizeMB) != null ? _h : 0),
|
|
21433
|
+
isMandatory: Boolean((_j = (_i = document2.isMandatory) != null ? _i : document2.IsMandatory) != null ? _j : false),
|
|
21434
|
+
isActive: Boolean((_l = (_k = document2.isActive) != null ? _k : document2.IsActive) != null ? _l : true)
|
|
21435
|
+
});
|
|
21436
|
+
}).filter((document2) => Number.isInteger(document2.documentConfigurationId) && document2.isActive);
|
|
21437
|
+
};
|
|
21438
|
+
var getDocumentAcceptValue = (extensions) => String(extensions != null ? extensions : "").split(/[,;\s]+/).map((extension) => extension.trim().toLowerCase()).filter(Boolean).map((extension) => extension.startsWith(".") ? extension : `.${extension}`).join(",");
|
|
21439
|
+
var getFileHistoryMovements = (response) => {
|
|
21440
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
21441
|
+
const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
|
|
21442
|
+
const movements = (_g = (_f = value == null ? void 0 : value.movements) != null ? _f : value == null ? void 0 : value.Movements) != null ? _g : [];
|
|
21443
|
+
return Array.isArray(movements) ? movements : [];
|
|
21444
|
+
};
|
|
21445
|
+
var formatMovementDate = (value) => {
|
|
21446
|
+
if (!value) return "-";
|
|
21447
|
+
const date = new Date(value);
|
|
21448
|
+
return Number.isNaN(date.getTime()) ? String(value) : date.toLocaleString("en-GB", {
|
|
21449
|
+
day: "2-digit",
|
|
21450
|
+
month: "short",
|
|
21451
|
+
year: "numeric",
|
|
21452
|
+
hour: "2-digit",
|
|
21453
|
+
minute: "2-digit"
|
|
21454
|
+
});
|
|
21455
|
+
};
|
|
21456
|
+
var mapFileHistoryMovement = (movement, index) => {
|
|
21457
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
21458
|
+
const actionCode = String((_d = (_c = (_b = (_a = movement.actionCode) != null ? _a : movement.ActionCode) != null ? _b : movement.actionName) != null ? _c : movement.ActionName) != null ? _d : "Action");
|
|
21459
|
+
const normalizedAction = actionCode.toUpperCase().replace(/[\s-]/g, "_");
|
|
21460
|
+
const isReturn = normalizedAction.includes("RETURN") || normalizedAction === "PULL";
|
|
21461
|
+
const isResubmit = normalizedAction.includes("RESUBMIT");
|
|
21462
|
+
const isSubmit = !isResubmit && normalizedAction.includes("SUBMIT");
|
|
21463
|
+
const status = isReturn ? "Returned to Applicant" : isResubmit ? "Resubmitted" : isSubmit ? "Submitted" : normalizedAction.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (letter) => letter.toUpperCase());
|
|
21464
|
+
const applicantActor = isResubmit || movement.applicantName && !movement.officialName;
|
|
21465
|
+
const userName = (_l = (_k = (_j = (_i = (_h = (_g = (_f = (_e = movement.userregistrationName) != null ? _e : movement.UserRegistrationName) != null ? _f : movement.UserName) != null ? _g : movement.userName) != null ? _h : applicantActor ? movement.applicantName : movement.officialName) != null ? _i : movement.officialName) != null ? _j : movement.applicantName) != null ? _k : movement.performedBy) != null ? _l : "Unknown user";
|
|
21466
|
+
const comments = (_p = (_o = (_n = (_m = movement.officialComment) != null ? _m : movement.applicantComment) != null ? _n : movement.comments) != null ? _o : movement.Comments) != null ? _p : "-";
|
|
21467
|
+
const stepId = (_q = movement.fromWorkflowStepId) != null ? _q : movement.FromWorkflowStepId;
|
|
21468
|
+
const stepName = (_s = (_r = movement.workflowStepName) != null ? _r : movement.WorkflowStepName) != null ? _s : "";
|
|
21469
|
+
return {
|
|
21470
|
+
id: (_u = (_t = movement.movementHistoryId) != null ? _t : movement.MovementHistoryId) != null ? _u : index + 1,
|
|
21471
|
+
type: isReturn ? "return" : isSubmit ? "submit" : isResubmit ? "resubmit" : "forward",
|
|
21472
|
+
date: formatMovementDate((_v = movement.movedOn) != null ? _v : movement.MovedOn),
|
|
21473
|
+
userName,
|
|
21474
|
+
userRole: applicantActor ? "Applicant" : "Official",
|
|
21475
|
+
status,
|
|
21476
|
+
stepNum: stepId != null && Number(stepId) > 0 ? `Step ${stepId}` : null,
|
|
21477
|
+
stepName: stepName || null,
|
|
21478
|
+
remarks: comments,
|
|
21479
|
+
isAlert: isReturn,
|
|
21480
|
+
isCurrent: false,
|
|
21481
|
+
title: status,
|
|
21482
|
+
by: `By ${userName}${applicantActor ? " (Applicant)" : ""}`
|
|
21483
|
+
};
|
|
21484
|
+
};
|
|
21485
|
+
var DEFAULT_ACTIONS = [
|
|
21486
|
+
{ label: "Approve kro", actionCode: "APPROVE" },
|
|
21487
|
+
{ label: "Reject", actionCode: "REJECT" },
|
|
21488
|
+
{ label: "Forward", actionCode: "FORWARD" },
|
|
21489
|
+
{ label: "Free Forward", actionCode: "FREE_FORWARD" },
|
|
21490
|
+
{ label: "Return To Applicant", actionCode: "RETURN_TO_APPLICANT" }
|
|
21491
|
+
];
|
|
21492
|
+
|
|
21493
|
+
// src/components/inbox/DynamicFormDisplay.jsx
|
|
21494
|
+
import { jsx as jsx106, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
21495
|
+
var formatSize = (bytes) => {
|
|
21496
|
+
const size = Number(bytes);
|
|
21497
|
+
if (!Number.isFinite(size)) return "";
|
|
21498
|
+
if (size >= 1048576) return `${(size / 1048576).toFixed(1)} MB`;
|
|
21499
|
+
if (size >= 1024) return `${Math.round(size / 1024)} KB`;
|
|
21500
|
+
return `${size} B`;
|
|
21501
|
+
};
|
|
21502
|
+
var FieldCard = ({ field }) => {
|
|
21503
|
+
var _a;
|
|
21504
|
+
const label = /* @__PURE__ */ jsx106("span", { className: "fc:text-[11px] fc:font-bold fc:text-slate-500 fc:block", children: field.label });
|
|
21505
|
+
const span = field.colSpan === 2 ? "fc:col-span-2" : "";
|
|
21276
21506
|
if (field.type === "boolean") {
|
|
21277
21507
|
return /* @__PURE__ */ jsxs105("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
|
|
21278
21508
|
label,
|
|
@@ -21294,44 +21524,102 @@ var FieldCard = ({ field }) => {
|
|
|
21294
21524
|
] });
|
|
21295
21525
|
};
|
|
21296
21526
|
var TableSection = ({ section }) => {
|
|
21527
|
+
var _a, _b;
|
|
21297
21528
|
return /* @__PURE__ */ jsx106("div", { className: "fc:overflow-x-auto fc:rounded-xl fc:border fc:border-slate-200/80 fc-custom-scrollbar", children: /* @__PURE__ */ jsxs105("table", { className: "fc:min-w-full", children: [
|
|
21298
|
-
/* @__PURE__ */ jsx106("thead", { className: "fc:bg-slate-50", children: /* @__PURE__ */ jsx106("tr", { children: section.columns.map((col) => /* @__PURE__ */ jsx106("th", { className: "fc:px-3 fc:py-2.5 fc:text-[11px] fc:font-bold fc:text-slate-600 fc:text-left fc:whitespace-nowrap fc:border-b fc:border-slate-200", children: col.label }, col.id)) }) }),
|
|
21299
|
-
/* @__PURE__ */ jsx106("tbody", { className: "fc:divide-y fc:divide-slate-100", children: section.rows
|
|
21300
|
-
|
|
21301
|
-
return /* @__PURE__ */ jsx106("
|
|
21302
|
-
|
|
21529
|
+
/* @__PURE__ */ jsx106("thead", { className: "fc:bg-slate-50", children: /* @__PURE__ */ jsx106("tr", { children: ((_a = section.columns) != null ? _a : []).map((col) => /* @__PURE__ */ jsx106("th", { className: "fc:px-3 fc:py-2.5 fc:text-[11px] fc:font-bold fc:text-slate-600 fc:text-left fc:whitespace-nowrap fc:border-b fc:border-slate-200", children: col.label }, col.id)) }) }),
|
|
21530
|
+
/* @__PURE__ */ jsx106("tbody", { className: "fc:divide-y fc:divide-slate-100", children: ((_b = section.rows) != null ? _b : []).map((row) => {
|
|
21531
|
+
var _a2;
|
|
21532
|
+
return /* @__PURE__ */ jsx106("tr", { className: "hover:fc:bg-slate-50/50", children: ((_a2 = section.columns) != null ? _a2 : []).map((col, index) => {
|
|
21533
|
+
var _a3;
|
|
21534
|
+
const val = (_a3 = row.values) == null ? void 0 : _a3[index];
|
|
21535
|
+
return /* @__PURE__ */ jsx106("td", { className: "fc:px-3 fc:py-2 fc:text-xs fc:text-slate-700 fc:whitespace-nowrap", children: col.type === "boolean" ? /* @__PURE__ */ jsx106("span", { className: `fc:inline-flex fc:items-center fc:px-2 fc:py-0.5 fc:rounded-full fc:text-[10px] fc:font-bold ${val ? "fc:bg-emerald-50 fc:text-emerald-600 fc:border fc:border-emerald-200" : "fc:bg-red-50 fc:text-red-500 fc:border fc:border-red-200"}`, children: val ? "Active" : "Inactive" }) : col.key === "profilePath" && val ? /* @__PURE__ */ jsx106("a", { href: String(val), target: "_blank", rel: "noreferrer", className: "fc:text-blue-600 hover:fc:underline", children: "View profile" }) : val !== null && val !== void 0 ? String(val) : "-" }, col.id);
|
|
21536
|
+
}) }, row.id);
|
|
21537
|
+
}) })
|
|
21303
21538
|
] }) });
|
|
21304
21539
|
};
|
|
21305
|
-
var AttachmentsSection = ({ section }) =>
|
|
21306
|
-
|
|
21307
|
-
|
|
21308
|
-
|
|
21309
|
-
|
|
21310
|
-
/* @__PURE__ */ jsxs105("
|
|
21311
|
-
|
|
21312
|
-
|
|
21313
|
-
|
|
21314
|
-
|
|
21540
|
+
var AttachmentsSection = ({ section }) => {
|
|
21541
|
+
var _a;
|
|
21542
|
+
return /* @__PURE__ */ jsx106("div", { className: "fc:space-y-3", children: ((_a = section.files) != null ? _a : []).map((file) => {
|
|
21543
|
+
const size = formatSize(file.sizeBytes);
|
|
21544
|
+
return /* @__PURE__ */ jsxs105("div", { className: "fc:flex fc:items-center fc:justify-between fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80", children: [
|
|
21545
|
+
/* @__PURE__ */ jsxs105("div", { className: "fc:flex fc:items-center fc:gap-3 fc:min-w-0", children: [
|
|
21546
|
+
/* @__PURE__ */ jsx106("div", { className: "fc:w-9 fc:h-9 fc:rounded-lg fc:bg-red-100 fc:flex fc:items-center fc:justify-center fc:shrink-0", children: /* @__PURE__ */ jsx106(RiFileTextLine4, { size: 18, className: "fc:text-red-500" }) }),
|
|
21547
|
+
/* @__PURE__ */ jsxs105("div", { className: "fc:min-w-0", children: [
|
|
21548
|
+
/* @__PURE__ */ jsx106("span", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-800", children: file.label }),
|
|
21549
|
+
/* @__PURE__ */ jsxs105("span", { className: "fc:block fc:text-[11px] fc:text-slate-500 fc:break-all", children: [
|
|
21550
|
+
file.fileName,
|
|
21551
|
+
size ? ` (${size})` : ""
|
|
21552
|
+
] })
|
|
21553
|
+
] })
|
|
21554
|
+
] }),
|
|
21555
|
+
/* @__PURE__ */ jsxs105("a", { href: file.downloadUrl, download: true, className: "fc:inline-flex fc:items-center fc:gap-1.5 fc:text-xs fc:font-semibold fc:text-blue-600 hover:fc:text-blue-700 fc:shrink-0 fc:ml-3", children: [
|
|
21556
|
+
/* @__PURE__ */ jsx106(RiDownload2Line, { size: 15 }),
|
|
21557
|
+
/* @__PURE__ */ jsx106("span", { children: "Download" })
|
|
21315
21558
|
] })
|
|
21316
|
-
] })
|
|
21317
|
-
|
|
21318
|
-
|
|
21319
|
-
|
|
21320
|
-
|
|
21321
|
-
]
|
|
21322
|
-
|
|
21323
|
-
|
|
21324
|
-
const [
|
|
21325
|
-
|
|
21326
|
-
|
|
21327
|
-
|
|
21328
|
-
|
|
21329
|
-
|
|
21330
|
-
|
|
21331
|
-
|
|
21559
|
+
] }, file.id);
|
|
21560
|
+
}) });
|
|
21561
|
+
};
|
|
21562
|
+
function DynamicFormDisplay({ fileNo, maximized = false, onToggleMaximize }) {
|
|
21563
|
+
const [displayData, setDisplayData] = useState77(null);
|
|
21564
|
+
const [activeTab, setActiveTab] = useState77("");
|
|
21565
|
+
const [expandedSections, setExpandedSections] = useState77({});
|
|
21566
|
+
const [isLoading, setIsLoading] = useState77(false);
|
|
21567
|
+
const [loadError, setLoadError] = useState77("");
|
|
21568
|
+
useEffect57(() => {
|
|
21569
|
+
if (!fileNo) {
|
|
21570
|
+
setDisplayData(null);
|
|
21571
|
+
setActiveTab("");
|
|
21572
|
+
setIsLoading(false);
|
|
21573
|
+
setLoadError("File number is unavailable.");
|
|
21574
|
+
return void 0;
|
|
21575
|
+
}
|
|
21576
|
+
let isCurrent = true;
|
|
21577
|
+
const loadPreview = async () => {
|
|
21578
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
21579
|
+
setIsLoading(true);
|
|
21580
|
+
setLoadError("");
|
|
21581
|
+
setDisplayData(null);
|
|
21582
|
+
setActiveTab("");
|
|
21583
|
+
try {
|
|
21584
|
+
const endpoint3 = getApplicantFormPreviewEndpoint();
|
|
21585
|
+
const url = typeof endpoint3 === "function" ? endpoint3() : String(endpoint3);
|
|
21586
|
+
const response = await getApiService().post(url, { fileNo });
|
|
21587
|
+
const preview = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
|
|
21588
|
+
if (!Array.isArray(preview == null ? void 0 : preview.sections)) {
|
|
21589
|
+
throw new Error("The applicant form preview response is invalid.");
|
|
21590
|
+
}
|
|
21591
|
+
if (isCurrent) {
|
|
21592
|
+
setDisplayData(preview);
|
|
21593
|
+
setActiveTab((_g = (_f = preview.sections[0]) == null ? void 0 : _f.id) != null ? _g : "");
|
|
21594
|
+
setExpandedSections(Object.fromEntries(
|
|
21595
|
+
preview.sections.map((section) => {
|
|
21596
|
+
var _a2;
|
|
21597
|
+
return [section.id, ((_a2 = preview.layout) == null ? void 0 : _a2.defaultExpanded) !== false];
|
|
21598
|
+
})
|
|
21599
|
+
));
|
|
21600
|
+
}
|
|
21601
|
+
} catch (error) {
|
|
21602
|
+
if (isCurrent) {
|
|
21603
|
+
setLoadError(((_i = (_h = error == null ? void 0 : error.response) == null ? void 0 : _h.data) == null ? void 0 : _i.message) || (error == null ? void 0 : error.message) || "Unable to load applicant form preview.");
|
|
21604
|
+
}
|
|
21605
|
+
} finally {
|
|
21606
|
+
if (isCurrent) setIsLoading(false);
|
|
21607
|
+
}
|
|
21608
|
+
};
|
|
21609
|
+
loadPreview();
|
|
21610
|
+
return () => {
|
|
21611
|
+
isCurrent = false;
|
|
21612
|
+
};
|
|
21613
|
+
}, [fileNo]);
|
|
21332
21614
|
const toggleSection = (id) => setExpandedSections((prev) => __spreadProps(__spreadValues({}, prev), { [id]: !prev[id] }));
|
|
21333
|
-
const displayData = STATIC_FORM_JSON;
|
|
21334
21615
|
const isMax = !!maximized;
|
|
21616
|
+
if (isLoading) {
|
|
21617
|
+
return /* @__PURE__ */ jsx106("div", { role: "status", className: "fc:rounded-2xl fc:border fc:border-slate-200 fc:bg-white fc:p-6 fc:text-center fc:text-sm fc:text-slate-500", children: "Loading applicant form preview..." });
|
|
21618
|
+
}
|
|
21619
|
+
if (loadError) {
|
|
21620
|
+
return /* @__PURE__ */ jsx106("div", { role: "alert", className: "fc:rounded-2xl fc:border fc:border-rose-200 fc:bg-white fc:p-6 fc:text-center fc:text-sm fc:text-rose-600", children: loadError });
|
|
21621
|
+
}
|
|
21622
|
+
if (!displayData) return null;
|
|
21335
21623
|
return /* @__PURE__ */ jsxs105("div", { className: `fc:bg-white fc:border fc:border-slate-200 fc:rounded-2xl fc:shadow-sm fc:overflow-hidden ${isMax ? "fc:w-full" : ""}`, children: [
|
|
21336
21624
|
/* @__PURE__ */ jsxs105("div", { className: "fc:flex fc:items-center fc:justify-between fc:px-5 fc:py-4 fc:border-b fc:border-slate-100", children: [
|
|
21337
21625
|
/* @__PURE__ */ jsxs105("div", { className: "fc:flex fc:items-center fc:gap-3", children: [
|
|
@@ -21360,7 +21648,7 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
|
|
|
21360
21648
|
)
|
|
21361
21649
|
] }),
|
|
21362
21650
|
/* @__PURE__ */ jsx106("div", { className: "fc:flex fc:items-center fc:gap-1 fc:px-5 fc:border-b fc:border-slate-200 fc:overflow-x-auto fc:pb-1 fc-custom-scrollbar", children: displayData.sections.map((section) => {
|
|
21363
|
-
var _a;
|
|
21651
|
+
var _a, _b, _c, _d, _e;
|
|
21364
21652
|
return /* @__PURE__ */ jsxs105(
|
|
21365
21653
|
"button",
|
|
21366
21654
|
{
|
|
@@ -21369,24 +21657,25 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
|
|
|
21369
21657
|
className: `fc:inline-flex fc:items-center fc:gap-1.5 fc:px-3 fc:py-2.5 fc:text-xs fc:font-semibold fc:whitespace-nowrap fc:border-b-2 fc:transition-colors ${activeTab === section.id ? "fc:border-blue-600 fc:text-blue-600" : "fc:border-transparent fc:text-slate-500 hover:fc:text-slate-800"}`,
|
|
21370
21658
|
children: [
|
|
21371
21659
|
section.title,
|
|
21372
|
-
/* @__PURE__ */ jsx106("span", { className: `fc:rounded-full fc:px-1.5 fc:py-0.5 fc:text-[9px] fc:font-bold ${activeTab === section.id ? "fc:bg-blue-50 fc:text-blue-600" : "fc:bg-slate-100 fc:text-slate-400"}`, children: section.type === "table" ? section.rows.length : section.type === "attachments" ? section.files.length : ((
|
|
21660
|
+
/* @__PURE__ */ jsx106("span", { className: `fc:rounded-full fc:px-1.5 fc:py-0.5 fc:text-[9px] fc:font-bold ${activeTab === section.id ? "fc:bg-blue-50 fc:text-blue-600" : "fc:bg-slate-100 fc:text-slate-400"}`, children: section.type === "table" ? (_b = (_a = section.rows) == null ? void 0 : _a.length) != null ? _b : 0 : section.type === "attachments" ? (_d = (_c = section.files) == null ? void 0 : _c.length) != null ? _d : 0 : ((_e = section.fields) == null ? void 0 : _e.length) || 0 })
|
|
21373
21661
|
]
|
|
21374
21662
|
},
|
|
21375
21663
|
section.id
|
|
21376
21664
|
);
|
|
21377
21665
|
}) }),
|
|
21378
21666
|
/* @__PURE__ */ jsx106("div", { className: "fc:p-5", children: displayData.sections.map((section) => {
|
|
21379
|
-
var _a, _b;
|
|
21667
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
21380
21668
|
if (section.id !== activeTab) return null;
|
|
21381
21669
|
if (section.type === "table") {
|
|
21382
21670
|
return /* @__PURE__ */ jsxs105("div", { className: "fc:space-y-3", children: [
|
|
21383
|
-
/* @__PURE__ */
|
|
21671
|
+
/* @__PURE__ */ jsxs105("div", { children: [
|
|
21384
21672
|
/* @__PURE__ */ jsx106("h3", { className: "fc:text-sm fc:font-extrabold fc:text-slate-900", children: section.title }),
|
|
21385
21673
|
/* @__PURE__ */ jsxs105("p", { className: "fc:text-[11px] fc:text-slate-400 fc:mt-0.5", children: [
|
|
21386
|
-
section.rows.length,
|
|
21674
|
+
(_b = (_a = section.rows) == null ? void 0 : _a.length) != null ? _b : 0,
|
|
21387
21675
|
" records"
|
|
21388
21676
|
] })
|
|
21389
|
-
] })
|
|
21677
|
+
] }),
|
|
21678
|
+
((_c = section.fields) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ jsx106("div", { className: `fc:grid fc:gap-3 ${isMax ? "fc:grid-cols-3" : "fc:grid-cols-2"}`, children: section.fields.map((field) => /* @__PURE__ */ jsx106(FieldCard, { field }, field.id)) }),
|
|
21390
21679
|
/* @__PURE__ */ jsx106(TableSection, { section })
|
|
21391
21680
|
] }, section.id);
|
|
21392
21681
|
}
|
|
@@ -21395,7 +21684,7 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
|
|
|
21395
21684
|
/* @__PURE__ */ jsxs105("div", { children: [
|
|
21396
21685
|
/* @__PURE__ */ jsx106("h3", { className: "fc:text-sm fc:font-extrabold fc:text-slate-900", children: section.title }),
|
|
21397
21686
|
/* @__PURE__ */ jsxs105("p", { className: "fc:text-[11px] fc:text-slate-400 fc:mt-0.5", children: [
|
|
21398
|
-
section.files.length,
|
|
21687
|
+
(_e = (_d = section.files) == null ? void 0 : _d.length) != null ? _e : 0,
|
|
21399
21688
|
" files"
|
|
21400
21689
|
] })
|
|
21401
21690
|
] }),
|
|
@@ -21407,11 +21696,11 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
|
|
|
21407
21696
|
/* @__PURE__ */ jsxs105("div", { children: [
|
|
21408
21697
|
/* @__PURE__ */ jsx106("h3", { className: "fc:text-sm fc:font-extrabold fc:text-slate-900", children: section.title }),
|
|
21409
21698
|
/* @__PURE__ */ jsxs105("p", { className: "fc:text-[11px] fc:text-slate-400 fc:mt-0.5", children: [
|
|
21410
|
-
((
|
|
21699
|
+
((_f = section.fields) == null ? void 0 : _f.length) || 0,
|
|
21411
21700
|
" fields"
|
|
21412
21701
|
] })
|
|
21413
21702
|
] }),
|
|
21414
|
-
displayData.layout.collapsibleSections && /* @__PURE__ */ jsx106(
|
|
21703
|
+
((_g = displayData.layout) == null ? void 0 : _g.collapsibleSections) && /* @__PURE__ */ jsx106(
|
|
21415
21704
|
"button",
|
|
21416
21705
|
{
|
|
21417
21706
|
type: "button",
|
|
@@ -21421,7 +21710,7 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
|
|
|
21421
21710
|
}
|
|
21422
21711
|
)
|
|
21423
21712
|
] }),
|
|
21424
|
-
(!displayData.layout.collapsibleSections || expandedSections[section.id]) && /* @__PURE__ */ jsx106("div", { className: `fc:grid fc:gap-3 ${isMax ? "fc:grid-cols-3" : "fc:grid-cols-2"}`, children: (
|
|
21713
|
+
(!((_h = displayData.layout) == null ? void 0 : _h.collapsibleSections) || expandedSections[section.id]) && /* @__PURE__ */ jsx106("div", { className: `fc:grid fc:gap-3 ${isMax ? "fc:grid-cols-3" : "fc:grid-cols-2"}`, children: (_i = section.fields) == null ? void 0 : _i.map((field) => /* @__PURE__ */ jsx106(FieldCard, { field }, field.id)) })
|
|
21425
21714
|
] }, section.id);
|
|
21426
21715
|
}) })
|
|
21427
21716
|
] });
|
|
@@ -21430,6 +21719,7 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
|
|
|
21430
21719
|
// src/components/inbox/FileDetailsTab.jsx
|
|
21431
21720
|
import { jsx as jsx107, jsxs as jsxs106 } from "react/jsx-runtime";
|
|
21432
21721
|
function FileDetailsTab({
|
|
21722
|
+
fileNo,
|
|
21433
21723
|
fileHistory,
|
|
21434
21724
|
isLoadingFileHistory,
|
|
21435
21725
|
fileHistoryError,
|
|
@@ -21456,6 +21746,7 @@ function FileDetailsTab({
|
|
|
21456
21746
|
/* @__PURE__ */ jsx107("div", { style: { minWidth: 0 }, children: /* @__PURE__ */ jsx107(
|
|
21457
21747
|
DynamicFormDisplay,
|
|
21458
21748
|
{
|
|
21749
|
+
fileNo,
|
|
21459
21750
|
maximized: isMaximized,
|
|
21460
21751
|
onToggleMaximize: () => setIsMaximized(!isMaximized)
|
|
21461
21752
|
}
|
|
@@ -21572,168 +21863,6 @@ function FileDetailsTab({
|
|
|
21572
21863
|
// src/components/inbox/MovementDetailModal.jsx
|
|
21573
21864
|
import React108 from "react";
|
|
21574
21865
|
import { RiHistoryLine as RiHistoryLine2, RiCloseLine as RiCloseLine5, RiFileTextLine as RiFileTextLine5 } from "@remixicon/react";
|
|
21575
|
-
|
|
21576
|
-
// src/components/inbox/reviewHelpers.js
|
|
21577
|
-
var getAvailableActions2 = (response) => {
|
|
21578
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
21579
|
-
const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
|
|
21580
|
-
const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
|
|
21581
|
-
return rows.map((action) => {
|
|
21582
|
-
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
21583
|
-
return {
|
|
21584
|
-
label: (_d2 = (_c2 = (_b2 = (_a2 = action.label) != null ? _a2 : action.Label) != null ? _b2 : action.actionName) != null ? _c2 : action.ActionName) != null ? _d2 : "",
|
|
21585
|
-
actionCode: (_f2 = (_e2 = action.actionCode) != null ? _e2 : action.ActionCode) != null ? _f2 : ""
|
|
21586
|
-
};
|
|
21587
|
-
}).filter((action) => action.label && action.actionCode);
|
|
21588
|
-
};
|
|
21589
|
-
var getWorkflowStepsStatusEndpoint = () => {
|
|
21590
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
21591
|
-
const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
|
|
21592
|
-
const endpoint3 = (_k = (_j = (_i = (_g = (_e = (_c = flowCore.getWorkflowStepsBarStatus) == null ? void 0 : _c.getStatus) != null ? _e : (_d = flowCore.workflowStepsBarStatus) == null ? void 0 : _d.getStatus) != null ? _g : (_f = flowCore.GetWorkflowStepsBarStatus) == null ? void 0 : _f.GetStatus) != null ? _i : (_h = flowCore.GetWorkflowStepsBarStatus) == null ? void 0 : _h.getStatus) != null ? _j : flowCore.GetWorkflowStepsBarStatus) != null ? _k : flowCore.getWorkflowStepsBarStatus;
|
|
21593
|
-
if (!endpoint3) throw new Error("Workflow steps bar status endpoint is not configured.");
|
|
21594
|
-
return endpoint3;
|
|
21595
|
-
};
|
|
21596
|
-
var getWorkflowSteps = (response) => {
|
|
21597
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
21598
|
-
const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
|
|
21599
|
-
const steps = (_g = (_f = value == null ? void 0 : value.steps) != null ? _f : value == null ? void 0 : value.Steps) != null ? _g : [];
|
|
21600
|
-
return Array.isArray(steps) ? [...steps].sort((first, second) => {
|
|
21601
|
-
var _a2, _b2, _c2, _d2;
|
|
21602
|
-
return Number((_b2 = (_a2 = first.sequenceNo) != null ? _a2 : first.SequenceNo) != null ? _b2 : 0) - Number((_d2 = (_c2 = second.sequenceNo) != null ? _c2 : second.SequenceNo) != null ? _d2 : 0);
|
|
21603
|
-
}) : [];
|
|
21604
|
-
};
|
|
21605
|
-
var getFileHistoryEndpoint = () => {
|
|
21606
|
-
var _a, _b, _c, _d, _e;
|
|
21607
|
-
const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
|
|
21608
|
-
const configured = (_c = flowCore.getFileHistory) != null ? _c : flowCore.GetFileHistory;
|
|
21609
|
-
const endpoint3 = (_e = (_d = configured == null ? void 0 : configured.getFileHistory) != null ? _d : configured == null ? void 0 : configured.GetFileHistory) != null ? _e : configured;
|
|
21610
|
-
if (!endpoint3) throw new Error("Get File History endpoint is not configured.");
|
|
21611
|
-
return endpoint3;
|
|
21612
|
-
};
|
|
21613
|
-
var getDocumentHistoryEndpoint = () => {
|
|
21614
|
-
var _a, _b, _c, _d, _e;
|
|
21615
|
-
const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
|
|
21616
|
-
const configured = (_c = flowCore.getDocumentAndWorkFlow) != null ? _c : flowCore.GetDocumentAndWorkFlow;
|
|
21617
|
-
const endpoint3 = (_e = (_d = configured == null ? void 0 : configured.getDocumentHistoryByHistoryId) != null ? _d : configured == null ? void 0 : configured.GetDocumentHistoryByHistoryId) != null ? _e : configured;
|
|
21618
|
-
if (!endpoint3) throw new Error("Document history details endpoint is not configured.");
|
|
21619
|
-
return endpoint3;
|
|
21620
|
-
};
|
|
21621
|
-
var getConfigValue = (source, key) => {
|
|
21622
|
-
if (!source || typeof source !== "object") return void 0;
|
|
21623
|
-
const matchingKey = Object.keys(source).find((candidate) => candidate.toLowerCase() === key.toLowerCase());
|
|
21624
|
-
return matchingKey ? source[matchingKey] : void 0;
|
|
21625
|
-
};
|
|
21626
|
-
var findConfigEntry = (source, key, path = [], visited = /* @__PURE__ */ new WeakSet()) => {
|
|
21627
|
-
if (!source || typeof source !== "object" || visited.has(source)) return null;
|
|
21628
|
-
visited.add(source);
|
|
21629
|
-
const entries = Object.entries(source);
|
|
21630
|
-
const matchingEntry = entries.find(([candidate]) => candidate.toLowerCase() === key.toLowerCase());
|
|
21631
|
-
if (matchingEntry) return { value: matchingEntry[1], path: [...path, matchingEntry[0]] };
|
|
21632
|
-
for (const [candidate, value] of entries) {
|
|
21633
|
-
const result = findConfigEntry(value, key, [...path, candidate], visited);
|
|
21634
|
-
if (result) return result;
|
|
21635
|
-
}
|
|
21636
|
-
return null;
|
|
21637
|
-
};
|
|
21638
|
-
var getStepDocumentsEndpoint = () => {
|
|
21639
|
-
var _a, _b, _c;
|
|
21640
|
-
const suppliedEndpoints = getApiEndpoints();
|
|
21641
|
-
const root = (_a = getConfigValue(suppliedEndpoints, "apiEndpoints")) != null ? _a : suppliedEndpoints;
|
|
21642
|
-
const flowCore = (_b = getConfigValue(root, "flowCore")) != null ? _b : root;
|
|
21643
|
-
const inbox = getConfigValue(flowCore, "inbox");
|
|
21644
|
-
const documentConfiguration = getConfigValue(flowCore, "documentConfiguration");
|
|
21645
|
-
const configuredEndpoint = (_c = getConfigValue(inbox, "getDocumentsByWorkFlowStepId")) != null ? _c : getConfigValue(documentConfiguration, "getDocumentsByWorkFlowStepId");
|
|
21646
|
-
const endpoint3 = configuredEndpoint ? { value: configuredEndpoint, path: ["flowCore", "inbox", "getDocumentsByWorkFlowStepId"] } : findConfigEntry(suppliedEndpoints, "getDocumentsByWorkFlowStepId");
|
|
21647
|
-
if (!(endpoint3 == null ? void 0 : endpoint3.value)) {
|
|
21648
|
-
const configKeys = Object.keys(flowCore != null ? flowCore : {}).join(", ") || "none";
|
|
21649
|
-
const inboxKeys = Object.keys(inbox != null ? inbox : {}).join(", ") || "none";
|
|
21650
|
-
throw new Error(`Documents endpoint missing at runtime. flowCore keys: ${configKeys}. inbox keys: ${inboxKeys}.`);
|
|
21651
|
-
}
|
|
21652
|
-
if (typeof endpoint3.value !== "string" && typeof endpoint3.value !== "function") {
|
|
21653
|
-
throw new Error(`Configured document endpoint at ${endpoint3.path.join(".")} must be a URL string or function.`);
|
|
21654
|
-
}
|
|
21655
|
-
return endpoint3.value;
|
|
21656
|
-
};
|
|
21657
|
-
var getUploadDocumentEndpoint = () => {
|
|
21658
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
21659
|
-
const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
|
|
21660
|
-
const execution = (_c = flowCore.workflowExecution) != null ? _c : flowCore.WorkflowExecution;
|
|
21661
|
-
const endpoint3 = (_l = (_j = (_h = (_f = (_d = execution == null ? void 0 : execution.uploadDocument) != null ? _d : execution == null ? void 0 : execution.UploadDocument) != null ? _f : (_e = flowCore.inbox) == null ? void 0 : _e.uploadDocument) != null ? _h : (_g = flowCore.inbox) == null ? void 0 : _g.UploadDocument) != null ? _j : (_i = flowCore.Inbox) == null ? void 0 : _i.uploadDocument) != null ? _l : (_k = flowCore.Inbox) == null ? void 0 : _k.UploadDocument;
|
|
21662
|
-
if (!endpoint3) throw new Error("Workflow document upload endpoint is not configured.");
|
|
21663
|
-
return endpoint3;
|
|
21664
|
-
};
|
|
21665
|
-
var getConfiguredDocuments = (response) => {
|
|
21666
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
21667
|
-
const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
|
|
21668
|
-
const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
|
|
21669
|
-
return rows.map((document2) => {
|
|
21670
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l;
|
|
21671
|
-
return __spreadProps(__spreadValues({}, document2), {
|
|
21672
|
-
documentConfigurationId: Number((_b2 = (_a2 = document2.documentConfigurationId) != null ? _a2 : document2.DocumentConfigurationId) != null ? _b2 : document2.id),
|
|
21673
|
-
documentName: (_d2 = (_c2 = document2.documentName) != null ? _c2 : document2.DocumentName) != null ? _d2 : "Document",
|
|
21674
|
-
allowedExtensions: (_f2 = (_e2 = document2.allowedExtensions) != null ? _e2 : document2.AllowedExtensions) != null ? _f2 : "",
|
|
21675
|
-
maxSizeMB: Number((_h = (_g2 = document2.maxSizeMB) != null ? _g2 : document2.MaxSizeMB) != null ? _h : 0),
|
|
21676
|
-
isMandatory: Boolean((_j = (_i = document2.isMandatory) != null ? _i : document2.IsMandatory) != null ? _j : false),
|
|
21677
|
-
isActive: Boolean((_l = (_k = document2.isActive) != null ? _k : document2.IsActive) != null ? _l : true)
|
|
21678
|
-
});
|
|
21679
|
-
}).filter((document2) => Number.isInteger(document2.documentConfigurationId) && document2.isActive);
|
|
21680
|
-
};
|
|
21681
|
-
var getDocumentAcceptValue = (extensions) => String(extensions != null ? extensions : "").split(/[,;\s]+/).map((extension) => extension.trim().toLowerCase()).filter(Boolean).map((extension) => extension.startsWith(".") ? extension : `.${extension}`).join(",");
|
|
21682
|
-
var getFileHistoryMovements = (response) => {
|
|
21683
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
21684
|
-
const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
|
|
21685
|
-
const movements = (_g = (_f = value == null ? void 0 : value.movements) != null ? _f : value == null ? void 0 : value.Movements) != null ? _g : [];
|
|
21686
|
-
return Array.isArray(movements) ? movements : [];
|
|
21687
|
-
};
|
|
21688
|
-
var formatMovementDate = (value) => {
|
|
21689
|
-
if (!value) return "-";
|
|
21690
|
-
const date = new Date(value);
|
|
21691
|
-
return Number.isNaN(date.getTime()) ? String(value) : date.toLocaleString("en-GB", {
|
|
21692
|
-
day: "2-digit",
|
|
21693
|
-
month: "short",
|
|
21694
|
-
year: "numeric",
|
|
21695
|
-
hour: "2-digit",
|
|
21696
|
-
minute: "2-digit"
|
|
21697
|
-
});
|
|
21698
|
-
};
|
|
21699
|
-
var mapFileHistoryMovement = (movement, index) => {
|
|
21700
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
21701
|
-
const actionCode = String((_d = (_c = (_b = (_a = movement.actionCode) != null ? _a : movement.ActionCode) != null ? _b : movement.actionName) != null ? _c : movement.ActionName) != null ? _d : "Action");
|
|
21702
|
-
const normalizedAction = actionCode.toUpperCase().replace(/[\s-]/g, "_");
|
|
21703
|
-
const isReturn = normalizedAction.includes("RETURN") || normalizedAction === "PULL";
|
|
21704
|
-
const isResubmit = normalizedAction.includes("RESUBMIT");
|
|
21705
|
-
const isSubmit = !isResubmit && normalizedAction.includes("SUBMIT");
|
|
21706
|
-
const status = isReturn ? "Returned to Applicant" : isResubmit ? "Resubmitted" : isSubmit ? "Submitted" : normalizedAction.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (letter) => letter.toUpperCase());
|
|
21707
|
-
const applicantActor = isResubmit || movement.applicantName && !movement.officialName;
|
|
21708
|
-
const userName = (_l = (_k = (_j = (_i = (_h = (_g = (_f = (_e = movement.userregistrationName) != null ? _e : movement.UserRegistrationName) != null ? _f : movement.UserName) != null ? _g : movement.userName) != null ? _h : applicantActor ? movement.applicantName : movement.officialName) != null ? _i : movement.officialName) != null ? _j : movement.applicantName) != null ? _k : movement.performedBy) != null ? _l : "Unknown user";
|
|
21709
|
-
const comments = (_p = (_o = (_n = (_m = movement.officialComment) != null ? _m : movement.applicantComment) != null ? _n : movement.comments) != null ? _o : movement.Comments) != null ? _p : "-";
|
|
21710
|
-
const stepId = (_q = movement.fromWorkflowStepId) != null ? _q : movement.FromWorkflowStepId;
|
|
21711
|
-
const stepName = (_s = (_r = movement.workflowStepName) != null ? _r : movement.WorkflowStepName) != null ? _s : "";
|
|
21712
|
-
return {
|
|
21713
|
-
id: (_u = (_t = movement.movementHistoryId) != null ? _t : movement.MovementHistoryId) != null ? _u : index + 1,
|
|
21714
|
-
type: isReturn ? "return" : isSubmit ? "submit" : isResubmit ? "resubmit" : "forward",
|
|
21715
|
-
date: formatMovementDate((_v = movement.movedOn) != null ? _v : movement.MovedOn),
|
|
21716
|
-
userName,
|
|
21717
|
-
userRole: applicantActor ? "Applicant" : "Official",
|
|
21718
|
-
status,
|
|
21719
|
-
stepNum: stepId != null && Number(stepId) > 0 ? `Step ${stepId}` : null,
|
|
21720
|
-
stepName: stepName || null,
|
|
21721
|
-
remarks: comments,
|
|
21722
|
-
isAlert: isReturn,
|
|
21723
|
-
isCurrent: false,
|
|
21724
|
-
title: status,
|
|
21725
|
-
by: `By ${userName}${applicantActor ? " (Applicant)" : ""}`
|
|
21726
|
-
};
|
|
21727
|
-
};
|
|
21728
|
-
var DEFAULT_ACTIONS = [
|
|
21729
|
-
{ label: "Approve kro", actionCode: "APPROVE" },
|
|
21730
|
-
{ label: "Reject", actionCode: "REJECT" },
|
|
21731
|
-
{ label: "Forward", actionCode: "FORWARD" },
|
|
21732
|
-
{ label: "Free Forward", actionCode: "FREE_FORWARD" },
|
|
21733
|
-
{ label: "Return To Applicant", actionCode: "RETURN_TO_APPLICANT" }
|
|
21734
|
-
];
|
|
21735
|
-
|
|
21736
|
-
// src/components/inbox/MovementDetailModal.jsx
|
|
21737
21866
|
import { Fragment as Fragment8, jsx as jsx108, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
21738
21867
|
function MovementDetailModal({
|
|
21739
21868
|
selectedHistoryItem,
|
|
@@ -21880,7 +22009,7 @@ function MovementDetailModal({
|
|
|
21880
22009
|
}
|
|
21881
22010
|
|
|
21882
22011
|
// src/components/inbox/TakeActionPanel.jsx
|
|
21883
|
-
import React109, { useState as
|
|
22012
|
+
import React109, { useState as useState78, useEffect as useEffect58, useRef as useRef27 } from "react";
|
|
21884
22013
|
import Swal30 from "sweetalert2";
|
|
21885
22014
|
import {
|
|
21886
22015
|
RiCloseLine as RiCloseLine6,
|
|
@@ -21902,24 +22031,24 @@ function TakeActionPanel({
|
|
|
21902
22031
|
onMinimize
|
|
21903
22032
|
}) {
|
|
21904
22033
|
var _a;
|
|
21905
|
-
const [actions, setActions] =
|
|
21906
|
-
const [actionCode, setActionCode] =
|
|
21907
|
-
const [remarks, setRemarks] =
|
|
21908
|
-
const [isSubmitting, setIsSubmitting] =
|
|
21909
|
-
const [editableFields, setEditableFields] =
|
|
21910
|
-
const [selectedEditableFields, setSelectedEditableFields] =
|
|
21911
|
-
const [isLoadingEditableFields, setIsLoadingEditableFields] =
|
|
21912
|
-
const [editableFieldsError, setEditableFieldsError] =
|
|
21913
|
-
const [officialDocuments, setOfficialDocuments] =
|
|
21914
|
-
const [isLoadingOfficialDocuments, setIsLoadingOfficialDocuments] =
|
|
21915
|
-
const [officialDocumentsError, setOfficialDocumentsError] =
|
|
21916
|
-
const [uploadedDocuments, setUploadedDocuments] =
|
|
21917
|
-
const [uploadingDocumentId, setUploadingDocumentId] =
|
|
21918
|
-
const [documentUploadErrors, setDocumentUploadErrors] =
|
|
21919
|
-
const documentInputRefs =
|
|
22034
|
+
const [actions, setActions] = useState78(DEFAULT_ACTIONS);
|
|
22035
|
+
const [actionCode, setActionCode] = useState78("RETURN_TO_APPLICANT");
|
|
22036
|
+
const [remarks, setRemarks] = useState78("");
|
|
22037
|
+
const [isSubmitting, setIsSubmitting] = useState78(false);
|
|
22038
|
+
const [editableFields, setEditableFields] = useState78([]);
|
|
22039
|
+
const [selectedEditableFields, setSelectedEditableFields] = useState78([]);
|
|
22040
|
+
const [isLoadingEditableFields, setIsLoadingEditableFields] = useState78(false);
|
|
22041
|
+
const [editableFieldsError, setEditableFieldsError] = useState78("");
|
|
22042
|
+
const [officialDocuments, setOfficialDocuments] = useState78([]);
|
|
22043
|
+
const [isLoadingOfficialDocuments, setIsLoadingOfficialDocuments] = useState78(false);
|
|
22044
|
+
const [officialDocumentsError, setOfficialDocumentsError] = useState78("");
|
|
22045
|
+
const [uploadedDocuments, setUploadedDocuments] = useState78([]);
|
|
22046
|
+
const [uploadingDocumentId, setUploadingDocumentId] = useState78(null);
|
|
22047
|
+
const [documentUploadErrors, setDocumentUploadErrors] = useState78({});
|
|
22048
|
+
const documentInputRefs = useRef27({});
|
|
21920
22049
|
const selectedAction = actions.find((a) => a.actionCode === actionCode);
|
|
21921
22050
|
const isReturnToApplicant = ((_a = selectedAction == null ? void 0 : selectedAction.label) == null ? void 0 : _a.toLowerCase().includes("return")) || ["PULL", "RETURN_TO_APPLICANT"].includes(actionCode == null ? void 0 : actionCode.toUpperCase());
|
|
21922
|
-
|
|
22051
|
+
useEffect58(() => {
|
|
21923
22052
|
let isCurrent = true;
|
|
21924
22053
|
(async () => {
|
|
21925
22054
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
@@ -21944,7 +22073,7 @@ function TakeActionPanel({
|
|
|
21944
22073
|
isCurrent = false;
|
|
21945
22074
|
};
|
|
21946
22075
|
}, [workflowStepId, activeWorkflowStepId]);
|
|
21947
|
-
|
|
22076
|
+
useEffect58(() => {
|
|
21948
22077
|
if (!isReturnToApplicant) {
|
|
21949
22078
|
setEditableFields([]);
|
|
21950
22079
|
setSelectedEditableFields([]);
|
|
@@ -21973,7 +22102,7 @@ function TakeActionPanel({
|
|
|
21973
22102
|
isCurrent = false;
|
|
21974
22103
|
};
|
|
21975
22104
|
}, [isReturnToApplicant]);
|
|
21976
|
-
|
|
22105
|
+
useEffect58(() => {
|
|
21977
22106
|
const normalizedStepId = Number(workflowStepId);
|
|
21978
22107
|
setOfficialDocuments([]);
|
|
21979
22108
|
setUploadedDocuments([]);
|
|
@@ -22482,23 +22611,24 @@ function ReviewApplication({
|
|
|
22482
22611
|
onSelectWorkflowStepId,
|
|
22483
22612
|
onBackToInbox,
|
|
22484
22613
|
onSubmitAction,
|
|
22485
|
-
refreshKey
|
|
22614
|
+
refreshKey,
|
|
22615
|
+
userName
|
|
22486
22616
|
}) {
|
|
22487
22617
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
22488
|
-
const [activeTab, setActiveTab] =
|
|
22489
|
-
const [showAllMovements, setShowAllMovements] =
|
|
22490
|
-
const [isApplicantFormMaximized, setIsApplicantFormMaximized] =
|
|
22491
|
-
const [isTakeActionMinimized, setIsTakeActionMinimized] =
|
|
22492
|
-
const [workflowSteps, setWorkflowSteps] =
|
|
22493
|
-
const [isLoadingWorkflowSteps, setIsLoadingWorkflowSteps] =
|
|
22494
|
-
const [workflowStepsError, setWorkflowStepsError] =
|
|
22495
|
-
const [fileHistory, setFileHistory] =
|
|
22496
|
-
const [isLoadingFileHistory, setIsLoadingFileHistory] =
|
|
22497
|
-
const [fileHistoryError, setFileHistoryError] =
|
|
22498
|
-
const [selectedHistoryItem, setSelectedHistoryItem] =
|
|
22499
|
-
const [historyDetail, setHistoryDetail] =
|
|
22500
|
-
const [historyDetailError, setHistoryDetailError] =
|
|
22501
|
-
const [isLoadingHistoryDetail, setIsLoadingHistoryDetail] =
|
|
22618
|
+
const [activeTab, setActiveTab] = useState79("workflowHistory");
|
|
22619
|
+
const [showAllMovements, setShowAllMovements] = useState79(false);
|
|
22620
|
+
const [isApplicantFormMaximized, setIsApplicantFormMaximized] = useState79(false);
|
|
22621
|
+
const [isTakeActionMinimized, setIsTakeActionMinimized] = useState79(false);
|
|
22622
|
+
const [workflowSteps, setWorkflowSteps] = useState79([]);
|
|
22623
|
+
const [isLoadingWorkflowSteps, setIsLoadingWorkflowSteps] = useState79(false);
|
|
22624
|
+
const [workflowStepsError, setWorkflowStepsError] = useState79("");
|
|
22625
|
+
const [fileHistory, setFileHistory] = useState79([]);
|
|
22626
|
+
const [isLoadingFileHistory, setIsLoadingFileHistory] = useState79(false);
|
|
22627
|
+
const [fileHistoryError, setFileHistoryError] = useState79("");
|
|
22628
|
+
const [selectedHistoryItem, setSelectedHistoryItem] = useState79(null);
|
|
22629
|
+
const [historyDetail, setHistoryDetail] = useState79(null);
|
|
22630
|
+
const [historyDetailError, setHistoryDetailError] = useState79("");
|
|
22631
|
+
const [isLoadingHistoryDetail, setIsLoadingHistoryDetail] = useState79(false);
|
|
22502
22632
|
const fileNo = file == null ? void 0 : file.fileNo;
|
|
22503
22633
|
const subject = (file == null ? void 0 : file.subject) || "ElectionPetition #41";
|
|
22504
22634
|
const department = (file == null ? void 0 : file.department) && file.department !== "-" ? file.department : "Nodal 19";
|
|
@@ -22508,7 +22638,7 @@ function ReviewApplication({
|
|
|
22508
22638
|
const createdOn = (file == null ? void 0 : file.receivedDate) && file.receivedDate !== "-" ? file.receivedDate : "01 Oct 2026, 10:24 AM";
|
|
22509
22639
|
const workflowStepId = (_b = (_a = file == null ? void 0 : file.workflowStepId) != null ? _a : file == null ? void 0 : file.WorkflowStepId) != null ? _b : activeWorkflowStepId;
|
|
22510
22640
|
const fileInstanceId = (_g = (_e = (_c = file == null ? void 0 : file.fileInstanceId) != null ? _c : file == null ? void 0 : file.FileInstanceId) != null ? _e : (_d = file == null ? void 0 : file.fileInstance) == null ? void 0 : _d.fileInstanceId) != null ? _g : (_f = file == null ? void 0 : file.FileInstance) == null ? void 0 : _f.FileInstanceId;
|
|
22511
|
-
|
|
22641
|
+
useEffect59(() => {
|
|
22512
22642
|
if (!workflowStepId) {
|
|
22513
22643
|
setWorkflowSteps([]);
|
|
22514
22644
|
setWorkflowStepsError("Workflow step ID is unavailable.");
|
|
@@ -22539,7 +22669,7 @@ function ReviewApplication({
|
|
|
22539
22669
|
};
|
|
22540
22670
|
}, [workflowStepId]);
|
|
22541
22671
|
const historyNeeded = activeTab === "workflowHistory" || activeTab === "fileDetails";
|
|
22542
|
-
|
|
22672
|
+
useEffect59(() => {
|
|
22543
22673
|
if (!historyNeeded) return void 0;
|
|
22544
22674
|
const normalizedFileInstanceId = Number(fileInstanceId);
|
|
22545
22675
|
if (!Number.isInteger(normalizedFileInstanceId) || normalizedFileInstanceId <= 0) {
|
|
@@ -22615,7 +22745,8 @@ function ReviewApplication({
|
|
|
22615
22745
|
activeStepName,
|
|
22616
22746
|
assignedSteps,
|
|
22617
22747
|
onSelectWorkflowStepId,
|
|
22618
|
-
refreshKey
|
|
22748
|
+
refreshKey,
|
|
22749
|
+
userName
|
|
22619
22750
|
}
|
|
22620
22751
|
),
|
|
22621
22752
|
/* @__PURE__ */ jsxs109("div", { className: "fc:p-3 md:fc:p-4 fc:flex fc:flex-row fc:gap-4 fc:items-start fc:w-full fc:min-w-0", children: [
|
|
@@ -22681,6 +22812,7 @@ function ReviewApplication({
|
|
|
22681
22812
|
activeTab === "fileDetails" && /* @__PURE__ */ jsx110(
|
|
22682
22813
|
FileDetailsTab,
|
|
22683
22814
|
{
|
|
22815
|
+
fileNo,
|
|
22684
22816
|
fileHistory,
|
|
22685
22817
|
isLoadingFileHistory,
|
|
22686
22818
|
fileHistoryError,
|
|
@@ -22837,29 +22969,30 @@ function InboxMain({
|
|
|
22837
22969
|
const headerTitle = title || ((allowedTabs == null ? void 0 : allowedTabs.length) === 1 && allowedTabs[0] === "myFiles" ? "My Files" : (allowedTabs == null ? void 0 : allowedTabs.length) === 1 && allowedTabs[0] === "filePool" ? "Unclaimed Files" : (allowedTabs == null ? void 0 : allowedTabs.length) === 1 && allowedTabs[0] === "totalFiles" ? "Completed Files" : "Inbox");
|
|
22838
22970
|
const headerSubtitle = subtitle || ((allowedTabs == null ? void 0 : allowedTabs.length) === 1 && allowedTabs[0] === "myFiles" ? "View and process files currently assigned to your queue" : (allowedTabs == null ? void 0 : allowedTabs.length) === 1 && allowedTabs[0] === "filePool" ? "Available files in the pool waiting to be claimed" : (allowedTabs == null ? void 0 : allowedTabs.length) === 1 && allowedTabs[0] === "totalFiles" ? "Archive of all completed and processed workflow files" : "Manage, claim, and process workflow files across stages");
|
|
22839
22971
|
const headerIconBg = iconBg || ((allowedTabs == null ? void 0 : allowedTabs.length) === 1 && allowedTabs[0] === "myFiles" ? "fc:bg-gradient-to-br fc:from-emerald-500 fc:to-teal-600" : (allowedTabs == null ? void 0 : allowedTabs.length) === 1 && allowedTabs[0] === "filePool" ? "fc:bg-gradient-to-br fc:from-blue-600 fc:to-indigo-600" : (allowedTabs == null ? void 0 : allowedTabs.length) === 1 && allowedTabs[0] === "totalFiles" ? "fc:bg-gradient-to-br fc:from-slate-700 fc:to-slate-900" : "fc:bg-gradient-to-br fc:from-blue-600 fc:to-indigo-600");
|
|
22840
|
-
const [activeTab, setActiveTab] =
|
|
22841
|
-
const [viewMode, setViewMode] =
|
|
22842
|
-
const [reviewingFile, setReviewingFile] =
|
|
22843
|
-
|
|
22972
|
+
const [activeTab, setActiveTab] = useState80(initialTab);
|
|
22973
|
+
const [viewMode, setViewMode] = useState80(initialView);
|
|
22974
|
+
const [reviewingFile, setReviewingFile] = useState80(null);
|
|
22975
|
+
useEffect60(() => {
|
|
22844
22976
|
if (initialTab) setActiveTab(initialTab);
|
|
22845
22977
|
}, [initialTab]);
|
|
22846
|
-
|
|
22978
|
+
useEffect60(() => {
|
|
22847
22979
|
if (initialView) setViewMode(initialView);
|
|
22848
22980
|
}, [initialView]);
|
|
22849
|
-
const
|
|
22850
|
-
const [
|
|
22851
|
-
const [
|
|
22852
|
-
const
|
|
22981
|
+
const { userName, initial: userInitial } = useUserProfile();
|
|
22982
|
+
const [assignedSteps, setAssignedSteps] = useState80([]);
|
|
22983
|
+
const [activeWorkflowStepId, setActiveWorkflowStepId] = useState80(null);
|
|
22984
|
+
const [roleDropdownOpen, setRoleDropdownOpen] = useState80(false);
|
|
22985
|
+
const roleDropdownRef = useRef28(null);
|
|
22853
22986
|
const activeRoleDetails = assignedSteps.find(
|
|
22854
22987
|
(step) => Number(step.workflowStepId) === Number(activeWorkflowStepId)
|
|
22855
22988
|
);
|
|
22856
22989
|
const activeRole = (activeRoleDetails == null ? void 0 : activeRoleDetails.stepName) || "No Assigned Step";
|
|
22857
|
-
const [filePoolFiles, setFilePoolFiles] =
|
|
22858
|
-
const [myFiles, setMyFiles] =
|
|
22859
|
-
const [totalFiles, setTotalFiles] =
|
|
22860
|
-
const [refreshKey, setRefreshKey] =
|
|
22861
|
-
const [isUnclaiming, setIsUnclaiming] =
|
|
22862
|
-
|
|
22990
|
+
const [filePoolFiles, setFilePoolFiles] = useState80([]);
|
|
22991
|
+
const [myFiles, setMyFiles] = useState80([]);
|
|
22992
|
+
const [totalFiles, setTotalFiles] = useState80([]);
|
|
22993
|
+
const [refreshKey, setRefreshKey] = useState80(0);
|
|
22994
|
+
const [isUnclaiming, setIsUnclaiming] = useState80(false);
|
|
22995
|
+
useEffect60(() => {
|
|
22863
22996
|
let isCurrent = true;
|
|
22864
22997
|
const loadAssignedSteps = async () => {
|
|
22865
22998
|
var _a, _b;
|
|
@@ -22918,7 +23051,7 @@ function InboxMain({
|
|
|
22918
23051
|
isCurrent = false;
|
|
22919
23052
|
};
|
|
22920
23053
|
}, []);
|
|
22921
|
-
|
|
23054
|
+
useEffect60(() => {
|
|
22922
23055
|
let isCurrent = true;
|
|
22923
23056
|
const loadStepFiles = async () => {
|
|
22924
23057
|
var _a, _b;
|
|
@@ -22977,30 +23110,30 @@ function InboxMain({
|
|
|
22977
23110
|
isCurrent = false;
|
|
22978
23111
|
};
|
|
22979
23112
|
}, [activeWorkflowStepId, refreshKey]);
|
|
22980
|
-
const [dynamicColumns, setDynamicColumns] =
|
|
23113
|
+
const [dynamicColumns, setDynamicColumns] = useState80([
|
|
22981
23114
|
{ key: "department", label: "Department", width: "190px", visible: true },
|
|
22982
23115
|
{ key: "applicant", label: "Applicant / Entity", width: "210px", visible: true },
|
|
22983
23116
|
{ key: "category", label: "Category / Type", width: "170px", visible: true },
|
|
22984
23117
|
{ key: "financialYear", label: "Financial Year", width: "120px", visible: true }
|
|
22985
23118
|
]);
|
|
22986
|
-
const [columnDropdownOpen, setColumnDropdownOpen] =
|
|
22987
|
-
const columnDropdownRef =
|
|
22988
|
-
const [searchQuery, setSearchQuery] =
|
|
22989
|
-
const [priorityFilter, setPriorityFilter] =
|
|
22990
|
-
const [pageSize, setPageSize] =
|
|
22991
|
-
const [currentPage, setCurrentPage] =
|
|
22992
|
-
const [sortColumn, setSortColumn] =
|
|
22993
|
-
const [sortDirection, setSortDirection] =
|
|
22994
|
-
const [poolModalOpen, setPoolModalOpen] =
|
|
22995
|
-
const [selectedPoolFile, setSelectedPoolFile] =
|
|
22996
|
-
const [isClaimingPool, setIsClaimingPool] =
|
|
22997
|
-
const [actionModalOpen, setActionModalOpen] =
|
|
22998
|
-
const [selectedActionFile, setSelectedActionFile] =
|
|
22999
|
-
const [viewModalOpen, setViewModalOpen] =
|
|
23000
|
-
const [selectedViewFile, setSelectedViewFile] =
|
|
23001
|
-
const tableRef =
|
|
23002
|
-
const [hoveredFileCard, setHoveredFileCard] =
|
|
23003
|
-
const [hoverTimeoutId, setHoverTimeoutId] =
|
|
23119
|
+
const [columnDropdownOpen, setColumnDropdownOpen] = useState80(false);
|
|
23120
|
+
const columnDropdownRef = useRef28(null);
|
|
23121
|
+
const [searchQuery, setSearchQuery] = useState80("");
|
|
23122
|
+
const [priorityFilter, setPriorityFilter] = useState80("all");
|
|
23123
|
+
const [pageSize, setPageSize] = useState80(10);
|
|
23124
|
+
const [currentPage, setCurrentPage] = useState80(1);
|
|
23125
|
+
const [sortColumn, setSortColumn] = useState80("");
|
|
23126
|
+
const [sortDirection, setSortDirection] = useState80("asc");
|
|
23127
|
+
const [poolModalOpen, setPoolModalOpen] = useState80(false);
|
|
23128
|
+
const [selectedPoolFile, setSelectedPoolFile] = useState80(null);
|
|
23129
|
+
const [isClaimingPool, setIsClaimingPool] = useState80(false);
|
|
23130
|
+
const [actionModalOpen, setActionModalOpen] = useState80(false);
|
|
23131
|
+
const [selectedActionFile, setSelectedActionFile] = useState80(null);
|
|
23132
|
+
const [viewModalOpen, setViewModalOpen] = useState80(false);
|
|
23133
|
+
const [selectedViewFile, setSelectedViewFile] = useState80(null);
|
|
23134
|
+
const tableRef = useRef28(null);
|
|
23135
|
+
const [hoveredFileCard, setHoveredFileCard] = useState80(null);
|
|
23136
|
+
const [hoverTimeoutId, setHoverTimeoutId] = useState80(null);
|
|
23004
23137
|
const hiddenDynamicColumns = useMemo8(
|
|
23005
23138
|
() => dynamicColumns.filter((col) => !col.visible),
|
|
23006
23139
|
[dynamicColumns]
|
|
@@ -23059,12 +23192,12 @@ function InboxMain({
|
|
|
23059
23192
|
}, 120);
|
|
23060
23193
|
setHoverTimeoutId(timer);
|
|
23061
23194
|
};
|
|
23062
|
-
|
|
23195
|
+
useEffect60(() => {
|
|
23063
23196
|
return () => {
|
|
23064
23197
|
if (hoverTimeoutId) clearTimeout(hoverTimeoutId);
|
|
23065
23198
|
};
|
|
23066
23199
|
}, [hoverTimeoutId]);
|
|
23067
|
-
|
|
23200
|
+
useEffect60(() => {
|
|
23068
23201
|
const handleScroll = () => {
|
|
23069
23202
|
if (hoveredFileCard) {
|
|
23070
23203
|
setHoveredFileCard(null);
|
|
@@ -23073,7 +23206,7 @@ function InboxMain({
|
|
|
23073
23206
|
window.addEventListener("scroll", handleScroll, true);
|
|
23074
23207
|
return () => window.removeEventListener("scroll", handleScroll, true);
|
|
23075
23208
|
}, [hoveredFileCard]);
|
|
23076
|
-
|
|
23209
|
+
useEffect60(() => {
|
|
23077
23210
|
const handleOutsideClick = (e) => {
|
|
23078
23211
|
if (columnDropdownRef.current && !columnDropdownRef.current.contains(e.target)) {
|
|
23079
23212
|
setColumnDropdownOpen(false);
|
|
@@ -23084,7 +23217,7 @@ function InboxMain({
|
|
|
23084
23217
|
}
|
|
23085
23218
|
return () => document.removeEventListener("mousedown", handleOutsideClick);
|
|
23086
23219
|
}, [columnDropdownOpen]);
|
|
23087
|
-
|
|
23220
|
+
useEffect60(() => {
|
|
23088
23221
|
const handleOutsideClick = (e) => {
|
|
23089
23222
|
if (roleDropdownRef.current && !roleDropdownRef.current.contains(e.target)) {
|
|
23090
23223
|
setRoleDropdownOpen(false);
|
|
@@ -23364,7 +23497,8 @@ function InboxMain({
|
|
|
23364
23497
|
},
|
|
23365
23498
|
onBackToInbox: () => setViewMode("table"),
|
|
23366
23499
|
onSubmitAction: handleActionSubmit,
|
|
23367
|
-
refreshKey
|
|
23500
|
+
refreshKey,
|
|
23501
|
+
userName
|
|
23368
23502
|
}
|
|
23369
23503
|
);
|
|
23370
23504
|
}
|
|
@@ -23391,12 +23525,12 @@ function InboxMain({
|
|
|
23391
23525
|
),
|
|
23392
23526
|
/* @__PURE__ */ jsxs110("div", { className: "fc:relative fc:flex fc:items-center fc:gap-3 fc:bg-slate-50/90 fc:border fc:border-slate-200/80 fc:rounded-2xl fc:p-1.5 fc:pr-3.5 fc:shadow-sm", ref: roleDropdownRef, children: [
|
|
23393
23527
|
/* @__PURE__ */ jsxs110("div", { className: "fc:relative fc:shrink-0", children: [
|
|
23394
|
-
/* @__PURE__ */ jsx111("div", { className: "fc:w-9 fc:h-9 fc:rounded-xl fc:bg-gradient-to-br fc:from-blue-600 fc:to-indigo-600 fc:text-white fc:font-extrabold fc:text-xs fc:flex fc:items-center fc:justify-center fc:shadow-sm", children:
|
|
23528
|
+
/* @__PURE__ */ jsx111("div", { className: "fc:w-9 fc:h-9 fc:rounded-xl fc:bg-gradient-to-br fc:from-blue-600 fc:to-indigo-600 fc:text-white fc:font-extrabold fc:text-xs fc:flex fc:items-center fc:justify-center fc:shadow-sm", children: userInitial }),
|
|
23395
23529
|
/* @__PURE__ */ jsx111("span", { className: "fc:absolute fc:-bottom-0.5 fc:-right-0.5 fc:w-2.5 fc:h-2.5 fc:bg-emerald-500 fc:border-2 fc:border-white fc:rounded-full" })
|
|
23396
23530
|
] }),
|
|
23397
23531
|
/* @__PURE__ */ jsxs110("div", { className: "fc:flex fc:flex-col fc:justify-center", children: [
|
|
23398
23532
|
/* @__PURE__ */ jsxs110("div", { className: "fc:flex fc:items-center fc:gap-2", children: [
|
|
23399
|
-
/* @__PURE__ */ jsx111("span", { className: "fc:text-xs fc:font-extrabold fc:text-slate-800", children: "
|
|
23533
|
+
/* @__PURE__ */ jsx111("span", { className: "fc:text-xs fc:font-extrabold fc:text-slate-800", children: userName || "User" }),
|
|
23400
23534
|
/* @__PURE__ */ jsxs110(
|
|
23401
23535
|
"button",
|
|
23402
23536
|
{
|
|
@@ -24326,7 +24460,7 @@ function CompletedFilesMain(props) {
|
|
|
24326
24460
|
}
|
|
24327
24461
|
|
|
24328
24462
|
// src/components/track-application/TrackApplicationMain.jsx
|
|
24329
|
-
import React116, { useState as
|
|
24463
|
+
import React116, { useState as useState81, useMemo as useMemo9 } from "react";
|
|
24330
24464
|
import Swal32 from "sweetalert2";
|
|
24331
24465
|
import {
|
|
24332
24466
|
RiRouteLine as RiRouteLine2,
|
|
@@ -24350,7 +24484,7 @@ import {
|
|
|
24350
24484
|
} from "@remixicon/react";
|
|
24351
24485
|
|
|
24352
24486
|
// src/components/track-application/TrackingSlipModal.jsx
|
|
24353
|
-
import React115, { useEffect as
|
|
24487
|
+
import React115, { useEffect as useEffect61 } from "react";
|
|
24354
24488
|
import {
|
|
24355
24489
|
RiCloseLine as RiCloseLine7,
|
|
24356
24490
|
RiPrinterLine,
|
|
@@ -24364,7 +24498,7 @@ import {
|
|
|
24364
24498
|
} from "@remixicon/react";
|
|
24365
24499
|
import { jsx as jsx115, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
24366
24500
|
function TrackingSlipModal({ isOpen, onClose, application }) {
|
|
24367
|
-
|
|
24501
|
+
useEffect61(() => {
|
|
24368
24502
|
if (!isOpen) return;
|
|
24369
24503
|
const handleKeyDown = (e) => {
|
|
24370
24504
|
if (e.key === "Escape") onClose();
|
|
@@ -24545,17 +24679,17 @@ import { Fragment as Fragment9, jsx as jsx116, jsxs as jsxs112 } from "react/jsx
|
|
|
24545
24679
|
var APPLICATION_DATABASE = [];
|
|
24546
24680
|
function TrackApplicationMain() {
|
|
24547
24681
|
var _a, _b, _c;
|
|
24548
|
-
const [trackQuery, setTrackQuery] =
|
|
24549
|
-
const [selectedApplication, setSelectedApplication] =
|
|
24550
|
-
const [activeTab, setActiveTab] =
|
|
24551
|
-
const [viewMode, setViewMode] =
|
|
24552
|
-
const [tableSearch, setTableSearch] =
|
|
24553
|
-
const [priorityFilter, setPriorityFilter] =
|
|
24554
|
-
const [pageSize, setPageSize] =
|
|
24555
|
-
const [currentPage, setCurrentPage] =
|
|
24556
|
-
const [sortColumn, setSortColumn] =
|
|
24557
|
-
const [sortDirection, setSortDirection] =
|
|
24558
|
-
const [slipModalOpen, setSlipModalOpen] =
|
|
24682
|
+
const [trackQuery, setTrackQuery] = useState81("");
|
|
24683
|
+
const [selectedApplication, setSelectedApplication] = useState81(null);
|
|
24684
|
+
const [activeTab, setActiveTab] = useState81("timeline");
|
|
24685
|
+
const [viewMode, setViewMode] = useState81("tracker");
|
|
24686
|
+
const [tableSearch, setTableSearch] = useState81("");
|
|
24687
|
+
const [priorityFilter, setPriorityFilter] = useState81("all");
|
|
24688
|
+
const [pageSize, setPageSize] = useState81(10);
|
|
24689
|
+
const [currentPage, setCurrentPage] = useState81(1);
|
|
24690
|
+
const [sortColumn, setSortColumn] = useState81("");
|
|
24691
|
+
const [sortDirection, setSortDirection] = useState81("asc");
|
|
24692
|
+
const [slipModalOpen, setSlipModalOpen] = useState81(false);
|
|
24559
24693
|
const handleTrack = async (fileNoToTrack) => {
|
|
24560
24694
|
const targetNo = (fileNoToTrack || trackQuery).trim().toUpperCase();
|
|
24561
24695
|
if (!targetNo) {
|
|
@@ -25353,7 +25487,7 @@ function Sidebar({ isOpen, onToggle, childrens, sidebar, sidebarConfig }) {
|
|
|
25353
25487
|
];
|
|
25354
25488
|
const masterPermissionItems = [
|
|
25355
25489
|
{ name: "Step Permission", component: "step_permission_main", icon: RiUserSettingsLine, configKey: "isStepPermission" },
|
|
25356
|
-
{ name: "
|
|
25490
|
+
{ name: "Applicant Editable Fields", component: "FormFieldMain", icon: RiFileList3Line, configKey: "isFormField" },
|
|
25357
25491
|
{ name: "Assignment Rule", component: "AssignmentRuleMain", icon: RiFileShieldLine, configKey: "isAssignmentRule" }
|
|
25358
25492
|
];
|
|
25359
25493
|
const masterHierarchyItems = [
|
|
@@ -25368,8 +25502,8 @@ function Sidebar({ isOpen, onToggle, childrens, sidebar, sidebarConfig }) {
|
|
|
25368
25502
|
const masterFileItems = [
|
|
25369
25503
|
// { name: "Inbox", component: "InboxMain", icon: RiInboxLine, configKey: "isInbox", badge: 6 },
|
|
25370
25504
|
{ name: "My Files", component: "MyFilesMain", icon: RiUserReceivedLine4, configKey: "isMyFiles" },
|
|
25371
|
-
{ name: "Unclaimed Files", component: "UnclaimedFilesMain", icon: RiInboxArchiveLine4, configKey: "isUnclaimedFiles"
|
|
25372
|
-
{ name: "Completed Files", component: "CompletedFilesMain", icon: RiFileUploadLine3, configKey: "isCompletedFiles"
|
|
25505
|
+
{ name: "Unclaimed Files", component: "UnclaimedFilesMain", icon: RiInboxArchiveLine4, configKey: "isUnclaimedFiles" },
|
|
25506
|
+
{ name: "Completed Files", component: "CompletedFilesMain", icon: RiFileUploadLine3, configKey: "isCompletedFiles" },
|
|
25373
25507
|
{ name: "Business Entity", component: "BusinessEntitymain", icon: RiFileList3Line, configKey: "isBusinessEntity" },
|
|
25374
25508
|
{ name: "File Instance", component: "FileInstanceMain", icon: RiFileList3Line, configKey: "isFileInstance" },
|
|
25375
25509
|
{ name: "File Pool", component: "FilePoolMain", icon: RiDatabase2Line, configKey: "isFilePool" },
|
|
@@ -25423,21 +25557,21 @@ function Sidebar({ isOpen, onToggle, childrens, sidebar, sidebarConfig }) {
|
|
|
25423
25557
|
...trackingItems,
|
|
25424
25558
|
...communicationItems
|
|
25425
25559
|
];
|
|
25426
|
-
const [activeComponent, setActiveComponent] =
|
|
25560
|
+
const [activeComponent, setActiveComponent] = useState82(() => {
|
|
25427
25561
|
const all = getAllAvailableItems();
|
|
25428
25562
|
const inboxItem = all.find((item) => item.component === "InboxMain");
|
|
25429
25563
|
if (inboxItem) return "InboxMain";
|
|
25430
25564
|
return all.length > 0 ? all[0].component : null;
|
|
25431
25565
|
});
|
|
25432
|
-
const [workflowOpen, setWorkflowOpen] =
|
|
25433
|
-
const [permissionOpen, setPermissionOpen] =
|
|
25434
|
-
const [hierarchyOpen, setHierarchyOpen] =
|
|
25435
|
-
const [documentOpen, setDocumentOpen] =
|
|
25436
|
-
const [filesOpen, setFilesOpen] =
|
|
25437
|
-
const [tasksOpen, setTasksOpen] =
|
|
25438
|
-
const [trackingOpen, setTrackingOpen] =
|
|
25439
|
-
const [communicationOpen, setCommunicationOpen] =
|
|
25440
|
-
|
|
25566
|
+
const [workflowOpen, setWorkflowOpen] = useState82(false);
|
|
25567
|
+
const [permissionOpen, setPermissionOpen] = useState82(false);
|
|
25568
|
+
const [hierarchyOpen, setHierarchyOpen] = useState82(false);
|
|
25569
|
+
const [documentOpen, setDocumentOpen] = useState82(false);
|
|
25570
|
+
const [filesOpen, setFilesOpen] = useState82(true);
|
|
25571
|
+
const [tasksOpen, setTasksOpen] = useState82(false);
|
|
25572
|
+
const [trackingOpen, setTrackingOpen] = useState82(false);
|
|
25573
|
+
const [communicationOpen, setCommunicationOpen] = useState82(false);
|
|
25574
|
+
useEffect62(() => {
|
|
25441
25575
|
if (workflowItems.some((item) => item.component === activeComponent)) {
|
|
25442
25576
|
setWorkflowOpen(true);
|
|
25443
25577
|
} else if (permissionItems.some((item) => item.component === activeComponent)) {
|
|
@@ -25724,10 +25858,10 @@ function Sidebar({ isOpen, onToggle, childrens, sidebar, sidebarConfig }) {
|
|
|
25724
25858
|
}
|
|
25725
25859
|
|
|
25726
25860
|
// src/components/Layout.jsx
|
|
25727
|
-
import { useState as
|
|
25861
|
+
import { useState as useState83 } from "react";
|
|
25728
25862
|
import { jsx as jsx118 } from "react/jsx-runtime";
|
|
25729
25863
|
var Layout = ({ children, sidebar, sidebarConfig }) => {
|
|
25730
|
-
const [isOpen, setIsOpen] =
|
|
25864
|
+
const [isOpen, setIsOpen] = useState83(true);
|
|
25731
25865
|
const resolvedSidebarConfig = sidebar != null ? sidebar : sidebarConfig;
|
|
25732
25866
|
return /* @__PURE__ */ jsx118(
|
|
25733
25867
|
"div",
|