@firecms/user_management 3.0.0-beta.14 → 3.0.0-beta.15
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/index.es.js
CHANGED
|
@@ -3,7 +3,7 @@ import equal from "react-fast-compare";
|
|
|
3
3
|
import { removeUndefined, useAuthController, toSnakeCase, FieldCaption, ConfirmationDialog, useNavigationController, useSnackbarController, useCustomizationController, defaultDateFormat } from "@firecms/core";
|
|
4
4
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
5
|
import { c } from "react-compiler-runtime";
|
|
6
|
-
import { getColorSchemeForSeed, Chip, TextField, TableRow, TableCell, Checkbox, Tooltip, Button, Typography, DialogTitle, TableHeader, Paper, Table, TableBody, SelectItem, Select, DialogContent,
|
|
6
|
+
import { getColorSchemeForSeed, Chip, TextField, TableRow, TableCell, Checkbox, Tooltip, Button, Typography, DialogTitle, TableHeader, Paper, Table, TableBody, SelectItem, Select, DialogContent, LoadingButton, DialogActions, Dialog, IconButton, DeleteIcon, CenteredView, AddIcon, Container, MultiSelectItem, MultiSelect } from "@firecms/ui";
|
|
7
7
|
import * as Yup from "yup";
|
|
8
8
|
import { useCreateFormex, getIn, Formex } from "@firecms/formex";
|
|
9
9
|
import { format } from "date-fns";
|
|
@@ -488,7 +488,7 @@ function canRoleBeEdited(loggedUser) {
|
|
|
488
488
|
return true;
|
|
489
489
|
}
|
|
490
490
|
function RolesDetailsForm(t0) {
|
|
491
|
-
const $ = c(
|
|
491
|
+
const $ = c(164);
|
|
492
492
|
const {
|
|
493
493
|
open,
|
|
494
494
|
role,
|
|
@@ -1103,7 +1103,7 @@ function RolesDetailsForm(t0) {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
let t80;
|
|
1105
1105
|
if ($[144] !== handleClose) {
|
|
1106
|
-
t80 = /* @__PURE__ */ jsx(Button, { variant: "text", onClick: () => {
|
|
1106
|
+
t80 = /* @__PURE__ */ jsx(Button, { variant: "text", color: "primary", onClick: () => {
|
|
1107
1107
|
handleClose();
|
|
1108
1108
|
}, children: "Cancel" });
|
|
1109
1109
|
$[144] = handleClose;
|
|
@@ -1112,71 +1112,64 @@ function RolesDetailsForm(t0) {
|
|
|
1112
1112
|
t80 = $[145];
|
|
1113
1113
|
}
|
|
1114
1114
|
const t81 = !dirty;
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
const t83 = isNewRole ? "Create role" : "Update";
|
|
1123
|
-
let t84;
|
|
1124
|
-
if ($[147] !== isSubmitting || $[148] !== t81 || $[149] !== t83) {
|
|
1125
|
-
t84 = /* @__PURE__ */ jsx(LoadingButton, { variant: "filled", color: "primary", type: "submit", disabled: t81, loading: isSubmitting, startIcon: t82, children: t83 });
|
|
1126
|
-
$[147] = isSubmitting;
|
|
1127
|
-
$[148] = t81;
|
|
1115
|
+
const t82 = isNewRole ? "Create role" : "Update";
|
|
1116
|
+
let t83;
|
|
1117
|
+
if ($[146] !== isSubmitting || $[147] !== t81 || $[148] !== t82) {
|
|
1118
|
+
t83 = /* @__PURE__ */ jsx(LoadingButton, { variant: "filled", color: "primary", type: "submit", disabled: t81, loading: isSubmitting, children: t82 });
|
|
1119
|
+
$[146] = isSubmitting;
|
|
1120
|
+
$[147] = t81;
|
|
1121
|
+
$[148] = t82;
|
|
1128
1122
|
$[149] = t83;
|
|
1129
|
-
$[150] = t84;
|
|
1130
1123
|
} else {
|
|
1131
|
-
|
|
1124
|
+
t83 = $[149];
|
|
1132
1125
|
}
|
|
1133
|
-
let
|
|
1134
|
-
if ($[
|
|
1135
|
-
|
|
1126
|
+
let t84;
|
|
1127
|
+
if ($[150] !== t79 || $[151] !== t80 || $[152] !== t83) {
|
|
1128
|
+
t84 = /* @__PURE__ */ jsxs(DialogActions, { position: "sticky", children: [
|
|
1136
1129
|
t79,
|
|
1137
1130
|
t80,
|
|
1138
|
-
|
|
1131
|
+
t83
|
|
1139
1132
|
] });
|
|
1140
|
-
$[
|
|
1141
|
-
$[
|
|
1133
|
+
$[150] = t79;
|
|
1134
|
+
$[151] = t80;
|
|
1135
|
+
$[152] = t83;
|
|
1142
1136
|
$[153] = t84;
|
|
1143
|
-
$[154] = t85;
|
|
1144
1137
|
} else {
|
|
1145
|
-
|
|
1138
|
+
t84 = $[153];
|
|
1146
1139
|
}
|
|
1147
|
-
let
|
|
1148
|
-
if ($[
|
|
1149
|
-
|
|
1140
|
+
let t85;
|
|
1141
|
+
if ($[154] !== formex.handleSubmit || $[155] !== t78 || $[156] !== t84) {
|
|
1142
|
+
t85 = /* @__PURE__ */ jsxs("form", { noValidate: true, autoComplete: "off", onSubmit: formex.handleSubmit, style: t7, children: [
|
|
1150
1143
|
t8,
|
|
1151
1144
|
t78,
|
|
1152
|
-
|
|
1145
|
+
t84
|
|
1153
1146
|
] });
|
|
1154
|
-
$[
|
|
1155
|
-
$[
|
|
1147
|
+
$[154] = formex.handleSubmit;
|
|
1148
|
+
$[155] = t78;
|
|
1149
|
+
$[156] = t84;
|
|
1156
1150
|
$[157] = t85;
|
|
1157
|
-
$[158] = t86;
|
|
1158
1151
|
} else {
|
|
1159
|
-
|
|
1152
|
+
t85 = $[157];
|
|
1160
1153
|
}
|
|
1161
|
-
let
|
|
1162
|
-
if ($[
|
|
1163
|
-
|
|
1164
|
-
$[
|
|
1154
|
+
let t86;
|
|
1155
|
+
if ($[158] !== formex || $[159] !== t85) {
|
|
1156
|
+
t86 = /* @__PURE__ */ jsx(Formex, { value: formex, children: t85 });
|
|
1157
|
+
$[158] = formex;
|
|
1158
|
+
$[159] = t85;
|
|
1165
1159
|
$[160] = t86;
|
|
1166
|
-
$[161] = t87;
|
|
1167
1160
|
} else {
|
|
1168
|
-
|
|
1161
|
+
t86 = $[160];
|
|
1169
1162
|
}
|
|
1170
|
-
let
|
|
1171
|
-
if ($[
|
|
1172
|
-
|
|
1173
|
-
$[
|
|
1163
|
+
let t87;
|
|
1164
|
+
if ($[161] !== open || $[162] !== t86) {
|
|
1165
|
+
t87 = /* @__PURE__ */ jsx(Dialog, { open, maxWidth: "4xl", children: t86 });
|
|
1166
|
+
$[161] = open;
|
|
1167
|
+
$[162] = t86;
|
|
1174
1168
|
$[163] = t87;
|
|
1175
|
-
$[164] = t88;
|
|
1176
1169
|
} else {
|
|
1177
|
-
|
|
1170
|
+
t87 = $[163];
|
|
1178
1171
|
}
|
|
1179
|
-
return
|
|
1172
|
+
return t87;
|
|
1180
1173
|
}
|
|
1181
1174
|
function _temp6$1(value_1) {
|
|
1182
1175
|
return value_1 === "own" ? "Own" : value_1 === "true" ? "Yes" : "No";
|
|
@@ -1483,7 +1476,7 @@ function canUserBeEdited(loggedUser, user, users, roles, prevUser) {
|
|
|
1483
1476
|
return true;
|
|
1484
1477
|
}
|
|
1485
1478
|
function UserDetailsForm(t0) {
|
|
1486
|
-
const $ = c(
|
|
1479
|
+
const $ = c(73);
|
|
1487
1480
|
const {
|
|
1488
1481
|
open,
|
|
1489
1482
|
user: userProp,
|
|
@@ -1721,7 +1714,7 @@ function UserDetailsForm(t0) {
|
|
|
1721
1714
|
}
|
|
1722
1715
|
let t25;
|
|
1723
1716
|
if ($[53] !== handleClose) {
|
|
1724
|
-
t25 = /* @__PURE__ */ jsx(Button, { variant: "text", onClick: () => {
|
|
1717
|
+
t25 = /* @__PURE__ */ jsx(Button, { variant: "text", color: "primary", onClick: () => {
|
|
1725
1718
|
handleClose();
|
|
1726
1719
|
}, children: "Cancel" });
|
|
1727
1720
|
$[53] = handleClose;
|
|
@@ -1730,70 +1723,63 @@ function UserDetailsForm(t0) {
|
|
|
1730
1723
|
t25 = $[54];
|
|
1731
1724
|
}
|
|
1732
1725
|
const t26 = !dirty;
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
const t28 = isNewUser ? "Create user" : "Update";
|
|
1741
|
-
let t29;
|
|
1742
|
-
if ($[56] !== isSubmitting || $[57] !== t26 || $[58] !== t28) {
|
|
1743
|
-
t29 = /* @__PURE__ */ jsx(LoadingButton, { variant: "filled", color: "primary", type: "submit", disabled: t26, loading: isSubmitting, startIcon: t27, children: t28 });
|
|
1744
|
-
$[56] = isSubmitting;
|
|
1745
|
-
$[57] = t26;
|
|
1726
|
+
const t27 = isNewUser ? "Create user" : "Update";
|
|
1727
|
+
let t28;
|
|
1728
|
+
if ($[55] !== isSubmitting || $[56] !== t26 || $[57] !== t27) {
|
|
1729
|
+
t28 = /* @__PURE__ */ jsx(LoadingButton, { variant: "filled", color: "primary", type: "submit", disabled: t26, loading: isSubmitting, children: t27 });
|
|
1730
|
+
$[55] = isSubmitting;
|
|
1731
|
+
$[56] = t26;
|
|
1732
|
+
$[57] = t27;
|
|
1746
1733
|
$[58] = t28;
|
|
1747
|
-
$[59] = t29;
|
|
1748
1734
|
} else {
|
|
1749
|
-
|
|
1735
|
+
t28 = $[58];
|
|
1750
1736
|
}
|
|
1751
|
-
let
|
|
1752
|
-
if ($[
|
|
1753
|
-
|
|
1737
|
+
let t29;
|
|
1738
|
+
if ($[59] !== t25 || $[60] !== t28) {
|
|
1739
|
+
t29 = /* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
1754
1740
|
t25,
|
|
1755
|
-
|
|
1741
|
+
t28
|
|
1756
1742
|
] });
|
|
1757
|
-
$[
|
|
1743
|
+
$[59] = t25;
|
|
1744
|
+
$[60] = t28;
|
|
1758
1745
|
$[61] = t29;
|
|
1759
|
-
$[62] = t30;
|
|
1760
1746
|
} else {
|
|
1761
|
-
|
|
1747
|
+
t29 = $[61];
|
|
1762
1748
|
}
|
|
1763
|
-
let
|
|
1764
|
-
if ($[
|
|
1765
|
-
|
|
1749
|
+
let t30;
|
|
1750
|
+
if ($[62] !== handleSubmit || $[63] !== t24 || $[64] !== t29) {
|
|
1751
|
+
t30 = /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, autoComplete: "off", noValidate: true, style: t6, children: [
|
|
1766
1752
|
t7,
|
|
1767
1753
|
t24,
|
|
1768
|
-
|
|
1754
|
+
t29
|
|
1769
1755
|
] });
|
|
1770
|
-
$[
|
|
1771
|
-
$[
|
|
1756
|
+
$[62] = handleSubmit;
|
|
1757
|
+
$[63] = t24;
|
|
1758
|
+
$[64] = t29;
|
|
1772
1759
|
$[65] = t30;
|
|
1773
|
-
$[66] = t31;
|
|
1774
1760
|
} else {
|
|
1775
|
-
|
|
1761
|
+
t30 = $[65];
|
|
1776
1762
|
}
|
|
1777
|
-
let
|
|
1778
|
-
if ($[
|
|
1779
|
-
|
|
1780
|
-
$[
|
|
1763
|
+
let t31;
|
|
1764
|
+
if ($[66] !== formex || $[67] !== t30) {
|
|
1765
|
+
t31 = /* @__PURE__ */ jsx(Formex, { value: formex, children: t30 });
|
|
1766
|
+
$[66] = formex;
|
|
1767
|
+
$[67] = t30;
|
|
1781
1768
|
$[68] = t31;
|
|
1782
|
-
$[69] = t32;
|
|
1783
1769
|
} else {
|
|
1784
|
-
|
|
1770
|
+
t31 = $[68];
|
|
1785
1771
|
}
|
|
1786
|
-
let
|
|
1787
|
-
if ($[
|
|
1788
|
-
|
|
1789
|
-
$[
|
|
1790
|
-
$[
|
|
1791
|
-
$[
|
|
1792
|
-
$[
|
|
1772
|
+
let t32;
|
|
1773
|
+
if ($[69] !== open || $[70] !== t31 || $[71] !== t5) {
|
|
1774
|
+
t32 = /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: t5, maxWidth: "4xl", children: t31 });
|
|
1775
|
+
$[69] = open;
|
|
1776
|
+
$[70] = t31;
|
|
1777
|
+
$[71] = t5;
|
|
1778
|
+
$[72] = t32;
|
|
1793
1779
|
} else {
|
|
1794
|
-
|
|
1780
|
+
t32 = $[72];
|
|
1795
1781
|
}
|
|
1796
|
-
return
|
|
1782
|
+
return t32;
|
|
1797
1783
|
}
|
|
1798
1784
|
function _temp7(userRole) {
|
|
1799
1785
|
return /* @__PURE__ */ jsx(MultiSelectItem, { value: userRole.id, children: /* @__PURE__ */ jsx(RoleChip, { role: userRole }, userRole?.id) }, userRole.id);
|