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.js CHANGED
@@ -752,7 +752,7 @@ function ApprovalWorkflow({
752
752
  }) {
753
753
  var _a, _b, _c, _d, _e, _f, _g;
754
754
  const theme = material.useTheme();
755
- const { api, urlBuilder, loadingComponent } = useWorkflowContext();
755
+ const { api, urlBuilder, loadingComponent, ENV_VARIABLES } = useWorkflowContext();
756
756
  const [selectedApprovalOtions, setSelectedApprovalOtions] = React7.useState(
757
757
  selectedWorkflowsList.length ? "selected" : "Action Required"
758
758
  );
@@ -825,12 +825,15 @@ function ApprovalWorkflow({
825
825
  },
826
826
  [isLoading, selectedApprovalOtions]
827
827
  );
828
- const visibleAllRequests = filteredAllRequestArray.slice(0, visibleAll);
829
- const visiblePendingRequests = filteredPendingRequestArray.slice(
828
+ const visibleAllRequests = (filteredAllRequestArray || []).slice(
829
+ 0,
830
+ visibleAll
831
+ );
832
+ const visiblePendingRequests = (filteredPendingRequestArray || []).slice(
830
833
  0,
831
834
  visiblePending
832
835
  );
833
- const visibleSelectedRequests = filteredSelectedRequestArray.slice(
836
+ const visibleSelectedRequests = (filteredSelectedRequestArray || []).slice(
834
837
  0,
835
838
  visibleSelected
836
839
  );
@@ -907,12 +910,12 @@ function ApprovalWorkflow({
907
910
  {
908
911
  label: "Action Required",
909
912
  icon: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-document-forward" }),
910
- count: pendingRequestArray.length || ""
913
+ count: pendingRequestArray ? pendingRequestArray.length : 0
911
914
  },
912
915
  {
913
916
  label: "All Requests",
914
917
  icon: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-document-copy" }),
915
- count: allRequestArray.length || ""
918
+ count: allRequestArray ? allRequestArray.length : 0
916
919
  }
917
920
  ];
918
921
  const fetchExpandedActivityLogs = (workflowLogId) => {
@@ -975,22 +978,31 @@ function ApprovalWorkflow({
975
978
  fetchSelectedActivites();
976
979
  }
977
980
  }, [selectedWorkflowsList]);
981
+ React7.useEffect(() => {
982
+ if (Object.keys(urlConfig).length > 0 && userInfo) {
983
+ fetchPendingActivities();
984
+ }
985
+ }, [urlConfig, userInfo]);
978
986
  const buildRedirectionUrl = (info) => {
979
- if (info == null ? void 0 : info.redirection_link) return info.redirection_link;
980
- if (urlBuilder)
981
- return urlBuilder(
982
- info == null ? void 0 : info.module_name,
983
- info == null ? void 0 : info.module_id,
984
- urlConfig,
985
- info == null ? void 0 : info.reference_id
986
- );
987
- const ref = urlConfig == null ? void 0 : urlConfig[info == null ? void 0 : info.module_name];
987
+ const { module_name, module_id, reference_id, redirection_link } = info;
988
+ if (redirection_link) return redirection_link;
989
+ if (module_name === "route_approval") {
990
+ return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.TRANSPORT_URL}route-listing/view/${reference_id}`;
991
+ } else if (module_name === "update_bus_details_approval") {
992
+ return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.TRANSPORT_URL}bus-listing/view/${reference_id}`;
993
+ } else if (module_name === "kit_handover_approve") {
994
+ return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.FINANCE_URL}fee-collection/?reference_id=${reference_id}&module_name=${module_name}&module_id=${module_id}`;
995
+ }
996
+ if (urlBuilder) {
997
+ return urlBuilder(module_name, module_id, urlConfig, reference_id);
998
+ }
999
+ const ref = urlConfig == null ? void 0 : urlConfig[module_name];
988
1000
  if ((ref == null ? void 0 : ref.base_url) && (ref == null ? void 0 : ref.sub_url)) {
989
1001
  const qs = new URLSearchParams();
990
- if (info == null ? void 0 : info.reference_id)
991
- qs.set("reference_id", String(info == null ? void 0 : info.reference_id));
992
- if (info == null ? void 0 : info.module_name) qs.set("module_name", String(info == null ? void 0 : info.module_name));
993
- return `${ref.base_url}${ref.sub_url}${qs.toString() ? `?${qs.toString()}` : ""}`;
1002
+ if (reference_id) qs.set("reference_id", String(reference_id));
1003
+ if (module_name) qs.set("module_name", String(module_name));
1004
+ if (module_id) qs.set("module_id", String(module_id));
1005
+ return `${ref.base_url}${ref.sub_url}?${qs.toString()}`;
994
1006
  }
995
1007
  return "#";
996
1008
  };
@@ -1132,23 +1144,30 @@ function ApprovalWorkflow({
1132
1144
  /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "20%", minWidth: 180 }, children: [
1133
1145
  /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
1134
1146
  /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
1135
- material.Typography,
1147
+ "a",
1136
1148
  {
1137
- component: "a",
1138
1149
  href: redir,
1139
1150
  target: "_blank",
1140
1151
  rel: "noreferrer",
1141
- sx: {
1142
- display: "block",
1143
- color: "primary.dark",
1144
- fontWeight: 500,
1145
- textDecoration: "none",
1146
- overflow: "hidden",
1147
- textOverflow: "ellipsis",
1148
- whiteSpace: "nowrap",
1149
- mt: 0.8
1152
+ style: {
1153
+ cursor: "pointer",
1154
+ textDecoration: "none"
1150
1155
  },
1151
- children: redir
1156
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1157
+ material.Typography,
1158
+ {
1159
+ variant: "subtitle2",
1160
+ color: "primary.dark",
1161
+ sx: {
1162
+ mt: 0.8,
1163
+ lineHeight: "15.4px",
1164
+ overflow: "hidden",
1165
+ textOverflow: "ellipsis",
1166
+ whiteSpace: "nowrap"
1167
+ },
1168
+ children: redir
1169
+ }
1170
+ )
1152
1171
  }
1153
1172
  ) })
1154
1173
  ] }),
@@ -1417,23 +1436,30 @@ function ApprovalWorkflow({
1417
1436
  }
1418
1437
  ),
1419
1438
  /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
1420
- material.Typography,
1439
+ "a",
1421
1440
  {
1422
- component: "a",
1423
1441
  href: redir,
1424
1442
  target: "_blank",
1425
1443
  rel: "noreferrer",
1426
- sx: {
1427
- display: "block",
1428
- color: "primary.dark",
1429
- fontWeight: 500,
1430
- textDecoration: "none",
1431
- overflow: "hidden",
1432
- textOverflow: "ellipsis",
1433
- whiteSpace: "nowrap",
1434
- mt: 0.8
1444
+ style: {
1445
+ cursor: "pointer",
1446
+ textDecoration: "none"
1435
1447
  },
1436
- children: redir
1448
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1449
+ material.Typography,
1450
+ {
1451
+ variant: "subtitle2",
1452
+ color: "primary.dark",
1453
+ sx: {
1454
+ mt: 0.8,
1455
+ lineHeight: "15.4px",
1456
+ overflow: "hidden",
1457
+ textOverflow: "ellipsis",
1458
+ whiteSpace: "nowrap"
1459
+ },
1460
+ children: redir
1461
+ }
1462
+ )
1437
1463
  }
1438
1464
  ) })
1439
1465
  ] }),
@@ -1628,18 +1654,11 @@ function ApprovalWorkflow({
1628
1654
  pb: 3
1629
1655
  },
1630
1656
  children: visiblePendingRequests == null ? void 0 : visiblePendingRequests.map((info, index) => {
1631
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l;
1657
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k;
1632
1658
  const currentLevel = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
1633
1659
  (level_) => level_.id === (info == null ? void 0 : info.current_level)
1634
1660
  );
1635
1661
  const statusList = currentLevel ? currentLevel.status_list : [];
1636
- (statusList || []).reduce(
1637
- (acc, s) => {
1638
- if ((s == null ? void 0 : s.status) != null) acc[s.status] = s;
1639
- return acc;
1640
- },
1641
- {}
1642
- );
1643
1662
  const redir = buildRedirectionUrl(info);
1644
1663
  const currentStatus = ((_d2 = (_c2 = (_b2 = info == null ? void 0 : info.levels) == null ? void 0 : _b2.find(
1645
1664
  (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
@@ -1647,7 +1666,7 @@ function ApprovalWorkflow({
1647
1666
  (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1648
1667
  )) == null ? void 0 : _f2.selected_status) == null ? void 0 : _g2.status_id) === 3 ? "rejected" : "pending";
1649
1668
  const statusData = getStatus2(currentStatus);
1650
- return /* @__PURE__ */ jsxRuntime.jsxs(
1669
+ return /* @__PURE__ */ jsxRuntime.jsx(
1651
1670
  material.Card,
1652
1671
  {
1653
1672
  ref: index === visiblePendingRequests.length - 1 ? lastCardRef : null,
@@ -1658,191 +1677,192 @@ function ApprovalWorkflow({
1658
1677
  px: 3,
1659
1678
  py: 2
1660
1679
  },
1661
- children: [
1662
- /* @__PURE__ */ jsxRuntime.jsxs(
1663
- material.CardContent,
1664
- {
1665
- sx: {
1666
- display: "flex",
1667
- justifyContent: "space-between",
1668
- alignItems: "center",
1669
- flexWrap: { xs: "wrap", md: "nowrap" },
1670
- gap: 2
1671
- },
1672
- children: [
1673
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "22%", minWidth: 220 }, children: [
1674
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsxRuntime.jsx(
1675
- material.Typography,
1676
- {
1677
- variant: "h6",
1678
- fontWeight: 600,
1679
- noWrap: true,
1680
- color: "text.primary",
1681
- children: info.activity_name
1682
- }
1683
- ) }),
1684
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsxRuntime.jsx(
1685
- material.Typography,
1686
- {
1687
- variant: "body2",
1688
- color: "text.secondary",
1689
- noWrap: true,
1690
- sx: { mt: 0.5 },
1691
- children: info.description_data
1692
- }
1693
- ) })
1694
- ] }),
1695
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "20%", minWidth: 180 }, children: [
1696
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
1697
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
1698
- material.Typography,
1699
- {
1700
- component: "a",
1701
- href: redir,
1702
- target: "_blank",
1703
- rel: "noreferrer",
1704
- sx: {
1705
- display: "block",
1680
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1681
+ material.CardContent,
1682
+ {
1683
+ sx: {
1684
+ display: "flex",
1685
+ justifyContent: "space-between",
1686
+ alignItems: "center",
1687
+ flexWrap: { xs: "wrap", md: "nowrap" },
1688
+ gap: 2
1689
+ },
1690
+ children: [
1691
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "20%", minWidth: 220 }, children: [
1692
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "h6", fontWeight: 600, noWrap: true, children: info.activity_name }) }),
1693
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsxRuntime.jsx(
1694
+ material.Typography,
1695
+ {
1696
+ variant: "body2",
1697
+ color: "text.secondary",
1698
+ noWrap: true,
1699
+ sx: { mt: 0.5 },
1700
+ children: info.description_data
1701
+ }
1702
+ ) })
1703
+ ] }),
1704
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "18%", minWidth: 180 }, children: [
1705
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
1706
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
1707
+ "a",
1708
+ {
1709
+ href: redir,
1710
+ target: "_blank",
1711
+ rel: "noreferrer",
1712
+ style: {
1713
+ cursor: "pointer",
1714
+ textDecoration: "none"
1715
+ },
1716
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1717
+ material.Typography,
1718
+ {
1719
+ variant: "subtitle2",
1706
1720
  color: "primary.dark",
1707
- fontWeight: 500,
1708
- textDecoration: "none",
1709
- overflow: "hidden",
1710
- textOverflow: "ellipsis",
1711
- whiteSpace: "nowrap",
1712
- mt: 0.8
1713
- },
1714
- children: redir
1715
- }
1716
- ) })
1717
- ] }),
1718
- /* @__PURE__ */ jsxRuntime.jsxs(
1719
- system.Box,
1721
+ sx: {
1722
+ mt: 0.8,
1723
+ lineHeight: "15.4px",
1724
+ overflow: "hidden",
1725
+ textOverflow: "ellipsis",
1726
+ whiteSpace: "nowrap"
1727
+ },
1728
+ children: redir
1729
+ }
1730
+ )
1731
+ }
1732
+ ) })
1733
+ ] }),
1734
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
1735
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
1736
+ /* @__PURE__ */ jsxRuntime.jsx(
1737
+ material.Typography,
1720
1738
  {
1739
+ variant: "body2",
1740
+ noWrap: true,
1721
1741
  sx: {
1722
- flexBasis: "18%",
1723
- minWidth: 200,
1724
- display: "flex",
1725
- alignItems: "center",
1726
- justifyContent: "flex-end",
1727
- gap: 1.5
1742
+ mt: 0.8,
1743
+ color: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? "primary.dark" : "text.disabled"
1728
1744
  },
1729
- children: [
1730
- (info == null ? void 0 : info.current_status) !== "completed" && ((_i = (_h = info == null ? void 0 : info.levels) == null ? void 0 : _h.find(
1731
- (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1732
- )) == null ? void 0 : _i.order) <= ((_k = (_j = info == null ? void 0 : info.levels) == null ? void 0 : _j.find(
1733
- (lvl) => {
1745
+ children: ((_i = info == null ? void 0 : info.attachment_links) == null ? void 0 : _i.length) ? `${info.attachment_links.length} file(s)` : "N/A"
1746
+ }
1747
+ )
1748
+ ] }),
1749
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
1750
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
1751
+ /* @__PURE__ */ jsxRuntime.jsx(
1752
+ material.Typography,
1753
+ {
1754
+ variant: "body2",
1755
+ sx: {
1756
+ mt: 0.8,
1757
+ fontWeight: 500,
1758
+ color: "text.primary"
1759
+ },
1760
+ children: (currentLevel == null ? void 0 : currentLevel.tat_expiry) ? moment__default.default(currentLevel.tat_expiry).utcOffset("UTC+05:30").format("DD/MM/YYYY hh:mm A") : "N/A"
1761
+ }
1762
+ )
1763
+ ] }),
1764
+ /* @__PURE__ */ jsxRuntime.jsxs(
1765
+ system.Box,
1766
+ {
1767
+ sx: {
1768
+ flexBasis: "8%",
1769
+ minWidth: 80,
1770
+ textAlign: "center"
1771
+ },
1772
+ children: [
1773
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
1774
+ /* @__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(
1775
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1776
+ )) != null ? _k : -1) + 1 || "") })
1777
+ ]
1778
+ }
1779
+ ),
1780
+ /* @__PURE__ */ jsxRuntime.jsxs(
1781
+ system.Box,
1782
+ {
1783
+ sx: {
1784
+ flexBasis: "18%",
1785
+ minWidth: 200,
1786
+ display: "flex",
1787
+ alignItems: "center",
1788
+ justifyContent: "flex-end",
1789
+ gap: 1.5
1790
+ },
1791
+ children: [
1792
+ (info == null ? void 0 : info.current_status) !== "completed" ? /* @__PURE__ */ jsxRuntime.jsx(
1793
+ Statusselector_default,
1794
+ {
1795
+ onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
1796
+ onApprove: () => {
1734
1797
  var _a3;
1735
- return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
1736
- }
1737
- )) == null ? void 0 : _k.order) ? /* @__PURE__ */ jsxRuntime.jsx(
1738
- Statusselector_default,
1739
- {
1740
- onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
1741
- onApprove: () => {
1742
- var _a3;
1743
- return handleApprove(
1744
- `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
1745
- );
1746
- },
1747
- onReject: () => {
1748
- var _a3;
1749
- return handleReject(
1750
- `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
1751
- );
1752
- },
1753
- onHold: () => {
1754
- var _a3;
1755
- return handleOnHold(
1756
- `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
1757
- );
1758
- },
1759
- statusList: (info == null ? void 0 : info.isLevelZero) && (info == null ? void 0 : info.created_by) === ((_l = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _l.id) ? statusList == null ? void 0 : statusList.filter(
1760
- (app) => app.status == 1
1761
- ) : statusList
1762
- }
1763
- ) : /* @__PURE__ */ jsxRuntime.jsx(
1764
- material.Chip,
1765
- {
1766
- variant: "filled",
1767
- sx: {
1768
- backgroundColor: getStatus2(currentStatus).color,
1769
- color: getStatus2(currentStatus).labelColor,
1770
- height: "40px",
1771
- px: 2,
1772
- borderRadius: "100px !important",
1773
- "& .MuiChip-label": {
1774
- fontSize: "14px",
1775
- lineHeight: "15.4px",
1776
- fontWeight: "500",
1777
- textTransform: "capitalize"
1778
- }
1779
- },
1780
- label: statusData.title
1781
- }
1782
- ),
1783
- /* @__PURE__ */ jsxRuntime.jsx(
1784
- material.Divider,
1785
- {
1786
- orientation: "vertical",
1787
- flexItem: true,
1788
- sx: {
1789
- borderColor: "#E0E0E0",
1790
- height: "40px"
1798
+ return handleApprove(
1799
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
1800
+ );
1801
+ },
1802
+ onReject: () => {
1803
+ var _a3;
1804
+ return handleReject(
1805
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
1806
+ );
1807
+ },
1808
+ onHold: () => {
1809
+ var _a3;
1810
+ return handleOnHold(
1811
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
1812
+ );
1813
+ },
1814
+ statusList
1815
+ }
1816
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1817
+ material.Chip,
1818
+ {
1819
+ variant: "filled",
1820
+ sx: {
1821
+ backgroundColor: statusData.color,
1822
+ color: statusData.labelColor,
1823
+ height: "40px",
1824
+ px: 2,
1825
+ borderRadius: "100px !important",
1826
+ "& .MuiChip-label": {
1827
+ fontSize: "14px",
1828
+ lineHeight: "15.4px",
1829
+ fontWeight: "500",
1830
+ textTransform: "capitalize"
1791
1831
  }
1832
+ },
1833
+ label: statusData.title
1834
+ }
1835
+ ),
1836
+ /* @__PURE__ */ jsxRuntime.jsx(
1837
+ material.Divider,
1838
+ {
1839
+ orientation: "vertical",
1840
+ flexItem: true,
1841
+ sx: {
1842
+ borderColor: "#E0E0E0",
1843
+ height: "40px"
1792
1844
  }
1793
- ),
1794
- /* @__PURE__ */ jsxRuntime.jsx(
1795
- material.IconButton,
1796
- {
1797
- disableFocusRipple: true,
1798
- disableRipple: true,
1799
- color: "primary",
1800
- sx: {
1801
- background: "rgba(25,118,210,0.08)",
1802
- boxShadow: "2px 2px 10px 0px #4C4E6426",
1803
- "& span": { color: "primary.dark" }
1804
- },
1805
- onClick: () => handleExpandClick(info._id),
1806
- children: expandedId === info._id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-right-3" })
1807
- }
1808
- )
1809
- ]
1810
- }
1811
- )
1812
- ]
1813
- }
1814
- ),
1815
- expandedId === info._id && /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { mt: 2, ml: 2 }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsxRuntime.jsx(
1816
- system.Box,
1817
- {
1818
- sx: {
1819
- height: 150,
1820
- display: "flex",
1821
- justifyContent: "center",
1822
- alignItems: "center"
1823
- },
1824
- children: /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 36, color: "primary" })
1825
- }
1826
- ) : /* @__PURE__ */ jsxRuntime.jsx(
1827
- ConnectedTimeline,
1828
- {
1829
- events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
1830
- var _a3, _b3, _c3, _d3;
1831
- return {
1832
- date: moment__default.default(item == null ? void 0 : item.created_at).format(
1833
- "DD-MM-YYYY"
1834
- ),
1835
- time: moment__default.default(item == null ? void 0 : item.created_at).format("HH:mm"),
1836
- 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",
1837
- subTitle: ((_c3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _c3.comment) || "No Comments",
1838
- attachment: ((_d3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _d3.file) || null,
1839
- count: (item == null ? void 0 : item.current_level) == "L0" ? "L0" : item == null ? void 0 : item.current_level_count,
1840
- cardType: "card"
1841
- };
1842
- })
1843
- }
1844
- ) })
1845
- ]
1845
+ }
1846
+ ),
1847
+ /* @__PURE__ */ jsxRuntime.jsx(
1848
+ material.IconButton,
1849
+ {
1850
+ color: "primary",
1851
+ sx: {
1852
+ background: "rgba(25,118,210,0.08)",
1853
+ boxShadow: "2px 2px 10px 0px #4C4E6426",
1854
+ "& span": { color: "primary.dark" }
1855
+ },
1856
+ onClick: () => handleExpandClick(info._id),
1857
+ children: expandedId === info._id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-right-3" })
1858
+ }
1859
+ )
1860
+ ]
1861
+ }
1862
+ )
1863
+ ]
1864
+ }
1865
+ )
1846
1866
  },
