amp-workflow-ui 0.1.3 → 0.1.4
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.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +278 -229
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +278 -229
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -738,7 +738,7 @@ function ApprovalWorkflow({
|
|
|
738
738
|
}) {
|
|
739
739
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
740
740
|
const theme = useTheme$1();
|
|
741
|
-
const { api, urlBuilder, loadingComponent } = useWorkflowContext();
|
|
741
|
+
const { api, urlBuilder, loadingComponent, ENV_VARIABLES } = useWorkflowContext();
|
|
742
742
|
const [selectedApprovalOtions, setSelectedApprovalOtions] = useState(
|
|
743
743
|
selectedWorkflowsList.length ? "selected" : "Action Required"
|
|
744
744
|
);
|
|
@@ -961,22 +961,31 @@ function ApprovalWorkflow({
|
|
|
961
961
|
fetchSelectedActivites();
|
|
962
962
|
}
|
|
963
963
|
}, [selectedWorkflowsList]);
|
|
964
|
+
useEffect(() => {
|
|
965
|
+
if (Object.keys(urlConfig).length > 0 && userInfo) {
|
|
966
|
+
fetchPendingActivities();
|
|
967
|
+
}
|
|
968
|
+
}, [urlConfig, userInfo]);
|
|
964
969
|
const buildRedirectionUrl = (info) => {
|
|
965
|
-
|
|
966
|
-
if (
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
970
|
+
const { module_name, module_id, reference_id, redirection_link } = info;
|
|
971
|
+
if (redirection_link) return redirection_link;
|
|
972
|
+
if (module_name === "route_approval") {
|
|
973
|
+
return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.TRANSPORT_URL}route-listing/view/${reference_id}`;
|
|
974
|
+
} else if (module_name === "update_bus_details_approval") {
|
|
975
|
+
return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.TRANSPORT_URL}bus-listing/view/${reference_id}`;
|
|
976
|
+
} else if (module_name === "kit_handover_approve") {
|
|
977
|
+
return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.FINANCE_URL}fee-collection/?reference_id=${reference_id}&module_name=${module_name}&module_id=${module_id}`;
|
|
978
|
+
}
|
|
979
|
+
if (urlBuilder) {
|
|
980
|
+
return urlBuilder(module_name, module_id, urlConfig, reference_id);
|
|
981
|
+
}
|
|
982
|
+
const ref = urlConfig == null ? void 0 : urlConfig[module_name];
|
|
974
983
|
if ((ref == null ? void 0 : ref.base_url) && (ref == null ? void 0 : ref.sub_url)) {
|
|
975
984
|
const qs = new URLSearchParams();
|
|
976
|
-
if (
|
|
977
|
-
|
|
978
|
-
if (
|
|
979
|
-
return `${ref.base_url}${ref.sub_url}
|
|
985
|
+
if (reference_id) qs.set("reference_id", String(reference_id));
|
|
986
|
+
if (module_name) qs.set("module_name", String(module_name));
|
|
987
|
+
if (module_id) qs.set("module_id", String(module_id));
|
|
988
|
+
return `${ref.base_url}${ref.sub_url}?${qs.toString()}`;
|
|
980
989
|
}
|
|
981
990
|
return "#";
|
|
982
991
|
};
|
|
@@ -1118,23 +1127,30 @@ function ApprovalWorkflow({
|
|
|
1118
1127
|
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "20%", minWidth: 180 }, children: [
|
|
1119
1128
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
|
|
1120
1129
|
/* @__PURE__ */ jsx(Tooltip, { title: redir, children: /* @__PURE__ */ jsx(
|
|
1121
|
-
|
|
1130
|
+
"a",
|
|
1122
1131
|
{
|
|
1123
|
-
component: "a",
|
|
1124
1132
|
href: redir,
|
|
1125
1133
|
target: "_blank",
|
|
1126
1134
|
rel: "noreferrer",
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
fontWeight: 500,
|
|
1131
|
-
textDecoration: "none",
|
|
1132
|
-
overflow: "hidden",
|
|
1133
|
-
textOverflow: "ellipsis",
|
|
1134
|
-
whiteSpace: "nowrap",
|
|
1135
|
-
mt: 0.8
|
|
1135
|
+
style: {
|
|
1136
|
+
cursor: "pointer",
|
|
1137
|
+
textDecoration: "none"
|
|
1136
1138
|
},
|
|
1137
|
-
children:
|
|
1139
|
+
children: /* @__PURE__ */ jsx(
|
|
1140
|
+
Typography,
|
|
1141
|
+
{
|
|
1142
|
+
variant: "subtitle2",
|
|
1143
|
+
color: "primary.dark",
|
|
1144
|
+
sx: {
|
|
1145
|
+
mt: 0.8,
|
|
1146
|
+
lineHeight: "15.4px",
|
|
1147
|
+
overflow: "hidden",
|
|
1148
|
+
textOverflow: "ellipsis",
|
|
1149
|
+
whiteSpace: "nowrap"
|
|
1150
|
+
},
|
|
1151
|
+
children: redir
|
|
1152
|
+
}
|
|
1153
|
+
)
|
|
1138
1154
|
}
|
|
1139
1155
|
) })
|
|
1140
1156
|
] }),
|
|
@@ -1403,23 +1419,30 @@ function ApprovalWorkflow({
|
|
|
1403
1419
|
}
|
|
1404
1420
|
),
|
|
1405
1421
|
/* @__PURE__ */ jsx(Tooltip, { title: redir, children: /* @__PURE__ */ jsx(
|
|
1406
|
-
|
|
1422
|
+
"a",
|
|
1407
1423
|
{
|
|
1408
|
-
component: "a",
|
|
1409
1424
|
href: redir,
|
|
1410
1425
|
target: "_blank",
|
|
1411
1426
|
rel: "noreferrer",
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
fontWeight: 500,
|
|
1416
|
-
textDecoration: "none",
|
|
1417
|
-
overflow: "hidden",
|
|
1418
|
-
textOverflow: "ellipsis",
|
|
1419
|
-
whiteSpace: "nowrap",
|
|
1420
|
-
mt: 0.8
|
|
1427
|
+
style: {
|
|
1428
|
+
cursor: "pointer",
|
|
1429
|
+
textDecoration: "none"
|
|
1421
1430
|
},
|
|
1422
|
-
children:
|
|
1431
|
+
children: /* @__PURE__ */ jsx(
|
|
1432
|
+
Typography,
|
|
1433
|
+
{
|
|
1434
|
+
variant: "subtitle2",
|
|
1435
|
+
color: "primary.dark",
|
|
1436
|
+
sx: {
|
|
1437
|
+
mt: 0.8,
|
|
1438
|
+
lineHeight: "15.4px",
|
|
1439
|
+
overflow: "hidden",
|
|
1440
|
+
textOverflow: "ellipsis",
|
|
1441
|
+
whiteSpace: "nowrap"
|
|
1442
|
+
},
|
|
1443
|
+
children: redir
|
|
1444
|
+
}
|
|
1445
|
+
)
|
|
1423
1446
|
}
|
|
1424
1447
|
) })
|
|
1425
1448
|
] }),
|
|
@@ -1614,18 +1637,11 @@ function ApprovalWorkflow({
|
|
|
1614
1637
|
pb: 3
|
|
1615
1638
|
},
|
|
1616
1639
|
children: visiblePendingRequests == null ? void 0 : visiblePendingRequests.map((info, index) => {
|
|
1617
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k
|
|
1640
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k;
|
|
1618
1641
|
const currentLevel = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
|
|
1619
1642
|
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
1620
1643
|
);
|
|
1621
1644
|
const statusList = currentLevel ? currentLevel.status_list : [];
|
|
1622
|
-
(statusList || []).reduce(
|
|
1623
|
-
(acc, s) => {
|
|
1624
|
-
if ((s == null ? void 0 : s.status) != null) acc[s.status] = s;
|
|
1625
|
-
return acc;
|
|
1626
|
-
},
|
|
1627
|
-
{}
|
|
1628
|
-
);
|
|
1629
1645
|
const redir = buildRedirectionUrl(info);
|
|
1630
1646
|
const currentStatus = ((_d2 = (_c2 = (_b2 = info == null ? void 0 : info.levels) == null ? void 0 : _b2.find(
|
|
1631
1647
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
@@ -1633,7 +1649,7 @@ function ApprovalWorkflow({
|
|
|
1633
1649
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1634
1650
|
)) == null ? void 0 : _f2.selected_status) == null ? void 0 : _g2.status_id) === 3 ? "rejected" : "pending";
|
|
1635
1651
|
const statusData = getStatus2(currentStatus);
|
|
1636
|
-
return /* @__PURE__ */
|
|
1652
|
+
return /* @__PURE__ */ jsx(
|
|
1637
1653
|
Card,
|
|
1638
1654
|
{
|
|
1639
1655
|
ref: index === visiblePendingRequests.length - 1 ? lastCardRef : null,
|
|
@@ -1644,191 +1660,192 @@ function ApprovalWorkflow({
|
|
|
1644
1660
|
px: 3,
|
|
1645
1661
|
py: 2
|
|
1646
1662
|
},
|
|
1647
|
-
children:
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
{
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
children: [
|
|
1659
|
-
/* @__PURE__ */
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
href: redir,
|
|
1688
|
-
target: "_blank",
|
|
1689
|
-
rel: "noreferrer",
|
|
1690
|
-
sx: {
|
|
1691
|
-
display: "block",
|
|
1663
|
+
children: /* @__PURE__ */ jsxs(
|
|
1664
|
+
CardContent,
|
|
1665
|
+
{
|
|
1666
|
+
sx: {
|
|
1667
|
+
display: "flex",
|
|
1668
|
+
justifyContent: "space-between",
|
|
1669
|
+
alignItems: "center",
|
|
1670
|
+
flexWrap: { xs: "wrap", md: "nowrap" },
|
|
1671
|
+
gap: 2
|
|
1672
|
+
},
|
|
1673
|
+
children: [
|
|
1674
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "20%", minWidth: 220 }, children: [
|
|
1675
|
+
/* @__PURE__ */ jsx(Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsx(Typography, { variant: "h6", fontWeight: 600, noWrap: true, children: info.activity_name }) }),
|
|
1676
|
+
/* @__PURE__ */ jsx(Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsx(
|
|
1677
|
+
Typography,
|
|
1678
|
+
{
|
|
1679
|
+
variant: "body2",
|
|
1680
|
+
color: "text.secondary",
|
|
1681
|
+
noWrap: true,
|
|
1682
|
+
sx: { mt: 0.5 },
|
|
1683
|
+
children: info.description_data
|
|
1684
|
+
}
|
|
1685
|
+
) })
|
|
1686
|
+
] }),
|
|
1687
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "18%", minWidth: 180 }, children: [
|
|
1688
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
|
|
1689
|
+
/* @__PURE__ */ jsx(Tooltip, { title: redir, children: /* @__PURE__ */ jsx(
|
|
1690
|
+
"a",
|
|
1691
|
+
{
|
|
1692
|
+
href: redir,
|
|
1693
|
+
target: "_blank",
|
|
1694
|
+
rel: "noreferrer",
|
|
1695
|
+
style: {
|
|
1696
|
+
cursor: "pointer",
|
|
1697
|
+
textDecoration: "none"
|
|
1698
|
+
},
|
|
1699
|
+
children: /* @__PURE__ */ jsx(
|
|
1700
|
+
Typography,
|
|
1701
|
+
{
|
|
1702
|
+
variant: "subtitle2",
|
|
1692
1703
|
color: "primary.dark",
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1704
|
+
sx: {
|
|
1705
|
+
mt: 0.8,
|
|
1706
|
+
lineHeight: "15.4px",
|
|
1707
|
+
overflow: "hidden",
|
|
1708
|
+
textOverflow: "ellipsis",
|
|
1709
|
+
whiteSpace: "nowrap"
|
|
1710
|
+
},
|
|
1711
|
+
children: redir
|
|
1712
|
+
}
|
|
1713
|
+
)
|
|
1714
|
+
}
|
|
1715
|
+
) })
|
|
1716
|
+
] }),
|
|
1717
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
|
|
1718
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
|
|
1719
|
+
/* @__PURE__ */ jsx(
|
|
1720
|
+
Typography,
|
|
1706
1721
|
{
|
|
1722
|
+
variant: "body2",
|
|
1723
|
+
noWrap: true,
|
|
1707
1724
|
sx: {
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
display: "flex",
|
|
1711
|
-
alignItems: "center",
|
|
1712
|
-
justifyContent: "flex-end",
|
|
1713
|
-
gap: 1.5
|
|
1725
|
+
mt: 0.8,
|
|
1726
|
+
color: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? "primary.dark" : "text.disabled"
|
|
1714
1727
|
},
|
|
1715
|
-
children:
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1728
|
+
children: ((_i = info == null ? void 0 : info.attachment_links) == null ? void 0 : _i.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
1729
|
+
}
|
|
1730
|
+
)
|
|
1731
|
+
] }),
|
|
1732
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
|
|
1733
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
|
|
1734
|
+
/* @__PURE__ */ jsx(
|
|
1735
|
+
Typography,
|
|
1736
|
+
{
|
|
1737
|
+
variant: "body2",
|
|
1738
|
+
sx: {
|
|
1739
|
+
mt: 0.8,
|
|
1740
|
+
fontWeight: 500,
|
|
1741
|
+
color: "text.primary"
|
|
1742
|
+
},
|
|
1743
|
+
children: (currentLevel == null ? void 0 : currentLevel.tat_expiry) ? moment(currentLevel.tat_expiry).utcOffset("UTC+05:30").format("DD/MM/YYYY hh:mm A") : "N/A"
|
|
1744
|
+
}
|
|
1745
|
+
)
|
|
1746
|
+
] }),
|
|
1747
|
+
/* @__PURE__ */ jsxs(
|
|
1748
|
+
Box,
|
|
1749
|
+
{
|
|
1750
|
+
sx: {
|
|
1751
|
+
flexBasis: "8%",
|
|
1752
|
+
minWidth: 80,
|
|
1753
|
+
textAlign: "center"
|
|
1754
|
+
},
|
|
1755
|
+
children: [
|
|
1756
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
1757
|
+
/* @__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(
|
|
1758
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1759
|
+
)) != null ? _k : -1) + 1 || "") })
|
|
1760
|
+
]
|
|
1761
|
+
}
|
|
1762
|
+
),
|
|
1763
|
+
/* @__PURE__ */ jsxs(
|
|
1764
|
+
Box,
|
|
1765
|
+
{
|
|
1766
|
+
sx: {
|
|
1767
|
+
flexBasis: "18%",
|
|
1768
|
+
minWidth: 200,
|
|
1769
|
+
display: "flex",
|
|
1770
|
+
alignItems: "center",
|
|
1771
|
+
justifyContent: "flex-end",
|
|
1772
|
+
gap: 1.5
|
|
1773
|
+
},
|
|
1774
|
+
children: [
|
|
1775
|
+
(info == null ? void 0 : info.current_status) !== "completed" ? /* @__PURE__ */ jsx(
|
|
1776
|
+
Statusselector_default,
|
|
1777
|
+
{
|
|
1778
|
+
onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
|
|
1779
|
+
onApprove: () => {
|
|
1720
1780
|
var _a3;
|
|
1721
|
-
return
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
{
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
backgroundColor: getStatus2(currentStatus).color,
|
|
1755
|
-
color: getStatus2(currentStatus).labelColor,
|
|
1756
|
-
height: "40px",
|
|
1757
|
-
px: 2,
|
|
1758
|
-
borderRadius: "100px !important",
|
|
1759
|
-
"& .MuiChip-label": {
|
|
1760
|
-
fontSize: "14px",
|
|
1761
|
-
lineHeight: "15.4px",
|
|
1762
|
-
fontWeight: "500",
|
|
1763
|
-
textTransform: "capitalize"
|
|
1764
|
-
}
|
|
1765
|
-
},
|
|
1766
|
-
label: statusData.title
|
|
1767
|
-
}
|
|
1768
|
-
),
|
|
1769
|
-
/* @__PURE__ */ jsx(
|
|
1770
|
-
Divider,
|
|
1771
|
-
{
|
|
1772
|
-
orientation: "vertical",
|
|
1773
|
-
flexItem: true,
|
|
1774
|
-
sx: {
|
|
1775
|
-
borderColor: "#E0E0E0",
|
|
1776
|
-
height: "40px"
|
|
1781
|
+
return handleApprove(
|
|
1782
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
|
|
1783
|
+
);
|
|
1784
|
+
},
|
|
1785
|
+
onReject: () => {
|
|
1786
|
+
var _a3;
|
|
1787
|
+
return handleReject(
|
|
1788
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
|
|
1789
|
+
);
|
|
1790
|
+
},
|
|
1791
|
+
onHold: () => {
|
|
1792
|
+
var _a3;
|
|
1793
|
+
return handleOnHold(
|
|
1794
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
|
|
1795
|
+
);
|
|
1796
|
+
},
|
|
1797
|
+
statusList
|
|
1798
|
+
}
|
|
1799
|
+
) : /* @__PURE__ */ jsx(
|
|
1800
|
+
Chip,
|
|
1801
|
+
{
|
|
1802
|
+
variant: "filled",
|
|
1803
|
+
sx: {
|
|
1804
|
+
backgroundColor: statusData.color,
|
|
1805
|
+
color: statusData.labelColor,
|
|
1806
|
+
height: "40px",
|
|
1807
|
+
px: 2,
|
|
1808
|
+
borderRadius: "100px !important",
|
|
1809
|
+
"& .MuiChip-label": {
|
|
1810
|
+
fontSize: "14px",
|
|
1811
|
+
lineHeight: "15.4px",
|
|
1812
|
+
fontWeight: "500",
|
|
1813
|
+
textTransform: "capitalize"
|
|
1777
1814
|
}
|
|
1815
|
+
},
|
|
1816
|
+
label: statusData.title
|
|
1817
|
+
}
|
|
1818
|
+
),
|
|
1819
|
+
/* @__PURE__ */ jsx(
|
|
1820
|
+
Divider,
|
|
1821
|
+
{
|
|
1822
|
+
orientation: "vertical",
|
|
1823
|
+
flexItem: true,
|
|
1824
|
+
sx: {
|
|
1825
|
+
borderColor: "#E0E0E0",
|
|
1826
|
+
height: "40px"
|
|
1778
1827
|
}
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
),
|
|
1801
|
-
expandedId === info._id && /* @__PURE__ */ jsx(Box, { sx: { mt: 2, ml: 2 }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsx(
|
|
1802
|
-
Box,
|
|
1803
|
-
{
|
|
1804
|
-
sx: {
|
|
1805
|
-
height: 150,
|
|
1806
|
-
display: "flex",
|
|
1807
|
-
justifyContent: "center",
|
|
1808
|
-
alignItems: "center"
|
|
1809
|
-
},
|
|
1810
|
-
children: /* @__PURE__ */ jsx(CircularProgress, { size: 36, color: "primary" })
|
|
1811
|
-
}
|
|
1812
|
-
) : /* @__PURE__ */ jsx(
|
|
1813
|
-
ConnectedTimeline,
|
|
1814
|
-
{
|
|
1815
|
-
events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
|
|
1816
|
-
var _a3, _b3, _c3, _d3;
|
|
1817
|
-
return {
|
|
1818
|
-
date: moment(item == null ? void 0 : item.created_at).format(
|
|
1819
|
-
"DD-MM-YYYY"
|
|
1820
|
-
),
|
|
1821
|
-
time: moment(item == null ? void 0 : item.created_at).format("HH:mm"),
|
|
1822
|
-
title: (item == null ? void 0 : item.type) === "create" ? `Raised by - ${(_a3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _a3.full_name}` : ((_b3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _b3.full_name) || "N/A",
|
|
1823
|
-
subTitle: ((_c3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _c3.comment) || "No Comments",
|
|
1824
|
-
attachment: ((_d3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _d3.file) || null,
|
|
1825
|
-
count: (item == null ? void 0 : item.current_level) == "L0" ? "L0" : item == null ? void 0 : item.current_level_count,
|
|
1826
|
-
cardType: "card"
|
|
1827
|
-
};
|
|
1828
|
-
})
|
|
1829
|
-
}
|
|
1830
|
-
) })
|
|
1831
|
-
]
|
|
1828
|
+
}
|
|
1829
|
+
),
|
|
1830
|
+
/* @__PURE__ */ jsx(
|
|
1831
|
+
IconButton,
|
|
1832
|
+
{
|
|
1833
|
+
color: "primary",
|
|
1834
|
+
sx: {
|
|
1835
|
+
background: "rgba(25,118,210,0.08)",
|
|
1836
|
+
boxShadow: "2px 2px 10px 0px #4C4E6426",
|
|
1837
|
+
"& span": { color: "primary.dark" }
|
|
1838
|
+
},
|
|
1839
|
+
onClick: () => handleExpandClick(info._id),
|
|
1840
|
+
children: expandedId === info._id ? /* @__PURE__ */ jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsx("span", { className: "icon-arrow-right-3" })
|
|
1841
|
+
}
|
|
1842
|
+
)
|
|
1843
|
+
]
|
|
1844
|
+
}
|
|
1845
|
+
)
|
|
1846
|
+
]
|
|
1847
|
+
}
|
|
1848
|
+
)
|
|
1832
1849
|
},
|
|
1833
1850
|
index
|
|
1834
1851
|
);
|
|
@@ -1922,12 +1939,44 @@ function DialogOpener({
|
|
|
1922
1939
|
) });
|
|
1923
1940
|
}
|
|
1924
1941
|
function DialogOpener2(props) {
|
|
1925
|
-
const {
|
|
1926
|
-
|
|
1942
|
+
const {
|
|
1943
|
+
api,
|
|
1944
|
+
urlBuilder,
|
|
1945
|
+
loadingComponent,
|
|
1946
|
+
userInfoData,
|
|
1947
|
+
ENV_VARIABLES,
|
|
1948
|
+
...rest
|
|
1949
|
+
} = props;
|
|
1950
|
+
return /* @__PURE__ */ jsx(
|
|
1951
|
+
WorkflowProvider,
|
|
1952
|
+
{
|
|
1953
|
+
value: {
|
|
1954
|
+
api,
|
|
1955
|
+
urlBuilder,
|
|
1956
|
+
userInfo: userInfoData,
|
|
1957
|
+
loadingComponent,
|
|
1958
|
+
ENV_VARIABLES
|
|
1959
|
+
},
|
|
1960
|
+
children: /* @__PURE__ */ jsx(DialogOpener, { ...rest, userInfoData })
|
|
1961
|
+
}
|
|
1962
|
+
);
|
|
1927
1963
|
}
|
|
1928
1964
|
function ApprovalWorkflow2(props) {
|
|
1929
|
-
const {
|
|
1930
|
-
|
|
1965
|
+
const {
|
|
1966
|
+
api,
|
|
1967
|
+
urlBuilder,
|
|
1968
|
+
loadingComponent,
|
|
1969
|
+
userInfo,
|
|
1970
|
+
ENV_VARIABLES,
|
|
1971
|
+
...rest
|
|
1972
|
+
} = props;
|
|
1973
|
+
return /* @__PURE__ */ jsx(
|
|
1974
|
+
WorkflowProvider,
|
|
1975
|
+
{
|
|
1976
|
+
value: { api, urlBuilder, userInfo, loadingComponent, ENV_VARIABLES },
|
|
1977
|
+
children: /* @__PURE__ */ jsx(ApprovalWorkflow, { userInfo, ...rest })
|
|
1978
|
+
}
|
|
1979
|
+
);
|
|
1931
1980
|
}
|
|
1932
1981
|
|
|
1933
1982
|
export { ApprovalWorkflow2 as ApprovalWorkflow, DialogOpener2 as DialogOpener };
|