@firecms/user_management 3.0.0-canary.183 → 3.0.0-canary.186
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/hooks/useBuildUserManagement.d.ts +1 -11
- package/dist/index.es.js +57 -115
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +57 -115
- package/dist/index.umd.js.map +1 -1
- package/dist/types/user_management.d.ts +0 -8
- package/package.json +5 -5
- package/src/components/roles/RolesView.tsx +9 -17
- package/src/components/users/UsersView.tsx +1 -4
- package/src/hooks/useBuildUserManagement.tsx +0 -16
- package/src/types/user_management.tsx +0 -10
package/dist/index.umd.js
CHANGED
@@ -159,8 +159,6 @@
|
|
159
159
|
dataSourceDelegate,
|
160
160
|
usersPath = "__FIRECMS/config/users",
|
161
161
|
rolesPath = "__FIRECMS/config/roles",
|
162
|
-
usersLimit,
|
163
|
-
canEditRoles = true,
|
164
162
|
allowDefaultRolesCreation,
|
165
163
|
includeCollectionConfigPermissions
|
166
164
|
}) {
|
@@ -361,10 +359,8 @@
|
|
361
359
|
rolesError,
|
362
360
|
deleteUser,
|
363
361
|
deleteRole,
|
364
|
-
usersLimit,
|
365
362
|
usersError,
|
366
363
|
isAdmin,
|
367
|
-
canEditRoles: canEditRoles === void 0 ? true : canEditRoles,
|
368
364
|
allowDefaultRolesCreation: allowDefaultRolesCreation === void 0 ? true : allowDefaultRolesCreation,
|
369
365
|
includeCollectionConfigPermissions: Boolean(includeCollectionConfigPermissions),
|
370
366
|
collectionPermissions,
|
@@ -1366,7 +1362,7 @@
|
|
1366
1362
|
return t11;
|
1367
1363
|
}
|
1368
1364
|
const RolesView = React.memo(function RolesView2(t0) {
|
1369
|
-
const $ = reactCompilerRuntime.c(
|
1365
|
+
const $ = reactCompilerRuntime.c(13);
|
1370
1366
|
const {
|
1371
1367
|
children
|
1372
1368
|
} = t0;
|
@@ -1375,9 +1371,6 @@
|
|
1375
1371
|
} = core.useNavigationController();
|
1376
1372
|
const [dialogOpen, setDialogOpen] = React.useState(false);
|
1377
1373
|
const [selectedRole, setSelectedRole] = React.useState();
|
1378
|
-
const {
|
1379
|
-
canEditRoles
|
1380
|
-
} = useUserManagement();
|
1381
1374
|
let t1;
|
1382
1375
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
1383
1376
|
t1 = (user) => {
|
@@ -1407,78 +1400,47 @@
|
|
1407
1400
|
} else {
|
1408
1401
|
t3 = $[2];
|
1409
1402
|
}
|
1410
|
-
|
1411
|
-
|
1412
|
-
let t6;
|
1413
|
-
let t7;
|
1403
|
+
let t4;
|
1404
|
+
let t5;
|
1414
1405
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
1415
|
-
|
1416
|
-
t7 = () => setDialogOpen(true);
|
1417
|
-
$[3] = t6;
|
1418
|
-
$[4] = t7;
|
1419
|
-
} else {
|
1420
|
-
t6 = $[3];
|
1421
|
-
t7 = $[4];
|
1422
|
-
}
|
1423
|
-
let t8;
|
1424
|
-
if ($[5] !== t5) {
|
1425
|
-
t8 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "large", disabled: t5, startIcon: t6, onClick: t7, children: "Add role" });
|
1426
|
-
$[5] = t5;
|
1427
|
-
$[6] = t8;
|
1428
|
-
} else {
|
1429
|
-
t8 = $[6];
|
1430
|
-
}
|
1431
|
-
let t9;
|
1432
|
-
if ($[7] !== t4 || $[8] !== t8) {
|
1433
|
-
t9 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center mt-12", children: [
|
1406
|
+
t4 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center mt-12", children: [
|
1434
1407
|
t3,
|
1435
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.
|
1408
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "large", startIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.AddIcon, {}), onClick: () => setDialogOpen(true), children: "Add role" })
|
1436
1409
|
] });
|
1437
|
-
|
1438
|
-
$[
|
1439
|
-
$[
|
1440
|
-
} else {
|
1441
|
-
t9 = $[9];
|
1442
|
-
}
|
1443
|
-
const t10 = Boolean(canEditRoles);
|
1444
|
-
let t11;
|
1445
|
-
if ($[10] !== t10) {
|
1446
|
-
t11 = /* @__PURE__ */ jsxRuntime.jsx(RolesTable, { onRoleClicked, editable: t10 });
|
1447
|
-
$[10] = t10;
|
1448
|
-
$[11] = t11;
|
1410
|
+
t5 = /* @__PURE__ */ jsxRuntime.jsx(RolesTable, { onRoleClicked, editable: true });
|
1411
|
+
$[3] = t4;
|
1412
|
+
$[4] = t5;
|
1449
1413
|
} else {
|
1450
|
-
|
1414
|
+
t4 = $[3];
|
1415
|
+
t5 = $[4];
|
1451
1416
|
}
|
1452
|
-
const
|
1453
|
-
let
|
1454
|
-
if ($[
|
1455
|
-
|
1456
|
-
$[
|
1457
|
-
$[
|
1458
|
-
$[
|
1459
|
-
$[
|
1460
|
-
$[
|
1461
|
-
$[17] = t13;
|
1417
|
+
const t6 = selectedRole?.id ?? "new";
|
1418
|
+
let t7;
|
1419
|
+
if ($[5] !== collections || $[6] !== dialogOpen || $[7] !== selectedRole || $[8] !== t6) {
|
1420
|
+
t7 = /* @__PURE__ */ jsxRuntime.jsx(RolesDetailsForm, { open: dialogOpen, role: selectedRole, editable: true, collections, handleClose }, t6);
|
1421
|
+
$[5] = collections;
|
1422
|
+
$[6] = dialogOpen;
|
1423
|
+
$[7] = selectedRole;
|
1424
|
+
$[8] = t6;
|
1425
|
+
$[9] = t7;
|
1462
1426
|
} else {
|
1463
|
-
|
1427
|
+
t7 = $[9];
|
1464
1428
|
}
|
1465
|
-
let
|
1466
|
-
if ($[
|
1467
|
-
|
1429
|
+
let t8;
|
1430
|
+
if ($[10] !== children || $[11] !== t7) {
|
1431
|
+
t8 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Container, { className: "w-full flex flex-col py-4 gap-4", maxWidth: "6xl", children: [
|
1468
1432
|
children,
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1433
|
+
t4,
|
1434
|
+
t5,
|
1435
|
+
t7
|
1472
1436
|
] });
|
1473
|
-
$[
|
1474
|
-
$[
|
1475
|
-
$[
|
1476
|
-
$[21] = t9;
|
1477
|
-
$[22] = t14;
|
1437
|
+
$[10] = children;
|
1438
|
+
$[11] = t7;
|
1439
|
+
$[12] = t8;
|
1478
1440
|
} else {
|
1479
|
-
|
1441
|
+
t8 = $[12];
|
1480
1442
|
}
|
1481
|
-
return
|
1443
|
+
return t8;
|
1482
1444
|
});
|
1483
1445
|
const UserYupSchema = Yup__namespace.object().shape({
|
1484
1446
|
displayName: Yup__namespace.string().required("Required"),
|
@@ -2019,17 +1981,13 @@
|
|
2019
1981
|
return /* @__PURE__ */ jsxRuntime.jsx(RoleChip, { role: userRole }, userRole?.id);
|
2020
1982
|
}
|
2021
1983
|
const UsersView = function UsersView2(t0) {
|
2022
|
-
const $ = reactCompilerRuntime.c(
|
1984
|
+
const $ = reactCompilerRuntime.c(12);
|
2023
1985
|
const {
|
2024
1986
|
children
|
2025
1987
|
} = t0;
|
2026
1988
|
const [dialogOpen, setDialogOpen] = React.useState();
|
2027
1989
|
const [selectedUser, setSelectedUser] = React.useState();
|
2028
|
-
|
2029
|
-
users,
|
2030
|
-
usersLimit
|
2031
|
-
} = useUserManagement();
|
2032
|
-
const reachedUsersLimit = usersLimit !== void 0 && users && users.length >= usersLimit;
|
1990
|
+
useUserManagement();
|
2033
1991
|
let t1;
|
2034
1992
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
2035
1993
|
t1 = (user) => {
|
@@ -2062,60 +2020,44 @@
|
|
2062
2020
|
let t4;
|
2063
2021
|
let t5;
|
2064
2022
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
2065
|
-
t4 = /* @__PURE__ */ jsxRuntime.
|
2066
|
-
|
2023
|
+
t4 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center mt-12", children: [
|
2024
|
+
t3,
|
2025
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "large", startIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.AddIcon, {}), onClick: () => setDialogOpen(true), children: "Add user" })
|
2026
|
+
] });
|
2027
|
+
t5 = /* @__PURE__ */ jsxRuntime.jsx(UsersTable, { onUserClicked });
|
2067
2028
|
$[3] = t4;
|
2068
2029
|
$[4] = t5;
|
2069
2030
|
} else {
|
2070
2031
|
t4 = $[3];
|
2071
2032
|
t5 = $[4];
|
2072
2033
|
}
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
]
|
2079
|
-
$[5] = reachedUsersLimit;
|
2034
|
+
const t6 = selectedUser?.uid ?? "new";
|
2035
|
+
const t7 = dialogOpen ?? false;
|
2036
|
+
let t8;
|
2037
|
+
if ($[5] !== selectedUser || $[6] !== t6 || $[7] !== t7) {
|
2038
|
+
t8 = /* @__PURE__ */ jsxRuntime.jsx(UserDetailsForm, { open: t7, user: selectedUser, handleClose }, t6);
|
2039
|
+
$[5] = selectedUser;
|
2080
2040
|
$[6] = t6;
|
2081
|
-
} else {
|
2082
|
-
t6 = $[6];
|
2083
|
-
}
|
2084
|
-
let t7;
|
2085
|
-
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
2086
|
-
t7 = /* @__PURE__ */ jsxRuntime.jsx(UsersTable, { onUserClicked });
|
2087
2041
|
$[7] = t7;
|
2042
|
+
$[8] = t8;
|
2088
2043
|
} else {
|
2089
|
-
|
2090
|
-
}
|
2091
|
-
const t8 = selectedUser?.uid ?? "new";
|
2092
|
-
const t9 = dialogOpen ?? false;
|
2093
|
-
let t10;
|
2094
|
-
if ($[8] !== selectedUser || $[9] !== t8 || $[10] !== t9) {
|
2095
|
-
t10 = /* @__PURE__ */ jsxRuntime.jsx(UserDetailsForm, { open: t9, user: selectedUser, handleClose }, t8);
|
2096
|
-
$[8] = selectedUser;
|
2097
|
-
$[9] = t8;
|
2098
|
-
$[10] = t9;
|
2099
|
-
$[11] = t10;
|
2100
|
-
} else {
|
2101
|
-
t10 = $[11];
|
2044
|
+
t8 = $[8];
|
2102
2045
|
}
|
2103
|
-
let
|
2104
|
-
if ($[
|
2105
|
-
|
2046
|
+
let t9;
|
2047
|
+
if ($[9] !== children || $[10] !== t8) {
|
2048
|
+
t9 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Container, { className: "w-full flex flex-col py-4 gap-4", maxWidth: "6xl", children: [
|
2106
2049
|
children,
|
2107
|
-
|
2108
|
-
|
2109
|
-
|
2050
|
+
t4,
|
2051
|
+
t5,
|
2052
|
+
t8
|
2110
2053
|
] });
|
2111
|
-
$[
|
2112
|
-
$[
|
2113
|
-
$[
|
2114
|
-
$[15] = t11;
|
2054
|
+
$[9] = children;
|
2055
|
+
$[10] = t8;
|
2056
|
+
$[11] = t9;
|
2115
2057
|
} else {
|
2116
|
-
|
2058
|
+
t9 = $[11];
|
2117
2059
|
}
|
2118
|
-
return
|
2060
|
+
return t9;
|
2119
2061
|
};
|
2120
2062
|
function useUserManagementPlugin(t0) {
|
2121
2063
|
const $ = reactCompilerRuntime.c(12);
|