amp-workflow-ui 0.1.11 → 0.1.13
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.css +10 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +952 -941
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +952 -941
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -882,7 +882,7 @@ var CustomCard = styled(Card)(
|
|
|
882
882
|
width: CARD_WIDTH,
|
|
883
883
|
height: CARD_HEIGHT,
|
|
884
884
|
borderRadius: 16,
|
|
885
|
-
backgroundColor: cardType === "subCard" ? "#FFF2D8" : cardType === "disableCard" ? "#ECECEC" : "#F1F1FF",
|
|
885
|
+
backgroundColor: cardType === "subCard" ? "#FFF2D8 !important" : cardType === "disableCard" ? "#ECECEC !important" : "#F1F1FF !important",
|
|
886
886
|
border: cardType === "disableCard" ? "none" : `1px solid ${theme.palette.primary.dark}`,
|
|
887
887
|
overflow: "hidden",
|
|
888
888
|
position: "relative"
|
|
@@ -995,8 +995,8 @@ function CustomTimelineWithStatus({ events }) {
|
|
|
995
995
|
{
|
|
996
996
|
label: event.status.title,
|
|
997
997
|
sx: {
|
|
998
|
-
backgroundColor: event.status.color
|
|
999
|
-
color: event.status.labelColor
|
|
998
|
+
backgroundColor: `${event.status.color} !important`,
|
|
999
|
+
color: `${event.status.labelColor} !important`,
|
|
1000
1000
|
borderRadius: "40px",
|
|
1001
1001
|
height: 28,
|
|
1002
1002
|
fontWeight: 600,
|
|
@@ -1404,1019 +1404,1030 @@ function ApprovalWorkflow({
|
|
|
1404
1404
|
/* @__PURE__ */ jsx(
|
|
1405
1405
|
Box,
|
|
1406
1406
|
{
|
|
1407
|
-
sx: {
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
variant: "filled",
|
|
1426
|
-
sx: {
|
|
1427
|
-
mr: 4,
|
|
1428
|
-
mb: 4,
|
|
1429
|
-
"& .MuiChip-icon": { fontSize: "18px !important" }
|
|
1430
|
-
},
|
|
1431
|
-
onClick: () => handleProfileToggle("selected")
|
|
1432
|
-
}
|
|
1433
|
-
) }) : "",
|
|
1434
|
-
approvalChipLabel.map(({ label, icon, count }, index) => /* @__PURE__ */ jsx(Tooltip, { title: `${count} ${label}`, children: /* @__PURE__ */ jsx(
|
|
1435
|
-
StyledChipProps,
|
|
1436
|
-
{
|
|
1437
|
-
label: `${count} ${label}`,
|
|
1438
|
-
icon,
|
|
1439
|
-
color: (selectedApprovalOtions == null ? void 0 : selectedApprovalOtions.includes(label)) ? "primary" : "default",
|
|
1440
|
-
variant: "filled",
|
|
1441
|
-
sx: {
|
|
1442
|
-
mr: 4,
|
|
1443
|
-
mb: 4,
|
|
1444
|
-
"& .MuiChip-icon": { fontSize: "18px !important" }
|
|
1445
|
-
},
|
|
1446
|
-
onClick: () => handleProfileToggle(label)
|
|
1447
|
-
}
|
|
1448
|
-
) }, index))
|
|
1449
|
-
] }),
|
|
1450
|
-
/* @__PURE__ */ jsx(Box, { sx: { flexGrow: 1, maxWidth: 250, ml: "auto" }, children: /* @__PURE__ */ jsx(
|
|
1451
|
-
SearchBox_default,
|
|
1452
|
-
{
|
|
1453
|
-
placeHolderTitle: "Search",
|
|
1454
|
-
searchText,
|
|
1455
|
-
handleClearSearch,
|
|
1456
|
-
handleInputChange: (e) => handleSearchChange(e.target.value)
|
|
1457
|
-
}
|
|
1458
|
-
) })
|
|
1459
|
-
]
|
|
1460
|
-
}
|
|
1461
|
-
),
|
|
1462
|
-
selectedApprovalOtions === "selected" && /* @__PURE__ */ jsx(
|
|
1463
|
-
Box,
|
|
1464
|
-
{
|
|
1465
|
-
className: "fixedModal",
|
|
1466
|
-
sx: {
|
|
1467
|
-
overflowY: "auto",
|
|
1468
|
-
height: "calc(100vh - 180px)",
|
|
1469
|
-
px: 2,
|
|
1470
|
-
pb: 3
|
|
1471
|
-
},
|
|
1472
|
-
children: visibleSelectedRequests.length > 0 ? visibleSelectedRequests == null ? void 0 : visibleSelectedRequests.map((info, index) => {
|
|
1473
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
1474
|
-
const currentLevel = info == null ? void 0 : info.levels.find(
|
|
1475
|
-
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
1476
|
-
);
|
|
1477
|
-
const statusList = currentLevel ? currentLevel.status_list : [];
|
|
1478
|
-
(statusList || []).reduce(
|
|
1479
|
-
(acc, s) => {
|
|
1480
|
-
if ((s == null ? void 0 : s.status) != null) acc[s.status] = s;
|
|
1481
|
-
return acc;
|
|
1407
|
+
sx: {
|
|
1408
|
+
display: "flex",
|
|
1409
|
+
justifyContent: "center",
|
|
1410
|
+
flexWrap: "nowrap",
|
|
1411
|
+
overflow: "hidden !important"
|
|
1412
|
+
},
|
|
1413
|
+
children: /* @__PURE__ */ jsxs(
|
|
1414
|
+
Box,
|
|
1415
|
+
{
|
|
1416
|
+
sx: { width: "100%", height: "100%", overflow: "hidden !important" },
|
|
1417
|
+
children: [
|
|
1418
|
+
/* @__PURE__ */ jsxs(
|
|
1419
|
+
Box,
|
|
1420
|
+
{
|
|
1421
|
+
sx: {
|
|
1422
|
+
display: "flex",
|
|
1423
|
+
justifyContent: "space-between",
|
|
1424
|
+
alignItems: "center"
|
|
1482
1425
|
},
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
return statusList2.filter((item) => item.status !== 3);
|
|
1488
|
-
};
|
|
1489
|
-
const redir = buildRedirectionUrl(info);
|
|
1490
|
-
const currentStatus = ((_c2 = (_b2 = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
|
|
1491
|
-
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1492
|
-
)) == null ? void 0 : _b2.selected_status) == null ? void 0 : _c2.status_id) === 1 ? "approved" : ((_f2 = (_e2 = (_d2 = info == null ? void 0 : info.levels) == null ? void 0 : _d2.find(
|
|
1493
|
-
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1494
|
-
)) == null ? void 0 : _e2.selected_status) == null ? void 0 : _f2.status_id) === 3 ? "rejected" : "pending";
|
|
1495
|
-
const statusData = getStatus(currentStatus);
|
|
1496
|
-
return /* @__PURE__ */ jsxs(
|
|
1497
|
-
Card,
|
|
1498
|
-
{
|
|
1499
|
-
ref: index === visibleSelectedRequests.length - 1 ? lastCardRef : null,
|
|
1500
|
-
sx: {
|
|
1501
|
-
mb: 3,
|
|
1502
|
-
borderRadius: "14px",
|
|
1503
|
-
boxShadow: "0px 2px 10px rgba(76, 78, 100, 0.1)",
|
|
1504
|
-
px: 3,
|
|
1505
|
-
py: 2,
|
|
1506
|
-
background: "white"
|
|
1507
|
-
},
|
|
1508
|
-
children: [
|
|
1509
|
-
/* @__PURE__ */ jsxs(
|
|
1510
|
-
CardContent,
|
|
1426
|
+
children: [
|
|
1427
|
+
/* @__PURE__ */ jsxs(Box, { sx: { mt: 2, mb: 2 }, children: [
|
|
1428
|
+
(selectedWorkflowsList == null ? void 0 : selectedWorkflowsList.length) ? /* @__PURE__ */ jsx(Tooltip, { title: "Selected Workflows", children: /* @__PURE__ */ jsx(
|
|
1429
|
+
StyledChipProps,
|
|
1511
1430
|
{
|
|
1431
|
+
label: "Selected",
|
|
1432
|
+
icon: /* @__PURE__ */ jsx("span", { className: "icon-eye" }),
|
|
1433
|
+
color: (selectedApprovalOtions == null ? void 0 : selectedApprovalOtions.includes("selected")) ? "primary" : "default",
|
|
1434
|
+
variant: "filled",
|
|
1512
1435
|
sx: {
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
flexWrap: { xs: "wrap", md: "nowrap" },
|
|
1517
|
-
gap: 2
|
|
1436
|
+
mr: 4,
|
|
1437
|
+
mb: 4,
|
|
1438
|
+
"& .MuiChip-icon": { fontSize: "18px !important" }
|
|
1518
1439
|
},
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1440
|
+
onClick: () => handleProfileToggle("selected")
|
|
1441
|
+
}
|
|
1442
|
+
) }) : "",
|
|
1443
|
+
approvalChipLabel.map(({ label, icon, count }, index) => /* @__PURE__ */ jsx(Tooltip, { title: `${count} ${label}`, children: /* @__PURE__ */ jsx(
|
|
1444
|
+
StyledChipProps,
|
|
1445
|
+
{
|
|
1446
|
+
label: `${count} ${label}`,
|
|
1447
|
+
icon,
|
|
1448
|
+
color: (selectedApprovalOtions == null ? void 0 : selectedApprovalOtions.includes(label)) ? "primary" : "default",
|
|
1449
|
+
variant: "filled",
|
|
1450
|
+
sx: {
|
|
1451
|
+
mr: 4,
|
|
1452
|
+
mb: 4,
|
|
1453
|
+
"& .MuiChip-icon": { fontSize: "18px !important" }
|
|
1454
|
+
},
|
|
1455
|
+
onClick: () => handleProfileToggle(label)
|
|
1456
|
+
}
|
|
1457
|
+
) }, index))
|
|
1458
|
+
] }),
|
|
1459
|
+
/* @__PURE__ */ jsx(Box, { sx: { flexGrow: 1, maxWidth: 250, ml: "auto" }, children: /* @__PURE__ */ jsx(
|
|
1460
|
+
SearchBox_default,
|
|
1461
|
+
{
|
|
1462
|
+
placeHolderTitle: "Search",
|
|
1463
|
+
searchText,
|
|
1464
|
+
handleClearSearch,
|
|
1465
|
+
handleInputChange: (e) => handleSearchChange(e.target.value)
|
|
1466
|
+
}
|
|
1467
|
+
) })
|
|
1468
|
+
]
|
|
1469
|
+
}
|
|
1470
|
+
),
|
|
1471
|
+
selectedApprovalOtions === "selected" && /* @__PURE__ */ jsx(
|
|
1472
|
+
Box,
|
|
1473
|
+
{
|
|
1474
|
+
className: "fixedModal hide-scrollbar",
|
|
1475
|
+
sx: {
|
|
1476
|
+
overflowY: "auto",
|
|
1477
|
+
height: "calc(100vh - 180px)",
|
|
1478
|
+
px: 2,
|
|
1479
|
+
pb: 3
|
|
1480
|
+
},
|
|
1481
|
+
children: visibleSelectedRequests.length > 0 ? visibleSelectedRequests == null ? void 0 : visibleSelectedRequests.map((info, index) => {
|
|
1482
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
1483
|
+
const currentLevel = info == null ? void 0 : info.levels.find(
|
|
1484
|
+
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
1485
|
+
);
|
|
1486
|
+
const statusList = currentLevel ? currentLevel.status_list : [];
|
|
1487
|
+
(statusList || []).reduce(
|
|
1488
|
+
(acc, s) => {
|
|
1489
|
+
if ((s == null ? void 0 : s.status) != null) acc[s.status] = s;
|
|
1490
|
+
return acc;
|
|
1491
|
+
},
|
|
1492
|
+
{}
|
|
1493
|
+
);
|
|
1494
|
+
const filterRejectForLevelZero = (statusList2, info2) => {
|
|
1495
|
+
if (!(info2 == null ? void 0 : info2.isLevelZero)) return statusList2;
|
|
1496
|
+
return statusList2.filter((item) => item.status !== 3);
|
|
1497
|
+
};
|
|
1498
|
+
const redir = buildRedirectionUrl(info);
|
|
1499
|
+
const currentStatus = ((_c2 = (_b2 = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
|
|
1500
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1501
|
+
)) == null ? void 0 : _b2.selected_status) == null ? void 0 : _c2.status_id) === 1 ? "approved" : ((_f2 = (_e2 = (_d2 = info == null ? void 0 : info.levels) == null ? void 0 : _d2.find(
|
|
1502
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1503
|
+
)) == null ? void 0 : _e2.selected_status) == null ? void 0 : _f2.status_id) === 3 ? "rejected" : "pending";
|
|
1504
|
+
const statusData = getStatus(currentStatus);
|
|
1505
|
+
return /* @__PURE__ */ jsxs(
|
|
1506
|
+
Card,
|
|
1507
|
+
{
|
|
1508
|
+
ref: index === visibleSelectedRequests.length - 1 ? lastCardRef : null,
|
|
1509
|
+
sx: {
|
|
1510
|
+
mb: 3,
|
|
1511
|
+
borderRadius: "14px",
|
|
1512
|
+
boxShadow: "0px 2px 10px rgba(76, 78, 100, 0.1)",
|
|
1513
|
+
px: 3,
|
|
1514
|
+
py: 2,
|
|
1515
|
+
background: "white !important"
|
|
1516
|
+
},
|
|
1517
|
+
children: [
|
|
1518
|
+
/* @__PURE__ */ jsxs(
|
|
1519
|
+
CardContent,
|
|
1520
|
+
{
|
|
1521
|
+
sx: {
|
|
1522
|
+
display: "flex",
|
|
1523
|
+
justifyContent: "space-between",
|
|
1524
|
+
alignItems: "center",
|
|
1525
|
+
flexWrap: { xs: "wrap", md: "nowrap" },
|
|
1526
|
+
gap: 2
|
|
1527
|
+
},
|
|
1528
|
+
children: [
|
|
1529
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "22%", minWidth: 220 }, children: [
|
|
1530
|
+
/* @__PURE__ */ jsx(Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsx(
|
|
1555
1531
|
Typography,
|
|
1556
1532
|
{
|
|
1557
|
-
variant: "
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
overflow: "hidden",
|
|
1563
|
-
textOverflow: "ellipsis",
|
|
1564
|
-
whiteSpace: "nowrap"
|
|
1565
|
-
},
|
|
1566
|
-
children: redir
|
|
1567
|
-
}
|
|
1568
|
-
)
|
|
1569
|
-
}
|
|
1570
|
-
) })
|
|
1571
|
-
] }),
|
|
1572
|
-
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
|
|
1573
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
|
|
1574
|
-
/* @__PURE__ */ jsx(
|
|
1575
|
-
Typography,
|
|
1576
|
-
{
|
|
1577
|
-
variant: "body2",
|
|
1578
|
-
noWrap: true,
|
|
1579
|
-
sx: {
|
|
1580
|
-
mt: 0.8,
|
|
1581
|
-
color: ((_g2 = info == null ? void 0 : info.attachment_links) == null ? void 0 : _g2.length) ? "primary.dark" : "text.disabled"
|
|
1582
|
-
},
|
|
1583
|
-
children: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
1584
|
-
}
|
|
1585
|
-
)
|
|
1586
|
-
] }),
|
|
1587
|
-
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
|
|
1588
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
|
|
1589
|
-
/* @__PURE__ */ jsx(
|
|
1590
|
-
Typography,
|
|
1591
|
-
{
|
|
1592
|
-
variant: "body2",
|
|
1593
|
-
sx: {
|
|
1594
|
-
mt: 0.8,
|
|
1595
|
-
fontWeight: 500,
|
|
1596
|
-
color: "text.primary"
|
|
1597
|
-
},
|
|
1598
|
-
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"
|
|
1599
|
-
}
|
|
1600
|
-
)
|
|
1601
|
-
] }),
|
|
1602
|
-
/* @__PURE__ */ jsxs(
|
|
1603
|
-
Box,
|
|
1604
|
-
{
|
|
1605
|
-
sx: {
|
|
1606
|
-
flexBasis: "8%",
|
|
1607
|
-
minWidth: 80,
|
|
1608
|
-
textAlign: "center"
|
|
1609
|
-
},
|
|
1610
|
-
children: [
|
|
1611
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
1612
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_j = (_i = info == null ? void 0 : info.levels) == null ? void 0 : _i.findIndex(
|
|
1613
|
-
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1614
|
-
)) != null ? _j : -1) + 1 || "") })
|
|
1615
|
-
]
|
|
1616
|
-
}
|
|
1617
|
-
),
|
|
1618
|
-
/* @__PURE__ */ jsxs(
|
|
1619
|
-
Box,
|
|
1620
|
-
{
|
|
1621
|
-
sx: {
|
|
1622
|
-
flexBasis: "18%",
|
|
1623
|
-
minWidth: 200,
|
|
1624
|
-
display: "flex",
|
|
1625
|
-
alignItems: "center",
|
|
1626
|
-
justifyContent: "flex-end",
|
|
1627
|
-
gap: 1.5
|
|
1628
|
-
},
|
|
1629
|
-
children: [
|
|
1630
|
-
(info == null ? void 0 : info.current_status) !== "completed" && ((_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find(
|
|
1631
|
-
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1632
|
-
)) == null ? void 0 : _l.order) <= ((_n = (_m = info == null ? void 0 : info.levels) == null ? void 0 : _m.find(
|
|
1633
|
-
(lvl) => {
|
|
1634
|
-
var _a3;
|
|
1635
|
-
return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
|
|
1533
|
+
variant: "h6",
|
|
1534
|
+
fontWeight: 600,
|
|
1535
|
+
noWrap: true,
|
|
1536
|
+
color: "text.primary",
|
|
1537
|
+
children: info.activity_name
|
|
1636
1538
|
}
|
|
1637
|
-
)
|
|
1638
|
-
|
|
1539
|
+
) }),
|
|
1540
|
+
/* @__PURE__ */ jsx(Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsx(
|
|
1541
|
+
Typography,
|
|
1639
1542
|
{
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
);
|
|
1646
|
-
},
|
|
1647
|
-
onReject: () => {
|
|
1648
|
-
var _a3;
|
|
1649
|
-
return handleReject(
|
|
1650
|
-
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
|
|
1651
|
-
);
|
|
1652
|
-
},
|
|
1653
|
-
onHold: () => {
|
|
1654
|
-
var _a3;
|
|
1655
|
-
return handleOnHold(
|
|
1656
|
-
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
|
|
1657
|
-
);
|
|
1658
|
-
},
|
|
1659
|
-
level: info == null ? void 0 : info.isLevelZero,
|
|
1660
|
-
statusList: filterRejectForLevelZero(
|
|
1661
|
-
statusList,
|
|
1662
|
-
info
|
|
1663
|
-
)
|
|
1543
|
+
variant: "body2",
|
|
1544
|
+
color: "text.secondary",
|
|
1545
|
+
noWrap: true,
|
|
1546
|
+
sx: { mt: 0.5 },
|
|
1547
|
+
children: info.description_data
|
|
1664
1548
|
}
|
|
1665
|
-
)
|
|
1666
|
-
|
|
1549
|
+
) })
|
|
1550
|
+
] }),
|
|
1551
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "20%", minWidth: 180 }, children: [
|
|
1552
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
|
|
1553
|
+
/* @__PURE__ */ jsx(Tooltip, { title: redir, children: /* @__PURE__ */ jsx(
|
|
1554
|
+
"a",
|
|
1667
1555
|
{
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
borderRadius: "100px !important",
|
|
1675
|
-
"& .MuiChip-label": {
|
|
1676
|
-
fontSize: "14px",
|
|
1677
|
-
lineHeight: "15.4px",
|
|
1678
|
-
fontWeight: "500",
|
|
1679
|
-
textTransform: "capitalize"
|
|
1680
|
-
}
|
|
1556
|
+
href: redir,
|
|
1557
|
+
target: "_blank",
|
|
1558
|
+
rel: "noreferrer",
|
|
1559
|
+
style: {
|
|
1560
|
+
cursor: "pointer",
|
|
1561
|
+
textDecoration: "none"
|
|
1681
1562
|
},
|
|
1682
|
-
|
|
1563
|
+
children: /* @__PURE__ */ jsx(
|
|
1564
|
+
Typography,
|
|
1565
|
+
{
|
|
1566
|
+
variant: "subtitle2",
|
|
1567
|
+
color: "primary.dark",
|
|
1568
|
+
sx: {
|
|
1569
|
+
mt: 0.8,
|
|
1570
|
+
lineHeight: "15.4px",
|
|
1571
|
+
overflow: "hidden",
|
|
1572
|
+
textOverflow: "ellipsis",
|
|
1573
|
+
whiteSpace: "nowrap"
|
|
1574
|
+
},
|
|
1575
|
+
children: redir
|
|
1576
|
+
}
|
|
1577
|
+
)
|
|
1683
1578
|
}
|
|
1684
|
-
)
|
|
1579
|
+
) })
|
|
1580
|
+
] }),
|
|
1581
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
|
|
1582
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
|
|
1685
1583
|
/* @__PURE__ */ jsx(
|
|
1686
|
-
|
|
1584
|
+
Typography,
|
|
1687
1585
|
{
|
|
1688
|
-
|
|
1689
|
-
|
|
1586
|
+
variant: "body2",
|
|
1587
|
+
noWrap: true,
|
|
1690
1588
|
sx: {
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
}
|
|
1589
|
+
mt: 0.8,
|
|
1590
|
+
color: ((_g2 = info == null ? void 0 : info.attachment_links) == null ? void 0 : _g2.length) ? "primary.dark" : "text.disabled"
|
|
1591
|
+
},
|
|
1592
|
+
children: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
1694
1593
|
}
|
|
1695
|
-
)
|
|
1594
|
+
)
|
|
1595
|
+
] }),
|
|
1596
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
|
|
1597
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
|
|
1696
1598
|
/* @__PURE__ */ jsx(
|
|
1697
|
-
|
|
1599
|
+
Typography,
|
|
1698
1600
|
{
|
|
1699
|
-
|
|
1700
|
-
disableRipple: true,
|
|
1701
|
-
color: "primary",
|
|
1601
|
+
variant: "body2",
|
|
1702
1602
|
sx: {
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1603
|
+
mt: 0.8,
|
|
1604
|
+
fontWeight: 500,
|
|
1605
|
+
color: "text.primary"
|
|
1706
1606
|
},
|
|
1707
|
-
|
|
1708
|
-
children: expandedId === info._id ? /* @__PURE__ */ jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsx("span", { className: "icon-arrow-right-3" })
|
|
1607
|
+
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"
|
|
1709
1608
|
}
|
|
1710
1609
|
)
|
|
1711
|
-
]
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
}
|
|
1728
|
-
) : /* @__PURE__ */ jsxs("div", { children: [
|
|
1729
|
-
/* @__PURE__ */ jsx(
|
|
1730
|
-
CustomTimelineWithStatus,
|
|
1731
|
-
{
|
|
1732
|
-
events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
|
|
1733
|
-
var _a3, _b3, _c3, _d3;
|
|
1734
|
-
return {
|
|
1735
|
-
date: moment(item == null ? void 0 : item.created_at).format(
|
|
1736
|
-
"DD-MM-YYYY"
|
|
1737
|
-
),
|
|
1738
|
-
time: moment(item == null ? void 0 : item.created_at).format(
|
|
1739
|
-
"HH:mm"
|
|
1610
|
+
] }),
|
|
1611
|
+
/* @__PURE__ */ jsxs(
|
|
1612
|
+
Box,
|
|
1613
|
+
{
|
|
1614
|
+
sx: {
|
|
1615
|
+
flexBasis: "8%",
|
|
1616
|
+
minWidth: 80,
|
|
1617
|
+
textAlign: "center"
|
|
1618
|
+
},
|
|
1619
|
+
children: [
|
|
1620
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
1621
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_j = (_i = info == null ? void 0 : info.levels) == null ? void 0 : _i.findIndex(
|
|
1622
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1623
|
+
)) != null ? _j : -1) + 1 || "") })
|
|
1624
|
+
]
|
|
1625
|
+
}
|
|
1740
1626
|
),
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1627
|
+
/* @__PURE__ */ jsxs(
|
|
1628
|
+
Box,
|
|
1629
|
+
{
|
|
1630
|
+
sx: {
|
|
1631
|
+
flexBasis: "18%",
|
|
1632
|
+
minWidth: 200,
|
|
1633
|
+
display: "flex",
|
|
1634
|
+
alignItems: "center",
|
|
1635
|
+
justifyContent: "flex-end",
|
|
1636
|
+
gap: 1.5
|
|
1637
|
+
},
|
|
1638
|
+
children: [
|
|
1639
|
+
(info == null ? void 0 : info.current_status) !== "completed" && ((_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find(
|
|
1640
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1641
|
+
)) == null ? void 0 : _l.order) <= ((_n = (_m = info == null ? void 0 : info.levels) == null ? void 0 : _m.find(
|
|
1642
|
+
(lvl) => {
|
|
1643
|
+
var _a3;
|
|
1644
|
+
return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
|
|
1645
|
+
}
|
|
1646
|
+
)) == null ? void 0 : _n.order) ? /* @__PURE__ */ jsx(
|
|
1647
|
+
Statusselector_default,
|
|
1648
|
+
{
|
|
1649
|
+
onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
|
|
1650
|
+
onApprove: () => {
|
|
1651
|
+
var _a3;
|
|
1652
|
+
return handleApprove(
|
|
1653
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
|
|
1654
|
+
);
|
|
1655
|
+
},
|
|
1656
|
+
onReject: () => {
|
|
1657
|
+
var _a3;
|
|
1658
|
+
return handleReject(
|
|
1659
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
|
|
1660
|
+
);
|
|
1661
|
+
},
|
|
1662
|
+
onHold: () => {
|
|
1663
|
+
var _a3;
|
|
1664
|
+
return handleOnHold(
|
|
1665
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
|
|
1666
|
+
);
|
|
1667
|
+
},
|
|
1668
|
+
level: info == null ? void 0 : info.isLevelZero,
|
|
1669
|
+
statusList: filterRejectForLevelZero(
|
|
1670
|
+
statusList,
|
|
1671
|
+
info
|
|
1672
|
+
)
|
|
1673
|
+
}
|
|
1674
|
+
) : /* @__PURE__ */ jsx(
|
|
1675
|
+
Chip,
|
|
1676
|
+
{
|
|
1677
|
+
variant: "filled",
|
|
1678
|
+
sx: {
|
|
1679
|
+
backgroundColor: `${getStatus(currentStatus).color} !important`,
|
|
1680
|
+
color: `${getStatus(currentStatus).labelColor} !important`,
|
|
1681
|
+
height: "40px",
|
|
1682
|
+
px: 2,
|
|
1683
|
+
borderRadius: "100px !important",
|
|
1684
|
+
"& .MuiChip-label": {
|
|
1685
|
+
fontSize: "14px",
|
|
1686
|
+
lineHeight: "15.4px",
|
|
1687
|
+
fontWeight: "500",
|
|
1688
|
+
textTransform: "capitalize"
|
|
1689
|
+
}
|
|
1690
|
+
},
|
|
1691
|
+
label: statusData.title
|
|
1692
|
+
}
|
|
1693
|
+
),
|
|
1694
|
+
/* @__PURE__ */ jsx(
|
|
1695
|
+
Divider,
|
|
1696
|
+
{
|
|
1697
|
+
orientation: "vertical",
|
|
1698
|
+
flexItem: true,
|
|
1699
|
+
sx: {
|
|
1700
|
+
borderColor: "#E0E0E0",
|
|
1701
|
+
height: "40px"
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
),
|
|
1705
|
+
/* @__PURE__ */ jsx(
|
|
1706
|
+
IconButton,
|
|
1707
|
+
{
|
|
1708
|
+
disableFocusRipple: true,
|
|
1709
|
+
disableRipple: true,
|
|
1710
|
+
color: "primary",
|
|
1711
|
+
sx: {
|
|
1712
|
+
background: "rgba(25,118,210,0.08)",
|
|
1713
|
+
boxShadow: "2px 2px 10px 0px #4C4E6426",
|
|
1714
|
+
"& span": { color: "primary.dark" }
|
|
1715
|
+
},
|
|
1716
|
+
onClick: () => handleExpandClick(info._id),
|
|
1717
|
+
children: expandedId === info._id ? /* @__PURE__ */ jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsx("span", { className: "icon-arrow-right-3" })
|
|
1718
|
+
}
|
|
1719
|
+
)
|
|
1720
|
+
]
|
|
1721
|
+
}
|
|
1722
|
+
)
|
|
1723
|
+
]
|
|
1724
|
+
}
|
|
1725
|
+
),
|
|
1726
|
+
expandedId === info._id && /* @__PURE__ */ jsx(Box, { sx: { mt: 2, ml: 2 }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsx(
|
|
1727
|
+
Box,
|
|
1758
1728
|
{
|
|
1759
|
-
|
|
1760
|
-
|
|
1729
|
+
sx: {
|
|
1730
|
+
height: 150,
|
|
1731
|
+
display: "flex",
|
|
1732
|
+
justifyContent: "center",
|
|
1733
|
+
alignItems: "center"
|
|
1734
|
+
},
|
|
1735
|
+
children: /* @__PURE__ */ jsx(CircularProgress, { size: 36, color: "primary" })
|
|
1761
1736
|
}
|
|
1762
|
-
)
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
sx: {
|
|
1791
|
-
overflowY: "auto",
|
|
1792
|
-
height: "calc(100vh - 180px)",
|
|
1793
|
-
px: 2,
|
|
1794
|
-
pb: 3
|
|
1795
|
-
},
|
|
1796
|
-
children: visibleAllRequests.length > 0 ? visibleAllRequests == null ? void 0 : visibleAllRequests.map((info, index) => {
|
|
1797
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
1798
|
-
if (!(info == null ? void 0 : info.isLevelZero)) {
|
|
1799
|
-
console.log("\u{1F680} ~ ApprovalWorkflow ~ Zero:", info);
|
|
1800
|
-
}
|
|
1801
|
-
const currentLevel = info == null ? void 0 : info.levels.find(
|
|
1802
|
-
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
1803
|
-
);
|
|
1804
|
-
const statusList = currentLevel ? currentLevel.status_list : [];
|
|
1805
|
-
(statusList || []).reduce(
|
|
1806
|
-
(acc, s) => {
|
|
1807
|
-
if ((s == null ? void 0 : s.status) != null) acc[s.status] = s;
|
|
1808
|
-
return acc;
|
|
1809
|
-
},
|
|
1810
|
-
{}
|
|
1811
|
-
);
|
|
1812
|
-
const filterRejectForLevelZero = (statusList2, info2) => {
|
|
1813
|
-
if (!(info2 == null ? void 0 : info2.isLevelZero)) return statusList2;
|
|
1814
|
-
return statusList2.filter((item) => item.status !== 3);
|
|
1815
|
-
};
|
|
1816
|
-
const redir = buildRedirectionUrl(info);
|
|
1817
|
-
const currentStatus = ((_c2 = (_b2 = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
|
|
1818
|
-
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1819
|
-
)) == null ? void 0 : _b2.selected_status) == null ? void 0 : _c2.status_id) === 1 ? "approved" : ((_f2 = (_e2 = (_d2 = info == null ? void 0 : info.levels) == null ? void 0 : _d2.find(
|
|
1820
|
-
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1821
|
-
)) == null ? void 0 : _e2.selected_status) == null ? void 0 : _f2.status_id) === 3 ? "rejected" : "pending";
|
|
1822
|
-
const statusData = getStatus(currentStatus);
|
|
1823
|
-
return /* @__PURE__ */ jsxs(
|
|
1824
|
-
Card,
|
|
1825
|
-
{
|
|
1826
|
-
ref: index === visibleAllRequests.length - 1 ? lastCardRef : null,
|
|
1827
|
-
sx: {
|
|
1828
|
-
mb: 3,
|
|
1829
|
-
borderRadius: "14px",
|
|
1830
|
-
boxShadow: "0px 2px 10px rgba(76, 78, 100, 0.1)",
|
|
1831
|
-
px: 3,
|
|
1832
|
-
py: 2,
|
|
1833
|
-
background: "white"
|
|
1834
|
-
},
|
|
1835
|
-
children: [
|
|
1836
|
-
/* @__PURE__ */ jsxs(
|
|
1837
|
-
CardContent,
|
|
1838
|
-
{
|
|
1839
|
-
sx: {
|
|
1840
|
-
display: "flex",
|
|
1841
|
-
justifyContent: "space-between",
|
|
1842
|
-
alignItems: "center",
|
|
1843
|
-
flexWrap: { xs: "wrap", md: "nowrap" },
|
|
1844
|
-
gap: 2
|
|
1845
|
-
},
|
|
1846
|
-
children: [
|
|
1847
|
-
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "20%", minWidth: 220 }, children: [
|
|
1848
|
-
/* @__PURE__ */ jsx(Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsx(
|
|
1849
|
-
Typography,
|
|
1850
|
-
{
|
|
1851
|
-
variant: "h6",
|
|
1852
|
-
fontWeight: 600,
|
|
1853
|
-
noWrap: true,
|
|
1854
|
-
color: "text.primary",
|
|
1855
|
-
children: info.activity_name
|
|
1856
|
-
}
|
|
1857
|
-
) }),
|
|
1858
|
-
/* @__PURE__ */ jsx(Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsx(
|
|
1859
|
-
Typography,
|
|
1860
|
-
{
|
|
1861
|
-
variant: "body2",
|
|
1862
|
-
noWrap: true,
|
|
1863
|
-
sx: { mt: 0.5, color: "text.secondary" },
|
|
1864
|
-
children: info.description_data
|
|
1865
|
-
}
|
|
1866
|
-
) })
|
|
1867
|
-
] }),
|
|
1868
|
-
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "18%", minWidth: 180 }, children: [
|
|
1737
|
+
) : /* @__PURE__ */ jsxs("div", { children: [
|
|
1738
|
+
/* @__PURE__ */ jsx(
|
|
1739
|
+
CustomTimelineWithStatus,
|
|
1740
|
+
{
|
|
1741
|
+
events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
|
|
1742
|
+
var _a3, _b3, _c3, _d3;
|
|
1743
|
+
return {
|
|
1744
|
+
date: moment(item == null ? void 0 : item.created_at).format(
|
|
1745
|
+
"DD-MM-YYYY"
|
|
1746
|
+
),
|
|
1747
|
+
time: moment(item == null ? void 0 : item.created_at).format(
|
|
1748
|
+
"HH:mm"
|
|
1749
|
+
),
|
|
1750
|
+
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",
|
|
1751
|
+
subTitle: ((_c3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _c3.comment) || "No Comments",
|
|
1752
|
+
attachment: ((_d3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _d3.file) || null,
|
|
1753
|
+
count: (item == null ? void 0 : item.current_level) == "L0" ? "L0" : item == null ? void 0 : item.current_level_count,
|
|
1754
|
+
cardType: "card",
|
|
1755
|
+
status: (item == null ? void 0 : item.type) === "approve" ? StatusObj.approved : (item == null ? void 0 : item.type) === "reject" ? StatusObj.rejected : (item == null ? void 0 : item.type) === "send_back" ? StatusObj.sendback : (item == null ? void 0 : item.type) === "onhold" ? StatusObj.onhold : null
|
|
1756
|
+
};
|
|
1757
|
+
})
|
|
1758
|
+
}
|
|
1759
|
+
),
|
|
1760
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1761
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: /* @__PURE__ */ jsxs("span", { style: { fontWeight: "bold" }, children: [
|
|
1762
|
+
"Currently Assigned to:",
|
|
1763
|
+
" "
|
|
1764
|
+
] }) }),
|
|
1869
1765
|
/* @__PURE__ */ jsx(
|
|
1870
|
-
|
|
1766
|
+
Tooltip,
|
|
1871
1767
|
{
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
sx: { display: "block" },
|
|
1875
|
-
children: "Links"
|
|
1768
|
+
title: (info == null ? void 0 : info.isLevelZero) ? (_p = (_o = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _o.created_by_user) == null ? void 0 : _p.official_email_id : (_r = (_q = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _q.assigned_user) == null ? void 0 : _r.official_email_id,
|
|
1769
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: (info == null ? void 0 : info.isLevelZero) ? `${expandedDetails == null ? void 0 : expandedDetails[0].created_by_user.full_name} (${((_t = (_s = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _s.created_by_user) == null ? void 0 : _t.group_employee_code) || "N/A"})` : `${(_v = (_u = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _u.assigned_user) == null ? void 0 : _v.full_name} (${((_x = (_w = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _w.assigned_user) == null ? void 0 : _x.group_employee_code) || "N/A"})` })
|
|
1876
1770
|
}
|
|
1877
|
-
)
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1771
|
+
)
|
|
1772
|
+
] })
|
|
1773
|
+
] }) })
|
|
1774
|
+
]
|
|
1775
|
+
},
|
|
1776
|
+
index
|
|
1777
|
+
);
|
|
1778
|
+
}) : /* @__PURE__ */ jsx(
|
|
1779
|
+
"div",
|
|
1780
|
+
{
|
|
1781
|
+
style: {
|
|
1782
|
+
height: "100%",
|
|
1783
|
+
width: "100%",
|
|
1784
|
+
color: "gray",
|
|
1785
|
+
fontSize: "20px",
|
|
1786
|
+
display: "flex",
|
|
1787
|
+
justifyContent: "center",
|
|
1788
|
+
alignItems: "center"
|
|
1789
|
+
},
|
|
1790
|
+
children: "NO RECORD FOUND"
|
|
1791
|
+
}
|
|
1792
|
+
)
|
|
1793
|
+
}
|
|
1794
|
+
),
|
|
1795
|
+
selectedApprovalOtions === "All Requests" && /* @__PURE__ */ jsx(
|
|
1796
|
+
Box,
|
|
1797
|
+
{
|
|
1798
|
+
className: "fixedModal hide-scrollbar",
|
|
1799
|
+
sx: {
|
|
1800
|
+
overflowY: "auto",
|
|
1801
|
+
height: "calc(100vh - 180px)",
|
|
1802
|
+
px: 2,
|
|
1803
|
+
pb: 3
|
|
1804
|
+
},
|
|
1805
|
+
children: visibleAllRequests.length > 0 ? visibleAllRequests == null ? void 0 : visibleAllRequests.map((info, index) => {
|
|
1806
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
1807
|
+
if (!(info == null ? void 0 : info.isLevelZero)) {
|
|
1808
|
+
console.log("\u{1F680} ~ ApprovalWorkflow ~ Zero:", info);
|
|
1809
|
+
}
|
|
1810
|
+
const currentLevel = info == null ? void 0 : info.levels.find(
|
|
1811
|
+
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
1812
|
+
);
|
|
1813
|
+
const statusList = currentLevel ? currentLevel.status_list : [];
|
|
1814
|
+
(statusList || []).reduce(
|
|
1815
|
+
(acc, s) => {
|
|
1816
|
+
if ((s == null ? void 0 : s.status) != null) acc[s.status] = s;
|
|
1817
|
+
return acc;
|
|
1818
|
+
},
|
|
1819
|
+
{}
|
|
1820
|
+
);
|
|
1821
|
+
const filterRejectForLevelZero = (statusList2, info2) => {
|
|
1822
|
+
if (!(info2 == null ? void 0 : info2.isLevelZero)) return statusList2;
|
|
1823
|
+
return statusList2.filter((item) => item.status !== 3);
|
|
1824
|
+
};
|
|
1825
|
+
const redir = buildRedirectionUrl(info);
|
|
1826
|
+
const currentStatus = ((_c2 = (_b2 = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
|
|
1827
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1828
|
+
)) == null ? void 0 : _b2.selected_status) == null ? void 0 : _c2.status_id) === 1 ? "approved" : ((_f2 = (_e2 = (_d2 = info == null ? void 0 : info.levels) == null ? void 0 : _d2.find(
|
|
1829
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1830
|
+
)) == null ? void 0 : _e2.selected_status) == null ? void 0 : _f2.status_id) === 3 ? "rejected" : "pending";
|
|
1831
|
+
const statusData = getStatus(currentStatus);
|
|
1832
|
+
return /* @__PURE__ */ jsxs(
|
|
1833
|
+
Card,
|
|
1834
|
+
{
|
|
1835
|
+
ref: index === visibleAllRequests.length - 1 ? lastCardRef : null,
|
|
1836
|
+
sx: {
|
|
1837
|
+
mb: 3,
|
|
1838
|
+
borderRadius: "14px",
|
|
1839
|
+
boxShadow: "0px 2px 10px rgba(76, 78, 100, 0.1)",
|
|
1840
|
+
px: 3,
|
|
1841
|
+
py: 2,
|
|
1842
|
+
background: "white !important"
|
|
1843
|
+
},
|
|
1844
|
+
children: [
|
|
1845
|
+
/* @__PURE__ */ jsxs(
|
|
1846
|
+
CardContent,
|
|
1847
|
+
{
|
|
1848
|
+
sx: {
|
|
1849
|
+
display: "flex",
|
|
1850
|
+
justifyContent: "space-between",
|
|
1851
|
+
alignItems: "center",
|
|
1852
|
+
flexWrap: { xs: "wrap", md: "nowrap" },
|
|
1853
|
+
gap: 2
|
|
1854
|
+
},
|
|
1855
|
+
children: [
|
|
1856
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "20%", minWidth: 220 }, children: [
|
|
1857
|
+
/* @__PURE__ */ jsx(Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsx(
|
|
1889
1858
|
Typography,
|
|
1890
1859
|
{
|
|
1891
|
-
variant: "
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
overflow: "hidden",
|
|
1897
|
-
textOverflow: "ellipsis",
|
|
1898
|
-
whiteSpace: "nowrap"
|
|
1899
|
-
},
|
|
1900
|
-
children: redir
|
|
1860
|
+
variant: "h6",
|
|
1861
|
+
fontWeight: 600,
|
|
1862
|
+
noWrap: true,
|
|
1863
|
+
color: "text.primary",
|
|
1864
|
+
children: info.activity_name
|
|
1901
1865
|
}
|
|
1902
|
-
)
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
] }),
|
|
1906
|
-
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
|
|
1907
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
|
|
1908
|
-
/* @__PURE__ */ jsx(
|
|
1909
|
-
Typography,
|
|
1910
|
-
{
|
|
1911
|
-
variant: "body2",
|
|
1912
|
-
noWrap: true,
|
|
1913
|
-
sx: {
|
|
1914
|
-
mt: 0.8,
|
|
1915
|
-
color: ((_g2 = info == null ? void 0 : info.attachment_links) == null ? void 0 : _g2.length) ? "primary.dark" : "text.disabled"
|
|
1916
|
-
},
|
|
1917
|
-
children: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
1918
|
-
}
|
|
1919
|
-
)
|
|
1920
|
-
] }),
|
|
1921
|
-
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
|
|
1922
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
|
|
1923
|
-
/* @__PURE__ */ jsx(
|
|
1924
|
-
Typography,
|
|
1925
|
-
{
|
|
1926
|
-
variant: "body2",
|
|
1927
|
-
sx: {
|
|
1928
|
-
mt: 0.8,
|
|
1929
|
-
fontWeight: 500,
|
|
1930
|
-
color: "text.primary"
|
|
1931
|
-
},
|
|
1932
|
-
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"
|
|
1933
|
-
}
|
|
1934
|
-
)
|
|
1935
|
-
] }),
|
|
1936
|
-
/* @__PURE__ */ jsxs(
|
|
1937
|
-
Box,
|
|
1938
|
-
{
|
|
1939
|
-
sx: {
|
|
1940
|
-
flexBasis: "8%",
|
|
1941
|
-
minWidth: 80,
|
|
1942
|
-
textAlign: "center"
|
|
1943
|
-
},
|
|
1944
|
-
children: [
|
|
1945
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
1946
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_j = (_i = info == null ? void 0 : info.levels) == null ? void 0 : _i.findIndex(
|
|
1947
|
-
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1948
|
-
)) != null ? _j : -1) + 1 || "") })
|
|
1949
|
-
]
|
|
1950
|
-
}
|
|
1951
|
-
),
|
|
1952
|
-
/* @__PURE__ */ jsxs(
|
|
1953
|
-
Box,
|
|
1954
|
-
{
|
|
1955
|
-
sx: {
|
|
1956
|
-
flexBasis: "18%",
|
|
1957
|
-
minWidth: 200,
|
|
1958
|
-
display: "flex",
|
|
1959
|
-
alignItems: "center",
|
|
1960
|
-
justifyContent: "flex-end",
|
|
1961
|
-
gap: 1.5
|
|
1962
|
-
},
|
|
1963
|
-
children: [
|
|
1964
|
-
(info == null ? void 0 : info.current_status) !== "completed" && ((_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find(
|
|
1965
|
-
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1966
|
-
)) == null ? void 0 : _l.order) <= ((_n = (_m = info == null ? void 0 : info.levels) == null ? void 0 : _m.find(
|
|
1967
|
-
(lvl) => {
|
|
1968
|
-
var _a3;
|
|
1969
|
-
return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
|
|
1970
|
-
}
|
|
1971
|
-
)) == null ? void 0 : _n.order) ? /* @__PURE__ */ jsx(
|
|
1972
|
-
Statusselector_default,
|
|
1866
|
+
) }),
|
|
1867
|
+
/* @__PURE__ */ jsx(Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsx(
|
|
1868
|
+
Typography,
|
|
1973
1869
|
{
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
|
|
1979
|
-
);
|
|
1980
|
-
},
|
|
1981
|
-
onReject: () => {
|
|
1982
|
-
var _a3;
|
|
1983
|
-
return handleReject(
|
|
1984
|
-
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
|
|
1985
|
-
);
|
|
1986
|
-
},
|
|
1987
|
-
onHold: () => {
|
|
1988
|
-
var _a3;
|
|
1989
|
-
return handleOnHold(
|
|
1990
|
-
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
|
|
1991
|
-
);
|
|
1992
|
-
},
|
|
1993
|
-
level: info == null ? void 0 : info.isLevelZero,
|
|
1994
|
-
statusList: filterRejectForLevelZero(
|
|
1995
|
-
statusList,
|
|
1996
|
-
info
|
|
1997
|
-
)
|
|
1870
|
+
variant: "body2",
|
|
1871
|
+
noWrap: true,
|
|
1872
|
+
sx: { mt: 0.5, color: "text.secondary" },
|
|
1873
|
+
children: info.description_data
|
|
1998
1874
|
}
|
|
1999
|
-
)
|
|
2000
|
-
|
|
1875
|
+
) })
|
|
1876
|
+
] }),
|
|
1877
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "18%", minWidth: 180 }, children: [
|
|
1878
|
+
/* @__PURE__ */ jsx(
|
|
1879
|
+
Typography,
|
|
2001
1880
|
{
|
|
2002
|
-
variant: "
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
height: "40px",
|
|
2007
|
-
px: 2,
|
|
2008
|
-
borderRadius: "100px !important",
|
|
2009
|
-
"& .MuiChip-label": {
|
|
2010
|
-
fontSize: "14px",
|
|
2011
|
-
lineHeight: "15.4px",
|
|
2012
|
-
fontWeight: "500",
|
|
2013
|
-
textTransform: "capitalize"
|
|
2014
|
-
}
|
|
2015
|
-
},
|
|
2016
|
-
label: statusData.title
|
|
1881
|
+
variant: "caption",
|
|
1882
|
+
color: "text.secondary",
|
|
1883
|
+
sx: { display: "block" },
|
|
1884
|
+
children: "Links"
|
|
2017
1885
|
}
|
|
2018
1886
|
),
|
|
2019
|
-
/* @__PURE__ */ jsx(
|
|
2020
|
-
|
|
1887
|
+
/* @__PURE__ */ jsx(Tooltip, { title: redir, children: /* @__PURE__ */ jsx(
|
|
1888
|
+
"a",
|
|
2021
1889
|
{
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
1890
|
+
href: redir,
|
|
1891
|
+
target: "_blank",
|
|
1892
|
+
rel: "noreferrer",
|
|
1893
|
+
style: {
|
|
1894
|
+
cursor: "pointer",
|
|
1895
|
+
textDecoration: "none"
|
|
1896
|
+
},
|
|
1897
|
+
children: /* @__PURE__ */ jsx(
|
|
1898
|
+
Typography,
|
|
1899
|
+
{
|
|
1900
|
+
variant: "subtitle2",
|
|
1901
|
+
color: "primary.dark",
|
|
1902
|
+
sx: {
|
|
1903
|
+
mt: 0.8,
|
|
1904
|
+
lineHeight: "15.4px",
|
|
1905
|
+
overflow: "hidden",
|
|
1906
|
+
textOverflow: "ellipsis",
|
|
1907
|
+
whiteSpace: "nowrap"
|
|
1908
|
+
},
|
|
1909
|
+
children: redir
|
|
1910
|
+
}
|
|
1911
|
+
)
|
|
2028
1912
|
}
|
|
2029
|
-
)
|
|
1913
|
+
) })
|
|
1914
|
+
] }),
|
|
1915
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
|
|
1916
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
|
|
2030
1917
|
/* @__PURE__ */ jsx(
|
|
2031
|
-
|
|
1918
|
+
Typography,
|
|
2032
1919
|
{
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
color: "primary",
|
|
1920
|
+
variant: "body2",
|
|
1921
|
+
noWrap: true,
|
|
2036
1922
|
sx: {
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
"& span": { color: "primary.dark" }
|
|
1923
|
+
mt: 0.8,
|
|
1924
|
+
color: ((_g2 = info == null ? void 0 : info.attachment_links) == null ? void 0 : _g2.length) ? "primary.dark" : "text.disabled"
|
|
2040
1925
|
},
|
|
2041
|
-
|
|
2042
|
-
children: expandedId === info._id ? /* @__PURE__ */ jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsx("span", { className: "icon-arrow-right-3" })
|
|
1926
|
+
children: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
2043
1927
|
}
|
|
2044
1928
|
)
|
|
2045
|
-
]
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
}
|
|
2050
|
-
),
|
|
2051
|
-
expandedId === info._id && /* @__PURE__ */ jsx(Box, { sx: { mt: 2, ml: 2 }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsx(
|
|
2052
|
-
Box,
|
|
2053
|
-
{
|
|
2054
|
-
sx: {
|
|
2055
|
-
height: 150,
|
|
2056
|
-
display: "flex",
|
|
2057
|
-
justifyContent: "center",
|
|
2058
|
-
alignItems: "center"
|
|
2059
|
-
},
|
|
2060
|
-
children: /* @__PURE__ */ jsx(CircularProgress, { size: 36, color: "primary" })
|
|
2061
|
-
}
|
|
2062
|
-
) : /* @__PURE__ */ jsxs("div", { children: [
|
|
2063
|
-
/* @__PURE__ */ jsx(
|
|
2064
|
-
CustomTimelineWithStatus,
|
|
2065
|
-
{
|
|
2066
|
-
events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
|
|
2067
|
-
var _a3, _b3, _c3, _d3;
|
|
2068
|
-
return {
|
|
2069
|
-
date: moment(item == null ? void 0 : item.created_at).format(
|
|
2070
|
-
"DD-MM-YYYY"
|
|
2071
|
-
),
|
|
2072
|
-
time: moment(item == null ? void 0 : item.created_at).format(
|
|
2073
|
-
"HH:mm"
|
|
2074
|
-
),
|
|
2075
|
-
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",
|
|
2076
|
-
subTitle: ((_c3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _c3.comment) || "No Comments",
|
|
2077
|
-
attachment: ((_d3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _d3.file) || null,
|
|
2078
|
-
count: (item == null ? void 0 : item.current_level) == "L0" ? "L0" : item == null ? void 0 : item.current_level_count,
|
|
2079
|
-
cardType: "card",
|
|
2080
|
-
status: (item == null ? void 0 : item.type) === "approve" ? StatusObj.approved : (item == null ? void 0 : item.type) === "reject" ? StatusObj.rejected : (item == null ? void 0 : item.type) === "send_back" ? StatusObj.sendback : (item == null ? void 0 : item.type) === "onhold" ? StatusObj.onhold : null
|
|
2081
|
-
};
|
|
2082
|
-
})
|
|
2083
|
-
}
|
|
2084
|
-
),
|
|
2085
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2086
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: /* @__PURE__ */ jsxs("span", { style: { fontWeight: "bold" }, children: [
|
|
2087
|
-
"Currently Assigned to:",
|
|
2088
|
-
" "
|
|
2089
|
-
] }) }),
|
|
2090
|
-
/* @__PURE__ */ jsx(
|
|
2091
|
-
Tooltip,
|
|
2092
|
-
{
|
|
2093
|
-
title: (info == null ? void 0 : info.isLevelZero) ? (_p = (_o = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _o.created_by_user) == null ? void 0 : _p.official_email_id : (_r = (_q = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _q.assigned_user) == null ? void 0 : _r.official_email_id,
|
|
2094
|
-
children: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: (info == null ? void 0 : info.isLevelZero) ? `${expandedDetails == null ? void 0 : expandedDetails[0].created_by_user.full_name} (${((_t = (_s = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _s.created_by_user) == null ? void 0 : _t.group_employee_code) || "N/A"})` : `${(_v = (_u = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _u.assigned_user) == null ? void 0 : _v.full_name} (${((_x = (_w = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _w.assigned_user) == null ? void 0 : _x.group_employee_code) || "N/A"})` })
|
|
2095
|
-
}
|
|
2096
|
-
)
|
|
2097
|
-
] })
|
|
2098
|
-
] }) })
|
|
2099
|
-
]
|
|
2100
|
-
},
|
|
2101
|
-
index
|
|
2102
|
-
);
|
|
2103
|
-
}) : /* @__PURE__ */ jsx(
|
|
2104
|
-
"div",
|
|
2105
|
-
{
|
|
2106
|
-
style: {
|
|
2107
|
-
height: "100%",
|
|
2108
|
-
width: "100%",
|
|
2109
|
-
color: "gray",
|
|
2110
|
-
fontSize: "20px",
|
|
2111
|
-
display: "flex",
|
|
2112
|
-
justifyContent: "center",
|
|
2113
|
-
alignItems: "center"
|
|
2114
|
-
},
|
|
2115
|
-
children: "NO RECORD FOUND"
|
|
2116
|
-
}
|
|
2117
|
-
)
|
|
2118
|
-
}
|
|
2119
|
-
),
|
|
2120
|
-
selectedApprovalOtions === "Action Required" && /* @__PURE__ */ jsx(
|
|
2121
|
-
Box,
|
|
2122
|
-
{
|
|
2123
|
-
className: "fixedModal",
|
|
2124
|
-
sx: {
|
|
2125
|
-
overflowY: "auto",
|
|
2126
|
-
height: "calc(100vh - 180px)",
|
|
2127
|
-
px: 2,
|
|
2128
|
-
pb: 3
|
|
2129
|
-
},
|
|
2130
|
-
children: visiblePendingRequests.length > 0 ? visiblePendingRequests == null ? void 0 : visiblePendingRequests.map((info, index) => {
|
|
2131
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
2132
|
-
const currentLevel = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
|
|
2133
|
-
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
2134
|
-
);
|
|
2135
|
-
const statusList = currentLevel ? currentLevel.status_list : [];
|
|
2136
|
-
const filterRejectForLevelZero = (statusList2, info2) => {
|
|
2137
|
-
if (!(info2 == null ? void 0 : info2.isLevelZero)) return statusList2;
|
|
2138
|
-
return statusList2.filter((item) => item.status !== 3);
|
|
2139
|
-
};
|
|
2140
|
-
const redir = buildRedirectionUrl(info);
|
|
2141
|
-
const currentStatus = ((_d2 = (_c2 = (_b2 = info == null ? void 0 : info.levels) == null ? void 0 : _b2.find(
|
|
2142
|
-
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
2143
|
-
)) == null ? void 0 : _c2.selected_status) == null ? void 0 : _d2.status_id) === 1 ? "approved" : ((_g2 = (_f2 = (_e2 = info == null ? void 0 : info.levels) == null ? void 0 : _e2.find(
|
|
2144
|
-
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
2145
|
-
)) == null ? void 0 : _f2.selected_status) == null ? void 0 : _g2.status_id) === 3 ? "rejected" : "pending";
|
|
2146
|
-
const statusData = getStatus(currentStatus);
|
|
2147
|
-
return /* @__PURE__ */ jsxs(
|
|
2148
|
-
Card,
|
|
2149
|
-
{
|
|
2150
|
-
ref: index === visiblePendingRequests.length - 1 ? lastCardRef : null,
|
|
2151
|
-
sx: {
|
|
2152
|
-
mb: 3,
|
|
2153
|
-
borderRadius: "14px",
|
|
2154
|
-
boxShadow: "0px 2px 10px rgba(76, 78, 100, 0.1)",
|
|
2155
|
-
px: 3,
|
|
2156
|
-
py: 2,
|
|
2157
|
-
background: "white"
|
|
2158
|
-
},
|
|
2159
|
-
children: [
|
|
2160
|
-
/* @__PURE__ */ jsxs(
|
|
2161
|
-
CardContent,
|
|
2162
|
-
{
|
|
2163
|
-
sx: {
|
|
2164
|
-
display: "flex",
|
|
2165
|
-
justifyContent: "space-between",
|
|
2166
|
-
alignItems: "center",
|
|
2167
|
-
flexWrap: { xs: "wrap", md: "nowrap" },
|
|
2168
|
-
gap: 2
|
|
2169
|
-
},
|
|
2170
|
-
children: [
|
|
2171
|
-
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "20%", minWidth: 220 }, children: [
|
|
2172
|
-
/* @__PURE__ */ jsx(Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsx(Typography, { variant: "h6", fontWeight: 600, noWrap: true, children: info.activity_name }) }),
|
|
2173
|
-
/* @__PURE__ */ jsx(Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsx(
|
|
2174
|
-
Typography,
|
|
2175
|
-
{
|
|
2176
|
-
variant: "body2",
|
|
2177
|
-
color: "text.secondary",
|
|
2178
|
-
noWrap: true,
|
|
2179
|
-
sx: { mt: 0.5 },
|
|
2180
|
-
children: info.description_data
|
|
2181
|
-
}
|
|
2182
|
-
) })
|
|
2183
|
-
] }),
|
|
2184
|
-
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "18%", minWidth: 180 }, children: [
|
|
2185
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
|
|
2186
|
-
/* @__PURE__ */ jsx(Tooltip, { title: redir, children: /* @__PURE__ */ jsx(
|
|
2187
|
-
"a",
|
|
2188
|
-
{
|
|
2189
|
-
href: redir,
|
|
2190
|
-
target: "_blank",
|
|
2191
|
-
rel: "noreferrer",
|
|
2192
|
-
style: {
|
|
2193
|
-
cursor: "pointer",
|
|
2194
|
-
textDecoration: "none"
|
|
2195
|
-
},
|
|
2196
|
-
children: /* @__PURE__ */ jsx(
|
|
1929
|
+
] }),
|
|
1930
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
|
|
1931
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
|
|
1932
|
+
/* @__PURE__ */ jsx(
|
|
2197
1933
|
Typography,
|
|
2198
1934
|
{
|
|
2199
|
-
variant: "
|
|
2200
|
-
color: "primary.dark",
|
|
1935
|
+
variant: "body2",
|
|
2201
1936
|
sx: {
|
|
2202
1937
|
mt: 0.8,
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
textOverflow: "ellipsis",
|
|
2206
|
-
whiteSpace: "nowrap"
|
|
1938
|
+
fontWeight: 500,
|
|
1939
|
+
color: "text.primary"
|
|
2207
1940
|
},
|
|
2208
|
-
children:
|
|
1941
|
+
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"
|
|
2209
1942
|
}
|
|
2210
1943
|
)
|
|
2211
|
-
}
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
1944
|
+
] }),
|
|
1945
|
+
/* @__PURE__ */ jsxs(
|
|
1946
|
+
Box,
|
|
1947
|
+
{
|
|
1948
|
+
sx: {
|
|
1949
|
+
flexBasis: "8%",
|
|
1950
|
+
minWidth: 80,
|
|
1951
|
+
textAlign: "center"
|
|
1952
|
+
},
|
|
1953
|
+
children: [
|
|
1954
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
1955
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_j = (_i = info == null ? void 0 : info.levels) == null ? void 0 : _i.findIndex(
|
|
1956
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1957
|
+
)) != null ? _j : -1) + 1 || "") })
|
|
1958
|
+
]
|
|
1959
|
+
}
|
|
1960
|
+
),
|
|
1961
|
+
/* @__PURE__ */ jsxs(
|
|
1962
|
+
Box,
|
|
1963
|
+
{
|
|
1964
|
+
sx: {
|
|
1965
|
+
flexBasis: "18%",
|
|
1966
|
+
minWidth: 200,
|
|
1967
|
+
display: "flex",
|
|
1968
|
+
alignItems: "center",
|
|
1969
|
+
justifyContent: "flex-end",
|
|
1970
|
+
gap: 1.5
|
|
1971
|
+
},
|
|
1972
|
+
children: [
|
|
1973
|
+
(info == null ? void 0 : info.current_status) !== "completed" && ((_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find(
|
|
1974
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
1975
|
+
)) == null ? void 0 : _l.order) <= ((_n = (_m = info == null ? void 0 : info.levels) == null ? void 0 : _m.find(
|
|
1976
|
+
(lvl) => {
|
|
1977
|
+
var _a3;
|
|
1978
|
+
return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
|
|
1979
|
+
}
|
|
1980
|
+
)) == null ? void 0 : _n.order) ? /* @__PURE__ */ jsx(
|
|
1981
|
+
Statusselector_default,
|
|
1982
|
+
{
|
|
1983
|
+
onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
|
|
1984
|
+
onApprove: () => {
|
|
1985
|
+
var _a3;
|
|
1986
|
+
return handleApprove(
|
|
1987
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
|
|
1988
|
+
);
|
|
1989
|
+
},
|
|
1990
|
+
onReject: () => {
|
|
1991
|
+
var _a3;
|
|
1992
|
+
return handleReject(
|
|
1993
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
|
|
1994
|
+
);
|
|
1995
|
+
},
|
|
1996
|
+
onHold: () => {
|
|
1997
|
+
var _a3;
|
|
1998
|
+
return handleOnHold(
|
|
1999
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
|
|
2000
|
+
);
|
|
2001
|
+
},
|
|
2002
|
+
level: info == null ? void 0 : info.isLevelZero,
|
|
2003
|
+
statusList: filterRejectForLevelZero(
|
|
2004
|
+
statusList,
|
|
2005
|
+
info
|
|
2006
|
+
)
|
|
2007
|
+
}
|
|
2008
|
+
) : /* @__PURE__ */ jsx(
|
|
2009
|
+
Chip,
|
|
2010
|
+
{
|
|
2011
|
+
variant: "filled",
|
|
2012
|
+
sx: {
|
|
2013
|
+
backgroundColor: `${getStatus(currentStatus).color} !important`,
|
|
2014
|
+
color: `${getStatus(currentStatus).labelColor} !important`,
|
|
2015
|
+
height: "40px",
|
|
2016
|
+
px: 2,
|
|
2017
|
+
borderRadius: "100px !important",
|
|
2018
|
+
"& .MuiChip-label": {
|
|
2019
|
+
fontSize: "14px",
|
|
2020
|
+
lineHeight: "15.4px",
|
|
2021
|
+
fontWeight: "500",
|
|
2022
|
+
textTransform: "capitalize"
|
|
2023
|
+
}
|
|
2024
|
+
},
|
|
2025
|
+
label: statusData.title
|
|
2026
|
+
}
|
|
2027
|
+
),
|
|
2028
|
+
/* @__PURE__ */ jsx(
|
|
2029
|
+
Divider,
|
|
2030
|
+
{
|
|
2031
|
+
orientation: "vertical",
|
|
2032
|
+
flexItem: true,
|
|
2033
|
+
sx: {
|
|
2034
|
+
borderColor: "#E0E0E0",
|
|
2035
|
+
height: "40px"
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
),
|
|
2039
|
+
/* @__PURE__ */ jsx(
|
|
2040
|
+
IconButton,
|
|
2041
|
+
{
|
|
2042
|
+
disableFocusRipple: true,
|
|
2043
|
+
disableRipple: true,
|
|
2044
|
+
color: "primary",
|
|
2045
|
+
sx: {
|
|
2046
|
+
background: "rgba(25,118,210,0.08)",
|
|
2047
|
+
boxShadow: "2px 2px 10px 0px #4C4E6426",
|
|
2048
|
+
"& span": { color: "primary.dark" }
|
|
2049
|
+
},
|
|
2050
|
+
onClick: () => handleExpandClick(info._id),
|
|
2051
|
+
children: expandedId === info._id ? /* @__PURE__ */ jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsx("span", { className: "icon-arrow-right-3" })
|
|
2052
|
+
}
|
|
2053
|
+
)
|
|
2054
|
+
]
|
|
2055
|
+
}
|
|
2056
|
+
)
|
|
2057
|
+
]
|
|
2058
|
+
}
|
|
2059
|
+
),
|
|
2060
|
+
expandedId === info._id && /* @__PURE__ */ jsx(Box, { sx: { mt: 2, ml: 2 }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsx(
|
|
2061
|
+
Box,
|
|
2062
|
+
{
|
|
2063
|
+
sx: {
|
|
2064
|
+
height: 150,
|
|
2065
|
+
display: "flex",
|
|
2066
|
+
justifyContent: "center",
|
|
2067
|
+
alignItems: "center"
|
|
2068
|
+
},
|
|
2069
|
+
children: /* @__PURE__ */ jsx(CircularProgress, { size: 36, color: "primary" })
|
|
2070
|
+
}
|
|
2071
|
+
) : /* @__PURE__ */ jsxs("div", { children: [
|
|
2072
|
+
/* @__PURE__ */ jsx(
|
|
2073
|
+
CustomTimelineWithStatus,
|
|
2074
|
+
{
|
|
2075
|
+
events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
|
|
2076
|
+
var _a3, _b3, _c3, _d3;
|
|
2077
|
+
return {
|
|
2078
|
+
date: moment(item == null ? void 0 : item.created_at).format(
|
|
2079
|
+
"DD-MM-YYYY"
|
|
2080
|
+
),
|
|
2081
|
+
time: moment(item == null ? void 0 : item.created_at).format(
|
|
2082
|
+
"HH:mm"
|
|
2083
|
+
),
|
|
2084
|
+
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",
|
|
2085
|
+
subTitle: ((_c3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _c3.comment) || "No Comments",
|
|
2086
|
+
attachment: ((_d3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _d3.file) || null,
|
|
2087
|
+
count: (item == null ? void 0 : item.current_level) == "L0" ? "L0" : item == null ? void 0 : item.current_level_count,
|
|
2088
|
+
cardType: "card",
|
|
2089
|
+
status: (item == null ? void 0 : item.type) === "approve" ? StatusObj.approved : (item == null ? void 0 : item.type) === "reject" ? StatusObj.rejected : (item == null ? void 0 : item.type) === "send_back" ? StatusObj.sendback : (item == null ? void 0 : item.type) === "onhold" ? StatusObj.onhold : null
|
|
2090
|
+
};
|
|
2091
|
+
})
|
|
2092
|
+
}
|
|
2093
|
+
),
|
|
2094
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2095
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: /* @__PURE__ */ jsxs("span", { style: { fontWeight: "bold" }, children: [
|
|
2096
|
+
"Currently Assigned to:",
|
|
2097
|
+
" "
|
|
2098
|
+
] }) }),
|
|
2231
2099
|
/* @__PURE__ */ jsx(
|
|
2232
|
-
|
|
2100
|
+
Tooltip,
|
|
2233
2101
|
{
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
mt: 0.8,
|
|
2237
|
-
fontWeight: 500,
|
|
2238
|
-
color: "text.primary"
|
|
2239
|
-
},
|
|
2240
|
-
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"
|
|
2102
|
+
title: (info == null ? void 0 : info.isLevelZero) ? (_p = (_o = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _o.created_by_user) == null ? void 0 : _p.official_email_id : (_r = (_q = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _q.assigned_user) == null ? void 0 : _r.official_email_id,
|
|
2103
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: (info == null ? void 0 : info.isLevelZero) ? `${expandedDetails == null ? void 0 : expandedDetails[0].created_by_user.full_name} (${((_t = (_s = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _s.created_by_user) == null ? void 0 : _t.group_employee_code) || "N/A"})` : `${(_v = (_u = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _u.assigned_user) == null ? void 0 : _v.full_name} (${((_x = (_w = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _w.assigned_user) == null ? void 0 : _x.group_employee_code) || "N/A"})` })
|
|
2241
2104
|
}
|
|
2242
2105
|
)
|
|
2243
|
-
] })
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2106
|
+
] })
|
|
2107
|
+
] }) })
|
|
2108
|
+
]
|
|
2109
|
+
},
|
|
2110
|
+
index
|
|
2111
|
+
);
|
|
2112
|
+
}) : /* @__PURE__ */ jsx(
|
|
2113
|
+
"div",
|
|
2114
|
+
{
|
|
2115
|
+
style: {
|
|
2116
|
+
height: "100%",
|
|
2117
|
+
width: "100%",
|
|
2118
|
+
color: "gray",
|
|
2119
|
+
fontSize: "20px",
|
|
2120
|
+
display: "flex",
|
|
2121
|
+
justifyContent: "center",
|
|
2122
|
+
alignItems: "center"
|
|
2123
|
+
},
|
|
2124
|
+
children: "NO RECORD FOUND"
|
|
2125
|
+
}
|
|
2126
|
+
)
|
|
2127
|
+
}
|
|
2128
|
+
),
|
|
2129
|
+
selectedApprovalOtions === "Action Required" && /* @__PURE__ */ jsx(
|
|
2130
|
+
Box,
|
|
2131
|
+
{
|
|
2132
|
+
className: "fixedModal hide-scrollbar",
|
|
2133
|
+
sx: {
|
|
2134
|
+
overflowY: "auto",
|
|
2135
|
+
height: "calc(100vh - 180px)",
|
|
2136
|
+
px: 2,
|
|
2137
|
+
pb: 3
|
|
2138
|
+
},
|
|
2139
|
+
children: visiblePendingRequests.length > 0 ? visiblePendingRequests == null ? void 0 : visiblePendingRequests.map((info, index) => {
|
|
2140
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
2141
|
+
const currentLevel = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
|
|
2142
|
+
(level_) => level_.id === (info == null ? void 0 : info.current_level)
|
|
2143
|
+
);
|
|
2144
|
+
const statusList = currentLevel ? currentLevel.status_list : [];
|
|
2145
|
+
const filterRejectForLevelZero = (statusList2, info2) => {
|
|
2146
|
+
if (!(info2 == null ? void 0 : info2.isLevelZero)) return statusList2;
|
|
2147
|
+
return statusList2.filter((item) => item.status !== 3);
|
|
2148
|
+
};
|
|
2149
|
+
const redir = buildRedirectionUrl(info);
|
|
2150
|
+
const currentStatus = ((_d2 = (_c2 = (_b2 = info == null ? void 0 : info.levels) == null ? void 0 : _b2.find(
|
|
2151
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
2152
|
+
)) == null ? void 0 : _c2.selected_status) == null ? void 0 : _d2.status_id) === 1 ? "approved" : ((_g2 = (_f2 = (_e2 = info == null ? void 0 : info.levels) == null ? void 0 : _e2.find(
|
|
2153
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
2154
|
+
)) == null ? void 0 : _f2.selected_status) == null ? void 0 : _g2.status_id) === 3 ? "rejected" : "pending";
|
|
2155
|
+
const statusData = getStatus(currentStatus);
|
|
2156
|
+
return /* @__PURE__ */ jsxs(
|
|
2157
|
+
Card,
|
|
2158
|
+
{
|
|
2159
|
+
ref: index === visiblePendingRequests.length - 1 ? lastCardRef : null,
|
|
2160
|
+
sx: {
|
|
2161
|
+
mb: 3,
|
|
2162
|
+
borderRadius: "14px",
|
|
2163
|
+
boxShadow: "0px 2px 10px rgba(76, 78, 100, 0.1)",
|
|
2164
|
+
px: 3,
|
|
2165
|
+
py: 2,
|
|
2166
|
+
background: "white !important"
|
|
2167
|
+
},
|
|
2168
|
+
children: [
|
|
2169
|
+
/* @__PURE__ */ jsxs(
|
|
2170
|
+
CardContent,
|
|
2171
|
+
{
|
|
2172
|
+
sx: {
|
|
2173
|
+
display: "flex",
|
|
2174
|
+
justifyContent: "space-between",
|
|
2175
|
+
alignItems: "center",
|
|
2176
|
+
flexWrap: { xs: "wrap", md: "nowrap" },
|
|
2177
|
+
gap: 2
|
|
2178
|
+
},
|
|
2179
|
+
children: [
|
|
2180
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "20%", minWidth: 220 }, children: [
|
|
2181
|
+
/* @__PURE__ */ jsx(Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsx(Typography, { variant: "h6", fontWeight: 600, noWrap: true, children: info.activity_name }) }),
|
|
2182
|
+
/* @__PURE__ */ jsx(Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsx(
|
|
2183
|
+
Typography,
|
|
2274
2184
|
{
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
);
|
|
2281
|
-
},
|
|
2282
|
-
onReject: () => {
|
|
2283
|
-
var _a3;
|
|
2284
|
-
return handleReject(
|
|
2285
|
-
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
|
|
2286
|
-
);
|
|
2287
|
-
},
|
|
2288
|
-
onHold: () => {
|
|
2289
|
-
var _a3;
|
|
2290
|
-
return handleOnHold(
|
|
2291
|
-
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
|
|
2292
|
-
);
|
|
2293
|
-
},
|
|
2294
|
-
level: info == null ? void 0 : info.isLevelZero,
|
|
2295
|
-
statusList: filterRejectForLevelZero(
|
|
2296
|
-
statusList,
|
|
2297
|
-
info
|
|
2298
|
-
)
|
|
2185
|
+
variant: "body2",
|
|
2186
|
+
color: "text.secondary",
|
|
2187
|
+
noWrap: true,
|
|
2188
|
+
sx: { mt: 0.5 },
|
|
2189
|
+
children: info.description_data
|
|
2299
2190
|
}
|
|
2300
|
-
)
|
|
2301
|
-
|
|
2191
|
+
) })
|
|
2192
|
+
] }),
|
|
2193
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "18%", minWidth: 180 }, children: [
|
|
2194
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
|
|
2195
|
+
/* @__PURE__ */ jsx(Tooltip, { title: redir, children: /* @__PURE__ */ jsx(
|
|
2196
|
+
"a",
|
|
2302
2197
|
{
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
borderRadius: "100px !important",
|
|
2310
|
-
"& .MuiChip-label": {
|
|
2311
|
-
fontSize: "14px",
|
|
2312
|
-
lineHeight: "15.4px",
|
|
2313
|
-
fontWeight: "500",
|
|
2314
|
-
textTransform: "capitalize"
|
|
2315
|
-
}
|
|
2198
|
+
href: redir,
|
|
2199
|
+
target: "_blank",
|
|
2200
|
+
rel: "noreferrer",
|
|
2201
|
+
style: {
|
|
2202
|
+
cursor: "pointer",
|
|
2203
|
+
textDecoration: "none"
|
|
2316
2204
|
},
|
|
2317
|
-
|
|
2205
|
+
children: /* @__PURE__ */ jsx(
|
|
2206
|
+
Typography,
|
|
2207
|
+
{
|
|
2208
|
+
variant: "subtitle2",
|
|
2209
|
+
color: "primary.dark",
|
|
2210
|
+
sx: {
|
|
2211
|
+
mt: 0.8,
|
|
2212
|
+
lineHeight: "15.4px",
|
|
2213
|
+
overflow: "hidden",
|
|
2214
|
+
textOverflow: "ellipsis",
|
|
2215
|
+
whiteSpace: "nowrap"
|
|
2216
|
+
},
|
|
2217
|
+
children: redir
|
|
2218
|
+
}
|
|
2219
|
+
)
|
|
2318
2220
|
}
|
|
2319
|
-
)
|
|
2221
|
+
) })
|
|
2222
|
+
] }),
|
|
2223
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
|
|
2224
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
|
|
2320
2225
|
/* @__PURE__ */ jsx(
|
|
2321
|
-
|
|
2226
|
+
Typography,
|
|
2322
2227
|
{
|
|
2323
|
-
|
|
2324
|
-
|
|
2228
|
+
variant: "body2",
|
|
2229
|
+
noWrap: true,
|
|
2325
2230
|
sx: {
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
}
|
|
2231
|
+
mt: 0.8,
|
|
2232
|
+
color: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? "primary.dark" : "text.disabled"
|
|
2233
|
+
},
|
|
2234
|
+
children: ((_i = info == null ? void 0 : info.attachment_links) == null ? void 0 : _i.length) ? `${info.attachment_links.length} file(s)` : "N/A"
|
|
2329
2235
|
}
|
|
2330
|
-
)
|
|
2236
|
+
)
|
|
2237
|
+
] }),
|
|
2238
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
|
|
2239
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
|
|
2331
2240
|
/* @__PURE__ */ jsx(
|
|
2332
|
-
|
|
2241
|
+
Typography,
|
|
2333
2242
|
{
|
|
2334
|
-
|
|
2243
|
+
variant: "body2",
|
|
2335
2244
|
sx: {
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2245
|
+
mt: 0.8,
|
|
2246
|
+
fontWeight: 500,
|
|
2247
|
+
color: "text.primary"
|
|
2339
2248
|
},
|
|
2340
|
-
|
|
2341
|
-
children: expandedId === info._id ? /* @__PURE__ */ jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsx("span", { className: "icon-arrow-right-3" })
|
|
2249
|
+
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"
|
|
2342
2250
|
}
|
|
2343
2251
|
)
|
|
2344
|
-
]
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
}
|
|
2361
|
-
) : /* @__PURE__ */ jsxs("div", { children: [
|
|
2362
|
-
/* @__PURE__ */ jsx(
|
|
2363
|
-
CustomTimelineWithStatus,
|
|
2364
|
-
{
|
|
2365
|
-
events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
|
|
2366
|
-
var _a3, _b3, _c3, _d3;
|
|
2367
|
-
return {
|
|
2368
|
-
date: moment(item == null ? void 0 : item.created_at).format(
|
|
2369
|
-
"DD-MM-YYYY"
|
|
2252
|
+
] }),
|
|
2253
|
+
/* @__PURE__ */ jsxs(
|
|
2254
|
+
Box,
|
|
2255
|
+
{
|
|
2256
|
+
sx: {
|
|
2257
|
+
flexBasis: "8%",
|
|
2258
|
+
minWidth: 80,
|
|
2259
|
+
textAlign: "center"
|
|
2260
|
+
},
|
|
2261
|
+
children: [
|
|
2262
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
|
|
2263
|
+
/* @__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(
|
|
2264
|
+
(lvl) => lvl.id === (info == null ? void 0 : info.current_level)
|
|
2265
|
+
)) != null ? _k : -1) + 1 || "") })
|
|
2266
|
+
]
|
|
2267
|
+
}
|
|
2370
2268
|
),
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2269
|
+
/* @__PURE__ */ jsxs(
|
|
2270
|
+
Box,
|
|
2271
|
+
{
|
|
2272
|
+
sx: {
|
|
2273
|
+
flexBasis: "18%",
|
|
2274
|
+
minWidth: 200,
|
|
2275
|
+
display: "flex",
|
|
2276
|
+
alignItems: "center",
|
|
2277
|
+
justifyContent: "flex-end",
|
|
2278
|
+
gap: 1.5
|
|
2279
|
+
},
|
|
2280
|
+
children: [
|
|
2281
|
+
(info == null ? void 0 : info.current_status) !== "completed" ? /* @__PURE__ */ jsx(
|
|
2282
|
+
Statusselector_default,
|
|
2283
|
+
{
|
|
2284
|
+
onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
|
|
2285
|
+
onApprove: () => {
|
|
2286
|
+
var _a3;
|
|
2287
|
+
return handleApprove(
|
|
2288
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
|
|
2289
|
+
);
|
|
2290
|
+
},
|
|
2291
|
+
onReject: () => {
|
|
2292
|
+
var _a3;
|
|
2293
|
+
return handleReject(
|
|
2294
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
|
|
2295
|
+
);
|
|
2296
|
+
},
|
|
2297
|
+
onHold: () => {
|
|
2298
|
+
var _a3;
|
|
2299
|
+
return handleOnHold(
|
|
2300
|
+
`${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
|
|
2301
|
+
);
|
|
2302
|
+
},
|
|
2303
|
+
level: info == null ? void 0 : info.isLevelZero,
|
|
2304
|
+
statusList: filterRejectForLevelZero(
|
|
2305
|
+
statusList,
|
|
2306
|
+
info
|
|
2307
|
+
)
|
|
2308
|
+
}
|
|
2309
|
+
) : /* @__PURE__ */ jsx(
|
|
2310
|
+
Chip,
|
|
2311
|
+
{
|
|
2312
|
+
variant: "filled",
|
|
2313
|
+
sx: {
|
|
2314
|
+
backgroundColor: statusData.color,
|
|
2315
|
+
color: statusData.labelColor,
|
|
2316
|
+
height: "40px",
|
|
2317
|
+
px: 2,
|
|
2318
|
+
borderRadius: "100px !important",
|
|
2319
|
+
"& .MuiChip-label": {
|
|
2320
|
+
fontSize: "14px",
|
|
2321
|
+
lineHeight: "15.4px",
|
|
2322
|
+
fontWeight: "500",
|
|
2323
|
+
textTransform: "capitalize"
|
|
2324
|
+
}
|
|
2325
|
+
},
|
|
2326
|
+
label: statusData.title
|
|
2327
|
+
}
|
|
2328
|
+
),
|
|
2329
|
+
/* @__PURE__ */ jsx(
|
|
2330
|
+
Divider,
|
|
2331
|
+
{
|
|
2332
|
+
orientation: "vertical",
|
|
2333
|
+
flexItem: true,
|
|
2334
|
+
sx: {
|
|
2335
|
+
borderColor: "#E0E0E0",
|
|
2336
|
+
height: "40px"
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
),
|
|
2340
|
+
/* @__PURE__ */ jsx(
|
|
2341
|
+
IconButton,
|
|
2342
|
+
{
|
|
2343
|
+
color: "primary",
|
|
2344
|
+
sx: {
|
|
2345
|
+
background: "rgba(25,118,210,0.08)",
|
|
2346
|
+
boxShadow: "2px 2px 10px 0px #4C4E6426",
|
|
2347
|
+
"& span": { color: "primary.dark" }
|
|
2348
|
+
},
|
|
2349
|
+
onClick: () => handleExpandClick(info._id),
|
|
2350
|
+
children: expandedId === info._id ? /* @__PURE__ */ jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsx("span", { className: "icon-arrow-right-3" })
|
|
2351
|
+
}
|
|
2352
|
+
)
|
|
2353
|
+
]
|
|
2354
|
+
}
|
|
2355
|
+
)
|
|
2356
|
+
]
|
|
2357
|
+
}
|
|
2358
|
+
),
|
|
2359
|
+
expandedId === info._id && /* @__PURE__ */ jsx(Box, { sx: { mt: 2, ml: 2 }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsx(
|
|
2360
|
+
Box,
|
|
2391
2361
|
{
|
|
2392
|
-
|
|
2393
|
-
|
|
2362
|
+
sx: {
|
|
2363
|
+
height: 150,
|
|
2364
|
+
display: "flex",
|
|
2365
|
+
justifyContent: "center",
|
|
2366
|
+
alignItems: "center"
|
|
2367
|
+
},
|
|
2368
|
+
children: /* @__PURE__ */ jsx(CircularProgress, { size: 36, color: "primary" })
|
|
2394
2369
|
}
|
|
2395
|
-
)
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2370
|
+
) : /* @__PURE__ */ jsxs("div", { children: [
|
|
2371
|
+
/* @__PURE__ */ jsx(
|
|
2372
|
+
CustomTimelineWithStatus,
|
|
2373
|
+
{
|
|
2374
|
+
events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
|
|
2375
|
+
var _a3, _b3, _c3, _d3;
|
|
2376
|
+
return {
|
|
2377
|
+
date: moment(item == null ? void 0 : item.created_at).format(
|
|
2378
|
+
"DD-MM-YYYY"
|
|
2379
|
+
),
|
|
2380
|
+
time: moment(item == null ? void 0 : item.created_at).format(
|
|
2381
|
+
"HH:mm"
|
|
2382
|
+
),
|
|
2383
|
+
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",
|
|
2384
|
+
subTitle: ((_c3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _c3.comment) || "No Comments",
|
|
2385
|
+
attachment: ((_d3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _d3.file) || null,
|
|
2386
|
+
count: (item == null ? void 0 : item.current_level) == "L0" ? "L0" : item == null ? void 0 : item.current_level_count,
|
|
2387
|
+
cardType: "card",
|
|
2388
|
+
status: (item == null ? void 0 : item.type) === "approve" ? StatusObj.approved : (item == null ? void 0 : item.type) === "reject" ? StatusObj.rejected : (item == null ? void 0 : item.type) === "send_back" ? StatusObj.sendback : (item == null ? void 0 : item.type) === "onhold" ? StatusObj.onhold : null
|
|
2389
|
+
};
|
|
2390
|
+
})
|
|
2391
|
+
}
|
|
2392
|
+
),
|
|
2393
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2394
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: /* @__PURE__ */ jsxs("span", { style: { fontWeight: "bold" }, children: [
|
|
2395
|
+
"Currently Assigned to:",
|
|
2396
|
+
" "
|
|
2397
|
+
] }) }),
|
|
2398
|
+
/* @__PURE__ */ jsx(
|
|
2399
|
+
Tooltip,
|
|
2400
|
+
{
|
|
2401
|
+
title: (info == null ? void 0 : info.isLevelZero) ? (_m = (_l = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _l.created_by_user) == null ? void 0 : _m.official_email_id : (_o = (_n = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _n.assigned_user) == null ? void 0 : _o.official_email_id,
|
|
2402
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: (info == null ? void 0 : info.isLevelZero) ? `${expandedDetails == null ? void 0 : expandedDetails[0].created_by_user.full_name} (${((_q = (_p = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _p.created_by_user) == null ? void 0 : _q.group_employee_code) || "N/A"})` : `${(_s = (_r = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _r.assigned_user) == null ? void 0 : _s.full_name} (${((_u = (_t = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _t.assigned_user) == null ? void 0 : _u.group_employee_code) || "N/A"})` })
|
|
2403
|
+
}
|
|
2404
|
+
)
|
|
2405
|
+
] })
|
|
2406
|
+
] }) })
|
|
2407
|
+
]
|
|
2408
|
+
},
|
|
2409
|
+
index
|
|
2410
|
+
);
|
|
2411
|
+
}) : /* @__PURE__ */ jsx(
|
|
2412
|
+
"div",
|
|
2413
|
+
{
|
|
2414
|
+
style: {
|
|
2415
|
+
height: "100%",
|
|
2416
|
+
width: "100%",
|
|
2417
|
+
color: "gray",
|
|
2418
|
+
fontSize: "20px",
|
|
2419
|
+
display: "flex",
|
|
2420
|
+
justifyContent: "center",
|
|
2421
|
+
alignItems: "center"
|
|
2422
|
+
},
|
|
2423
|
+
children: "NO RECORD FOUND"
|
|
2424
|
+
}
|
|
2425
|
+
)
|
|
2415
2426
|
}
|
|
2416
2427
|
)
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2428
|
+
]
|
|
2429
|
+
}
|
|
2430
|
+
)
|
|
2420
2431
|
}
|
|
2421
2432
|
),
|
|
2422
2433
|
/* @__PURE__ */ jsx(
|