amp-workflow-ui 0.1.19 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +19 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -296,6 +296,7 @@ function WorkflowRequestCard({
|
|
|
296
296
|
helpers
|
|
297
297
|
}) {
|
|
298
298
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
299
|
+
console.log("\u{1F680} ~ WorkflowRequestCard ~ requestDetails:", requestDetails);
|
|
299
300
|
const { timeLeftDHm, getStatus, buildRedirectionUrl } = helpers;
|
|
300
301
|
const allCurrentAssignees = (_a = requestDetails == null ? void 0 : requestDetails.levels) == null ? void 0 : _a.map(
|
|
301
302
|
(level) => {
|
|
@@ -312,7 +313,6 @@ function WorkflowRequestCard({
|
|
|
312
313
|
const allAssignees = [
|
|
313
314
|
.../* @__PURE__ */ new Set([...allCurrentAssignees, ...allCurrentEscalatedAssignees])
|
|
314
315
|
].filter((item) => item);
|
|
315
|
-
console.log("\u{1F680} ~ WorkflowRequestCard ~ allAssignees:", allAssignees);
|
|
316
316
|
const currentLevel = (_c = requestDetails == null ? void 0 : requestDetails.levels) == null ? void 0 : _c.find(
|
|
317
317
|
(level_) => level_.id === (requestDetails == null ? void 0 : requestDetails.current_level)
|
|
318
318
|
);
|
|
@@ -320,10 +320,6 @@ function WorkflowRequestCard({
|
|
|
320
320
|
const currentlyEscaltedUserArray = (currentLevel == null ? void 0 : currentLevel.escalate_assign_to_name) || [];
|
|
321
321
|
const currentlyAssignedUser = (currentLevel == null ? void 0 : currentLevel.assign_to_name) ? currentLevel == null ? void 0 : currentLevel.assign_to_name[0] : "NA";
|
|
322
322
|
const currentlyEscalatedUser = (currentLevel == null ? void 0 : currentLevel.escalate_assign_to_name) ? currentLevel == null ? void 0 : currentLevel.escalate_assign_to_name[0] : "NA";
|
|
323
|
-
console.log(
|
|
324
|
-
"\u{1F680} ~ WorkflowRequestCard ~ currentlyEscalatedUser:",
|
|
325
|
-
currentLevel == null ? void 0 : currentLevel.escalate_assign_to_name
|
|
326
|
-
);
|
|
327
323
|
const extraCurrentlyAssignedUserCount = currentlyAssignedUserArray.length - 1;
|
|
328
324
|
const extraCurrentlyEscalatedUserCount = currentlyEscaltedUserArray.length - 1;
|
|
329
325
|
const statusList = currentLevel ? currentLevel.status_list : [];
|
|
@@ -347,6 +343,7 @@ function WorkflowRequestCard({
|
|
|
347
343
|
(lvl) => lvl.id === (requestDetails == null ? void 0 : requestDetails.current_level)
|
|
348
344
|
)) != null ? _l : -1) + 1 || "");
|
|
349
345
|
const tatExpired = timeLeftDHm(currentLevel == null ? void 0 : currentLevel.tat_expiry) === "0d: 0h: 0m";
|
|
346
|
+
const userDetails = userInfo == null ? void 0 : userInfo.userInfo;
|
|
350
347
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
351
348
|
material.Box,
|
|
352
349
|
{
|
|
@@ -537,7 +534,7 @@ function WorkflowRequestCard({
|
|
|
537
534
|
tatExpired ? currentlyEscalatedUser : currentlyAssignedUser
|
|
538
535
|
] })
|
|
539
536
|
] }),
|
|
540
|
-
(requestDetails == null ? void 0 : requestDetails.current_status) !== "completed" ? /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { className: "action-buttons", children: [
|
|
537
|
+
(requestDetails == null ? void 0 : requestDetails.current_status) !== "completed" && (userDetails == null ? void 0 : userDetails.id) !== (requestDetails == null ? void 0 : requestDetails.created_by) && !(requestDetails == null ? void 0 : requestDetails.isLevelZero) ? /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { className: "action-buttons", children: [
|
|
541
538
|
filterRejectForLevelZero(statusList, requestDetails).find(
|
|
542
539
|
(list) => list.status == 3
|
|
543
540
|
) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -579,7 +576,20 @@ function WorkflowRequestCard({
|
|
|
579
576
|
children: "Approve"
|
|
580
577
|
}
|
|
581
578
|
)
|
|
582
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
579
|
+
] }) : (requestDetails == null ? void 0 : requestDetails.isLevelZero) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
580
|
+
material.Button,
|
|
581
|
+
{
|
|
582
|
+
variant: "contained",
|
|
583
|
+
className: "btn-approve",
|
|
584
|
+
onClick: () => {
|
|
585
|
+
var _a2;
|
|
586
|
+
return handleApprove(
|
|
587
|
+
`${requestDetails == null ? void 0 : requestDetails._id}|${(_a2 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a2.id}`
|
|
588
|
+
);
|
|
589
|
+
},
|
|
590
|
+
children: "Approve"
|
|
591
|
+
}
|
|
592
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
583
593
|
WorkflowButton_default,
|
|
584
594
|
{
|
|
585
595
|
variant: currentStatus === "approved" ? "approved" : currentStatus === "rejected" ? "rejected" : "pending",
|
|
@@ -1455,8 +1465,8 @@ var SearchBox = ({
|
|
|
1455
1465
|
className: "custom-search",
|
|
1456
1466
|
sx: {
|
|
1457
1467
|
"& .MuiOutlinedInput-root": {
|
|
1458
|
-
height: "38px",
|
|
1459
|
-
borderRadius: "20px"
|
|
1468
|
+
height: "38px !important",
|
|
1469
|
+
borderRadius: "20px !important"
|
|
1460
1470
|
}
|
|
1461
1471
|
},
|
|
1462
1472
|
InputProps: {
|
|
@@ -1767,7 +1777,6 @@ function ApprovalWorkflow({
|
|
|
1767
1777
|
const [selectedOption, setSelectedOption] = React7.useState(
|
|
1768
1778
|
selectedWorkflowsList.length ? "selected" : "Assign To Me"
|
|
1769
1779
|
);
|
|
1770
|
-
console.log("\u{1F680} ~ ApprovalWorkflow ~ selectedOption:", selectedOption);
|
|
1771
1780
|
const [expandedId, setExpandedId] = React7.useState(null);
|
|
1772
1781
|
const [sendDialog, setSendDialog] = React7__default.default.useState(null);
|
|
1773
1782
|
const [approveTarget, setApproveTarget] = React7__default.default.useState(null);
|
|
@@ -1826,7 +1835,6 @@ function ApprovalWorkflow({
|
|
|
1826
1835
|
filters: null
|
|
1827
1836
|
}
|
|
1828
1837
|
});
|
|
1829
|
-
console.log("\u{1F680} ~ ApprovalWorkflow ~ tabs:", tabs);
|
|
1830
1838
|
const [searchText, setSearchText] = React7.useState("");
|
|
1831
1839
|
const debouncedSearchTerm = useDebounce_default(searchText, 500);
|
|
1832
1840
|
React7.useEffect(() => {
|
|
@@ -1913,7 +1921,6 @@ function ApprovalWorkflow({
|
|
|
1913
1921
|
var _a2, _b2;
|
|
1914
1922
|
if (!((_a2 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a2.id)) return;
|
|
1915
1923
|
const currentFilters = filtersOverride || ((_b2 = tabs[tab]) == null ? void 0 : _b2.filters);
|
|
1916
|
-
console.log("\u{1F680} ~ ApprovalWorkflow ~ currentFilters:", currentFilters);
|
|
1917
1924
|
let filterQuery = "";
|
|
1918
1925
|
if (currentFilters) {
|
|
1919
1926
|
if (currentFilters.approvalType)
|