strapi-plugin-firebase-authentication 1.2.0 → 1.2.1
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/_chunks/{App-B7d4qS3T.js → App-CAgq2cOo.js} +277 -279
- package/dist/_chunks/{App-CQ9ehArz.mjs → App-CyeC5fLT.mjs} +193 -195
- package/dist/_chunks/api-BL-wXuSb.js +56776 -0
- package/dist/_chunks/api-Bjer83Qp.mjs +56759 -0
- package/dist/_chunks/index-Bg-lGlji.mjs +2758 -0
- package/dist/_chunks/{index-Cwp9xkG4.js → index-CTenjpqN.js} +158 -159
- package/dist/_chunks/{index-0tTyhxbb.mjs → index-Kidqhaeq.mjs} +139 -140
- package/dist/_chunks/index-Rervtuh1.js +2757 -0
- package/dist/admin/index.js +1 -3
- package/dist/admin/index.mjs +2 -4
- package/dist/server/index.js +375 -380
- package/dist/server/index.mjs +375 -380
- package/dist/server/src/controllers/firebaseController.d.ts +2 -2
- package/dist/server/src/index.d.ts +14 -4
- package/dist/server/src/policies/index.d.ts +3 -1
- package/dist/server/src/policies/is-authenticated.d.ts +6 -0
- package/dist/server/src/routes/content-api.d.ts +10 -2
- package/dist/server/src/routes/index.d.ts +10 -2
- package/dist/server/src/services/firebaseService.d.ts +5 -1
- package/dist/server/src/services/index.d.ts +1 -1
- package/package.json +8 -8
- package/dist/_chunks/api-BM2UtpvM.mjs +0 -36
- package/dist/_chunks/api-DYP-1kdx.js +0 -35
- package/dist/_chunks/index-B5EwGI_y.js +0 -814
- package/dist/_chunks/index-CMFutRyI.mjs +0 -815
|
@@ -3,17 +3,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const admin = require("@strapi/strapi/admin");
|
|
5
5
|
const reactRouterDom = require("react-router-dom");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
6
|
+
const rt = require("@radix-ui/react-tooltip");
|
|
7
|
+
const m = require("react");
|
|
8
|
+
const api = require("./api-BL-wXuSb.js");
|
|
9
9
|
const reactIntl = require("react-intl");
|
|
10
|
-
const index = require("./index-
|
|
11
|
-
const icons = require("@strapi/icons");
|
|
10
|
+
const index = require("./index-Rervtuh1.js");
|
|
12
11
|
const styled = require("styled-components");
|
|
13
12
|
const rx = require("react-icons/rx");
|
|
14
13
|
const ai = require("react-icons/ai");
|
|
15
14
|
const md = require("react-icons/md");
|
|
16
|
-
const api = require("./api-DYP-1kdx.js");
|
|
17
15
|
const PhoneInputModule = require("react-phone-input-2");
|
|
18
16
|
require("react-phone-input-2/lib/style.css");
|
|
19
17
|
const validator = require("validator");
|
|
@@ -35,7 +33,7 @@ function _interopNamespace(e2) {
|
|
|
35
33
|
n.default = e2;
|
|
36
34
|
return Object.freeze(n);
|
|
37
35
|
}
|
|
38
|
-
const
|
|
36
|
+
const m__default = /* @__PURE__ */ _interopDefault(m);
|
|
39
37
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
40
38
|
const PhoneInputModule__namespace = /* @__PURE__ */ _interopNamespace(PhoneInputModule);
|
|
41
39
|
const validator__default = /* @__PURE__ */ _interopDefault(validator);
|
|
@@ -302,8 +300,8 @@ const Header = ({
|
|
|
302
300
|
}) => {
|
|
303
301
|
const navigate = reactRouterDom.useNavigate();
|
|
304
302
|
const didChangeData = !isEqual$1(initialData, modifiedData) || isCreatingEntry && !isEmpty$1(modifiedData);
|
|
305
|
-
const primaryAction = /* @__PURE__ */ jsxRuntime.jsx(
|
|
306
|
-
|
|
303
|
+
const primaryAction = /* @__PURE__ */ jsxRuntime.jsx(api.T, { children: /* @__PURE__ */ jsxRuntime.jsx(api.R, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
304
|
+
api.Nn,
|
|
307
305
|
{
|
|
308
306
|
disabled: !didChangeData || isSubmitButtonDisabled,
|
|
309
307
|
onClick: onSave,
|
|
@@ -318,9 +316,9 @@ const Header = ({
|
|
|
318
316
|
title,
|
|
319
317
|
primaryAction,
|
|
320
318
|
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(
|
|
321
|
-
|
|
319
|
+
api.zc,
|
|
322
320
|
{
|
|
323
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
321
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(index.U2, {}),
|
|
324
322
|
onClick: (e2) => {
|
|
325
323
|
e2.preventDefault();
|
|
326
324
|
navigate(-1);
|
|
@@ -486,7 +484,7 @@ const providerNameMapping = {
|
|
|
486
484
|
anonymous: "Anonymous"
|
|
487
485
|
};
|
|
488
486
|
const MapProviderToIcon = ({ providerData }) => {
|
|
489
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
487
|
+
return /* @__PURE__ */ jsxRuntime.jsx(api.T, { gap: 2, children: providerData?.map(({ providerId }) => /* @__PURE__ */ jsxRuntime.jsx(api.Ar, { description: providerNameMapping[providerId] || providerId, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: providerIconMapping[providerId] || providerId }) }, providerId)) });
|
|
490
488
|
};
|
|
491
489
|
function _typeof(o) {
|
|
492
490
|
"@babel/helpers - typeof";
|
|
@@ -724,7 +722,7 @@ var formatters$1 = {
|
|
|
724
722
|
return addLeadingZeros(date.getUTCHours(), token.length);
|
|
725
723
|
},
|
|
726
724
|
// Minute
|
|
727
|
-
m: function
|
|
725
|
+
m: function m2(date, token) {
|
|
728
726
|
return addLeadingZeros(date.getUTCMinutes(), token.length);
|
|
729
727
|
},
|
|
730
728
|
// Second
|
|
@@ -1249,7 +1247,7 @@ var formatters = {
|
|
|
1249
1247
|
return addLeadingZeros(hours, token.length);
|
|
1250
1248
|
},
|
|
1251
1249
|
// Minute
|
|
1252
|
-
m: function
|
|
1250
|
+
m: function m3(date, token, localize2) {
|
|
1253
1251
|
if (token === "mo") {
|
|
1254
1252
|
return localize2.ordinalNumber(date.getUTCMinutes(), {
|
|
1255
1253
|
unit: "minute"
|
|
@@ -2016,10 +2014,10 @@ const getPasswordResetTooltip = (user) => {
|
|
|
2016
2014
|
}
|
|
2017
2015
|
return `Password reset is only available for users with email/password authentication. Current provider(s): ${providers}`;
|
|
2018
2016
|
};
|
|
2019
|
-
const TypographyMaxWidth = styled__default.default(
|
|
2017
|
+
const TypographyMaxWidth = styled__default.default(api.E)`
|
|
2020
2018
|
max-width: 300px;
|
|
2021
2019
|
`;
|
|
2022
|
-
const CellLink = styled__default.default(
|
|
2020
|
+
const CellLink = styled__default.default(api.A1)`
|
|
2023
2021
|
text-decoration: underline;
|
|
2024
2022
|
color: ${({ theme }) => theme.colors.primary600};
|
|
2025
2023
|
&:hover {
|
|
@@ -2030,7 +2028,7 @@ const CellLink = styled__default.default(designSystem.Td)`
|
|
|
2030
2028
|
color: ${({ theme }) => theme.colors.primary600};
|
|
2031
2029
|
}
|
|
2032
2030
|
`;
|
|
2033
|
-
const ActionCell = styled__default.default(
|
|
2031
|
+
const ActionCell = styled__default.default(api.A1)`
|
|
2034
2032
|
/* Prevent scroll on button clicks */
|
|
2035
2033
|
position: relative;
|
|
2036
2034
|
|
|
@@ -2058,11 +2056,11 @@ const FirebaseTableRows = ({
|
|
|
2058
2056
|
const { formatMessage } = reactIntl.useIntl();
|
|
2059
2057
|
const navigate = reactRouterDom.useNavigate();
|
|
2060
2058
|
const location = reactRouterDom.useLocation();
|
|
2061
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2059
|
+
return /* @__PURE__ */ jsxRuntime.jsx(api.S1, { children: rows.map((data) => {
|
|
2062
2060
|
const isChecked = entriesToDelete.includes(data.id);
|
|
2063
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2064
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2065
|
-
|
|
2061
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(api.k1, { children: [
|
|
2062
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.A1, { children: /* @__PURE__ */ jsxRuntime.jsx(api.T, { justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2063
|
+
api.Tr,
|
|
2066
2064
|
{
|
|
2067
2065
|
"aria-label": formatMessage({
|
|
2068
2066
|
id: "app.component.table.select.one-entry",
|
|
@@ -2090,7 +2088,7 @@ const FirebaseTableRows = ({
|
|
|
2090
2088
|
data.uid
|
|
2091
2089
|
),
|
|
2092
2090
|
/* @__PURE__ */ jsxRuntime.jsx(CellLink, { children: /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth, { ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2093
|
-
|
|
2091
|
+
api.R,
|
|
2094
2092
|
{
|
|
2095
2093
|
onClick: () => {
|
|
2096
2094
|
navigate(
|
|
@@ -2101,15 +2099,15 @@ const FirebaseTableRows = ({
|
|
|
2101
2099
|
children: data.strapiId
|
|
2102
2100
|
}
|
|
2103
2101
|
) }) }, data.strapiId),
|
|
2104
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2105
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2106
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2107
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2108
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2109
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2110
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2111
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2112
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2102
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.A1, { children: /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth, { ellipsis: true, textColor: "neutral800", children: data.username }) }, data.username),
|
|
2103
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.A1, { children: /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth, { ellipsis: true, textColor: "neutral800", children: data.displayName }) }),
|
|
2104
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.A1, { style: { padding: 16 }, children: /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth, { ellipsis: true, textColor: "neutral800", children: data.email }) }, data.email),
|
|
2105
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.A1, { style: { padding: 16 }, children: /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth, { ellipsis: true, textColor: "neutral800", children: data.phoneNumber || "-" }) }, data.phoneNumber),
|
|
2106
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.A1, { children: /* @__PURE__ */ jsxRuntime.jsx(MapProviderToIcon, { providerData: data.providerData }) }),
|
|
2107
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.A1, { children: data.emailVerified ? /* @__PURE__ */ jsxRuntime.jsx(rx.RxCheck, { size: 24 }) : /* @__PURE__ */ jsxRuntime.jsx(rx.RxCross2, { size: 24 }) }),
|
|
2108
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.A1, { children: data.disabled ? /* @__PURE__ */ jsxRuntime.jsx(rx.RxCheck, { size: 24 }) : /* @__PURE__ */ jsxRuntime.jsx(rx.RxCross2, { size: 24 }) }, data.disabled),
|
|
2109
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.A1, { children: /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth, { ellipsis: true, textColor: "neutral800", children: data.createdAt ? format(new Date(data.createdAt), "yyyy/MM/dd HH:mm z") : data.metadata?.creationTime ? format(new Date(data.metadata.creationTime), "yyyy/MM/dd HH:mm z") : "-" }) }, data.createdAt),
|
|
2110
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.A1, { children: /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth, { ellipsis: true, textColor: "neutral800", children: data.metadata?.lastSignInTime ? format(new Date(data.metadata.lastSignInTime), "yyyy/MM/dd HH:mm z") : "-" }) }, data.metadata?.lastSignInTime || "lastSignInTime"),
|
|
2113
2111
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2114
2112
|
ActionCell,
|
|
2115
2113
|
{
|
|
@@ -2120,9 +2118,9 @@ const FirebaseTableRows = ({
|
|
|
2120
2118
|
onMouseDown: (e2) => {
|
|
2121
2119
|
e2.preventDefault();
|
|
2122
2120
|
},
|
|
2123
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2121
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(api.T, { gap: 2, justifyContent: "center", alignItems: "center", children: [
|
|
2124
2122
|
hasPasswordProvider(data) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2125
|
-
|
|
2123
|
+
api.Nn,
|
|
2126
2124
|
{
|
|
2127
2125
|
onClick: (e2) => {
|
|
2128
2126
|
e2.preventDefault();
|
|
@@ -2141,10 +2139,10 @@ const FirebaseTableRows = ({
|
|
|
2141
2139
|
padding: "0.25rem 0.75rem",
|
|
2142
2140
|
minWidth: "5.5rem"
|
|
2143
2141
|
},
|
|
2144
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2142
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(index.m3, { "aria-hidden": true, style: { display: "block" } })
|
|
2145
2143
|
}
|
|
2146
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2147
|
-
|
|
2144
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(api.Ar, { label: getPasswordResetTooltip(data), children: /* @__PURE__ */ jsxRuntime.jsx(api.R, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2145
|
+
api.Nn,
|
|
2148
2146
|
{
|
|
2149
2147
|
disabled: true,
|
|
2150
2148
|
variant: "secondary",
|
|
@@ -2160,11 +2158,11 @@ const FirebaseTableRows = ({
|
|
|
2160
2158
|
opacity: 0.5,
|
|
2161
2159
|
cursor: "not-allowed"
|
|
2162
2160
|
},
|
|
2163
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2161
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(index.m3, { "aria-hidden": true, style: { display: "block" } })
|
|
2164
2162
|
}
|
|
2165
2163
|
) }) }),
|
|
2166
2164
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2167
|
-
|
|
2165
|
+
api.Nn,
|
|
2168
2166
|
{
|
|
2169
2167
|
onClick: (e2) => {
|
|
2170
2168
|
e2.preventDefault();
|
|
@@ -2183,7 +2181,7 @@ const FirebaseTableRows = ({
|
|
|
2183
2181
|
padding: "0.25rem 0.75rem",
|
|
2184
2182
|
minWidth: "5.5rem"
|
|
2185
2183
|
},
|
|
2186
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2184
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(index.bn, { "aria-hidden": true, style: { display: "block" } })
|
|
2187
2185
|
}
|
|
2188
2186
|
)
|
|
2189
2187
|
] })
|
|
@@ -2338,8 +2336,8 @@ const tableHeaders = [
|
|
|
2338
2336
|
}
|
|
2339
2337
|
];
|
|
2340
2338
|
const useBulkSelection = (items) => {
|
|
2341
|
-
const [selectedIds, setSelectedIds] =
|
|
2342
|
-
const toggleSelectAll =
|
|
2339
|
+
const [selectedIds, setSelectedIds] = m.useState(/* @__PURE__ */ new Set());
|
|
2340
|
+
const toggleSelectAll = m.useCallback(() => {
|
|
2343
2341
|
setSelectedIds((prev) => {
|
|
2344
2342
|
if (prev.size === items.length) {
|
|
2345
2343
|
return /* @__PURE__ */ new Set();
|
|
@@ -2348,7 +2346,7 @@ const useBulkSelection = (items) => {
|
|
|
2348
2346
|
}
|
|
2349
2347
|
});
|
|
2350
2348
|
}, [items]);
|
|
2351
|
-
const toggleSelectItem =
|
|
2349
|
+
const toggleSelectItem = m.useCallback((id) => {
|
|
2352
2350
|
setSelectedIds((prev) => {
|
|
2353
2351
|
const newSet = new Set(prev);
|
|
2354
2352
|
if (newSet.has(id)) {
|
|
@@ -2359,20 +2357,20 @@ const useBulkSelection = (items) => {
|
|
|
2359
2357
|
return newSet;
|
|
2360
2358
|
});
|
|
2361
2359
|
}, []);
|
|
2362
|
-
const clearSelection =
|
|
2360
|
+
const clearSelection = m.useCallback(() => {
|
|
2363
2361
|
setSelectedIds(/* @__PURE__ */ new Set());
|
|
2364
2362
|
}, []);
|
|
2365
|
-
const isAllSelected =
|
|
2363
|
+
const isAllSelected = m.useMemo(
|
|
2366
2364
|
() => selectedIds.size === items.length && items.length > 0,
|
|
2367
2365
|
[selectedIds.size, items.length]
|
|
2368
2366
|
);
|
|
2369
|
-
const isIndeterminate =
|
|
2367
|
+
const isIndeterminate = m.useMemo(
|
|
2370
2368
|
() => selectedIds.size > 0 && selectedIds.size < items.length,
|
|
2371
2369
|
[selectedIds.size, items.length]
|
|
2372
2370
|
);
|
|
2373
|
-
const hasSelection =
|
|
2374
|
-
const selectedCount =
|
|
2375
|
-
const selectedArray =
|
|
2371
|
+
const hasSelection = m.useMemo(() => selectedIds.size > 0, [selectedIds.size]);
|
|
2372
|
+
const selectedCount = m.useMemo(() => selectedIds.size, [selectedIds.size]);
|
|
2373
|
+
const selectedArray = m.useMemo(() => Array.from(selectedIds), [selectedIds]);
|
|
2376
2374
|
return {
|
|
2377
2375
|
selectedIds,
|
|
2378
2376
|
toggleSelectAll,
|
|
@@ -2392,31 +2390,31 @@ const DeleteAccount = ({
|
|
|
2392
2390
|
onToggleDialog,
|
|
2393
2391
|
isSingleRecord = false
|
|
2394
2392
|
}) => {
|
|
2395
|
-
const [isStrapiIncluded, setIsStrapiIncluded] =
|
|
2396
|
-
const [isFirebaseIncluded, setIsFirebaseIncluded] =
|
|
2397
|
-
|
|
2393
|
+
const [isStrapiIncluded, setIsStrapiIncluded] = m.useState(true);
|
|
2394
|
+
const [isFirebaseIncluded, setIsFirebaseIncluded] = m.useState(true);
|
|
2395
|
+
m.useEffect(() => {
|
|
2398
2396
|
setIsStrapiIncluded(true);
|
|
2399
2397
|
setIsFirebaseIncluded(true);
|
|
2400
2398
|
}, [isOpen]);
|
|
2401
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2402
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2403
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2404
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2405
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2406
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2399
|
+
return /* @__PURE__ */ jsxRuntime.jsx(api.t1.Root, { open: isOpen, onOpenChange: (open) => !open && onToggleDialog(), children: /* @__PURE__ */ jsxRuntime.jsxs(api.t1.Content, { children: [
|
|
2400
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.t1.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(api.t1.Title, { children: "Delete Account" }) }),
|
|
2401
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.t1.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
2402
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "row", alignItems: "center", gap: 2, children: [
|
|
2403
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Nn, { fill: "danger700", width: "20px", height: "20px" }),
|
|
2404
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { textColor: "danger700", children: "After you delete an account, it's permanently deleted. Accounts cannot be undeleted." })
|
|
2407
2405
|
] }),
|
|
2408
|
-
isSingleRecord ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2409
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2410
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2411
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2412
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2413
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2406
|
+
isSingleRecord ? /* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "column", alignItems: "stretch", gap: 1, children: [
|
|
2407
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", children: "User account" }),
|
|
2408
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { children: email })
|
|
2409
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "column", alignItems: "stretch", gap: 1, children: [
|
|
2410
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", children: "Bulk delete operation" }),
|
|
2411
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { children: "You are about to delete multiple user accounts" })
|
|
2414
2412
|
] }),
|
|
2415
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2416
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2417
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2413
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
2414
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { children: "Delete user from:" }),
|
|
2415
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "row", alignItems: "center", gap: 4, children: [
|
|
2418
2416
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2419
|
-
|
|
2417
|
+
api.Tr,
|
|
2420
2418
|
{
|
|
2421
2419
|
onCheckedChange: (checked) => setIsStrapiIncluded(checked === true),
|
|
2422
2420
|
checked: isStrapiIncluded,
|
|
@@ -2424,7 +2422,7 @@ const DeleteAccount = ({
|
|
|
2424
2422
|
}
|
|
2425
2423
|
),
|
|
2426
2424
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2427
|
-
|
|
2425
|
+
api.Tr,
|
|
2428
2426
|
{
|
|
2429
2427
|
onCheckedChange: (checked) => setIsFirebaseIncluded(checked === true),
|
|
2430
2428
|
checked: isFirebaseIncluded,
|
|
@@ -2434,10 +2432,10 @@ const DeleteAccount = ({
|
|
|
2434
2432
|
] })
|
|
2435
2433
|
] })
|
|
2436
2434
|
] }) }),
|
|
2437
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2438
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2435
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.t1.Footer, { children: [
|
|
2436
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Nn, { onClick: onToggleDialog, variant: "tertiary", children: "Cancel" }),
|
|
2439
2437
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2440
|
-
|
|
2438
|
+
api.Nn,
|
|
2441
2439
|
{
|
|
2442
2440
|
variant: "danger",
|
|
2443
2441
|
onClick: () => {
|
|
@@ -2487,7 +2485,7 @@ const StyledTableContainer = styled__default.default.div`
|
|
|
2487
2485
|
cursor: pointer;
|
|
2488
2486
|
}
|
|
2489
2487
|
`;
|
|
2490
|
-
const BulkActionsBar = styled__default.default(
|
|
2488
|
+
const BulkActionsBar = styled__default.default(api.R)`
|
|
2491
2489
|
margin-bottom: 16px;
|
|
2492
2490
|
padding: 12px 0;
|
|
2493
2491
|
`;
|
|
@@ -2528,7 +2526,7 @@ const FirebaseTable = ({
|
|
|
2528
2526
|
selectedArray
|
|
2529
2527
|
} = useBulkSelection(rows);
|
|
2530
2528
|
const [{ query }, setQuery] = admin.useQueryParams();
|
|
2531
|
-
const [showBulkDeleteDialog, setShowBulkDeleteDialog] =
|
|
2529
|
+
const [showBulkDeleteDialog, setShowBulkDeleteDialog] = m.useState(false);
|
|
2532
2530
|
const sort = query?.sort ?? "";
|
|
2533
2531
|
const [sortBy, sortOrder] = sort.split(":");
|
|
2534
2532
|
const handleBulkDelete = async (isStrapiIncluded, isFirebaseIncluded) => {
|
|
@@ -2555,21 +2553,21 @@ const FirebaseTable = ({
|
|
|
2555
2553
|
});
|
|
2556
2554
|
};
|
|
2557
2555
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2558
|
-
/* @__PURE__ */ jsxRuntime.jsx(BulkActionsBar, { paddingLeft: 0, paddingRight: 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2559
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2556
|
+
/* @__PURE__ */ jsxRuntime.jsx(BulkActionsBar, { paddingLeft: 0, paddingRight: 0, children: /* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "row", alignItems: "center", justifyContent: "space-between", wrap: "nowrap", children: [
|
|
2557
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "row", alignItems: "center", gap: 2, wrap: "nowrap", children: [
|
|
2560
2558
|
action,
|
|
2561
2559
|
hasSelection && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2562
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2560
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.E, { variant: "omega", fontWeight: "semiBold", style: { whiteSpace: "nowrap" }, children: [
|
|
2563
2561
|
selectedCount,
|
|
2564
2562
|
" ",
|
|
2565
2563
|
selectedCount === 1 ? "entry" : "entries",
|
|
2566
2564
|
" selected"
|
|
2567
2565
|
] }),
|
|
2568
2566
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2569
|
-
|
|
2567
|
+
api.Nn,
|
|
2570
2568
|
{
|
|
2571
2569
|
variant: "danger",
|
|
2572
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2570
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(index.bn, {}),
|
|
2573
2571
|
onClick: () => setShowBulkDeleteDialog(true),
|
|
2574
2572
|
size: "S",
|
|
2575
2573
|
style: { whiteSpace: "nowrap" },
|
|
@@ -2577,7 +2575,7 @@ const FirebaseTable = ({
|
|
|
2577
2575
|
}
|
|
2578
2576
|
),
|
|
2579
2577
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2580
|
-
|
|
2578
|
+
api.Nn,
|
|
2581
2579
|
{
|
|
2582
2580
|
variant: "secondary",
|
|
2583
2581
|
onClick: clearSelection,
|
|
@@ -2590,10 +2588,10 @@ const FirebaseTable = ({
|
|
|
2590
2588
|
] }),
|
|
2591
2589
|
createAction
|
|
2592
2590
|
] }) }),
|
|
2593
|
-
/* @__PURE__ */ jsxRuntime.jsx(StyledTableContainer, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2594
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2595
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2596
|
-
|
|
2591
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledTableContainer, { children: /* @__PURE__ */ jsxRuntime.jsxs(api.v1, { colCount: tableHeaders.length + 2, rowCount: rows.length + 1, children: [
|
|
2592
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.C1, { children: /* @__PURE__ */ jsxRuntime.jsxs(api.k1, { children: [
|
|
2593
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.$1, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2594
|
+
api.Tr,
|
|
2597
2595
|
{
|
|
2598
2596
|
"aria-label": "Select all entries",
|
|
2599
2597
|
checked: isAllSelected,
|
|
@@ -2605,19 +2603,19 @@ const FirebaseTable = ({
|
|
|
2605
2603
|
const isSorted = sortBy === header.name;
|
|
2606
2604
|
const isAsc = sortOrder === "ASC";
|
|
2607
2605
|
const isSortable = header.metadatas.sortable;
|
|
2608
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2606
|
+
return /* @__PURE__ */ jsxRuntime.jsx(api.$1, { children: isSortable ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2609
2607
|
SortButton,
|
|
2610
2608
|
{
|
|
2611
2609
|
onClick: () => handleSort(header.name),
|
|
2612
2610
|
"aria-label": `Sort by ${header.metadatas.label}`,
|
|
2613
2611
|
children: [
|
|
2614
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2615
|
-
isSorted && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: isAsc ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2612
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: header.metadatas.label }),
|
|
2613
|
+
isSorted && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: isAsc ? /* @__PURE__ */ jsxRuntime.jsx(index.Y2, { width: "10px", height: "10px" }) : /* @__PURE__ */ jsxRuntime.jsx(index.J2, { width: "10px", height: "10px" }) })
|
|
2616
2614
|
]
|
|
2617
2615
|
}
|
|
2618
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2616
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: header.metadatas.label }) }, header.key);
|
|
2619
2617
|
}),
|
|
2620
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2618
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.$1, { children: /* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: "Actions" }) })
|
|
2621
2619
|
] }) }),
|
|
2622
2620
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2623
2621
|
FirebaseTableRows,
|
|
@@ -2743,21 +2741,21 @@ const PaginationFooter = ({ pageCount = 0 }) => {
|
|
|
2743
2741
|
const handlePageSizeChange = (value) => {
|
|
2744
2742
|
setQuery({ pageSize: value, page: 1 });
|
|
2745
2743
|
};
|
|
2746
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2747
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2748
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2744
|
+
return /* @__PURE__ */ jsxRuntime.jsx(api.R, { paddingTop: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(api.T, { alignItems: "center", justifyContent: "space-between", children: [
|
|
2745
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { alignItems: "center", gap: 2, children: [
|
|
2746
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "pi", textColor: "neutral600", children: "Entries per page:" }),
|
|
2749
2747
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2750
|
-
|
|
2748
|
+
api.bo,
|
|
2751
2749
|
{
|
|
2752
2750
|
size: "S",
|
|
2753
2751
|
value: pageSize,
|
|
2754
2752
|
onChange: handlePageSizeChange,
|
|
2755
2753
|
"aria-label": "Entries per page",
|
|
2756
2754
|
children: [
|
|
2757
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2758
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2759
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2760
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2755
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.wo, { value: "10", children: "10" }),
|
|
2756
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.wo, { value: "25", children: "25" }),
|
|
2757
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.wo, { value: "50", children: "50" }),
|
|
2758
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.wo, { value: "100", children: "100" })
|
|
2761
2759
|
]
|
|
2762
2760
|
}
|
|
2763
2761
|
)
|
|
@@ -3091,9 +3089,9 @@ function nameOf(f) {
|
|
|
3091
3089
|
if (f.name) {
|
|
3092
3090
|
return f.name;
|
|
3093
3091
|
}
|
|
3094
|
-
var
|
|
3095
|
-
if (
|
|
3096
|
-
return
|
|
3092
|
+
var m4 = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
3093
|
+
if (m4) {
|
|
3094
|
+
return m4[1];
|
|
3097
3095
|
}
|
|
3098
3096
|
return null;
|
|
3099
3097
|
}
|
|
@@ -3159,7 +3157,7 @@ function isSet(x2) {
|
|
|
3159
3157
|
setSize.call(x2);
|
|
3160
3158
|
try {
|
|
3161
3159
|
mapSize.call(x2);
|
|
3162
|
-
} catch (
|
|
3160
|
+
} catch (m4) {
|
|
3163
3161
|
return true;
|
|
3164
3162
|
}
|
|
3165
3163
|
return x2 instanceof Set;
|
|
@@ -4833,14 +4831,14 @@ var lib = {
|
|
|
4833
4831
|
const useQueryParams = (initialParams) => {
|
|
4834
4832
|
const { search } = reactRouterDom.useLocation();
|
|
4835
4833
|
const navigate = reactRouterDom.useNavigate();
|
|
4836
|
-
const query =
|
|
4834
|
+
const query = m.useMemo(() => {
|
|
4837
4835
|
const searchQuery = search.substring(1);
|
|
4838
4836
|
if (!search) {
|
|
4839
4837
|
return initialParams;
|
|
4840
4838
|
}
|
|
4841
4839
|
return lib.parse(searchQuery);
|
|
4842
4840
|
}, [search, initialParams]);
|
|
4843
|
-
const setQuery =
|
|
4841
|
+
const setQuery = m.useCallback(
|
|
4844
4842
|
(nextParams, method = "push") => {
|
|
4845
4843
|
let nextQuery = { ...query };
|
|
4846
4844
|
if (method === "remove") {
|
|
@@ -4857,14 +4855,14 @@ const useQueryParams = (initialParams) => {
|
|
|
4857
4855
|
return { query, rawQuery: search, setQuery };
|
|
4858
4856
|
};
|
|
4859
4857
|
const SearchURLQuery = ({ label, placeholder = void 0 }) => {
|
|
4860
|
-
const wrapperRef =
|
|
4861
|
-
const iconButtonRef =
|
|
4858
|
+
const wrapperRef = m.useRef(null);
|
|
4859
|
+
const iconButtonRef = m.useRef(null);
|
|
4862
4860
|
const { query, setQuery } = useQueryParams();
|
|
4863
|
-
const [value, setValue] =
|
|
4864
|
-
const [isOpen, setIsOpen] =
|
|
4861
|
+
const [value, setValue] = m.useState(query?.search || "");
|
|
4862
|
+
const [isOpen, setIsOpen] = m.useState(!!value);
|
|
4865
4863
|
const { formatMessage } = reactIntl.useIntl();
|
|
4866
4864
|
const handleToggle = () => setIsOpen((prev) => !prev);
|
|
4867
|
-
|
|
4865
|
+
m.useLayoutEffect(() => {
|
|
4868
4866
|
if (isOpen) {
|
|
4869
4867
|
setTimeout(() => {
|
|
4870
4868
|
wrapperRef.current?.querySelector("input").focus();
|
|
@@ -4885,8 +4883,8 @@ const SearchURLQuery = ({ label, placeholder = void 0 }) => {
|
|
|
4885
4883
|
}
|
|
4886
4884
|
};
|
|
4887
4885
|
if (isOpen) {
|
|
4888
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4889
|
-
|
|
4886
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(api.h0, { onSubmit: handleSubmit, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4887
|
+
api.a0,
|
|
4890
4888
|
{
|
|
4891
4889
|
name: "search",
|
|
4892
4890
|
onChange: ({ target: { value: value2 } }) => setValue(value2),
|
|
@@ -4903,7 +4901,7 @@ const SearchURLQuery = ({ label, placeholder = void 0 }) => {
|
|
|
4903
4901
|
) }) });
|
|
4904
4902
|
}
|
|
4905
4903
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4906
|
-
|
|
4904
|
+
api.ot,
|
|
4907
4905
|
{
|
|
4908
4906
|
ref: iconButtonRef,
|
|
4909
4907
|
variant: "tertiary",
|
|
@@ -4912,7 +4910,7 @@ const SearchURLQuery = ({ label, placeholder = void 0 }) => {
|
|
|
4912
4910
|
id: "app.component.search.label",
|
|
4913
4911
|
defaultMessage: "Search"
|
|
4914
4912
|
}),
|
|
4915
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4913
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(index.un, {})
|
|
4916
4914
|
}
|
|
4917
4915
|
);
|
|
4918
4916
|
};
|
|
@@ -4926,13 +4924,13 @@ const ResetPassword = ({
|
|
|
4926
4924
|
passwordRegex = "^.{6,}$",
|
|
4927
4925
|
passwordMessage = "Password must be at least 6 characters long"
|
|
4928
4926
|
}) => {
|
|
4929
|
-
const [mode, setMode] =
|
|
4930
|
-
const [password, setPassword] =
|
|
4931
|
-
const [isLoading, setIsLoading] =
|
|
4932
|
-
const [emailSent, setEmailSent] =
|
|
4933
|
-
const [error, setError] =
|
|
4934
|
-
const [isPasswordChanged, setIsPasswordChanged] =
|
|
4935
|
-
|
|
4927
|
+
const [mode, setMode] = m.useState("direct");
|
|
4928
|
+
const [password, setPassword] = m.useState("");
|
|
4929
|
+
const [isLoading, setIsLoading] = m.useState(false);
|
|
4930
|
+
const [emailSent, setEmailSent] = m.useState(false);
|
|
4931
|
+
const [error, setError] = m.useState("");
|
|
4932
|
+
const [isPasswordChanged, setIsPasswordChanged] = m.useState(false);
|
|
4933
|
+
m.useEffect(() => {
|
|
4936
4934
|
if (!isOpen) {
|
|
4937
4935
|
resetState();
|
|
4938
4936
|
}
|
|
@@ -4984,23 +4982,23 @@ const ResetPassword = ({
|
|
|
4984
4982
|
setIsLoading(false);
|
|
4985
4983
|
}
|
|
4986
4984
|
};
|
|
4987
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4988
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4989
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4990
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4991
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4992
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4985
|
+
return /* @__PURE__ */ jsxRuntime.jsx(api.Km.Root, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(api.Km.Content, { children: [
|
|
4986
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Km.Header, { children: "Reset Password" }),
|
|
4987
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Km.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "column", gap: 4, children: [
|
|
4988
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "column", gap: 1, children: [
|
|
4989
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", children: "User email" }),
|
|
4990
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { children: email })
|
|
4993
4991
|
] }),
|
|
4994
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4995
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4996
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4997
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4992
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.x1.Root, { value: mode, onValueChange: (val) => setMode(val), children: [
|
|
4993
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.x1.List, { children: [
|
|
4994
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.x1.Trigger, { value: "direct", children: "Set Password Directly" }),
|
|
4995
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.x1.Trigger, { value: "email", children: "Send Reset Email" })
|
|
4998
4996
|
] }),
|
|
4999
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5000
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5001
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4997
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.x1.Content, { value: "direct", children: /* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "column", gap: 3, paddingTop: 4, children: [
|
|
4998
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { children: "Set a new password for this user. The user will not be notified of this change." }),
|
|
4999
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "column", gap: 1, children: [
|
|
5002
5000
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5003
|
-
|
|
5001
|
+
api.G0,
|
|
5004
5002
|
{
|
|
5005
5003
|
type: "password",
|
|
5006
5004
|
label: "New password",
|
|
@@ -5014,24 +5012,24 @@ const ResetPassword = ({
|
|
|
5014
5012
|
required: true
|
|
5015
5013
|
}
|
|
5016
5014
|
),
|
|
5017
|
-
isPasswordChanged && password && !validatePassword(password) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5015
|
+
isPasswordChanged && password && !validatePassword(password) && /* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "pi", textColor: "danger500", children: passwordMessage })
|
|
5018
5016
|
] })
|
|
5019
5017
|
] }) }),
|
|
5020
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5018
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.x1.Content, { value: "email", children: /* @__PURE__ */ jsxRuntime.jsx(api.T, { direction: "column", gap: 3, paddingTop: 4, children: !emailSent ? /* @__PURE__ */ jsxRuntime.jsxs(api.E, { children: [
|
|
5021
5019
|
"Send a password reset email to ",
|
|
5022
5020
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: email }),
|
|
5023
5021
|
". The link will expire in 1 hour."
|
|
5024
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5022
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(api.vm, { variant: "success", title: "Email Sent", children: [
|
|
5025
5023
|
"Password reset email has been sent to ",
|
|
5026
5024
|
email
|
|
5027
5025
|
] }) }) })
|
|
5028
5026
|
] }),
|
|
5029
|
-
error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5027
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(api.vm, { variant: "danger", title: "Error", children: error })
|
|
5030
5028
|
] }) }),
|
|
5031
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5032
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5029
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.Km.Footer, { children: [
|
|
5030
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Nn, { onClick: handleClose, variant: "tertiary", children: emailSent ? "Close" : "Cancel" }),
|
|
5033
5031
|
!emailSent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5034
|
-
|
|
5032
|
+
api.Nn,
|
|
5035
5033
|
{
|
|
5036
5034
|
variant: mode === "direct" ? "danger-light" : "success",
|
|
5037
5035
|
loading: isLoading,
|
|
@@ -5050,9 +5048,9 @@ const ResendVerification = ({
|
|
|
5050
5048
|
onClose,
|
|
5051
5049
|
onSendVerificationEmail
|
|
5052
5050
|
}) => {
|
|
5053
|
-
const [isLoading, setIsLoading] =
|
|
5054
|
-
const [emailSent, setEmailSent] =
|
|
5055
|
-
const [error, setError] =
|
|
5051
|
+
const [isLoading, setIsLoading] = m.useState(false);
|
|
5052
|
+
const [emailSent, setEmailSent] = m.useState(false);
|
|
5053
|
+
const [error, setError] = m.useState("");
|
|
5056
5054
|
const resetState = () => {
|
|
5057
5055
|
setEmailSent(false);
|
|
5058
5056
|
setError("");
|
|
@@ -5074,25 +5072,25 @@ const ResendVerification = ({
|
|
|
5074
5072
|
setIsLoading(false);
|
|
5075
5073
|
}
|
|
5076
5074
|
};
|
|
5077
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5078
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5079
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5075
|
+
return /* @__PURE__ */ jsxRuntime.jsx(api.Km.Root, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(api.Km.Content, { children: [
|
|
5076
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Km.Header, { children: "Resend Verification Email" }),
|
|
5077
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Km.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "column", gap: 4, alignItems: "center", children: [
|
|
5080
5078
|
!emailSent ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5081
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5079
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.E, { textAlign: "center", children: [
|
|
5082
5080
|
"Send a verification email to ",
|
|
5083
5081
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: email }),
|
|
5084
5082
|
"?"
|
|
5085
5083
|
] }),
|
|
5086
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5087
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5084
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "omega", textColor: "neutral600", textAlign: "center", children: "The link will expire in 1 hour." })
|
|
5085
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(api.vm, { variant: "success", title: "Email Sent", children: [
|
|
5088
5086
|
"Verification email has been sent to ",
|
|
5089
5087
|
email
|
|
5090
5088
|
] }),
|
|
5091
|
-
error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5089
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(api.vm, { variant: "danger", title: "Error", children: error })
|
|
5092
5090
|
] }) }),
|
|
5093
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5094
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5095
|
-
!emailSent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5091
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.Km.Footer, { children: [
|
|
5092
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Nn, { onClick: handleClose, variant: "tertiary", children: emailSent ? "Close" : "Cancel" }),
|
|
5093
|
+
!emailSent && /* @__PURE__ */ jsxRuntime.jsx(api.Nn, { variant: "success", loading: isLoading, onClick: handleSendEmail, children: "Send" })
|
|
5096
5094
|
] })
|
|
5097
5095
|
] }) });
|
|
5098
5096
|
};
|
|
@@ -5108,22 +5106,22 @@ const mapUserData = (users) => users.map((item) => ({
|
|
|
5108
5106
|
...item
|
|
5109
5107
|
}));
|
|
5110
5108
|
function ListView({ data, meta }) {
|
|
5111
|
-
const [showResetPasswordDialogue, setShowResetPasswordDialogue] =
|
|
5109
|
+
const [showResetPasswordDialogue, setShowResetPasswordDialogue] = m.useState({
|
|
5112
5110
|
isOpen: false,
|
|
5113
5111
|
email: "",
|
|
5114
5112
|
id: ""
|
|
5115
5113
|
});
|
|
5116
|
-
const [showDeleteAccountDialogue, setShowDeleteAccountDialogue] =
|
|
5114
|
+
const [showDeleteAccountDialogue, setShowDeleteAccountDialogue] = m.useState({
|
|
5117
5115
|
isOpen: false,
|
|
5118
5116
|
email: "",
|
|
5119
5117
|
id: ""
|
|
5120
5118
|
});
|
|
5121
|
-
const [rowsData, setRowsData] =
|
|
5122
|
-
const [rowsMeta, setRowsMeta] =
|
|
5119
|
+
const [rowsData, setRowsData] = m.useState([]);
|
|
5120
|
+
const [rowsMeta, setRowsMeta] = m.useState({
|
|
5123
5121
|
pagination: { page: 1, pageCount: 1, pageSize: 10, total: 0 }
|
|
5124
5122
|
});
|
|
5125
|
-
const [isLoading, setIsLoading] =
|
|
5126
|
-
const [passwordConfig, setPasswordConfig] =
|
|
5123
|
+
const [isLoading, setIsLoading] = m.useState(false);
|
|
5124
|
+
const [passwordConfig, setPasswordConfig] = m.useState({
|
|
5127
5125
|
passwordRequirementsRegex: "^.{6,}$",
|
|
5128
5126
|
passwordRequirementsMessage: "Password must be at least 6 characters long",
|
|
5129
5127
|
passwordResetUrl: "http://localhost:3000/reset-password",
|
|
@@ -5133,15 +5131,15 @@ function ListView({ data, meta }) {
|
|
|
5133
5131
|
const navigate = reactRouterDom.useNavigate();
|
|
5134
5132
|
const { toggleNotification } = admin.useNotification();
|
|
5135
5133
|
const { formatMessage } = reactIntl.useIntl();
|
|
5136
|
-
const queryKey =
|
|
5137
|
-
const setNextPageToken =
|
|
5134
|
+
const queryKey = m.useMemo(() => JSON.stringify(query.query), [query.query]);
|
|
5135
|
+
const setNextPageToken = m.useCallback((page, nextPageToken) => {
|
|
5138
5136
|
const formattedPage = parseInt(page, 10) || 1;
|
|
5139
5137
|
const storeObject = sessionStorage.getItem("nextPageTokens");
|
|
5140
5138
|
const tokens = storeObject ? JSON.parse(storeObject) : {};
|
|
5141
5139
|
tokens[formattedPage + 1] = nextPageToken;
|
|
5142
5140
|
sessionStorage.setItem("nextPageTokens", JSON.stringify(tokens));
|
|
5143
5141
|
}, []);
|
|
5144
|
-
const getNextPageToken =
|
|
5142
|
+
const getNextPageToken = m.useCallback((page) => {
|
|
5145
5143
|
const formattedPage = parseInt(page, 10);
|
|
5146
5144
|
const storeObject = sessionStorage.getItem("nextPageTokens");
|
|
5147
5145
|
if (!storeObject) {
|
|
@@ -5150,7 +5148,7 @@ function ListView({ data, meta }) {
|
|
|
5150
5148
|
const tokens = JSON.parse(storeObject);
|
|
5151
5149
|
return tokens[formattedPage];
|
|
5152
5150
|
}, []);
|
|
5153
|
-
const fetchPaginatedUsers =
|
|
5151
|
+
const fetchPaginatedUsers = m.useCallback(async () => {
|
|
5154
5152
|
const page = query?.query?.page;
|
|
5155
5153
|
const nextPageToken = page ? getNextPageToken(page) : void 0;
|
|
5156
5154
|
const queryWithToken = {
|
|
@@ -5163,7 +5161,7 @@ function ListView({ data, meta }) {
|
|
|
5163
5161
|
}
|
|
5164
5162
|
return response;
|
|
5165
5163
|
}, [query.query, getNextPageToken, setNextPageToken]);
|
|
5166
|
-
|
|
5164
|
+
m.useEffect(() => {
|
|
5167
5165
|
const fetchConfig = async () => {
|
|
5168
5166
|
try {
|
|
5169
5167
|
const config = await getFirebaseConfig();
|
|
@@ -5174,7 +5172,7 @@ function ListView({ data, meta }) {
|
|
|
5174
5172
|
};
|
|
5175
5173
|
fetchConfig();
|
|
5176
5174
|
}, []);
|
|
5177
|
-
|
|
5175
|
+
m.useEffect(() => {
|
|
5178
5176
|
let isMounted = true;
|
|
5179
5177
|
const fetchPaginatedData = async () => {
|
|
5180
5178
|
try {
|
|
@@ -5203,7 +5201,7 @@ function ListView({ data, meta }) {
|
|
|
5203
5201
|
isMounted = false;
|
|
5204
5202
|
};
|
|
5205
5203
|
}, [queryKey]);
|
|
5206
|
-
const fetchData =
|
|
5204
|
+
const fetchData = m.useCallback(async () => {
|
|
5207
5205
|
try {
|
|
5208
5206
|
setIsLoading(true);
|
|
5209
5207
|
const response = await fetchPaginatedUsers();
|
|
@@ -5226,14 +5224,14 @@ function ListView({ data, meta }) {
|
|
|
5226
5224
|
setIsLoading(false);
|
|
5227
5225
|
}
|
|
5228
5226
|
}, [fetchPaginatedUsers, toggleNotification, formatMessage]);
|
|
5229
|
-
const handleDeleteAll =
|
|
5227
|
+
const handleDeleteAll = m.useCallback(
|
|
5230
5228
|
async (idsToDelete, destination = null) => {
|
|
5231
5229
|
await Promise.all(idsToDelete.map((id) => deleteUser(id, destination)));
|
|
5232
5230
|
await fetchData();
|
|
5233
5231
|
},
|
|
5234
5232
|
[fetchData]
|
|
5235
5233
|
);
|
|
5236
|
-
const handleDeleteRecord =
|
|
5234
|
+
const handleDeleteRecord = m.useCallback(
|
|
5237
5235
|
async (idsToDelete, destination) => {
|
|
5238
5236
|
await deleteUser(idsToDelete, destination);
|
|
5239
5237
|
const result = await fetchData();
|
|
@@ -5241,7 +5239,7 @@ function ListView({ data, meta }) {
|
|
|
5241
5239
|
},
|
|
5242
5240
|
[fetchData]
|
|
5243
5241
|
);
|
|
5244
|
-
const handleConfirmDeleteData =
|
|
5242
|
+
const handleConfirmDeleteData = m.useCallback(
|
|
5245
5243
|
async (idsToDelete, isStrapiIncluded, isFirebaseIncluded) => {
|
|
5246
5244
|
let destination = null;
|
|
5247
5245
|
if (isStrapiIncluded && isFirebaseIncluded) {
|
|
@@ -5256,20 +5254,20 @@ function ListView({ data, meta }) {
|
|
|
5256
5254
|
},
|
|
5257
5255
|
[handleDeleteRecord]
|
|
5258
5256
|
);
|
|
5259
|
-
const handleNavigateToCreate =
|
|
5257
|
+
const handleNavigateToCreate = m.useCallback(() => {
|
|
5260
5258
|
navigate("users/create");
|
|
5261
5259
|
}, [navigate]);
|
|
5262
|
-
const getCreateAction =
|
|
5263
|
-
() => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5260
|
+
const getCreateAction = m.useCallback(
|
|
5261
|
+
() => /* @__PURE__ */ jsxRuntime.jsx(api.Nn, { onClick: handleNavigateToCreate, startIcon: /* @__PURE__ */ jsxRuntime.jsx(index.sn, {}), children: "Create" }),
|
|
5264
5262
|
[handleNavigateToCreate]
|
|
5265
5263
|
);
|
|
5266
|
-
const handleCloseResetDialogue =
|
|
5264
|
+
const handleCloseResetDialogue = m.useCallback(() => {
|
|
5267
5265
|
setShowResetPasswordDialogue({ isOpen: false, email: "", id: "" });
|
|
5268
5266
|
}, []);
|
|
5269
|
-
const handleCloseDeleteDialogue =
|
|
5267
|
+
const handleCloseDeleteDialogue = m.useCallback(() => {
|
|
5270
5268
|
setShowDeleteAccountDialogue({ isOpen: false, email: "", id: "" });
|
|
5271
5269
|
}, []);
|
|
5272
|
-
const resetPassword =
|
|
5270
|
+
const resetPassword = m.useCallback(
|
|
5273
5271
|
async (newPassword) => {
|
|
5274
5272
|
try {
|
|
5275
5273
|
await resetUserPassword(showResetPasswordDialogue.id, {
|
|
@@ -5289,7 +5287,7 @@ function ListView({ data, meta }) {
|
|
|
5289
5287
|
},
|
|
5290
5288
|
[showResetPasswordDialogue.id, handleCloseResetDialogue, toggleNotification]
|
|
5291
5289
|
);
|
|
5292
|
-
const deleteAccount =
|
|
5290
|
+
const deleteAccount = m.useCallback(
|
|
5293
5291
|
async (isStrapiIncluded, isFirebaseIncluded) => {
|
|
5294
5292
|
const newRowsData = await handleConfirmDeleteData(
|
|
5295
5293
|
showDeleteAccountDialogue.id,
|
|
@@ -5301,14 +5299,14 @@ function ListView({ data, meta }) {
|
|
|
5301
5299
|
},
|
|
5302
5300
|
[showDeleteAccountDialogue.id, handleConfirmDeleteData, handleCloseDeleteDialogue]
|
|
5303
5301
|
);
|
|
5304
|
-
const handleResetPasswordClick =
|
|
5302
|
+
const handleResetPasswordClick = m.useCallback((data2) => {
|
|
5305
5303
|
setShowResetPasswordDialogue({
|
|
5306
5304
|
isOpen: true,
|
|
5307
5305
|
email: data2.email,
|
|
5308
5306
|
id: data2.uid
|
|
5309
5307
|
});
|
|
5310
5308
|
}, []);
|
|
5311
|
-
const handleDeleteAccountClick =
|
|
5309
|
+
const handleDeleteAccountClick = m.useCallback((data2) => {
|
|
5312
5310
|
setShowDeleteAccountDialogue({
|
|
5313
5311
|
isOpen: true,
|
|
5314
5312
|
email: data2.email,
|
|
@@ -5325,7 +5323,7 @@ function ListView({ data, meta }) {
|
|
|
5325
5323
|
{
|
|
5326
5324
|
subtitle: headSubtitle,
|
|
5327
5325
|
title: HEADER_TITLE,
|
|
5328
|
-
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5326
|
+
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(api.zc, { startIcon: /* @__PURE__ */ jsxRuntime.jsx(index.U2, {}), to: "/content-manager/", children: "Back" })
|
|
5329
5327
|
}
|
|
5330
5328
|
),
|
|
5331
5329
|
/* @__PURE__ */ jsxRuntime.jsxs(admin.Layouts.Content, { children: [
|
|
@@ -5407,10 +5405,10 @@ const ContentContainer = styled__default.default.div`
|
|
|
5407
5405
|
`;
|
|
5408
5406
|
const HomePage = () => {
|
|
5409
5407
|
const { toggleNotification } = admin.useNotification();
|
|
5410
|
-
const [isNotConfigured, setIsNotConfigured] =
|
|
5411
|
-
const [isLoading, setIsLoading] =
|
|
5408
|
+
const [isNotConfigured, setIsNotConfigured] = m.useState(false);
|
|
5409
|
+
const [isLoading, setIsLoading] = m.useState(true);
|
|
5412
5410
|
const navigate = reactRouterDom.useNavigate();
|
|
5413
|
-
|
|
5411
|
+
m.useEffect(() => {
|
|
5414
5412
|
const loadData = async () => {
|
|
5415
5413
|
try {
|
|
5416
5414
|
const config = await api.getFirebaseConfig();
|
|
@@ -5437,11 +5435,11 @@ const HomePage = () => {
|
|
|
5437
5435
|
}
|
|
5438
5436
|
return /* @__PURE__ */ jsxRuntime.jsxs(StyledPageMain, { children: [
|
|
5439
5437
|
/* @__PURE__ */ jsxRuntime.jsx(admin.Page.Title, { children: "Firebase Users" }),
|
|
5440
|
-
!isNotConfigured ? /* @__PURE__ */ jsxRuntime.jsx(ContentContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5441
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5442
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5438
|
+
!isNotConfigured ? /* @__PURE__ */ jsxRuntime.jsx(ContentContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(api.T, { direction: "column", alignItems: "stretch", gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(ListView, {}) }) }) : /* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "column", marginTop: 10, children: [
|
|
5439
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Nn, {}),
|
|
5440
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.R, { marginTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(api.E, { children: "Firebase is not configured, please configure Firebase" }) }),
|
|
5443
5441
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5444
|
-
|
|
5442
|
+
api.Nn,
|
|
5445
5443
|
{
|
|
5446
5444
|
marginTop: 3,
|
|
5447
5445
|
onClick: () => {
|
|
@@ -5635,14 +5633,14 @@ const UserFormFields = ({
|
|
|
5635
5633
|
}) => {
|
|
5636
5634
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5637
5635
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5638
|
-
|
|
5636
|
+
api.Fm.Root,
|
|
5639
5637
|
{
|
|
5640
5638
|
style: { width: "50%" },
|
|
5641
5639
|
error: emailError || (hasBeenTouched && !userData?.email && !userData?.phoneNumber ? "Email or Phone Number is required" : void 0),
|
|
5642
5640
|
children: [
|
|
5643
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5641
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Label, { children: "Email" }),
|
|
5644
5642
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5645
|
-
|
|
5643
|
+
api.G0,
|
|
5646
5644
|
{
|
|
5647
5645
|
id: "email",
|
|
5648
5646
|
name: "email",
|
|
@@ -5652,14 +5650,14 @@ const UserFormFields = ({
|
|
|
5652
5650
|
value: userData.email || ""
|
|
5653
5651
|
}
|
|
5654
5652
|
),
|
|
5655
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5653
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Error, {})
|
|
5656
5654
|
]
|
|
5657
5655
|
}
|
|
5658
5656
|
),
|
|
5659
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5660
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5657
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.Fm.Root, { style: { width: "50%" }, children: [
|
|
5658
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Label, { children: "Display Name" }),
|
|
5661
5659
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5662
|
-
|
|
5660
|
+
api.G0,
|
|
5663
5661
|
{
|
|
5664
5662
|
id: "displayName",
|
|
5665
5663
|
name: "displayName",
|
|
@@ -5669,8 +5667,8 @@ const UserFormFields = ({
|
|
|
5669
5667
|
}
|
|
5670
5668
|
)
|
|
5671
5669
|
] }),
|
|
5672
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5673
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5670
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.Fm.Root, { style: { width: "50%" }, error: phoneError || void 0, children: [
|
|
5671
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Label, { children: "Phone Number" }),
|
|
5674
5672
|
/* @__PURE__ */ jsxRuntime.jsx(StyledPhoneInputWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5675
5673
|
PhoneInput,
|
|
5676
5674
|
{
|
|
@@ -5700,18 +5698,18 @@ const UserFormFields = ({
|
|
|
5700
5698
|
}
|
|
5701
5699
|
}
|
|
5702
5700
|
) }),
|
|
5703
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5704
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5701
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Error, {}),
|
|
5702
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Hint, { children: "E.164 format: +[country code][number] (e.g., +14155552671)" })
|
|
5705
5703
|
] }),
|
|
5706
5704
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5707
|
-
|
|
5705
|
+
api.Fm.Root,
|
|
5708
5706
|
{
|
|
5709
5707
|
style: { width: "50%" },
|
|
5710
5708
|
error: userData?.password?.length && userData?.password?.length < 6 ? "Password must be at least 6 characters" : void 0,
|
|
5711
5709
|
children: [
|
|
5712
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5710
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Label, { children: "Password" }),
|
|
5713
5711
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5714
|
-
|
|
5712
|
+
api.G0,
|
|
5715
5713
|
{
|
|
5716
5714
|
id: "password",
|
|
5717
5715
|
name: "password",
|
|
@@ -5722,15 +5720,15 @@ const UserFormFields = ({
|
|
|
5722
5720
|
required: isPasswordRequired
|
|
5723
5721
|
}
|
|
5724
5722
|
),
|
|
5725
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5726
|
-
showPasswordHint && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5723
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Error, {}),
|
|
5724
|
+
showPasswordHint && /* @__PURE__ */ jsxRuntime.jsx(api.Fm.Hint, { children: "Leave empty to keep current password" })
|
|
5727
5725
|
]
|
|
5728
5726
|
}
|
|
5729
5727
|
),
|
|
5730
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5731
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5728
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.Fm.Root, { maxWidth: "320px", children: [
|
|
5729
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Label, { children: "Disabled" }),
|
|
5732
5730
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5733
|
-
|
|
5731
|
+
api.D1,
|
|
5734
5732
|
{
|
|
5735
5733
|
name: "disabled",
|
|
5736
5734
|
onLabel: "True",
|
|
@@ -5740,10 +5738,10 @@ const UserFormFields = ({
|
|
|
5740
5738
|
}
|
|
5741
5739
|
)
|
|
5742
5740
|
] }),
|
|
5743
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5744
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5741
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.Fm.Root, { maxWidth: "320px", children: [
|
|
5742
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Label, { children: "Email Verified" }),
|
|
5745
5743
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5746
|
-
|
|
5744
|
+
api.D1,
|
|
5747
5745
|
{
|
|
5748
5746
|
name: "emailVerified",
|
|
5749
5747
|
onLabel: "True",
|
|
@@ -5756,9 +5754,9 @@ const UserFormFields = ({
|
|
|
5756
5754
|
] });
|
|
5757
5755
|
};
|
|
5758
5756
|
const UserFormLayout = ({ children, sidebar }) => {
|
|
5759
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5757
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "row", alignItems: "stretch", gap: 4, width: "100%", children: [
|
|
5760
5758
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5761
|
-
|
|
5759
|
+
api.R,
|
|
5762
5760
|
{
|
|
5763
5761
|
background: "neutral0",
|
|
5764
5762
|
borderColor: "neutral150",
|
|
@@ -5766,11 +5764,11 @@ const UserFormLayout = ({ children, sidebar }) => {
|
|
|
5766
5764
|
padding: 8,
|
|
5767
5765
|
shadow: "tableShadow",
|
|
5768
5766
|
style: { flex: "9 1 0px", minWidth: 0 },
|
|
5769
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5767
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(api.T, { direction: "column", gap: 4, alignItems: "stretch", children })
|
|
5770
5768
|
}
|
|
5771
5769
|
),
|
|
5772
5770
|
sidebar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5773
|
-
|
|
5771
|
+
api.T,
|
|
5774
5772
|
{
|
|
5775
5773
|
direction: "column",
|
|
5776
5774
|
gap: 4,
|
|
@@ -5807,11 +5805,11 @@ function validatePhoneNumber(phone) {
|
|
|
5807
5805
|
return { isValid: true, error: null };
|
|
5808
5806
|
}
|
|
5809
5807
|
const useUserForm = (initialData = {}) => {
|
|
5810
|
-
const [userData, setUserData] =
|
|
5811
|
-
const [emailError, setEmailError] =
|
|
5812
|
-
const [phoneError, setPhoneError] =
|
|
5813
|
-
const [hasBeenTouched, setHasBeenTouched] =
|
|
5814
|
-
const onTextInputChange =
|
|
5808
|
+
const [userData, setUserData] = m.useState(initialData);
|
|
5809
|
+
const [emailError, setEmailError] = m.useState(null);
|
|
5810
|
+
const [phoneError, setPhoneError] = m.useState(null);
|
|
5811
|
+
const [hasBeenTouched, setHasBeenTouched] = m.useState(false);
|
|
5812
|
+
const onTextInputChange = m.useCallback(
|
|
5815
5813
|
(e2) => {
|
|
5816
5814
|
const { name, value } = e2.target;
|
|
5817
5815
|
setUserData((prevState) => ({
|
|
@@ -5824,13 +5822,13 @@ const useUserForm = (initialData = {}) => {
|
|
|
5824
5822
|
},
|
|
5825
5823
|
[emailError]
|
|
5826
5824
|
);
|
|
5827
|
-
const onEmailBlur =
|
|
5825
|
+
const onEmailBlur = m.useCallback((e2) => {
|
|
5828
5826
|
const { value } = e2.target;
|
|
5829
5827
|
const validation = validateEmail(value);
|
|
5830
5828
|
setEmailError(validation.error);
|
|
5831
5829
|
setHasBeenTouched(true);
|
|
5832
5830
|
}, []);
|
|
5833
|
-
const onPhoneChange =
|
|
5831
|
+
const onPhoneChange = m.useCallback((value) => {
|
|
5834
5832
|
setUserData((prevState) => ({
|
|
5835
5833
|
...prevState,
|
|
5836
5834
|
phoneNumber: value || ""
|
|
@@ -5838,7 +5836,7 @@ const useUserForm = (initialData = {}) => {
|
|
|
5838
5836
|
const validation = validatePhoneNumber(value);
|
|
5839
5837
|
setPhoneError(validation.error);
|
|
5840
5838
|
}, []);
|
|
5841
|
-
const onToggleInputChange =
|
|
5839
|
+
const onToggleInputChange = m.useCallback((e2) => {
|
|
5842
5840
|
setUserData((prevState) => ({
|
|
5843
5841
|
...prevState,
|
|
5844
5842
|
[e2.target.name]: e2.target.checked
|
|
@@ -5863,11 +5861,11 @@ const useUserForm = (initialData = {}) => {
|
|
|
5863
5861
|
};
|
|
5864
5862
|
};
|
|
5865
5863
|
const CreateUserForm = () => {
|
|
5866
|
-
const [isLoading, setIsLoading] =
|
|
5864
|
+
const [isLoading, setIsLoading] = m.useState(false);
|
|
5867
5865
|
const { toggleNotification } = admin.useNotification();
|
|
5868
5866
|
const navigate = reactRouterDom.useNavigate();
|
|
5869
5867
|
const { userData, emailError, phoneError, hasBeenTouched, handlers, isSubmitDisabled } = useUserForm();
|
|
5870
|
-
const createUserHandler =
|
|
5868
|
+
const createUserHandler = m.useCallback(async () => {
|
|
5871
5869
|
setIsLoading(true);
|
|
5872
5870
|
try {
|
|
5873
5871
|
const createdUser = await createUser(userData);
|
|
@@ -5937,11 +5935,11 @@ const PasswordResetButton = ({
|
|
|
5937
5935
|
}
|
|
5938
5936
|
};
|
|
5939
5937
|
const button = /* @__PURE__ */ jsxRuntime.jsx(
|
|
5940
|
-
|
|
5938
|
+
api.Nn,
|
|
5941
5939
|
{
|
|
5942
5940
|
onClick: handleClick,
|
|
5943
5941
|
disabled: !canResetPassword,
|
|
5944
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5942
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(index.m3, {}),
|
|
5945
5943
|
variant,
|
|
5946
5944
|
size,
|
|
5947
5945
|
fullWidth,
|
|
@@ -5949,18 +5947,18 @@ const PasswordResetButton = ({
|
|
|
5949
5947
|
}
|
|
5950
5948
|
);
|
|
5951
5949
|
if (!canResetPassword) {
|
|
5952
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5950
|
+
return /* @__PURE__ */ jsxRuntime.jsx(api.Ar, { label: tooltipMessage, children: /* @__PURE__ */ jsxRuntime.jsx(api.R, { children: button }) });
|
|
5953
5951
|
}
|
|
5954
5952
|
return button;
|
|
5955
5953
|
};
|
|
5956
|
-
const MetaWrapper = styled__default.default(
|
|
5954
|
+
const MetaWrapper = styled__default.default(api.R)`
|
|
5957
5955
|
width: 100%;
|
|
5958
5956
|
display: flex;
|
|
5959
5957
|
flex-direction: column;
|
|
5960
5958
|
justify-content: flex-start;
|
|
5961
5959
|
font-size: 18px;
|
|
5962
5960
|
`;
|
|
5963
|
-
const ContentWrapper = styled__default.default(
|
|
5961
|
+
const ContentWrapper = styled__default.default(api.R)`
|
|
5964
5962
|
width: 100%;
|
|
5965
5963
|
display: flex;
|
|
5966
5964
|
justify-content: space-between;
|
|
@@ -5968,7 +5966,7 @@ const ContentWrapper = styled__default.default(designSystem.Box)`
|
|
|
5968
5966
|
font-size: 18px;
|
|
5969
5967
|
padding: 5px;
|
|
5970
5968
|
`;
|
|
5971
|
-
const DetailsButtonWrapper = styled__default.default(
|
|
5969
|
+
const DetailsButtonWrapper = styled__default.default(api.R)`
|
|
5972
5970
|
width: 100%;
|
|
5973
5971
|
display: flex;
|
|
5974
5972
|
justify-content: flex-end;
|
|
@@ -5976,19 +5974,19 @@ const DetailsButtonWrapper = styled__default.default(designSystem.Box)`
|
|
|
5976
5974
|
padding: 5px;
|
|
5977
5975
|
`;
|
|
5978
5976
|
const EditUserForm = ({ data }) => {
|
|
5979
|
-
const [originalUserData] =
|
|
5980
|
-
const [isLoading, setIsLoading] =
|
|
5981
|
-
const [showResetPasswordDialog, setShowResetPasswordDialog] =
|
|
5977
|
+
const [originalUserData] = m.useState(data);
|
|
5978
|
+
const [isLoading, setIsLoading] = m.useState(false);
|
|
5979
|
+
const [showResetPasswordDialog, setShowResetPasswordDialog] = m.useState({
|
|
5982
5980
|
isOpen: false,
|
|
5983
5981
|
email: "",
|
|
5984
5982
|
id: ""
|
|
5985
5983
|
});
|
|
5986
|
-
const [showVerificationDialog, setShowVerificationDialog] =
|
|
5984
|
+
const [showVerificationDialog, setShowVerificationDialog] = m.useState({
|
|
5987
5985
|
isOpen: false,
|
|
5988
5986
|
email: "",
|
|
5989
5987
|
id: ""
|
|
5990
5988
|
});
|
|
5991
|
-
const [passwordConfig, setPasswordConfig] =
|
|
5989
|
+
const [passwordConfig, setPasswordConfig] = m.useState({
|
|
5992
5990
|
passwordRequirementsRegex: "^.{6,}$",
|
|
5993
5991
|
passwordRequirementsMessage: "Password must be at least 6 characters long"
|
|
5994
5992
|
});
|
|
@@ -5997,7 +5995,7 @@ const EditUserForm = ({ data }) => {
|
|
|
5997
5995
|
const location = reactRouterDom.useLocation();
|
|
5998
5996
|
const locationState = location.state || {};
|
|
5999
5997
|
const { userData, setUserData, emailError, phoneError, handlers, isSubmitDisabled } = useUserForm(data);
|
|
6000
|
-
const updateUserHandler =
|
|
5998
|
+
const updateUserHandler = m.useCallback(async () => {
|
|
6001
5999
|
setIsLoading(true);
|
|
6002
6000
|
try {
|
|
6003
6001
|
const updatedUser = await updateUser(userData.uid, userData);
|
|
@@ -6024,7 +6022,7 @@ const EditUserForm = ({ data }) => {
|
|
|
6024
6022
|
setUserData(data);
|
|
6025
6023
|
}
|
|
6026
6024
|
}, [userData, toggleNotification, data, setUserData]);
|
|
6027
|
-
|
|
6025
|
+
m.useEffect(() => {
|
|
6028
6026
|
const fetchConfig = async () => {
|
|
6029
6027
|
try {
|
|
6030
6028
|
const config = await getFirebaseConfig();
|
|
@@ -6038,10 +6036,10 @@ const EditUserForm = ({ data }) => {
|
|
|
6038
6036
|
};
|
|
6039
6037
|
fetchConfig();
|
|
6040
6038
|
}, []);
|
|
6041
|
-
const handleCloseResetDialog =
|
|
6039
|
+
const handleCloseResetDialog = m.useCallback(() => {
|
|
6042
6040
|
setShowResetPasswordDialog({ isOpen: false, email: "", id: "" });
|
|
6043
6041
|
}, []);
|
|
6044
|
-
const handleResetPassword =
|
|
6042
|
+
const handleResetPassword = m.useCallback(
|
|
6045
6043
|
async (newPassword) => {
|
|
6046
6044
|
try {
|
|
6047
6045
|
await resetUserPassword(userData.uid, { password: newPassword });
|
|
@@ -6060,7 +6058,7 @@ const EditUserForm = ({ data }) => {
|
|
|
6060
6058
|
},
|
|
6061
6059
|
[userData.uid, toggleNotification, handleCloseResetDialog]
|
|
6062
6060
|
);
|
|
6063
|
-
const handleSendResetEmail =
|
|
6061
|
+
const handleSendResetEmail = m.useCallback(async () => {
|
|
6064
6062
|
try {
|
|
6065
6063
|
await sendResetEmail(userData.uid);
|
|
6066
6064
|
toggleNotification({
|
|
@@ -6075,10 +6073,10 @@ const EditUserForm = ({ data }) => {
|
|
|
6075
6073
|
});
|
|
6076
6074
|
}
|
|
6077
6075
|
}, [userData.uid, toggleNotification]);
|
|
6078
|
-
const handleCloseVerificationDialog =
|
|
6076
|
+
const handleCloseVerificationDialog = m.useCallback(() => {
|
|
6079
6077
|
setShowVerificationDialog({ isOpen: false, email: "", id: "" });
|
|
6080
6078
|
}, []);
|
|
6081
|
-
const handleSendVerificationEmail =
|
|
6079
|
+
const handleSendVerificationEmail = m.useCallback(async () => {
|
|
6082
6080
|
await sendVerificationEmail(userData.uid);
|
|
6083
6081
|
}, [userData.uid]);
|
|
6084
6082
|
if (isLoading) {
|
|
@@ -6101,7 +6099,7 @@ const EditUserForm = ({ data }) => {
|
|
|
6101
6099
|
{
|
|
6102
6100
|
sidebar: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6103
6101
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6104
|
-
|
|
6102
|
+
api.R,
|
|
6105
6103
|
{
|
|
6106
6104
|
as: "aside",
|
|
6107
6105
|
background: "neutral0",
|
|
@@ -6113,15 +6111,15 @@ const EditUserForm = ({ data }) => {
|
|
|
6113
6111
|
paddingTop: 2,
|
|
6114
6112
|
shadow: "tableShadow",
|
|
6115
6113
|
children: [
|
|
6116
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6117
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6118
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6119
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6114
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { paddingTop: 2, paddingBottom: 2, direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
6115
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { gap: 1, children: [
|
|
6116
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: "Firebase User ID:" }),
|
|
6117
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: userData.firebaseUserID || userData.uid })
|
|
6120
6118
|
] }),
|
|
6121
|
-
locationState?.strapiId && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6122
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6119
|
+
locationState?.strapiId && /* @__PURE__ */ jsxRuntime.jsxs(api.T, { gap: 1, children: [
|
|
6120
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: "Strapi ID:" }),
|
|
6123
6121
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6124
|
-
|
|
6122
|
+
api.E,
|
|
6125
6123
|
{
|
|
6126
6124
|
variant: "sigma",
|
|
6127
6125
|
textColor: "primary600",
|
|
@@ -6141,37 +6139,37 @@ const EditUserForm = ({ data }) => {
|
|
|
6141
6139
|
)
|
|
6142
6140
|
] })
|
|
6143
6141
|
] }),
|
|
6144
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6145
|
-
userData.providerData?.map((provider, index2) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6146
|
-
index2 > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6147
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6148
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6149
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6150
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6142
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.pl, {}),
|
|
6143
|
+
userData.providerData?.map((provider, index2) => /* @__PURE__ */ jsxRuntime.jsxs(m__default.default.Fragment, { children: [
|
|
6144
|
+
index2 > 0 && /* @__PURE__ */ jsxRuntime.jsx(api.pl, {}),
|
|
6145
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { paddingTop: 2, paddingBottom: 2, direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
6146
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { gap: 1, children: [
|
|
6147
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: "Provider:" }),
|
|
6148
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: provider.providerId })
|
|
6151
6149
|
] }),
|
|
6152
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6153
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6154
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6150
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { gap: 1, children: [
|
|
6151
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: "Identifier:" }),
|
|
6152
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: provider.uid })
|
|
6155
6153
|
] })
|
|
6156
6154
|
] })
|
|
6157
6155
|
] }, index2)),
|
|
6158
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6159
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6156
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.pl, {}),
|
|
6157
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { paddingTop: 2, paddingBottom: 2, direction: "column", alignItems: "flex-start", gap: 3, children: [
|
|
6160
6158
|
userData.metadata?.lastSignInTime && /* @__PURE__ */ jsxRuntime.jsxs(MetaWrapper, { children: [
|
|
6161
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6162
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6159
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: "Last Sign In Time" }),
|
|
6160
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: format(new Date(userData.metadata.lastSignInTime), "yyyy/MM/dd HH:mm z") })
|
|
6163
6161
|
] }),
|
|
6164
6162
|
(userData.metadata?.creationTime || userData.createdAt) && /* @__PURE__ */ jsxRuntime.jsxs(MetaWrapper, { children: [
|
|
6165
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6166
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6163
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: "Creation Time" }),
|
|
6164
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: userData.metadata?.creationTime ? format(new Date(userData.metadata.creationTime), "yyyy/MM/dd HH:mm z") : userData.createdAt ? format(new Date(userData.createdAt), "yyyy/MM/dd HH:mm z") : "-" })
|
|
6167
6165
|
] })
|
|
6168
6166
|
] })
|
|
6169
6167
|
]
|
|
6170
6168
|
}
|
|
6171
6169
|
),
|
|
6172
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6170
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.R, { marginTop: 5, marginBottom: 5 }),
|
|
6173
6171
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6174
|
-
|
|
6172
|
+
api.R,
|
|
6175
6173
|
{
|
|
6176
6174
|
as: "aside",
|
|
6177
6175
|
background: "neutral0",
|
|
@@ -6183,8 +6181,8 @@ const EditUserForm = ({ data }) => {
|
|
|
6183
6181
|
paddingTop: 4,
|
|
6184
6182
|
shadow: "tableShadow",
|
|
6185
6183
|
children: [
|
|
6186
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6187
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6184
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", marginBottom: 2, children: "Account Actions" }),
|
|
6185
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "column", gap: 2, children: [
|
|
6188
6186
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6189
6187
|
PasswordResetButton,
|
|
6190
6188
|
{
|
|
@@ -6200,7 +6198,7 @@ const EditUserForm = ({ data }) => {
|
|
|
6200
6198
|
}
|
|
6201
6199
|
),
|
|
6202
6200
|
userData.email && !userData.emailVerified && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6203
|
-
|
|
6201
|
+
api.Nn,
|
|
6204
6202
|
{
|
|
6205
6203
|
variant: "secondary",
|
|
6206
6204
|
fullWidth: true,
|
|
@@ -6218,9 +6216,9 @@ const EditUserForm = ({ data }) => {
|
|
|
6218
6216
|
]
|
|
6219
6217
|
}
|
|
6220
6218
|
),
|
|
6221
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6219
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.R, { marginTop: 5, marginBottom: 5 }),
|
|
6222
6220
|
userData.localUser && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6223
|
-
|
|
6221
|
+
api.R,
|
|
6224
6222
|
{
|
|
6225
6223
|
as: "aside",
|
|
6226
6224
|
background: "neutral0",
|
|
@@ -6231,11 +6229,11 @@ const EditUserForm = ({ data }) => {
|
|
|
6231
6229
|
paddingRight: 2,
|
|
6232
6230
|
paddingTop: 1,
|
|
6233
6231
|
shadow: "tableShadow",
|
|
6234
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6232
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(api.R, { paddingTop: 2, paddingBottom: 2, children: [
|
|
6235
6233
|
/* @__PURE__ */ jsxRuntime.jsx(DetailsButtonWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6236
|
-
|
|
6234
|
+
api.zc,
|
|
6237
6235
|
{
|
|
6238
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6236
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(index._3, {}),
|
|
6239
6237
|
onClick: () => navigate(
|
|
6240
6238
|
`/content-manager/collection-types/plugin::users-permissions.user/${userData.localUser?.id}`
|
|
6241
6239
|
),
|
|
@@ -6244,8 +6242,8 @@ const EditUserForm = ({ data }) => {
|
|
|
6244
6242
|
}
|
|
6245
6243
|
) }),
|
|
6246
6244
|
/* @__PURE__ */ jsxRuntime.jsxs(ContentWrapper, { children: [
|
|
6247
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6248
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6245
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: "local user:" }),
|
|
6246
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "sigma", textColor: "neutral600", children: userData.localUser.username })
|
|
6249
6247
|
] })
|
|
6250
6248
|
] })
|
|
6251
6249
|
}
|
|
@@ -6295,9 +6293,9 @@ const EditUserForm = ({ data }) => {
|
|
|
6295
6293
|
const EditView = () => {
|
|
6296
6294
|
const { id } = reactRouterDom.useParams();
|
|
6297
6295
|
const { toggleNotification } = admin.useNotification();
|
|
6298
|
-
const [userData, setUserData] =
|
|
6299
|
-
const [isLoading, setIsLoading] =
|
|
6300
|
-
|
|
6296
|
+
const [userData, setUserData] = m.useState(null);
|
|
6297
|
+
const [isLoading, setIsLoading] = m.useState(true);
|
|
6298
|
+
m.useEffect(() => {
|
|
6301
6299
|
const loadUser = async () => {
|
|
6302
6300
|
try {
|
|
6303
6301
|
if (!id) {
|
|
@@ -6333,7 +6331,7 @@ const CreateView = () => {
|
|
|
6333
6331
|
return /* @__PURE__ */ jsxRuntime.jsx(CreateUserForm, {});
|
|
6334
6332
|
};
|
|
6335
6333
|
const App = () => {
|
|
6336
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6334
|
+
return /* @__PURE__ */ jsxRuntime.jsx(rt.Provider, { delayDuration: 300, skipDelayDuration: 100, children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [
|
|
6337
6335
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: /* @__PURE__ */ jsxRuntime.jsx(HomePage, {}) }),
|
|
6338
6336
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "users/create", element: /* @__PURE__ */ jsxRuntime.jsx(CreateView, {}) }),
|
|
6339
6337
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: ":id", element: /* @__PURE__ */ jsxRuntime.jsx(EditView, {}) }),
|