@tesouro/embedded-components-react 0.11.129 → 0.11.131
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/fixtures/index.d.ts +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +20 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +14 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js +31 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index24.js +26 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index25.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +35 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +57 -65
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +6 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +20 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +97 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +10 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +7 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +8 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +24 -139
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +24 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +14 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +130 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +17 -100
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +21 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +41 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +98 -53
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +82 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +3 -193
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +57 -81
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +110 -66
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +190 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +71 -456
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +69 -114
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +113 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +458 -79
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +116 -79
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +10 -256
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +78 -36
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +73 -236
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +256 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +43 -516
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +245 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +20 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +497 -211
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +40 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +235 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +64 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index6.js +4 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index7.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index8.js +8 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +18 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index3.js +44 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -1,31 +1,12 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { usePayableApprovalRequestsQuery as e } from "../../data-access/dist/index2.js";
|
|
6
|
-
import "../../data-access/dist/index.js";
|
|
7
|
-
import { currentApprovalRound as t } from "./index7.js";
|
|
8
|
-
import { usePayableApprovalRoundStart as n } from "./index10.js";
|
|
9
|
-
import { resolveBillRejectionNotice as r } from "./index15.js";
|
|
10
|
-
import { useMemo as i } from "react";
|
|
11
1
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
payableUpdatedAt: s,
|
|
22
|
-
labels: u
|
|
23
|
-
}), [
|
|
24
|
-
o,
|
|
25
|
-
s,
|
|
26
|
-
p,
|
|
27
|
-
l,
|
|
28
|
-
u
|
|
29
|
-
]);
|
|
2
|
+
function e({ isCapabilityUnknown: e, canApproveNow: t, canOverridePolicy: n, status: r, hasApprovalPolicy: i, pendingApproverNames: a, labels: o }) {
|
|
3
|
+
if (e) return { showApprovalOverrideNotice: !1 };
|
|
4
|
+
if (n) return { showApprovalOverrideNotice: !t };
|
|
5
|
+
if (t || r !== "approve_in_progress" || !i) return { showApprovalOverrideNotice: !1 };
|
|
6
|
+
let s = [...new Set(a)];
|
|
7
|
+
return {
|
|
8
|
+
showApprovalOverrideNotice: !1,
|
|
9
|
+
awaitingApprovalNotice: s.length ? o.awaitingApprovalNotice(s) : o.awaitingApprovalUnknownNotice
|
|
10
|
+
};
|
|
30
11
|
}
|
|
31
|
-
export {
|
|
12
|
+
export { e as resolveApprovalNotices };
|
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { hasAnyScope as e } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
6
|
-
import { Scope as t } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
7
|
-
import "../../../../shared/data-access/dist/index.js";
|
|
8
|
-
import { useWidgetConfig as n } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
9
|
-
import "../../../../shared/feature/dist/index.js";
|
|
10
|
-
import { usePayableApprovalRequestsQuery as r } from "../../data-access/dist/index2.js";
|
|
11
|
-
import "../../data-access/dist/index.js";
|
|
12
|
-
import { currentApprovalRound as i } from "./index7.js";
|
|
13
|
-
import { usePayableApprovalRoundStart as a } from "./index10.js";
|
|
14
1
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
enabled: u
|
|
19
|
-
}), f = c?.userId ?? void 0, p = (e) => e.caller_is_policy_approver ?? !!(f && e.user_ids.includes(f)), m = r(o, {
|
|
20
|
-
enabled: u,
|
|
21
|
-
hasAwaitedRequest: u ? (e) => i(e, d).some(p) : void 0,
|
|
22
|
-
currentRoundStartedAt: d
|
|
23
|
-
}), h = u ? i(m.data?.data, d) : [], g = h.some(p), _ = h.filter((e) => e.status === "waiting");
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
if (!e) return;
|
|
4
|
+
let { onOpen: n, canEditExisting: r, ...i } = e;
|
|
24
5
|
return {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
isLoading: m.isLoading
|
|
6
|
+
...i,
|
|
7
|
+
onEditExisting: t && r ? n : void 0,
|
|
8
|
+
onAdd: t ? void 0 : n
|
|
29
9
|
};
|
|
30
10
|
}
|
|
31
|
-
export {
|
|
11
|
+
export { e as resolvePaymentInstructionsGestures };
|
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { buildPayableAuditHistory as e, hasUnattributedAuditRows as t } from "../../../../shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js";
|
|
1
|
+
import { formatRejectionDate as e } from "../../../../shared/util/dist/lib/formatRejectionDate.js";
|
|
6
2
|
import "../../../../shared/util/dist/index.js";
|
|
7
|
-
import { usePayableHistoryQuery as n } from "../../data-access/dist/index3.js";
|
|
8
|
-
import "../../data-access/dist/index.js";
|
|
9
|
-
import { useMemo as r } from "react";
|
|
10
3
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
s
|
|
16
|
-
]);
|
|
4
|
+
function t({ payableStatus: t, approvalRequests: n, userNames: r, payableUpdatedAt: i, labels: a, now: o }) {
|
|
5
|
+
let s = n.find((e) => e.status === "rejected");
|
|
6
|
+
if (!s) return t !== "rejected" || !i ? void 0 : { actorLabel: a.rejectedOn(e(i, o)) };
|
|
7
|
+
let c = s.rejected_by ? r.get(s.rejected_by) : void 0, l = e(s.updated_at, o);
|
|
17
8
|
return {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
namesError: o && t(c.data?.data ?? [], l, a)
|
|
9
|
+
actorLabel: c ? a.rejectedByOn(c, l) : a.rejectedOn(l),
|
|
10
|
+
message: s.reject_reason ? a.rejectionMessage(s.reject_reason) : void 0
|
|
21
11
|
};
|
|
22
12
|
}
|
|
23
|
-
export {
|
|
13
|
+
export { t as resolveBillRejectionNotice };
|
|
@@ -2,145 +2,30 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import "../../../../shared/ui/dist/index.js";
|
|
7
|
-
import { useWidgetConfig as t } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
8
|
-
import "../../../../shared/feature/dist/index.js";
|
|
9
|
-
import { useApprovePayableApprovalRequestMutation as n, useRejectPayableApprovalRequestMutation as r } from "../../data-access/dist/index2.js";
|
|
10
|
-
import { useCancelPayableMutation as i } from "../../data-access/dist/index7.js";
|
|
11
|
-
import { useCancelScheduledPaymentMutation as a } from "../../data-access/dist/index8.js";
|
|
12
|
-
import { useForceApprovePayableMutation as o } from "../../data-access/dist/index12.js";
|
|
13
|
-
import { useForceRejectPayableMutation as s } from "../../data-access/dist/index13.js";
|
|
14
|
-
import { useReopenPayableMutation as c } from "../../data-access/dist/index14.js";
|
|
5
|
+
import { usePayableApprovalRequestsQuery as e } from "../../data-access/dist/index2.js";
|
|
15
6
|
import "../../data-access/dist/index.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
7
|
+
import { currentApprovalRound as t } from "./index6.js";
|
|
8
|
+
import { usePayableApprovalRoundStart as n } from "./index13.js";
|
|
9
|
+
import { resolveBillRejectionNotice as r } from "./index18.js";
|
|
10
|
+
import { useMemo as i } from "react";
|
|
19
11
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js
|
|
20
|
-
function
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
}), G = {
|
|
40
|
-
reject: {
|
|
41
|
-
isPending: M.isPending,
|
|
42
|
-
run: (e) => p && M.mutate({
|
|
43
|
-
path: { approval_request_id: p },
|
|
44
|
-
body: e ? { reject_reason: e } : void 0
|
|
45
|
-
}, W("reject"))
|
|
46
|
-
},
|
|
47
|
-
approve: {
|
|
48
|
-
isPending: N.isPending,
|
|
49
|
-
run: () => p && N.mutate({ path: { approval_request_id: p } }, W("approve"))
|
|
50
|
-
},
|
|
51
|
-
cancel: {
|
|
52
|
-
isPending: P.isPending,
|
|
53
|
-
run: () => d && P.mutate({ path: { payable_id: d } }, W("cancel"))
|
|
54
|
-
},
|
|
55
|
-
cancelScheduledPayment: {
|
|
56
|
-
isPending: F.isPending,
|
|
57
|
-
run: () => {
|
|
58
|
-
let e = H?.scheduledPaymentIntentId;
|
|
59
|
-
d && e && F.mutate({
|
|
60
|
-
path: { payment_intent_id: e },
|
|
61
|
-
payableId: d
|
|
62
|
-
}, W("cancelScheduledPayment"));
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
reopen: {
|
|
66
|
-
isPending: I.isPending,
|
|
67
|
-
run: () => d && I.mutate({ path: { payable_id: d } }, W("reopen"))
|
|
68
|
-
},
|
|
69
|
-
forceApprove: {
|
|
70
|
-
isPending: L.isPending,
|
|
71
|
-
run: () => d && L.mutate({ path: { payable_id: d } }, W("forceApprove"))
|
|
72
|
-
},
|
|
73
|
-
forceReject: {
|
|
74
|
-
isPending: R.isPending,
|
|
75
|
-
run: () => d && R.mutate({ path: { payable_id: d } }, W("forceReject"))
|
|
76
|
-
}
|
|
77
|
-
}, K = U.map((e) => ({
|
|
78
|
-
...e,
|
|
79
|
-
disabled: z,
|
|
80
|
-
loading: e.id === "markAsPaid" ? C : G[e.id]?.isPending ?? !1,
|
|
81
|
-
onSelect: () => {
|
|
82
|
-
!z && d && (e.id === "payBill" ? D() : e.id === "markAsPaid" ? O() : e.id === "edit" ? k?.() : y(e.id) ? V({
|
|
83
|
-
id: e.id,
|
|
84
|
-
scheduledPaymentIntentId: g
|
|
85
|
-
}) : G[e.id]?.run());
|
|
86
|
-
}
|
|
87
|
-
}));
|
|
88
|
-
return {
|
|
89
|
-
isActionPending: z,
|
|
90
|
-
actions: {
|
|
91
|
-
row: K.filter((e) => e.surface === "row"),
|
|
92
|
-
menu: K.filter((e) => e.surface === "menu")
|
|
93
|
-
},
|
|
94
|
-
decisionDialog: {
|
|
95
|
-
open: !!H,
|
|
96
|
-
copy: H ? {
|
|
97
|
-
...S.decisionDialog[H.id],
|
|
98
|
-
...b(H.id) && !w ? S.decisionDialog[H.id].noApprovalPolicy : void 0,
|
|
99
|
-
presentation: _(H.id),
|
|
100
|
-
pendingApprovers: b(H.id) ? E ?? [] : void 0
|
|
101
|
-
} : void 0,
|
|
102
|
-
isPending: H ? G[H.id]?.isPending ?? !1 : !1,
|
|
103
|
-
onCancel: () => {
|
|
104
|
-
z || V(void 0);
|
|
105
|
-
},
|
|
106
|
-
onConfirm: (e) => {
|
|
107
|
-
H && !z && (G[H.id]?.run(e), V(void 0));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
12
|
+
function a({ payableId: a, payableStatus: o, payableUpdatedAt: s, enabled: c, userNames: l, labels: u }) {
|
|
13
|
+
let d = n({
|
|
14
|
+
payableId: a,
|
|
15
|
+
enabled: c
|
|
16
|
+
}), f = e(a, { enabled: c }), p = i(() => t(f.data?.data, d.roundStartedAt), [f.data, d.roundStartedAt]);
|
|
17
|
+
return i(() => r({
|
|
18
|
+
payableStatus: o,
|
|
19
|
+
approvalRequests: p,
|
|
20
|
+
userNames: l,
|
|
21
|
+
payableUpdatedAt: s,
|
|
22
|
+
labels: u
|
|
23
|
+
}), [
|
|
24
|
+
o,
|
|
25
|
+
s,
|
|
26
|
+
p,
|
|
27
|
+
l,
|
|
28
|
+
u
|
|
29
|
+
]);
|
|
111
30
|
}
|
|
112
|
-
|
|
113
|
-
alignment: "center",
|
|
114
|
-
icon: f,
|
|
115
|
-
tone: "destructive",
|
|
116
|
-
actionWidth: "equal"
|
|
117
|
-
}, h = {
|
|
118
|
-
alignment: "center",
|
|
119
|
-
icon: d,
|
|
120
|
-
tone: "destructive",
|
|
121
|
-
actionWidth: "equal"
|
|
122
|
-
}, g = {
|
|
123
|
-
alignment: "center",
|
|
124
|
-
icon: d,
|
|
125
|
-
tone: "destructive",
|
|
126
|
-
actionWidth: "equal"
|
|
127
|
-
};
|
|
128
|
-
function _(e) {
|
|
129
|
-
if (b(e)) return m;
|
|
130
|
-
if (e === "reject") return h;
|
|
131
|
-
if (e === "cancel") return g;
|
|
132
|
-
}
|
|
133
|
-
var v = [
|
|
134
|
-
"reject",
|
|
135
|
-
"cancel",
|
|
136
|
-
"cancelScheduledPayment",
|
|
137
|
-
"forceApprove",
|
|
138
|
-
"forceReject"
|
|
139
|
-
];
|
|
140
|
-
function y(e) {
|
|
141
|
-
return v.includes(e);
|
|
142
|
-
}
|
|
143
|
-
function b(e) {
|
|
144
|
-
return e === "forceApprove" || e === "forceReject";
|
|
145
|
-
}
|
|
146
|
-
export { p as usePayableDetailActions };
|
|
31
|
+
export { a as useBillRejectionNotice };
|
|
@@ -2,19 +2,30 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { hasAnyScope as e } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
6
|
+
import { Scope as t } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
7
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
8
|
+
import { useWidgetConfig as n } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
6
9
|
import "../../../../shared/feature/dist/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import "
|
|
9
|
-
import {
|
|
10
|
+
import { usePayableApprovalRequestsQuery as r } from "../../data-access/dist/index2.js";
|
|
11
|
+
import "../../data-access/dist/index.js";
|
|
12
|
+
import { currentApprovalRound as i } from "./index6.js";
|
|
13
|
+
import { usePayableApprovalRoundStart as a } from "./index13.js";
|
|
10
14
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
function o({ payableId: o, status: s }) {
|
|
16
|
+
let { initResponse: c } = n(), l = e(c?.scopes, [t.ApprovalRequestReadOrg]), u = s === "approve_in_progress" && l, { roundStartedAt: d } = a({
|
|
17
|
+
payableId: o,
|
|
18
|
+
enabled: u
|
|
19
|
+
}), f = c?.userId ?? void 0, p = (e) => e.caller_is_policy_approver ?? !!(f && e.user_ids.includes(f)), m = r(o, {
|
|
20
|
+
enabled: u,
|
|
21
|
+
hasAwaitedRequest: u ? (e) => i(e, d).some(p) : void 0,
|
|
22
|
+
currentRoundStartedAt: d
|
|
23
|
+
}), h = u ? i(m.data?.data, d) : [], g = h.some(p), _ = h.filter((e) => e.status === "waiting");
|
|
24
|
+
return {
|
|
25
|
+
id: _.filter(p).find((e) => !(f && (e.approved_by ?? []).includes(f)))?.id,
|
|
26
|
+
isPolicyApprover: g,
|
|
27
|
+
hasWaitingRequest: _.length > 0,
|
|
28
|
+
isLoading: m.isLoading
|
|
29
|
+
};
|
|
19
30
|
}
|
|
20
|
-
export {
|
|
31
|
+
export { o as useCurrentApprovalRequestId };
|
|
@@ -2,25 +2,22 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import "
|
|
8
|
-
import { useWidgetConfig as n } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
9
|
-
import "../../../../shared/feature/dist/index.js";
|
|
10
|
-
import { isLiveScheduledPaymentRecord as r } from "../../../util/dist/lib/isLiveScheduledPaymentRecord.js";
|
|
11
|
-
import "../../../util/dist/index.js";
|
|
12
|
-
import { usePayablePaymentRecordsQuery as i } from "../../data-access/dist/index19.js";
|
|
5
|
+
import { buildPayableAuditHistory as e, hasUnattributedAuditRows as t } from "../../../../shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js";
|
|
6
|
+
import "../../../../shared/util/dist/index.js";
|
|
7
|
+
import { usePayableHistoryQuery as n } from "../../data-access/dist/index3.js";
|
|
13
8
|
import "../../data-access/dist/index.js";
|
|
9
|
+
import { useMemo as r } from "react";
|
|
14
10
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js
|
|
15
|
-
function
|
|
16
|
-
let
|
|
11
|
+
function i({ payableId: i, userNames: a, isRosterError: o, labels: s }) {
|
|
12
|
+
let c = n(i), l = r(() => e(c.data?.data ?? [], a, s), [
|
|
13
|
+
c.data,
|
|
14
|
+
a,
|
|
15
|
+
s
|
|
16
|
+
]);
|
|
17
17
|
return {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
isResolving: u.isResolving,
|
|
22
|
-
scheduledDate: p ?? void 0,
|
|
23
|
-
scheduledPaymentIntentId: d?.payment_intent_id ?? void 0
|
|
18
|
+
historyQuery: c,
|
|
19
|
+
rows: l,
|
|
20
|
+
namesError: o && t(c.data?.data ?? [], l, a)
|
|
24
21
|
};
|
|
25
22
|
}
|
|
26
|
-
export {
|
|
23
|
+
export { i as usePayableAuditHistory };
|
|
@@ -3,41 +3,144 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import { hasAnyScope as t } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
7
|
-
import { Scope as n } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
8
|
-
import "../../../../shared/data-access/dist/index.js";
|
|
9
6
|
import "../../../../shared/ui/dist/index.js";
|
|
10
|
-
import { useWidgetConfig as
|
|
7
|
+
import { useWidgetConfig as t } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
8
|
import "../../../../shared/feature/dist/index.js";
|
|
12
|
-
import {
|
|
9
|
+
import { useApprovePayableApprovalRequestMutation as n, useRejectPayableApprovalRequestMutation as r } from "../../data-access/dist/index2.js";
|
|
10
|
+
import { useCancelPayableMutation as i } from "../../data-access/dist/index7.js";
|
|
11
|
+
import { useCancelScheduledPaymentMutation as a } from "../../data-access/dist/index8.js";
|
|
12
|
+
import { useForceApprovePayableMutation as o } from "../../data-access/dist/index12.js";
|
|
13
|
+
import { useForceRejectPayableMutation as s } from "../../data-access/dist/index13.js";
|
|
14
|
+
import { useReopenPayableMutation as c } from "../../data-access/dist/index14.js";
|
|
13
15
|
import "../../data-access/dist/index.js";
|
|
14
|
-
import {
|
|
16
|
+
import { getBillDetailActions as l } from "./index5.js";
|
|
17
|
+
import { useState as u } from "react";
|
|
18
|
+
import { BanIcon as d, HandIcon as f } from "lucide-react";
|
|
15
19
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js
|
|
16
|
-
function
|
|
17
|
-
let { initResponse:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
function p({ payableId: d, status: f, currentApprovalRequestId: p, arePendingApproversUnknown: m, hasScheduledPayment: h, scheduledPaymentIntentId: g, isScheduledPaymentUnknown: v, isPayabilityUnknown: x, labels: S, isMarkAsPaidPending: C, hasApprovalPolicy: w = !0, hasWaitingRequest: T, pendingApprovers: E, onPayBillSelect: D, onMarkAsPaidSelect: O, onEditSelect: k, onActionSucceeded: A }) {
|
|
21
|
+
let { initResponse: j } = t(), M = r(), N = n(), P = i(), F = a(), I = c(), L = o(), R = s(), z = C || M.isPending || N.isPending || P.isPending || F.isPending || I.isPending || L.isPending || R.isPending, [B, V] = u(), H = B && (B.id !== "cancelScheduledPayment" || B.scheduledPaymentIntentId === g) ? B : void 0, U = d && f ? l({
|
|
22
|
+
status: f,
|
|
23
|
+
scopes: j?.scopes,
|
|
24
|
+
canDecideApprovalRequest: !!p,
|
|
25
|
+
arePendingApproversUnknown: m,
|
|
26
|
+
hasApprovalPolicy: w,
|
|
27
|
+
hasWaitingRequest: T,
|
|
28
|
+
hasScheduledPayment: h || v,
|
|
29
|
+
scheduledPaymentIntentId: g,
|
|
30
|
+
isPayabilityUnknown: x,
|
|
31
|
+
canEdit: !!k,
|
|
32
|
+
labels: S
|
|
33
|
+
}) : [], W = (t) => ({
|
|
34
|
+
onError: () => e.error(S.actionError),
|
|
35
|
+
onSuccess: () => {
|
|
36
|
+
let n = b(t) && !w ? `${t}NoApprovalPolicy` : t;
|
|
37
|
+
e.success(S.actionSuccess[n]), A?.(t);
|
|
38
|
+
}
|
|
39
|
+
}), G = {
|
|
40
|
+
reject: {
|
|
41
|
+
isPending: M.isPending,
|
|
42
|
+
run: (e) => p && M.mutate({
|
|
43
|
+
path: { approval_request_id: p },
|
|
44
|
+
body: e ? { reject_reason: e } : void 0
|
|
45
|
+
}, W("reject"))
|
|
46
|
+
},
|
|
47
|
+
approve: {
|
|
48
|
+
isPending: N.isPending,
|
|
49
|
+
run: () => p && N.mutate({ path: { approval_request_id: p } }, W("approve"))
|
|
50
|
+
},
|
|
51
|
+
cancel: {
|
|
52
|
+
isPending: P.isPending,
|
|
53
|
+
run: () => d && P.mutate({ path: { payable_id: d } }, W("cancel"))
|
|
54
|
+
},
|
|
55
|
+
cancelScheduledPayment: {
|
|
56
|
+
isPending: F.isPending,
|
|
57
|
+
run: () => {
|
|
58
|
+
let e = H?.scheduledPaymentIntentId;
|
|
59
|
+
d && e && F.mutate({
|
|
60
|
+
path: { payment_intent_id: e },
|
|
61
|
+
payableId: d
|
|
62
|
+
}, W("cancelScheduledPayment"));
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
reopen: {
|
|
66
|
+
isPending: I.isPending,
|
|
67
|
+
run: () => d && I.mutate({ path: { payable_id: d } }, W("reopen"))
|
|
68
|
+
},
|
|
69
|
+
forceApprove: {
|
|
70
|
+
isPending: L.isPending,
|
|
71
|
+
run: () => d && L.mutate({ path: { payable_id: d } }, W("forceApprove"))
|
|
72
|
+
},
|
|
73
|
+
forceReject: {
|
|
74
|
+
isPending: R.isPending,
|
|
75
|
+
run: () => d && R.mutate({ path: { payable_id: d } }, W("forceReject"))
|
|
76
|
+
}
|
|
77
|
+
}, K = U.map((e) => ({
|
|
78
|
+
...e,
|
|
79
|
+
disabled: z,
|
|
80
|
+
loading: e.id === "markAsPaid" ? C : G[e.id]?.isPending ?? !1,
|
|
81
|
+
onSelect: () => {
|
|
82
|
+
!z && d && (e.id === "payBill" ? D() : e.id === "markAsPaid" ? O() : e.id === "edit" ? k?.() : y(e.id) ? V({
|
|
83
|
+
id: e.id,
|
|
84
|
+
scheduledPaymentIntentId: g
|
|
85
|
+
}) : G[e.id]?.run());
|
|
86
|
+
}
|
|
87
|
+
}));
|
|
23
88
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
89
|
+
isActionPending: z,
|
|
90
|
+
actions: {
|
|
91
|
+
row: K.filter((e) => e.surface === "row"),
|
|
92
|
+
menu: K.filter((e) => e.surface === "menu")
|
|
93
|
+
},
|
|
94
|
+
decisionDialog: {
|
|
95
|
+
open: !!H,
|
|
96
|
+
copy: H ? {
|
|
97
|
+
...S.decisionDialog[H.id],
|
|
98
|
+
...b(H.id) && !w ? S.decisionDialog[H.id].noApprovalPolicy : void 0,
|
|
99
|
+
presentation: _(H.id),
|
|
100
|
+
pendingApprovers: b(H.id) ? E ?? [] : void 0
|
|
101
|
+
} : void 0,
|
|
102
|
+
isPending: H ? G[H.id]?.isPending ?? !1 : !1,
|
|
29
103
|
onCancel: () => {
|
|
30
|
-
|
|
104
|
+
z || V(void 0);
|
|
31
105
|
},
|
|
32
|
-
onConfirm: () => {
|
|
33
|
-
|
|
34
|
-
onError: () => e.error(l.error),
|
|
35
|
-
onSuccess: () => {
|
|
36
|
-
m(!1), u();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
106
|
+
onConfirm: (e) => {
|
|
107
|
+
H && !z && (G[H.id]?.run(e), V(void 0));
|
|
39
108
|
}
|
|
40
109
|
}
|
|
41
110
|
};
|
|
42
111
|
}
|
|
43
|
-
|
|
112
|
+
var m = {
|
|
113
|
+
alignment: "center",
|
|
114
|
+
icon: f,
|
|
115
|
+
tone: "destructive",
|
|
116
|
+
actionWidth: "equal"
|
|
117
|
+
}, h = {
|
|
118
|
+
alignment: "center",
|
|
119
|
+
icon: d,
|
|
120
|
+
tone: "destructive",
|
|
121
|
+
actionWidth: "equal"
|
|
122
|
+
}, g = {
|
|
123
|
+
alignment: "center",
|
|
124
|
+
icon: d,
|
|
125
|
+
tone: "destructive",
|
|
126
|
+
actionWidth: "equal"
|
|
127
|
+
};
|
|
128
|
+
function _(e) {
|
|
129
|
+
if (b(e)) return m;
|
|
130
|
+
if (e === "reject") return h;
|
|
131
|
+
if (e === "cancel") return g;
|
|
132
|
+
}
|
|
133
|
+
var v = [
|
|
134
|
+
"reject",
|
|
135
|
+
"cancel",
|
|
136
|
+
"cancelScheduledPayment",
|
|
137
|
+
"forceApprove",
|
|
138
|
+
"forceReject"
|
|
139
|
+
];
|
|
140
|
+
function y(e) {
|
|
141
|
+
return v.includes(e);
|
|
142
|
+
}
|
|
143
|
+
function b(e) {
|
|
144
|
+
return e === "forceApprove" || e === "forceReject";
|
|
145
|
+
}
|
|
146
|
+
export { p as usePayableDetailActions };
|