@burdenoff/microfe-workspaces 2026.601.3 → 2026.601.4
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.
|
@@ -11,18 +11,18 @@ import { useWorkspaceRoles as oe } from "../hooks/useWorkspaceRoles.js";
|
|
|
11
11
|
import { useProjects as se } from "../hooks/useProjects.js";
|
|
12
12
|
import { downloadWorkspaceBulkInviteTemplate as ce, parseWorkspaceBulkInviteCsv as le } from "../utils/workspaceBulkInviteCsv.js";
|
|
13
13
|
import { useMemo as s, useRef as ue, useState as c } from "react";
|
|
14
|
-
import { AlertCircle as
|
|
15
|
-
import { PermissionProvider as
|
|
16
|
-
import { Fragment as
|
|
17
|
-
import { AlertDialog as
|
|
18
|
-
import { useNavigate as
|
|
19
|
-
import { useI18n as
|
|
14
|
+
import { AlertCircle as de, ArrowLeft as fe, CheckCircle2 as l, Download as pe, Loader2 as u, Mail as me, RefreshCw as he, Send as ge, Upload as _e, UserPlus as ve, XCircle as d } from "lucide-react";
|
|
15
|
+
import { PermissionProvider as ye } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
16
|
+
import { Fragment as be, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
17
|
+
import { AlertDialog as xe, AlertDialogAction as Se, AlertDialogCancel as Ce, AlertDialogContent as we, AlertDialogDescription as Te, AlertDialogFooter as Ee, AlertDialogHeader as De, AlertDialogTitle as Oe, Badge as m, Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Checkbox as b, Input as ke, Skeleton as x, Tabs as Ae, TabsContent as je, TabsList as Me, TabsTrigger as Ne, Tooltip as S, TooltipContent as C, TooltipProvider as Pe, TooltipTrigger as w } from "@burdenoff/fe-libs/ui";
|
|
18
|
+
import { useNavigate as Fe, useParams as Ie } from "react-router-dom";
|
|
19
|
+
import { useI18n as Le } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
20
20
|
//#region src/pages/WorkspaceInvitePage.tsx
|
|
21
|
-
var
|
|
22
|
-
function
|
|
21
|
+
var Re = 1024 * 1024, T = 500;
|
|
22
|
+
function ze(e) {
|
|
23
23
|
return e.type === "text/csv" || e.name.toLowerCase().endsWith(".csv");
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Be(e) {
|
|
26
26
|
if (!e) return null;
|
|
27
27
|
let t = new Date(e);
|
|
28
28
|
return Number.isNaN(t.getTime()) ? null : t.toLocaleDateString(void 0, {
|
|
@@ -33,14 +33,14 @@ function ze(e) {
|
|
|
33
33
|
minute: "2-digit"
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function E(e) {
|
|
37
37
|
let t = e instanceof Error ? e.message : String(e);
|
|
38
38
|
return t.includes("CONFLICT") ? "An invite already exists for this email address." : t.includes("already a member") ? "This user is already a member of the workspace." : "Something went wrong. Please try again or contact support.";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Ve(e, t, n) {
|
|
41
41
|
return e.length === 0 ? t : e.map((e) => n ? n(e) : e).join(", ");
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function He(e, t, n, r) {
|
|
44
44
|
return {
|
|
45
45
|
email: t,
|
|
46
46
|
workspaceId: e,
|
|
@@ -51,62 +51,62 @@ function Ve(e, t, n, r) {
|
|
|
51
51
|
} } : {}
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return /* @__PURE__ */
|
|
54
|
+
function Ue({ selectedRoleIds: e, onRoleToggle: t, selectedProjectIds: n, onProjectToggle: r, availableRoles: i, availableProjects: a, isLoadingRoles: ee, isLoadingProjects: te, disabled: o }) {
|
|
55
|
+
return /* @__PURE__ */ p("div", {
|
|
56
56
|
className: "space-y-6",
|
|
57
|
-
children: [/* @__PURE__ */
|
|
57
|
+
children: [/* @__PURE__ */ p("div", {
|
|
58
58
|
className: "space-y-3",
|
|
59
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ p("div", {
|
|
60
60
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
61
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ p("div", {
|
|
62
62
|
className: "space-y-1",
|
|
63
|
-
children: [/* @__PURE__ */
|
|
63
|
+
children: [/* @__PURE__ */ f("h3", {
|
|
64
64
|
className: "text-base font-semibold",
|
|
65
65
|
children: "Roles (Optional)"
|
|
66
|
-
}), /* @__PURE__ */
|
|
66
|
+
}), /* @__PURE__ */ f("p", {
|
|
67
67
|
className: "text-sm text-muted-foreground",
|
|
68
68
|
children: "Choose roles. Hover any role to preview its full description."
|
|
69
69
|
})]
|
|
70
|
-
}), e.length > 0 ? /* @__PURE__ */ m
|
|
70
|
+
}), e.length > 0 ? /* @__PURE__ */ p(m, {
|
|
71
71
|
variant: "secondary",
|
|
72
72
|
children: [e.length, " selected"]
|
|
73
73
|
}) : null]
|
|
74
|
-
}), /* @__PURE__ */
|
|
74
|
+
}), /* @__PURE__ */ f(Pe, { children: /* @__PURE__ */ f("div", {
|
|
75
75
|
className: "grid grid-cols-1 gap-2 md:grid-cols-2 xl:grid-cols-3",
|
|
76
|
-
children: ee ? /* @__PURE__ */
|
|
76
|
+
children: ee ? /* @__PURE__ */ f("p", {
|
|
77
77
|
className: "text-sm text-muted-foreground",
|
|
78
78
|
children: "Loading roles…"
|
|
79
|
-
}) : i.length === 0 ? /* @__PURE__ */
|
|
79
|
+
}) : i.length === 0 ? /* @__PURE__ */ f("p", {
|
|
80
80
|
className: "text-sm text-muted-foreground",
|
|
81
81
|
children: "No assignable roles were returned for this workspace."
|
|
82
82
|
}) : i.map((n) => {
|
|
83
83
|
let r = e.includes(n.id);
|
|
84
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ p(S, { children: [/* @__PURE__ */ f(w, {
|
|
85
85
|
asChild: !0,
|
|
86
|
-
children: /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ p("label", {
|
|
87
87
|
className: `flex cursor-pointer items-center justify-between gap-3 rounded-lg border px-3 py-3 text-left text-sm font-medium transition-colors focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 ${r ? "border-primary bg-primary/10 text-foreground shadow-sm" : "border-border bg-background text-foreground hover:bg-accent"} ${o ? "opacity-70" : ""}`,
|
|
88
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ f("span", {
|
|
89
89
|
className: "min-w-0 flex-1 truncate",
|
|
90
90
|
children: n.name
|
|
91
|
-
}), /* @__PURE__ */
|
|
91
|
+
}), /* @__PURE__ */ f(b, {
|
|
92
92
|
checked: r,
|
|
93
93
|
disabled: o,
|
|
94
94
|
onCheckedChange: (e) => t(n.id, !!e),
|
|
95
95
|
"aria-label": `Select ${n.name}`
|
|
96
96
|
})]
|
|
97
97
|
})
|
|
98
|
-
}), /* @__PURE__ */
|
|
98
|
+
}), /* @__PURE__ */ p(C, {
|
|
99
99
|
className: "max-w-xs text-sm leading-6",
|
|
100
100
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ f("p", {
|
|
102
102
|
className: "font-medium",
|
|
103
103
|
children: n.name
|
|
104
104
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ f("p", {
|
|
106
106
|
className: "mt-1 text-muted-foreground",
|
|
107
107
|
children: n.description || "No description available for this role."
|
|
108
108
|
}),
|
|
109
|
-
n.isSystem ? /* @__PURE__ */
|
|
109
|
+
n.isSystem ? /* @__PURE__ */ f("p", {
|
|
110
110
|
className: "mt-2 text-xs",
|
|
111
111
|
children: "System role"
|
|
112
112
|
}) : null
|
|
@@ -114,51 +114,51 @@ function He({ selectedRoleIds: e, onRoleToggle: t, selectedProjectIds: n, onProj
|
|
|
114
114
|
})] }, n.id);
|
|
115
115
|
})
|
|
116
116
|
}) })]
|
|
117
|
-
}), /* @__PURE__ */
|
|
117
|
+
}), /* @__PURE__ */ p("div", {
|
|
118
118
|
className: "space-y-3",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ p("div", {
|
|
120
120
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
121
|
+
children: [/* @__PURE__ */ p("div", {
|
|
122
122
|
className: "space-y-1",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ f("h3", {
|
|
124
124
|
className: "text-base font-semibold",
|
|
125
125
|
children: "Projects to add on acceptance (Optional)"
|
|
126
|
-
}), /* @__PURE__ */
|
|
126
|
+
}), /* @__PURE__ */ f("p", {
|
|
127
127
|
className: "text-sm text-muted-foreground",
|
|
128
128
|
children: "The invited user will be added to these projects automatically after they accept."
|
|
129
129
|
})]
|
|
130
|
-
}), n.length > 0 ? /* @__PURE__ */ m
|
|
130
|
+
}), n.length > 0 ? /* @__PURE__ */ p(m, {
|
|
131
131
|
variant: "secondary",
|
|
132
132
|
children: [n.length, " selected"]
|
|
133
133
|
}) : null]
|
|
134
|
-
}), /* @__PURE__ */
|
|
134
|
+
}), /* @__PURE__ */ f("div", {
|
|
135
135
|
className: "grid grid-cols-1 gap-2 md:grid-cols-2 xl:grid-cols-3",
|
|
136
|
-
children: te ? /* @__PURE__ */
|
|
136
|
+
children: te ? /* @__PURE__ */ f("p", {
|
|
137
137
|
className: "text-sm text-muted-foreground",
|
|
138
138
|
children: "Loading projects…"
|
|
139
|
-
}) : a.length === 0 ? /* @__PURE__ */
|
|
139
|
+
}) : a.length === 0 ? /* @__PURE__ */ f("p", {
|
|
140
140
|
className: "text-sm text-muted-foreground",
|
|
141
141
|
children: "No active projects are available in this workspace yet."
|
|
142
142
|
}) : a.map((e) => {
|
|
143
143
|
let t = n.includes(e.id);
|
|
144
|
-
return /* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ p("label", {
|
|
145
145
|
className: `flex cursor-pointer items-start justify-between gap-3 rounded-lg border px-3 py-3 transition-colors focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 ${t ? "border-primary bg-primary/10 text-foreground shadow-sm" : "border-border bg-background text-foreground hover:bg-accent"} ${o ? "opacity-70" : ""}`,
|
|
146
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ p("div", {
|
|
147
147
|
className: "min-w-0 flex-1 space-y-1",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ f("p", {
|
|
149
149
|
className: "truncate text-sm font-semibold leading-tight",
|
|
150
150
|
children: e.name
|
|
151
|
-
}), /* @__PURE__ */
|
|
151
|
+
}), /* @__PURE__ */ p("div", {
|
|
152
152
|
className: "flex items-center gap-2 text-xs text-muted-foreground",
|
|
153
|
-
children: [/* @__PURE__ */
|
|
153
|
+
children: [/* @__PURE__ */ f("span", {
|
|
154
154
|
className: "truncate font-mono",
|
|
155
155
|
children: e.key
|
|
156
|
-
}), /* @__PURE__ */
|
|
156
|
+
}), /* @__PURE__ */ f(m, {
|
|
157
157
|
variant: "outline",
|
|
158
158
|
children: e.status
|
|
159
159
|
})]
|
|
160
160
|
})]
|
|
161
|
-
}), /* @__PURE__ */
|
|
161
|
+
}), /* @__PURE__ */ f(b, {
|
|
162
162
|
checked: t,
|
|
163
163
|
disabled: o,
|
|
164
164
|
onCheckedChange: (t) => r(e.id, !!t),
|
|
@@ -170,113 +170,113 @@ function He({ selectedRoleIds: e, onRoleToggle: t, selectedProjectIds: n, onProj
|
|
|
170
170
|
})]
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
let { workspaceId:
|
|
175
|
-
i("workspaces.invite", { workspaceId:
|
|
176
|
-
let { canInviteMember:
|
|
177
|
-
if (!
|
|
173
|
+
function D() {
|
|
174
|
+
let { workspaceId: ye } = Ie(), { t: b } = Le(), S = Fe(), { basePath: C = "/workspaces", workspaceId: Pe } = e(), { withCurrentSearch: w } = n(), D = ye || Pe || "";
|
|
175
|
+
i("workspaces.invite", { workspaceId: D || void 0 });
|
|
176
|
+
let { canInviteMember: We, isLoading: Ge } = ae(), { data: Ke, isLoading: qe, error: Je } = t(D), { data: O = [], isLoading: Ye } = oe(D), { data: k, isLoading: Xe } = se({ archived: !1 }, { limit: 100 }, D), { data: Ze, isLoading: Qe, isFetching: A, error: $e, refetch: et } = a(D, "PENDING", { limit: 50 }, { retry: !1 }), j = s(() => (k?.items ?? []).filter((e) => !e.archived), [k?.items]), [tt, nt] = c("single"), [M, rt] = c(""), [N, it] = c([]), [P, at] = c([]), [ot, F] = c(null), [st, ct] = c(null), [lt, I] = c(null), [ut, L] = c(null), [R, z] = c(null), [B, V] = c([]), [dt, ft] = c(null), [pt, H] = c(!1), [U, mt] = c(!1), ht = ue(null), [W, G] = c(null), { mutateAsync: gt, isPending: K } = o(D), { mutateAsync: _t, isPending: q } = ee(), { mutate: vt, isPending: J } = ne(D), { mutate: yt, isPending: Y } = te(D), [bt, X] = c(null), Z = Ze?.items ?? [], xt = K || q || U, St = s(() => O.filter((e) => N.includes(e.id)).map((e) => e.name), [O, N]), Ct = s(() => j.filter((e) => P.includes(e.id)).map((e) => e.name), [j, P]), Q = s(() => B.filter((e) => e.errors.length === 0 && e.status.kind !== "invited"), [B]), $ = s(() => B.filter((e) => e.errors.length > 0), [B]);
|
|
177
|
+
if (!D) return /* @__PURE__ */ f("div", {
|
|
178
178
|
className: "space-y-4 p-6",
|
|
179
|
-
children: /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ p("div", {
|
|
180
180
|
className: "rounded-xl border bg-card p-8 text-center",
|
|
181
181
|
children: [
|
|
182
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ f("h1", {
|
|
183
183
|
className: "text-2xl font-bold",
|
|
184
|
-
children: r(
|
|
184
|
+
children: r(b, "workspaceInvite.noWorkspaceTitle", "Select a workspace first")
|
|
185
185
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ f("p", {
|
|
187
187
|
className: "mt-2 text-muted-foreground",
|
|
188
|
-
children: r(
|
|
188
|
+
children: r(b, "workspaceInvite.noWorkspaceDescription", "Choose a current workspace from the header or open a workspace detail page before inviting members.")
|
|
189
189
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ f("div", {
|
|
191
191
|
className: "mt-4",
|
|
192
|
-
children: /* @__PURE__ */
|
|
193
|
-
onClick: () =>
|
|
192
|
+
children: /* @__PURE__ */ f(h, {
|
|
193
|
+
onClick: () => S(w(`${C}/list`)),
|
|
194
194
|
variant: "outline",
|
|
195
|
-
children: r(
|
|
195
|
+
children: r(b, "workspaceInvite.backToWorkspaces", "Back to Workspaces")
|
|
196
196
|
})
|
|
197
197
|
})
|
|
198
198
|
]
|
|
199
199
|
})
|
|
200
200
|
});
|
|
201
|
-
if (
|
|
201
|
+
if (Ge || qe) return /* @__PURE__ */ p("div", {
|
|
202
202
|
className: "space-y-6 p-6",
|
|
203
203
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ f(x, { className: "h-10 w-48" }),
|
|
205
|
+
/* @__PURE__ */ f(x, { className: "h-40 w-full" }),
|
|
206
|
+
/* @__PURE__ */ f(x, { className: "h-80 w-full" })
|
|
207
207
|
]
|
|
208
208
|
});
|
|
209
|
-
if (!
|
|
209
|
+
if (!We) return /* @__PURE__ */ f("div", {
|
|
210
210
|
className: "flex min-h-[400px] items-center justify-center",
|
|
211
|
-
children: /* @__PURE__ */
|
|
211
|
+
children: /* @__PURE__ */ p("div", {
|
|
212
212
|
className: "space-y-2 text-center",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ f("h2", {
|
|
214
214
|
className: "text-lg font-semibold",
|
|
215
|
-
children: r(
|
|
216
|
-
}), /* @__PURE__ */
|
|
215
|
+
children: r(b, "workspaceInvite.accessDenied", "Access Denied")
|
|
216
|
+
}), /* @__PURE__ */ f("p", {
|
|
217
217
|
className: "text-sm text-muted-foreground",
|
|
218
|
-
children: r(
|
|
218
|
+
children: r(b, "workspaceInvite.accessDeniedDescription", "You don't have permission to invite members into this workspace.")
|
|
219
219
|
})]
|
|
220
220
|
})
|
|
221
221
|
});
|
|
222
|
-
if (
|
|
222
|
+
if (Je || !Ke) return /* @__PURE__ */ p("div", {
|
|
223
223
|
className: "space-y-4 p-6",
|
|
224
|
-
children: [/* @__PURE__ */
|
|
224
|
+
children: [/* @__PURE__ */ p(h, {
|
|
225
225
|
variant: "ghost",
|
|
226
|
-
onClick: () =>
|
|
226
|
+
onClick: () => S(w(`${C}/list`)),
|
|
227
227
|
className: "gap-2",
|
|
228
|
-
children: [/* @__PURE__ */
|
|
229
|
-
}), /* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ f(fe, { size: 18 }), r(b, "workspaceInvite.backToWorkspaces", "Back to Workspaces")]
|
|
229
|
+
}), /* @__PURE__ */ f("div", {
|
|
230
230
|
className: "rounded-xl border bg-card p-8 text-center text-destructive",
|
|
231
|
-
children: r(
|
|
231
|
+
children: r(b, "workspaceInvite.workspaceLoadError", "Unable to load workspace invite details.")
|
|
232
232
|
})]
|
|
233
233
|
});
|
|
234
|
-
let
|
|
235
|
-
|
|
236
|
-
},
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
if (e.preventDefault(), F(null),
|
|
234
|
+
let wt = (e, t) => {
|
|
235
|
+
it((n) => t ? [...n, e].filter((e, t, n) => n.indexOf(e) === t) : n.filter((t) => t !== e));
|
|
236
|
+
}, Tt = (e, t) => {
|
|
237
|
+
at((n) => t ? [...n, e].filter((e, t, n) => n.indexOf(e) === t) : n.filter((t) => t !== e));
|
|
238
|
+
}, Et = async (e) => {
|
|
239
|
+
if (e.preventDefault(), F(null), ct(null), z(null), !M.trim()) {
|
|
240
240
|
F("Email is required.");
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
243
|
try {
|
|
244
|
-
await
|
|
244
|
+
await gt(He(D, M.trim().toLowerCase(), N, P)), rt(""), ct(`Invitation sent to ${M.trim().toLowerCase()}.`);
|
|
245
245
|
} catch (e) {
|
|
246
|
-
F(
|
|
246
|
+
F(E(e));
|
|
247
247
|
}
|
|
248
|
-
},
|
|
249
|
-
if (!
|
|
248
|
+
}, Dt = (e) => {
|
|
249
|
+
if (!ze(e)) {
|
|
250
250
|
I("Please upload a .csv file.");
|
|
251
251
|
return;
|
|
252
252
|
}
|
|
253
|
-
if (e.size >
|
|
253
|
+
if (e.size > Re) {
|
|
254
254
|
I("CSV file is too large (max 1 MB).");
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
257
|
let t = new FileReader();
|
|
258
258
|
t.onload = () => {
|
|
259
259
|
let n = le(typeof t.result == "string" ? t.result : "");
|
|
260
|
-
V(n.slice(0,
|
|
260
|
+
V(n.slice(0, T).map((e) => ({
|
|
261
261
|
...e,
|
|
262
262
|
status: { kind: "idle" }
|
|
263
|
-
}))),
|
|
263
|
+
}))), ft(e.name), I(n.length > T ? `Only the first ${T} rows were loaded. Split larger CSV files into smaller batches.` : null), L(null), z(null);
|
|
264
264
|
}, t.onerror = () => {
|
|
265
265
|
I("Failed to read CSV file.");
|
|
266
266
|
}, t.readAsText(e);
|
|
267
|
-
},
|
|
267
|
+
}, Ot = async () => {
|
|
268
268
|
if (!(Q.length === 0 || U)) {
|
|
269
|
-
I(null), L(null), z(null),
|
|
269
|
+
I(null), L(null), z(null), mt(!0), V((e) => e.map((e) => e.errors.length === 0 && e.status.kind !== "invited" ? {
|
|
270
270
|
...e,
|
|
271
271
|
status: { kind: "sending" }
|
|
272
272
|
} : e));
|
|
273
273
|
try {
|
|
274
|
-
await
|
|
274
|
+
await _t(Q.map((e) => He(D, e.email, N, P))), V((e) => e.map((e) => e.status.kind === "sending" ? {
|
|
275
275
|
...e,
|
|
276
276
|
status: { kind: "invited" }
|
|
277
277
|
} : e)), L(`Sent ${Q.length} workspace invitation${Q.length === 1 ? "" : "s"}.`);
|
|
278
278
|
} catch (e) {
|
|
279
|
-
let t =
|
|
279
|
+
let t = E(e);
|
|
280
280
|
V((e) => e.map((e) => e.status.kind === "sending" ? {
|
|
281
281
|
...e,
|
|
282
282
|
status: {
|
|
@@ -285,11 +285,11 @@ function O() {
|
|
|
285
285
|
}
|
|
286
286
|
} : e)), I(t);
|
|
287
287
|
} finally {
|
|
288
|
-
|
|
288
|
+
mt(!1);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
},
|
|
292
|
-
z(null), X(e.id),
|
|
291
|
+
}, kt = (e) => {
|
|
292
|
+
z(null), X(e.id), vt(e.id, {
|
|
293
293
|
onSuccess: () => {
|
|
294
294
|
z({
|
|
295
295
|
tone: "success",
|
|
@@ -299,21 +299,21 @@ function O() {
|
|
|
299
299
|
onError: (e) => {
|
|
300
300
|
z({
|
|
301
301
|
tone: "error",
|
|
302
|
-
message:
|
|
302
|
+
message: E(e)
|
|
303
303
|
});
|
|
304
304
|
},
|
|
305
305
|
onSettled: () => X(null)
|
|
306
306
|
});
|
|
307
307
|
};
|
|
308
|
-
return /* @__PURE__ */
|
|
308
|
+
return /* @__PURE__ */ p(be, { children: [/* @__PURE__ */ f(xe, {
|
|
309
309
|
open: !!W,
|
|
310
310
|
onOpenChange: (e) => !e && G(null),
|
|
311
|
-
children: /* @__PURE__ */
|
|
311
|
+
children: /* @__PURE__ */ p(we, { children: [/* @__PURE__ */ p(De, { children: [/* @__PURE__ */ f(Oe, { children: "Cancel pending invitation?" }), /* @__PURE__ */ f(Te, { children: W ? `This will revoke the pending invite for ${W.email}. They will need a new invitation to join later.` : "This will revoke the pending invitation." })] }), /* @__PURE__ */ p(Ee, { children: [/* @__PURE__ */ f(Ce, {
|
|
312
312
|
disabled: Y,
|
|
313
313
|
children: "Keep invitation"
|
|
314
|
-
}), /* @__PURE__ */
|
|
314
|
+
}), /* @__PURE__ */ p(Se, {
|
|
315
315
|
onClick: () => {
|
|
316
|
-
W && (z(null), X(W.id),
|
|
316
|
+
W && (z(null), X(W.id), yt(W.id, {
|
|
317
317
|
onSuccess: () => {
|
|
318
318
|
z({
|
|
319
319
|
tone: "success",
|
|
@@ -323,173 +323,173 @@ function O() {
|
|
|
323
323
|
onError: (e) => {
|
|
324
324
|
z({
|
|
325
325
|
tone: "error",
|
|
326
|
-
message:
|
|
326
|
+
message: E(e)
|
|
327
327
|
});
|
|
328
328
|
},
|
|
329
329
|
onSettled: () => X(null)
|
|
330
330
|
}));
|
|
331
331
|
},
|
|
332
332
|
disabled: Y,
|
|
333
|
-
children: [Y ? /* @__PURE__ */
|
|
333
|
+
children: [Y ? /* @__PURE__ */ f(u, { className: "size-4 animate-spin" }) : null, "Cancel invitation"]
|
|
334
334
|
})] })] })
|
|
335
|
-
}), /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ p("div", {
|
|
336
336
|
className: "space-y-6 p-3 sm:p-6",
|
|
337
337
|
children: [
|
|
338
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ f("div", {
|
|
339
339
|
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
340
|
-
children: /* @__PURE__ */
|
|
341
|
-
/* @__PURE__ */
|
|
340
|
+
children: /* @__PURE__ */ p("div", { children: [
|
|
341
|
+
/* @__PURE__ */ p(h, {
|
|
342
342
|
variant: "ghost",
|
|
343
|
-
onClick: () =>
|
|
343
|
+
onClick: () => S(w(`${C}/${D}`)),
|
|
344
344
|
className: "-ml-2 mb-2 gap-2",
|
|
345
|
-
children: [/* @__PURE__ */
|
|
345
|
+
children: [/* @__PURE__ */ f(fe, { size: 18 }), r(b, "workspaceInvite.backToWorkspace", "Back to Workspace")]
|
|
346
346
|
}),
|
|
347
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ p("div", {
|
|
348
348
|
className: "flex items-center gap-2",
|
|
349
|
-
children: [/* @__PURE__ */
|
|
349
|
+
children: [/* @__PURE__ */ f(ve, {
|
|
350
350
|
className: "text-primary",
|
|
351
351
|
size: 24
|
|
352
|
-
}), /* @__PURE__ */
|
|
352
|
+
}), /* @__PURE__ */ f("h1", {
|
|
353
353
|
className: "text-2xl font-bold sm:text-3xl",
|
|
354
|
-
children: r(
|
|
354
|
+
children: r(b, "workspaceInvite.title", "Invite Members")
|
|
355
355
|
})]
|
|
356
356
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ p("p", {
|
|
358
358
|
className: "mt-2 text-sm text-muted-foreground sm:text-base",
|
|
359
359
|
children: [
|
|
360
|
-
|
|
360
|
+
Ke.name,
|
|
361
361
|
" —",
|
|
362
362
|
" ",
|
|
363
|
-
r(
|
|
363
|
+
r(b, "workspaceInvite.subtitle", "Invite people into this workspace and optionally grant project access.")
|
|
364
364
|
]
|
|
365
365
|
})
|
|
366
366
|
] })
|
|
367
367
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ p(g, { children: [/* @__PURE__ */ f(v, { children: /* @__PURE__ */ f(y, { children: r(b, "workspaceInvite.setupTitle", "Access to grant on acceptance") }) }), /* @__PURE__ */ f(_, { children: /* @__PURE__ */ f(Ue, {
|
|
369
369
|
selectedRoleIds: N,
|
|
370
|
-
onRoleToggle:
|
|
370
|
+
onRoleToggle: wt,
|
|
371
371
|
selectedProjectIds: P,
|
|
372
|
-
onProjectToggle:
|
|
373
|
-
availableRoles:
|
|
372
|
+
onProjectToggle: Tt,
|
|
373
|
+
availableRoles: O,
|
|
374
374
|
availableProjects: j,
|
|
375
|
-
isLoadingRoles:
|
|
376
|
-
isLoadingProjects:
|
|
377
|
-
disabled:
|
|
375
|
+
isLoadingRoles: Ye,
|
|
376
|
+
isLoadingProjects: Xe,
|
|
377
|
+
disabled: xt
|
|
378
378
|
}) })] }),
|
|
379
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ p(g, { children: [/* @__PURE__ */ f(v, { children: /* @__PURE__ */ f(y, { children: "Selection summary" }) }), /* @__PURE__ */ p(_, {
|
|
380
380
|
className: "grid gap-4 md:grid-cols-2",
|
|
381
|
-
children: [/* @__PURE__ */
|
|
381
|
+
children: [/* @__PURE__ */ p("div", {
|
|
382
382
|
className: "space-y-2 rounded-lg border p-4",
|
|
383
|
-
children: [/* @__PURE__ */
|
|
383
|
+
children: [/* @__PURE__ */ p("div", {
|
|
384
384
|
className: "flex items-center justify-between gap-2",
|
|
385
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ f("p", {
|
|
386
386
|
className: "text-sm font-medium",
|
|
387
387
|
children: "Roles"
|
|
388
|
-
}), /* @__PURE__ */
|
|
388
|
+
}), /* @__PURE__ */ f(m, {
|
|
389
389
|
variant: "secondary",
|
|
390
|
-
children:
|
|
390
|
+
children: St.length
|
|
391
391
|
})]
|
|
392
|
-
}), /* @__PURE__ */
|
|
392
|
+
}), /* @__PURE__ */ f("p", {
|
|
393
393
|
className: "text-sm text-muted-foreground",
|
|
394
|
-
children:
|
|
394
|
+
children: Ve(St, "No roles selected")
|
|
395
395
|
})]
|
|
396
|
-
}), /* @__PURE__ */
|
|
396
|
+
}), /* @__PURE__ */ p("div", {
|
|
397
397
|
className: "space-y-2 rounded-lg border p-4",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ p("div", {
|
|
399
399
|
className: "flex items-center justify-between gap-2",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ f("p", {
|
|
401
401
|
className: "text-sm font-medium",
|
|
402
402
|
children: "Projects"
|
|
403
|
-
}), /* @__PURE__ */
|
|
403
|
+
}), /* @__PURE__ */ f(m, {
|
|
404
404
|
variant: "secondary",
|
|
405
|
-
children:
|
|
405
|
+
children: Ct.length
|
|
406
406
|
})]
|
|
407
|
-
}), /* @__PURE__ */
|
|
407
|
+
}), /* @__PURE__ */ f("p", {
|
|
408
408
|
className: "text-sm text-muted-foreground",
|
|
409
|
-
children:
|
|
409
|
+
children: Ve(Ct, "No project access will be granted automatically")
|
|
410
410
|
})]
|
|
411
411
|
})]
|
|
412
412
|
})] }),
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
value:
|
|
415
|
-
onValueChange: (e) =>
|
|
413
|
+
/* @__PURE__ */ p(g, { children: [/* @__PURE__ */ f(v, { children: /* @__PURE__ */ f(y, { children: r(b, "workspaceInvite.sendTitle", "Send invitations") }) }), /* @__PURE__ */ f(_, { children: /* @__PURE__ */ p(Ae, {
|
|
414
|
+
value: tt,
|
|
415
|
+
onValueChange: (e) => nt(e),
|
|
416
416
|
className: "space-y-5",
|
|
417
417
|
children: [
|
|
418
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ p(Me, { children: [/* @__PURE__ */ f(Ne, {
|
|
419
419
|
value: "single",
|
|
420
|
-
children: r(
|
|
421
|
-
}), /* @__PURE__ */
|
|
420
|
+
children: r(b, "workspaceInvite.modeSingle", "Single")
|
|
421
|
+
}), /* @__PURE__ */ f(Ne, {
|
|
422
422
|
value: "bulk",
|
|
423
|
-
children: r(
|
|
423
|
+
children: r(b, "workspaceInvite.modeBulk", "Bulk CSV")
|
|
424
424
|
})] }),
|
|
425
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ p(je, {
|
|
426
426
|
value: "single",
|
|
427
427
|
className: "space-y-4",
|
|
428
428
|
children: [
|
|
429
|
-
|
|
429
|
+
ot ? /* @__PURE__ */ p("div", {
|
|
430
430
|
className: "flex items-center gap-2 rounded-md border border-destructive/20 bg-destructive/10 p-3 text-sm text-destructive",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
431
|
+
children: [/* @__PURE__ */ f(de, { className: "size-4 shrink-0" }), /* @__PURE__ */ f("span", { children: ot })]
|
|
432
432
|
}) : null,
|
|
433
|
-
|
|
433
|
+
st ? /* @__PURE__ */ p("div", {
|
|
434
434
|
className: "flex items-center gap-2 rounded-md border border-green-500/20 bg-green-500/10 p-3 text-sm text-green-700 dark:text-green-400",
|
|
435
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ f(l, { className: "size-4 shrink-0" }), /* @__PURE__ */ f("span", { children: st })]
|
|
436
436
|
}) : null,
|
|
437
|
-
/* @__PURE__ */
|
|
438
|
-
onSubmit:
|
|
437
|
+
/* @__PURE__ */ p("form", {
|
|
438
|
+
onSubmit: Et,
|
|
439
439
|
className: "space-y-4",
|
|
440
|
-
children: [/* @__PURE__ */
|
|
440
|
+
children: [/* @__PURE__ */ p("div", {
|
|
441
441
|
className: "space-y-2",
|
|
442
|
-
children: [/* @__PURE__ */
|
|
442
|
+
children: [/* @__PURE__ */ f("label", {
|
|
443
443
|
htmlFor: "workspace-invite-email",
|
|
444
444
|
className: "text-sm font-medium",
|
|
445
|
-
children: r(
|
|
446
|
-
}), /* @__PURE__ */
|
|
445
|
+
children: r(b, "workspaceInvite.emailLabel", "Email Address")
|
|
446
|
+
}), /* @__PURE__ */ f(ke, {
|
|
447
447
|
id: "workspace-invite-email",
|
|
448
448
|
type: "email",
|
|
449
449
|
placeholder: "member@example.com",
|
|
450
450
|
value: M,
|
|
451
|
-
onChange: (e) =>
|
|
451
|
+
onChange: (e) => rt(e.target.value),
|
|
452
452
|
disabled: K
|
|
453
453
|
})]
|
|
454
|
-
}), /* @__PURE__ */
|
|
454
|
+
}), /* @__PURE__ */ f("div", {
|
|
455
455
|
className: "flex justify-end",
|
|
456
|
-
children: /* @__PURE__ */
|
|
456
|
+
children: /* @__PURE__ */ p(h, {
|
|
457
457
|
type: "submit",
|
|
458
458
|
disabled: K,
|
|
459
459
|
className: "gap-2",
|
|
460
|
-
children: [K ? /* @__PURE__ */
|
|
460
|
+
children: [K ? /* @__PURE__ */ f(u, { className: "size-4 animate-spin" }) : /* @__PURE__ */ f(ge, { className: "size-4" }), r(b, "workspaceInvite.sendSingleButton", "Send Invitation")]
|
|
461
461
|
})
|
|
462
462
|
})]
|
|
463
463
|
})
|
|
464
464
|
]
|
|
465
465
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ p(je, {
|
|
467
467
|
value: "bulk",
|
|
468
468
|
className: "space-y-5",
|
|
469
469
|
children: [
|
|
470
|
-
|
|
470
|
+
lt ? /* @__PURE__ */ p("div", {
|
|
471
471
|
className: "flex items-center gap-2 rounded-md border border-destructive/20 bg-destructive/10 p-3 text-sm text-destructive",
|
|
472
|
-
children: [/* @__PURE__ */
|
|
472
|
+
children: [/* @__PURE__ */ f(de, { className: "size-4 shrink-0" }), /* @__PURE__ */ f("span", { children: lt })]
|
|
473
473
|
}) : null,
|
|
474
|
-
|
|
474
|
+
ut ? /* @__PURE__ */ p("div", {
|
|
475
475
|
className: "flex items-center gap-2 rounded-md border border-green-500/20 bg-green-500/10 p-3 text-sm text-green-700 dark:text-green-400",
|
|
476
|
-
children: [/* @__PURE__ */
|
|
476
|
+
children: [/* @__PURE__ */ f(l, { className: "size-4 shrink-0" }), /* @__PURE__ */ f("span", { children: ut })]
|
|
477
477
|
}) : null,
|
|
478
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ p("div", {
|
|
479
479
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
480
|
-
children: [/* @__PURE__ */
|
|
480
|
+
children: [/* @__PURE__ */ p("div", {
|
|
481
481
|
className: "space-y-1",
|
|
482
482
|
children: [
|
|
483
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ f("p", {
|
|
484
484
|
className: "text-sm text-muted-foreground",
|
|
485
|
-
children: r(
|
|
485
|
+
children: r(b, "workspaceInvite.bulkDescription", "Upload a CSV with one email column. All valid rows will receive the currently selected roles and projects.")
|
|
486
486
|
}),
|
|
487
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ p("div", {
|
|
488
488
|
className: "rounded-md border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",
|
|
489
|
-
children: [/* @__PURE__ */
|
|
489
|
+
children: [/* @__PURE__ */ f("p", {
|
|
490
490
|
className: "font-medium text-foreground",
|
|
491
491
|
children: "Sample format"
|
|
492
|
-
}), /* @__PURE__ */
|
|
492
|
+
}), /* @__PURE__ */ p("pre", {
|
|
493
493
|
className: "mt-1 whitespace-pre-wrap",
|
|
494
494
|
children: [
|
|
495
495
|
"email",
|
|
@@ -500,7 +500,7 @@ function O() {
|
|
|
500
500
|
]
|
|
501
501
|
})]
|
|
502
502
|
}),
|
|
503
|
-
(
|
|
503
|
+
(k?.total ?? 0) > j.length ? /* @__PURE__ */ p("p", {
|
|
504
504
|
className: "text-xs text-muted-foreground",
|
|
505
505
|
children: [
|
|
506
506
|
"Showing the first ",
|
|
@@ -509,15 +509,15 @@ function O() {
|
|
|
509
509
|
]
|
|
510
510
|
}) : null
|
|
511
511
|
]
|
|
512
|
-
}), /* @__PURE__ */
|
|
512
|
+
}), /* @__PURE__ */ p(h, {
|
|
513
513
|
type: "button",
|
|
514
514
|
variant: "outline",
|
|
515
515
|
onClick: ce,
|
|
516
516
|
className: "gap-2",
|
|
517
|
-
children: [/* @__PURE__ */
|
|
517
|
+
children: [/* @__PURE__ */ f(pe, { size: 16 }), r(b, "workspaceInvite.downloadTemplate", "Download template")]
|
|
518
518
|
})]
|
|
519
519
|
}),
|
|
520
|
-
/* @__PURE__ */
|
|
520
|
+
/* @__PURE__ */ p("div", {
|
|
521
521
|
onDragOver: (e) => {
|
|
522
522
|
e.preventDefault(), H(!0);
|
|
523
523
|
},
|
|
@@ -525,56 +525,56 @@ function O() {
|
|
|
525
525
|
onDrop: (e) => {
|
|
526
526
|
e.preventDefault(), H(!1);
|
|
527
527
|
let t = e.dataTransfer.files?.[0];
|
|
528
|
-
t ?
|
|
528
|
+
t ? Dt(t) : I("Please upload a .csv file.");
|
|
529
529
|
},
|
|
530
|
-
className: `flex flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed p-8 transition-colors ${
|
|
530
|
+
className: `flex flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed p-8 transition-colors ${pt ? "border-primary bg-primary/5" : "border-border bg-background"}`,
|
|
531
531
|
children: [
|
|
532
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ f(_e, {
|
|
533
533
|
size: 28,
|
|
534
534
|
className: "text-muted-foreground"
|
|
535
535
|
}),
|
|
536
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ p("div", {
|
|
537
537
|
className: "text-center",
|
|
538
|
-
children: [/* @__PURE__ */
|
|
538
|
+
children: [/* @__PURE__ */ f("p", {
|
|
539
539
|
className: "text-sm font-medium",
|
|
540
|
-
children:
|
|
541
|
-
}), /* @__PURE__ */
|
|
540
|
+
children: dt || "Drop a CSV file here or click to browse"
|
|
541
|
+
}), /* @__PURE__ */ f("p", {
|
|
542
542
|
className: "mt-1 text-xs text-muted-foreground",
|
|
543
543
|
children: "CSV files only. Required column: email."
|
|
544
544
|
})]
|
|
545
545
|
}),
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
-
ref:
|
|
546
|
+
/* @__PURE__ */ f("input", {
|
|
547
|
+
ref: ht,
|
|
548
548
|
type: "file",
|
|
549
549
|
accept: ".csv,text/csv",
|
|
550
550
|
onChange: (e) => {
|
|
551
551
|
let t = e.target.files?.[0];
|
|
552
|
-
t &&
|
|
552
|
+
t && Dt(t), e.target.value = "";
|
|
553
553
|
},
|
|
554
554
|
className: "hidden",
|
|
555
555
|
"aria-label": "Choose CSV file"
|
|
556
556
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ f(h, {
|
|
558
558
|
type: "button",
|
|
559
|
-
onClick: () =>
|
|
560
|
-
children: r(
|
|
559
|
+
onClick: () => ht.current?.click(),
|
|
560
|
+
children: r(b, "workspaceInvite.chooseFile", "Choose file")
|
|
561
561
|
})
|
|
562
562
|
]
|
|
563
563
|
}),
|
|
564
|
-
B.length > 0 ? /* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
564
|
+
B.length > 0 ? /* @__PURE__ */ p(be, { children: [
|
|
565
|
+
/* @__PURE__ */ p("div", {
|
|
566
566
|
className: "flex flex-wrap gap-4 text-xs text-muted-foreground",
|
|
567
567
|
children: [
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
-
/* @__PURE__ */
|
|
571
|
-
$.length > 0 ? /* @__PURE__ */
|
|
568
|
+
/* @__PURE__ */ p("span", { children: ["Total rows: ", B.length] }),
|
|
569
|
+
/* @__PURE__ */ p("span", { children: ["Ready: ", Q.length] }),
|
|
570
|
+
/* @__PURE__ */ p("span", { children: ["With errors: ", $.length] }),
|
|
571
|
+
$.length > 0 ? /* @__PURE__ */ f(m, {
|
|
572
572
|
variant: "destructive",
|
|
573
573
|
children: "Invalid rows will be skipped"
|
|
574
574
|
}) : null
|
|
575
575
|
]
|
|
576
576
|
}),
|
|
577
|
-
$.length > 0 ? /* @__PURE__ */
|
|
577
|
+
$.length > 0 ? /* @__PURE__ */ p("div", {
|
|
578
578
|
className: "rounded-md border border-destructive/20 bg-destructive/10 px-3 py-2 text-sm text-destructive",
|
|
579
579
|
children: [
|
|
580
580
|
$.length,
|
|
@@ -583,67 +583,67 @@ function O() {
|
|
|
583
583
|
" need attention. Only valid rows can be invited."
|
|
584
584
|
]
|
|
585
585
|
}) : null,
|
|
586
|
-
/* @__PURE__ */
|
|
586
|
+
/* @__PURE__ */ f("div", {
|
|
587
587
|
className: "overflow-hidden rounded-xl border",
|
|
588
|
-
children: /* @__PURE__ */
|
|
588
|
+
children: /* @__PURE__ */ f("div", {
|
|
589
589
|
className: "overflow-x-auto",
|
|
590
|
-
children: /* @__PURE__ */
|
|
590
|
+
children: /* @__PURE__ */ p("table", {
|
|
591
591
|
className: "min-w-full",
|
|
592
|
-
children: [/* @__PURE__ */
|
|
592
|
+
children: [/* @__PURE__ */ f("thead", {
|
|
593
593
|
className: "bg-muted/40",
|
|
594
|
-
children: /* @__PURE__ */
|
|
595
|
-
/* @__PURE__ */
|
|
594
|
+
children: /* @__PURE__ */ p("tr", { children: [
|
|
595
|
+
/* @__PURE__ */ f("th", {
|
|
596
596
|
className: "px-3 py-2 text-left text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
597
597
|
children: "#"
|
|
598
598
|
}),
|
|
599
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ f("th", {
|
|
600
600
|
className: "px-3 py-2 text-left text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
601
601
|
children: "Email"
|
|
602
602
|
}),
|
|
603
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ f("th", {
|
|
604
604
|
className: "px-3 py-2 text-left text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
605
605
|
children: "Status"
|
|
606
606
|
})
|
|
607
607
|
] })
|
|
608
|
-
}), /* @__PURE__ */
|
|
608
|
+
}), /* @__PURE__ */ f("tbody", {
|
|
609
609
|
className: "divide-y",
|
|
610
610
|
children: B.map((e) => {
|
|
611
611
|
let t = e.errors.length > 0;
|
|
612
|
-
return /* @__PURE__ */
|
|
612
|
+
return /* @__PURE__ */ p("tr", {
|
|
613
613
|
className: t ? "bg-destructive/5" : void 0,
|
|
614
614
|
children: [
|
|
615
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ f("td", {
|
|
616
616
|
className: "px-3 py-2 text-xs text-muted-foreground",
|
|
617
617
|
children: e.rowNumber
|
|
618
618
|
}),
|
|
619
|
-
/* @__PURE__ */
|
|
619
|
+
/* @__PURE__ */ f("td", {
|
|
620
620
|
className: "px-3 py-2 text-sm",
|
|
621
|
-
children: e.email || /* @__PURE__ */
|
|
621
|
+
children: e.email || /* @__PURE__ */ f("span", {
|
|
622
622
|
className: "italic text-muted-foreground",
|
|
623
623
|
children: "(empty)"
|
|
624
624
|
})
|
|
625
625
|
}),
|
|
626
|
-
/* @__PURE__ */
|
|
626
|
+
/* @__PURE__ */ f("td", {
|
|
627
627
|
className: "px-3 py-2 text-xs",
|
|
628
|
-
children: t ? /* @__PURE__ */
|
|
628
|
+
children: t ? /* @__PURE__ */ f("div", {
|
|
629
629
|
className: "space-y-1 text-destructive",
|
|
630
|
-
children: e.errors.map((t) => /* @__PURE__ */
|
|
630
|
+
children: e.errors.map((t) => /* @__PURE__ */ p("span", {
|
|
631
631
|
className: "inline-flex items-center gap-1 pr-3",
|
|
632
|
-
children: [/* @__PURE__ */
|
|
632
|
+
children: [/* @__PURE__ */ f(d, { size: 14 }), t]
|
|
633
633
|
}, `${e.rowNumber}-${t}`))
|
|
634
|
-
}) : e.status.kind === "sending" ? /* @__PURE__ */
|
|
634
|
+
}) : e.status.kind === "sending" ? /* @__PURE__ */ p("span", {
|
|
635
635
|
className: "inline-flex items-center gap-1 text-muted-foreground",
|
|
636
|
-
children: [/* @__PURE__ */
|
|
636
|
+
children: [/* @__PURE__ */ f(u, {
|
|
637
637
|
size: 14,
|
|
638
638
|
className: "animate-spin"
|
|
639
639
|
}), "Sending..."]
|
|
640
|
-
}) : e.status.kind === "invited" ? /* @__PURE__ */
|
|
640
|
+
}) : e.status.kind === "invited" ? /* @__PURE__ */ p("span", {
|
|
641
641
|
className: "inline-flex items-center gap-1 text-green-700 dark:text-green-400",
|
|
642
|
-
children: [/* @__PURE__ */
|
|
643
|
-
}) : e.status.kind === "failed" ? /* @__PURE__ */
|
|
642
|
+
children: [/* @__PURE__ */ f(l, { size: 14 }), "Invited"]
|
|
643
|
+
}) : e.status.kind === "failed" ? /* @__PURE__ */ p("span", {
|
|
644
644
|
className: "inline-flex items-center gap-1 text-destructive",
|
|
645
|
-
children: [/* @__PURE__ */
|
|
646
|
-
}) : /* @__PURE__ */
|
|
645
|
+
children: [/* @__PURE__ */ f(d, { size: 14 }), e.status.message]
|
|
646
|
+
}) : /* @__PURE__ */ f("span", {
|
|
647
647
|
className: "text-muted-foreground",
|
|
648
648
|
children: "Ready"
|
|
649
649
|
})
|
|
@@ -655,136 +655,164 @@ function O() {
|
|
|
655
655
|
})
|
|
656
656
|
})
|
|
657
657
|
})
|
|
658
|
-
] }) : /* @__PURE__ */
|
|
658
|
+
] }) : /* @__PURE__ */ f("div", {
|
|
659
659
|
className: "rounded-xl border border-dashed p-6 text-center text-sm text-muted-foreground",
|
|
660
660
|
children: "Upload a CSV to preview invite rows here before sending."
|
|
661
661
|
}),
|
|
662
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ f("div", {
|
|
663
663
|
className: "flex justify-end",
|
|
664
|
-
children: /* @__PURE__ */
|
|
664
|
+
children: /* @__PURE__ */ p(h, {
|
|
665
665
|
type: "button",
|
|
666
|
-
onClick:
|
|
666
|
+
onClick: Ot,
|
|
667
667
|
disabled: Q.length === 0 || q || U,
|
|
668
668
|
className: "gap-2",
|
|
669
|
-
children: [q || U ? /* @__PURE__ */
|
|
669
|
+
children: [q || U ? /* @__PURE__ */ f(u, { className: "size-4 animate-spin" }) : /* @__PURE__ */ f(ge, { className: "size-4" }), r(b, "workspaceInvite.sendBulkButton", "Send Bulk Invites")]
|
|
670
670
|
})
|
|
671
671
|
})
|
|
672
672
|
]
|
|
673
673
|
})
|
|
674
674
|
]
|
|
675
675
|
}) })] }),
|
|
676
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ p(g, { children: [/* @__PURE__ */ f(v, { children: /* @__PURE__ */ p(y, {
|
|
677
677
|
className: "flex items-center gap-2",
|
|
678
678
|
children: [
|
|
679
|
-
/* @__PURE__ */
|
|
680
|
-
r(
|
|
681
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ f(me, { className: "size-5 text-primary" }),
|
|
680
|
+
r(b, "workspaceInvite.pendingTitle", "Pending Invitations"),
|
|
681
|
+
/* @__PURE__ */ f(m, {
|
|
682
682
|
variant: "secondary",
|
|
683
683
|
children: Z.length
|
|
684
684
|
})
|
|
685
685
|
]
|
|
686
|
-
}) }), /* @__PURE__ */
|
|
686
|
+
}) }), /* @__PURE__ */ p(_, { children: [R ? /* @__PURE__ */ p("div", {
|
|
687
687
|
className: `mb-4 flex items-center gap-2 rounded-md border p-3 text-sm ${R.tone === "success" ? "border-green-500/20 bg-green-500/10 text-green-700 dark:text-green-400" : "border-destructive/20 bg-destructive/10 text-destructive"}`,
|
|
688
|
-
children: [R.tone === "success" ? /* @__PURE__ */
|
|
689
|
-
}) : null,
|
|
688
|
+
children: [R.tone === "success" ? /* @__PURE__ */ f(l, { className: "size-4 shrink-0" }) : /* @__PURE__ */ f(de, { className: "size-4 shrink-0" }), /* @__PURE__ */ f("span", { children: R.message })]
|
|
689
|
+
}) : null, Qe ? /* @__PURE__ */ p("div", {
|
|
690
690
|
className: "space-y-3",
|
|
691
|
-
children: [/* @__PURE__ */
|
|
692
|
-
}) : Z.length === 0 ? /* @__PURE__ */ p("
|
|
691
|
+
children: [/* @__PURE__ */ f(x, { className: "h-20 w-full" }), /* @__PURE__ */ f(x, { className: "h-20 w-full" })]
|
|
692
|
+
}) : $e && Z.length === 0 ? /* @__PURE__ */ p("div", {
|
|
693
|
+
role: "alert",
|
|
694
|
+
className: "space-y-3 rounded-md border border-destructive/20 bg-destructive/10 p-3 text-sm text-destructive",
|
|
695
|
+
children: [/* @__PURE__ */ f("p", { children: r(b, "workspaceInvite.pendingLoadFailed", "Failed to load pending invitations for this workspace.") }), /* @__PURE__ */ f(h, {
|
|
696
|
+
type: "button",
|
|
697
|
+
variant: "outline",
|
|
698
|
+
size: "sm",
|
|
699
|
+
className: "w-fit",
|
|
700
|
+
disabled: A,
|
|
701
|
+
onClick: () => {
|
|
702
|
+
et();
|
|
703
|
+
},
|
|
704
|
+
children: A ? r(b, "workspaceInvite.retrying", "Retrying…") : r(b, "workspaceInvite.tryAgain", "Try again")
|
|
705
|
+
})]
|
|
706
|
+
}) : Z.length === 0 ? /* @__PURE__ */ f("p", {
|
|
693
707
|
className: "text-sm text-muted-foreground",
|
|
694
|
-
children: r(
|
|
708
|
+
children: r(b, "workspaceInvite.pendingEmpty", "No pending invitations for this workspace.")
|
|
695
709
|
}) : /* @__PURE__ */ p("div", {
|
|
696
710
|
className: "space-y-3",
|
|
697
|
-
children:
|
|
698
|
-
|
|
699
|
-
|
|
711
|
+
children: [$e ? /* @__PURE__ */ p("div", {
|
|
712
|
+
role: "alert",
|
|
713
|
+
className: "flex flex-wrap items-center justify-between gap-3 rounded-md border border-destructive/20 bg-destructive/10 p-3 text-sm text-destructive",
|
|
714
|
+
children: [/* @__PURE__ */ f("span", { children: r(b, "workspaceInvite.pendingStaleWarning", "Pending invitations may be outdated. Try again to refresh this list.") }), /* @__PURE__ */ f(h, {
|
|
715
|
+
type: "button",
|
|
716
|
+
variant: "outline",
|
|
717
|
+
size: "sm",
|
|
718
|
+
className: "w-fit",
|
|
719
|
+
disabled: A,
|
|
720
|
+
onClick: () => {
|
|
721
|
+
et();
|
|
722
|
+
},
|
|
723
|
+
children: A ? r(b, "workspaceInvite.retrying", "Retrying…") : r(b, "workspaceInvite.tryAgain", "Try again")
|
|
724
|
+
})]
|
|
725
|
+
}) : null, Z.map((e) => {
|
|
726
|
+
let t = ie(e), n = re(e), r = bt === e.id && (J || Y);
|
|
727
|
+
return /* @__PURE__ */ f("div", {
|
|
700
728
|
className: "rounded-lg border p-4",
|
|
701
|
-
children: /* @__PURE__ */
|
|
729
|
+
children: /* @__PURE__ */ p("div", {
|
|
702
730
|
className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",
|
|
703
|
-
children: [/* @__PURE__ */
|
|
731
|
+
children: [/* @__PURE__ */ p("div", {
|
|
704
732
|
className: "space-y-3",
|
|
705
733
|
children: [
|
|
706
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ p("div", {
|
|
707
735
|
className: "flex flex-wrap items-center gap-2",
|
|
708
|
-
children: [/* @__PURE__ */
|
|
736
|
+
children: [/* @__PURE__ */ f("p", {
|
|
709
737
|
className: "font-semibold",
|
|
710
738
|
children: e.email
|
|
711
|
-
}), /* @__PURE__ */
|
|
739
|
+
}), /* @__PURE__ */ f(m, {
|
|
712
740
|
variant: "outline",
|
|
713
741
|
children: e.status
|
|
714
742
|
})]
|
|
715
743
|
}),
|
|
716
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ p("div", {
|
|
717
745
|
className: "grid gap-3 text-sm text-muted-foreground sm:grid-cols-2",
|
|
718
|
-
children: [/* @__PURE__ */
|
|
746
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
|
|
719
747
|
className: "font-medium text-foreground",
|
|
720
748
|
children: "Received"
|
|
721
|
-
}), /* @__PURE__ */
|
|
749
|
+
}), /* @__PURE__ */ f("p", { children: Be(e.createdAt) ?? "—" })] }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
|
|
722
750
|
className: "font-medium text-foreground",
|
|
723
751
|
children: "Expires"
|
|
724
|
-
}), /* @__PURE__ */
|
|
752
|
+
}), /* @__PURE__ */ f("p", { children: Be(e.expiresAt) ?? "—" })] })]
|
|
725
753
|
}),
|
|
726
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
|
|
727
755
|
className: "mb-2 text-sm font-medium text-foreground",
|
|
728
756
|
children: "Roles"
|
|
729
|
-
}), /* @__PURE__ */
|
|
757
|
+
}), /* @__PURE__ */ f("div", {
|
|
730
758
|
className: "flex flex-wrap gap-2",
|
|
731
|
-
children: t.length > 0 ? t.map((t, n) => /* @__PURE__ */
|
|
759
|
+
children: t.length > 0 ? t.map((t, n) => /* @__PURE__ */ f(m, {
|
|
732
760
|
variant: "outline",
|
|
733
761
|
children: t
|
|
734
|
-
}, `${e.id}-${e.roleIds[n] ?? t}`)) : /* @__PURE__ */
|
|
762
|
+
}, `${e.id}-${e.roleIds[n] ?? t}`)) : /* @__PURE__ */ f("span", {
|
|
735
763
|
className: "text-sm text-muted-foreground",
|
|
736
764
|
children: "No roles selected"
|
|
737
765
|
})
|
|
738
766
|
})] }),
|
|
739
|
-
/* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
|
|
740
768
|
className: "mb-2 text-sm font-medium text-foreground",
|
|
741
769
|
children: "Projects"
|
|
742
|
-
}), /* @__PURE__ */
|
|
770
|
+
}), /* @__PURE__ */ f("div", {
|
|
743
771
|
className: "flex flex-wrap gap-2",
|
|
744
|
-
children: n.length > 0 ? n.map((t, n) => /* @__PURE__ */
|
|
772
|
+
children: n.length > 0 ? n.map((t, n) => /* @__PURE__ */ f(m, {
|
|
745
773
|
variant: "secondary",
|
|
746
774
|
children: t
|
|
747
|
-
}, `${e.id}-project-${t}-${n}`)) : /* @__PURE__ */
|
|
775
|
+
}, `${e.id}-project-${t}-${n}`)) : /* @__PURE__ */ f("span", {
|
|
748
776
|
className: "text-sm text-muted-foreground",
|
|
749
777
|
children: "No project access will be granted automatically"
|
|
750
778
|
})
|
|
751
779
|
})] })
|
|
752
780
|
]
|
|
753
|
-
}), /* @__PURE__ */
|
|
781
|
+
}), /* @__PURE__ */ p("div", {
|
|
754
782
|
className: "flex gap-2",
|
|
755
|
-
children: [/* @__PURE__ */
|
|
783
|
+
children: [/* @__PURE__ */ p(h, {
|
|
756
784
|
type: "button",
|
|
757
785
|
variant: "outline",
|
|
758
786
|
disabled: J || Y,
|
|
759
|
-
onClick: () =>
|
|
787
|
+
onClick: () => kt(e),
|
|
760
788
|
className: "gap-2",
|
|
761
|
-
children: [r && J ? /* @__PURE__ */
|
|
762
|
-
}), /* @__PURE__ */
|
|
789
|
+
children: [r && J ? /* @__PURE__ */ f(he, { className: "size-4 animate-spin" }) : /* @__PURE__ */ f(he, { className: "size-4" }), "Resend"]
|
|
790
|
+
}), /* @__PURE__ */ p(h, {
|
|
763
791
|
type: "button",
|
|
764
792
|
variant: "outline",
|
|
765
793
|
disabled: J || Y,
|
|
766
794
|
onClick: () => G(e),
|
|
767
795
|
className: "gap-2",
|
|
768
|
-
children: [r && Y ? /* @__PURE__ */
|
|
796
|
+
children: [r && Y ? /* @__PURE__ */ f(u, { className: "size-4 animate-spin" }) : /* @__PURE__ */ f(d, { className: "size-4" }), "Cancel"]
|
|
769
797
|
})]
|
|
770
798
|
})]
|
|
771
799
|
})
|
|
772
800
|
}, e.id);
|
|
773
|
-
})
|
|
801
|
+
})]
|
|
774
802
|
})] })] })
|
|
775
803
|
]
|
|
776
804
|
})] });
|
|
777
805
|
}
|
|
778
|
-
function
|
|
779
|
-
let { workspaceId: t } =
|
|
780
|
-
return /* @__PURE__ */
|
|
806
|
+
function We() {
|
|
807
|
+
let { workspaceId: t } = Ie(), { workspaceId: n } = e();
|
|
808
|
+
return /* @__PURE__ */ f(ye, {
|
|
781
809
|
scopeId: t || n || null,
|
|
782
810
|
gateway: "workspace",
|
|
783
811
|
debug: !1,
|
|
784
|
-
children: /* @__PURE__ */
|
|
812
|
+
children: /* @__PURE__ */ f(D, {})
|
|
785
813
|
});
|
|
786
814
|
}
|
|
787
815
|
//#endregion
|
|
788
|
-
export {
|
|
816
|
+
export { We as WorkspaceInvitePage };
|
|
789
817
|
|
|
790
818
|
//# sourceMappingURL=WorkspaceInvitePage.js.map
|