@burdenoff/microfe-workspaces 2026.1120.1 → 2026.1123.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/WorkspacesRoot.js +39 -31
- package/dist/WorkspacesRoutes.js +91 -59
- package/dist/components/ProjectCard.js +48 -47
- package/dist/constants/navigationV2.d.ts +5 -0
- package/dist/constants/navigationV2.js +2 -2
- package/dist/generated/global-operations.d.ts +11 -1
- package/dist/generated/global-types.d.ts +9866 -574
- package/dist/generated/wspace-operations.d.ts +631 -2
- package/dist/generated/wspace-operations.js +5428 -1376
- package/dist/generated/wspace-types.d.ts +200319 -48046
- package/dist/generated/wspace-types.js +19 -0
- package/dist/hooks/useCollaboration.d.ts +143 -0
- package/dist/hooks/useCollaboration.js +119 -0
- package/dist/hooks/useCollaborationMutations.d.ts +177 -0
- package/dist/hooks/useCollaborationMutations.js +126 -0
- package/dist/hooks/v2/useWorkspacePagesV2Data.d.ts +89 -0
- package/dist/hooks/v2/useWorkspacePagesV2Data.js +211 -0
- package/dist/index.d.ts +1 -1
- package/dist/node_modules/sonner/dist/index.js +167 -0
- package/dist/pages/CollaborationConsolePage.d.ts +1 -0
- package/dist/pages/CollaborationConsolePage.js +1059 -0
- package/dist/pages/MembersListPage.js +101 -100
- package/dist/pages/ProjectMembersPage.js +116 -115
- package/dist/pages/ProjectsListPage.js +233 -232
- package/dist/pages/WorkspacesListPage.js +79 -68
- package/dist/pages/v2/ActivityPage.d.ts +1 -0
- package/dist/pages/v2/ActivityPage.js +150 -0
- package/dist/pages/v2/InvitePeopleDialog.d.ts +11 -0
- package/dist/pages/v2/InvitePeopleDialog.js +208 -0
- package/dist/pages/v2/InvitedTab.d.ts +9 -0
- package/dist/pages/v2/InvitedTab.js +223 -0
- package/dist/pages/v2/MembersPage.d.ts +1 -0
- package/dist/pages/v2/MembersPage.js +120 -0
- package/dist/pages/v2/PeopleTab.d.ts +20 -0
- package/dist/pages/v2/PeopleTab.js +253 -0
- package/dist/pages/v2/ProjectsPage.d.ts +1 -0
- package/dist/pages/v2/ProjectsPage.js +242 -0
- package/dist/pages/v2/WorkspacesPage.d.ts +3 -0
- package/dist/pages/v2/WorkspacesPage.js +247 -0
- package/dist/pages/v2/activitySentences.d.ts +50 -0
- package/dist/pages/v2/activitySentences.js +288 -0
- package/dist/pages/v2/inviteEmails.d.ts +12 -0
- package/dist/pages/v2/inviteEmails.js +18 -0
- package/dist/pages/v2/memberRows.d.ts +54 -0
- package/dist/pages/v2/memberRows.js +51 -0
- package/dist/pages/v2/projectRows.d.ts +10 -0
- package/dist/pages/v2/projectRows.js +10 -0
- package/dist/pages/v2/relativeTime.d.ts +6 -0
- package/dist/pages/v2/relativeTime.js +30 -0
- package/dist/store/workspacesStore.d.ts +2 -1
- package/dist/store/workspacesStore.js +1 -1
- package/dist/translations/en.d.ts +436 -0
- package/dist/translations/en.js +436 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/utils/nativeBridge.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,1059 @@
|
|
|
1
|
+
import { toast as e } from "../node_modules/sonner/dist/index.js";
|
|
2
|
+
import { useWorkspacesContext as t } from "../providers/WorkspacesProvider.js";
|
|
3
|
+
import { useWorkspacesPageView as n } from "../hooks/useWorkspacesPageView.js";
|
|
4
|
+
import { commitWorkspaceSelection as ee } from "../hooks/useOpenWorkspace.js";
|
|
5
|
+
import { useTr as te } from "../hooks/useTr.js";
|
|
6
|
+
import { useCrossWorkspaceOverview as ne, useMspOrgLinks as re, useMspOrganizationSummary as ie, useWorkspaceShares as ae } from "../hooks/useCollaboration.js";
|
|
7
|
+
import { useCollaborationMutations as oe } from "../hooks/useCollaborationMutations.js";
|
|
8
|
+
import { MspBillingMode as r, MspDelegatedScope as i, MspLinkRole as se, MspOrgLinkStatus as a, WorkspaceShareAccessLevel as o, WorkspaceShareDirection as ce, WorkspaceShareResourceType as s, WorkspaceShareStatus as le } from "../generated/wspace-types.js";
|
|
9
|
+
import { useCallback as ue, useState as c } from "react";
|
|
10
|
+
import { ArrowRightLeft as de, Building2 as fe, CheckCircle2 as pe, CreditCard as me, FolderKanban as he, Globe as ge, Link2 as _e, PauseCircle as ve, PlayCircle as ye, Plus as be, Share2 as l, ShieldCheck as xe, Users as Se, XCircle as Ce } from "lucide-react";
|
|
11
|
+
import { AuroraBackground as we, Badge as u, Button as d, CardContent as f, CardHeader as p, CardTitle as m, GlassCard as h, GradientText as Te, Input as g, PagePurpose as Ee, Skeleton as _ } from "@burdenoff/fe-libs/ui";
|
|
12
|
+
import { useActiveContext as De } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
13
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
14
|
+
// src/pages/CollaborationConsolePage.tsx
|
|
15
|
+
var Oe = [
|
|
16
|
+
{
|
|
17
|
+
value: i.ViewOverview,
|
|
18
|
+
label: "View Overview"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
value: i.ViewBillingSummary,
|
|
22
|
+
label: "View Billing Summary"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: i.ManageMembers,
|
|
26
|
+
label: "Manage Members"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: i.ManageProjects,
|
|
30
|
+
label: "Manage Projects"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
value: i.ManageShares,
|
|
34
|
+
label: "Manage Shares"
|
|
35
|
+
}
|
|
36
|
+
], ke = [
|
|
37
|
+
{
|
|
38
|
+
value: s.Channel,
|
|
39
|
+
label: "Shared Channel"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: s.Project,
|
|
43
|
+
label: "Shared Project"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
value: s.Mentions,
|
|
47
|
+
label: "Cross-Workspace Mentions"
|
|
48
|
+
}
|
|
49
|
+
], Ae = [
|
|
50
|
+
{
|
|
51
|
+
value: o.ReadOnly,
|
|
52
|
+
label: "Read Only"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: o.Collaborate,
|
|
56
|
+
label: "Collaborate"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
value: o.Admin,
|
|
60
|
+
label: "Admin"
|
|
61
|
+
}
|
|
62
|
+
], je = [
|
|
63
|
+
{
|
|
64
|
+
value: r.Consolidated,
|
|
65
|
+
label: "Consolidated (MSP Billed)"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
value: r.ClientDirect,
|
|
69
|
+
label: "Client Direct"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
value: r.Split,
|
|
73
|
+
label: "Split Billing"
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
function b(e) {
|
|
77
|
+
switch (e) {
|
|
78
|
+
case "ACTIVE": return "bg-status-success-bgSubtle text-status-success-text border-status-success-border";
|
|
79
|
+
case "PENDING": return "bg-status-warning-bgSubtle text-status-warning-text border-status-warning-border";
|
|
80
|
+
case "SUSPENDED": return "bg-status-warning-bgSubtle text-status-warning-text border-status-warning-border";
|
|
81
|
+
default: return "bg-surface-secondary text-text-secondary border-border-seam";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function x() {
|
|
85
|
+
n("workspaces.collaboration");
|
|
86
|
+
let x = te(), { workspaceId: S, organizationId: Me } = t(), { setOrganization: Ne, setWorkspace: Pe, setProject: C, setTenant: w } = De(), [T, E] = c("portfolio"), [D, O] = c(null), [Fe, k] = c(!1), [Ie, Le] = c(""), [A, Re] = c(s.Channel), [j, M] = c(""), [N, P] = c(""), [F, ze] = c(o.Collaborate), [Be, I] = c(!1), [L, R] = c(""), [z, B] = c(""), [V, H] = c(""), [U, Ve] = c(r.Consolidated), [W, G] = c(""), [K, He] = c(""), [q, Ue] = c([i.ViewOverview, i.ViewBillingSummary]), J = ne(), We = ae(S, ce.All), Ge = re(S, se.All), Y = ie(S, D), X = oe(), Ke = ue((t) => {
|
|
87
|
+
ee({
|
|
88
|
+
setOrganization: Ne,
|
|
89
|
+
setWorkspace: Pe,
|
|
90
|
+
setProject: C,
|
|
91
|
+
setTenant: w
|
|
92
|
+
}, {
|
|
93
|
+
id: t.id,
|
|
94
|
+
orgId: t.orgId,
|
|
95
|
+
tenantId: t.tenantId
|
|
96
|
+
}), e.success(x("collaborationConsole.switchedToast", "Switched active workspace to {{name}}", { name: t.name }));
|
|
97
|
+
}, [
|
|
98
|
+
Ne,
|
|
99
|
+
C,
|
|
100
|
+
w,
|
|
101
|
+
Pe,
|
|
102
|
+
x
|
|
103
|
+
]), qe = (e) => {
|
|
104
|
+
Ue((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
105
|
+
}, Je = async (t) => {
|
|
106
|
+
if (t.preventDefault(), !S) e.error(x("collaborationConsole.workspaceRequired", "Select an active workspace first"));
|
|
107
|
+
else try {
|
|
108
|
+
await X.createShare.mutateAsync({
|
|
109
|
+
workspaceId: S,
|
|
110
|
+
targetWorkspaceId: Ie.trim(),
|
|
111
|
+
resourceType: A,
|
|
112
|
+
resourceId: j.trim(),
|
|
113
|
+
resourceName: N.trim(),
|
|
114
|
+
accessLevel: F
|
|
115
|
+
}), e.success(x("collaborationConsole.shareCreated", "Cross-workspace share offered (pending target consent)")), Le(""), M(""), P(""), k(!1);
|
|
116
|
+
} catch (t) {
|
|
117
|
+
e.error(t instanceof Error ? t.message : "Failed to create share");
|
|
118
|
+
}
|
|
119
|
+
}, Ye = async (t) => {
|
|
120
|
+
if (S) try {
|
|
121
|
+
await X.acceptShare.mutateAsync({
|
|
122
|
+
workspaceId: S,
|
|
123
|
+
shareId: t
|
|
124
|
+
}), e.success(x("collaborationConsole.shareAccepted", "Share consent granted and activated"));
|
|
125
|
+
} catch (t) {
|
|
126
|
+
e.error(t instanceof Error ? t.message : "Failed to accept share");
|
|
127
|
+
}
|
|
128
|
+
}, Xe = async (t) => {
|
|
129
|
+
if (S) try {
|
|
130
|
+
await X.revokeShare.mutateAsync({
|
|
131
|
+
workspaceId: S,
|
|
132
|
+
shareId: t,
|
|
133
|
+
reason: "Revoked via Multi-Org & Sharing Console"
|
|
134
|
+
}), e.success(x("collaborationConsole.shareRevoked", "Share revoked immediately"));
|
|
135
|
+
} catch (t) {
|
|
136
|
+
e.error(t instanceof Error ? t.message : "Failed to revoke share");
|
|
137
|
+
}
|
|
138
|
+
}, Ze = async (t) => {
|
|
139
|
+
if (t.preventDefault(), !S) e.error(x("collaborationConsole.workspaceRequired", "Select an active workspace first"));
|
|
140
|
+
else if (q.length === 0) e.error(x("collaborationConsole.scopeRequired", "Select at least one delegated permission scope"));
|
|
141
|
+
else try {
|
|
142
|
+
let t = W.trim() ? Number.parseInt(W, 10) : void 0;
|
|
143
|
+
await X.createMspLink.mutateAsync({
|
|
144
|
+
workspaceId: S,
|
|
145
|
+
clientOrgId: L.trim(),
|
|
146
|
+
clientOrgName: z.trim(),
|
|
147
|
+
clientWorkspaceId: V.trim() || void 0,
|
|
148
|
+
delegatedScopes: q,
|
|
149
|
+
billingMode: U,
|
|
150
|
+
monthlySeatBudget: Number.isFinite(t) ? t : void 0,
|
|
151
|
+
notes: K.trim() || void 0
|
|
152
|
+
}), e.success(x("collaborationConsole.mspCreated", "MSP link proposed — awaiting client organization approval")), R(""), B(""), H(""), G(""), He(""), I(!1);
|
|
153
|
+
} catch (t) {
|
|
154
|
+
e.error(t instanceof Error ? t.message : "Failed to propose MSP link");
|
|
155
|
+
}
|
|
156
|
+
}, Qe = async (t) => {
|
|
157
|
+
if (S) try {
|
|
158
|
+
await X.approveMspLink.mutateAsync({
|
|
159
|
+
workspaceId: S,
|
|
160
|
+
linkId: t
|
|
161
|
+
}), e.success(x("collaborationConsole.mspApproved", "MSP organization link approved"));
|
|
162
|
+
} catch (t) {
|
|
163
|
+
e.error(t instanceof Error ? t.message : "Failed to approve MSP link");
|
|
164
|
+
}
|
|
165
|
+
}, $e = async (t, n) => {
|
|
166
|
+
if (S) try {
|
|
167
|
+
await X.updateMspLink.mutateAsync({
|
|
168
|
+
workspaceId: S,
|
|
169
|
+
linkId: t,
|
|
170
|
+
status: n
|
|
171
|
+
}), e.success(n === a.Suspended ? x("collaborationConsole.mspSuspended", "MSP link suspended") : x("collaborationConsole.mspReactivated", "MSP link reactivated"));
|
|
172
|
+
} catch (t) {
|
|
173
|
+
e.error(t instanceof Error ? t.message : "Failed to update MSP link");
|
|
174
|
+
}
|
|
175
|
+
}, et = async (t) => {
|
|
176
|
+
if (S) try {
|
|
177
|
+
await X.revokeMspLink.mutateAsync({
|
|
178
|
+
workspaceId: S,
|
|
179
|
+
linkId: t
|
|
180
|
+
}), e.success(x("collaborationConsole.mspRevoked", "MSP organization link revoked"));
|
|
181
|
+
} catch (t) {
|
|
182
|
+
e.error(t instanceof Error ? t.message : "Failed to revoke MSP link");
|
|
183
|
+
}
|
|
184
|
+
}, Z = J.data, Q = We.data?.items ?? [], $ = Ge.data?.items ?? [];
|
|
185
|
+
return /* @__PURE__ */ y("div", {
|
|
186
|
+
className: "space-y-6 p-3 sm:p-6",
|
|
187
|
+
"data-testid": "collaboration-console-page",
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ y("div", {
|
|
190
|
+
className: "relative overflow-hidden rounded-card flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 px-4 py-4",
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ v(we, { intensity: "subtle" }),
|
|
193
|
+
/* @__PURE__ */ y("div", {
|
|
194
|
+
className: "relative z-10",
|
|
195
|
+
children: [/* @__PURE__ */ y("div", {
|
|
196
|
+
className: "flex items-center gap-2",
|
|
197
|
+
children: [/* @__PURE__ */ v(ge, {
|
|
198
|
+
className: "text-primary",
|
|
199
|
+
size: 24,
|
|
200
|
+
"aria-hidden": "true"
|
|
201
|
+
}), /* @__PURE__ */ v("h1", {
|
|
202
|
+
className: "text-2xl sm:text-3xl font-bold",
|
|
203
|
+
children: /* @__PURE__ */ v(Te, { children: x("collaborationConsole.title", "Multi-Org & Cross-Workspace Console") })
|
|
204
|
+
})]
|
|
205
|
+
}), /* @__PURE__ */ v("p", {
|
|
206
|
+
className: "text-sm sm:text-base text-text-secondary mt-1",
|
|
207
|
+
children: x("collaborationConsole.subtitle", "Manage bilateral cross-workspace shares, delegated MSP client organizations, and aggregated seat billing without compromising workspace isolation.")
|
|
208
|
+
})]
|
|
209
|
+
}),
|
|
210
|
+
/* @__PURE__ */ y("div", {
|
|
211
|
+
className: "relative z-10 flex flex-wrap items-center gap-2",
|
|
212
|
+
children: [/* @__PURE__ */ y(d, {
|
|
213
|
+
variant: "outline",
|
|
214
|
+
size: "sm",
|
|
215
|
+
onClick: () => {
|
|
216
|
+
E("shares"), k(!0);
|
|
217
|
+
},
|
|
218
|
+
className: "gap-2",
|
|
219
|
+
"data-testid": "open-share-form-btn",
|
|
220
|
+
children: [/* @__PURE__ */ v(l, {
|
|
221
|
+
size: 16,
|
|
222
|
+
"aria-hidden": "true"
|
|
223
|
+
}), x("collaborationConsole.newShareButton", "Share Resource")]
|
|
224
|
+
}), /* @__PURE__ */ y(d, {
|
|
225
|
+
size: "sm",
|
|
226
|
+
onClick: () => {
|
|
227
|
+
E("msp"), I(!0);
|
|
228
|
+
},
|
|
229
|
+
className: "gap-2",
|
|
230
|
+
"data-testid": "open-msp-form-btn",
|
|
231
|
+
children: [/* @__PURE__ */ v(be, {
|
|
232
|
+
size: 16,
|
|
233
|
+
"aria-hidden": "true"
|
|
234
|
+
}), x("collaborationConsole.newMspLinkButton", "Link Client Org")]
|
|
235
|
+
})]
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ v(Ee, { children: x("collaborationConsole.purpose", "Strict workspace isolation stays on by default. Every cross-workspace share (channels, projects, mentions) and MSP organization link starts pending and activates only after explicit target-side consent. Either organization can revoke access instantaneously.") }),
|
|
240
|
+
/* @__PURE__ */ y("div", {
|
|
241
|
+
className: "grid grid-cols-2 lg:grid-cols-4 gap-4",
|
|
242
|
+
"data-testid": "portfolio-kpi-strip",
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ v(h, {
|
|
245
|
+
treatment: "insight",
|
|
246
|
+
children: /* @__PURE__ */ y(f, {
|
|
247
|
+
className: "p-4 flex items-center justify-between",
|
|
248
|
+
children: [/* @__PURE__ */ y("div", { children: [
|
|
249
|
+
/* @__PURE__ */ v("p", {
|
|
250
|
+
className: "text-xs text-text-secondary uppercase tracking-wide",
|
|
251
|
+
children: x("collaborationConsole.kpiOrgs", "Organizations")
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ v("p", {
|
|
254
|
+
className: "text-2xl font-bold text-text-primary mt-1",
|
|
255
|
+
children: J.isLoading ? "—" : Z?.totals.organizationCount ?? 0
|
|
256
|
+
}),
|
|
257
|
+
/* @__PURE__ */ y("p", {
|
|
258
|
+
className: "text-xs text-text-muted mt-0.5",
|
|
259
|
+
children: [
|
|
260
|
+
Z?.totals.managedOrganizationCount ?? 0,
|
|
261
|
+
" ",
|
|
262
|
+
x("collaborationConsole.kpiManagedSuffix", "MSP-managed")
|
|
263
|
+
]
|
|
264
|
+
})
|
|
265
|
+
] }), /* @__PURE__ */ v(fe, {
|
|
266
|
+
className: "text-primary",
|
|
267
|
+
size: 24,
|
|
268
|
+
"aria-hidden": "true"
|
|
269
|
+
})]
|
|
270
|
+
})
|
|
271
|
+
}),
|
|
272
|
+
/* @__PURE__ */ v(h, {
|
|
273
|
+
treatment: "insight",
|
|
274
|
+
children: /* @__PURE__ */ y(f, {
|
|
275
|
+
className: "p-4 flex items-center justify-between",
|
|
276
|
+
children: [/* @__PURE__ */ y("div", { children: [
|
|
277
|
+
/* @__PURE__ */ v("p", {
|
|
278
|
+
className: "text-xs text-text-secondary uppercase tracking-wide",
|
|
279
|
+
children: x("collaborationConsole.kpiWorkspaces", "Workspaces")
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ v("p", {
|
|
282
|
+
className: "text-2xl font-bold text-text-primary mt-1",
|
|
283
|
+
children: J.isLoading ? "—" : Z?.totals.workspaceCount ?? 0
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ y("p", {
|
|
286
|
+
className: "text-xs text-text-muted mt-0.5",
|
|
287
|
+
children: [
|
|
288
|
+
Z?.totals.activeWorkspaceCount ?? 0,
|
|
289
|
+
" ",
|
|
290
|
+
x("collaborationConsole.kpiActiveSuffix", "active")
|
|
291
|
+
]
|
|
292
|
+
})
|
|
293
|
+
] }), /* @__PURE__ */ v(he, {
|
|
294
|
+
className: "text-primary",
|
|
295
|
+
size: 24,
|
|
296
|
+
"aria-hidden": "true"
|
|
297
|
+
})]
|
|
298
|
+
})
|
|
299
|
+
}),
|
|
300
|
+
/* @__PURE__ */ v(h, {
|
|
301
|
+
treatment: "insight",
|
|
302
|
+
children: /* @__PURE__ */ y(f, {
|
|
303
|
+
className: "p-4 flex items-center justify-between",
|
|
304
|
+
children: [/* @__PURE__ */ y("div", { children: [
|
|
305
|
+
/* @__PURE__ */ v("p", {
|
|
306
|
+
className: "text-xs text-text-secondary uppercase tracking-wide",
|
|
307
|
+
children: x("collaborationConsole.kpiSeats", "Aggregated Seats")
|
|
308
|
+
}),
|
|
309
|
+
/* @__PURE__ */ v("p", {
|
|
310
|
+
className: "text-2xl font-bold text-text-primary mt-1",
|
|
311
|
+
children: J.isLoading ? "—" : Z?.totals.totalActiveSeats ?? 0
|
|
312
|
+
}),
|
|
313
|
+
/* @__PURE__ */ y("p", {
|
|
314
|
+
className: "text-xs text-text-muted mt-0.5",
|
|
315
|
+
children: [
|
|
316
|
+
Z?.totals.totalProjects ?? 0,
|
|
317
|
+
" ",
|
|
318
|
+
x("collaborationConsole.kpiProjectsSuffix", "projects")
|
|
319
|
+
]
|
|
320
|
+
})
|
|
321
|
+
] }), /* @__PURE__ */ v(Se, {
|
|
322
|
+
className: "text-primary",
|
|
323
|
+
size: 24,
|
|
324
|
+
"aria-hidden": "true"
|
|
325
|
+
})]
|
|
326
|
+
})
|
|
327
|
+
}),
|
|
328
|
+
/* @__PURE__ */ v(h, {
|
|
329
|
+
treatment: "insight",
|
|
330
|
+
children: /* @__PURE__ */ y(f, {
|
|
331
|
+
className: "p-4 flex items-center justify-between",
|
|
332
|
+
children: [/* @__PURE__ */ y("div", { children: [
|
|
333
|
+
/* @__PURE__ */ v("p", {
|
|
334
|
+
className: "text-xs text-text-secondary uppercase tracking-wide",
|
|
335
|
+
children: x("collaborationConsole.kpiShares", "Active Shares")
|
|
336
|
+
}),
|
|
337
|
+
/* @__PURE__ */ v("p", {
|
|
338
|
+
className: "text-2xl font-bold text-text-primary mt-1",
|
|
339
|
+
children: J.isLoading ? "—" : Z?.totals.activeShareCount ?? 0
|
|
340
|
+
}),
|
|
341
|
+
/* @__PURE__ */ y("p", {
|
|
342
|
+
className: "text-xs text-text-muted mt-0.5",
|
|
343
|
+
children: [
|
|
344
|
+
$.length,
|
|
345
|
+
" ",
|
|
346
|
+
x("collaborationConsole.kpiLinksSuffix", "MSP links")
|
|
347
|
+
]
|
|
348
|
+
})
|
|
349
|
+
] }), /* @__PURE__ */ v(xe, {
|
|
350
|
+
className: "text-primary",
|
|
351
|
+
size: 24,
|
|
352
|
+
"aria-hidden": "true"
|
|
353
|
+
})]
|
|
354
|
+
})
|
|
355
|
+
})
|
|
356
|
+
]
|
|
357
|
+
}),
|
|
358
|
+
/* @__PURE__ */ y("div", {
|
|
359
|
+
className: "flex flex-wrap items-center gap-2 border-b border-border-seam pb-3",
|
|
360
|
+
role: "tablist",
|
|
361
|
+
"aria-label": x("collaborationConsole.tabsAria", "Multi-org console sections"),
|
|
362
|
+
children: [
|
|
363
|
+
/* @__PURE__ */ y(d, {
|
|
364
|
+
role: "tab",
|
|
365
|
+
"aria-selected": T === "portfolio",
|
|
366
|
+
variant: T === "portfolio" ? "default" : "outline",
|
|
367
|
+
size: "sm",
|
|
368
|
+
onClick: () => E("portfolio"),
|
|
369
|
+
className: "gap-2",
|
|
370
|
+
"data-testid": "tab-portfolio",
|
|
371
|
+
children: [/* @__PURE__ */ v(me, {
|
|
372
|
+
size: 16,
|
|
373
|
+
"aria-hidden": "true"
|
|
374
|
+
}), x("collaborationConsole.tabPortfolio", "Portfolio & Billing")]
|
|
375
|
+
}),
|
|
376
|
+
/* @__PURE__ */ y(d, {
|
|
377
|
+
role: "tab",
|
|
378
|
+
"aria-selected": T === "shares",
|
|
379
|
+
variant: T === "shares" ? "default" : "outline",
|
|
380
|
+
size: "sm",
|
|
381
|
+
onClick: () => E("shares"),
|
|
382
|
+
className: "gap-2",
|
|
383
|
+
"data-testid": "tab-shares",
|
|
384
|
+
children: [
|
|
385
|
+
/* @__PURE__ */ v(l, {
|
|
386
|
+
size: 16,
|
|
387
|
+
"aria-hidden": "true"
|
|
388
|
+
}),
|
|
389
|
+
x("collaborationConsole.tabShares", "Cross-Workspace Shares"),
|
|
390
|
+
/* @__PURE__ */ v(u, {
|
|
391
|
+
variant: "secondary",
|
|
392
|
+
children: Q.length
|
|
393
|
+
})
|
|
394
|
+
]
|
|
395
|
+
}),
|
|
396
|
+
/* @__PURE__ */ y(d, {
|
|
397
|
+
role: "tab",
|
|
398
|
+
"aria-selected": T === "msp",
|
|
399
|
+
variant: T === "msp" ? "default" : "outline",
|
|
400
|
+
size: "sm",
|
|
401
|
+
onClick: () => E("msp"),
|
|
402
|
+
className: "gap-2",
|
|
403
|
+
"data-testid": "tab-msp",
|
|
404
|
+
children: [
|
|
405
|
+
/* @__PURE__ */ v(_e, {
|
|
406
|
+
size: 16,
|
|
407
|
+
"aria-hidden": "true"
|
|
408
|
+
}),
|
|
409
|
+
x("collaborationConsole.tabMsp", "MSP Org Links"),
|
|
410
|
+
/* @__PURE__ */ v(u, {
|
|
411
|
+
variant: "secondary",
|
|
412
|
+
children: $.length
|
|
413
|
+
})
|
|
414
|
+
]
|
|
415
|
+
})
|
|
416
|
+
]
|
|
417
|
+
}),
|
|
418
|
+
T === "portfolio" && /* @__PURE__ */ y("div", {
|
|
419
|
+
className: "space-y-4",
|
|
420
|
+
"data-testid": "panel-portfolio",
|
|
421
|
+
children: [J.isLoading ? /* @__PURE__ */ v("div", {
|
|
422
|
+
className: "grid grid-cols-1 lg:grid-cols-2 gap-4",
|
|
423
|
+
children: Array.from({ length: 2 }).map((e, t) => /* @__PURE__ */ v(_, { className: "h-48 w-full rounded-card" }, t))
|
|
424
|
+
}) : J.error ? /* @__PURE__ */ v(h, { children: /* @__PURE__ */ y(f, {
|
|
425
|
+
className: "p-6 text-center",
|
|
426
|
+
children: [/* @__PURE__ */ v("p", {
|
|
427
|
+
className: "text-status-error-text font-medium",
|
|
428
|
+
children: x("collaborationConsole.overviewError", "Unable to load multi-org overview")
|
|
429
|
+
}), /* @__PURE__ */ v("p", {
|
|
430
|
+
className: "text-xs text-text-secondary mt-1",
|
|
431
|
+
children: J.error instanceof Error ? J.error.message : ""
|
|
432
|
+
})]
|
|
433
|
+
}) }) : !Z || Z.organizations.length === 0 ? /* @__PURE__ */ v(h, { children: /* @__PURE__ */ y(f, {
|
|
434
|
+
className: "p-8 text-center",
|
|
435
|
+
children: [/* @__PURE__ */ v("p", {
|
|
436
|
+
className: "text-text-primary font-medium",
|
|
437
|
+
children: x("collaborationConsole.emptyPortfolio", "No accessible organizations yet")
|
|
438
|
+
}), /* @__PURE__ */ v("p", {
|
|
439
|
+
className: "text-sm text-text-secondary mt-1",
|
|
440
|
+
children: x("collaborationConsole.emptyPortfolioHint", "Create a workspace or link a client organization to manage multiple tenants from one view.")
|
|
441
|
+
})]
|
|
442
|
+
}) }) : /* @__PURE__ */ v("div", {
|
|
443
|
+
className: "grid grid-cols-1 lg:grid-cols-2 gap-4",
|
|
444
|
+
children: Z.organizations.map((e) => /* @__PURE__ */ y(h, {
|
|
445
|
+
treatment: "insight",
|
|
446
|
+
"data-testid": `org-card-${e.orgId}`,
|
|
447
|
+
children: [/* @__PURE__ */ v(p, {
|
|
448
|
+
className: "pb-2",
|
|
449
|
+
children: /* @__PURE__ */ y("div", {
|
|
450
|
+
className: "flex items-start justify-between gap-2",
|
|
451
|
+
children: [/* @__PURE__ */ y("div", {
|
|
452
|
+
className: "min-w-0",
|
|
453
|
+
children: [/* @__PURE__ */ v(m, {
|
|
454
|
+
className: "text-lg truncate",
|
|
455
|
+
children: e.orgName
|
|
456
|
+
}), /* @__PURE__ */ v("p", {
|
|
457
|
+
className: "text-xs text-text-muted truncate",
|
|
458
|
+
children: e.orgId
|
|
459
|
+
})]
|
|
460
|
+
}), /* @__PURE__ */ y("div", {
|
|
461
|
+
className: "flex items-center gap-2 shrink-0",
|
|
462
|
+
children: [/* @__PURE__ */ v(u, {
|
|
463
|
+
className: e.managedByMsp ? "bg-action-primary-bg/10 text-primary border-action-primary-bg/30" : "bg-surface-secondary text-text-secondary border-border-seam",
|
|
464
|
+
children: e.managedByMsp ? x("collaborationConsole.badgeMspManaged", "MSP Delegated") : x("collaborationConsole.badgeDirect", "Direct Org")
|
|
465
|
+
}), S && /* @__PURE__ */ v(d, {
|
|
466
|
+
size: "sm",
|
|
467
|
+
variant: "outline",
|
|
468
|
+
onClick: () => O(e.orgId),
|
|
469
|
+
children: x("collaborationConsole.inspectOrg", "Summary")
|
|
470
|
+
})]
|
|
471
|
+
})]
|
|
472
|
+
})
|
|
473
|
+
}), /* @__PURE__ */ y(f, {
|
|
474
|
+
className: "space-y-4",
|
|
475
|
+
children: [/* @__PURE__ */ y("div", {
|
|
476
|
+
className: "grid grid-cols-3 gap-2 rounded-lg border border-border-seam bg-surface-secondary/40 p-3 text-xs",
|
|
477
|
+
children: [
|
|
478
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
479
|
+
className: "text-text-muted",
|
|
480
|
+
children: x("collaborationConsole.seatsLabel", "Active Seats")
|
|
481
|
+
}), /* @__PURE__ */ y("p", {
|
|
482
|
+
className: "text-sm font-semibold text-text-primary",
|
|
483
|
+
children: [e.billingSummary.totalActiveSeats, e.billingSummary.monthlySeatBudget ? ` / ${e.billingSummary.monthlySeatBudget}` : ""]
|
|
484
|
+
})] }),
|
|
485
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
486
|
+
className: "text-text-muted",
|
|
487
|
+
children: x("collaborationConsole.projectsLabel", "Projects")
|
|
488
|
+
}), /* @__PURE__ */ v("p", {
|
|
489
|
+
className: "text-sm font-semibold text-text-primary",
|
|
490
|
+
children: e.billingSummary.totalProjects
|
|
491
|
+
})] }),
|
|
492
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
493
|
+
className: "text-text-muted",
|
|
494
|
+
children: x("collaborationConsole.billingModeLabel", "Billing Mode")
|
|
495
|
+
}), /* @__PURE__ */ v("p", {
|
|
496
|
+
className: "text-sm font-semibold text-text-primary",
|
|
497
|
+
children: e.billingSummary.billingMode ?? "DIRECT"
|
|
498
|
+
})] })
|
|
499
|
+
]
|
|
500
|
+
}), /* @__PURE__ */ v("div", {
|
|
501
|
+
className: "space-y-2",
|
|
502
|
+
children: e.workspaces.map((e) => {
|
|
503
|
+
let t = e.id === S;
|
|
504
|
+
return /* @__PURE__ */ y("div", {
|
|
505
|
+
className: "flex items-center justify-between gap-2 rounded-lg border border-border-seam px-3 py-2",
|
|
506
|
+
children: [/* @__PURE__ */ y("div", {
|
|
507
|
+
className: "min-w-0",
|
|
508
|
+
children: [/* @__PURE__ */ v("p", {
|
|
509
|
+
className: "text-sm font-medium text-text-primary truncate",
|
|
510
|
+
children: e.name
|
|
511
|
+
}), /* @__PURE__ */ y("p", {
|
|
512
|
+
className: "text-xs text-text-secondary",
|
|
513
|
+
children: [
|
|
514
|
+
e.memberCount,
|
|
515
|
+
" seats · ",
|
|
516
|
+
e.projectCount,
|
|
517
|
+
" projects ·",
|
|
518
|
+
" ",
|
|
519
|
+
e.activeShareCount,
|
|
520
|
+
" shares"
|
|
521
|
+
]
|
|
522
|
+
})]
|
|
523
|
+
}), /* @__PURE__ */ y("div", {
|
|
524
|
+
className: "flex items-center gap-2 shrink-0",
|
|
525
|
+
children: [/* @__PURE__ */ v(u, {
|
|
526
|
+
className: `text-xs border ${b(e.status)}`,
|
|
527
|
+
children: e.status
|
|
528
|
+
}), t ? /* @__PURE__ */ v(u, {
|
|
529
|
+
variant: "secondary",
|
|
530
|
+
children: x("collaborationConsole.currentWorkspace", "Active")
|
|
531
|
+
}) : /* @__PURE__ */ y(d, {
|
|
532
|
+
size: "sm",
|
|
533
|
+
variant: "outline",
|
|
534
|
+
onClick: () => Ke(e),
|
|
535
|
+
className: "gap-1",
|
|
536
|
+
children: [/* @__PURE__ */ v(de, {
|
|
537
|
+
size: 14,
|
|
538
|
+
"aria-hidden": "true"
|
|
539
|
+
}), x("collaborationConsole.switchButton", "Switch")]
|
|
540
|
+
})]
|
|
541
|
+
})]
|
|
542
|
+
}, e.id);
|
|
543
|
+
})
|
|
544
|
+
})]
|
|
545
|
+
})]
|
|
546
|
+
}, e.orgId))
|
|
547
|
+
}), D && /* @__PURE__ */ y(h, {
|
|
548
|
+
"data-testid": "org-summary-panel",
|
|
549
|
+
children: [/* @__PURE__ */ y(p, {
|
|
550
|
+
className: "flex flex-row items-center justify-between",
|
|
551
|
+
children: [/* @__PURE__ */ y(m, {
|
|
552
|
+
className: "text-base",
|
|
553
|
+
children: [
|
|
554
|
+
x("collaborationConsole.orgDrilldownTitle", "Organization Billing & Access Summary"),
|
|
555
|
+
" ",
|
|
556
|
+
"— ",
|
|
557
|
+
Y.data?.orgName ?? D
|
|
558
|
+
]
|
|
559
|
+
}), /* @__PURE__ */ v(d, {
|
|
560
|
+
size: "sm",
|
|
561
|
+
variant: "outline",
|
|
562
|
+
onClick: () => O(null),
|
|
563
|
+
children: x("collaborationConsole.closeButton", "Close")
|
|
564
|
+
})]
|
|
565
|
+
}), /* @__PURE__ */ v(f, { children: Y.isLoading ? /* @__PURE__ */ v(_, { className: "h-24 w-full" }) : Y.error ? /* @__PURE__ */ v("p", {
|
|
566
|
+
className: "text-sm text-status-error-text",
|
|
567
|
+
children: Y.error instanceof Error ? Y.error.message : "Failed to load summary"
|
|
568
|
+
}) : Y.data ? /* @__PURE__ */ y("div", {
|
|
569
|
+
className: "grid grid-cols-2 sm:grid-cols-5 gap-3 text-sm",
|
|
570
|
+
children: [
|
|
571
|
+
/* @__PURE__ */ y("div", {
|
|
572
|
+
className: "rounded-lg border border-border-seam p-3",
|
|
573
|
+
children: [/* @__PURE__ */ v("p", {
|
|
574
|
+
className: "text-xs text-text-muted",
|
|
575
|
+
children: "Workspaces"
|
|
576
|
+
}), /* @__PURE__ */ v("p", {
|
|
577
|
+
className: "text-lg font-semibold text-text-primary",
|
|
578
|
+
children: Y.data.billingSummary.totalWorkspaces
|
|
579
|
+
})]
|
|
580
|
+
}),
|
|
581
|
+
/* @__PURE__ */ y("div", {
|
|
582
|
+
className: "rounded-lg border border-border-seam p-3",
|
|
583
|
+
children: [/* @__PURE__ */ v("p", {
|
|
584
|
+
className: "text-xs text-text-muted",
|
|
585
|
+
children: "Active Seats"
|
|
586
|
+
}), /* @__PURE__ */ v("p", {
|
|
587
|
+
className: "text-lg font-semibold text-text-primary",
|
|
588
|
+
children: Y.data.billingSummary.totalActiveSeats
|
|
589
|
+
})]
|
|
590
|
+
}),
|
|
591
|
+
/* @__PURE__ */ y("div", {
|
|
592
|
+
className: "rounded-lg border border-border-seam p-3",
|
|
593
|
+
children: [/* @__PURE__ */ v("p", {
|
|
594
|
+
className: "text-xs text-text-muted",
|
|
595
|
+
children: "Resources"
|
|
596
|
+
}), /* @__PURE__ */ v("p", {
|
|
597
|
+
className: "text-lg font-semibold text-text-primary",
|
|
598
|
+
children: Y.data.billingSummary.totalResources
|
|
599
|
+
})]
|
|
600
|
+
}),
|
|
601
|
+
/* @__PURE__ */ y("div", {
|
|
602
|
+
className: "rounded-lg border border-border-seam p-3",
|
|
603
|
+
children: [/* @__PURE__ */ v("p", {
|
|
604
|
+
className: "text-xs text-text-muted",
|
|
605
|
+
children: "Products"
|
|
606
|
+
}), /* @__PURE__ */ v("p", {
|
|
607
|
+
className: "text-lg font-semibold text-text-primary",
|
|
608
|
+
children: Y.data.billingSummary.subscribedProductCount
|
|
609
|
+
})]
|
|
610
|
+
}),
|
|
611
|
+
/* @__PURE__ */ y("div", {
|
|
612
|
+
className: "rounded-lg border border-border-seam p-3",
|
|
613
|
+
children: [/* @__PURE__ */ v("p", {
|
|
614
|
+
className: "text-xs text-text-muted",
|
|
615
|
+
children: "Seat Utilization"
|
|
616
|
+
}), /* @__PURE__ */ v("p", {
|
|
617
|
+
className: "text-lg font-semibold text-text-primary",
|
|
618
|
+
children: Y.data.billingSummary.seatUtilizationPercent !== null && Y.data.billingSummary.seatUtilizationPercent !== void 0 ? `${Y.data.billingSummary.seatUtilizationPercent}%` : "Unbounded"
|
|
619
|
+
})]
|
|
620
|
+
})
|
|
621
|
+
]
|
|
622
|
+
}) : null })]
|
|
623
|
+
})]
|
|
624
|
+
}),
|
|
625
|
+
T === "shares" && /* @__PURE__ */ y("div", {
|
|
626
|
+
className: "space-y-4",
|
|
627
|
+
"data-testid": "panel-shares",
|
|
628
|
+
children: [Fe && /* @__PURE__ */ y(h, { children: [/* @__PURE__ */ v(p, { children: /* @__PURE__ */ v(m, {
|
|
629
|
+
className: "text-base",
|
|
630
|
+
children: x("collaborationConsole.createShareTitle", "Offer Cross-Workspace Share")
|
|
631
|
+
}) }), /* @__PURE__ */ v(f, { children: /* @__PURE__ */ y("form", {
|
|
632
|
+
onSubmit: (e) => void Je(e),
|
|
633
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
634
|
+
children: [
|
|
635
|
+
/* @__PURE__ */ y("div", {
|
|
636
|
+
className: "space-y-1",
|
|
637
|
+
children: [/* @__PURE__ */ v("label", {
|
|
638
|
+
className: "text-xs font-medium text-text-secondary",
|
|
639
|
+
htmlFor: "share-target-ws",
|
|
640
|
+
children: x("collaborationConsole.targetWorkspaceLabel", "Target Workspace ID *")
|
|
641
|
+
}), /* @__PURE__ */ v(g, {
|
|
642
|
+
id: "share-target-ws",
|
|
643
|
+
value: Ie,
|
|
644
|
+
onChange: (e) => Le(e.target.value),
|
|
645
|
+
placeholder: "UUID of partner workspace",
|
|
646
|
+
required: !0
|
|
647
|
+
})]
|
|
648
|
+
}),
|
|
649
|
+
/* @__PURE__ */ y("div", {
|
|
650
|
+
className: "space-y-1",
|
|
651
|
+
children: [/* @__PURE__ */ v("label", {
|
|
652
|
+
className: "text-xs font-medium text-text-secondary",
|
|
653
|
+
htmlFor: "share-resource-type",
|
|
654
|
+
children: x("collaborationConsole.resourceTypeLabel", "Resource Kind *")
|
|
655
|
+
}), /* @__PURE__ */ v("select", {
|
|
656
|
+
id: "share-resource-type",
|
|
657
|
+
value: A,
|
|
658
|
+
onChange: (e) => Re(e.target.value),
|
|
659
|
+
className: "w-full h-10 rounded-md border border-border-seam bg-surface-primary px-3 text-sm text-text-primary",
|
|
660
|
+
children: ke.map((e) => /* @__PURE__ */ v("option", {
|
|
661
|
+
value: e.value,
|
|
662
|
+
children: e.label
|
|
663
|
+
}, e.value))
|
|
664
|
+
})]
|
|
665
|
+
}),
|
|
666
|
+
/* @__PURE__ */ y("div", {
|
|
667
|
+
className: "space-y-1",
|
|
668
|
+
children: [/* @__PURE__ */ v("label", {
|
|
669
|
+
className: "text-xs font-medium text-text-secondary",
|
|
670
|
+
htmlFor: "share-resource-id",
|
|
671
|
+
children: x("collaborationConsole.resourceIdLabel", "Resource ID *")
|
|
672
|
+
}), /* @__PURE__ */ v(g, {
|
|
673
|
+
id: "share-resource-id",
|
|
674
|
+
value: j,
|
|
675
|
+
onChange: (e) => M(e.target.value),
|
|
676
|
+
placeholder: "Project ID, Channel ID, or * for Mentions",
|
|
677
|
+
required: !0
|
|
678
|
+
})]
|
|
679
|
+
}),
|
|
680
|
+
/* @__PURE__ */ y("div", {
|
|
681
|
+
className: "space-y-1",
|
|
682
|
+
children: [/* @__PURE__ */ v("label", {
|
|
683
|
+
className: "text-xs font-medium text-text-secondary",
|
|
684
|
+
htmlFor: "share-resource-name",
|
|
685
|
+
children: x("collaborationConsole.resourceNameLabel", "Display Name *")
|
|
686
|
+
}), /* @__PURE__ */ v(g, {
|
|
687
|
+
id: "share-resource-name",
|
|
688
|
+
value: N,
|
|
689
|
+
onChange: (e) => P(e.target.value),
|
|
690
|
+
placeholder: "e.g. #agency-delivery or Q4 Launch Project",
|
|
691
|
+
required: !0
|
|
692
|
+
})]
|
|
693
|
+
}),
|
|
694
|
+
/* @__PURE__ */ y("div", {
|
|
695
|
+
className: "space-y-1",
|
|
696
|
+
children: [/* @__PURE__ */ v("label", {
|
|
697
|
+
className: "text-xs font-medium text-text-secondary",
|
|
698
|
+
htmlFor: "share-access-level",
|
|
699
|
+
children: x("collaborationConsole.accessLevelLabel", "Access Level")
|
|
700
|
+
}), /* @__PURE__ */ v("select", {
|
|
701
|
+
id: "share-access-level",
|
|
702
|
+
value: F,
|
|
703
|
+
onChange: (e) => ze(e.target.value),
|
|
704
|
+
className: "w-full h-10 rounded-md border border-border-seam bg-surface-primary px-3 text-sm text-text-primary",
|
|
705
|
+
children: Ae.map((e) => /* @__PURE__ */ v("option", {
|
|
706
|
+
value: e.value,
|
|
707
|
+
children: e.label
|
|
708
|
+
}, e.value))
|
|
709
|
+
})]
|
|
710
|
+
}),
|
|
711
|
+
/* @__PURE__ */ y("div", {
|
|
712
|
+
className: "flex items-end gap-2",
|
|
713
|
+
children: [/* @__PURE__ */ v(d, {
|
|
714
|
+
type: "submit",
|
|
715
|
+
disabled: X.createShare.isPending,
|
|
716
|
+
children: X.createShare.isPending ? "Sending..." : "Send Share Offer"
|
|
717
|
+
}), /* @__PURE__ */ v(d, {
|
|
718
|
+
type: "button",
|
|
719
|
+
variant: "outline",
|
|
720
|
+
onClick: () => k(!1),
|
|
721
|
+
children: "Cancel"
|
|
722
|
+
})]
|
|
723
|
+
})
|
|
724
|
+
]
|
|
725
|
+
}) })] }), We.isLoading ? /* @__PURE__ */ v(_, { className: "h-32 w-full rounded-card" }) : Q.length === 0 ? /* @__PURE__ */ v(h, { children: /* @__PURE__ */ y(f, {
|
|
726
|
+
className: "p-8 text-center",
|
|
727
|
+
children: [/* @__PURE__ */ v("p", {
|
|
728
|
+
className: "text-text-primary font-medium",
|
|
729
|
+
children: x("collaborationConsole.noShares", "No cross-workspace shares yet")
|
|
730
|
+
}), /* @__PURE__ */ v("p", {
|
|
731
|
+
className: "text-sm text-text-secondary mt-1",
|
|
732
|
+
children: x("collaborationConsole.noSharesHint", "Share a channel, project, or cross-workspace mentions with a partner workspace. Target consent is always required.")
|
|
733
|
+
})]
|
|
734
|
+
}) }) : /* @__PURE__ */ v("div", {
|
|
735
|
+
className: "space-y-3",
|
|
736
|
+
children: Q.map((e) => {
|
|
737
|
+
let t = e.targetWorkspaceId === S;
|
|
738
|
+
return /* @__PURE__ */ v(h, {
|
|
739
|
+
treatment: "insight",
|
|
740
|
+
children: /* @__PURE__ */ y(f, {
|
|
741
|
+
className: "p-4 flex flex-col sm:flex-row sm:items-center justify-between gap-3",
|
|
742
|
+
children: [/* @__PURE__ */ y("div", {
|
|
743
|
+
className: "space-y-1 min-w-0",
|
|
744
|
+
children: [/* @__PURE__ */ y("div", {
|
|
745
|
+
className: "flex flex-wrap items-center gap-2",
|
|
746
|
+
children: [
|
|
747
|
+
/* @__PURE__ */ v(u, {
|
|
748
|
+
variant: "secondary",
|
|
749
|
+
children: e.resourceType
|
|
750
|
+
}),
|
|
751
|
+
/* @__PURE__ */ v("span", {
|
|
752
|
+
className: "font-semibold text-text-primary truncate",
|
|
753
|
+
children: e.resourceName
|
|
754
|
+
}),
|
|
755
|
+
/* @__PURE__ */ v(u, {
|
|
756
|
+
className: `text-xs border ${b(e.status)}`,
|
|
757
|
+
children: e.status
|
|
758
|
+
}),
|
|
759
|
+
/* @__PURE__ */ v(u, {
|
|
760
|
+
variant: "outline",
|
|
761
|
+
children: e.accessLevel
|
|
762
|
+
})
|
|
763
|
+
]
|
|
764
|
+
}), /* @__PURE__ */ y("p", {
|
|
765
|
+
className: "text-xs text-text-secondary",
|
|
766
|
+
children: [
|
|
767
|
+
t ? "Inbound from " : "Outbound to ",
|
|
768
|
+
/* @__PURE__ */ v("span", {
|
|
769
|
+
className: "font-medium text-text-primary",
|
|
770
|
+
children: t ? e.sourceWorkspaceName ?? e.workspaceId : e.targetWorkspaceName ?? e.targetWorkspaceId
|
|
771
|
+
}),
|
|
772
|
+
" ",
|
|
773
|
+
"· Consent scope: ",
|
|
774
|
+
/* @__PURE__ */ v("code", { children: e.consentScope })
|
|
775
|
+
]
|
|
776
|
+
})]
|
|
777
|
+
}), /* @__PURE__ */ y("div", {
|
|
778
|
+
className: "flex items-center gap-2 shrink-0",
|
|
779
|
+
children: [t && e.status === le.Pending && /* @__PURE__ */ y(d, {
|
|
780
|
+
size: "sm",
|
|
781
|
+
onClick: () => void Ye(e.id),
|
|
782
|
+
disabled: X.acceptShare.isPending,
|
|
783
|
+
className: "gap-1",
|
|
784
|
+
children: [/* @__PURE__ */ v(pe, {
|
|
785
|
+
size: 14,
|
|
786
|
+
"aria-hidden": "true"
|
|
787
|
+
}), "Accept Consent"]
|
|
788
|
+
}), e.status !== le.Revoked && /* @__PURE__ */ y(d, {
|
|
789
|
+
size: "sm",
|
|
790
|
+
variant: "outline",
|
|
791
|
+
onClick: () => void Xe(e.id),
|
|
792
|
+
disabled: X.revokeShare.isPending,
|
|
793
|
+
className: "gap-1 text-status-error-text",
|
|
794
|
+
children: [/* @__PURE__ */ v(Ce, {
|
|
795
|
+
size: 14,
|
|
796
|
+
"aria-hidden": "true"
|
|
797
|
+
}), "Revoke"]
|
|
798
|
+
})]
|
|
799
|
+
})]
|
|
800
|
+
})
|
|
801
|
+
}, e.id);
|
|
802
|
+
})
|
|
803
|
+
})]
|
|
804
|
+
}),
|
|
805
|
+
T === "msp" && /* @__PURE__ */ y("div", {
|
|
806
|
+
className: "space-y-4",
|
|
807
|
+
"data-testid": "panel-msp",
|
|
808
|
+
children: [Be && /* @__PURE__ */ y(h, { children: [/* @__PURE__ */ v(p, { children: /* @__PURE__ */ v(m, {
|
|
809
|
+
className: "text-base",
|
|
810
|
+
children: x("collaborationConsole.createMspTitle", "Propose MSP Organization Link")
|
|
811
|
+
}) }), /* @__PURE__ */ v(f, { children: /* @__PURE__ */ y("form", {
|
|
812
|
+
onSubmit: (e) => void Ze(e),
|
|
813
|
+
className: "space-y-4",
|
|
814
|
+
children: [
|
|
815
|
+
/* @__PURE__ */ y("div", {
|
|
816
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
817
|
+
children: [
|
|
818
|
+
/* @__PURE__ */ y("div", {
|
|
819
|
+
className: "space-y-1",
|
|
820
|
+
children: [/* @__PURE__ */ v("label", {
|
|
821
|
+
className: "text-xs font-medium text-text-secondary",
|
|
822
|
+
htmlFor: "msp-client-org-id",
|
|
823
|
+
children: "Client Organization ID *"
|
|
824
|
+
}), /* @__PURE__ */ v(g, {
|
|
825
|
+
id: "msp-client-org-id",
|
|
826
|
+
value: L,
|
|
827
|
+
onChange: (e) => R(e.target.value),
|
|
828
|
+
placeholder: "UUID of client organization",
|
|
829
|
+
required: !0
|
|
830
|
+
})]
|
|
831
|
+
}),
|
|
832
|
+
/* @__PURE__ */ y("div", {
|
|
833
|
+
className: "space-y-1",
|
|
834
|
+
children: [/* @__PURE__ */ v("label", {
|
|
835
|
+
className: "text-xs font-medium text-text-secondary",
|
|
836
|
+
htmlFor: "msp-client-org-name",
|
|
837
|
+
children: "Client Organization Name *"
|
|
838
|
+
}), /* @__PURE__ */ v(g, {
|
|
839
|
+
id: "msp-client-org-name",
|
|
840
|
+
value: z,
|
|
841
|
+
onChange: (e) => B(e.target.value),
|
|
842
|
+
placeholder: "e.g. Acme Client Corp",
|
|
843
|
+
required: !0
|
|
844
|
+
})]
|
|
845
|
+
}),
|
|
846
|
+
/* @__PURE__ */ y("div", {
|
|
847
|
+
className: "space-y-1",
|
|
848
|
+
children: [/* @__PURE__ */ v("label", {
|
|
849
|
+
className: "text-xs font-medium text-text-secondary",
|
|
850
|
+
htmlFor: "msp-client-ws",
|
|
851
|
+
children: "Primary Client Workspace ID (Optional)"
|
|
852
|
+
}), /* @__PURE__ */ v(g, {
|
|
853
|
+
id: "msp-client-ws",
|
|
854
|
+
value: V,
|
|
855
|
+
onChange: (e) => H(e.target.value),
|
|
856
|
+
placeholder: "Optional workspace UUID"
|
|
857
|
+
})]
|
|
858
|
+
}),
|
|
859
|
+
/* @__PURE__ */ y("div", {
|
|
860
|
+
className: "space-y-1",
|
|
861
|
+
children: [/* @__PURE__ */ v("label", {
|
|
862
|
+
className: "text-xs font-medium text-text-secondary",
|
|
863
|
+
htmlFor: "msp-billing-mode",
|
|
864
|
+
children: "Billing Aggregation Mode"
|
|
865
|
+
}), /* @__PURE__ */ v("select", {
|
|
866
|
+
id: "msp-billing-mode",
|
|
867
|
+
value: U,
|
|
868
|
+
onChange: (e) => Ve(e.target.value),
|
|
869
|
+
className: "w-full h-10 rounded-md border border-border-seam bg-surface-primary px-3 text-sm text-text-primary",
|
|
870
|
+
children: je.map((e) => /* @__PURE__ */ v("option", {
|
|
871
|
+
value: e.value,
|
|
872
|
+
children: e.label
|
|
873
|
+
}, e.value))
|
|
874
|
+
})]
|
|
875
|
+
}),
|
|
876
|
+
/* @__PURE__ */ y("div", {
|
|
877
|
+
className: "space-y-1",
|
|
878
|
+
children: [/* @__PURE__ */ v("label", {
|
|
879
|
+
className: "text-xs font-medium text-text-secondary",
|
|
880
|
+
htmlFor: "msp-seat-budget",
|
|
881
|
+
children: "Monthly Seat Budget (Optional)"
|
|
882
|
+
}), /* @__PURE__ */ v(g, {
|
|
883
|
+
id: "msp-seat-budget",
|
|
884
|
+
type: "number",
|
|
885
|
+
min: 1,
|
|
886
|
+
value: W,
|
|
887
|
+
onChange: (e) => G(e.target.value),
|
|
888
|
+
placeholder: "e.g. 50"
|
|
889
|
+
})]
|
|
890
|
+
}),
|
|
891
|
+
/* @__PURE__ */ y("div", {
|
|
892
|
+
className: "space-y-1",
|
|
893
|
+
children: [/* @__PURE__ */ v("label", {
|
|
894
|
+
className: "text-xs font-medium text-text-secondary",
|
|
895
|
+
htmlFor: "msp-notes",
|
|
896
|
+
children: "Agreement Notes"
|
|
897
|
+
}), /* @__PURE__ */ v(g, {
|
|
898
|
+
id: "msp-notes",
|
|
899
|
+
value: K,
|
|
900
|
+
onChange: (e) => He(e.target.value),
|
|
901
|
+
placeholder: "Optional MSP engagement reference"
|
|
902
|
+
})]
|
|
903
|
+
})
|
|
904
|
+
]
|
|
905
|
+
}),
|
|
906
|
+
/* @__PURE__ */ y("div", {
|
|
907
|
+
className: "space-y-2",
|
|
908
|
+
children: [/* @__PURE__ */ v("p", {
|
|
909
|
+
className: "text-xs font-medium text-text-secondary",
|
|
910
|
+
children: "Delegated Permission Scopes *"
|
|
911
|
+
}), /* @__PURE__ */ v("div", {
|
|
912
|
+
className: "flex flex-wrap gap-2",
|
|
913
|
+
children: Oe.map((e) => {
|
|
914
|
+
let t = q.includes(e.value);
|
|
915
|
+
return /* @__PURE__ */ v(d, {
|
|
916
|
+
type: "button",
|
|
917
|
+
size: "sm",
|
|
918
|
+
variant: t ? "default" : "outline",
|
|
919
|
+
onClick: () => qe(e.value),
|
|
920
|
+
children: e.label
|
|
921
|
+
}, e.value);
|
|
922
|
+
})
|
|
923
|
+
})]
|
|
924
|
+
}),
|
|
925
|
+
/* @__PURE__ */ y("div", {
|
|
926
|
+
className: "flex items-center gap-2",
|
|
927
|
+
children: [/* @__PURE__ */ v(d, {
|
|
928
|
+
type: "submit",
|
|
929
|
+
disabled: X.createMspLink.isPending,
|
|
930
|
+
children: X.createMspLink.isPending ? "Proposing..." : "Propose MSP Link"
|
|
931
|
+
}), /* @__PURE__ */ v(d, {
|
|
932
|
+
type: "button",
|
|
933
|
+
variant: "outline",
|
|
934
|
+
onClick: () => I(!1),
|
|
935
|
+
children: "Cancel"
|
|
936
|
+
})]
|
|
937
|
+
})
|
|
938
|
+
]
|
|
939
|
+
}) })] }), Ge.isLoading ? /* @__PURE__ */ v(_, { className: "h-32 w-full rounded-card" }) : $.length === 0 ? /* @__PURE__ */ v(h, { children: /* @__PURE__ */ y(f, {
|
|
940
|
+
className: "p-8 text-center",
|
|
941
|
+
children: [/* @__PURE__ */ v("p", {
|
|
942
|
+
className: "text-text-primary font-medium",
|
|
943
|
+
children: x("collaborationConsole.noMspLinks", "No MSP organization links yet")
|
|
944
|
+
}), /* @__PURE__ */ v("p", {
|
|
945
|
+
className: "text-sm text-text-secondary mt-1",
|
|
946
|
+
children: x("collaborationConsole.noMspLinksHint", "Link managed client organizations to oversee workspaces, delegated roles, and consolidated seat usage from one console.")
|
|
947
|
+
})]
|
|
948
|
+
}) }) : /* @__PURE__ */ v("div", {
|
|
949
|
+
className: "space-y-3",
|
|
950
|
+
children: $.map((e) => {
|
|
951
|
+
let t = !!(Me && e.clientOrgId === Me);
|
|
952
|
+
return /* @__PURE__ */ v(h, {
|
|
953
|
+
treatment: "insight",
|
|
954
|
+
children: /* @__PURE__ */ y(f, {
|
|
955
|
+
className: "p-4 flex flex-col sm:flex-row sm:items-center justify-between gap-3",
|
|
956
|
+
children: [/* @__PURE__ */ y("div", {
|
|
957
|
+
className: "space-y-1 min-w-0",
|
|
958
|
+
children: [
|
|
959
|
+
/* @__PURE__ */ y("div", {
|
|
960
|
+
className: "flex flex-wrap items-center gap-2",
|
|
961
|
+
children: [
|
|
962
|
+
/* @__PURE__ */ v("span", {
|
|
963
|
+
className: "font-semibold text-text-primary",
|
|
964
|
+
children: e.clientOrgName
|
|
965
|
+
}),
|
|
966
|
+
/* @__PURE__ */ v(u, {
|
|
967
|
+
className: `text-xs border ${b(e.status)}`,
|
|
968
|
+
children: e.status
|
|
969
|
+
}),
|
|
970
|
+
/* @__PURE__ */ v(u, {
|
|
971
|
+
variant: "outline",
|
|
972
|
+
children: e.billingMode
|
|
973
|
+
}),
|
|
974
|
+
e.monthlySeatBudget ? /* @__PURE__ */ y(u, {
|
|
975
|
+
variant: "secondary",
|
|
976
|
+
children: [
|
|
977
|
+
"Budget: ",
|
|
978
|
+
e.monthlySeatBudget,
|
|
979
|
+
" seats"
|
|
980
|
+
]
|
|
981
|
+
}) : null
|
|
982
|
+
]
|
|
983
|
+
}),
|
|
984
|
+
/* @__PURE__ */ y("p", {
|
|
985
|
+
className: "text-xs text-text-secondary",
|
|
986
|
+
children: [
|
|
987
|
+
"MSP Org: ",
|
|
988
|
+
/* @__PURE__ */ v("code", { children: e.mspOrgId }),
|
|
989
|
+
" → Client Org:",
|
|
990
|
+
" ",
|
|
991
|
+
/* @__PURE__ */ v("code", { children: e.clientOrgId })
|
|
992
|
+
]
|
|
993
|
+
}),
|
|
994
|
+
/* @__PURE__ */ v("div", {
|
|
995
|
+
className: "flex flex-wrap gap-1 pt-1",
|
|
996
|
+
children: e.delegatedScopes.map((e) => /* @__PURE__ */ v(u, {
|
|
997
|
+
variant: "secondary",
|
|
998
|
+
className: "text-xs",
|
|
999
|
+
children: e
|
|
1000
|
+
}, e))
|
|
1001
|
+
})
|
|
1002
|
+
]
|
|
1003
|
+
}), /* @__PURE__ */ y("div", {
|
|
1004
|
+
className: "flex flex-wrap items-center gap-2 shrink-0",
|
|
1005
|
+
children: [
|
|
1006
|
+
t && e.status === a.Pending && /* @__PURE__ */ y(d, {
|
|
1007
|
+
size: "sm",
|
|
1008
|
+
onClick: () => void Qe(e.id),
|
|
1009
|
+
disabled: X.approveMspLink.isPending,
|
|
1010
|
+
className: "gap-1",
|
|
1011
|
+
children: [/* @__PURE__ */ v(pe, {
|
|
1012
|
+
size: 14,
|
|
1013
|
+
"aria-hidden": "true"
|
|
1014
|
+
}), "Approve Link"]
|
|
1015
|
+
}),
|
|
1016
|
+
e.status === a.Active && /* @__PURE__ */ y(d, {
|
|
1017
|
+
size: "sm",
|
|
1018
|
+
variant: "outline",
|
|
1019
|
+
onClick: () => void $e(e.id, a.Suspended),
|
|
1020
|
+
disabled: X.updateMspLink.isPending,
|
|
1021
|
+
className: "gap-1",
|
|
1022
|
+
children: [/* @__PURE__ */ v(ve, {
|
|
1023
|
+
size: 14,
|
|
1024
|
+
"aria-hidden": "true"
|
|
1025
|
+
}), "Suspend"]
|
|
1026
|
+
}),
|
|
1027
|
+
t && e.status === a.Suspended && /* @__PURE__ */ y(d, {
|
|
1028
|
+
size: "sm",
|
|
1029
|
+
variant: "outline",
|
|
1030
|
+
onClick: () => void $e(e.id, a.Active),
|
|
1031
|
+
disabled: X.updateMspLink.isPending,
|
|
1032
|
+
className: "gap-1",
|
|
1033
|
+
children: [/* @__PURE__ */ v(ye, {
|
|
1034
|
+
size: 14,
|
|
1035
|
+
"aria-hidden": "true"
|
|
1036
|
+
}), "Resume"]
|
|
1037
|
+
}),
|
|
1038
|
+
e.status !== a.Revoked && /* @__PURE__ */ y(d, {
|
|
1039
|
+
size: "sm",
|
|
1040
|
+
variant: "outline",
|
|
1041
|
+
onClick: () => void et(e.id),
|
|
1042
|
+
disabled: X.revokeMspLink.isPending,
|
|
1043
|
+
className: "gap-1 text-status-error-text",
|
|
1044
|
+
children: [/* @__PURE__ */ v(Ce, {
|
|
1045
|
+
size: 14,
|
|
1046
|
+
"aria-hidden": "true"
|
|
1047
|
+
}), "Revoke"]
|
|
1048
|
+
})
|
|
1049
|
+
]
|
|
1050
|
+
})]
|
|
1051
|
+
})
|
|
1052
|
+
}, e.id);
|
|
1053
|
+
})
|
|
1054
|
+
})]
|
|
1055
|
+
})
|
|
1056
|
+
]
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1059
|
+
export { x as CollaborationConsolePage };
|