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 CHANGED
@@ -31,11 +31,13 @@ declare function DialogOpener(props: DialogOpenerProps & {
31
31
  api: ApiClient;
32
32
  urlBuilder?: UrlBuilder;
33
33
  loadingComponent?: React.ReactNode;
34
+ ENV_VARIABLES?: any;
34
35
  }): react_jsx_runtime.JSX.Element;
35
36
  declare function ApprovalWorkflow(props: ApprovalWorkflowProps & {
36
37
  api: ApiClient;
37
38
  urlBuilder?: UrlBuilder;
38
39
  loadingComponent?: React.ReactNode;
40
+ ENV_VARIABLES?: any;
39
41
  }): react_jsx_runtime.JSX.Element;
40
42
 
41
43
  export { type ApiClient, ApprovalWorkflow, type ApprovalWorkflowProps, DialogOpener, type DialogOpenerProps, type UrlBuilder };
package/dist/index.d.ts CHANGED
@@ -31,11 +31,13 @@ declare function DialogOpener(props: DialogOpenerProps & {
31
31
  api: ApiClient;
32
32
  urlBuilder?: UrlBuilder;
33
33
  loadingComponent?: React.ReactNode;
34
+ ENV_VARIABLES?: any;
34
35
  }): react_jsx_runtime.JSX.Element;
35
36
  declare function ApprovalWorkflow(props: ApprovalWorkflowProps & {
36
37
  api: ApiClient;
37
38
  urlBuilder?: UrlBuilder;
38
39
  loadingComponent?: React.ReactNode;
40
+ ENV_VARIABLES?: any;
39
41
  }): react_jsx_runtime.JSX.Element;
40
42
 
41
43
  export { type ApiClient, ApprovalWorkflow, type ApprovalWorkflowProps, DialogOpener, type DialogOpenerProps, type UrlBuilder };
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
  );
@@ -975,22 +975,31 @@ function ApprovalWorkflow({
975
975
  fetchSelectedActivites();
976
976
  }
977
977
  }, [selectedWorkflowsList]);
978
+ React7.useEffect(() => {
979
+ if (Object.keys(urlConfig).length > 0 && userInfo) {
980
+ fetchPendingActivities();
981
+ }
982
+ }, [urlConfig, userInfo]);
978
983
  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];
