@tesouro/embedded-components-react 0.4.24 → 0.4.26
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/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +2219 -2220
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useRolePermissionsQueries.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index11.js +45 -36
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index12.js +64 -60
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index14.js +56 -47
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index15.js +157 -143
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index16.js +12 -15
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +271 -261
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index3.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index7.js +19 -22
- package/package.json +1 -1
|
@@ -4,195 +4,209 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { useAllBankAccountsQuery as e } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
|
|
6
6
|
import { useAllExternalBankAccountsQuery as t } from "../../../shared/data-access/dist/lib/external-bank-account/useAllExternalBankAccountsQuery.js";
|
|
7
|
+
import { useRolePermissionsQueries as n } from "../../../shared/data-access/dist/lib/role/useRolePermissionsQueries.js";
|
|
8
|
+
import { useAllOrganizationUsersQuery as r } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
7
9
|
import "../../../shared/data-access/dist/index.js";
|
|
8
|
-
import { useAnalyticsTrack as
|
|
10
|
+
import { useAnalyticsTrack as i } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
9
11
|
import "../../../shared/feature/dist/index.js";
|
|
10
|
-
import { TeamWidgetAnalyticsEvent as
|
|
11
|
-
import { useManageBankAccountAccessMutation as
|
|
12
|
-
import { useUserBankAccountAccessQuery as
|
|
13
|
-
import { useAllTeamMembersQuery as
|
|
14
|
-
import { useUpdateTeamMemberMutation as
|
|
15
|
-
import { useAllDepartmentsQuery as
|
|
16
|
-
import { useAllLocationsQuery as
|
|
12
|
+
import { TeamWidgetAnalyticsEvent as ee } from "./index2.js";
|
|
13
|
+
import { useManageBankAccountAccessMutation as a } from "../../data-access/dist/index9.js";
|
|
14
|
+
import { useUserBankAccountAccessQuery as o } from "../../data-access/dist/index10.js";
|
|
15
|
+
import { useAllTeamMembersQuery as te } from "../../data-access/dist/index14.js";
|
|
16
|
+
import { useUpdateTeamMemberMutation as ne } from "../../data-access/dist/index15.js";
|
|
17
|
+
import { useAllDepartmentsQuery as re } from "../../data-access/dist/index17.js";
|
|
18
|
+
import { useAllLocationsQuery as ie } from "../../data-access/dist/index21.js";
|
|
17
19
|
import "../../data-access/dist/index.js";
|
|
18
|
-
import { isMemberActionable as
|
|
19
|
-
import {
|
|
20
|
-
import { useCallback as
|
|
20
|
+
import { isMemberActionable as ae, isMemberInvited as oe, resolveMemberRoleId as se, toNamedSelectOptions as ce, toReportingManagerOptions as le, toRoleCardOptions as ue } from "./index11.js";
|
|
21
|
+
import { ACCOUNT_ACCESS_ADMIN_PERMISSION_KEY as de, ACCOUNT_ACCESS_VISIBILITY_PERMISSION_KEYS as fe, isAdminPermissionSet as pe, isEmployeePermissionSet as me, toAccountAccessInputs as he, toAccountAccessOptions as ge } from "./index7.js";
|
|
22
|
+
import { useCallback as _e, useEffect as ve, useMemo as s, useState as c } from "react";
|
|
21
23
|
//#region ../../libs/tesouro-embedded-components-react/team-widget/feature/dist/index15.js
|
|
22
|
-
var
|
|
24
|
+
var ye = {
|
|
23
25
|
name: "",
|
|
24
26
|
role: "",
|
|
25
27
|
department: "",
|
|
26
28
|
location: "",
|
|
27
29
|
reportingManager: ""
|
|
28
30
|
};
|
|
29
|
-
function
|
|
31
|
+
function be({ member: e, organizationId: t, canEditAnyProfile: n, canEditOrgProfile: r, currentUserId: i }) {
|
|
30
32
|
return i && e.id === i ? !1 : n ? !0 : r && !!t && e.organizationId === t;
|
|
31
33
|
}
|
|
32
|
-
function
|
|
34
|
+
function xe({ member: e, organizationId: t, canEditRole: n, currentUserId: r }) {
|
|
33
35
|
return r && e.id === r ? !1 : n && !!t && e.organizationId === t;
|
|
34
36
|
}
|
|
35
|
-
function
|
|
36
|
-
let
|
|
37
|
+
function Se({ canEditAnyProfile: Se, canEditOrgProfile: Ce, organizationId: l, currentUserId: u, canEditRole: we, canReadDirectory: Te, canManageAccountAccess: Ee, canReadInternalAccounts: d, canReadExternalAccounts: f, members: De, roles: p, allRoles: Oe = p, roleCatalog: ke = [], featureLabels: m }) {
|
|
38
|
+
let Ae = i(), [h, g] = c(), [_, je] = c(ye), [Me, v] = c({}), [Ne, y] = c([]), [Pe, b] = c(!1), [x, S] = c([]), C = ne(), w = a(), T = !!h && Te, E = re({ enabled: T }), D = ie({ enabled: T }), O = te({
|
|
37
39
|
Status: "ACTIVE",
|
|
38
|
-
enabled:
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, [
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
enabled: T
|
|
41
|
+
}), Fe = h ? De.find((e) => e.id === h.memberId) : void 0, k = ae(Fe) ? Fe : void 0, Ie = !!h && !k;
|
|
42
|
+
ve(() => {
|
|
43
|
+
Ie && g(void 0);
|
|
44
|
+
}, [Ie]);
|
|
45
|
+
let A = k?.id, j = !!k && Ee && !(u && A === u), M = oe(k), N = se(Oe, h?.baselineRoleKey) ?? "", Le = s(() => {
|
|
46
|
+
let e = p.map((e) => e.id);
|
|
47
|
+
return N && !e.includes(N) ? [...e, N] : e;
|
|
48
|
+
}, [p, N]), P = n({
|
|
49
|
+
roleIds: Le,
|
|
50
|
+
enabled: !!h?.canEditRole || j && M
|
|
51
|
+
}), F = r({
|
|
52
|
+
enabled: j && !M,
|
|
53
|
+
permissions: [de]
|
|
54
|
+
}), I = r({
|
|
55
|
+
enabled: j && !M,
|
|
56
|
+
permissions: [...fe]
|
|
57
|
+
}), L = j && (M ? P.resolvingRoleIds.has(N) : F.isResolving || I.isResolving), R = j && (M ? !P.resolvingRoleIds.has(N) && !P.byRoleId.has(N) : F.isError || I.isError), z = !!(A && !L && !R && (M ? pe(P.byRoleId.get(N)) : (F.data?.data ?? []).some((e) => e.id === A))), Re = !!(A && !L && !R && (M ? me(P.byRoleId.get(N)) : !(I.data?.data ?? []).some((e) => e.id === A))), B = j, V = e({ enabled: B && d }), H = t({ enabled: B && f }), ze = !d || !!V.data && !V.hasNextPage && !V.isFetchingNextPage, Be = !f || !!H.data && !H.hasNextPage && !H.isFetchingNextPage, Ve = B && ze && Be && !L, He = B && (d && V.isError || f && H.isError || R), U = s(() => ge(d ? V.data?.data ?? [] : [], f ? H.data?.data ?? [] : [], {
|
|
58
|
+
checking: m.accountTypeChecking,
|
|
59
|
+
savings: m.accountTypeSavings
|
|
46
60
|
}), [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
]),
|
|
61
|
+
d,
|
|
62
|
+
f,
|
|
63
|
+
V.data?.data,
|
|
64
|
+
H.data?.data,
|
|
65
|
+
m.accountTypeChecking,
|
|
66
|
+
m.accountTypeSavings
|
|
67
|
+
]), Ue = s(() => [...U.descriptors.values()].map((e) => ({
|
|
54
68
|
bankAccountId: e.bankAccountId,
|
|
55
69
|
source: e.source
|
|
56
|
-
})), [
|
|
57
|
-
userId:
|
|
58
|
-
accounts:
|
|
59
|
-
enabled:
|
|
60
|
-
}),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
]),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
let
|
|
70
|
+
})), [U.descriptors]), W = o({
|
|
71
|
+
userId: A,
|
|
72
|
+
accounts: Ue,
|
|
73
|
+
enabled: j && !z && Ve
|
|
74
|
+
}), We = Ue.length === 0 || W.isComplete, Ge = s(() => z ? U.allAccountIds : [...W.accessibleAccountIds], [
|
|
75
|
+
z,
|
|
76
|
+
U.allAccountIds,
|
|
77
|
+
W.accessibleAccountIds
|
|
78
|
+
]), G = j && (He || !z && W.isError), Ke = j && !G && (!Ve || !z && !We), qe = j && !Pe && Ve && (z || We);
|
|
79
|
+
ve(() => {
|
|
80
|
+
qe && (y(Ge), S(Ge), b(!0));
|
|
81
|
+
}, [qe, Ge]);
|
|
82
|
+
let K = _.role !== N && p.some((e) => e.id === _.role), Je = K && P.resolvingRoleIds.has(_.role), Ye = K && (Je || !P.byRoleId.has(_.role)), Xe = Ye && !Je, q = K ? pe(P.byRoleId.get(_.role)) : z, J = K ? me(P.byRoleId.get(_.role)) : Re, Ze = j ? q ? "admin" : J ? "employee" : "picker" : "hidden", Qe = s(() => U.options.map((e) => ({
|
|
69
83
|
...e,
|
|
70
|
-
checked:
|
|
84
|
+
checked: q ? !0 : !J && Ne.includes(e.value)
|
|
71
85
|
})), [
|
|
72
|
-
|
|
73
|
-
K,
|
|
86
|
+
U.options,
|
|
74
87
|
q,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
J,
|
|
89
|
+
Ne
|
|
90
|
+
]), $e = _e((e, t) => {
|
|
91
|
+
y((n) => t ? n.includes(e) ? n : [...n, e] : n.filter((t) => t !== e));
|
|
92
|
+
}, []), Y = q ? U.allAccountIds : J ? [] : Ne, et = s(() => new Set(x), [x]), tt = s(() => new Set(Y), [Y]), nt = s(() => Y.filter((e) => !et.has(e)), [Y, et]), rt = s(() => x.filter((e) => !tt.has(e)), [x, tt]), it = j && Pe && (nt.length > 0 || rt.length > 0), at = (e) => {
|
|
93
|
+
let t = De.find((t) => t.id === e);
|
|
80
94
|
if (!t) return;
|
|
81
|
-
let n =
|
|
95
|
+
let n = be({
|
|
82
96
|
member: t,
|
|
83
|
-
organizationId:
|
|
84
|
-
canEditAnyProfile:
|
|
85
|
-
canEditOrgProfile:
|
|
86
|
-
currentUserId:
|
|
87
|
-
}), r =
|
|
97
|
+
organizationId: l,
|
|
98
|
+
canEditAnyProfile: Se,
|
|
99
|
+
canEditOrgProfile: Ce,
|
|
100
|
+
currentUserId: u
|
|
101
|
+
}), r = xe({
|
|
88
102
|
member: t,
|
|
89
|
-
organizationId:
|
|
90
|
-
canEditRole:
|
|
91
|
-
currentUserId:
|
|
92
|
-
}), i =
|
|
103
|
+
organizationId: l,
|
|
104
|
+
canEditRole: we,
|
|
105
|
+
currentUserId: u
|
|
106
|
+
}), i = Ee && t.id !== u;
|
|
93
107
|
if (!n && !r && !i) return;
|
|
94
|
-
let
|
|
95
|
-
|
|
96
|
-
name:
|
|
108
|
+
let ee = t.name, a = t.role ?? "", o = se(Oe, a) ?? "", te = t.department?.id ?? "", ne = t.location?.id ?? "", re = t.reportingManagerUserId ?? "";
|
|
109
|
+
je({
|
|
110
|
+
name: ee,
|
|
97
111
|
role: o,
|
|
98
|
-
department:
|
|
99
|
-
location:
|
|
100
|
-
reportingManager:
|
|
101
|
-
}),
|
|
112
|
+
department: te,
|
|
113
|
+
location: ne,
|
|
114
|
+
reportingManager: re
|
|
115
|
+
}), v({}), C.reset(), w.reset(), y([]), S([]), b(!1), g({
|
|
102
116
|
memberId: e,
|
|
103
117
|
canEditProfile: n,
|
|
104
118
|
canEditRole: r,
|
|
105
|
-
baselineName:
|
|
106
|
-
|
|
107
|
-
baselineDepartmentId:
|
|
108
|
-
baselineLocationId:
|
|
109
|
-
baselineReportingManagerId:
|
|
119
|
+
baselineName: ee,
|
|
120
|
+
baselineRoleKey: a,
|
|
121
|
+
baselineDepartmentId: te,
|
|
122
|
+
baselineLocationId: ne,
|
|
123
|
+
baselineReportingManagerId: re
|
|
110
124
|
});
|
|
111
|
-
},
|
|
112
|
-
e || (
|
|
113
|
-
},
|
|
114
|
-
if (
|
|
115
|
-
if (
|
|
116
|
-
|
|
125
|
+
}, ot = (e) => {
|
|
126
|
+
e || (g(void 0), y([]), S([]), b(!1));
|
|
127
|
+
}, X = _.name.trim(), Z = h?.canEditProfile ?? !1, Q = h?.canEditRole ?? !1, st = h?.baselineName ?? "", ct = h?.baselineDepartmentId ?? "", lt = h?.baselineLocationId ?? "", ut = h?.baselineReportingManagerId ?? "", dt = Z && _.reportingManager !== ut, ft = Q && _.department !== ct, pt = Q && _.location !== lt, mt = k ? Z && X !== st || Q && _.role !== N || dt || ft || pt || it : !1, ht = Q && K && (q || J) && !j, gt = () => {
|
|
128
|
+
if (ht || Ye || j && (Ke || G) || !k || !Z && !Q && !j) return;
|
|
129
|
+
if (Z && !X) {
|
|
130
|
+
v({ name: m.nameRequiredError });
|
|
117
131
|
return;
|
|
118
132
|
}
|
|
119
|
-
|
|
133
|
+
v({});
|
|
120
134
|
let e = {};
|
|
121
|
-
|
|
122
|
-
let t =
|
|
135
|
+
Z && X !== st && (e.name = X), dt && (e.reportingManagerUserId = _.reportingManager || null);
|
|
136
|
+
let t = Q && p.some((e) => e.id === _.role) ? _.role : void 0, n = t && t !== N ? {
|
|
123
137
|
addRoleId: t,
|
|
124
|
-
removeRoleId:
|
|
125
|
-
} : void 0,
|
|
126
|
-
removeId:
|
|
127
|
-
addId:
|
|
128
|
-
} : void 0,
|
|
129
|
-
removeId:
|
|
130
|
-
addId:
|
|
131
|
-
} : void 0,
|
|
132
|
-
if (!
|
|
133
|
-
let
|
|
138
|
+
removeRoleId: N || void 0
|
|
139
|
+
} : void 0, r = ft ? {
|
|
140
|
+
removeId: ct || void 0,
|
|
141
|
+
addId: _.department || void 0
|
|
142
|
+
} : void 0, i = pt ? {
|
|
143
|
+
removeId: lt || void 0,
|
|
144
|
+
addId: _.location || void 0
|
|
145
|
+
} : void 0, a = Object.keys(e).length > 0 || !!n || !!r || !!i;
|
|
146
|
+
if (!a && !it) return;
|
|
147
|
+
let o = k.id;
|
|
134
148
|
(async () => {
|
|
135
149
|
try {
|
|
136
|
-
|
|
137
|
-
userIds: [
|
|
150
|
+
rt.length > 0 && await w.mutateAsync({
|
|
151
|
+
userIds: [o],
|
|
138
152
|
grant: [],
|
|
139
|
-
revoke:
|
|
140
|
-
}),
|
|
141
|
-
path: { id:
|
|
153
|
+
revoke: he(rt, U.descriptors)
|
|
154
|
+
}), a && await C.mutateAsync({
|
|
155
|
+
path: { id: o },
|
|
142
156
|
body: e,
|
|
143
157
|
roleChange: n,
|
|
144
|
-
departmentChange:
|
|
145
|
-
locationChange:
|
|
146
|
-
}),
|
|
147
|
-
userIds: [
|
|
148
|
-
grant:
|
|
158
|
+
departmentChange: r,
|
|
159
|
+
locationChange: i
|
|
160
|
+
}), nt.length > 0 && await w.mutateAsync({
|
|
161
|
+
userIds: [o],
|
|
162
|
+
grant: he(nt, U.descriptors),
|
|
149
163
|
revoke: []
|
|
150
|
-
}),
|
|
164
|
+
}), Ae(ee.MemberUpdated, { memberId: o }), g(void 0), y([]), S([]), b(!1);
|
|
151
165
|
} catch (e) {
|
|
152
166
|
console.error("Failed to update team member:", e);
|
|
153
167
|
}
|
|
154
168
|
})();
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
]),
|
|
169
|
+
}, _t = s(() => E.isComplete ? ce(E.data?.data ?? []) : [], [E.isComplete, E.data?.data]), vt = s(() => D.isComplete ? ce(D.data?.data ?? []) : [], [D.isComplete, D.data?.data]), yt = s(() => O.isComplete ? le((O.data?.data ?? []).filter((e) => e.id !== h?.memberId), ke, m, l) : [], [
|
|
170
|
+
O.isComplete,
|
|
171
|
+
O.data?.data,
|
|
172
|
+
h?.memberId,
|
|
173
|
+
ke,
|
|
174
|
+
m,
|
|
175
|
+
l
|
|
176
|
+
]), bt = T && !E.isComplete && !E.isError, xt = T && !D.isComplete && !D.isError, St = T && !O.isComplete && !O.isError, Ct = T && E.isError, wt = T && D.isError, Tt = T && O.isError, $ = C.isPending || w.isPending;
|
|
163
177
|
return {
|
|
164
|
-
isEditOpen: !!
|
|
165
|
-
editMemberName:
|
|
166
|
-
editMemberEmail:
|
|
167
|
-
editForm:
|
|
168
|
-
editErrors:
|
|
178
|
+
isEditOpen: !!k,
|
|
179
|
+
editMemberName: k?.name ?? "",
|
|
180
|
+
editMemberEmail: k?.email ?? "",
|
|
181
|
+
editForm: _,
|
|
182
|
+
editErrors: Me,
|
|
169
183
|
isSavingEdit: $,
|
|
170
|
-
isEditNameDisabled: !
|
|
171
|
-
isEditRoleDisabled: !
|
|
172
|
-
isEditGroupDisabled: !
|
|
173
|
-
isEditReportingManagerDisabled: !
|
|
174
|
-
isEditSaveDisabled:
|
|
175
|
-
editErrorMessage:
|
|
176
|
-
roleOptions:
|
|
177
|
-
departmentOptions:
|
|
178
|
-
locationOptions:
|
|
179
|
-
reportingManagerOptions:
|
|
180
|
-
departmentsLoading:
|
|
181
|
-
locationsLoading:
|
|
182
|
-
reportingManagersLoading:
|
|
183
|
-
departmentsError:
|
|
184
|
-
locationsError:
|
|
185
|
-
reportingManagersError:
|
|
186
|
-
accountAccessMode:
|
|
187
|
-
accountAccessRows:
|
|
188
|
-
onAccountAccessToggle:
|
|
189
|
-
isAccountAccessLoading:
|
|
190
|
-
accountAccessErrorMessage:
|
|
191
|
-
openMemberEdit:
|
|
192
|
-
onEditOpenChange:
|
|
193
|
-
onEditFormChange:
|
|
194
|
-
onEditSubmit:
|
|
184
|
+
isEditNameDisabled: !Z || $,
|
|
185
|
+
isEditRoleDisabled: !Q || $,
|
|
186
|
+
isEditGroupDisabled: !Q || $,
|
|
187
|
+
isEditReportingManagerDisabled: !Z || $,
|
|
188
|
+
isEditSaveDisabled: !mt || $ || ht || Ye || j && (Ke || G),
|
|
189
|
+
editErrorMessage: Xe ? m.rolePermissionsUnavailableError : ht ? m.roleNeedsAccountAccessError : C.isError || w.isError ? m.editFailedError : void 0,
|
|
190
|
+
roleOptions: ue(p),
|
|
191
|
+
departmentOptions: _t,
|
|
192
|
+
locationOptions: vt,
|
|
193
|
+
reportingManagerOptions: yt,
|
|
194
|
+
departmentsLoading: bt,
|
|
195
|
+
locationsLoading: xt,
|
|
196
|
+
reportingManagersLoading: St,
|
|
197
|
+
departmentsError: Ct,
|
|
198
|
+
locationsError: wt,
|
|
199
|
+
reportingManagersError: Tt,
|
|
200
|
+
accountAccessMode: Ze,
|
|
201
|
+
accountAccessRows: Qe,
|
|
202
|
+
onAccountAccessToggle: $e,
|
|
203
|
+
isAccountAccessLoading: Ke,
|
|
204
|
+
accountAccessErrorMessage: G ? m.loadAccessFailedError : void 0,
|
|
205
|
+
openMemberEdit: at,
|
|
206
|
+
onEditOpenChange: ot,
|
|
207
|
+
onEditFormChange: je,
|
|
208
|
+
onEditSubmit: gt
|
|
195
209
|
};
|
|
196
210
|
}
|
|
197
211
|
//#endregion
|
|
198
|
-
export {
|
|
212
|
+
export { be as canEditMemberProfile, xe as canEditMemberRole, Se as useMemberEdit };
|
|
@@ -10,16 +10,13 @@ import { TeamWidgetAnalyticsEvent as n } from "./index2.js";
|
|
|
10
10
|
import { useDeactivateTeamMemberMutation as r } from "../../data-access/dist/index4.js";
|
|
11
11
|
import { useResendInviteMutation as i } from "../../data-access/dist/index8.js";
|
|
12
12
|
import "../../data-access/dist/index.js";
|
|
13
|
-
import { isMemberActionable as a } from "./index11.js";
|
|
14
|
-
import { resolveAcceptInviteRedirectUri as
|
|
15
|
-
import { useEffect as
|
|
13
|
+
import { isMemberActionable as a, isMemberInvited as o } from "./index11.js";
|
|
14
|
+
import { resolveAcceptInviteRedirectUri as s } from "./index8.js";
|
|
15
|
+
import { useEffect as c, useState as l } from "react";
|
|
16
16
|
//#region ../../libs/tesouro-embedded-components-react/team-widget/feature/dist/index16.js
|
|
17
|
-
function l(e) {
|
|
18
|
-
return (e?.status ?? "").trim().toUpperCase() === "INVITED";
|
|
19
|
-
}
|
|
20
17
|
function u({ members: e, canPerform: t, onOpen: n, isEligible: r }) {
|
|
21
|
-
let [i, o] =
|
|
22
|
-
return
|
|
18
|
+
let [i, o] = l(), s = i ? e.find((e) => e.id === i) : void 0, u = s && a(s) && (r?.(s) ?? !0) ? s : void 0, d = !!i && !u;
|
|
19
|
+
return c(() => {
|
|
23
20
|
d && o(void 0);
|
|
24
21
|
}, [d]), {
|
|
25
22
|
member: u,
|
|
@@ -32,9 +29,9 @@ function u({ members: e, canPerform: t, onOpen: n, isEligible: r }) {
|
|
|
32
29
|
close: () => o(void 0)
|
|
33
30
|
};
|
|
34
31
|
}
|
|
35
|
-
function d({ canDeactivate: a, canResendInvite:
|
|
32
|
+
function d({ canDeactivate: a, canResendInvite: c, members: l, featureLabels: d, acceptInviteRedirectUri: f }) {
|
|
36
33
|
let p = t(), m = r(), h = i(), g = u({
|
|
37
|
-
members:
|
|
34
|
+
members: l,
|
|
38
35
|
canPerform: a,
|
|
39
36
|
onOpen: () => m.reset()
|
|
40
37
|
}), _ = () => {
|
|
@@ -44,10 +41,10 @@ function d({ canDeactivate: a, canResendInvite: s, members: c, featureLabels: d,
|
|
|
44
41
|
p(n.MemberDeactivated, { memberId: e }), g.close();
|
|
45
42
|
} });
|
|
46
43
|
}, v = u({
|
|
47
|
-
members:
|
|
48
|
-
canPerform:
|
|
44
|
+
members: l,
|
|
45
|
+
canPerform: c,
|
|
49
46
|
onOpen: () => h.reset(),
|
|
50
|
-
isEligible:
|
|
47
|
+
isEligible: o
|
|
51
48
|
});
|
|
52
49
|
return {
|
|
53
50
|
isDeactivateOpen: !!g.member,
|
|
@@ -66,10 +63,10 @@ function d({ canDeactivate: a, canResendInvite: s, members: c, featureLabels: d,
|
|
|
66
63
|
openResendConfirmation: v.open,
|
|
67
64
|
onResendOpenChange: v.onOpenChange,
|
|
68
65
|
onResendConfirm: () => {
|
|
69
|
-
!
|
|
66
|
+
!c || !v.member || h.mutate({
|
|
70
67
|
name: v.member.name,
|
|
71
68
|
email: v.member.email,
|
|
72
|
-
redirectUri:
|
|
69
|
+
redirectUri: s(f)
|
|
73
70
|
}, { onSuccess: () => {
|
|
74
71
|
e.success(d.resendSuccessToast), v.close();
|
|
75
72
|
} });
|