@burdenoff/microfe-billing 2026.1115.2 → 2026.1119.1
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/billing/modules/addons/pages/AddonCreatePage.js +143 -143
- package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.js +170 -170
- package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +148 -148
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +115 -115
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +136 -136
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +129 -129
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js +325 -325
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +149 -149
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +99 -98
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/checkout/components/StoreShippingSection.js +125 -124
- package/dist/billing/modules/checkout/components/StoreShippingSection.js.map +1 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +61 -60
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +177 -177
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +231 -231
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.js +139 -139
- package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +54 -54
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +65 -65
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +95 -95
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +232 -231
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +328 -328
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +57 -57
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +53 -53
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +100 -100
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +150 -150
- package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +125 -125
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +113 -113
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +132 -132
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +101 -101
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +175 -171
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js +51 -50
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +107 -107
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/shared/components/GeoPricingOverridesEditor.js +1 -0
- package/package.json +2 -2
|
@@ -6,288 +6,292 @@ import "../../../shared/components/index.js";
|
|
|
6
6
|
import { useBillingPermissions as i } from "../../../hooks/useBillingPermissions.js";
|
|
7
7
|
import { directBillingGraphqlRequest as a } from "../../../shared/utils/directBillingGraphql.js";
|
|
8
8
|
import { useBillingAccountSelection as o } from "../../../hooks/useBillingAccountSelection.js";
|
|
9
|
-
import { useBillingAccounts as
|
|
9
|
+
import { useBillingAccounts as ee } from "../../dashboard/hooks/useDashboard.js";
|
|
10
10
|
import "../../../shared/utils/index.js";
|
|
11
|
-
import { useActorProfiles as
|
|
11
|
+
import { useActorProfiles as s } from "../../../shared/hooks/useActorProfiles.js";
|
|
12
12
|
import "../../../shared/hooks/index.js";
|
|
13
|
-
import { useCallback as
|
|
14
|
-
import { AlertDialog as
|
|
15
|
-
import { Fragment as
|
|
13
|
+
import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
|
|
14
|
+
import { AlertDialog as f, AlertDialogAction as p, AlertDialogCancel as m, AlertDialogContent as h, AlertDialogDescription as g, AlertDialogFooter as _, AlertDialogHeader as v, AlertDialogTitle as y, IllustratedEmptyState as b, PagePurpose as x, ThemedSelect as S } from "@burdenoff/fe-libs/ui";
|
|
15
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
16
16
|
// src/billing/modules/settings/pages/TeamPermissionsPage.tsx
|
|
17
|
-
var
|
|
18
|
-
let { apiGatewayUrl:
|
|
19
|
-
orgId:
|
|
20
|
-
billingAccounts:
|
|
17
|
+
var te = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, ne = "\n query BillingScopeRoles($scopeId: String!) {\n roles(scopeId: $scopeId) {\n id\n name\n description\n priority\n isSystem\n }\n }\n", re = "\n query BillingScopeActors($scopeId: String!) {\n actors(scopeId: $scopeId) {\n actorId\n actorType\n roleAssignments {\n id\n actorId\n actorType\n roleId\n scopeId\n isActive\n expiresAt\n role { id name priority }\n }\n }\n }\n", ie = "\n mutation AssignBillingRole($input: AssignRoleInput!) {\n assignRoleToActor(input: $input) {\n id\n actorId\n roleId\n scopeId\n }\n }\n", ae = "\n mutation RemoveBillingRole($assignmentId: String!) {\n removeRoleFromActor(assignmentId: $assignmentId)\n }\n", E = ({ embedded: E = !1 }) => {
|
|
18
|
+
let { apiGatewayUrl: D, authToken: O, orgId: k } = e(), { billingAccounts: A } = ee(), { selectedAccountId: j } = o({
|
|
19
|
+
orgId: k,
|
|
20
|
+
billingAccounts: A,
|
|
21
21
|
syncFromUrl: !0,
|
|
22
22
|
urlParamName: "billingAccountId"
|
|
23
|
-
}),
|
|
24
|
-
apiGatewayUrl:
|
|
25
|
-
authToken:
|
|
26
|
-
orgId:
|
|
23
|
+
}), M = j ?? void 0, N = i({ billingAccountIdOverride: M }), [P, F] = d([]), [I, L] = d([]), [R, z] = d(!1), [B, V] = d(null), [H, U] = d(""), [W, G] = d(""), [K, q] = d(!1), [J, Y] = d(null), X = c(async (e, t) => a({
|
|
24
|
+
apiGatewayUrl: D,
|
|
25
|
+
authToken: O,
|
|
26
|
+
orgId: k,
|
|
27
27
|
query: e,
|
|
28
28
|
variables: t
|
|
29
29
|
}), [
|
|
30
|
+
D,
|
|
30
31
|
O,
|
|
31
|
-
k
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
B(!0), H(null);
|
|
32
|
+
k
|
|
33
|
+
]), Z = c(async () => {
|
|
34
|
+
if (M) {
|
|
35
|
+
z(!0), V(null);
|
|
36
36
|
try {
|
|
37
|
-
let [e, t] = await Promise.all([
|
|
38
|
-
|
|
37
|
+
let [e, t] = await Promise.all([X(ne, { scopeId: M }), X(re, { scopeId: M })]);
|
|
38
|
+
F(e.roles ?? []), L(t.actors ?? []);
|
|
39
39
|
let n = (e.roles ?? []).find((e) => /viewer/i.test(e.name));
|
|
40
|
-
|
|
40
|
+
G(n?.id ?? e.roles?.[0]?.id ?? "");
|
|
41
41
|
} catch (e) {
|
|
42
|
-
|
|
42
|
+
V(e instanceof Error ? e.message : "Failed to load team data");
|
|
43
43
|
} finally {
|
|
44
|
-
|
|
44
|
+
z(!1);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
}, [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, [
|
|
51
|
-
let
|
|
47
|
+
}, [M, X]);
|
|
48
|
+
l(() => {
|
|
49
|
+
Z();
|
|
50
|
+
}, [Z]);
|
|
51
|
+
let Q = u(() => [...I].sort((e, t) => {
|
|
52
52
|
let n = Math.max(...e.roleAssignments.map((e) => e.role?.priority ?? 0), 0);
|
|
53
53
|
return Math.max(...t.roleAssignments.map((e) => e.role?.priority ?? 0), 0) - n;
|
|
54
|
-
}), [
|
|
54
|
+
}), [I]), oe = u(() => Q.map((e) => ({
|
|
55
55
|
actorId: e.actorId,
|
|
56
56
|
actorType: e.actorType
|
|
57
|
-
})), [
|
|
58
|
-
if (
|
|
59
|
-
}, [
|
|
60
|
-
if (e.preventDefault(), !
|
|
61
|
-
let t =
|
|
62
|
-
if (!
|
|
57
|
+
})), [Q]), se = s(oe), ce = u(() => {
|
|
58
|
+
if (M) return A.find((e) => e.id === M)?.name ?? void 0;
|
|
59
|
+
}, [M, A]), le = async (e) => {
|
|
60
|
+
if (e.preventDefault(), !M || !H.trim() || !W) return;
|
|
61
|
+
let t = H.trim();
|
|
62
|
+
if (!te.test(t)) V("User ID must be a UUID (e.g. 1a2b3c4d-...). Get it from the user profile page.");
|
|
63
63
|
else {
|
|
64
|
-
|
|
64
|
+
q(!0), V(null);
|
|
65
65
|
try {
|
|
66
|
-
await
|
|
66
|
+
await X(ie, { input: {
|
|
67
67
|
actorId: t,
|
|
68
68
|
actorType: "USER",
|
|
69
|
-
roleId:
|
|
70
|
-
scopeId:
|
|
71
|
-
} }),
|
|
69
|
+
roleId: W,
|
|
70
|
+
scopeId: M
|
|
71
|
+
} }), U(""), await Z();
|
|
72
72
|
} catch (e) {
|
|
73
|
-
|
|
73
|
+
V(e instanceof Error ? e.message : "Failed to assign role");
|
|
74
74
|
} finally {
|
|
75
|
-
|
|
75
|
+
q(!1);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
},
|
|
79
|
-
|
|
78
|
+
}, $ = async (e) => {
|
|
79
|
+
V(null);
|
|
80
80
|
try {
|
|
81
|
-
await
|
|
81
|
+
await X(ae, { assignmentId: e }), await Z();
|
|
82
82
|
} catch (e) {
|
|
83
|
-
|
|
83
|
+
V(e instanceof Error ? e.message : "Failed to remove role");
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
return
|
|
86
|
+
return N.isLoading ? /* @__PURE__ */ w("div", {
|
|
87
87
|
className: "flex min-h-[400px] items-center justify-center",
|
|
88
|
-
children: /* @__PURE__ */
|
|
89
|
-
}) :
|
|
90
|
-
className:
|
|
88
|
+
children: /* @__PURE__ */ w("div", { className: "size-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
89
|
+
}) : N.isBillingAdmin ? M ? /* @__PURE__ */ T("div", {
|
|
90
|
+
className: E ? "space-y-6" : "space-y-6 p-6",
|
|
91
91
|
children: [
|
|
92
|
-
|
|
92
|
+
E ? null : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(n, {
|
|
93
93
|
title: "Team & Permissions",
|
|
94
94
|
description: "Control who can manage this billing account and what they can do."
|
|
95
|
-
}), /* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
95
|
+
}), /* @__PURE__ */ w(x, { children: "Decide who on your team can see and manage this billing account. Assign the Billing Admin role (full access) or Billing Viewer (read-only) to specific people, and revoke access when someone no longer needs it." })] }),
|
|
96
|
+
/* @__PURE__ */ T("div", {
|
|
97
97
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm",
|
|
98
98
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ w("span", {
|
|
100
100
|
className: "font-medium text-text-primary",
|
|
101
101
|
children: "Billing account:"
|
|
102
102
|
}),
|
|
103
103
|
" ",
|
|
104
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ w("span", {
|
|
105
105
|
className: "text-text-primary",
|
|
106
|
-
children:
|
|
106
|
+
children: ce ?? "Unnamed account"
|
|
107
107
|
}),
|
|
108
|
-
|
|
108
|
+
M ? /* @__PURE__ */ T("details", {
|
|
109
109
|
className: "mt-2 text-xs text-text-secondary",
|
|
110
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ w("summary", {
|
|
111
111
|
className: "cursor-pointer",
|
|
112
112
|
children: "Account ID"
|
|
113
|
-
}), /* @__PURE__ */
|
|
113
|
+
}), /* @__PURE__ */ w("span", {
|
|
114
114
|
className: "mt-1 inline-block font-mono",
|
|
115
|
-
children:
|
|
115
|
+
children: M
|
|
116
116
|
})]
|
|
117
117
|
}) : null
|
|
118
118
|
]
|
|
119
119
|
}),
|
|
120
|
-
|
|
120
|
+
B && /* @__PURE__ */ w("div", {
|
|
121
121
|
className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/5 p-4 text-sm text-status-error-text",
|
|
122
|
-
children:
|
|
122
|
+
children: B
|
|
123
123
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
onSubmit: (e) => void
|
|
124
|
+
/* @__PURE__ */ T("form", {
|
|
125
|
+
onSubmit: (e) => void le(e),
|
|
126
126
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 space-y-3",
|
|
127
127
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ w("h3", {
|
|
129
129
|
className: "text-sm font-semibold text-text-primary",
|
|
130
130
|
children: "Add member"
|
|
131
131
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ T("div", {
|
|
133
133
|
className: "grid grid-cols-1 gap-3 md:grid-cols-3",
|
|
134
|
-
children: [/* @__PURE__ */
|
|
134
|
+
children: [/* @__PURE__ */ T("div", {
|
|
135
135
|
className: "md:col-span-2",
|
|
136
136
|
children: [
|
|
137
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ w("label", {
|
|
138
138
|
htmlFor: "newActorId",
|
|
139
139
|
className: "block text-xs font-medium text-text-secondary",
|
|
140
140
|
children: "User ID"
|
|
141
141
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ w("input", {
|
|
143
143
|
id: "newActorId",
|
|
144
144
|
type: "text",
|
|
145
|
-
value:
|
|
146
|
-
onChange: (e) =>
|
|
145
|
+
value: H,
|
|
146
|
+
onChange: (e) => U(e.target.value),
|
|
147
147
|
placeholder: "Paste the user ID from their profile page",
|
|
148
148
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm",
|
|
149
149
|
required: !0
|
|
150
150
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ w("p", {
|
|
152
152
|
className: "mt-1 text-[11px] text-text-secondary",
|
|
153
153
|
children: "Find this on the user's profile page."
|
|
154
154
|
})
|
|
155
155
|
]
|
|
156
|
-
}), /* @__PURE__ */
|
|
156
|
+
}), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
157
157
|
htmlFor: "newRoleId",
|
|
158
158
|
className: "block text-xs font-medium text-text-secondary",
|
|
159
159
|
children: "Role"
|
|
160
|
-
}), /* @__PURE__ */
|
|
160
|
+
}), /* @__PURE__ */ w(S, {
|
|
161
161
|
id: "newRoleId",
|
|
162
|
-
value:
|
|
163
|
-
onChange: (e) =>
|
|
162
|
+
value: W,
|
|
163
|
+
onChange: (e) => G(e.target.value),
|
|
164
164
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
165
165
|
required: !0,
|
|
166
|
-
children:
|
|
166
|
+
children: P.map((e) => /* @__PURE__ */ w("option", {
|
|
167
167
|
value: e.id,
|
|
168
168
|
children: e.name
|
|
169
169
|
}, e.id))
|
|
170
170
|
})] })]
|
|
171
171
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ w("button", {
|
|
173
173
|
type: "submit",
|
|
174
|
-
disabled:
|
|
174
|
+
disabled: K || !H.trim() || !W,
|
|
175
175
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text disabled:opacity-50",
|
|
176
|
-
children:
|
|
176
|
+
children: K ? "Adding…" : "Add member"
|
|
177
177
|
})
|
|
178
178
|
]
|
|
179
179
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ T("div", {
|
|
181
181
|
className: "rounded-lg border border-border-subtle bg-bg-surface",
|
|
182
|
-
children: [/* @__PURE__ */
|
|
182
|
+
children: [/* @__PURE__ */ T("div", {
|
|
183
183
|
className: "border-b border-border-subtle px-4 py-3",
|
|
184
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ w("h3", {
|
|
185
185
|
className: "text-sm font-semibold text-text-primary",
|
|
186
186
|
children: "Members"
|
|
187
|
-
}), /* @__PURE__ */
|
|
187
|
+
}), /* @__PURE__ */ w("p", {
|
|
188
188
|
className: "text-xs text-text-secondary",
|
|
189
189
|
children: "Each member's role applies only to this billing account."
|
|
190
190
|
})]
|
|
191
|
-
}),
|
|
191
|
+
}), R ? /* @__PURE__ */ w("div", {
|
|
192
192
|
className: "p-6 text-sm text-text-secondary",
|
|
193
193
|
children: "Loading…"
|
|
194
|
-
}) :
|
|
194
|
+
}) : Q.length === 0 ? /* @__PURE__ */ w("div", {
|
|
195
195
|
className: "p-6 text-sm text-text-secondary",
|
|
196
196
|
children: "No members assigned yet."
|
|
197
|
-
}) : /* @__PURE__ */
|
|
198
|
-
className: "
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
className: "border-b border-border-subtle last:border-0",
|
|
221
|
-
children: [
|
|
222
|
-
/* @__PURE__ */ b("td", {
|
|
223
|
-
className: "px-4 py-3",
|
|
224
|
-
children: /* @__PURE__ */ b(r, {
|
|
225
|
-
profile: ae[e.actorId] ?? {
|
|
226
|
-
actorId: e.actorId,
|
|
227
|
-
actorType: e.actorType,
|
|
228
|
-
displayName: e.actorType.toLowerCase() === "user" ? `User ${e.actorId.slice(0, 8)}…` : e.actorType,
|
|
229
|
-
secondaryLabel: e.actorId.slice(0, 12),
|
|
230
|
-
resolved: !1
|
|
231
|
-
},
|
|
232
|
-
variant: "cell"
|
|
233
|
-
})
|
|
234
|
-
}),
|
|
235
|
-
/* @__PURE__ */ b("td", {
|
|
236
|
-
className: "px-4 py-3 text-xs capitalize text-text-secondary",
|
|
237
|
-
children: e.actorType.toLowerCase()
|
|
238
|
-
}),
|
|
239
|
-
/* @__PURE__ */ b("td", {
|
|
240
|
-
className: "px-4 py-3",
|
|
241
|
-
children: /* @__PURE__ */ b("div", {
|
|
242
|
-
className: "flex flex-wrap gap-1",
|
|
243
|
-
children: e.roleAssignments.filter((e) => e.isActive).map((e) => /* @__PURE__ */ x("span", {
|
|
244
|
-
className: "inline-flex items-center gap-1 rounded-full border border-border-subtle bg-bg-sunken px-2 py-0.5 text-xs",
|
|
245
|
-
children: [e.role?.name ?? e.roleId, /* @__PURE__ */ b("button", {
|
|
246
|
-
type: "button",
|
|
247
|
-
onClick: () => X(e.id),
|
|
248
|
-
className: "text-text-secondary hover:text-status-error-text",
|
|
249
|
-
"aria-label": `Remove ${e.role?.name ?? "role"}`,
|
|
250
|
-
children: "×"
|
|
251
|
-
})]
|
|
252
|
-
}, e.id))
|
|
197
|
+
}) : /* @__PURE__ */ w("div", {
|
|
198
|
+
className: "overflow-x-auto",
|
|
199
|
+
"data-testid": "billing-team-members-scroll",
|
|
200
|
+
children: /* @__PURE__ */ T("table", {
|
|
201
|
+
className: "w-full text-sm",
|
|
202
|
+
children: [/* @__PURE__ */ w("thead", { children: /* @__PURE__ */ T("tr", {
|
|
203
|
+
className: "border-b border-border-subtle text-left text-xs text-text-secondary",
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ w("th", {
|
|
206
|
+
className: "px-4 py-2",
|
|
207
|
+
children: "Member"
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ w("th", {
|
|
210
|
+
className: "px-4 py-2",
|
|
211
|
+
children: "Type"
|
|
212
|
+
}),
|
|
213
|
+
/* @__PURE__ */ w("th", {
|
|
214
|
+
className: "px-4 py-2",
|
|
215
|
+
children: "Roles"
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ w("th", {
|
|
218
|
+
className: "px-4 py-2 text-right",
|
|
219
|
+
children: "Actions"
|
|
253
220
|
})
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
221
|
+
]
|
|
222
|
+
}) }), /* @__PURE__ */ w("tbody", { children: Q.map((e) => /* @__PURE__ */ T("tr", {
|
|
223
|
+
className: "border-b border-border-subtle last:border-0",
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ w("td", {
|
|
226
|
+
className: "px-4 py-3",
|
|
227
|
+
children: /* @__PURE__ */ w(r, {
|
|
228
|
+
profile: se[e.actorId] ?? {
|
|
229
|
+
actorId: e.actorId,
|
|
230
|
+
actorType: e.actorType,
|
|
231
|
+
displayName: e.actorType.toLowerCase() === "user" ? `User ${e.actorId.slice(0, 8)}…` : e.actorType,
|
|
232
|
+
secondaryLabel: e.actorId.slice(0, 12),
|
|
233
|
+
resolved: !1
|
|
234
|
+
},
|
|
235
|
+
variant: "cell"
|
|
236
|
+
})
|
|
237
|
+
}),
|
|
238
|
+
/* @__PURE__ */ w("td", {
|
|
239
|
+
className: "px-4 py-3 text-xs capitalize text-text-secondary",
|
|
240
|
+
children: e.actorType.toLowerCase()
|
|
241
|
+
}),
|
|
242
|
+
/* @__PURE__ */ w("td", {
|
|
243
|
+
className: "px-4 py-3",
|
|
244
|
+
children: /* @__PURE__ */ w("div", {
|
|
245
|
+
className: "flex flex-wrap gap-1",
|
|
246
|
+
children: e.roleAssignments.filter((e) => e.isActive).map((e) => /* @__PURE__ */ T("span", {
|
|
247
|
+
className: "inline-flex items-center gap-1 rounded-full border border-border-subtle bg-bg-sunken px-2 py-0.5 text-xs",
|
|
248
|
+
children: [e.role?.name ?? e.roleId, /* @__PURE__ */ w("button", {
|
|
249
|
+
type: "button",
|
|
250
|
+
onClick: () => Y(e.id),
|
|
251
|
+
className: "text-text-secondary hover:text-status-error-text",
|
|
252
|
+
"aria-label": `Remove ${e.role?.name ?? "role"}`,
|
|
253
|
+
children: "×"
|
|
254
|
+
})]
|
|
255
|
+
}, e.id))
|
|
256
|
+
})
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ w("td", {
|
|
259
|
+
className: "px-4 py-3 text-right",
|
|
260
|
+
children: /* @__PURE__ */ T("span", {
|
|
261
|
+
className: "text-xs text-text-secondary",
|
|
262
|
+
children: [e.effectivePermissionCount ?? "—", " permissions"]
|
|
263
|
+
})
|
|
260
264
|
})
|
|
261
|
-
|
|
262
|
-
]
|
|
263
|
-
}
|
|
265
|
+
]
|
|
266
|
+
}, e.actorId)) })]
|
|
267
|
+
})
|
|
264
268
|
})]
|
|
265
269
|
}),
|
|
266
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ T("div", {
|
|
267
271
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
268
272
|
children: [
|
|
269
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ w("h3", {
|
|
270
274
|
className: "text-sm font-semibold text-text-primary",
|
|
271
275
|
children: "Available roles"
|
|
272
276
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ w("p", {
|
|
274
278
|
className: "mt-1 text-xs text-text-secondary",
|
|
275
279
|
children: "Roles are cloned from the system templates when a billing account is created."
|
|
276
280
|
}),
|
|
277
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ w("ul", {
|
|
278
282
|
className: "mt-3 space-y-2",
|
|
279
|
-
children:
|
|
283
|
+
children: P.map((e) => /* @__PURE__ */ T("li", {
|
|
280
284
|
className: "flex items-start gap-3 rounded-md border border-border-subtle bg-bg-surface p-3",
|
|
281
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ T("div", {
|
|
282
286
|
className: "flex-1",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ w("div", {
|
|
284
288
|
className: "text-sm font-medium text-text-primary",
|
|
285
289
|
children: e.name
|
|
286
|
-
}), e.description && /* @__PURE__ */
|
|
290
|
+
}), e.description && /* @__PURE__ */ w("p", {
|
|
287
291
|
className: "mt-1 text-xs text-text-secondary",
|
|
288
292
|
children: e.description
|
|
289
293
|
})]
|
|
290
|
-
}), /* @__PURE__ */
|
|
294
|
+
}), /* @__PURE__ */ T("span", {
|
|
291
295
|
className: "text-xs text-text-secondary",
|
|
292
296
|
children: ["priority ", e.priority]
|
|
293
297
|
})]
|
|
@@ -295,32 +299,32 @@ var S = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, C = "
|
|
|
295
299
|
})
|
|
296
300
|
]
|
|
297
301
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
open:
|
|
302
|
+
/* @__PURE__ */ w(f, {
|
|
303
|
+
open: J !== null,
|
|
300
304
|
onOpenChange: (e) => {
|
|
301
|
-
e ||
|
|
305
|
+
e || Y(null);
|
|
302
306
|
},
|
|
303
|
-
children: /* @__PURE__ */
|
|
307
|
+
children: /* @__PURE__ */ T(h, { children: [/* @__PURE__ */ T(v, { children: [/* @__PURE__ */ w(y, { children: "Remove role assignment?" }), /* @__PURE__ */ w(g, { children: "Remove this role assignment? The member will lose the access this role grants for this billing account." })] }), /* @__PURE__ */ T(_, { children: [/* @__PURE__ */ w(m, { children: "Cancel" }), /* @__PURE__ */ w(p, {
|
|
304
308
|
onClick: () => {
|
|
305
|
-
let e =
|
|
306
|
-
|
|
309
|
+
let e = J;
|
|
310
|
+
Y(null), e && $(e);
|
|
307
311
|
},
|
|
308
312
|
children: "Remove"
|
|
309
313
|
})] })] })
|
|
310
314
|
})
|
|
311
315
|
]
|
|
312
|
-
}) :
|
|
316
|
+
}) : E ? null : /* @__PURE__ */ T("div", {
|
|
313
317
|
className: "space-y-6 p-6",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
318
|
+
children: [/* @__PURE__ */ w(n, {
|
|
315
319
|
title: "Team & Permissions",
|
|
316
320
|
description: "Select a billing account to manage who can access it."
|
|
317
|
-
}), /* @__PURE__ */ b
|
|
321
|
+
}), /* @__PURE__ */ w(b, {
|
|
318
322
|
illustration: "empty-people",
|
|
319
323
|
title: "No billing account selected",
|
|
320
324
|
description: "Pick one from the billing account selector to manage its members and roles."
|
|
321
325
|
})]
|
|
322
|
-
}) :
|
|
326
|
+
}) : E ? null : /* @__PURE__ */ w(t, { message: "You don't have permission to manage team and permissions for this billing account." });
|
|
323
327
|
};
|
|
324
|
-
export {
|
|
328
|
+
export { E as TeamPermissionsPage };
|
|
325
329
|
|
|
326
330
|
//# sourceMappingURL=TeamPermissionsPage.js.map
|