984
+ const { module_name, module_id, reference_id, redirection_link } = info;
985
+ if (redirection_link) return redirection_link;
986
+ if (module_name === "route_approval") {
987
+ return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.TRANSPORT_URL}route-listing/view/${reference_id}`;
988
+ } else if (module_name === "update_bus_details_approval") {
989
+ return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.TRANSPORT_URL}bus-listing/view/${reference_id}`;
990
+ } else if (module_name === "kit_handover_approve") {
991
+ return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.FINANCE_URL}fee-collection/?reference_id=${reference_id}&module_name=${module_name}&module_id=${module_id}`;
992
+ }
993
+ if (urlBuilder) {
994
+ return urlBuilder(module_name, module_id, urlConfig, reference_id);
995
+ }
996
+ const ref = urlConfig == null ? void 0 : urlConfig[module_name];
988
997
  if ((ref == null ? void 0 : ref.base_url) && (ref == null ? void 0 : ref.sub_url)) {
989
998
  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()}` : ""}`;
999
+ if (reference_id) qs.set("reference_id", String(reference_id));
1000
+ if (module_name) qs.set("module_name", String(module_name));
1001
+ if (module_id) qs.set("module_id", String(module_id));
1002
+ return `${ref.base_url}${ref.sub_url}?${qs.toString()}`;
994
1003
  }
995
1004
  return "#";
996
1005
  };
@@ -1132,23 +1141,30 @@ function ApprovalWorkflow({
1132
1141
  /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "20%", minWidth: 180 }, children: [
1133
1142
  /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
1134
1143
  /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
1135
- material.Typography,
1144
+ "a",
1136
1145
  {
1137
- component: "a",
1138
1146
  href: redir,
1139
1147
  target: "_blank",
1140
1148
  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
1149
+ style: {
1150
+ cursor: "pointer",
1151
+ textDecoration: "none"
1150
1152
  },
1151
- children: redir
1153
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1154
+ material.Typography,
1155
+ {
1156
+ variant: "subtitle2",
1157
+ color: "primary.dark",
1158
+ sx: {
1159
+ mt: 0.8,
1160
+ lineHeight: "15.4px",
1161
+ overflow: "hidden",
1162
+ textOverflow: "ellipsis",
1163
+ whiteSpace: "nowrap"
1164
+ },
1165
+ children: redir
1166
+ }
1167
+ )
1152
1168
  }
1153
1169
  ) })
1154
1170
  ] }),
@@ -1417,23 +1433,30 @@ function ApprovalWorkflow({
1417
1433
  }
1418
1434
  ),
1419
1435
  /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
1420
- material.Typography,
1436
+ "a",
1421
1437
  {
1422
- component: "a",
1423
1438
  href: redir,
1424
1439
  target: "_blank",
1425
1440
  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
1441
+ style: {
1442
+ cursor: "pointer",
1443
+ textDecoration: "none"
1435
1444
  },
1436
- children: redir
1445
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1446
+ material.Typography,
1447
+ {
1448
+ variant: "subtitle2",
1449
+ color: "primary.dark",
1450
+ sx: {
1451
+ mt: 0.8,
1452
+ lineHeight: "15.4px",
1453
+ overflow: "hidden",
1454
+ textOverflow: "ellipsis",
1455
+ whiteSpace: "nowrap"
1456
+ },
1457
+ children: redir
1458
+ }
1459
+ )
1437
1460
  }
1438
1461
  ) })
1439
1462
  ] }),
@@ -1628,18 +1651,11 @@ function ApprovalWorkflow({
1628
1651
  pb: 3
1629
1652
  },
1630
1653
  children: visiblePendingRequests == null ? void 0 : visiblePendingRequests.map((info, index) => {
1631
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l;
1654
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k;
1632
1655
  const currentLevel = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
1633
1656
  (level_) => level_.id === (info == null ? void 0 : info.current_level)
1634
1657
  );
1635
1658
  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
1659
  const redir = buildRedirectionUrl(info);
1644
1660
  const currentStatus = ((_d2 = (_c2 = (_b2 = info == null ? void 0 : info.levels) == null ? void 0 : _b2.find(
1645
1661
  (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
@@ -1647,7 +1663,7 @@ function ApprovalWorkflow({
1647
1663
  (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1648
1664
  )) == null ? void 0 : _f2.selected_status) == null ? void 0 : _g2.status_id) === 3 ? "rejected" : "pending";
1649
1665
  const statusData = getStatus2(currentStatus);
1650
- return /* @__PURE__ */ jsxRuntime.jsxs(
1666
+ return /* @__PURE__ */ jsxRuntime.jsx(
1651
1667
  material.Card,
1652
1668
  {
1653
1669
  ref: index === visiblePendingRequests.length - 1 ? lastCardRef : null,
@@ -1658,191 +1674,192 @@ function ApprovalWorkflow({
1658
1674
  px: 3,
1659
1675
  py: 2
1660
1676
  },
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",
1677
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1678
+ material.CardContent,
1679
+ {
1680
+ sx: {
1681
+ display: "flex",
1682
+ justifyContent: "space-between",
1683
+ alignItems: "center",
1684
+ flexWrap: { xs: "wrap", md: "nowrap" },
1685
+ gap: 2
1686
+ },
1687
+ children: [
1688
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "20%", minWidth: 220 }, children: [
1689
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "h6", fontWeight: 600, noWrap: true, children: info.activity_name }) }),
1690
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsxRuntime.jsx(
1691
+ material.Typography,
1692
+ {
1693
+ variant: "body2",
1694
+ color: "text.secondary",
1695
+ noWrap: true,
1696
+ sx: { mt: 0.5 },
1697
+ children: info.description_data
1698
+ }
1699
+ ) })
1700
+ ] }),
1701
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "18%", minWidth: 180 }, children: [
1702
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
1703
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
1704
+ "a",
1705
+ {
1706
+ href: redir,
1707
+ target: "_blank",
1708
+ rel: "noreferrer",
1709
+ style: {
1710
+ cursor: "pointer",
1711
+ textDecoration: "none"
1712
+ },
1713
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1714
+ material.Typography,
1715
+ {
1716
+ variant: "subtitle2",
1706
1717
  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,
1718
+ sx: {
1719
+ mt: 0.8,
1720
+ lineHeight: "15.4px",
1721
+ overflow: "hidden",
1722
+ textOverflow: "ellipsis",
1723
+ whiteSpace: "nowrap"
1724
+ },
1725
+ children: redir
1726
+ }
1727
+ )
1728
+ }
1729
+ ) })
1730
+ ] }),
1731
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
1732
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
1733
+ /* @__PURE__ */ jsxRuntime.jsx(
1734
+ material.Typography,
1720
1735
  {
1736
+ variant: "body2",
1737
+ noWrap: true,
1721
1738
  sx: {
1722
- flexBasis: "18%",
1723
- minWidth: 200,
1724
- display: "flex",
1725
- alignItems: "center",
1726
- justifyContent: "flex-end",
1727
- gap: 1.5
1739
+ mt: 0.8,
1740
+ color: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? "primary.dark" : "text.disabled"
1728
1741
  },
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) => {
1742
+ children: ((_i = info == null ? void 0 : info.attachment_links) == null ? void 0 : _i.length) ? `${info.attachment_links.length} file(s)` : "N/A"
1743
+ }
1744
+ )
1745
+ ] }),
1746
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
1747
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
1748
+ /* @__PURE__ */ jsxRuntime.jsx(
1749
+ material.Typography,
1750
+ {
1751
+ variant: "body2",
1752
+ sx: {
1753
+ mt: 0.8,
1754
+ fontWeight: 500,
1755
+ color: "text.primary"
1756
+ },
1757
+ 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"
1758
+ }
1759
+ )
1760
+ ] }),
1761
+ /* @__PURE__ */ jsxRuntime.jsxs(
1762
+ system.Box,
1763
+ {
1764
+ sx: {
1765
+ flexBasis: "8%",
1766
+ minWidth: 80,
1767
+ textAlign: "center"
1768
+ },
1769
+ children: [
1770
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
1771
+ /* @__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(
1772
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1773
+ )) != null ? _k : -1) + 1 || "") })
1774
+ ]
1775
+ }
1776
+ ),
1777
+ /* @__PURE__ */ jsxRuntime.jsxs(
1778
+ system.Box,
1779
+ {
1780
+ sx: {
1781
+ flexBasis: "18%",
1782
+ minWidth: 200,
1783
+ display: "flex",
1784
+ alignItems: "center",
1785
+ justifyContent: "flex-end",
1786
+ gap: 1.5
1787
+ },
1788
+ children: [
1789
+ (info == null ? void 0 : info.current_status) !== "completed" ? /* @__PURE__ */ jsxRuntime.jsx(
1790
+ Statusselector_default,
1791
+ {
1792
+ onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
1793
+ onApprove: () => {
1734
1794
  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"
1795
+ return handleApprove(
1796
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
1797
+ );
1798
+ },
1799
+ onReject: () => {
1800
+ var _a3;
1801
+ return handleReject(
1802
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
1803
+ );
1804
+ },
1805
+ onHold: () => {
1806
+ var _a3;
1807
+ return handleOnHold(
1808
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
1809
+ );
1810
+ },
1811
+ statusList
1812
+ }
1813
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1814
+ material.Chip,
1815
+ {
1816
+ variant: "filled",
1817
+ sx: {
1818
+ backgroundColor: statusData.color,
1819
+ color: statusData.labelColor,
1820
+ height: "40px",
1821
+ px: 2,
1822
+ borderRadius: "100px !important",
1823
+ "& .MuiChip-label": {
1824
+ fontSize: "14px",
1825
+ lineHeight: "15.4px",
1826
+ fontWeight: "500",
1827
+ textTransform: "capitalize"
1791
1828
  }
1829
+ },
1830
+ label: statusData.title
1831
+ }
1832
+ ),
1833
+ /* @__PURE__ */ jsxRuntime.jsx(
1834
+ material.Divider,
1835
+ {
1836
+ orientation: "vertical",
1837
+ flexItem: true,
1838
+ sx: {
1839
+ borderColor: "#E0E0E0",
1840
+ height: "40px"
1792
1841
  }
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
- ]
1842
+ }
1843
+ ),
1844
+ /* @__PURE__ */ jsxRuntime.jsx(
1845
+ material.IconButton,
1846
+ {
1847
+ color: "primary",
1848
+ sx: {
1849
+ background: "rgba(25,118,210,0.08)",
1850
+ boxShadow: "2px 2px 10px 0px #4C4E6426",
1851
+ "& span": { color: "primary.dark" }
1852
+ },
1853
+ onClick: () => handleExpandClick(info._id),
1854
+ children: expandedId === info._id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-right-3" })
1855
+ }
1856
+ )
1857
+ ]
1858
+ }
1859
+ )
1860
+ ]
1861
+ }
1862
+ )
1846
1863
  },
1847
1864
  index
1848
1865
  );
@@ -1936,12 +1953,44 @@ function DialogOpener({
1936
1953
  ) });
1937
1954
  }
1938
1955
  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 }) });
1956
+ const {
1957
+ api,
1958
+ urlBuilder,
1959
+ loadingComponent,
1960
+ userInfoData,
1961
+ ENV_VARIABLES,
1962
+ ...rest
1963
+ } = props;
1964
+ return /* @__PURE__ */ jsxRuntime.jsx(
1965
+ WorkflowProvider,
1966
+ {
1967
+ value: {
1968
+ api,
1969
+ urlBuilder,
1970
+ userInfo: userInfoData,
1971
+ loadingComponent,
1972
+ ENV_VARIABLES
1973
+ },
1974
+ children: /* @__PURE__ */ jsxRuntime.jsx(DialogOpener, { ...rest, userInfoData })
1975
+ }
1976
+ );
1941
1977
  }
1942
1978
  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 }) });
1979
+ const {
1980
+ api,
1981
+ urlBuilder,
1982
+ loadingComponent,
1983
+ userInfo,
1984
+ ENV_VARIABLES,
1985
+ ...rest
1986
+ } = props;
1987
+ return /* @__PURE__ */ jsxRuntime.jsx(
1988
+ WorkflowProvider,
1989
+ {
1990
+ value: { api, urlBuilder, userInfo, loadingComponent, ENV_VARIABLES },
1991
+ children: /* @__PURE__ */ jsxRuntime.jsx(ApprovalWorkflow, { userInfo, ...rest })
1992
+ }
1993
+ );
1945
1994
  }
1946
1995
 
1947
1996
  exports.ApprovalWorkflow = ApprovalWorkflow2;