@tesouro/embedded-components-react 0.3.22 → 0.3.23
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 +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +31 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +42 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +158 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +33 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +1 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +45 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +4 -64
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +13 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +14 -62
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +56 -123
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +18 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +15 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +61 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +130 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +20 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +38 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +48 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +5 -93
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +71 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +48 -139
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +91 -66
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +22 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +34 -22
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +144 -210
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +63 -209
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +21 -103
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +209 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +211 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +104 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +12 -165
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +47 -35
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +29 -99
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +64 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +166 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +34 -243
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +104 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +12 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +259 -81
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +4 -145
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +33 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +82 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +155 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +2 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +2 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +43 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +1 -94
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +8 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +85 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +3 -59
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +9 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +19 -120
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +56 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +3 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +3 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +116 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +8 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +43 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +19 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +27 -249
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +82 -109
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +47 -206
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +253 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +111 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +6 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +197 -102
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +6 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +114 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +5 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +3 -162
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +9 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +10 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +123 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -170
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +7 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +163 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +14 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +89 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
- package/package.json +1 -1
|
@@ -1,65 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { usePayableHistoryQuery as e } from "../../data-access/dist/index6.js";
|
|
6
|
+
import "../../data-access/dist/index.js";
|
|
5
7
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}), S.push({
|
|
14
|
-
id: "reject",
|
|
15
|
-
label: h.reject,
|
|
16
|
-
variant: "ghost",
|
|
17
|
-
surface: "row"
|
|
18
|
-
})), s === "approve_in_progress" && p && x && !f && !m && (S.push({
|
|
19
|
-
id: "forceApprove",
|
|
20
|
-
label: h.forceApprove,
|
|
21
|
-
variant: "ghost",
|
|
22
|
-
surface: "menu",
|
|
23
|
-
icon: o,
|
|
24
|
-
sectionHeading: h.policyOverridesHeading
|
|
25
|
-
}), S.push({
|
|
26
|
-
id: "forceReject",
|
|
27
|
-
label: h.forceReject,
|
|
28
|
-
variant: "ghost",
|
|
29
|
-
surface: "menu",
|
|
30
|
-
icon: a,
|
|
31
|
-
sectionHeading: h.policyOverridesHeading
|
|
32
|
-
}));
|
|
33
|
-
let C = (s === "waiting_to_be_paid" || s === "partially_paid") && g && !u, w = s === "waiting_to_be_paid" && g && _ && v && !u;
|
|
34
|
-
return C && S.push({
|
|
35
|
-
id: "markAsPaid",
|
|
36
|
-
label: h.markAsPaid,
|
|
37
|
-
variant: "outline",
|
|
38
|
-
surface: "row"
|
|
39
|
-
}), w && S.push({
|
|
40
|
-
id: "payBill",
|
|
41
|
-
label: h.payBill,
|
|
42
|
-
variant: "default",
|
|
43
|
-
surface: "row"
|
|
44
|
-
}), s === "new" && y && S.push({
|
|
45
|
-
id: "cancel",
|
|
46
|
-
label: h.cancel,
|
|
47
|
-
variant: "ghost",
|
|
48
|
-
surface: "menu",
|
|
49
|
-
icon: n
|
|
50
|
-
}), (s === "rejected" || s === "waiting_to_be_paid" && !u) && y && S.push({
|
|
51
|
-
id: "reopen",
|
|
52
|
-
label: h.reopen,
|
|
53
|
-
variant: "ghost",
|
|
54
|
-
surface: "menu",
|
|
55
|
-
icon: i
|
|
56
|
-
}), s === "waiting_to_be_paid" && u && d && b && S.push({
|
|
57
|
-
id: "cancelScheduledPayment",
|
|
58
|
-
label: h.cancelScheduledPayment,
|
|
59
|
-
variant: "ghost",
|
|
60
|
-
surface: "menu",
|
|
61
|
-
icon: r
|
|
62
|
-
}), S;
|
|
8
|
+
var t = "submitted_for_approval";
|
|
9
|
+
function n({ payableId: n, enabled: r = !0 }) {
|
|
10
|
+
let i = e(n, { enabled: r });
|
|
11
|
+
return {
|
|
12
|
+
roundStartedAt: (i.data?.data ?? []).reduce((e, n) => n.event_type === t ? n.timestamp : e, void 0),
|
|
13
|
+
isLoading: i.isLoading
|
|
14
|
+
};
|
|
63
15
|
}
|
|
64
16
|
//#endregion
|
|
65
|
-
export {
|
|
17
|
+
export { n as usePayableApprovalRoundStart };
|
|
@@ -2,133 +2,66 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import "../../../shared/
|
|
7
|
-
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 { useAllOrganizationRolesQuery as n } from "../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
|
|
8
|
+
import { useAllOrganizationUsersQuery as r } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
9
|
+
import "../../../shared/data-access/dist/index.js";
|
|
10
|
+
import { useWidgetConfig as i } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
8
11
|
import "../../../shared/feature/dist/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import { useCancelPayableMutation as i, useCancelPaymentRecordMutation as a, useForceApprovePayableMutation as o, useForceRejectPayableMutation as s, useMarkPayableAsPaidMutation as c, useReopenPayableMutation as l } from "../../data-access/dist/index10.js";
|
|
12
|
+
import { usePayableApprovalRequestsQuery as a } from "../../data-access/dist/index5.js";
|
|
11
13
|
import "../../data-access/dist/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
14
|
+
import { useGetApprovalPoliciesQuery as o } from "../../../shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js";
|
|
15
|
+
import "../../../shared/approval-policy/data-access/dist/index.js";
|
|
16
|
+
import { buildApprovalPolicyCardView as s } from "./index15.js";
|
|
17
|
+
import { currentApprovalRound as c } from "./index16.js";
|
|
18
|
+
import { buildPendingApproverGroups as l } from "./index17.js";
|
|
19
|
+
import { usePayableApprovalRoundStart as u } from "./index18.js";
|
|
20
|
+
import { useMemo as d } from "react";
|
|
15
21
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js
|
|
16
|
-
function
|
|
17
|
-
let { initResponse:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
isPending: O.isPending,
|
|
33
|
-
run: () => f && O.mutate({ path: { payable_id: f } }, V("markAsPaid"))
|
|
34
|
-
},
|
|
35
|
-
reject: {
|
|
36
|
-
isPending: k.isPending,
|
|
37
|
-
run: (e) => h && k.mutate({
|
|
38
|
-
path: { approval_request_id: h },
|
|
39
|
-
body: e ? { reject_reason: e } : void 0
|
|
40
|
-
}, V("reject"))
|
|
41
|
-
},
|
|
42
|
-
approve: {
|
|
43
|
-
isPending: A.isPending,
|
|
44
|
-
run: () => h && A.mutate({ path: { approval_request_id: h } }, V("approve"))
|
|
45
|
-
},
|
|
46
|
-
cancel: {
|
|
47
|
-
isPending: j.isPending,
|
|
48
|
-
run: () => f && j.mutate({ path: { payable_id: f } }, V("cancel"))
|
|
49
|
-
},
|
|
50
|
-
cancelScheduledPayment: {
|
|
51
|
-
isPending: M.isPending,
|
|
52
|
-
run: () => {
|
|
53
|
-
let e = z?.scheduledPaymentRecordId;
|
|
54
|
-
!f || !e || M.mutate({
|
|
55
|
-
path: { payment_record_id: e },
|
|
56
|
-
payableId: f
|
|
57
|
-
}, V("cancelScheduledPayment"));
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
reopen: {
|
|
61
|
-
isPending: N.isPending,
|
|
62
|
-
run: () => f && N.mutate({ path: { payable_id: f } }, V("reopen"))
|
|
63
|
-
},
|
|
64
|
-
forceApprove: {
|
|
65
|
-
isPending: P.isPending,
|
|
66
|
-
run: () => f && P.mutate({ path: { payable_id: f } }, V("forceApprove"))
|
|
67
|
-
},
|
|
68
|
-
forceReject: {
|
|
69
|
-
isPending: F.isPending,
|
|
70
|
-
run: () => f && F.mutate({ path: { payable_id: f } }, V("forceReject"))
|
|
71
|
-
}
|
|
72
|
-
}, U = B.map((e) => ({
|
|
73
|
-
...e,
|
|
74
|
-
disabled: I,
|
|
75
|
-
loading: H[e.id]?.isPending ?? !1,
|
|
76
|
-
onSelect: () => {
|
|
77
|
-
if (!(I || !f)) {
|
|
78
|
-
if (e.id === "payBill") {
|
|
79
|
-
E();
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
if (g(e.id)) {
|
|
83
|
-
R({
|
|
84
|
-
id: e.id,
|
|
85
|
-
scheduledPaymentRecordId: S
|
|
86
|
-
});
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
H[e.id]?.run();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}));
|
|
22
|
+
function f({ payableId: f, approvalPolicyId: p, enabled: m = !0, copy: h }) {
|
|
23
|
+
let g = m && !!p, { initResponse: _ } = i(), v = e(_?.scopes, [t.ApprovalPolicyReadOrg]), y = e(_?.scopes, [t.ApprovalRequestReadOrg]), b = e(_?.scopes, [t.RoleReadOrg]), x = e(_?.scopes, [t.UserReadOrg]), S = o({ enabled: g && v }), C = n({ enabled: g && b }), w = r({ enabled: g && x }), T = a(f, { enabled: g && y }), { roundStartedAt: E } = u({
|
|
24
|
+
payableId: f,
|
|
25
|
+
enabled: g && y
|
|
26
|
+
}), D = d(() => {
|
|
27
|
+
let e = /* @__PURE__ */ new Map();
|
|
28
|
+
for (let t of C.data?.data ?? []) e.set(t.id, {
|
|
29
|
+
label: t.name,
|
|
30
|
+
kind: "role"
|
|
31
|
+
});
|
|
32
|
+
for (let t of w.data?.data ?? []) e.set(t.id, {
|
|
33
|
+
label: t.name,
|
|
34
|
+
kind: "user"
|
|
35
|
+
});
|
|
36
|
+
return e;
|
|
37
|
+
}, [C.data, w.data]), O = d(() => c(T.data?.data, E), [T.data, E]), k = d(() => new Set(O.flatMap((e) => e.approved_by ?? [])), [O]), A = d(() => new Set(O.filter((e) => (e.approved_by ?? []).length > 0).flatMap((e) => e.role_ids ?? [])), [O]), j = d(() => p ? S.data?.data.find((e) => e.id === p) : void 0, [S.data, p]);
|
|
93
38
|
return {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
39
|
+
view: d(() => g && j ? s({
|
|
40
|
+
policy: j,
|
|
41
|
+
lookup: D,
|
|
42
|
+
approvedUserIds: k,
|
|
43
|
+
approvedRoleIds: A,
|
|
44
|
+
copy: h
|
|
45
|
+
}) : void 0, [
|
|
46
|
+
g,
|
|
47
|
+
j,
|
|
48
|
+
D,
|
|
49
|
+
k,
|
|
50
|
+
A,
|
|
51
|
+
h
|
|
52
|
+
]),
|
|
53
|
+
pendingApprovers: d(() => g ? l({
|
|
54
|
+
requestsNewestFirst: T.data?.data,
|
|
55
|
+
roundStartedAt: E,
|
|
56
|
+
lookup: D
|
|
57
|
+
}) : [], [
|
|
58
|
+
g,
|
|
59
|
+
T.data,
|
|
60
|
+
E,
|
|
61
|
+
D
|
|
62
|
+
]),
|
|
63
|
+
isLoading: g && (S.isResolving || C.isResolving || w.isResolving || T.isLoading)
|
|
113
64
|
};
|
|
114
65
|
}
|
|
115
|
-
var m = {
|
|
116
|
-
alignment: "center",
|
|
117
|
-
icon: f,
|
|
118
|
-
tone: "destructive",
|
|
119
|
-
actionWidth: "equal"
|
|
120
|
-
}, h = [
|
|
121
|
-
"reject",
|
|
122
|
-
"cancel",
|
|
123
|
-
"cancelScheduledPayment",
|
|
124
|
-
"forceApprove",
|
|
125
|
-
"forceReject"
|
|
126
|
-
];
|
|
127
|
-
function g(e) {
|
|
128
|
-
return h.includes(e);
|
|
129
|
-
}
|
|
130
|
-
function _(e) {
|
|
131
|
-
return e === "forceApprove" || e === "forceReject";
|
|
132
|
-
}
|
|
133
66
|
//#endregion
|
|
134
|
-
export {
|
|
67
|
+
export { f as useApprovalPolicyCardView };
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
+
import { MARK_AS_PAID_DIALOG_LABELS_EN as e } from "../../ui/dist/index82.js";
|
|
2
|
+
import "../../ui/dist/index.js";
|
|
1
3
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
+
var t = {
|
|
5
|
+
dueDateSuffix: (e) => `by ${e}`,
|
|
6
|
+
paidToast: "Bill marked as paid",
|
|
7
|
+
submitError: "Couldn't mark this bill as paid. Try again.",
|
|
8
|
+
dialog: e
|
|
9
|
+
};
|
|
10
|
+
function n(e) {
|
|
11
|
+
return {
|
|
12
|
+
...t,
|
|
13
|
+
...e,
|
|
14
|
+
dialog: {
|
|
15
|
+
...t.dialog,
|
|
16
|
+
...e?.dialog
|
|
17
|
+
}
|
|
18
|
+
};
|
|
4
19
|
}
|
|
5
20
|
//#endregion
|
|
6
|
-
export {
|
|
21
|
+
export { t as MARK_AS_PAID_FLOW_LABELS_EN, n as mergeMarkAsPaidFlowLabels };
|
|
@@ -3,22 +3,27 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useCurrentUserQuery as t } from "../../../shared/data-access/dist/lib/useCurrentUserQuery.js";
|
|
7
|
+
import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
7
8
|
import "../../../shared/data-access/dist/index.js";
|
|
8
|
-
import { formatCalendarDate as n } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
9
9
|
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
10
|
import "../../../shared/feature/dist/index.js";
|
|
11
|
-
import {
|
|
11
|
+
import { usePayableApprovalRequestsQuery as i } from "../../data-access/dist/index5.js";
|
|
12
12
|
import "../../data-access/dist/index.js";
|
|
13
|
+
import { currentApprovalRound as a } from "./index16.js";
|
|
14
|
+
import { usePayableApprovalRoundStart as o } from "./index18.js";
|
|
13
15
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js
|
|
14
|
-
function
|
|
15
|
-
let { initResponse:
|
|
16
|
+
function s({ payableId: s, status: c }) {
|
|
17
|
+
let { initResponse: l } = r(), u = e(l?.scopes, [n.ApprovalRequestReadOrg]), d = c === "approve_in_progress" && u, f = i(s, { enabled: d }), p = t({ enabled: d }), { roundStartedAt: m } = o({
|
|
18
|
+
payableId: s,
|
|
19
|
+
enabled: d
|
|
20
|
+
}), h = p.data?.id, g = d ? a(f.data?.data, m) : [], _ = (e) => e.caller_is_policy_approver ?? !!(h && e.user_ids.includes(h)), v = g.some(_), y = g.filter((e) => e.status === "waiting");
|
|
16
21
|
return {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
id: y.filter(_).find((e) => !(h && (e.approved_by ?? []).includes(h)))?.id,
|
|
23
|
+
isPolicyApprover: v,
|
|
24
|
+
hasWaitingRequest: y.length > 0,
|
|
25
|
+
isLoading: f.isLoading || p.isLoading
|
|
21
26
|
};
|
|
22
27
|
}
|
|
23
28
|
//#endregion
|
|
24
|
-
export {
|
|
29
|
+
export { s as useCurrentApprovalRequestId };
|
|
@@ -1,44 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
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";
|
|
1
|
+
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
2
|
+
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
8
3
|
import "../../../shared/data-access/dist/index.js";
|
|
9
|
-
import "
|
|
10
|
-
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
|
-
import "../../../shared/feature/dist/index.js";
|
|
12
|
-
import { useDeletePayableMutation as i } from "../../data-access/dist/index10.js";
|
|
13
|
-
import "../../data-access/dist/index.js";
|
|
14
|
-
import { useState as a } from "react";
|
|
4
|
+
import { BanIcon as n, CalendarXIcon as r, RotateCcwIcon as i, ThumbsDownIcon as a, ThumbsUpIcon as o } from "lucide-react";
|
|
15
5
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js
|
|
16
|
-
function
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
6
|
+
function s({ status: s, scopes: c, canDecideApprovalRequest: l, hasScheduledPayment: u, scheduledPaymentRecordId: d, isPolicyApprover: f, hasWaitingRequest: p, arePendingApproversUnknown: m, labels: h }) {
|
|
7
|
+
let g = e(c, [t.PayablePayOrg]), _ = e(c, [t.BankAccountReadOrg]), v = e(c, [t.PaymentRailAch]), y = e(c, [t.PayableWriteOrg]), b = e(c, [t.PaymentRecordWriteOrg]), x = e(c, [t.PayableApproveOrg]), S = [];
|
|
8
|
+
s === "approve_in_progress" && l && (S.push({
|
|
9
|
+
id: "approve",
|
|
10
|
+
label: h.approve,
|
|
11
|
+
variant: "default",
|
|
12
|
+
surface: "row"
|
|
13
|
+
}), S.push({
|
|
14
|
+
id: "reject",
|
|
15
|
+
label: h.reject,
|
|
16
|
+
variant: "ghost",
|
|
17
|
+
surface: "row"
|
|
18
|
+
})), s === "approve_in_progress" && p && x && !f && !m && (S.push({
|
|
19
|
+
id: "forceApprove",
|
|
20
|
+
label: h.forceApprove,
|
|
21
|
+
variant: "ghost",
|
|
22
|
+
surface: "menu",
|
|
23
|
+
icon: o,
|
|
24
|
+
sectionHeading: h.policyOverridesHeading
|
|
25
|
+
}), S.push({
|
|
26
|
+
id: "forceReject",
|
|
27
|
+
label: h.forceReject,
|
|
28
|
+
variant: "ghost",
|
|
29
|
+
surface: "menu",
|
|
30
|
+
icon: a,
|
|
31
|
+
sectionHeading: h.policyOverridesHeading
|
|
32
|
+
}));
|
|
33
|
+
let C = s === "waiting_to_be_paid" && g && !u, w = s === "waiting_to_be_paid" && g && _ && v && !u;
|
|
34
|
+
return C && S.push({
|
|
35
|
+
id: "markAsPaid",
|
|
36
|
+
label: h.markAsPaid,
|
|
37
|
+
variant: "outline",
|
|
38
|
+
surface: "row"
|
|
39
|
+
}), w && S.push({
|
|
40
|
+
id: "payBill",
|
|
41
|
+
label: h.payBill,
|
|
42
|
+
variant: "default",
|
|
43
|
+
surface: "row"
|
|
44
|
+
}), s === "new" && y && S.push({
|
|
45
|
+
id: "cancel",
|
|
46
|
+
label: h.cancel,
|
|
47
|
+
variant: "ghost",
|
|
48
|
+
surface: "menu",
|
|
49
|
+
icon: n
|
|
50
|
+
}), (s === "rejected" || s === "waiting_to_be_paid" && !u) && y && S.push({
|
|
51
|
+
id: "reopen",
|
|
52
|
+
label: h.reopen,
|
|
53
|
+
variant: "ghost",
|
|
54
|
+
surface: "menu",
|
|
55
|
+
icon: i
|
|
56
|
+
}), s === "waiting_to_be_paid" && u && d && b && S.push({
|
|
57
|
+
id: "cancelScheduledPayment",
|
|
58
|
+
label: h.cancelScheduledPayment,
|
|
59
|
+
variant: "ghost",
|
|
60
|
+
surface: "menu",
|
|
61
|
+
icon: r
|
|
62
|
+
}), S;
|
|
42
63
|
}
|
|
43
64
|
//#endregion
|
|
44
|
-
export {
|
|
65
|
+
export { s as getBillDetailActions };
|
|
@@ -1,54 +1,134 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
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/index5.js";
|
|
10
|
+
import { useCancelPayableMutation as i, useCancelPaymentRecordMutation as a, useForceApprovePayableMutation as o, useForceRejectPayableMutation as s, useReopenPayableMutation as c } from "../../data-access/dist/index10.js";
|
|
11
|
+
import "../../data-access/dist/index.js";
|
|
12
|
+
import { getBillDetailActions as l } from "./index21.js";
|
|
13
|
+
import { useState as u } from "react";
|
|
14
|
+
import { HandIcon as d } from "lucide-react";
|
|
1
15
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js
|
|
2
|
-
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyApprover: _, hasWaitingRequest: v, arePendingApproversUnknown: y, hasScheduledPayment: b, scheduledPaymentRecordId: x, isScheduledPaymentUnknown: S, labels: C, isMarkAsPaidPending: w, pendingApprovers: T, onPayBillSelect: E, onMarkAsPaidSelect: D }) {
|
|
17
|
+
let { initResponse: O } = t(), k = r(), A = n(), j = i(), M = a(), N = c(), P = o(), F = s(), I = w || k.isPending || A.isPending || j.isPending || M.isPending || N.isPending || P.isPending || F.isPending, [L, R] = u(), z = L && (L.id !== "cancelScheduledPayment" || L.scheduledPaymentRecordId === x) ? L : void 0, B = d && f ? l({
|
|
18
|
+
status: f,
|
|
19
|
+
scopes: O?.scopes,
|
|
20
|
+
canDecideApprovalRequest: !!m,
|
|
21
|
+
isPolicyApprover: _,
|
|
22
|
+
hasWaitingRequest: v,
|
|
23
|
+
arePendingApproversUnknown: y,
|
|
24
|
+
hasScheduledPayment: b || S,
|
|
25
|
+
scheduledPaymentRecordId: x,
|
|
26
|
+
labels: C
|
|
27
|
+
}) : [], V = (t) => ({
|
|
28
|
+
onError: () => e.error(C.actionError),
|
|
29
|
+
onSuccess: () => e.success(C.actionSuccess[t])
|
|
30
|
+
}), H = {
|
|
31
|
+
reject: {
|
|
32
|
+
isPending: k.isPending,
|
|
33
|
+
run: (e) => m && k.mutate({
|
|
34
|
+
path: { approval_request_id: m },
|
|
35
|
+
body: e ? { reject_reason: e } : void 0
|
|
36
|
+
}, V("reject"))
|
|
37
|
+
},
|
|
38
|
+
approve: {
|
|
39
|
+
isPending: A.isPending,
|
|
40
|
+
run: () => m && A.mutate({ path: { approval_request_id: m } }, V("approve"))
|
|
41
|
+
},
|
|
42
|
+
cancel: {
|
|
43
|
+
isPending: j.isPending,
|
|
44
|
+
run: () => d && j.mutate({ path: { payable_id: d } }, V("cancel"))
|
|
45
|
+
},
|
|
46
|
+
cancelScheduledPayment: {
|
|
47
|
+
isPending: M.isPending,
|
|
48
|
+
run: () => {
|
|
49
|
+
let e = z?.scheduledPaymentRecordId;
|
|
50
|
+
!d || !e || M.mutate({
|
|
51
|
+
path: { payment_record_id: e },
|
|
52
|
+
payableId: d
|
|
53
|
+
}, V("cancelScheduledPayment"));
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
reopen: {
|
|
57
|
+
isPending: N.isPending,
|
|
58
|
+
run: () => d && N.mutate({ path: { payable_id: d } }, V("reopen"))
|
|
59
|
+
},
|
|
60
|
+
forceApprove: {
|
|
61
|
+
isPending: P.isPending,
|
|
62
|
+
run: () => d && P.mutate({ path: { payable_id: d } }, V("forceApprove"))
|
|
63
|
+
},
|
|
64
|
+
forceReject: {
|
|
65
|
+
isPending: F.isPending,
|
|
66
|
+
run: () => d && F.mutate({ path: { payable_id: d } }, V("forceReject"))
|
|
67
|
+
}
|
|
68
|
+
}, U = B.map((e) => ({
|
|
69
|
+
...e,
|
|
70
|
+
disabled: I,
|
|
71
|
+
loading: e.id === "markAsPaid" ? w : H[e.id]?.isPending ?? !1,
|
|
72
|
+
onSelect: () => {
|
|
73
|
+
if (!(I || !d)) {
|
|
74
|
+
if (e.id === "payBill") {
|
|
75
|
+
E();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (e.id === "markAsPaid") {
|
|
79
|
+
D();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (h(e.id)) {
|
|
83
|
+
R({
|
|
84
|
+
id: e.id,
|
|
85
|
+
scheduledPaymentRecordId: x
|
|
86
|
+
});
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
H[e.id]?.run();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
return {
|
|
94
|
+
actions: {
|
|
95
|
+
row: U.filter((e) => e.surface === "row"),
|
|
96
|
+
menu: U.filter((e) => e.surface === "menu")
|
|
97
|
+
},
|
|
98
|
+
decisionDialog: {
|
|
99
|
+
open: !!z,
|
|
100
|
+
copy: z ? {
|
|
101
|
+
...C.decisionDialog[z.id],
|
|
102
|
+
presentation: g(z.id) ? p : void 0,
|
|
103
|
+
pendingApprovers: g(z.id) ? T ?? [] : void 0
|
|
104
|
+
} : void 0,
|
|
105
|
+
isPending: z ? H[z.id]?.isPending ?? !1 : !1,
|
|
106
|
+
onCancel: () => {
|
|
107
|
+
I || R(void 0);
|
|
108
|
+
},
|
|
109
|
+
onConfirm: (e) => {
|
|
110
|
+
!z || I || (H[z.id]?.run(e), R(void 0));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
20
113
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
case "paid": return {
|
|
40
|
-
status: "paid",
|
|
41
|
-
tone: "success"
|
|
42
|
-
};
|
|
43
|
-
case "canceled": return {
|
|
44
|
-
status: "canceled",
|
|
45
|
-
tone: "muted"
|
|
46
|
-
};
|
|
47
|
-
case "rejected": return {
|
|
48
|
-
status: "rejected",
|
|
49
|
-
tone: "danger"
|
|
50
|
-
};
|
|
51
|
-
}
|
|
114
|
+
}
|
|
115
|
+
var p = {
|
|
116
|
+
alignment: "center",
|
|
117
|
+
icon: d,
|
|
118
|
+
tone: "destructive",
|
|
119
|
+
actionWidth: "equal"
|
|
120
|
+
}, m = [
|
|
121
|
+
"reject",
|
|
122
|
+
"cancel",
|
|
123
|
+
"cancelScheduledPayment",
|
|
124
|
+
"forceApprove",
|
|
125
|
+
"forceReject"
|
|
126
|
+
];
|
|
127
|
+
function h(e) {
|
|
128
|
+
return m.includes(e);
|
|
129
|
+
}
|
|
130
|
+
function g(e) {
|
|
131
|
+
return e === "forceApprove" || e === "forceReject";
|
|
52
132
|
}
|
|
53
133
|
//#endregion
|
|
54
|
-
export {
|
|
134
|
+
export { f as usePayableDetailActions };
|