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.js
CHANGED
|
@@ -1135,7 +1135,7 @@ function ApprovalWorkflow({
|
|
|
1135
1135
|
selectedWorkflowsList = [],
|
|
1136
1136
|
userInfo
|
|
1137
1137
|
}) {
|
|
1138
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
1138
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1139
1139
|
const theme = material.useTheme();
|
|
1140
1140
|
const { api, urlBuilder, loadingComponent, ENV_VARIABLES } = useWorkflowContext();
|
|
1141
1141
|
const [selectedApprovalOtions, setSelectedApprovalOtions] = React7.useState(
|
|
@@ -1394,31 +1394,26 @@ function ApprovalWorkflow({
|
|
|
1394
1394
|
const StatusObj = {
|
|
1395
1395
|
approved: {
|
|
1396
1396
|
title: "Approved",
|
|
1397
|
-
color:
|
|
1398
|
-
labelColor:
|
|
1397
|
+
color: "#e6f7e9",
|
|
1398
|
+
labelColor: "#389e49"
|
|
1399
1399
|
},
|
|
1400
1400
|
rejected: {
|
|
1401
1401
|
title: "Rejected",
|
|
1402
|
-
color:
|
|
1403
|
-
labelColor:
|
|
1402
|
+
color: "#fff1f0",
|
|
1403
|
+
labelColor: "#f5222d"
|
|
1404
1404
|
},
|
|
1405
1405
|
onhold: {
|
|
1406
1406
|
title: "On Hold",
|
|
1407
|
-
color:
|
|
1408
|
-
labelColor:
|
|
1407
|
+
color: "#fff7e6",
|
|
1408
|
+
labelColor: "#faad14"
|
|
1409
1409
|
},
|
|
1410
1410
|
sendback: {
|
|
1411
1411
|
title: "Send Back",
|
|
1412
|
-
color:
|
|
1413
|
-
labelColor:
|
|
1414
|
-
}
|
|
1415
|
-
pending: {
|
|
1416
|
-
color: ((_j = theme.palette.customColors) == null ? void 0 : _j.approvalPrimaryChipBG) || theme.palette.grey[300],
|
|
1417
|
-
labelColor: ((_l = (_k = theme.palette) == null ? void 0 : _k.customColors) == null ? void 0 : _l.approvalPrimaryChipText) || theme.palette.text.primary
|
|
1418
|
-
}
|
|
1419
|
-
};
|
|
1412
|
+
color: "#e6f7ff",
|
|
1413
|
+
labelColor: "#1890ff"
|
|
1414
|
+
}};
|
|
1420
1415
|
if (isLoading && loadingComponent) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: loadingComponent });
|
|
1421
|
-
console.
|
|
1416
|
+
console.info("LIBRARY RUNNING...");
|
|
1422
1417
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1423
1418
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1424
1419
|
system.Box,
|
|
@@ -1489,7 +1484,7 @@ function ApprovalWorkflow({
|
|
|
1489
1484
|
pb: 3
|
|
1490
1485
|
},
|
|
1491
1486
|
children: visibleSelectedRequests == null ? void 0 : visibleSelectedRequests.map((info, index) => {
|
|
1492
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2,
|
|
1487
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n;
|
|
1493
1488
|
const currentLevel = info == null ? void 0 : info.levels.find(
|
|
1494
1489
|
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
1495
1490
|
);
|
|
@@ -1598,7 +1593,7 @@ function ApprovalWorkflow({
|
|
|
1598
1593
|
mt: 0.8,
|
|
1599
1594
|
color: ((_g2 = info == null ? void 0 : info.attachment_links) == null ? void 0 : _g2.length) ? "primary.dark" : "text.disabled"
|
|
1600
1595
|
},
|
|
1601
|
-
children: ((
|
|
1596
|
+
children: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
1602
1597
|
}
|
|
1603
1598
|
)
|
|
1604
1599
|
] }),
|
|
@@ -1627,9 +1622,9 @@ function ApprovalWorkflow({
|
|
|
1627
1622
|
},
|
|
1628
1623
|
children: [
|
|
1629
1624
|
/* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
1630
|
-
/* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((
|
|
1625
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.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(
|
|
1631
1626
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1632
|
-
)) != null ?
|
|
1627
|
+
)) != null ? _j : -1) + 1 || "") })
|
|
1633
1628
|
]
|
|
1634
1629
|
}
|
|
1635
1630
|
),
|
|
@@ -1645,14 +1640,14 @@ function ApprovalWorkflow({
|
|
|
1645
1640
|
gap: 1.5
|
|
1646
1641
|
},
|
|
1647
1642
|
children: [
|
|
1648
|
-
(info == null ? void 0 : info.current_status) !== "completed" && ((
|
|
1643
|
+
(info == null ? void 0 : info.current_status) !== "completed" && ((_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find(
|
|
1649
1644
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1650
|
-
)) == null ? void 0 :
|
|
1645
|
+
)) == null ? void 0 : _l.order) <= ((_n = (_m = info == null ? void 0 : info.levels) == null ? void 0 : _m.find(
|
|
1651
1646
|
(lvl) => {
|
|
1652
1647
|
var _a3;
|
|
1653
1648
|
return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
|
|
1654
1649
|
}
|
|
1655
|
-
)) == null ? void 0 :
|
|
1650
|
+
)) == null ? void 0 : _n.order) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1656
1651
|
Statusselector_default,
|
|
1657
1652
|
{
|
|
1658
1653
|
onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
|
|
@@ -1781,7 +1776,7 @@ function ApprovalWorkflow({
|
|
|
1781
1776
|
pb: 3
|
|
1782
1777
|
},
|
|
1783
1778
|
children: visibleAllRequests == null ? void 0 : visibleAllRequests.map((info, index) => {
|
|
1784
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2,
|
|
1779
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n;
|
|
1785
1780
|
const currentLevel = info == null ? void 0 : info.levels.find(
|
|
1786
1781
|
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
1787
1782
|
);
|
|
@@ -1897,7 +1892,7 @@ function ApprovalWorkflow({
|
|
|
1897
1892
|
mt: 0.8,
|
|
1898
1893
|
color: ((_g2 = info == null ? void 0 : info.attachment_links) == null ? void 0 : _g2.length) ? "primary.dark" : "text.disabled"
|
|
1899
1894
|
},
|
|
1900
|
-
children: ((
|
|
1895
|
+
children: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
1901
1896
|
}
|
|
1902
1897
|
)
|
|
1903
1898
|
] }),
|
|
@@ -1926,9 +1921,9 @@ function ApprovalWorkflow({
|
|
|
1926
1921
|
},
|
|
1927
1922
|
children: [
|
|
1928
1923
|
/* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
1929
|
-
/* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((
|
|
1924
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.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(
|
|
1930
1925
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1931
|
-
)) != null ?
|
|
1926
|
+
)) != null ? _j : -1) + 1 || "") })
|
|
1932
1927
|
]
|
|
1933
1928
|
}
|
|
1934
1929
|
),
|
|
@@ -1944,14 +1939,14 @@ function ApprovalWorkflow({
|
|
|
1944
1939
|
gap: 1.5
|
|
1945
1940
|
},
|
|
1946
1941
|
children: [
|
|
1947
|
-
(info == null ? void 0 : info.current_status) !== "completed" && ((
|
|
1942
|
+
(info == null ? void 0 : info.current_status) !== "completed" && ((_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find(
|
|
1948
1943
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1949
|
-
)) == null ? void 0 :
|
|
1944
|
+
)) == null ? void 0 : _l.order) <= ((_n = (_m = info == null ? void 0 : info.levels) == null ? void 0 : _m.find(
|
|
1950
1945
|
(lvl) => {
|
|
1951
1946
|
var _a3;
|
|
1952
1947
|
return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
|
|
1953
1948
|
}
|
|
1954
|
-
)) == null ? void 0 :
|
|
1949
|
+
)) == null ? void 0 : _n.order) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1955
1950
|
Statusselector_default,
|
|
1956
1951
|
{
|
|
1957
1952
|
onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
|
|
@@ -2080,7 +2075,7 @@ function ApprovalWorkflow({
|
|
|
2080
2075
|
pb: 3
|
|
2081
2076
|
},
|
|
2082
2077
|
children: visiblePendingRequests == null ? void 0 : visiblePendingRequests.map((info, index) => {
|
|
2083
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2,
|
|
2078
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k;
|
|
2084
2079
|
const currentLevel = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
|
|
2085
2080
|
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
2086
2081
|
);
|
|
@@ -2171,9 +2166,9 @@ function ApprovalWorkflow({
|
|
|
2171
2166
|
noWrap: true,
|
|
2172
2167
|
sx: {
|
|
2173
2168
|
mt: 0.8,
|
|
2174
|
-
color: ((
|
|
2169
|
+
color: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? "primary.dark" : "text.disabled"
|
|
2175
2170
|
},
|
|
2176
|
-
children: ((
|
|
2171
|
+
children: ((_i = info == null ? void 0 : info.attachment_links) == null ? void 0 : _i.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
2177
2172
|
}
|
|
2178
2173
|
)
|
|
2179
2174
|
] }),
|
|
@@ -2202,9 +2197,9 @@ function ApprovalWorkflow({
|
|
|
2202
2197
|
},
|
|
2203
2198
|
children: [
|
|
2204
2199
|
/* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
2205
|
-
/* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((
|
|
2200
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.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(
|
|
2206
2201
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
2207
|
-
)) != null ?
|
|
2202
|
+
)) != null ? _k : -1) + 1 || "") })
|
|
2208
2203
|
]
|
|
2209
2204
|
}
|
|
2210
2205
|
),
|
|
@@ -2354,8 +2349,8 @@ function ApprovalWorkflow({
|
|
|
2354
2349
|
openModal: !!approveTarget,
|
|
2355
2350
|
closeModal: () => setApproveTarget(null),
|
|
2356
2351
|
header: "Approve",
|
|
2357
|
-
workflowLogId: (
|
|
2358
|
-
statusId: (
|
|
2352
|
+
workflowLogId: (_a = approveTarget == null ? void 0 : approveTarget.split("|")) == null ? void 0 : _a[0],
|
|
2353
|
+
statusId: (_b = approveTarget == null ? void 0 : approveTarget.split("|")) == null ? void 0 : _b[1]
|
|
2359
2354
|
}
|
|
2360
2355
|
),
|
|
2361
2356
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2364,9 +2359,9 @@ function ApprovalWorkflow({
|
|
|
2364
2359
|
openModal: !!rejectTarget,
|
|
2365
2360
|
closeModal: () => setRejectTarget(null),
|
|
2366
2361
|
header: "Reject",
|
|
2367
|
-
workflowLogId: (
|
|
2368
|
-
statusId: (
|
|
2369
|
-
rejection_reason_master: (
|
|
2362
|
+
workflowLogId: (_c = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _c[0],
|
|
2363
|
+
statusId: (_d = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _d[1],
|
|
2364
|
+
rejection_reason_master: (_e = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _e[2]
|
|
2370
2365
|
}
|
|
2371
2366
|
),
|
|
2372
2367
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2375,8 +2370,8 @@ function ApprovalWorkflow({
|
|
|
2375
2370
|
openModal: !!onHoldTarget,
|
|
2376
2371
|
closeModal: () => setOnHoldTarget(null),
|
|
2377
2372
|
header: "On Hold",
|
|
2378
|
-
workflowLogId: (
|
|
2379
|
-
statusId: (
|
|
2373
|
+
workflowLogId: (_f = onHoldTarget == null ? void 0 : onHoldTarget.split("|")) == null ? void 0 : _f[0],
|
|
2374
|
+
statusId: (_g = onHoldTarget == null ? void 0 : onHoldTarget.split("|")) == null ? void 0 : _g[1]
|
|
2380
2375
|
}
|
|
2381
2376
|
)
|
|
2382
2377
|
] });
|