@burdenoff/microfe-workspaces 2026.531.2 → 2026.531.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.
- package/dist/WorkspacesRoutes.js +36 -17
- package/dist/WorkspacesRoutes.js.map +1 -1
- package/dist/components/InviteMemberDialog.js +204 -117
- package/dist/components/InviteMemberDialog.js.map +1 -1
- package/dist/components/MemberListItem.js +2 -1
- package/dist/components/MemberListItem.js.map +1 -1
- package/dist/components/ProjectMemberPickerDialog.js +211 -0
- package/dist/components/ProjectMemberPickerDialog.js.map +1 -0
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useMemberMutations.js +13 -13
- package/dist/hooks/useMemberMutations.js.map +1 -1
- package/dist/hooks/useProjectMemberMutations.js +104 -0
- package/dist/hooks/useProjectMemberMutations.js.map +1 -0
- package/dist/hooks/useProjectMembers.js +42 -0
- package/dist/hooks/useProjectMembers.js.map +1 -0
- package/dist/hooks/useWorkspaceMembers.js +60 -24
- package/dist/hooks/useWorkspaceMembers.js.map +1 -1
- package/dist/hooks/useWorkspacePermissions.js +4 -0
- package/dist/hooks/useWorkspacePermissions.js.map +1 -1
- package/dist/hooks/useWorkspacesEventEmitter.js.map +1 -1
- package/dist/index.js +16 -15
- package/dist/pages/ActivityListPage.js +5 -5
- package/dist/pages/InviteAcceptancePage.js +211 -207
- package/dist/pages/InviteAcceptancePage.js.map +1 -1
- package/dist/pages/MembersListPage.js +210 -208
- package/dist/pages/MembersListPage.js.map +1 -1
- package/dist/pages/PendingInvitesPage.js +124 -120
- package/dist/pages/PendingInvitesPage.js.map +1 -1
- package/dist/pages/ProjectDetailPage.js +249 -213
- package/dist/pages/ProjectDetailPage.js.map +1 -1
- package/dist/pages/ProjectMembersPage.js +265 -0
- package/dist/pages/ProjectMembersPage.js.map +1 -0
- package/dist/pages/ProjectsListPage.js +9 -9
- package/dist/pages/WorkspaceDetailPage.js +119 -111
- package/dist/pages/WorkspaceDetailPage.js.map +1 -1
- package/dist/pages/WorkspaceInvitePage.js +790 -0
- package/dist/pages/WorkspaceInvitePage.js.map +1 -0
- package/dist/pages/WorkspacesListPage.js +115 -100
- package/dist/pages/WorkspacesListPage.js.map +1 -1
- package/dist/utils/invitationDisplay.js +25 -0
- package/dist/utils/invitationDisplay.js.map +1 -0
- package/dist/utils/workspaceBulkInviteCsv.js +42 -0
- package/dist/utils/workspaceBulkInviteCsv.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,225 +1,227 @@
|
|
|
1
1
|
import { useWorkspacesContext as e } from "../providers/WorkspacesProvider.js";
|
|
2
2
|
import { useWorkspacesStore as t } from "../store/workspacesStore.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { useEffect as
|
|
13
|
-
import { AlertCircle as
|
|
14
|
-
import { jsx as
|
|
15
|
-
import { Badge as
|
|
16
|
-
import { useParams as
|
|
17
|
-
import { useDebounce as
|
|
18
|
-
import { PermissionButton as
|
|
19
|
-
import { useI18n as
|
|
20
|
-
import { useActorProfiles as
|
|
3
|
+
import { useScopedNavigation as n } from "../hooks/useScopedNavigation.js";
|
|
4
|
+
import { WORKSPACE_PERMISSIONS as r } from "../constants/permissions.js";
|
|
5
|
+
import { tWithFallback as i } from "../utils/i18n.js";
|
|
6
|
+
import { useWorkspacesPageView as a } from "../hooks/useWorkspacesPageView.js";
|
|
7
|
+
import { nativeConfirm as ee, nativeImpact as te } from "../utils/nativeBridge.js";
|
|
8
|
+
import { useWorkspaceInvitations as ne, useWorkspaceMembers as re } from "../hooks/useWorkspaceMembers.js";
|
|
9
|
+
import { useRemoveUserFromWorkspace as ie, useResendInvitation as ae } from "../hooks/useMemberMutations.js";
|
|
10
|
+
import { useWorkspacePermissions as oe } from "../hooks/useWorkspacePermissions.js";
|
|
11
|
+
import { MemberListItem as se } from "../components/MemberListItem.js";
|
|
12
|
+
import { useEffect as o, useMemo as s, useState as c } from "react";
|
|
13
|
+
import { AlertCircle as ce, RefreshCw as le, Search as l, UserPlus as u, Users as d } from "lucide-react";
|
|
14
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
15
|
+
import { Badge as m, Button as h, Input as ue, PageContainer as de, Skeleton as g } from "@burdenoff/fe-libs/ui";
|
|
16
|
+
import { useNavigate as fe, useParams as pe, useSearchParams as me } from "react-router-dom";
|
|
17
|
+
import { useDebounce as he } from "@burdenoff/fe-libs/shared/hooks";
|
|
18
|
+
import { PermissionButton as _ } from "@burdenoff/fe-libs/shared/components";
|
|
19
|
+
import { useI18n as ge } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
20
|
+
import { useActorProfiles as v } from "@burdenoff/fe-libs/shared";
|
|
21
21
|
//#region src/pages/MembersListPage.tsx
|
|
22
|
-
function
|
|
23
|
-
let { t:
|
|
24
|
-
|
|
25
|
-
workspaceId:
|
|
22
|
+
function y() {
|
|
23
|
+
let { t: y } = ge(), { memberFilters: _e, setMemberFilters: b, selectedMemberIds: x, toggleMemberSelection: S, clearMemberSelection: C } = t(), w = fe(), { workspaceId: ve } = e(), { basePath: T = "/workspaces" } = e(), { withCurrentSearch: E } = n(), { workspaceId: ye } = pe(), D = ye || ve;
|
|
24
|
+
a("workspaces.members", {
|
|
25
|
+
workspaceId: D,
|
|
26
26
|
requireParams: !0
|
|
27
27
|
});
|
|
28
|
-
let [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
let { data:
|
|
33
|
-
|
|
28
|
+
let [O, be] = c(_e.search || ""), k = he(O, 500);
|
|
29
|
+
o(() => {
|
|
30
|
+
b({ search: k });
|
|
31
|
+
}, [k, b]);
|
|
32
|
+
let { data: A, isLoading: xe, error: j } = re(D || ""), { data: M, isLoading: Se } = ne(D || "", "PENDING"), { mutate: N, isPending: P } = ae(), { mutate: Ce, isPending: we } = ie(), [F, I] = c(null), [L, R] = c(/* @__PURE__ */ new Set()), Te = (e) => {
|
|
33
|
+
I(e), N(e, {
|
|
34
34
|
onSuccess: () => {
|
|
35
|
-
|
|
35
|
+
I(null);
|
|
36
36
|
},
|
|
37
37
|
onError: (e) => {
|
|
38
|
-
console.error("Failed to resend invitation:", e),
|
|
38
|
+
console.error("Failed to resend invitation:", e), I(null);
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
|
-
},
|
|
41
|
+
}, z = s(() => A?.items || [], [A?.items]), B = s(() => M?.items || [], [M?.items]), V = xe || Se, H = z.length > 0, U = B.length > 0, { apiGatewayUrl: Ee, authToken: De, organizationId: Oe } = e(), ke = v(s(() => z.map((e) => ({
|
|
42
42
|
actorId: e.userId,
|
|
43
43
|
actorType: "user"
|
|
44
|
-
})), [
|
|
45
|
-
apiGatewayUrl:
|
|
46
|
-
authToken:
|
|
47
|
-
orgId:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
})), [z]), {
|
|
45
|
+
apiGatewayUrl: Ee,
|
|
46
|
+
authToken: De,
|
|
47
|
+
orgId: Oe,
|
|
48
|
+
workspaceId: D
|
|
49
|
+
}), W = z.filter((e) => {
|
|
50
|
+
if (!k) return !0;
|
|
51
|
+
let t = k.toLowerCase(), n = ke[e.userId];
|
|
51
52
|
if (n && (n.displayName.toLowerCase().includes(t) || n.email?.toLowerCase().includes(t))) return !0;
|
|
52
53
|
let r = e.context?.metadata, i = typeof r?.email == "string" ? r.email : "", a = typeof r?.displayName == "string" ? r.displayName : typeof r?.name == "string" ? r.name : "";
|
|
53
54
|
return i.toLowerCase().includes(t) || a.toLowerCase().includes(t) ? !0 : e.userId.toLowerCase().includes(t);
|
|
54
|
-
}),
|
|
55
|
-
|
|
56
|
-
let [Y, X] =
|
|
57
|
-
|
|
58
|
-
if (Y.get("invite") === "true" &&
|
|
59
|
-
T({ id: E });
|
|
55
|
+
}), G = s(() => W.filter((e) => x.has(e.id)), [W, x]), K = s(() => B.filter((e) => L.has(e.id)), [B, L]), q = W.length > 0 && W.every((e) => x.has(e.id)), Ae = W.some((e) => x.has(e.id)) && !q, J = B.length > 0 && B.every((e) => L.has(e.id)), je = B.some((e) => L.has(e.id)) && !J;
|
|
56
|
+
o(() => () => C(), [C]);
|
|
57
|
+
let [Y, X] = me();
|
|
58
|
+
o(() => {
|
|
59
|
+
if (Y.get("invite") === "true" && D) {
|
|
60
60
|
let e = new URLSearchParams(Y);
|
|
61
|
-
e.delete("invite"), X(e, { replace: !0 });
|
|
61
|
+
e.delete("invite"), X(e, { replace: !0 }), w(E(`${T}/${D}/invite`), { replace: !0 });
|
|
62
62
|
}
|
|
63
63
|
}, [
|
|
64
64
|
Y,
|
|
65
65
|
X,
|
|
66
|
+
D,
|
|
67
|
+
w,
|
|
66
68
|
E,
|
|
67
69
|
T
|
|
68
70
|
]);
|
|
69
|
-
let { canListMembers:
|
|
70
|
-
if (
|
|
71
|
+
let { canListMembers: Me, canInviteMember: Z, canRemoveMember: Q, isLoading: Ne } = oe();
|
|
72
|
+
if (Ne) return /* @__PURE__ */ p("div", {
|
|
71
73
|
className: "space-y-4 p-6",
|
|
72
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ f(g, { className: "h-10 w-1/3" }), /* @__PURE__ */ f(g, { className: "h-64" })]
|
|
73
75
|
});
|
|
74
|
-
if (!
|
|
76
|
+
if (!Me && !Z) return /* @__PURE__ */ f("div", {
|
|
75
77
|
className: "flex items-center justify-center min-h-[400px]",
|
|
76
|
-
children: /* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ p("div", {
|
|
77
79
|
className: "text-center space-y-2",
|
|
78
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ f("h2", {
|
|
79
81
|
className: "text-lg font-semibold",
|
|
80
|
-
children:
|
|
81
|
-
}), /* @__PURE__ */
|
|
82
|
+
children: i(y, "membersList.accessDenied", "Access Denied")
|
|
83
|
+
}), /* @__PURE__ */ f("p", {
|
|
82
84
|
className: "text-sm text-muted-foreground",
|
|
83
|
-
children:
|
|
85
|
+
children: i(y, "membersList.noPermissionToViewMembers", "You don't have permission to view workspace members.")
|
|
84
86
|
})]
|
|
85
87
|
})
|
|
86
88
|
});
|
|
87
89
|
let $ = () => {
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
e !==
|
|
90
|
+
D && w(E(`${T}/${D}/invite`));
|
|
91
|
+
}, Pe = (e) => {
|
|
92
|
+
W.forEach((t) => {
|
|
93
|
+
e !== x.has(t.id) && S(t.id);
|
|
92
94
|
});
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
+
}, Fe = (e, t) => {
|
|
96
|
+
R((n) => {
|
|
95
97
|
let r = new Set(n);
|
|
96
98
|
return t ? r.add(e) : r.delete(e), r;
|
|
97
99
|
});
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
+
}, Ie = (e) => {
|
|
101
|
+
R((t) => {
|
|
100
102
|
let n = new Set(t);
|
|
101
|
-
return
|
|
103
|
+
return B.forEach((t) => {
|
|
102
104
|
e ? n.add(t.id) : n.delete(t.id);
|
|
103
105
|
}), n;
|
|
104
106
|
});
|
|
105
|
-
},
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
-
let e = `${
|
|
107
|
+
}, Le = async () => {
|
|
108
|
+
if (G.length === 0) return;
|
|
109
|
+
te("medium");
|
|
110
|
+
let e = `${i(y, "membersList.bulkRemoveConfirmPrefix", "Remove")} ${G.length} ${G.length === 1 ? i(y, "membersList.bulkRemoveConfirmSingular", "selected member") : i(y, "membersList.bulkRemoveConfirmPlural", "selected members")} ${i(y, "membersList.bulkRemoveConfirmSuffix", "from this workspace?")}`, t = await ee({
|
|
109
111
|
title: "Remove members",
|
|
110
112
|
message: e,
|
|
111
113
|
okButtonTitle: "Remove",
|
|
112
114
|
cancelButtonTitle: "Cancel"
|
|
113
115
|
});
|
|
114
|
-
(t === null ? window.confirm(e) : t) && (
|
|
115
|
-
|
|
116
|
-
}),
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
(t === null ? window.confirm(e) : t) && (G.forEach((e) => {
|
|
117
|
+
Ce(e.userId);
|
|
118
|
+
}), C());
|
|
119
|
+
}, Re = () => {
|
|
120
|
+
K.length !== 0 && K.forEach((e) => {
|
|
121
|
+
N(e.id, { onSuccess: () => {
|
|
122
|
+
R((t) => {
|
|
121
123
|
let n = new Set(t);
|
|
122
124
|
return n.delete(e.id), n;
|
|
123
125
|
});
|
|
124
126
|
} });
|
|
125
127
|
});
|
|
126
128
|
};
|
|
127
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ f(de, {
|
|
128
130
|
padded: !1,
|
|
129
|
-
children:
|
|
131
|
+
children: /* @__PURE__ */ p("div", {
|
|
130
132
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6",
|
|
131
133
|
children: [
|
|
132
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ p("div", {
|
|
133
135
|
className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",
|
|
134
|
-
children: [/* @__PURE__ */
|
|
136
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
|
|
135
137
|
className: "text-2xl sm:text-3xl font-bold",
|
|
136
|
-
children:
|
|
137
|
-
}), /* @__PURE__ */
|
|
138
|
+
children: i(y, "membersList.pageTitle", "Members")
|
|
139
|
+
}), /* @__PURE__ */ f("p", {
|
|
138
140
|
className: "text-muted-foreground text-sm sm:text-base",
|
|
139
|
-
children:
|
|
140
|
-
})] }), /* @__PURE__ */
|
|
141
|
+
children: i(y, "membersList.pageSubtitle", "Manage workspace members and invitations")
|
|
142
|
+
})] }), /* @__PURE__ */ f("div", {
|
|
141
143
|
className: "flex gap-2",
|
|
142
|
-
children: /* @__PURE__ */
|
|
143
|
-
permission:
|
|
144
|
+
children: /* @__PURE__ */ f(_, {
|
|
145
|
+
permission: r.MEMBER_CREATE,
|
|
144
146
|
deniedBehavior: "disable",
|
|
145
|
-
deniedTooltip:
|
|
146
|
-
children: /* @__PURE__ */ h
|
|
147
|
+
deniedTooltip: i(y, "membersList.noPermissionToInvite", "You don't have permission to invite members"),
|
|
148
|
+
children: /* @__PURE__ */ p(h, {
|
|
147
149
|
onClick: $,
|
|
148
|
-
disabled: !
|
|
149
|
-
children: [/* @__PURE__ */
|
|
150
|
+
disabled: !D,
|
|
151
|
+
children: [/* @__PURE__ */ f(u, { className: "size-4 sm:mr-2" }), /* @__PURE__ */ f("span", {
|
|
150
152
|
className: "hidden sm:inline",
|
|
151
|
-
children:
|
|
153
|
+
children: i(y, "membersList.inviteMember", "Invite Member")
|
|
152
154
|
})]
|
|
153
155
|
})
|
|
154
156
|
})
|
|
155
157
|
})]
|
|
156
158
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ p("div", {
|
|
158
160
|
className: "flex flex-col sm:flex-row gap-3 sm:gap-4",
|
|
159
|
-
children: [/* @__PURE__ */
|
|
161
|
+
children: [/* @__PURE__ */ p("div", {
|
|
160
162
|
className: "relative flex-1",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
162
|
-
placeholder:
|
|
163
|
-
value:
|
|
164
|
-
onChange: (e) =>
|
|
163
|
+
children: [/* @__PURE__ */ f(l, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }), /* @__PURE__ */ f(ue, {
|
|
164
|
+
placeholder: i(y, "membersList.searchPlaceholder", "Search members..."),
|
|
165
|
+
value: O,
|
|
166
|
+
onChange: (e) => be(e.target.value),
|
|
165
167
|
className: "pl-9"
|
|
166
168
|
})]
|
|
167
|
-
}),
|
|
169
|
+
}), U && /* @__PURE__ */ f("div", {
|
|
168
170
|
className: "flex items-center gap-2",
|
|
169
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ p(m, {
|
|
170
172
|
variant: "secondary",
|
|
171
173
|
className: "text-sm",
|
|
172
174
|
children: [
|
|
173
|
-
|
|
175
|
+
B.length,
|
|
174
176
|
" ",
|
|
175
|
-
|
|
177
|
+
B.length === 1 ? i(y, "membersList.pendingInvitation", "Pending Invitation") : i(y, "membersList.pendingInvitations", "Pending Invitations")
|
|
176
178
|
]
|
|
177
179
|
})
|
|
178
180
|
})]
|
|
179
181
|
}),
|
|
180
|
-
|
|
182
|
+
W.length > 0 && /* @__PURE__ */ p("div", {
|
|
181
183
|
className: "flex flex-col gap-3 rounded-lg border bg-card p-4 sm:flex-row sm:items-center sm:justify-between",
|
|
182
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ p("label", {
|
|
183
185
|
className: "flex items-center gap-2 text-sm text-foreground",
|
|
184
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ f("input", {
|
|
185
187
|
type: "checkbox",
|
|
186
|
-
checked:
|
|
188
|
+
checked: q,
|
|
187
189
|
ref: (e) => {
|
|
188
|
-
e && (e.indeterminate =
|
|
190
|
+
e && (e.indeterminate = Ae && !q);
|
|
189
191
|
},
|
|
190
|
-
onChange: (e) =>
|
|
191
|
-
"aria-label":
|
|
192
|
+
onChange: (e) => Pe(e.target.checked),
|
|
193
|
+
"aria-label": i(y, "membersList.selectAllMembersAriaLabel", "Select all workspace members"),
|
|
192
194
|
className: "size-4 rounded border-border text-primary"
|
|
193
|
-
}), /* @__PURE__ */
|
|
194
|
-
}), /* @__PURE__ */
|
|
195
|
+
}), /* @__PURE__ */ f("span", { children: i(y, "membersList.selectAllVisibleMembers", "Select all visible members") })]
|
|
196
|
+
}), /* @__PURE__ */ p("div", {
|
|
195
197
|
className: "flex flex-wrap items-center gap-2",
|
|
196
198
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ p("span", {
|
|
198
200
|
className: "text-sm text-muted-foreground",
|
|
199
201
|
children: [
|
|
200
|
-
|
|
202
|
+
x.size,
|
|
201
203
|
" ",
|
|
202
|
-
|
|
204
|
+
i(y, "membersList.selected", "selected")
|
|
203
205
|
]
|
|
204
206
|
}),
|
|
205
|
-
|
|
207
|
+
x.size > 0 && /* @__PURE__ */ f(h, {
|
|
206
208
|
variant: "ghost",
|
|
207
209
|
size: "sm",
|
|
208
|
-
onClick:
|
|
209
|
-
children:
|
|
210
|
+
onClick: C,
|
|
211
|
+
children: i(y, "membersList.clearSelection", "Clear selection")
|
|
210
212
|
}),
|
|
211
|
-
Q && /* @__PURE__ */ h
|
|
213
|
+
Q && /* @__PURE__ */ p(h, {
|
|
212
214
|
variant: "outline",
|
|
213
215
|
size: "sm",
|
|
214
|
-
onClick:
|
|
215
|
-
disabled:
|
|
216
|
+
onClick: Le,
|
|
217
|
+
disabled: G.length === 0 || we,
|
|
216
218
|
className: "text-destructive",
|
|
217
|
-
children: [
|
|
219
|
+
children: [i(y, "membersList.removeSelected", "Remove Selected"), G.length > 0 ? ` (${G.length})` : ""]
|
|
218
220
|
})
|
|
219
221
|
]
|
|
220
222
|
})]
|
|
221
223
|
}),
|
|
222
|
-
|
|
224
|
+
V && /* @__PURE__ */ f("div", {
|
|
223
225
|
className: "space-y-3",
|
|
224
226
|
children: [...[
|
|
225
227
|
,
|
|
@@ -227,217 +229,217 @@ function b() {
|
|
|
227
229
|
,
|
|
228
230
|
,
|
|
229
231
|
,
|
|
230
|
-
]].map((e, t) => /* @__PURE__ */
|
|
232
|
+
]].map((e, t) => /* @__PURE__ */ f(g, { className: "h-20 w-full" }, t))
|
|
231
233
|
}),
|
|
232
|
-
!
|
|
234
|
+
!V && j && /* @__PURE__ */ p("div", {
|
|
233
235
|
className: "flex flex-col items-center justify-center py-12 text-center",
|
|
234
236
|
children: [
|
|
235
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ f("div", {
|
|
236
238
|
className: "rounded-full bg-destructive/10 p-6 mb-4",
|
|
237
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ f(ce, {
|
|
238
240
|
size: 48,
|
|
239
241
|
className: "text-destructive"
|
|
240
242
|
})
|
|
241
243
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ f("h3", {
|
|
243
245
|
className: "text-lg font-semibold mb-2",
|
|
244
|
-
children:
|
|
246
|
+
children: i(y, "membersList.failedToLoad", "Failed to Load Members")
|
|
245
247
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ f("p", {
|
|
247
249
|
className: "text-muted-foreground max-w-sm",
|
|
248
|
-
children:
|
|
250
|
+
children: j instanceof Error ? j.message : i(y, "membersList.errorLoadingMembers", "An error occurred while loading members")
|
|
249
251
|
})
|
|
250
252
|
]
|
|
251
253
|
}),
|
|
252
|
-
!
|
|
254
|
+
!V && !j && !D && /* @__PURE__ */ p("div", {
|
|
253
255
|
className: "flex flex-col items-center justify-center py-12 text-center",
|
|
254
256
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ f("div", {
|
|
256
258
|
className: "rounded-full bg-muted p-6 mb-4",
|
|
257
|
-
children: /* @__PURE__ */
|
|
259
|
+
children: /* @__PURE__ */ f(d, {
|
|
258
260
|
size: 48,
|
|
259
261
|
className: "text-muted-foreground"
|
|
260
262
|
})
|
|
261
263
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ f("h3", {
|
|
263
265
|
className: "text-lg font-semibold mb-2",
|
|
264
|
-
children:
|
|
266
|
+
children: i(y, "membersList.noWorkspaceSelected", "No Workspace Selected")
|
|
265
267
|
}),
|
|
266
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ f("p", {
|
|
267
269
|
className: "text-muted-foreground max-w-sm",
|
|
268
|
-
children:
|
|
270
|
+
children: i(y, "membersList.selectWorkspacePrompt", "Select a workspace to view and manage its members")
|
|
269
271
|
})
|
|
270
272
|
]
|
|
271
273
|
}),
|
|
272
|
-
!
|
|
274
|
+
!V && !j && D && !H && /* @__PURE__ */ p("div", {
|
|
273
275
|
className: "flex flex-col items-center justify-center py-12 text-center",
|
|
274
276
|
children: [
|
|
275
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ f("div", {
|
|
276
278
|
className: "rounded-full bg-muted p-6 mb-4",
|
|
277
|
-
children: /* @__PURE__ */
|
|
279
|
+
children: /* @__PURE__ */ f(d, {
|
|
278
280
|
size: 48,
|
|
279
281
|
className: "text-muted-foreground"
|
|
280
282
|
})
|
|
281
283
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ f("h3", {
|
|
283
285
|
className: "text-lg font-semibold mb-2",
|
|
284
|
-
children:
|
|
286
|
+
children: i(y, "membersList.noMembersYet", "No Members Yet")
|
|
285
287
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ f("p", {
|
|
287
289
|
className: "text-muted-foreground max-w-sm mb-4",
|
|
288
|
-
children:
|
|
290
|
+
children: i(y, "membersList.noMembersPrompt", "Start building your team by inviting members to this workspace")
|
|
289
291
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
permission:
|
|
292
|
+
/* @__PURE__ */ f(_, {
|
|
293
|
+
permission: r.MEMBER_CREATE,
|
|
292
294
|
deniedBehavior: "disable",
|
|
293
|
-
deniedTooltip:
|
|
294
|
-
children: /* @__PURE__ */ h
|
|
295
|
+
deniedTooltip: i(y, "membersList.noPermissionToInvite", "You don't have permission to invite members"),
|
|
296
|
+
children: /* @__PURE__ */ p(h, {
|
|
295
297
|
onClick: $,
|
|
296
|
-
children: [/* @__PURE__ */
|
|
298
|
+
children: [/* @__PURE__ */ f(u, { className: "mr-2 size-4" }), i(y, "membersList.inviteFirstMember", "Invite Your First Member")]
|
|
297
299
|
})
|
|
298
300
|
})
|
|
299
301
|
]
|
|
300
302
|
}),
|
|
301
|
-
!
|
|
303
|
+
!V && !j && D && H && W.length === 0 && /* @__PURE__ */ p("div", {
|
|
302
304
|
className: "flex flex-col items-center justify-center py-12 text-center",
|
|
303
305
|
children: [
|
|
304
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ f("div", {
|
|
305
307
|
className: "rounded-full bg-muted p-6 mb-4",
|
|
306
|
-
children: /* @__PURE__ */
|
|
308
|
+
children: /* @__PURE__ */ f(l, {
|
|
307
309
|
size: 48,
|
|
308
310
|
className: "text-muted-foreground"
|
|
309
311
|
})
|
|
310
312
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ f("h3", {
|
|
312
314
|
className: "text-lg font-semibold mb-2",
|
|
313
|
-
children:
|
|
315
|
+
children: i(y, "membersList.noMembersFound", "No Members Found")
|
|
314
316
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ f("p", {
|
|
316
318
|
className: "text-muted-foreground max-w-sm",
|
|
317
|
-
children:
|
|
319
|
+
children: i(y, "membersList.noMembersFoundPrompt", "No members match your search criteria. Try adjusting your search.")
|
|
318
320
|
})
|
|
319
321
|
]
|
|
320
322
|
}),
|
|
321
|
-
!
|
|
323
|
+
!V && W.length > 0 && /* @__PURE__ */ p("div", {
|
|
322
324
|
className: "space-y-3",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ f("div", {
|
|
324
326
|
className: "flex items-center justify-between",
|
|
325
|
-
children: /* @__PURE__ */
|
|
327
|
+
children: /* @__PURE__ */ p("h2", {
|
|
326
328
|
className: "text-lg font-semibold",
|
|
327
329
|
children: [
|
|
328
|
-
|
|
330
|
+
i(y, "membersList.activeMembers", "Active Members"),
|
|
329
331
|
" (",
|
|
330
|
-
|
|
332
|
+
W.length,
|
|
331
333
|
")"
|
|
332
334
|
]
|
|
333
335
|
})
|
|
334
|
-
}), /* @__PURE__ */
|
|
336
|
+
}), /* @__PURE__ */ f("div", {
|
|
335
337
|
className: "space-y-2",
|
|
336
|
-
children:
|
|
338
|
+
children: W.map((e) => /* @__PURE__ */ f(se, {
|
|
337
339
|
member: e,
|
|
338
|
-
selected:
|
|
340
|
+
selected: x.has(e.id),
|
|
339
341
|
onToggleSelect: (t) => {
|
|
340
|
-
t !==
|
|
342
|
+
t !== x.has(e.id) && S(e.id);
|
|
341
343
|
},
|
|
342
344
|
canRemove: Q
|
|
343
345
|
}, e.id))
|
|
344
346
|
})]
|
|
345
347
|
}),
|
|
346
|
-
!
|
|
348
|
+
!V && U && /* @__PURE__ */ p("div", {
|
|
347
349
|
className: "space-y-3",
|
|
348
350
|
children: [
|
|
349
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ f("h2", {
|
|
350
352
|
className: "text-lg font-semibold",
|
|
351
|
-
children:
|
|
353
|
+
children: i(y, "membersList.pendingInvitationsHeader", "Pending Invitations")
|
|
352
354
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ p("div", {
|
|
354
356
|
className: "flex flex-col gap-3 rounded-lg border bg-card p-4 sm:flex-row sm:items-center sm:justify-between",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ p("label", {
|
|
356
358
|
className: "flex items-center gap-2 text-sm text-foreground",
|
|
357
|
-
children: [/* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ f("input", {
|
|
358
360
|
type: "checkbox",
|
|
359
|
-
checked:
|
|
361
|
+
checked: J,
|
|
360
362
|
ref: (e) => {
|
|
361
|
-
e && (e.indeterminate =
|
|
363
|
+
e && (e.indeterminate = je && !J);
|
|
362
364
|
},
|
|
363
|
-
onChange: (e) =>
|
|
364
|
-
"aria-label":
|
|
365
|
+
onChange: (e) => Ie(e.target.checked),
|
|
366
|
+
"aria-label": i(y, "membersList.selectAllInvitationsAriaLabel", "Select all pending invitations"),
|
|
365
367
|
className: "size-4 rounded border-border text-primary"
|
|
366
|
-
}), /* @__PURE__ */
|
|
367
|
-
}), /* @__PURE__ */
|
|
368
|
+
}), /* @__PURE__ */ f("span", { children: i(y, "membersList.selectAllInvitations", "Select all invitations") })]
|
|
369
|
+
}), /* @__PURE__ */ p("div", {
|
|
368
370
|
className: "flex flex-wrap items-center gap-2",
|
|
369
371
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ p("span", {
|
|
371
373
|
className: "text-sm text-muted-foreground",
|
|
372
374
|
children: [
|
|
373
|
-
|
|
375
|
+
L.size,
|
|
374
376
|
" ",
|
|
375
|
-
|
|
377
|
+
i(y, "membersList.selected", "selected")
|
|
376
378
|
]
|
|
377
379
|
}),
|
|
378
|
-
|
|
380
|
+
L.size > 0 && /* @__PURE__ */ f(h, {
|
|
379
381
|
variant: "ghost",
|
|
380
382
|
size: "sm",
|
|
381
|
-
onClick: () =>
|
|
382
|
-
children:
|
|
383
|
+
onClick: () => R(/* @__PURE__ */ new Set()),
|
|
384
|
+
children: i(y, "membersList.clearSelection", "Clear selection")
|
|
383
385
|
}),
|
|
384
|
-
Z && /* @__PURE__ */ h
|
|
386
|
+
Z && /* @__PURE__ */ p(h, {
|
|
385
387
|
variant: "outline",
|
|
386
388
|
size: "sm",
|
|
387
|
-
onClick:
|
|
388
|
-
disabled:
|
|
389
|
-
children: [
|
|
389
|
+
onClick: Re,
|
|
390
|
+
disabled: K.length === 0 || P,
|
|
391
|
+
children: [i(y, "membersList.resendSelected", "Resend Selected"), K.length > 0 ? ` (${K.length})` : ""]
|
|
390
392
|
})
|
|
391
393
|
]
|
|
392
394
|
})]
|
|
393
395
|
}),
|
|
394
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ f("div", {
|
|
395
397
|
className: "space-y-2",
|
|
396
|
-
children:
|
|
398
|
+
children: B.map((e) => /* @__PURE__ */ p("div", {
|
|
397
399
|
className: "flex items-center justify-between p-4 border rounded-lg bg-card",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ p("div", {
|
|
399
401
|
className: "flex items-center gap-3",
|
|
400
402
|
children: [
|
|
401
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ f("input", {
|
|
402
404
|
type: "checkbox",
|
|
403
|
-
checked:
|
|
404
|
-
onChange: (t) =>
|
|
405
|
-
"aria-label": `${
|
|
405
|
+
checked: L.has(e.id),
|
|
406
|
+
onChange: (t) => Fe(e.id, t.target.checked),
|
|
407
|
+
"aria-label": `${i(y, "membersList.selectInvitationAriaLabel", "Select invitation")} ${e.email}`,
|
|
406
408
|
className: "size-4 rounded border-border text-primary"
|
|
407
409
|
}),
|
|
408
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ f("div", {
|
|
409
411
|
className: "size-10 rounded-full bg-status-warning/10 flex items-center justify-center transition-colors",
|
|
410
|
-
children: /* @__PURE__ */
|
|
412
|
+
children: /* @__PURE__ */ f(d, { className: "size-5 text-status-warning" })
|
|
411
413
|
}),
|
|
412
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
|
|
413
415
|
className: "font-medium text-sm",
|
|
414
416
|
children: e.email
|
|
415
|
-
}), /* @__PURE__ */
|
|
417
|
+
}), /* @__PURE__ */ p("p", {
|
|
416
418
|
className: "text-xs text-muted-foreground",
|
|
417
419
|
children: [
|
|
418
|
-
|
|
420
|
+
i(y, "membersList.invited", "Invited"),
|
|
419
421
|
" ",
|
|
420
422
|
new Date(e.createdAt).toLocaleDateString()
|
|
421
423
|
]
|
|
422
424
|
})] })
|
|
423
425
|
]
|
|
424
|
-
}), /* @__PURE__ */
|
|
426
|
+
}), /* @__PURE__ */ p("div", {
|
|
425
427
|
className: "flex items-center gap-2",
|
|
426
|
-
children: [/* @__PURE__ */
|
|
427
|
-
permission:
|
|
428
|
+
children: [/* @__PURE__ */ f(_, {
|
|
429
|
+
permission: r.MEMBER_CREATE,
|
|
428
430
|
deniedBehavior: "disable",
|
|
429
|
-
deniedTooltip:
|
|
430
|
-
children: /* @__PURE__ */ h
|
|
431
|
+
deniedTooltip: i(y, "membersList.noPermissionToResend", "You don't have permission to resend invitations"),
|
|
432
|
+
children: /* @__PURE__ */ p(h, {
|
|
431
433
|
variant: "outline",
|
|
432
434
|
size: "sm",
|
|
433
|
-
onClick: () =>
|
|
434
|
-
disabled:
|
|
435
|
-
children: [/* @__PURE__ */
|
|
435
|
+
onClick: () => Te(e.id),
|
|
436
|
+
disabled: P && F === e.id,
|
|
437
|
+
children: [/* @__PURE__ */ f(le, { className: `size-4 mr-1 ${P && F === e.id ? "animate-spin" : ""}` }), P && F === e.id ? i(y, "membersList.sending", "Sending...") : i(y, "membersList.resend", "Resend")]
|
|
436
438
|
})
|
|
437
|
-
}), /* @__PURE__ */ m
|
|
439
|
+
}), /* @__PURE__ */ f(m, {
|
|
438
440
|
variant: "outline",
|
|
439
441
|
className: "bg-status-warning/10 text-status-warning border-status-warning/30 transition-colors",
|
|
440
|
-
children:
|
|
442
|
+
children: i(y, "membersList.pending", "Pending")
|
|
441
443
|
})]
|
|
442
444
|
})]
|
|
443
445
|
}, e.id))
|
|
@@ -445,10 +447,10 @@ function b() {
|
|
|
445
447
|
]
|
|
446
448
|
})
|
|
447
449
|
]
|
|
448
|
-
})
|
|
450
|
+
})
|
|
449
451
|
});
|
|
450
452
|
}
|
|
451
453
|
//#endregion
|
|
452
|
-
export {
|
|
454
|
+
export { y as MembersListPage };
|
|
453
455
|
|
|
454
456
|
//# sourceMappingURL=MembersListPage.js.map
|