amp-workflow-ui 0.1.3 → 0.1.5
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 +318 -239
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +318 -239
- 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
|
);
|
|
@@ -811,12 +811,15 @@ function ApprovalWorkflow({
|
|
|
811
811
|
},
|
|
812
812
|
[isLoading, selectedApprovalOtions]
|
|
813
813
|
);
|
|
814
|
-
const visibleAllRequests = filteredAllRequestArray.slice(
|
|
815
|
-
|
|
814
|
+
const visibleAllRequests = (filteredAllRequestArray || []).slice(
|
|
815
|
+
0,
|
|
816
|
+
visibleAll
|
|
817
|
+
);
|
|
818
|
+
const visiblePendingRequests = (filteredPendingRequestArray || []).slice(
|
|
816
819
|
0,
|
|
817
820
|
visiblePending
|
|
818
821
|
);
|
|
819
|
-
const visibleSelectedRequests = filteredSelectedRequestArray.slice(
|
|
822
|
+
const visibleSelectedRequests = (filteredSelectedRequestArray || []).slice(
|
|
820
823
|
0,
|
|
821
824
|
visibleSelected
|
|
822
825
|
);
|
|
@@ -893,12 +896,12 @@ function ApprovalWorkflow({
|
|
|
893
896
|
{
|
|
894
897
|
label: "Action Required",
|
|
895
898
|
icon: /* @__PURE__ */ jsx("span", { className: "icon-document-forward" }),
|
|
896
|
-
count: pendingRequestArray.length
|
|
899
|
+
count: pendingRequestArray ? pendingRequestArray.length : 0
|
|
897
900
|
},
|
|
898
901
|
{
|
|
899
902
|
label: "All Requests",
|
|
900
903
|
icon: /* @__PURE__ */ jsx("span", { className: "icon-document-copy" }),
|
|
901
|
-
count: allRequestArray.length
|
|
904
|
+
count: allRequestArray ? allRequestArray.length : 0
|
|
902
905
|
}
|
|
903
906
|
];
|
|
904
907
|
const fetchExpandedActivityLogs = (workflowLogId) => {
|
|
@@ -961,22 +964,31 @@ function ApprovalWorkflow({
|
|
|
961
964
|
fetchSelectedActivites();
|
|
962
965
|
}
|
|
963
966
|
}, [selectedWorkflowsList]);
|
|
967
|
+
useEffect(() => {
|
|
968
|
+
if (Object.keys(urlConfig).length > 0 && userInfo) {
|
|
969
|
+
fetchPendingActivities();
|
|
970
|
+
}
|
|
971
|
+
}, [urlConfig, userInfo]);
|
|
964
972
|
const buildRedirectionUrl = (info) => {
|
|
965
|
-
|
|
966
|
-
if (
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
973
|
+
const { module_name, module_id, reference_id, redirection_link } = info;
|
|
974
|
+
if (redirection_link) return redirection_link;
|
|
975
|
+
if (module_name === "route_approval") {
|
|
976
|
+
return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.TRANSPORT_URL}route-listing/view/${reference_id}`;
|
|
977
|
+
} else if (module_name === "update_bus_details_approval") {
|
|
978
|
+
return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.TRANSPORT_URL}bus-listing/view/${reference_id}`;
|
|
979
|
+
} else if (module_name === "kit_handover_approve") {
|
|
980
|
+
return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.FINANCE_URL}fee-collection/?reference_id=${reference_id}&module_name=${module_name}&module_id=${module_id}`;
|
|
981
|
+
}
|
|
982
|
+
if (urlBuilder) {
|
|
983
|
+
return urlBuilder(module_name, module_id, urlConfig, reference_id);
|
|
984
|
+
}
|
|
985
|
+
const ref = urlConfig == null ? void 0 : urlConfig[module_name];
|
|
974
986
|
if ((ref == null ? void 0 : ref.base_url) && (ref == null ? void 0 : ref.sub_url)) {
|
|
975
987
|
const qs = new URLSearchParams();
|
|
976
|
-
if (
|
|
977
|
-
|
|
978
|
-
if (
|
|
979
|
-
return `${ref.base_url}${ref.sub_url}
|
|
988
|
+
if (reference_id) qs.set("reference_id", String(reference_id));
|
|
989
|
+
if (module_name) qs.set("module_name", String(module_name));
|
|
990
|
+
if (module_id) qs.set("module_id", String(module_id));
|
|
991
|
+
return `${ref.base_url}${ref.sub_url}?${qs.toString()}`;
|
|
980
992
|
}
|
|
981
993
|
return "#";
|
|
982
994
|
};
|
|
@@ -1118,23 +1130,30 @@ function ApprovalWorkflow({
|
|
|
1118
1130
|
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "20%", minWidth: 180 }, children: [
|
|
1119
1131
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
|
|
1120
1132
|
/* @__PURE__ */ jsx(Tooltip, { title: redir, children: /* @__PURE__ */ jsx(
|
|
1121
|
-
|
|
1133
|
+
"a",
|
|
1122
1134
|
{
|
|
1123
|
-
component: "a",
|
|
1124
1135
|
href: redir,
|
|
1125
1136
|
target: "_blank",
|
|
1126
1137
|
rel: "noreferrer",
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
fontWeight: 500,
|
|
1131
|
-
textDecoration: "none",
|
|
1132
|
-
overflow: "hidden",
|
|
1133
|
-
textOverflow: "ellipsis",
|
|
1134
|
-
whiteSpace: "nowrap",
|
|
1135
|
-
mt: 0.8
|
|
1138
|
+
style: {
|
|
1139
|
+
cursor: "pointer",
|
|
1140
|
+
textDecoration: "none"
|
|
1136
1141
|
},
|
|
1137
|
-
children:
|
|
1142
|
+
children: /* @__PURE__ */ jsx(
|
|
1143
|
+
Typography,
|
|
1144
|
+
{
|
|
1145
|
+
variant: "subtitle2",
|
|
1146
|
+
color: "primary.dark",
|
|
1147
|
+
sx: {
|
|
1148
|
+
mt: 0.8,
|
|
1149
|
+
lineHeight: "15.4px",
|
|
1150
|
+
overflow: "hidden",
|
|
1151
|
+
textOverflow: "ellipsis",
|
|
1152
|
+
whiteSpace: "nowrap"
|
|
1153
|
+
},
|
|
1154
|
+
children: redir
|
|
1155
|
+
}
|
|
1156
|
+
)
|
|
1138
1157
|
}
|
|
1139
1158
|
) })
|
|
1140
1159
|
] }),
|
|
@@ -1403,23 +1422,30 @@ function ApprovalWorkflow({
|
|
|
1403
1422
|
}
|
|
1404
1423
|
),
|
|
1405
1424
|
/* @__PURE__ */ jsx(Tooltip, { title: redir, children: /* @__PURE__ */ jsx(
|
|
1406
|
-
|
|
1425
|
+
"a",
|
|
1407
1426
|
{
|
|
1408
|
-
component: "a",
|
|
1409
1427
|
href: redir,
|
|
1410
1428
|
target: "_blank",
|
|
1411
1429
|
rel: "noreferrer",
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
fontWeight: 500,
|
|
1416
|
-
textDecoration: "none",
|
|
1417
|
-
overflow: "hidden",
|
|
1418
|
-
textOverflow: "ellipsis",
|
|
1419
|
-
whiteSpace: "nowrap",
|
|
1420
|
-
mt: 0.8
|
|
1430
|
+
style: {
|
|
1431
|
+
cursor: "pointer",
|
|
1432
|
+
textDecoration: "none"
|
|
1421
1433
|
},
|
|
1422
|
-
children:
|
|
1434
|
+
children: /* @__PURE__ */ jsx(
|
|
1435
|
+
Typography,
|
|
1436
|
+
{
|
|
1437
|
+
variant: "subtitle2",
|
|
1438
|
+
color: "primary.dark",
|
|
1439
|
+
sx: {
|
|
1440
|
+
mt: 0.8,
|
|
1441
|
+
lineHeight: "15.4px",
|
|
1442
|
+
overflow: "hidden",
|
|
1443
|
+
textOverflow: "ellipsis",
|
|
1444
|
+
whiteSpace: "nowrap"
|
|
1445
|
+
},
|
|
1446
|
+
children: redir
|
|
1447
|
+
}
|
|
1448
|
+
)
|
|
1423
1449
|
}
|
|
1424
1450
|
) })
|
|
1425
1451
|
] }),
|
|
@@ -1614,18 +1640,11 @@ function ApprovalWorkflow({
|
|
|
1614
1640
|
pb: 3
|
|
1615
1641
|
},
|
|
1616
1642
|
children: visiblePendingRequests == null ? void 0 : visiblePendingRequests.map((info, index) => {
|
|
1617
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k
|
|
1643
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k;
|
|
1618
1644
|
const currentLevel = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
|
|
1619
1645
|
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
1620
1646
|
);
|
|
1621
1647
|
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
1648
|
const redir = buildRedirectionUrl(info);
|
|
1630
1649
|
const currentStatus = ((_d2 = (_c2 = (_b2 = info == null ? void 0 : info.levels) == null ? void 0 : _b2.find(
|
|
1631
1650
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
@@ -1633,7 +1652,7 @@ function ApprovalWorkflow({
|
|
|
1633
1652
|
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1634
1653
|
)) == null ? void 0 : _f2.selected_status) == null ? void 0 : _g2.status_id) === 3 ? "rejected" : "pending";
|
|
1635
1654
|
const statusData = getStatus2(currentStatus);
|
|
1636
|
-
return /* @__PURE__ */
|
|
1655
|
+
return /* @__PURE__ */ jsx(
|
|
1637
1656
|
Card,
|
|
1638
1657
|
{
|
|
1639
1658
|
ref: index === visiblePendingRequests.length - 1 ? lastCardRef : null,
|
|
@@ -1644,191 +1663,192 @@ function ApprovalWorkflow({
|
|
|
1644
1663
|
px: 3,
|
|
1645
1664
|
py: 2
|
|
1646
1665
|
},
|
|
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",
|
|
1666
|
+
children: /* @__PURE__ */ jsxs(
|
|
1667
|
+
CardContent,
|
|
1668
|
+
{
|
|
1669
|
+
sx: {
|
|
1670
|
+
display: "flex",
|
|
1671
|
+
justifyContent: "space-between",
|
|
1672
|
+
alignItems: "center",
|
|
1673
|
+
flexWrap: { xs: "wrap", md: "nowrap" },
|
|
1674
|
+
gap: 2
|
|
1675
|
+
},
|
|
1676
|
+
children: [
|
|
1677
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "20%", minWidth: 220 }, children: [
|
|
1678
|
+
/* @__PURE__ */ jsx(Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsx(Typography, { variant: "h6", fontWeight: 600, noWrap: true, children: info.activity_name }) }),
|
|
1679
|
+
/* @__PURE__ */ jsx(Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsx(
|
|
1680
|
+
Typography,
|
|
1681
|
+
{
|
|
1682
|
+
variant: "body2",
|
|
1683
|
+
color: "text.secondary",
|
|
1684
|
+
noWrap: true,
|
|
1685
|
+
sx: { mt: 0.5 },
|
|
1686
|
+
children: info.description_data
|
|
1687
|
+
}
|
|
1688
|
+
) })
|
|
1689
|
+
] }),
|
|
1690
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "18%", minWidth: 180 }, children: [
|
|
1691
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
|
|
1692
|
+
/* @__PURE__ */ jsx(Tooltip, { title: redir, children: /* @__PURE__ */ jsx(
|
|
1693
|
+
"a",
|
|
1694
|
+
{
|
|
1695
|
+
href: redir,
|
|
1696
|
+
target: "_blank",
|
|
1697
|
+
rel: "noreferrer",
|
|
1698
|
+
style: {
|
|
1699
|
+
cursor: "pointer",
|
|
1700
|
+
textDecoration: "none"
|
|
1701
|
+
},
|
|
1702
|
+
children: /* @__PURE__ */ jsx(
|
|
1703
|
+
Typography,
|
|
1704
|
+
{
|
|
1705
|
+
variant: "subtitle2",
|
|
1692
1706
|
color: "primary.dark",
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1707
|
+
sx: {
|
|
1708
|
+
mt: 0.8,
|
|
1709
|
+
lineHeight: "15.4px",
|
|
1710
|
+
overflow: "hidden",
|
|
1711
|
+
textOverflow: "ellipsis",
|
|
1712
|
+
whiteSpace: "nowrap"
|
|
1713
|
+
},
|
|
1714
|
+
children: redir
|
|
1715
|
+
}
|
|
1716
|
+
)
|
|
1717
|
+
}
|
|
1718
|
+
) })
|
|
1719
|
+
] }),
|
|
1720
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
|
|
1721
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
|
|
1722
|
+
/* @__PURE__ */ jsx(
|
|
1723
|
+
Typography,
|
|
1706
1724
|
{
|
|
1725
|
+
variant: "body2",
|
|
1726
|
+
noWrap: true,
|
|
1707
1727
|
sx: {
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
display: "flex",
|
|
1711
|
-
alignItems: "center",
|
|
1712
|
-
justifyContent: "flex-end",
|
|
1713
|
-
gap: 1.5
|
|
1728
|
+
mt: 0.8,
|
|
1729
|
+
color: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? "primary.dark" : "text.disabled"
|
|
1714
1730
|
},
|
|
1715
|
-
children:
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1731
|
+
children: ((_i = info == null ? void 0 : info.attachment_links) == null ? void 0 : _i.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
1732
|
+
}
|
|
1733
|
+
)
|
|
1734
|
+
] }),
|
|
1735
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
|
|
1736
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
|
|
1737
|
+
/* @__PURE__ */ jsx(
|
|
1738
|
+
Typography,
|
|
1739
|
+
{
|
|
1740
|
+
variant: "body2",
|
|
1741
|
+
sx: {
|
|
1742
|
+
mt: 0.8,
|
|
1743
|
+
fontWeight: 500,
|
|
1744
|
+
color: "text.primary"
|
|
1745
|
+
},
|
|
1746
|
+
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"
|
|
1747
|
+
}
|
|
1748
|
+
)
|
|
1749
|
+
] }),
|
|
1750
|
+
/* @__PURE__ */ jsxs(
|
|
1751
|
+
Box,
|
|
1752
|
+
{
|
|
1753
|
+
sx: {
|
|
1754
|
+
flexBasis: "8%",
|
|
1755
|
+
minWidth: 80,
|
|
1756
|
+
textAlign: "center"
|
|
1757
|
+
},
|
|
1758
|
+
children: [
|
|
1759
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
1760
|
+
/* @__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(
|
|
1761
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1762
|
+
)) != null ? _k : -1) + 1 || "") })
|
|
1763
|
+
]
|
|
1764
|
+
}
|
|
1765
|
+
),
|
|
1766
|
+
/* @__PURE__ */ jsxs(
|
|
1767
|
+
Box,
|
|
1768
|
+
{
|
|
1769
|
+
sx: {
|
|
1770
|
+
flexBasis: "18%",
|
|
1771
|
+
minWidth: 200,
|
|
1772
|
+
display: "flex",
|
|
1773
|
+
alignItems: "center",
|
|
1774
|
+
justifyContent: "flex-end",
|
|
1775
|
+
gap: 1.5
|
|
1776
|
+
},
|
|
1777
|
+
children: [
|
|
1778
|
+
(info == null ? void 0 : info.current_status) !== "completed" ? /* @__PURE__ */ jsx(
|
|
1779
|
+
Statusselector_default,
|
|
1780
|
+
{
|
|
1781
|
+
onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
|
|
1782
|
+
onApprove: () => {
|
|
1720
1783
|
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"
|
|
1784
|
+
return handleApprove(
|
|
1785
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
|
|
1786
|
+
);
|
|
1787
|
+
},
|
|
1788
|
+
onReject: () => {
|
|
1789
|
+
var _a3;
|
|
1790
|
+
return handleReject(
|
|
1791
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
|
|
1792
|
+
);
|
|
1793
|
+
},
|
|
1794
|
+
onHold: () => {
|
|
1795
|
+
var _a3;
|
|
1796
|
+
return handleOnHold(
|
|
1797
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
|
|
1798
|
+
);
|
|
1799
|
+
},
|
|
1800
|
+
statusList
|
|
1801
|
+
}
|
|
1802
|
+
) : /* @__PURE__ */ jsx(
|
|
1803
|
+
Chip,
|
|
1804
|
+
{
|
|
1805
|
+
variant: "filled",
|
|
1806
|
+
sx: {
|
|
1807
|
+
backgroundColor: statusData.color,
|
|
1808
|
+
color: statusData.labelColor,
|
|
1809
|
+
height: "40px",
|
|
1810
|
+
px: 2,
|
|
1811
|
+
borderRadius: "100px !important",
|
|
1812
|
+
"& .MuiChip-label": {
|
|
1813
|
+
fontSize: "14px",
|
|
1814
|
+
lineHeight: "15.4px",
|
|
1815
|
+
fontWeight: "500",
|
|
1816
|
+
textTransform: "capitalize"
|
|
1777
1817
|
}
|
|
1818
|
+
},
|
|
1819
|
+
label: statusData.title
|
|
1820
|
+
}
|
|
1821
|
+
),
|
|
1822
|
+
/* @__PURE__ */ jsx(
|
|
1823
|
+
Divider,
|
|
1824
|
+
{
|
|
1825
|
+
orientation: "vertical",
|
|
1826
|
+
flexItem: true,
|
|
1827
|
+
sx: {
|
|
1828
|
+
borderColor: "#E0E0E0",
|
|
1829
|
+
height: "40px"
|
|
1778
1830
|
}
|
|
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
|
-
]
|
|
1831
|
+
}
|
|
1832
|
+
),
|
|
1833
|
+
/* @__PURE__ */ jsx(
|
|
1834
|
+
IconButton,
|
|
1835
|
+
{
|
|
1836
|
+
color: "primary",
|
|
1837
|
+
sx: {
|
|
1838
|
+
background: "rgba(25,118,210,0.08)",
|
|
1839
|
+
boxShadow: "2px 2px 10px 0px #4C4E6426",
|
|
1840
|
+
"& span": { color: "primary.dark" }
|
|
1841
|
+
},
|
|
1842
|
+
onClick: () => handleExpandClick(info._id),
|
|
1843
|
+
children: expandedId === info._id ? /* @__PURE__ */ jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsx("span", { className: "icon-arrow-right-3" })
|
|
1844
|
+
}
|
|
1845
|
+
)
|
|
1846
|
+
]
|
|
1847
|
+
}
|
|
1848
|
+
)
|
|
1849
|
+
]
|
|
1850
|
+
}
|
|
1851
|
+
)
|
|
1832
1852
|
},
|
|
1833
1853
|
index
|
|
1834
1854
|
);
|
|
@@ -1888,7 +1908,15 @@ function DialogOpener({
|
|
|
1888
1908
|
}) {
|
|
1889
1909
|
const theme = useTheme();
|
|
1890
1910
|
useMediaQuery(theme.breakpoints.down("lg"));
|
|
1891
|
-
const [screenWidth, setScreenWidth] = useState(
|
|
1911
|
+
const [screenWidth, setScreenWidth] = useState(
|
|
1912
|
+
typeof window !== "undefined" ? window.innerWidth : 0
|
|
1913
|
+
);
|
|
1914
|
+
console.log("Dialog opener props", {
|
|
1915
|
+
openDialog,
|
|
1916
|
+
handleClose,
|
|
1917
|
+
userInfoData,
|
|
1918
|
+
selectedWorkflowsList
|
|
1919
|
+
});
|
|
1892
1920
|
useEffect(() => {
|
|
1893
1921
|
const updateScreenWidth = () => setScreenWidth(window.innerWidth);
|
|
1894
1922
|
window.addEventListener("resize", updateScreenWidth);
|
|
@@ -1901,18 +1929,37 @@ function DialogOpener({
|
|
|
1901
1929
|
open: openDialog,
|
|
1902
1930
|
onClose: () => handleClose && handleClose(),
|
|
1903
1931
|
"aria-labelledby": "responsive-dialog-title",
|
|
1904
|
-
sx: { zIndex:
|
|
1932
|
+
sx: { zIndex: 1234 },
|
|
1905
1933
|
children: [
|
|
1906
1934
|
/* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
1907
|
-
/* @__PURE__ */ jsx(
|
|
1908
|
-
|
|
1935
|
+
/* @__PURE__ */ jsx(
|
|
1936
|
+
IconButton,
|
|
1937
|
+
{
|
|
1938
|
+
onClick: handleClose,
|
|
1939
|
+
disableFocusRipple: true,
|
|
1940
|
+
disableRipple: true,
|
|
1941
|
+
sx: { float: "right" },
|
|
1942
|
+
children: /* @__PURE__ */ jsx(HighlightOffIcon, { style: { color: "#666666" } })
|
|
1943
|
+
}
|
|
1944
|
+
),
|
|
1945
|
+
/* @__PURE__ */ jsx(
|
|
1946
|
+
ApprovalWorkflow,
|
|
1947
|
+
{
|
|
1948
|
+
userInfo: userInfoData,
|
|
1949
|
+
selectedWorkflowsList
|
|
1950
|
+
}
|
|
1951
|
+
)
|
|
1909
1952
|
] }),
|
|
1910
1953
|
/* @__PURE__ */ jsx(DialogActions5, { children: /* @__PURE__ */ jsx(
|
|
1911
1954
|
Button7,
|
|
1912
1955
|
{
|
|
1913
1956
|
variant: "contained",
|
|
1914
1957
|
color: "primary",
|
|
1915
|
-
sx: {
|
|
1958
|
+
sx: {
|
|
1959
|
+
display: "flex",
|
|
1960
|
+
justifyContent: "flex-end",
|
|
1961
|
+
alignItems: "center"
|
|
1962
|
+
},
|
|
1916
1963
|
onClick: handleClose,
|
|
1917
1964
|
children: "Close"
|
|
1918
1965
|
}
|
|
@@ -1922,12 +1969,44 @@ function DialogOpener({
|
|
|
1922
1969
|
) });
|
|
1923
1970
|
}
|
|
1924
1971
|
function DialogOpener2(props) {
|
|
1925
|
-
const {
|
|
1926
|
-
|
|
1972
|
+
const {
|
|
1973
|
+
api,
|
|
1974
|
+
urlBuilder,
|
|
1975
|
+
loadingComponent,
|
|
1976
|
+
userInfoData,
|
|
1977
|
+
ENV_VARIABLES,
|
|
1978
|
+
...rest
|
|
1979
|
+
} = props;
|
|
1980
|
+
return /* @__PURE__ */ jsx(
|
|
1981
|
+
WorkflowProvider,
|
|
1982
|
+
{
|
|
1983
|
+
value: {
|
|
1984
|
+
api,
|
|
1985
|
+
urlBuilder,
|
|
1986
|
+
userInfo: userInfoData,
|
|
1987
|
+
loadingComponent,
|
|
1988
|
+
ENV_VARIABLES
|
|
1989
|
+
},
|
|
1990
|
+
children: /* @__PURE__ */ jsx(DialogOpener, { ...rest, userInfoData })
|
|
1991
|
+
}
|
|
1992
|
+
);
|
|
1927
1993
|
}
|
|
1928
1994
|
function ApprovalWorkflow2(props) {
|
|
1929
|
-
const {
|
|
1930
|
-
|
|
1995
|
+
const {
|
|
1996
|
+
api,
|
|
1997
|
+
urlBuilder,
|
|
1998
|
+
loadingComponent,
|
|
1999
|
+
userInfo,
|
|
2000
|
+
ENV_VARIABLES,
|
|
2001
|
+
...rest
|
|
2002
|
+
} = props;
|
|
2003
|
+
return /* @__PURE__ */ jsx(
|
|
2004
|
+
WorkflowProvider,
|
|
2005
|
+
{
|
|
2006
|
+
value: { api, urlBuilder, userInfo, loadingComponent, ENV_VARIABLES },
|
|
2007
|
+
children: /* @__PURE__ */ jsx(ApprovalWorkflow, { userInfo, ...rest })
|
|
2008
|
+
}
|
|
2009
|
+
);
|
|
1931
2010
|
}
|
|
1932
2011
|
|
|
1933
2012
|
export { ApprovalWorkflow2 as ApprovalWorkflow, DialogOpener2 as DialogOpener };
|