1847
1867
  index
1848
1868
  );
@@ -1902,7 +1922,15 @@ function DialogOpener({
1902
1922
  }) {
1903
1923
  const theme = styles.useTheme();
1904
1924
  useMediaQuery__default.default(theme.breakpoints.down("lg"));
1905
- const [screenWidth, setScreenWidth] = React7.useState(typeof window !== "undefined" ? window.innerWidth : 0);
1925
+ const [screenWidth, setScreenWidth] = React7.useState(
1926
+ typeof window !== "undefined" ? window.innerWidth : 0
1927
+ );
1928
+ console.log("Dialog opener props", {
1929
+ openDialog,
1930
+ handleClose,
1931
+ userInfoData,
1932
+ selectedWorkflowsList
1933
+ });
1906
1934
  React7.useEffect(() => {
1907
1935
  const updateScreenWidth = () => setScreenWidth(window.innerWidth);
1908
1936
  window.addEventListener("resize", updateScreenWidth);
@@ -1915,18 +1943,37 @@ function DialogOpener({
1915
1943
  open: openDialog,
1916
1944
  onClose: () => handleClose && handleClose(),
1917
1945
  "aria-labelledby": "responsive-dialog-title",
1918
- sx: { zIndex: 123 },
1946
+ sx: { zIndex: 1234 },
1919
1947
  children: [
1920
1948
  /* @__PURE__ */ jsxRuntime.jsxs(DialogContent__default.default, { children: [
1921
- /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { onClick: handleClose, disableFocusRipple: true, disableRipple: true, sx: { float: "right" }, children: /* @__PURE__ */ jsxRuntime.jsx(HighlightOffIcon__default.default, { style: { color: "#666666" } }) }),
1922
- /* @__PURE__ */ jsxRuntime.jsx(ApprovalWorkflow, { userInfo: userInfoData, selectedWorkflowsList })
1949
+ /* @__PURE__ */ jsxRuntime.jsx(
1950
+ material.IconButton,
1951
+ {
1952
+ onClick: handleClose,
1953
+ disableFocusRipple: true,
1954
+ disableRipple: true,
1955
+ sx: { float: "right" },
1956
+ children: /* @__PURE__ */ jsxRuntime.jsx(HighlightOffIcon__default.default, { style: { color: "#666666" } })
1957
+ }
1958
+ ),
1959
+ /* @__PURE__ */ jsxRuntime.jsx(
1960
+ ApprovalWorkflow,
1961
+ {
1962
+ userInfo: userInfoData,
1963
+ selectedWorkflowsList
1964
+ }
1965
+ )
1923
1966
  ] }),
1924
1967
  /* @__PURE__ */ jsxRuntime.jsx(DialogActions5__default.default, { children: /* @__PURE__ */ jsxRuntime.jsx(
1925
1968
  Button7__default.default,
1926
1969
  {
1927
1970
  variant: "contained",
1928
1971
  color: "primary",
1929
- sx: { display: "flex", justifyContent: "flex-end", alignItems: "center" },
1972
+ sx: {
1973
+ display: "flex",
1974
+ justifyContent: "flex-end",
1975
+ alignItems: "center"
1976
+ },
1930
1977
  onClick: handleClose,
1931
1978
  children: "Close"
1932
1979
  }
@@ -1936,12 +1983,44 @@ function DialogOpener({
1936
1983
  ) });
1937
1984
  }
1938
1985
  function DialogOpener2(props) {
1939
- const { api, urlBuilder, loadingComponent, userInfoData, ...rest } = props;
1940
- return /* @__PURE__ */ jsxRuntime.jsx(WorkflowProvider, { value: { api, urlBuilder, userInfo: userInfoData, loadingComponent }, children: /* @__PURE__ */ jsxRuntime.jsx(DialogOpener, { ...rest, userInfoData }) });
1986
+ const {
1987
+ api,
1988
+ urlBuilder,
1989
+ loadingComponent,
1990
+ userInfoData,
1991
+ ENV_VARIABLES,
1992
+ ...rest
1993
+ } = props;
1994
+ return /* @__PURE__ */ jsxRuntime.jsx(
1995
+ WorkflowProvider,
1996
+ {
1997
+ value: {
1998
+ api,
1999
+ urlBuilder,
2000
+ userInfo: userInfoData,
2001
+ loadingComponent,
2002
+ ENV_VARIABLES
2003
+ },
2004
+ children: /* @__PURE__ */ jsxRuntime.jsx(DialogOpener, { ...rest, userInfoData })
2005
+ }
2006
+ );
1941
2007
  }
1942
2008
  function ApprovalWorkflow2(props) {
1943
- const { api, urlBuilder, loadingComponent, userInfo, ...rest } = props;
1944
- return /* @__PURE__ */ jsxRuntime.jsx(WorkflowProvider, { value: { api, urlBuilder, userInfo, loadingComponent }, children: /* @__PURE__ */ jsxRuntime.jsx(ApprovalWorkflow, { userInfo, ...rest }) });
2009
+ const {
2010
+ api,
2011
+ urlBuilder,
2012
+ loadingComponent,
2013
+ userInfo,
2014
+ ENV_VARIABLES,
2015
+ ...rest
2016
+ } = props;
2017
+ return /* @__PURE__ */ jsxRuntime.jsx(
2018
+ WorkflowProvider,
2019
+ {
2020
+ value: { api, urlBuilder, userInfo, loadingComponent, ENV_VARIABLES },
2021
+ children: /* @__PURE__ */ jsxRuntime.jsx(ApprovalWorkflow, { userInfo, ...rest })
2022
+ }
2023
+ );
1945
2024
  }
1946
2025
 
1947
2026
  exports.ApprovalWorkflow = ApprovalWorkflow2;