@firecms/user_management 3.0.0-canary.41 → 3.0.0-canary.43
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/LICENSE +113 -21
- package/dist/hooks/useFirestoreUserManagement.d.ts +6 -0
- package/dist/index.es.js +487 -430
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/user_management.d.ts +3 -1
- package/dist/useUserManagementPlugin.d.ts +6 -1
- package/package.json +11 -11
- package/src/hooks/useFirestoreUserManagement.tsx +15 -16
- package/src/types/user_management.tsx +4 -1
- package/src/useUserManagementPlugin.tsx +88 -2
package/dist/index.es.js
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
import F, { useEffect as
|
2
|
-
import { getFirestore as
|
1
|
+
import F, { useEffect as ce, useCallback as k, useContext as Ie, useState as P } from "react";
|
2
|
+
import { getFirestore as Y, onSnapshot as ue, collection as ee, setDoc as me, doc as H, addDoc as Fe, deleteDoc as he } from "firebase/firestore";
|
3
3
|
import { jsx as e, jsxs as s, Fragment as K } from "react/jsx-runtime";
|
4
|
-
import { getColorSchemeForSeed as
|
5
|
-
import * as
|
6
|
-
import { toSnakeCase as Be, FieldCaption as B, DeleteConfirmationDialog as
|
7
|
-
import { useCreateFormex as
|
8
|
-
import { format as
|
9
|
-
import * as
|
10
|
-
const
|
4
|
+
import { getColorSchemeForSeed as Pe, Chip as Ae, Dialog as fe, DialogContent as ge, Typography as A, TextField as Q, Paper as pe, Table as re, TableHeader as ie, TableCell as d, TableBody as oe, TableRow as W, Tooltip as V, Checkbox as I, Select as ne, SelectItem as L, DialogActions as Ce, Button as O, LoadingButton as ve, DoneIcon as we, IconButton as ye, DeleteIcon as be, CenteredView as Ne, Container as Ue, AddIcon as le, MultiSelect as Te, MultiSelectItem as Le } from "@firecms/ui";
|
5
|
+
import * as M from "yup";
|
6
|
+
import { toSnakeCase as Be, FieldCaption as B, DeleteConfirmationDialog as xe, useNavigationController as _e, useSnackbarController as se, useAuthController as ae, useCustomizationController as Ve, defaultDateFormat as Me } from "@firecms/core";
|
7
|
+
import { useCreateFormex as Re, getIn as J, Formex as De } from "@firecms/formex";
|
8
|
+
import { format as Oe } from "date-fns";
|
9
|
+
import * as $e from "date-fns/locale";
|
10
|
+
const fn = ["Admin"], qe = {
|
11
11
|
read: !1,
|
12
12
|
edit: !1,
|
13
13
|
create: !1,
|
14
14
|
delete: !1
|
15
15
|
};
|
16
|
-
function
|
16
|
+
function Ye({
|
17
17
|
collection: t,
|
18
|
-
user:
|
18
|
+
user: r
|
19
19
|
}) {
|
20
|
-
const n =
|
20
|
+
const n = r?.roles;
|
21
21
|
if (n) {
|
22
|
-
if (t.ownerId ===
|
22
|
+
if (t.ownerId === r?.uid)
|
23
23
|
return {
|
24
24
|
read: !0,
|
25
25
|
create: !0,
|
@@ -27,303 +27,299 @@ function qe({
|
|
27
27
|
delete: !0
|
28
28
|
};
|
29
29
|
{
|
30
|
-
const
|
30
|
+
const l = {
|
31
31
|
read: !1,
|
32
32
|
create: !1,
|
33
33
|
edit: !1,
|
34
34
|
delete: !1
|
35
35
|
};
|
36
|
-
return n.map((
|
36
|
+
return n.map((i) => We(i, t.id)).reduce(te, l);
|
37
37
|
}
|
38
38
|
} else
|
39
|
-
return
|
39
|
+
return qe;
|
40
40
|
}
|
41
|
-
function
|
41
|
+
function We(t, r) {
|
42
42
|
const n = {
|
43
43
|
read: t.isAdmin || t.defaultPermissions?.read,
|
44
44
|
create: t.isAdmin || t.defaultPermissions?.create,
|
45
45
|
edit: t.isAdmin || t.defaultPermissions?.edit,
|
46
46
|
delete: t.isAdmin || t.defaultPermissions?.delete
|
47
47
|
};
|
48
|
-
return t.collectionPermissions && t.collectionPermissions[
|
48
|
+
return t.collectionPermissions && t.collectionPermissions[r] ? te(t.collectionPermissions[r], n) : t.defaultPermissions ? te(t.defaultPermissions, n) : n;
|
49
49
|
}
|
50
|
-
const te = (t,
|
51
|
-
read: t.read ||
|
52
|
-
create: t.create ||
|
53
|
-
edit: t.edit ||
|
54
|
-
delete: t.delete ||
|
50
|
+
const te = (t, r) => ({
|
51
|
+
read: t.read || r.read,
|
52
|
+
create: t.create || r.create,
|
53
|
+
edit: t.edit || r.edit,
|
54
|
+
delete: t.delete || r.delete
|
55
55
|
});
|
56
|
-
function
|
57
|
-
return t ?
|
56
|
+
function gn(t, r) {
|
57
|
+
return t ? r.roles ? r.roles.map((n) => t.find((l) => l.id === n.id)).filter(Boolean) : [] : void 0;
|
58
58
|
}
|
59
|
-
const
|
60
|
-
const n = t.map((
|
61
|
-
return n.length ===
|
59
|
+
const je = (t, r) => {
|
60
|
+
const n = t.map((i) => i.id), l = r.map((i) => i.id);
|
61
|
+
return n.length === r.length && n.every((i) => l.includes(i));
|
62
62
|
};
|
63
|
-
function
|
64
|
-
if (!
|
63
|
+
function pn(t, r) {
|
64
|
+
if (!r)
|
65
65
|
return;
|
66
|
-
const n =
|
66
|
+
const n = ze(r), l = new Date(n.exp * 1e3);
|
67
67
|
localStorage.setItem(`auth_token::${t}`, JSON.stringify({
|
68
|
-
token:
|
69
|
-
expiry:
|
68
|
+
token: r,
|
69
|
+
expiry: l
|
70
70
|
}));
|
71
71
|
}
|
72
|
-
function
|
73
|
-
const
|
74
|
-
if (
|
75
|
-
const n = JSON.parse(
|
72
|
+
function Cn(t) {
|
73
|
+
const r = localStorage.getItem(`auth_token::${t}`);
|
74
|
+
if (r) {
|
75
|
+
const n = JSON.parse(r);
|
76
76
|
if (n.expiry = new Date(n.expiry), n.expiry > /* @__PURE__ */ new Date())
|
77
77
|
return n.token;
|
78
78
|
}
|
79
79
|
}
|
80
|
-
function
|
80
|
+
function vn() {
|
81
81
|
for (let t = 0; t < localStorage.length; t++) {
|
82
|
-
const
|
83
|
-
|
82
|
+
const r = localStorage.key(t);
|
83
|
+
r?.startsWith("auth_token::") && localStorage.removeItem(r);
|
84
84
|
}
|
85
85
|
}
|
86
|
-
function
|
86
|
+
function ze(t) {
|
87
87
|
if (!t)
|
88
88
|
throw new Error("No JWT token");
|
89
|
-
const n = t.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"),
|
90
|
-
return "%" + ("00" +
|
89
|
+
const n = t.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), l = decodeURIComponent(window.atob(n).split("").map(function(i) {
|
90
|
+
return "%" + ("00" + i.charCodeAt(0).toString(16)).slice(-2);
|
91
91
|
}).join(""));
|
92
|
-
return JSON.parse(
|
92
|
+
return JSON.parse(l);
|
93
93
|
}
|
94
|
-
function
|
94
|
+
function wn(t, r = 10) {
|
95
95
|
if (!/^#([0-9A-Fa-f]{3}){1,2}$/.test(t))
|
96
96
|
throw new Error("Invalid color format");
|
97
97
|
let n = t.substring(1).split("");
|
98
98
|
n.length === 3 && (n = [n[0], n[0], n[1], n[1], n[2], n[2]]);
|
99
|
-
let
|
100
|
-
return
|
99
|
+
let l = parseInt(n[0] + n[1], 16), i = parseInt(n[2] + n[3], 16), m = parseInt(n[4] + n[5], 16);
|
100
|
+
return l = Math.floor(l * (1 - r / 100)), i = Math.floor(i * (1 - r / 100)), m = Math.floor(m * (1 - r / 100)), "#" + (l < 16 ? "0" : "") + l.toString(16) + (i < 16 ? "0" : "") + i.toString(16) + (m < 16 ? "0" : "") + m.toString(16);
|
101
101
|
}
|
102
|
-
function
|
102
|
+
function yn(t, r = 10) {
|
103
103
|
if (!/^#([0-9A-Fa-f]{3}){1,2}$/.test(t))
|
104
104
|
throw new Error("Invalid color format");
|
105
105
|
let n = t.substring(1).split("");
|
106
106
|
n.length === 3 && (n = [n[0], n[0], n[1], n[1], n[2], n[2]]);
|
107
|
-
const
|
108
|
-
return `rgba(${
|
107
|
+
const l = parseInt(n[0] + n[1], 16), i = parseInt(n[2] + n[3], 16), m = parseInt(n[4] + n[5], 16), f = r / 100;
|
108
|
+
return `rgba(${l}, ${i}, ${m}, ${f})`;
|
109
109
|
}
|
110
|
-
function
|
110
|
+
function bn({
|
111
111
|
firebaseApp: t,
|
112
|
-
usersPath:
|
112
|
+
usersPath: r = "__FIRECMS/config/users",
|
113
113
|
rolesPath: n = "__FIRECMS/config/roles",
|
114
|
-
usersLimit:
|
115
|
-
canEditRoles:
|
116
|
-
allowDefaultRolesCreation:
|
117
|
-
includeCollectionConfigPermissions:
|
114
|
+
usersLimit: l,
|
115
|
+
canEditRoles: i = !0,
|
116
|
+
allowDefaultRolesCreation: m,
|
117
|
+
includeCollectionConfigPermissions: f
|
118
118
|
}) {
|
119
|
-
const [
|
120
|
-
...
|
121
|
-
roles: S.filter((
|
122
|
-
})), [b,
|
123
|
-
|
124
|
-
rolesLoading: g,
|
125
|
-
usersLoading: w,
|
126
|
-
roles: S,
|
127
|
-
usersWithRoleIds: l,
|
128
|
-
users: y
|
129
|
-
}), se(() => {
|
119
|
+
const [v, R] = F.useState(!0), [w, c] = F.useState(!0), [S, U] = F.useState([]), [a, C] = F.useState([]), y = a.map((g) => ({
|
120
|
+
...g,
|
121
|
+
roles: S.filter((p) => g.roles?.includes(p.id))
|
122
|
+
})), [b, _] = F.useState(), [z, u] = F.useState(), h = v || w;
|
123
|
+
ce(() => {
|
130
124
|
if (!t || !n)
|
131
125
|
return;
|
132
|
-
const
|
133
|
-
return
|
134
|
-
ee(
|
126
|
+
const g = Y(t);
|
127
|
+
return ue(
|
128
|
+
ee(g, n),
|
135
129
|
{
|
136
|
-
next: (
|
137
|
-
|
130
|
+
next: (p) => {
|
131
|
+
_(void 0);
|
138
132
|
try {
|
139
|
-
const
|
140
|
-
N
|
141
|
-
} catch (
|
142
|
-
|
133
|
+
const N = Ge(p.docs);
|
134
|
+
U(N);
|
135
|
+
} catch (N) {
|
136
|
+
console.error("Error loading roles", N), _(N);
|
143
137
|
}
|
144
138
|
R(!1);
|
145
139
|
},
|
146
|
-
error: (
|
147
|
-
|
140
|
+
error: (p) => {
|
141
|
+
console.error("Error loading roles", p), _(p), R(!1);
|
148
142
|
}
|
149
143
|
}
|
150
144
|
);
|
151
|
-
}, [t, n]),
|
152
|
-
if (!t || !
|
145
|
+
}, [t, n]), ce(() => {
|
146
|
+
if (!t || !r)
|
153
147
|
return;
|
154
|
-
const
|
155
|
-
return
|
156
|
-
ee(
|
148
|
+
const g = Y(t);
|
149
|
+
return ue(
|
150
|
+
ee(g, r),
|
157
151
|
{
|
158
|
-
next: (
|
152
|
+
next: (p) => {
|
159
153
|
u(void 0);
|
160
154
|
try {
|
161
|
-
const
|
162
|
-
|
163
|
-
} catch (
|
164
|
-
u(
|
155
|
+
const N = Je(p.docs);
|
156
|
+
C(N);
|
157
|
+
} catch (N) {
|
158
|
+
console.error("Error loading users", N), u(N);
|
165
159
|
}
|
166
160
|
c(!1);
|
167
161
|
},
|
168
|
-
error: (
|
169
|
-
u(
|
162
|
+
error: (p) => {
|
163
|
+
console.error("Error loading users", p), u(p), c(!1);
|
170
164
|
}
|
171
165
|
}
|
172
166
|
);
|
173
|
-
}, [t,
|
174
|
-
const x = k(async (
|
167
|
+
}, [t, r]);
|
168
|
+
const x = k(async (g) => {
|
175
169
|
if (!t)
|
176
170
|
throw Error("useFirestoreUserManagement Firebase not initialised");
|
177
|
-
const
|
178
|
-
if (!
|
171
|
+
const p = Y(t);
|
172
|
+
if (!p || !r)
|
179
173
|
throw Error("useFirestoreUserManagement Firestore not initialised");
|
180
|
-
console.debug("Persisting user",
|
181
|
-
const
|
182
|
-
uid:
|
174
|
+
console.debug("Persisting user", g);
|
175
|
+
const N = g.roles?.map((ke) => ke.id), {
|
176
|
+
uid: q,
|
183
177
|
...Z
|
184
|
-
} =
|
178
|
+
} = g, de = {
|
185
179
|
...Z,
|
186
|
-
roles:
|
180
|
+
roles: N
|
187
181
|
};
|
188
|
-
return
|
189
|
-
}, [
|
182
|
+
return q ? me(H(p, r, q), de, { merge: !0 }).then(() => g) : Fe(ee(p, r), de).then(() => g);
|
183
|
+
}, [r, t]), D = k((g) => {
|
190
184
|
if (!t)
|
191
185
|
throw Error("useFirestoreUserManagement Firebase not initialised");
|
192
|
-
const
|
193
|
-
if (!
|
186
|
+
const p = Y(t);
|
187
|
+
if (!p || !n)
|
194
188
|
throw Error("useFirestoreUserManagement Firestore not initialised");
|
195
|
-
console.debug("Persisting role",
|
189
|
+
console.debug("Persisting role", g);
|
196
190
|
const {
|
197
|
-
id:
|
198
|
-
|
199
|
-
} =
|
200
|
-
return
|
201
|
-
}, [n, t]),
|
191
|
+
id: N,
|
192
|
+
...q
|
193
|
+
} = g, Z = H(p, n, N);
|
194
|
+
return me(Z, q, { merge: !0 });
|
195
|
+
}, [n, t]), T = k(async (g) => {
|
202
196
|
if (!t)
|
203
197
|
throw Error("useFirestoreUserManagement Firebase not initialised");
|
204
|
-
const
|
205
|
-
if (!
|
198
|
+
const p = Y(t);
|
199
|
+
if (!p || !r)
|
206
200
|
throw Error("useFirestoreUserManagement Firestore not initialised");
|
207
|
-
console.debug("Deleting",
|
208
|
-
const { uid:
|
209
|
-
return
|
210
|
-
}, [
|
201
|
+
console.debug("Deleting", g);
|
202
|
+
const { uid: N } = g;
|
203
|
+
return he(H(p, r, N));
|
204
|
+
}, [r, t]), o = k((g) => {
|
211
205
|
if (!t)
|
212
206
|
throw Error("useFirestoreUserManagement Firebase not initialised");
|
213
|
-
const
|
214
|
-
if (!
|
207
|
+
const p = Y(t);
|
208
|
+
if (!p || !n)
|
215
209
|
throw Error("useFirestoreUserManagement Firestore not initialised");
|
216
|
-
console.debug("Deleting",
|
217
|
-
const { id:
|
218
|
-
return
|
210
|
+
console.debug("Deleting", g);
|
211
|
+
const { id: N } = g, q = H(p, n, N);
|
212
|
+
return he(q);
|
219
213
|
}, [n, t]), E = k(({
|
220
|
-
collection:
|
221
|
-
user:
|
222
|
-
}) =>
|
223
|
-
collection:
|
224
|
-
user:
|
225
|
-
}), []),
|
214
|
+
collection: g,
|
215
|
+
user: p
|
216
|
+
}) => Ye({
|
217
|
+
collection: g,
|
218
|
+
user: p
|
219
|
+
}), []), $ = k((g) => {
|
226
220
|
if (!y)
|
227
221
|
throw Error("Users not loaded");
|
228
|
-
return y.find((
|
229
|
-
}, [y]), G = k(({ user:
|
230
|
-
if (console.
|
231
|
-
return console.
|
232
|
-
if (y.length === 0 || y.find((
|
222
|
+
return y.find((N) => N.email?.toLowerCase() === g?.email?.toLowerCase())?.roles;
|
223
|
+
}, [y]), G = k(({ user: g }) => {
|
224
|
+
if (console.debug("Authenticating user", g), h)
|
225
|
+
return console.warn("User management is still loading"), !1;
|
226
|
+
if (y.length === 0 || y.find((N) => N.email?.toLowerCase() === g?.email?.toLowerCase()))
|
233
227
|
return !0;
|
234
|
-
throw Error("Could not find a user with the provided email");
|
235
|
-
}, [
|
228
|
+
throw Error("Could not find a user with the provided email in the user management system.");
|
229
|
+
}, [h, y]);
|
236
230
|
return {
|
237
|
-
loading:
|
231
|
+
loading: h,
|
238
232
|
roles: S,
|
239
233
|
users: y,
|
240
234
|
saveUser: x,
|
241
235
|
saveRole: D,
|
242
|
-
|
236
|
+
rolesError: b,
|
237
|
+
deleteUser: T,
|
243
238
|
deleteRole: o,
|
244
|
-
usersLimit:
|
245
|
-
|
246
|
-
|
247
|
-
|
239
|
+
usersLimit: l,
|
240
|
+
usersError: z,
|
241
|
+
canEditRoles: i === void 0 ? !0 : i,
|
242
|
+
allowDefaultRolesCreation: m === void 0 ? !0 : m,
|
243
|
+
includeCollectionConfigPermissions: !!f,
|
248
244
|
collectionPermissions: E,
|
249
|
-
defineRolesFor:
|
245
|
+
defineRolesFor: $,
|
250
246
|
authenticator: G
|
251
247
|
};
|
252
248
|
}
|
253
|
-
const
|
254
|
-
const n =
|
249
|
+
const Je = (t) => t.map((r) => {
|
250
|
+
const n = r.data();
|
255
251
|
return {
|
256
|
-
uid:
|
252
|
+
uid: r.id,
|
257
253
|
...n,
|
258
254
|
created_on: n?.created_on?.toDate(),
|
259
255
|
updated_on: n?.updated_on?.toDate()
|
260
256
|
};
|
261
|
-
}),
|
262
|
-
id:
|
263
|
-
...
|
264
|
-
})),
|
265
|
-
function
|
257
|
+
}), Ge = (t) => t.map((r) => ({
|
258
|
+
id: r.id,
|
259
|
+
...r.data()
|
260
|
+
})), Ee = F.createContext({});
|
261
|
+
function He({
|
266
262
|
children: t,
|
267
|
-
userManagement:
|
263
|
+
userManagement: r
|
268
264
|
}) {
|
269
|
-
return /* @__PURE__ */ e(
|
265
|
+
return /* @__PURE__ */ e(Ee.Provider, { value: r, children: t });
|
270
266
|
}
|
271
|
-
const j = () => Ee
|
267
|
+
const j = () => Ie(Ee);
|
272
268
|
function X({ role: t }) {
|
273
|
-
let
|
274
|
-
return t.isAdmin ?
|
275
|
-
|
269
|
+
let r;
|
270
|
+
return t.isAdmin ? r = "blueDarker" : t.id === "editor" ? r = "yellowLight" : t.id === "viewer" ? r = "grayLight" : r = Pe(t.id), /* @__PURE__ */ e(
|
271
|
+
Ae,
|
276
272
|
{
|
277
|
-
colorScheme:
|
273
|
+
colorScheme: r,
|
278
274
|
children: t.name
|
279
275
|
},
|
280
276
|
t.id
|
281
277
|
);
|
282
278
|
}
|
283
|
-
const
|
284
|
-
id:
|
285
|
-
name:
|
279
|
+
const Ke = M.object().shape({
|
280
|
+
id: M.string().required("Required"),
|
281
|
+
name: M.string().required("Required")
|
286
282
|
});
|
287
|
-
function
|
283
|
+
function Qe({
|
288
284
|
open: t,
|
289
|
-
role:
|
285
|
+
role: r,
|
290
286
|
editable: n,
|
291
|
-
handleClose:
|
292
|
-
collections:
|
287
|
+
handleClose: l,
|
288
|
+
collections: i
|
293
289
|
}) {
|
294
|
-
const { saveRole:
|
295
|
-
initialValues:
|
290
|
+
const { saveRole: m } = j(), f = !r, [v, R] = P(), w = k((o) => (R(void 0), m(o)), [m]), c = Re({
|
291
|
+
initialValues: r ?? {
|
296
292
|
name: ""
|
297
293
|
},
|
298
294
|
onSubmit: (o, E) => w(o).then(() => {
|
299
295
|
E.resetForm({
|
300
296
|
values: o
|
301
|
-
}),
|
302
|
-
}).catch((
|
303
|
-
validation: (o) =>
|
304
|
-
const
|
297
|
+
}), l();
|
298
|
+
}).catch(($) => R($)),
|
299
|
+
validation: (o) => Ke.validate(o, { abortEarly: !1 }).then(() => ({})).catch((E) => {
|
300
|
+
const $ = {};
|
305
301
|
return E.inner.forEach((G) => {
|
306
|
-
|
307
|
-
}),
|
302
|
+
$[G.path] = G.message;
|
303
|
+
}), $;
|
308
304
|
})
|
309
305
|
}), {
|
310
306
|
isSubmitting: S,
|
311
|
-
touched:
|
312
|
-
values:
|
313
|
-
errors:
|
307
|
+
touched: U,
|
308
|
+
values: a,
|
309
|
+
errors: C,
|
314
310
|
handleChange: y,
|
315
311
|
setFieldValue: b,
|
316
|
-
dirty:
|
317
|
-
setFieldTouched:
|
318
|
-
} = c, u =
|
312
|
+
dirty: _,
|
313
|
+
setFieldTouched: z
|
314
|
+
} = c, u = a.isAdmin ?? !1, h = a.defaultPermissions?.create ?? !1, x = a.defaultPermissions?.read ?? !1, D = a.defaultPermissions?.edit ?? !1, T = a.defaultPermissions?.delete ?? !1;
|
319
315
|
return F.useEffect(() => {
|
320
|
-
!
|
321
|
-
}, [
|
322
|
-
|
316
|
+
!J(U, "id") && a.name && b("id", Be(a.name));
|
317
|
+
}, [U, a.name]), /* @__PURE__ */ e(
|
318
|
+
fe,
|
323
319
|
{
|
324
320
|
open: t,
|
325
321
|
maxWidth: "4xl",
|
326
|
-
children: /* @__PURE__ */ e(
|
322
|
+
children: /* @__PURE__ */ e(De, { value: c, children: /* @__PURE__ */ s(
|
327
323
|
"form",
|
328
324
|
{
|
329
325
|
noValidate: !0,
|
@@ -336,13 +332,13 @@ function Ke({
|
|
336
332
|
height: "100%"
|
337
333
|
},
|
338
334
|
children: [
|
339
|
-
/* @__PURE__ */ s(
|
335
|
+
/* @__PURE__ */ s(ge, { className: "flex-grow", children: [
|
340
336
|
/* @__PURE__ */ e(
|
341
337
|
"div",
|
342
338
|
{
|
343
339
|
className: "flex flex-row pt-12 pb-8",
|
344
340
|
children: /* @__PURE__ */ e(
|
345
|
-
|
341
|
+
A,
|
346
342
|
{
|
347
343
|
variant: "h4",
|
348
344
|
className: "flex-grow",
|
@@ -358,15 +354,15 @@ function Ke({
|
|
358
354
|
{
|
359
355
|
name: "name",
|
360
356
|
required: !0,
|
361
|
-
error:
|
362
|
-
value:
|
357
|
+
error: U.name && !!C.name,
|
358
|
+
value: a.name,
|
363
359
|
disabled: u || !n,
|
364
360
|
onChange: y,
|
365
361
|
"aria-describedby": "name-helper-text",
|
366
362
|
label: "Name"
|
367
363
|
}
|
368
364
|
),
|
369
|
-
/* @__PURE__ */ e(B, { children:
|
365
|
+
/* @__PURE__ */ e(B, { children: U.name && C.name ? C.name : "Name of this role" })
|
370
366
|
] }),
|
371
367
|
/* @__PURE__ */ s("div", { className: "col-span-12 md:col-span-4", children: [
|
372
368
|
/* @__PURE__ */ e(
|
@@ -374,49 +370,49 @@ function Ke({
|
|
374
370
|
{
|
375
371
|
name: "id",
|
376
372
|
required: !0,
|
377
|
-
error:
|
378
|
-
value:
|
379
|
-
disabled: !
|
373
|
+
error: U.id && !!C.id,
|
374
|
+
value: a.id,
|
375
|
+
disabled: !f || !n,
|
380
376
|
onChange: (o) => {
|
381
|
-
y(o),
|
377
|
+
y(o), z("id", !0);
|
382
378
|
},
|
383
379
|
"aria-describedby": "id-helper-text",
|
384
380
|
label: "ID"
|
385
381
|
}
|
386
382
|
),
|
387
|
-
/* @__PURE__ */ e(B, { children:
|
383
|
+
/* @__PURE__ */ e(B, { children: U.id && C.id ? C.id : "ID of this role" })
|
388
384
|
] }),
|
389
385
|
/* @__PURE__ */ s("div", { className: "col-span-12", children: [
|
390
386
|
/* @__PURE__ */ e(
|
391
|
-
|
387
|
+
pe,
|
392
388
|
{
|
393
389
|
className: "bg-inherit",
|
394
|
-
children: /* @__PURE__ */ s(
|
395
|
-
/* @__PURE__ */ s(
|
396
|
-
/* @__PURE__ */ e(
|
390
|
+
children: /* @__PURE__ */ s(re, { children: [
|
391
|
+
/* @__PURE__ */ s(ie, { children: [
|
392
|
+
/* @__PURE__ */ e(d, {}),
|
397
393
|
/* @__PURE__ */ e(
|
398
|
-
|
394
|
+
d,
|
399
395
|
{
|
400
396
|
align: "center",
|
401
397
|
children: "Create entities"
|
402
398
|
}
|
403
399
|
),
|
404
400
|
/* @__PURE__ */ e(
|
405
|
-
|
401
|
+
d,
|
406
402
|
{
|
407
403
|
align: "center",
|
408
404
|
children: "Read entities"
|
409
405
|
}
|
410
406
|
),
|
411
407
|
/* @__PURE__ */ e(
|
412
|
-
|
408
|
+
d,
|
413
409
|
{
|
414
410
|
align: "center",
|
415
411
|
children: "Update entities"
|
416
412
|
}
|
417
413
|
),
|
418
414
|
/* @__PURE__ */ e(
|
419
|
-
|
415
|
+
d,
|
420
416
|
{
|
421
417
|
align: "center",
|
422
418
|
children: "Delete entities"
|
@@ -424,27 +420,27 @@ function Ke({
|
|
424
420
|
)
|
425
421
|
] }),
|
426
422
|
/* @__PURE__ */ s(oe, { children: [
|
427
|
-
/* @__PURE__ */ s(
|
423
|
+
/* @__PURE__ */ s(W, { children: [
|
428
424
|
/* @__PURE__ */ e(
|
429
|
-
|
425
|
+
d,
|
430
426
|
{
|
431
427
|
scope: "row",
|
432
428
|
children: /* @__PURE__ */ e("strong", { children: "All collections" })
|
433
429
|
}
|
434
430
|
),
|
435
431
|
/* @__PURE__ */ e(
|
436
|
-
|
432
|
+
d,
|
437
433
|
{
|
438
434
|
align: "center",
|
439
435
|
children: /* @__PURE__ */ e(
|
440
|
-
|
436
|
+
V,
|
441
437
|
{
|
442
438
|
title: "Create entities in collections",
|
443
439
|
children: /* @__PURE__ */ e(
|
444
440
|
I,
|
445
441
|
{
|
446
442
|
disabled: u || !n,
|
447
|
-
checked: (u ||
|
443
|
+
checked: (u || h) ?? !1,
|
448
444
|
onCheckedChange: (o) => b("defaultPermissions.create", o)
|
449
445
|
}
|
450
446
|
)
|
@@ -453,11 +449,11 @@ function Ke({
|
|
453
449
|
}
|
454
450
|
),
|
455
451
|
/* @__PURE__ */ e(
|
456
|
-
|
452
|
+
d,
|
457
453
|
{
|
458
454
|
align: "center",
|
459
455
|
children: /* @__PURE__ */ e(
|
460
|
-
|
456
|
+
V,
|
461
457
|
{
|
462
458
|
title: "Access all data in every collection",
|
463
459
|
children: /* @__PURE__ */ e(
|
@@ -473,11 +469,11 @@ function Ke({
|
|
473
469
|
}
|
474
470
|
),
|
475
471
|
/* @__PURE__ */ e(
|
476
|
-
|
472
|
+
d,
|
477
473
|
{
|
478
474
|
align: "center",
|
479
475
|
children: /* @__PURE__ */ e(
|
480
|
-
|
476
|
+
V,
|
481
477
|
{
|
482
478
|
title: "Update data in any collection",
|
483
479
|
children: /* @__PURE__ */ e(
|
@@ -493,18 +489,18 @@ function Ke({
|
|
493
489
|
}
|
494
490
|
),
|
495
491
|
/* @__PURE__ */ e(
|
496
|
-
|
492
|
+
d,
|
497
493
|
{
|
498
494
|
align: "center",
|
499
495
|
children: /* @__PURE__ */ e(
|
500
|
-
|
496
|
+
V,
|
501
497
|
{
|
502
498
|
title: "Delete data in any collection",
|
503
499
|
children: /* @__PURE__ */ e(
|
504
500
|
I,
|
505
501
|
{
|
506
502
|
disabled: u || !n,
|
507
|
-
checked: (u ||
|
503
|
+
checked: (u || T) ?? !1,
|
508
504
|
onCheckedChange: (o) => b("defaultPermissions.delete", o)
|
509
505
|
}
|
510
506
|
)
|
@@ -513,65 +509,65 @@ function Ke({
|
|
513
509
|
}
|
514
510
|
)
|
515
511
|
] }),
|
516
|
-
|
512
|
+
i && i.map((o) => /* @__PURE__ */ s(W, { children: [
|
517
513
|
/* @__PURE__ */ e(
|
518
|
-
|
514
|
+
d,
|
519
515
|
{
|
520
516
|
scope: "row",
|
521
517
|
children: o.name
|
522
518
|
}
|
523
519
|
),
|
524
520
|
/* @__PURE__ */ e(
|
525
|
-
|
521
|
+
d,
|
526
522
|
{
|
527
523
|
align: "center",
|
528
524
|
children: /* @__PURE__ */ e(
|
529
525
|
I,
|
530
526
|
{
|
531
|
-
disabled: u ||
|
532
|
-
checked: (u ||
|
527
|
+
disabled: u || h || !n,
|
528
|
+
checked: (u || h || J(a, `collectionPermissions.${o.path}.create`)) ?? !1,
|
533
529
|
onCheckedChange: (E) => b(`collectionPermissions.${o.path}.create`, E)
|
534
530
|
}
|
535
531
|
)
|
536
532
|
}
|
537
533
|
),
|
538
534
|
/* @__PURE__ */ e(
|
539
|
-
|
535
|
+
d,
|
540
536
|
{
|
541
537
|
align: "center",
|
542
538
|
children: /* @__PURE__ */ e(
|
543
539
|
I,
|
544
540
|
{
|
545
541
|
disabled: u || x || !n,
|
546
|
-
checked: (u || x ||
|
542
|
+
checked: (u || x || J(a, `collectionPermissions.${o.path}.read`)) ?? !1,
|
547
543
|
onCheckedChange: (E) => b(`collectionPermissions.${o.path}.read`, E)
|
548
544
|
}
|
549
545
|
)
|
550
546
|
}
|
551
547
|
),
|
552
548
|
/* @__PURE__ */ e(
|
553
|
-
|
549
|
+
d,
|
554
550
|
{
|
555
551
|
align: "center",
|
556
552
|
children: /* @__PURE__ */ e(
|
557
553
|
I,
|
558
554
|
{
|
559
555
|
disabled: u || D || !n,
|
560
|
-
checked: (u || D ||
|
556
|
+
checked: (u || D || J(a, `collectionPermissions.${o.path}.edit`)) ?? !1,
|
561
557
|
onCheckedChange: (E) => b(`collectionPermissions.${o.path}.edit`, E)
|
562
558
|
}
|
563
559
|
)
|
564
560
|
}
|
565
561
|
),
|
566
562
|
/* @__PURE__ */ e(
|
567
|
-
|
563
|
+
d,
|
568
564
|
{
|
569
565
|
align: "center",
|
570
566
|
children: /* @__PURE__ */ e(
|
571
567
|
I,
|
572
568
|
{
|
573
|
-
disabled: u ||
|
574
|
-
checked: (u ||
|
569
|
+
disabled: u || T || !n,
|
570
|
+
checked: (u || T || J(a, `collectionPermissions.${o.path}.delete`)) ?? !1,
|
575
571
|
onCheckedChange: (E) => b(`collectionPermissions.${o.path}.delete`, E)
|
576
572
|
}
|
577
573
|
)
|
@@ -588,25 +584,25 @@ function Ke({
|
|
588
584
|
/* @__PURE__ */ s(
|
589
585
|
ne,
|
590
586
|
{
|
591
|
-
error:
|
587
|
+
error: U.config && !!C.config,
|
592
588
|
id: "createCollections",
|
593
589
|
name: "createCollections",
|
594
590
|
label: "Create collections",
|
595
591
|
position: "item-aligned",
|
596
592
|
disabled: u || !n,
|
597
593
|
onChange: (o) => b("config.createCollections", o.target.value === "true"),
|
598
|
-
value: u ||
|
594
|
+
value: u || a.config?.createCollections ? "true" : "false",
|
599
595
|
renderValue: (o) => o === "true" ? "Yes" : "No",
|
600
596
|
children: [
|
601
597
|
/* @__PURE__ */ e(
|
602
|
-
|
598
|
+
L,
|
603
599
|
{
|
604
600
|
value: "true",
|
605
601
|
children: " Yes "
|
606
602
|
}
|
607
603
|
),
|
608
604
|
/* @__PURE__ */ e(
|
609
|
-
|
605
|
+
L,
|
610
606
|
{
|
611
607
|
value: "false",
|
612
608
|
children: " No "
|
@@ -615,38 +611,38 @@ function Ke({
|
|
615
611
|
]
|
616
612
|
}
|
617
613
|
),
|
618
|
-
/* @__PURE__ */ e(B, { children:
|
614
|
+
/* @__PURE__ */ e(B, { children: U.config && C.config ? C.config : "Can the user create collections" })
|
619
615
|
] }),
|
620
616
|
/* @__PURE__ */ s("div", { className: "col-span-12 md:col-span-4", children: [
|
621
617
|
/* @__PURE__ */ s(
|
622
618
|
ne,
|
623
619
|
{
|
624
|
-
error:
|
620
|
+
error: U.config && !!C.config,
|
625
621
|
id: "editCollections",
|
626
622
|
name: "editCollections",
|
627
623
|
label: "Edit collections",
|
628
624
|
disabled: u || !n,
|
629
625
|
position: "item-aligned",
|
630
626
|
onChange: (o) => b("config.editCollections", o.target.value === "own" ? "own" : o.target.value === "true"),
|
631
|
-
value: u ? "true" :
|
627
|
+
value: u ? "true" : a.config?.editCollections === "own" ? "own" : a.config?.editCollections ? "true" : "false",
|
632
628
|
renderValue: (o) => o === "own" ? "Own" : o === "true" ? "Yes" : "No",
|
633
629
|
children: [
|
634
630
|
/* @__PURE__ */ e(
|
635
|
-
|
631
|
+
L,
|
636
632
|
{
|
637
633
|
value: "true",
|
638
634
|
children: " Yes "
|
639
635
|
}
|
640
636
|
),
|
641
637
|
/* @__PURE__ */ e(
|
642
|
-
|
638
|
+
L,
|
643
639
|
{
|
644
640
|
value: "false",
|
645
641
|
children: " No "
|
646
642
|
}
|
647
643
|
),
|
648
644
|
/* @__PURE__ */ e(
|
649
|
-
|
645
|
+
L,
|
650
646
|
{
|
651
647
|
value: "own",
|
652
648
|
children: " Only his/her own "
|
@@ -655,38 +651,38 @@ function Ke({
|
|
655
651
|
]
|
656
652
|
}
|
657
653
|
),
|
658
|
-
/* @__PURE__ */ e(B, { children:
|
654
|
+
/* @__PURE__ */ e(B, { children: U.config && C.config ? C.config : "Can the user edit collections" })
|
659
655
|
] }),
|
660
656
|
/* @__PURE__ */ s("div", { className: "col-span-12 md:col-span-4", children: [
|
661
657
|
/* @__PURE__ */ s(
|
662
658
|
ne,
|
663
659
|
{
|
664
|
-
error:
|
660
|
+
error: U.config && !!C.config,
|
665
661
|
id: "deleteCollections",
|
666
662
|
name: "deleteCollections",
|
667
663
|
label: "Delete collections",
|
668
664
|
disabled: u || !n,
|
669
665
|
position: "item-aligned",
|
670
666
|
onChange: (o) => b("config.deleteCollections", o.target.value === "own" ? "own" : o.target.value === "true"),
|
671
|
-
value: u ? "true" :
|
667
|
+
value: u ? "true" : a.config?.deleteCollections === "own" ? "own" : a.config?.deleteCollections ? "true" : "false",
|
672
668
|
renderValue: (o) => o === "own" ? "Own" : o === "true" ? "Yes" : "No",
|
673
669
|
children: [
|
674
670
|
/* @__PURE__ */ e(
|
675
|
-
|
671
|
+
L,
|
676
672
|
{
|
677
673
|
value: "true",
|
678
674
|
children: " Yes "
|
679
675
|
}
|
680
676
|
),
|
681
677
|
/* @__PURE__ */ e(
|
682
|
-
|
678
|
+
L,
|
683
679
|
{
|
684
680
|
value: "false",
|
685
681
|
children: " No "
|
686
682
|
}
|
687
683
|
),
|
688
684
|
/* @__PURE__ */ e(
|
689
|
-
|
685
|
+
L,
|
690
686
|
{
|
691
687
|
value: "own",
|
692
688
|
children: " Only his/her own "
|
@@ -695,32 +691,32 @@ function Ke({
|
|
695
691
|
]
|
696
692
|
}
|
697
693
|
),
|
698
|
-
/* @__PURE__ */ e(B, { children:
|
694
|
+
/* @__PURE__ */ e(B, { children: U.config && C.config ? C.config : "Can the user delete collections" })
|
699
695
|
] })
|
700
696
|
] })
|
701
697
|
] }),
|
702
|
-
/* @__PURE__ */ s(
|
703
|
-
|
698
|
+
/* @__PURE__ */ s(Ce, { position: "sticky", children: [
|
699
|
+
v && /* @__PURE__ */ e(A, { className: "text-red-500", children: "There was an error saving this role" }),
|
704
700
|
/* @__PURE__ */ e(
|
705
|
-
|
701
|
+
O,
|
706
702
|
{
|
707
703
|
variant: "text",
|
708
704
|
onClick: () => {
|
709
|
-
|
705
|
+
l();
|
710
706
|
},
|
711
707
|
children: "Cancel"
|
712
708
|
}
|
713
709
|
),
|
714
710
|
/* @__PURE__ */ e(
|
715
|
-
|
711
|
+
ve,
|
716
712
|
{
|
717
713
|
variant: "filled",
|
718
714
|
color: "primary",
|
719
715
|
type: "submit",
|
720
|
-
disabled: !
|
716
|
+
disabled: !_,
|
721
717
|
loading: S,
|
722
|
-
startIcon: /* @__PURE__ */ e(
|
723
|
-
children:
|
718
|
+
startIcon: /* @__PURE__ */ e(we, {}),
|
719
|
+
children: f ? "Create role" : "Update"
|
724
720
|
}
|
725
721
|
)
|
726
722
|
] })
|
@@ -730,7 +726,7 @@ function Ke({
|
|
730
726
|
}
|
731
727
|
);
|
732
728
|
}
|
733
|
-
const
|
729
|
+
const Se = [
|
734
730
|
{
|
735
731
|
id: "admin",
|
736
732
|
name: "Admin",
|
@@ -766,67 +762,67 @@ const Qe = [
|
|
766
762
|
];
|
767
763
|
function Xe({
|
768
764
|
onRoleClicked: t,
|
769
|
-
editable:
|
765
|
+
editable: r
|
770
766
|
}) {
|
771
767
|
const {
|
772
768
|
roles: n,
|
773
|
-
saveRole:
|
774
|
-
deleteRole:
|
775
|
-
allowDefaultRolesCreation:
|
776
|
-
} = j(), [
|
769
|
+
saveRole: l,
|
770
|
+
deleteRole: i,
|
771
|
+
allowDefaultRolesCreation: m
|
772
|
+
} = j(), [f, v] = P(void 0), [R, w] = P(!1);
|
777
773
|
return /* @__PURE__ */ s(
|
778
774
|
"div",
|
779
775
|
{
|
780
776
|
className: "w-full overflow-auto",
|
781
777
|
children: [
|
782
|
-
/* @__PURE__ */ s(
|
783
|
-
/* @__PURE__ */ s(
|
784
|
-
/* @__PURE__ */ e(
|
785
|
-
/* @__PURE__ */ e(
|
786
|
-
/* @__PURE__ */ e(
|
787
|
-
/* @__PURE__ */ e(
|
778
|
+
/* @__PURE__ */ s(re, { children: [
|
779
|
+
/* @__PURE__ */ s(ie, { children: [
|
780
|
+
/* @__PURE__ */ e(d, { header: !0, className: "w-16" }),
|
781
|
+
/* @__PURE__ */ e(d, { header: !0, children: "Role" }),
|
782
|
+
/* @__PURE__ */ e(d, { header: !0, className: "items-center", children: "Is Admin" }),
|
783
|
+
/* @__PURE__ */ e(d, { header: !0, children: "Default permissions" })
|
788
784
|
] }),
|
789
785
|
/* @__PURE__ */ s(oe, { children: [
|
790
786
|
n && n.map((c) => {
|
791
|
-
const S = c.isAdmin || c.defaultPermissions?.create,
|
787
|
+
const S = c.isAdmin || c.defaultPermissions?.create, U = c.isAdmin || c.defaultPermissions?.read, a = c.isAdmin || c.defaultPermissions?.edit, C = c.isAdmin || c.defaultPermissions?.delete;
|
792
788
|
return /* @__PURE__ */ s(
|
793
|
-
|
789
|
+
W,
|
794
790
|
{
|
795
791
|
onClick: () => {
|
796
792
|
t(c);
|
797
793
|
},
|
798
794
|
children: [
|
799
|
-
/* @__PURE__ */ e(
|
800
|
-
|
795
|
+
/* @__PURE__ */ e(d, { style: { width: "64px" }, children: !c.isAdmin && /* @__PURE__ */ e(V, { title: "Delete this role", children: /* @__PURE__ */ e(
|
796
|
+
ye,
|
801
797
|
{
|
802
798
|
size: "small",
|
803
|
-
disabled: !
|
804
|
-
onClick: (y) => (y.stopPropagation(),
|
805
|
-
children: /* @__PURE__ */ e(
|
799
|
+
disabled: !r,
|
800
|
+
onClick: (y) => (y.stopPropagation(), v(c)),
|
801
|
+
children: /* @__PURE__ */ e(be, {})
|
806
802
|
}
|
807
803
|
) }) }),
|
808
|
-
/* @__PURE__ */ e(
|
809
|
-
/* @__PURE__ */ e(
|
810
|
-
/* @__PURE__ */ e(
|
804
|
+
/* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(X, { role: c }) }),
|
805
|
+
/* @__PURE__ */ e(d, { className: "items-center", children: /* @__PURE__ */ e(I, { checked: c.isAdmin ?? !1 }) }),
|
806
|
+
/* @__PURE__ */ e(d, { children: /* @__PURE__ */ s("ul", { children: [
|
811
807
|
S && /* @__PURE__ */ e("li", { children: "Create" }),
|
812
|
-
|
813
|
-
|
814
|
-
|
808
|
+
U && /* @__PURE__ */ e("li", { children: "Read" }),
|
809
|
+
a && /* @__PURE__ */ e("li", { children: "Update" }),
|
810
|
+
C && /* @__PURE__ */ e("li", { children: "Delete" })
|
815
811
|
] }) })
|
816
812
|
]
|
817
813
|
},
|
818
814
|
c.name
|
819
815
|
);
|
820
816
|
}),
|
821
|
-
(!n || n.length === 0) && /* @__PURE__ */ e(
|
822
|
-
/* @__PURE__ */ e(
|
823
|
-
|
824
|
-
|
817
|
+
(!n || n.length === 0) && /* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(d, { colspan: 4, children: /* @__PURE__ */ s(Ne, { className: "flex flex-col gap-4 my-8 items-center", children: [
|
818
|
+
/* @__PURE__ */ e(A, { variant: "label", children: "You don't have any roles yet." }),
|
819
|
+
m && /* @__PURE__ */ e(
|
820
|
+
O,
|
825
821
|
{
|
826
822
|
variant: "outlined",
|
827
823
|
onClick: () => {
|
828
|
-
|
829
|
-
|
824
|
+
Se.forEach((c) => {
|
825
|
+
l(c);
|
830
826
|
});
|
831
827
|
},
|
832
828
|
children: "Create default roles"
|
@@ -836,19 +832,19 @@ function Xe({
|
|
836
832
|
] })
|
837
833
|
] }),
|
838
834
|
/* @__PURE__ */ e(
|
839
|
-
|
835
|
+
xe,
|
840
836
|
{
|
841
|
-
open: !!
|
837
|
+
open: !!f,
|
842
838
|
loading: R,
|
843
839
|
onAccept: () => {
|
844
|
-
|
845
|
-
|
840
|
+
f && (w(!0), i(f).then(() => {
|
841
|
+
v(void 0);
|
846
842
|
}).finally(() => {
|
847
843
|
w(!1);
|
848
844
|
}));
|
849
845
|
},
|
850
846
|
onCancel: () => {
|
851
|
-
|
847
|
+
v(void 0);
|
852
848
|
},
|
853
849
|
title: /* @__PURE__ */ e(K, { children: "Delete?" }),
|
854
850
|
body: /* @__PURE__ */ e(K, { children: "Are you sure you want to delete this role?" })
|
@@ -859,15 +855,15 @@ function Xe({
|
|
859
855
|
);
|
860
856
|
}
|
861
857
|
const Ze = F.memo(
|
862
|
-
function({ children:
|
863
|
-
const { collections: n } =
|
864
|
-
|
858
|
+
function({ children: r }) {
|
859
|
+
const { collections: n } = _e(), [l, i] = P(!1), [m, f] = P(), { canEditRoles: v } = j(), R = k((c) => {
|
860
|
+
i(!0), f(c);
|
865
861
|
}, []);
|
866
|
-
return /* @__PURE__ */ s(
|
867
|
-
|
862
|
+
return /* @__PURE__ */ s(Ue, { className: "w-full flex flex-col py-4 gap-4", maxWidth: "6xl", children: [
|
863
|
+
r,
|
868
864
|
/* @__PURE__ */ s("div", { className: "flex items-center mt-12", children: [
|
869
865
|
/* @__PURE__ */ e(
|
870
|
-
|
866
|
+
A,
|
871
867
|
{
|
872
868
|
gutterBottom: !0,
|
873
869
|
variant: "h4",
|
@@ -876,103 +872,103 @@ const Ze = F.memo(
|
|
876
872
|
children: "Roles"
|
877
873
|
}
|
878
874
|
),
|
879
|
-
/* @__PURE__ */ e(
|
880
|
-
|
875
|
+
/* @__PURE__ */ e(V, { title: v ? void 0 : "Update plans to customise roles", children: /* @__PURE__ */ e(
|
876
|
+
O,
|
881
877
|
{
|
882
878
|
size: "large",
|
883
|
-
disabled: !
|
884
|
-
startIcon: /* @__PURE__ */ e(
|
885
|
-
onClick: () =>
|
879
|
+
disabled: !v,
|
880
|
+
startIcon: /* @__PURE__ */ e(le, {}),
|
881
|
+
onClick: () => i(!0),
|
886
882
|
children: "Add role"
|
887
883
|
}
|
888
884
|
) })
|
889
885
|
] }),
|
890
|
-
/* @__PURE__ */ e(Xe, { onRoleClicked: R, editable: !!
|
886
|
+
/* @__PURE__ */ e(Xe, { onRoleClicked: R, editable: !!v }),
|
891
887
|
/* @__PURE__ */ e(
|
892
|
-
|
888
|
+
Qe,
|
893
889
|
{
|
894
|
-
open:
|
895
|
-
role:
|
896
|
-
editable:
|
890
|
+
open: l,
|
891
|
+
role: m,
|
892
|
+
editable: v,
|
897
893
|
collections: n,
|
898
894
|
handleClose: () => {
|
899
|
-
|
895
|
+
f(void 0), i(!1);
|
900
896
|
}
|
901
897
|
},
|
902
|
-
|
898
|
+
m?.id ?? "new"
|
903
899
|
)
|
904
900
|
] });
|
905
901
|
}
|
906
|
-
), en =
|
907
|
-
displayName:
|
908
|
-
email:
|
909
|
-
roles:
|
902
|
+
), en = M.object().shape({
|
903
|
+
displayName: M.string().required("Required"),
|
904
|
+
email: M.string().email().required("Required"),
|
905
|
+
roles: M.array().min(1)
|
910
906
|
});
|
911
|
-
function nn(t,
|
912
|
-
const
|
913
|
-
if ((!
|
907
|
+
function nn(t, r, n, l, i) {
|
908
|
+
const m = n.filter((w) => w.roles?.map((c) => c.id).includes("admin")), f = t.roles?.map((w) => w.id).includes("admin");
|
909
|
+
if ((!i || !je(i.roles ?? [], r.roles ?? [])) && !f)
|
914
910
|
throw new Error("Only admins can change roles");
|
915
|
-
if (
|
911
|
+
if (i && i.roles?.map((w) => w.id).includes("admin") && !r.roles?.map((w) => w.id).includes("admin") && m.length === 1)
|
916
912
|
throw new Error("There must be at least one admin");
|
917
913
|
return !0;
|
918
914
|
}
|
919
915
|
function tn({
|
920
916
|
open: t,
|
921
|
-
user:
|
917
|
+
user: r,
|
922
918
|
handleClose: n
|
923
919
|
}) {
|
924
|
-
const
|
925
|
-
user:
|
926
|
-
} =
|
927
|
-
saveUser:
|
928
|
-
users:
|
929
|
-
roles:
|
930
|
-
} = j(), R = !
|
931
|
-
if (!
|
920
|
+
const l = se(), {
|
921
|
+
user: i
|
922
|
+
} = ae(), {
|
923
|
+
saveUser: m,
|
924
|
+
users: f,
|
925
|
+
roles: v
|
926
|
+
} = j(), R = !r, w = k((h) => {
|
927
|
+
if (!i)
|
932
928
|
throw new Error("Logged user not found");
|
933
929
|
try {
|
934
|
-
return nn(
|
930
|
+
return nn(i, h, f, v, r), m(h);
|
935
931
|
} catch (x) {
|
936
932
|
return Promise.reject(x);
|
937
933
|
}
|
938
|
-
}, [
|
939
|
-
initialValues:
|
934
|
+
}, [v, m, r, f, i]), c = Re({
|
935
|
+
initialValues: r ?? {
|
940
936
|
displayName: "",
|
941
937
|
email: "",
|
942
|
-
roles:
|
938
|
+
roles: v.filter((h) => h.id === "editor")
|
943
939
|
},
|
944
|
-
validation: (
|
945
|
-
onSubmit: (
|
940
|
+
validation: (h) => en.validate(h, { abortEarly: !1 }).then(() => ({})).catch((x) => x.inner.reduce((D, T) => (D[T.path] = T.message, D), {})),
|
941
|
+
onSubmit: (h, x) => w(h).then(() => {
|
946
942
|
n(), x.resetForm({
|
947
|
-
values:
|
943
|
+
values: h
|
948
944
|
});
|
949
945
|
}).catch((D) => {
|
950
|
-
|
946
|
+
l.open({
|
951
947
|
type: "error",
|
952
948
|
message: D.message
|
953
949
|
});
|
954
950
|
})
|
955
951
|
}), {
|
956
952
|
isSubmitting: S,
|
957
|
-
touched:
|
958
|
-
handleChange:
|
959
|
-
values:
|
953
|
+
touched: U,
|
954
|
+
handleChange: a,
|
955
|
+
values: C,
|
960
956
|
errors: y,
|
961
957
|
setFieldValue: b,
|
962
|
-
dirty:
|
963
|
-
handleSubmit:
|
958
|
+
dirty: _,
|
959
|
+
handleSubmit: z,
|
964
960
|
submitCount: u
|
965
961
|
} = c;
|
966
962
|
return /* @__PURE__ */ e(
|
967
|
-
|
963
|
+
fe,
|
968
964
|
{
|
969
965
|
open: t,
|
970
|
-
onOpenChange: (
|
966
|
+
onOpenChange: (h) => h ? void 0 : n(),
|
971
967
|
maxWidth: "4xl",
|
972
|
-
children: /* @__PURE__ */ e(
|
968
|
+
children: /* @__PURE__ */ e(De, { value: c, children: /* @__PURE__ */ s(
|
973
969
|
"form",
|
974
970
|
{
|
975
|
-
onSubmit:
|
971
|
+
onSubmit: z,
|
976
972
|
autoComplete: "off",
|
977
973
|
noValidate: !0,
|
978
974
|
style: {
|
@@ -982,13 +978,13 @@ function tn({
|
|
982
978
|
height: "100%"
|
983
979
|
},
|
984
980
|
children: [
|
985
|
-
/* @__PURE__ */ s(
|
981
|
+
/* @__PURE__ */ s(ge, { className: "h-full flex-grow", children: [
|
986
982
|
/* @__PURE__ */ e(
|
987
983
|
"div",
|
988
984
|
{
|
989
985
|
className: "flex flex-row pt-4 pb-4",
|
990
986
|
children: /* @__PURE__ */ e(
|
991
|
-
|
987
|
+
A,
|
992
988
|
{
|
993
989
|
variant: "h4",
|
994
990
|
className: "flex-grow",
|
@@ -1005,8 +1001,8 @@ function tn({
|
|
1005
1001
|
name: "displayName",
|
1006
1002
|
required: !0,
|
1007
1003
|
error: u > 0 && !!y.displayName,
|
1008
|
-
value:
|
1009
|
-
onChange:
|
1004
|
+
value: C.displayName ?? "",
|
1005
|
+
onChange: a,
|
1010
1006
|
"aria-describedby": "name-helper-text",
|
1011
1007
|
label: "Name"
|
1012
1008
|
}
|
@@ -1020,8 +1016,8 @@ function tn({
|
|
1020
1016
|
required: !0,
|
1021
1017
|
error: u > 0 && !!y.email,
|
1022
1018
|
name: "email",
|
1023
|
-
value:
|
1024
|
-
onChange:
|
1019
|
+
value: C.email ?? "",
|
1020
|
+
onChange: a,
|
1025
1021
|
"aria-describedby": "email-helper-text",
|
1026
1022
|
label: "Email"
|
1027
1023
|
}
|
@@ -1029,30 +1025,30 @@ function tn({
|
|
1029
1025
|
/* @__PURE__ */ e(B, { children: u > 0 && y.email ? y.email : "Email of this user" })
|
1030
1026
|
] }),
|
1031
1027
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
1032
|
-
|
1028
|
+
Te,
|
1033
1029
|
{
|
1034
1030
|
label: "Roles",
|
1035
|
-
value:
|
1036
|
-
onMultiValueChange: (
|
1037
|
-
renderValue: (
|
1038
|
-
const x =
|
1031
|
+
value: C.roles?.map((h) => h.id) ?? [],
|
1032
|
+
onMultiValueChange: (h) => b("roles", h.map((x) => v.find((D) => D.id === x))),
|
1033
|
+
renderValue: (h) => {
|
1034
|
+
const x = v.find((D) => D.id === h);
|
1039
1035
|
return x ? /* @__PURE__ */ e("div", { className: "flex flex-wrap space-x-2 space-y-2", children: /* @__PURE__ */ e(X, { role: x }, x?.id) }) : null;
|
1040
1036
|
},
|
1041
|
-
children:
|
1042
|
-
|
1037
|
+
children: v.map((h) => /* @__PURE__ */ e(
|
1038
|
+
Le,
|
1043
1039
|
{
|
1044
|
-
value:
|
1045
|
-
children: /* @__PURE__ */ e(X, { role:
|
1040
|
+
value: h.id,
|
1041
|
+
children: /* @__PURE__ */ e(X, { role: h }, h?.id)
|
1046
1042
|
},
|
1047
|
-
|
1043
|
+
h.id
|
1048
1044
|
))
|
1049
1045
|
}
|
1050
1046
|
) })
|
1051
1047
|
] })
|
1052
1048
|
] }),
|
1053
|
-
/* @__PURE__ */ s(
|
1049
|
+
/* @__PURE__ */ s(Ce, { children: [
|
1054
1050
|
/* @__PURE__ */ e(
|
1055
|
-
|
1051
|
+
O,
|
1056
1052
|
{
|
1057
1053
|
variant: "text",
|
1058
1054
|
onClick: () => {
|
@@ -1062,14 +1058,14 @@ function tn({
|
|
1062
1058
|
}
|
1063
1059
|
),
|
1064
1060
|
/* @__PURE__ */ e(
|
1065
|
-
|
1061
|
+
ve,
|
1066
1062
|
{
|
1067
1063
|
variant: "filled",
|
1068
1064
|
color: "primary",
|
1069
1065
|
type: "submit",
|
1070
|
-
disabled: !
|
1066
|
+
disabled: !_,
|
1071
1067
|
loading: S,
|
1072
|
-
startIcon: /* @__PURE__ */ e(
|
1068
|
+
startIcon: /* @__PURE__ */ e(we, {}),
|
1073
1069
|
children: R ? "Create user" : "Update"
|
1074
1070
|
}
|
1075
1071
|
)
|
@@ -1082,77 +1078,77 @@ function tn({
|
|
1082
1078
|
}
|
1083
1079
|
function rn({ onUserClicked: t }) {
|
1084
1080
|
const {
|
1085
|
-
users:
|
1081
|
+
users: r,
|
1086
1082
|
saveUser: n,
|
1087
|
-
deleteUser:
|
1088
|
-
} = j(),
|
1083
|
+
deleteUser: l
|
1084
|
+
} = j(), i = ae(), m = se(), f = Ve(), v = f?.locale ? $e[f?.locale] : void 0, R = f?.dateTimeFormat ?? Me, [w, c] = P(void 0), [S, U] = P(!1);
|
1089
1085
|
return /* @__PURE__ */ s("div", { className: "overflow-auto", children: [
|
1090
|
-
/* @__PURE__ */ s(
|
1091
|
-
/* @__PURE__ */ s(
|
1092
|
-
/* @__PURE__ */ e(
|
1093
|
-
/* @__PURE__ */ e(
|
1094
|
-
/* @__PURE__ */ e(
|
1095
|
-
/* @__PURE__ */ e(
|
1096
|
-
/* @__PURE__ */ e(
|
1097
|
-
/* @__PURE__ */ e(
|
1086
|
+
/* @__PURE__ */ s(re, { children: [
|
1087
|
+
/* @__PURE__ */ s(ie, { children: [
|
1088
|
+
/* @__PURE__ */ e(d, { className: "truncate w-16" }),
|
1089
|
+
/* @__PURE__ */ e(d, { children: "ID" }),
|
1090
|
+
/* @__PURE__ */ e(d, { children: "Email" }),
|
1091
|
+
/* @__PURE__ */ e(d, { children: "Name" }),
|
1092
|
+
/* @__PURE__ */ e(d, { children: "Roles" }),
|
1093
|
+
/* @__PURE__ */ e(d, { children: "Created on" })
|
1098
1094
|
] }),
|
1099
1095
|
/* @__PURE__ */ s(oe, { children: [
|
1100
|
-
|
1101
|
-
const
|
1096
|
+
r && r.map((a) => {
|
1097
|
+
const C = a.roles, y = a.created_on ? Oe(a.created_on, R, { locale: v }) : "";
|
1102
1098
|
return /* @__PURE__ */ s(
|
1103
|
-
|
1099
|
+
W,
|
1104
1100
|
{
|
1105
1101
|
onClick: () => {
|
1106
|
-
t(
|
1102
|
+
t(a);
|
1107
1103
|
},
|
1108
1104
|
children: [
|
1109
|
-
/* @__PURE__ */ e(
|
1110
|
-
|
1105
|
+
/* @__PURE__ */ e(d, { className: "w-10", children: /* @__PURE__ */ e(V, { title: "Delete this user", children: /* @__PURE__ */ e(
|
1106
|
+
ye,
|
1111
1107
|
{
|
1112
1108
|
size: "small",
|
1113
|
-
onClick: (b) => (b.stopPropagation(), c(
|
1114
|
-
children: /* @__PURE__ */ e(
|
1109
|
+
onClick: (b) => (b.stopPropagation(), c(a)),
|
1110
|
+
children: /* @__PURE__ */ e(be, {})
|
1115
1111
|
}
|
1116
1112
|
) }) }),
|
1117
|
-
/* @__PURE__ */ e(
|
1118
|
-
/* @__PURE__ */ e(
|
1119
|
-
/* @__PURE__ */ e(
|
1120
|
-
/* @__PURE__ */ e(
|
1113
|
+
/* @__PURE__ */ e(d, { children: a.uid }),
|
1114
|
+
/* @__PURE__ */ e(d, { children: a.email }),
|
1115
|
+
/* @__PURE__ */ e(d, { className: "font-medium align-left", children: a.displayName }),
|
1116
|
+
/* @__PURE__ */ e(d, { className: "align-left", children: C ? /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: C.map(
|
1121
1117
|
(b) => /* @__PURE__ */ e(X, { role: b }, b?.id)
|
1122
1118
|
) }) : null }),
|
1123
|
-
/* @__PURE__ */ e(
|
1119
|
+
/* @__PURE__ */ e(d, { children: y })
|
1124
1120
|
]
|
1125
1121
|
},
|
1126
|
-
"row_" +
|
1122
|
+
"row_" + a.uid
|
1127
1123
|
);
|
1128
1124
|
}),
|
1129
|
-
(!
|
1130
|
-
/* @__PURE__ */ e(
|
1125
|
+
(!r || r.length === 0) && /* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(d, { colspan: 6, children: /* @__PURE__ */ s(Ne, { className: "flex flex-col gap-4 my-8 items-center", children: [
|
1126
|
+
/* @__PURE__ */ e(A, { variant: "label", children: "There are no users yet" }),
|
1131
1127
|
/* @__PURE__ */ e(
|
1132
|
-
|
1128
|
+
O,
|
1133
1129
|
{
|
1134
1130
|
variant: "outlined",
|
1135
1131
|
onClick: () => {
|
1136
|
-
if (!
|
1132
|
+
if (!i.user?.uid)
|
1137
1133
|
throw Error("UsersTable, authController misconfiguration");
|
1138
1134
|
n({
|
1139
|
-
uid:
|
1140
|
-
email:
|
1141
|
-
displayName:
|
1142
|
-
photoURL:
|
1143
|
-
providerId:
|
1144
|
-
isAnonymous:
|
1135
|
+
uid: i.user?.uid,
|
1136
|
+
email: i.user?.email,
|
1137
|
+
displayName: i.user?.displayName,
|
1138
|
+
photoURL: i.user?.photoURL,
|
1139
|
+
providerId: i.user?.providerId,
|
1140
|
+
isAnonymous: i.user?.isAnonymous,
|
1145
1141
|
roles: [{ id: "admin", name: "Admin" }],
|
1146
1142
|
created_on: /* @__PURE__ */ new Date()
|
1147
1143
|
}).then(() => {
|
1148
|
-
|
1144
|
+
m.open({
|
1149
1145
|
type: "success",
|
1150
1146
|
message: "User added successfully"
|
1151
1147
|
});
|
1152
|
-
}).catch((
|
1153
|
-
|
1148
|
+
}).catch((a) => {
|
1149
|
+
m.open({
|
1154
1150
|
type: "error",
|
1155
|
-
message: "Error adding user: " +
|
1151
|
+
message: "Error adding user: " + a.message
|
1156
1152
|
});
|
1157
1153
|
});
|
1158
1154
|
},
|
@@ -1163,20 +1159,20 @@ function rn({ onUserClicked: t }) {
|
|
1163
1159
|
] })
|
1164
1160
|
] }),
|
1165
1161
|
/* @__PURE__ */ e(
|
1166
|
-
|
1162
|
+
xe,
|
1167
1163
|
{
|
1168
1164
|
open: !!w,
|
1169
1165
|
loading: S,
|
1170
1166
|
onAccept: () => {
|
1171
|
-
w && (
|
1167
|
+
w && (U(!0), l(w).then(() => {
|
1172
1168
|
c(void 0);
|
1173
|
-
}).catch((
|
1174
|
-
|
1169
|
+
}).catch((a) => {
|
1170
|
+
m.open({
|
1175
1171
|
type: "error",
|
1176
|
-
message: "Error deleting user: " +
|
1172
|
+
message: "Error deleting user: " + a.message
|
1177
1173
|
});
|
1178
1174
|
}).finally(() => {
|
1179
|
-
|
1175
|
+
U(!1);
|
1180
1176
|
}));
|
1181
1177
|
},
|
1182
1178
|
onCancel: () => {
|
@@ -1188,21 +1184,21 @@ function rn({ onUserClicked: t }) {
|
|
1188
1184
|
)
|
1189
1185
|
] });
|
1190
1186
|
}
|
1191
|
-
const on = function({ children:
|
1192
|
-
const [n,
|
1193
|
-
|
1187
|
+
const on = function({ children: r }) {
|
1188
|
+
const [n, l] = P(), [i, m] = P(), { users: f, usersLimit: v } = j(), R = v !== void 0 && f && f.length >= v, w = k((S) => {
|
1189
|
+
m(S), l(!0);
|
1194
1190
|
}, []), c = k(() => {
|
1195
|
-
|
1191
|
+
l(!1), m(void 0);
|
1196
1192
|
}, []);
|
1197
|
-
return /* @__PURE__ */ s(
|
1198
|
-
|
1193
|
+
return /* @__PURE__ */ s(Ue, { className: "w-full flex flex-col py-4 gap-4", maxWidth: "6xl", children: [
|
1194
|
+
r,
|
1199
1195
|
/* @__PURE__ */ s(
|
1200
1196
|
"div",
|
1201
1197
|
{
|
1202
1198
|
className: "flex items-center mt-12",
|
1203
1199
|
children: [
|
1204
1200
|
/* @__PURE__ */ e(
|
1205
|
-
|
1201
|
+
A,
|
1206
1202
|
{
|
1207
1203
|
gutterBottom: !0,
|
1208
1204
|
variant: "h4",
|
@@ -1212,12 +1208,12 @@ const on = function({ children: i }) {
|
|
1212
1208
|
}
|
1213
1209
|
),
|
1214
1210
|
/* @__PURE__ */ e(
|
1215
|
-
|
1211
|
+
O,
|
1216
1212
|
{
|
1217
1213
|
size: "large",
|
1218
1214
|
disabled: R,
|
1219
|
-
startIcon: /* @__PURE__ */ e(
|
1220
|
-
onClick: () =>
|
1215
|
+
startIcon: /* @__PURE__ */ e(le, {}),
|
1216
|
+
onClick: () => l(!0),
|
1221
1217
|
children: "Add user"
|
1222
1218
|
}
|
1223
1219
|
)
|
@@ -1229,26 +1225,86 @@ const on = function({ children: i }) {
|
|
1229
1225
|
tn,
|
1230
1226
|
{
|
1231
1227
|
open: n ?? !1,
|
1232
|
-
user:
|
1228
|
+
user: i,
|
1233
1229
|
handleClose: c
|
1234
1230
|
},
|
1235
|
-
|
1231
|
+
i?.uid ?? "new"
|
1236
1232
|
)
|
1237
1233
|
] });
|
1238
1234
|
};
|
1239
1235
|
function Nn({ userManagement: t }) {
|
1236
|
+
const r = t.users.length === 0, n = t.roles.length === 0;
|
1240
1237
|
return {
|
1241
1238
|
key: "user_management",
|
1242
1239
|
loading: t.loading,
|
1240
|
+
homePage: {
|
1241
|
+
additionalChildrenStart: r || n ? /* @__PURE__ */ e(
|
1242
|
+
ln,
|
1243
|
+
{
|
1244
|
+
noUsers: r,
|
1245
|
+
noRoles: n,
|
1246
|
+
userManagement: t
|
1247
|
+
}
|
1248
|
+
) : void 0
|
1249
|
+
},
|
1243
1250
|
provider: {
|
1244
|
-
Component:
|
1251
|
+
Component: He,
|
1245
1252
|
props: {
|
1246
1253
|
userManagement: t
|
1247
1254
|
}
|
1248
1255
|
}
|
1249
1256
|
};
|
1250
1257
|
}
|
1251
|
-
|
1258
|
+
function ln({
|
1259
|
+
noUsers: t,
|
1260
|
+
noRoles: r,
|
1261
|
+
userManagement: n
|
1262
|
+
}) {
|
1263
|
+
const l = ae(), i = se();
|
1264
|
+
return /* @__PURE__ */ s(
|
1265
|
+
pe,
|
1266
|
+
{
|
1267
|
+
className: "my-4 flex flex-col px-4 py-6 bg-white dark:bg-slate-800 gap-2",
|
1268
|
+
children: [
|
1269
|
+
/* @__PURE__ */ e(A, { variant: "subtitle2", className: "uppercase", children: "Create your users and roles" }),
|
1270
|
+
/* @__PURE__ */ e(A, { children: "You have no users or roles defined. You can create default roles and add the current user as admin." }),
|
1271
|
+
/* @__PURE__ */ s(O, { onClick: () => {
|
1272
|
+
if (!l.user?.uid)
|
1273
|
+
throw Error("UsersTable, authController misconfiguration");
|
1274
|
+
t && n.saveUser({
|
1275
|
+
uid: l.user?.uid,
|
1276
|
+
email: l.user?.email,
|
1277
|
+
displayName: l.user?.displayName,
|
1278
|
+
photoURL: l.user?.photoURL,
|
1279
|
+
providerId: l.user?.providerId,
|
1280
|
+
isAnonymous: l.user?.isAnonymous,
|
1281
|
+
roles: [{
|
1282
|
+
id: "admin",
|
1283
|
+
name: "Admin"
|
1284
|
+
}],
|
1285
|
+
created_on: /* @__PURE__ */ new Date()
|
1286
|
+
}).then(() => {
|
1287
|
+
i.open({
|
1288
|
+
type: "success",
|
1289
|
+
message: "User added successfully"
|
1290
|
+
});
|
1291
|
+
}).catch((f) => {
|
1292
|
+
i.open({
|
1293
|
+
type: "error",
|
1294
|
+
message: "Error adding user: " + f.message
|
1295
|
+
});
|
1296
|
+
}), r && Se.forEach((f) => {
|
1297
|
+
n.saveRole(f);
|
1298
|
+
});
|
1299
|
+
}, children: [
|
1300
|
+
/* @__PURE__ */ e(le, {}),
|
1301
|
+
t && r ? "Create default roles and add current user as admin" : t ? "Add current user as admin" : r ? "Create default roles" : void 0
|
1302
|
+
] })
|
1303
|
+
]
|
1304
|
+
}
|
1305
|
+
);
|
1306
|
+
}
|
1307
|
+
const Un = [
|
1252
1308
|
{
|
1253
1309
|
path: "users",
|
1254
1310
|
name: "CMS Users",
|
@@ -1265,29 +1321,30 @@ const bn = [
|
|
1265
1321
|
}
|
1266
1322
|
];
|
1267
1323
|
export {
|
1268
|
-
|
1324
|
+
ln as IntroWidget,
|
1325
|
+
fn as RESERVED_GROUPS,
|
1269
1326
|
X as RoleChip,
|
1270
|
-
|
1271
|
-
|
1327
|
+
Ke as RoleYupSchema,
|
1328
|
+
Qe as RolesDetailsForm,
|
1272
1329
|
Xe as RolesTable,
|
1273
1330
|
Ze as RolesView,
|
1274
1331
|
tn as UserDetailsForm,
|
1275
|
-
|
1276
|
-
|
1332
|
+
Ee as UserManagementContext,
|
1333
|
+
He as UserManagementProvider,
|
1277
1334
|
en as UserYupSchema,
|
1278
1335
|
rn as UsersTable,
|
1279
1336
|
on as UsersView,
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1337
|
+
je as areRolesEqual,
|
1338
|
+
pn as cacheDelegatedLoginToken,
|
1339
|
+
vn as clearDelegatedLoginTokensCache,
|
1340
|
+
wn as darkenColor,
|
1341
|
+
Cn as getDelegatedLoginTokenFromCache,
|
1342
|
+
gn as getUserRoles,
|
1343
|
+
yn as hexToRgbaWithOpacity,
|
1344
|
+
Ye as resolveUserRolePermissions,
|
1345
|
+
bn as useFirestoreUserManagement,
|
1289
1346
|
j as useUserManagement,
|
1290
1347
|
Nn as useUserManagementPlugin,
|
1291
|
-
|
1348
|
+
Un as userManagementAdminViews
|
1292
1349
|
};
|
1293
1350
|
//# sourceMappingURL=index.es.js.map
|