amp-workflow-ui 0.1.8 → 0.1.9
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/index.js +37 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1122,7 +1122,7 @@ function ApprovalWorkflow({
|
|
|
1122
1122
|
selectedWorkflowsList = [],
|
|
1123
1123
|
userInfo
|
|
1124
1124
|
}) {
|
|
1125
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
1125
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1126
1126
|
const theme = useTheme$1();
|
|
1127
1127
|
const { api, urlBuilder, loadingComponent, ENV_VARIABLES } = useWorkflowContext();
|
|
1128
1128
|
const [selectedApprovalOtions, setSelectedApprovalOtions] = useState(
|
|
@@ -1381,31 +1381,26 @@ function ApprovalWorkflow({
|
|
|
1381
1381
|
const StatusObj = {
|
|
1382
1382
|
approved: {
|
|
1383
1383
|
title: "Approved",
|
|
1384
|
-
color:
|
|
1385
|
-
labelColor:
|
|
1384
|
+
color: "#e6f7e9",
|
|
1385
|
+
labelColor: "#389e49"
|
|
1386
1386
|
},
|
|
1387
1387
|
rejected: {
|
|
1388
1388
|
title: "Rejected",
|
|
1389
|
-
color:
|
|
1390
|
-
labelColor:
|
|
1389
|
+
color: "#fff1f0",
|
|
1390
|
+
labelColor: "#f5222d"
|
|
1391
1391
|
},
|
|
1392
1392
|
onhold: {
|
|
1393
1393
|
title: "On Hold",
|
|
1394
|
-
color:
|
|
1395
|
-
labelColor:
|
|
1394
|
+
color: "#fff7e6",
|
|
1395
|
+
labelColor: "#faad14"
|
|
1396
1396
|
},
|
|
1397
1397
|
sendback: {
|
|
1398
1398
|
title: "Send Back",
|
|
1399
|
-
color:
|
|
1400
|
-
labelColor:
|
|
1401
|
-
}
|
|
1402
|
-
pending: {
|
|
1403
|
-
color: ((_j = theme.palette.customColors) == null ? void 0 : _j.approvalPrimaryChipBG) || theme.palette.grey[300],
|
|
1404
|
-
labelColor: ((_l = (_k = theme.palette) == null ? void 0 : _k.customColors) == null ? void 0 : _l.approvalPrimaryChipText) || theme.palette.text.primary
|
|
1405
|
-
}
|
|
1406
|
-
};
|
|
1399
|
+
color: "#e6f7ff",
|
|
1400
|
+
labelColor: "#1890ff"
|
|
1401
|
+
}};
|
|
1407
1402
|
if (isLoading && loadingComponent) return /* @__PURE__ */ jsx(Fragment, { children: loadingComponent });
|
|
1408
|
-
console.
|
|
1403
|
+
console.info("LIBRARY RUNNING...");
|
|
1409
1404
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1410
1405
|
/* @__PURE__ */ jsx(
|
|
1411
1406
|
Box,
|
|
@@ -1476,7 +1471,7 @@ function ApprovalWorkflow({
|
|
|
1476
1471
|
pb: 3
|
|
1477
1472
|
},
|
|
1478
1473
|
children: visibleSelectedRequests == null ? void 0 : visibleSelectedRequests.map((info, index) => {
|
|
1479
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2,
|
|
1474
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n;
|
|
1480
1475
|
const currentLevel = info == null ? void 0 : info.levels.find(
|
|
1481
1476
|
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
1482
1477
|
);
|
|
@@ -1585,7 +1580,7 @@ function ApprovalWorkflow({
|
|
|
1585
1580
|
mt: 0.8,
|
|
1586
1581
|
color: ((_g2 = info == null ? void 0 : info.attachment_links) == null ? void 0 : _g2.length) ? "primary.dark" : "text.disabled"
|
|
1587
1582
|
},
|
|
1588
|
-
children: ((
|
|
1583
|
+
children: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
1589
1584
|
}
|
|
1590
1585
|
)
|
|
1591
1586
|
] }),
|
|
@@ -1614,9 +1609,9 @@ function ApprovalWorkflow({
|
|
|
1614
1609
|
},
|
|
1615
1610
|
children: [
|
|
1616
1611
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
1617
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((
|
|
1612
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_j = (_i = info == null ? void 0 : info.levels) == null ? void 0 : _i.findIndex(
|
|
1618
1613
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1619
|
-
)) != null ?
|
|
1614
|
+
)) != null ? _j : -1) + 1 || "") })
|
|
1620
1615
|
]
|
|
1621
1616
|
}
|
|
1622
1617
|
),
|
|
@@ -1632,14 +1627,14 @@ function ApprovalWorkflow({
|
|
|
1632
1627
|
gap: 1.5
|
|
1633
1628
|
},
|
|
1634
1629
|
children: [
|
|
1635
|
-
(info == null ? void 0 : info.current_status) !== "completed" && ((
|
|
1630
|
+
(info == null ? void 0 : info.current_status) !== "completed" && ((_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find(
|
|
1636
1631
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1637
|
-
)) == null ? void 0 :
|
|
1632
|
+
)) == null ? void 0 : _l.order) <= ((_n = (_m = info == null ? void 0 : info.levels) == null ? void 0 : _m.find(
|
|
1638
1633
|
(lvl) => {
|
|
1639
1634
|
var _a3;
|
|
1640
1635
|
return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
|
|
1641
1636
|
}
|
|
1642
|
-
)) == null ? void 0 :
|
|
1637
|
+
)) == null ? void 0 : _n.order) ? /* @__PURE__ */ jsx(
|
|
1643
1638
|
Statusselector_default,
|
|
1644
1639
|
{
|
|
1645
1640
|
onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
|
|
@@ -1768,7 +1763,7 @@ function ApprovalWorkflow({
|
|
|
1768
1763
|
pb: 3
|
|
1769
1764
|
},
|
|
1770
1765
|
children: visibleAllRequests == null ? void 0 : visibleAllRequests.map((info, index) => {
|
|
1771
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2,
|
|
1766
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n;
|
|
1772
1767
|
const currentLevel = info == null ? void 0 : info.levels.find(
|
|
1773
1768
|
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
1774
1769
|
);
|
|
@@ -1884,7 +1879,7 @@ function ApprovalWorkflow({
|
|
|
1884
1879
|
mt: 0.8,
|
|
1885
1880
|
color: ((_g2 = info == null ? void 0 : info.attachment_links) == null ? void 0 : _g2.length) ? "primary.dark" : "text.disabled"
|
|
1886
1881
|
},
|
|
1887
|
-
children: ((
|
|
1882
|
+
children: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
1888
1883
|
}
|
|
1889
1884
|
)
|
|
1890
1885
|
] }),
|
|
@@ -1913,9 +1908,9 @@ function ApprovalWorkflow({
|
|
|
1913
1908
|
},
|
|
1914
1909
|
children: [
|
|
1915
1910
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
1916
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((
|
|
1911
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_j = (_i = info == null ? void 0 : info.levels) == null ? void 0 : _i.findIndex(
|
|
1917
1912
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1918
|
-
)) != null ?
|
|
1913
|
+
)) != null ? _j : -1) + 1 || "") })
|
|
1919
1914
|
]
|
|
1920
1915
|
}
|
|
1921
1916
|
),
|
|
@@ -1931,14 +1926,14 @@ function ApprovalWorkflow({
|
|
|
1931
1926
|
gap: 1.5
|
|
1932
1927
|
},
|
|
1933
1928
|
children: [
|
|
1934
|
-
(info == null ? void 0 : info.current_status) !== "completed" && ((
|
|
1929
|
+
(info == null ? void 0 : info.current_status) !== "completed" && ((_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find(
|
|
1935
1930
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1936
|
-
)) == null ? void 0 :
|
|
1931
|
+
)) == null ? void 0 : _l.order) <= ((_n = (_m = info == null ? void 0 : info.levels) == null ? void 0 : _m.find(
|
|
1937
1932
|
(lvl) => {
|
|
1938
1933
|
var _a3;
|
|
1939
1934
|
return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
|
|
1940
1935
|
}
|
|
1941
|
-
)) == null ? void 0 :
|
|
1936
|
+
)) == null ? void 0 : _n.order) ? /* @__PURE__ */ jsx(
|
|
1942
1937
|
Statusselector_default,
|
|
1943
1938
|
{
|
|
1944
1939
|
onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
|
|
@@ -2067,7 +2062,7 @@ function ApprovalWorkflow({
|
|
|
2067
2062
|
pb: 3
|
|
2068
2063
|
},
|
|
2069
2064
|
children: visiblePendingRequests == null ? void 0 : visiblePendingRequests.map((info, index) => {
|
|
2070
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2,
|
|
2065
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k;
|
|
2071
2066
|
const currentLevel = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
|
|
2072
2067
|
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
2073
2068
|
);
|
|
@@ -2158,9 +2153,9 @@ function ApprovalWorkflow({
|
|
|
2158
2153
|
noWrap: true,
|
|
2159
2154
|
sx: {
|
|
2160
2155
|
mt: 0.8,
|
|
2161
|
-
color: ((
|
|
2156
|
+
color: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? "primary.dark" : "text.disabled"
|
|
2162
2157
|
},
|
|
2163
|
-
children: ((
|
|
2158
|
+
children: ((_i = info == null ? void 0 : info.attachment_links) == null ? void 0 : _i.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
2164
2159
|
}
|
|
2165
2160
|
)
|
|
2166
2161
|
] }),
|
|
@@ -2189,9 +2184,9 @@ function ApprovalWorkflow({
|
|
|
2189
2184
|
},
|
|
2190
2185
|
children: [
|
|
2191
2186
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
2192
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((
|
|
2187
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_k = (_j = info == null ? void 0 : info.levels) == null ? void 0 : _j.findIndex(
|
|
2193
2188
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
2194
|
-
)) != null ?
|
|
2189
|
+
)) != null ? _k : -1) + 1 || "") })
|
|
2195
2190
|
]
|
|
2196
2191
|
}
|
|
2197
2192
|
),
|
|
@@ -2341,8 +2336,8 @@ function ApprovalWorkflow({
|
|
|
2341
2336
|
openModal: !!approveTarget,
|
|
2342
2337
|
closeModal: () => setApproveTarget(null),
|
|
2343
2338
|
header: "Approve",
|
|
2344
|
-
workflowLogId: (
|
|
2345
|
-
statusId: (
|
|
2339
|
+
workflowLogId: (_a = approveTarget == null ? void 0 : approveTarget.split("|")) == null ? void 0 : _a[0],
|
|
2340
|
+
statusId: (_b = approveTarget == null ? void 0 : approveTarget.split("|")) == null ? void 0 : _b[1]
|
|
2346
2341
|
}
|
|
2347
2342
|
),
|
|
2348
2343
|
/* @__PURE__ */ jsx(
|
|
@@ -2351,9 +2346,9 @@ function ApprovalWorkflow({
|
|
|
2351
2346
|
openModal: !!rejectTarget,
|
|
2352
2347
|
closeModal: () => setRejectTarget(null),
|
|
2353
2348
|
header: "Reject",
|
|
2354
|
-
workflowLogId: (
|
|
2355
|
-
statusId: (
|
|
2356
|
-
rejection_reason_master: (
|
|
2349
|
+
workflowLogId: (_c = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _c[0],
|
|
2350
|
+
statusId: (_d = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _d[1],
|
|
2351
|
+
rejection_reason_master: (_e = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _e[2]
|
|
2357
2352
|
}
|
|
2358
2353
|
),
|
|
2359
2354
|
/* @__PURE__ */ jsx(
|
|
@@ -2362,8 +2357,8 @@ function ApprovalWorkflow({
|
|
|
2362
2357
|
openModal: !!onHoldTarget,
|
|
2363
2358
|
closeModal: () => setOnHoldTarget(null),
|
|
2364
2359
|
header: "On Hold",
|
|
2365
|
-
workflowLogId: (
|
|
2366
|
-
statusId: (
|
|
2360
|
+
workflowLogId: (_f = onHoldTarget == null ? void 0 : onHoldTarget.split("|")) == null ? void 0 : _f[0],
|
|
2361
|
+
statusId: (_g = onHoldTarget == null ? void 0 : onHoldTarget.split("|")) == null ? void 0 : _g[1]
|
|
2367
2362
|
}
|
|
2368
2363
|
)
|
|
2369
2364
|
] });
|