strapi-plugin-firebase-authentication 1.1.12 → 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-BqjE8BHb.js → App-CAgq2cOo.js} +369 -288
- package/dist/_chunks/{App-BY1gNGKH.mjs → App-CyeC5fLT.mjs} +291 -210
- 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-C4t4JZZ_.js → index-CTenjpqN.js} +285 -172
- package/dist/_chunks/{index-D8pv1Q6h.mjs → index-Kidqhaeq.mjs} +268 -155
- package/dist/_chunks/index-Rervtuh1.js +2757 -0
- package/dist/admin/index.js +1 -3
- package/dist/admin/index.mjs +2 -4
- package/dist/admin/src/components/user-management/ResendVerification/ResendVerification.d.ts +9 -0
- package/dist/admin/src/components/user-management/index.d.ts +1 -0
- package/dist/admin/src/pages/Settings/api.d.ts +4 -0
- package/dist/admin/src/pages/utils/api.d.ts +2 -1
- package/dist/server/index.js +1008 -332
- package/dist/server/index.mjs +1008 -332
- package/dist/server/src/config/index.d.ts +1 -1
- package/dist/server/src/content-types/index.d.ts +16 -0
- package/dist/server/src/controllers/firebaseController.d.ts +16 -1
- package/dist/server/src/controllers/index.d.ts +3 -0
- package/dist/server/src/controllers/userController.d.ts +1 -0
- package/dist/server/src/index.d.ts +51 -5
- 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/emailService.d.ts +10 -0
- package/dist/server/src/services/firebaseService.d.ts +21 -1
- package/dist/server/src/services/index.d.ts +18 -1
- package/dist/server/src/services/settingsService.d.ts +2 -0
- package/dist/server/src/services/tokenService.d.ts +21 -0
- package/dist/server/src/services/userService.d.ts +5 -0
- package/dist/server/src/templates/defaults/email-verification.d.ts +2 -0
- package/dist/server/src/templates/defaults/index.d.ts +1 -0
- package/dist/server/src/templates/types.d.ts +3 -1
- package/package.json +8 -8
- package/dist/_chunks/api-DQCdqlCd.js +0 -35
- package/dist/_chunks/api-D_4cdJU5.mjs +0 -36
- package/dist/_chunks/index-DlPxMuSK.js +0 -814
- package/dist/_chunks/index-DtGfwf9S.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-DQCdqlCd.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,
|
|
@@ -2731,27 +2729,33 @@ const getFirebaseConfig = async () => {
|
|
|
2731
2729
|
};
|
|
2732
2730
|
}
|
|
2733
2731
|
};
|
|
2732
|
+
const sendVerificationEmail = async (userId) => {
|
|
2733
|
+
const url = `/${index.PLUGIN_ID}/users/sendVerificationEmail/${userId}`;
|
|
2734
|
+
const { put } = admin.getFetchClient();
|
|
2735
|
+
const { data: result } = await put(url, {});
|
|
2736
|
+
return result;
|
|
2737
|
+
};
|
|
2734
2738
|
const PaginationFooter = ({ pageCount = 0 }) => {
|
|
2735
2739
|
const [{ query }, setQuery] = admin.useQueryParams();
|
|
2736
2740
|
const pageSize = query?.pageSize || "10";
|
|
2737
2741
|
const handlePageSizeChange = (value) => {
|
|
2738
2742
|
setQuery({ pageSize: value, page: 1 });
|
|
2739
2743
|
};
|
|
2740
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2741
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2742
|
-
/* @__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:" }),
|
|
2743
2747
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2744
|
-
|
|
2748
|
+
api.bo,
|
|
2745
2749
|
{
|
|
2746
2750
|
size: "S",
|
|
2747
2751
|
value: pageSize,
|
|
2748
2752
|
onChange: handlePageSizeChange,
|
|
2749
2753
|
"aria-label": "Entries per page",
|
|
2750
2754
|
children: [
|
|
2751
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2752
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2753
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2754
|
-
/* @__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" })
|
|
2755
2759
|
]
|
|
2756
2760
|
}
|
|
2757
2761
|
)
|
|
@@ -3085,9 +3089,9 @@ function nameOf(f) {
|
|
|
3085
3089
|
if (f.name) {
|
|
3086
3090
|
return f.name;
|
|
3087
3091
|
}
|
|
3088
|
-
var
|
|
3089
|
-
if (
|
|
3090
|
-
return
|
|
3092
|
+
var m4 = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
3093
|
+
if (m4) {
|
|
3094
|
+
return m4[1];
|
|
3091
3095
|
}
|
|
3092
3096
|
return null;
|
|
3093
3097
|
}
|
|
@@ -3153,7 +3157,7 @@ function isSet(x2) {
|
|
|
3153
3157
|
setSize.call(x2);
|
|
3154
3158
|
try {
|
|
3155
3159
|
mapSize.call(x2);
|
|
3156
|
-
} catch (
|
|
3160
|
+
} catch (m4) {
|
|
3157
3161
|
return true;
|
|
3158
3162
|
}
|
|
3159
3163
|
return x2 instanceof Set;
|
|
@@ -4827,14 +4831,14 @@ var lib = {
|
|
|
4827
4831
|
const useQueryParams = (initialParams) => {
|
|
4828
4832
|
const { search } = reactRouterDom.useLocation();
|
|
4829
4833
|
const navigate = reactRouterDom.useNavigate();
|
|
4830
|
-
const query =
|
|
4834
|
+
const query = m.useMemo(() => {
|
|
4831
4835
|
const searchQuery = search.substring(1);
|
|
4832
4836
|
if (!search) {
|
|
4833
4837
|
return initialParams;
|
|
4834
4838
|
}
|
|
4835
4839
|
return lib.parse(searchQuery);
|
|
4836
4840
|
}, [search, initialParams]);
|
|
4837
|
-
const setQuery =
|
|
4841
|
+
const setQuery = m.useCallback(
|
|
4838
4842
|
(nextParams, method = "push") => {
|
|
4839
4843
|
let nextQuery = { ...query };
|
|
4840
4844
|
if (method === "remove") {
|
|
@@ -4851,14 +4855,14 @@ const useQueryParams = (initialParams) => {
|
|
|
4851
4855
|
return { query, rawQuery: search, setQuery };
|
|
4852
4856
|
};
|
|
4853
4857
|
const SearchURLQuery = ({ label, placeholder = void 0 }) => {
|
|
4854
|
-
const wrapperRef =
|
|
4855
|
-
const iconButtonRef =
|
|
4858
|
+
const wrapperRef = m.useRef(null);
|
|
4859
|
+
const iconButtonRef = m.useRef(null);
|
|
4856
4860
|
const { query, setQuery } = useQueryParams();
|
|
4857
|
-
const [value, setValue] =
|
|
4858
|
-
const [isOpen, setIsOpen] =
|
|
4861
|
+
const [value, setValue] = m.useState(query?.search || "");
|
|
4862
|
+
const [isOpen, setIsOpen] = m.useState(!!value);
|
|
4859
4863
|
const { formatMessage } = reactIntl.useIntl();
|
|
4860
4864
|
const handleToggle = () => setIsOpen((prev) => !prev);
|
|
4861
|
-
|
|
4865
|
+
m.useLayoutEffect(() => {
|
|
4862
4866
|
if (isOpen) {
|
|
4863
4867
|
setTimeout(() => {
|
|
4864
4868
|
wrapperRef.current?.querySelector("input").focus();
|
|
@@ -4879,8 +4883,8 @@ const SearchURLQuery = ({ label, placeholder = void 0 }) => {
|
|
|
4879
4883
|
}
|
|
4880
4884
|
};
|
|
4881
4885
|
if (isOpen) {
|
|
4882
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4883
|
-
|
|
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,
|
|
4884
4888
|
{
|
|
4885
4889
|
name: "search",
|
|
4886
4890
|
onChange: ({ target: { value: value2 } }) => setValue(value2),
|
|
@@ -4897,7 +4901,7 @@ const SearchURLQuery = ({ label, placeholder = void 0 }) => {
|
|
|
4897
4901
|
) }) });
|
|
4898
4902
|
}
|
|
4899
4903
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4900
|
-
|
|
4904
|
+
api.ot,
|
|
4901
4905
|
{
|
|
4902
4906
|
ref: iconButtonRef,
|
|
4903
4907
|
variant: "tertiary",
|
|
@@ -4906,7 +4910,7 @@ const SearchURLQuery = ({ label, placeholder = void 0 }) => {
|
|
|
4906
4910
|
id: "app.component.search.label",
|
|
4907
4911
|
defaultMessage: "Search"
|
|
4908
4912
|
}),
|
|
4909
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4913
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(index.un, {})
|
|
4910
4914
|
}
|
|
4911
4915
|
);
|
|
4912
4916
|
};
|
|
@@ -4920,13 +4924,13 @@ const ResetPassword = ({
|
|
|
4920
4924
|
passwordRegex = "^.{6,}$",
|
|
4921
4925
|
passwordMessage = "Password must be at least 6 characters long"
|
|
4922
4926
|
}) => {
|
|
4923
|
-
const [mode, setMode] =
|
|
4924
|
-
const [password, setPassword] =
|
|
4925
|
-
const [isLoading, setIsLoading] =
|
|
4926
|
-
const [emailSent, setEmailSent] =
|
|
4927
|
-
const [error, setError] =
|
|
4928
|
-
const [isPasswordChanged, setIsPasswordChanged] =
|
|
4929
|
-
|
|
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(() => {
|
|
4930
4934
|
if (!isOpen) {
|
|
4931
4935
|
resetState();
|
|
4932
4936
|
}
|
|
@@ -4978,23 +4982,23 @@ const ResetPassword = ({
|
|
|
4978
4982
|
setIsLoading(false);
|
|
4979
4983
|
}
|
|
4980
4984
|
};
|
|
4981
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4982
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4983
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4984
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4985
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4986
|
-
/* @__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 })
|
|
4987
4991
|
] }),
|
|
4988
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4989
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4990
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4991
|
-
/* @__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" })
|
|
4992
4996
|
] }),
|
|
4993
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4994
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4995
|
-
/* @__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: [
|
|
4996
5000
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4997
|
-
|
|
5001
|
+
api.G0,
|
|
4998
5002
|
{
|
|
4999
5003
|
type: "password",
|
|
5000
5004
|
label: "New password",
|
|
@@ -5008,24 +5012,24 @@ const ResetPassword = ({
|
|
|
5008
5012
|
required: true
|
|
5009
5013
|
}
|
|
5010
5014
|
),
|
|
5011
|
-
isPasswordChanged && password && !validatePassword(password) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5015
|
+
isPasswordChanged && password && !validatePassword(password) && /* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "pi", textColor: "danger500", children: passwordMessage })
|
|
5012
5016
|
] })
|
|
5013
5017
|
] }) }),
|
|
5014
|
-
/* @__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: [
|
|
5015
5019
|
"Send a password reset email to ",
|
|
5016
5020
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: email }),
|
|
5017
5021
|
". The link will expire in 1 hour."
|
|
5018
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5022
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(api.vm, { variant: "success", title: "Email Sent", children: [
|
|
5019
5023
|
"Password reset email has been sent to ",
|
|
5020
5024
|
email
|
|
5021
5025
|
] }) }) })
|
|
5022
5026
|
] }),
|
|
5023
|
-
error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5027
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(api.vm, { variant: "danger", title: "Error", children: error })
|
|
5024
5028
|
] }) }),
|
|
5025
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5026
|
-
/* @__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" }),
|
|
5027
5031
|
!emailSent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5028
|
-
|
|
5032
|
+
api.Nn,
|
|
5029
5033
|
{
|
|
5030
5034
|
variant: mode === "direct" ? "danger-light" : "success",
|
|
5031
5035
|
loading: isLoading,
|
|
@@ -5037,6 +5041,59 @@ const ResetPassword = ({
|
|
|
5037
5041
|
] })
|
|
5038
5042
|
] }) });
|
|
5039
5043
|
};
|
|
5044
|
+
const ResendVerification = ({
|
|
5045
|
+
isOpen,
|
|
5046
|
+
email,
|
|
5047
|
+
userId,
|
|
5048
|
+
onClose,
|
|
5049
|
+
onSendVerificationEmail
|
|
5050
|
+
}) => {
|
|
5051
|
+
const [isLoading, setIsLoading] = m.useState(false);
|
|
5052
|
+
const [emailSent, setEmailSent] = m.useState(false);
|
|
5053
|
+
const [error, setError] = m.useState("");
|
|
5054
|
+
const resetState = () => {
|
|
5055
|
+
setEmailSent(false);
|
|
5056
|
+
setError("");
|
|
5057
|
+
setIsLoading(false);
|
|
5058
|
+
};
|
|
5059
|
+
const handleClose = () => {
|
|
5060
|
+
resetState();
|
|
5061
|
+
onClose();
|
|
5062
|
+
};
|
|
5063
|
+
const handleSendEmail = async () => {
|
|
5064
|
+
try {
|
|
5065
|
+
setIsLoading(true);
|
|
5066
|
+
setError("");
|
|
5067
|
+
await onSendVerificationEmail();
|
|
5068
|
+
setEmailSent(true);
|
|
5069
|
+
} catch (err) {
|
|
5070
|
+
setError(err.message || "Failed to send verification email");
|
|
5071
|
+
} finally {
|
|
5072
|
+
setIsLoading(false);
|
|
5073
|
+
}
|
|
5074
|
+
};
|
|
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: [
|
|
5078
|
+
!emailSent ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5079
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.E, { textAlign: "center", children: [
|
|
5080
|
+
"Send a verification email to ",
|
|
5081
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: email }),
|
|
5082
|
+
"?"
|
|
5083
|
+
] }),
|
|
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: [
|
|
5086
|
+
"Verification email has been sent to ",
|
|
5087
|
+
email
|
|
5088
|
+
] }),
|
|
5089
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(api.vm, { variant: "danger", title: "Error", children: error })
|
|
5090
|
+
] }) }),
|
|
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" })
|
|
5094
|
+
] })
|
|
5095
|
+
] }) });
|
|
5096
|
+
};
|
|
5040
5097
|
const HEADER_TITLE = "Firebase Users";
|
|
5041
5098
|
const NOTIFICATION_MESSAGES = {
|
|
5042
5099
|
DELETED: "Deleted",
|
|
@@ -5049,22 +5106,22 @@ const mapUserData = (users) => users.map((item) => ({
|
|
|
5049
5106
|
...item
|
|
5050
5107
|
}));
|
|
5051
5108
|
function ListView({ data, meta }) {
|
|
5052
|
-
const [showResetPasswordDialogue, setShowResetPasswordDialogue] =
|
|
5109
|
+
const [showResetPasswordDialogue, setShowResetPasswordDialogue] = m.useState({
|
|
5053
5110
|
isOpen: false,
|
|
5054
5111
|
email: "",
|
|
5055
5112
|
id: ""
|
|
5056
5113
|
});
|
|
5057
|
-
const [showDeleteAccountDialogue, setShowDeleteAccountDialogue] =
|
|
5114
|
+
const [showDeleteAccountDialogue, setShowDeleteAccountDialogue] = m.useState({
|
|
5058
5115
|
isOpen: false,
|
|
5059
5116
|
email: "",
|
|
5060
5117
|
id: ""
|
|
5061
5118
|
});
|
|
5062
|
-
const [rowsData, setRowsData] =
|
|
5063
|
-
const [rowsMeta, setRowsMeta] =
|
|
5119
|
+
const [rowsData, setRowsData] = m.useState([]);
|
|
5120
|
+
const [rowsMeta, setRowsMeta] = m.useState({
|
|
5064
5121
|
pagination: { page: 1, pageCount: 1, pageSize: 10, total: 0 }
|
|
5065
5122
|
});
|
|
5066
|
-
const [isLoading, setIsLoading] =
|
|
5067
|
-
const [passwordConfig, setPasswordConfig] =
|
|
5123
|
+
const [isLoading, setIsLoading] = m.useState(false);
|
|
5124
|
+
const [passwordConfig, setPasswordConfig] = m.useState({
|
|
5068
5125
|
passwordRequirementsRegex: "^.{6,}$",
|
|
5069
5126
|
passwordRequirementsMessage: "Password must be at least 6 characters long",
|
|
5070
5127
|
passwordResetUrl: "http://localhost:3000/reset-password",
|
|
@@ -5074,15 +5131,15 @@ function ListView({ data, meta }) {
|
|
|
5074
5131
|
const navigate = reactRouterDom.useNavigate();
|
|
5075
5132
|
const { toggleNotification } = admin.useNotification();
|
|
5076
5133
|
const { formatMessage } = reactIntl.useIntl();
|
|
5077
|
-
const queryKey =
|
|
5078
|
-
const setNextPageToken =
|
|
5134
|
+
const queryKey = m.useMemo(() => JSON.stringify(query.query), [query.query]);
|
|
5135
|
+
const setNextPageToken = m.useCallback((page, nextPageToken) => {
|
|
5079
5136
|
const formattedPage = parseInt(page, 10) || 1;
|
|
5080
5137
|
const storeObject = sessionStorage.getItem("nextPageTokens");
|
|
5081
5138
|
const tokens = storeObject ? JSON.parse(storeObject) : {};
|
|
5082
5139
|
tokens[formattedPage + 1] = nextPageToken;
|
|
5083
5140
|
sessionStorage.setItem("nextPageTokens", JSON.stringify(tokens));
|
|
5084
5141
|
}, []);
|
|
5085
|
-
const getNextPageToken =
|
|
5142
|
+
const getNextPageToken = m.useCallback((page) => {
|
|
5086
5143
|
const formattedPage = parseInt(page, 10);
|
|
5087
5144
|
const storeObject = sessionStorage.getItem("nextPageTokens");
|
|
5088
5145
|
if (!storeObject) {
|
|
@@ -5091,7 +5148,7 @@ function ListView({ data, meta }) {
|
|
|
5091
5148
|
const tokens = JSON.parse(storeObject);
|
|
5092
5149
|
return tokens[formattedPage];
|
|
5093
5150
|
}, []);
|
|
5094
|
-
const fetchPaginatedUsers =
|
|
5151
|
+
const fetchPaginatedUsers = m.useCallback(async () => {
|
|
5095
5152
|
const page = query?.query?.page;
|
|
5096
5153
|
const nextPageToken = page ? getNextPageToken(page) : void 0;
|
|
5097
5154
|
const queryWithToken = {
|
|
@@ -5104,7 +5161,7 @@ function ListView({ data, meta }) {
|
|
|
5104
5161
|
}
|
|
5105
5162
|
return response;
|
|
5106
5163
|
}, [query.query, getNextPageToken, setNextPageToken]);
|
|
5107
|
-
|
|
5164
|
+
m.useEffect(() => {
|
|
5108
5165
|
const fetchConfig = async () => {
|
|
5109
5166
|
try {
|
|
5110
5167
|
const config = await getFirebaseConfig();
|
|
@@ -5115,7 +5172,7 @@ function ListView({ data, meta }) {
|
|
|
5115
5172
|
};
|
|
5116
5173
|
fetchConfig();
|
|
5117
5174
|
}, []);
|
|
5118
|
-
|
|
5175
|
+
m.useEffect(() => {
|
|
5119
5176
|
let isMounted = true;
|
|
5120
5177
|
const fetchPaginatedData = async () => {
|
|
5121
5178
|
try {
|
|
@@ -5144,7 +5201,7 @@ function ListView({ data, meta }) {
|
|
|
5144
5201
|
isMounted = false;
|
|
5145
5202
|
};
|
|
5146
5203
|
}, [queryKey]);
|
|
5147
|
-
const fetchData =
|
|
5204
|
+
const fetchData = m.useCallback(async () => {
|
|
5148
5205
|
try {
|
|
5149
5206
|
setIsLoading(true);
|
|
5150
5207
|
const response = await fetchPaginatedUsers();
|
|
@@ -5167,14 +5224,14 @@ function ListView({ data, meta }) {
|
|
|
5167
5224
|
setIsLoading(false);
|
|
5168
5225
|
}
|
|
5169
5226
|
}, [fetchPaginatedUsers, toggleNotification, formatMessage]);
|
|
5170
|
-
const handleDeleteAll =
|
|
5227
|
+
const handleDeleteAll = m.useCallback(
|
|
5171
5228
|
async (idsToDelete, destination = null) => {
|
|
5172
5229
|
await Promise.all(idsToDelete.map((id) => deleteUser(id, destination)));
|
|
5173
5230
|
await fetchData();
|
|
5174
5231
|
},
|
|
5175
5232
|
[fetchData]
|
|
5176
5233
|
);
|
|
5177
|
-
const handleDeleteRecord =
|
|
5234
|
+
const handleDeleteRecord = m.useCallback(
|
|
5178
5235
|
async (idsToDelete, destination) => {
|
|
5179
5236
|
await deleteUser(idsToDelete, destination);
|
|
5180
5237
|
const result = await fetchData();
|
|
@@ -5182,7 +5239,7 @@ function ListView({ data, meta }) {
|
|
|
5182
5239
|
},
|
|
5183
5240
|
[fetchData]
|
|
5184
5241
|
);
|
|
5185
|
-
const handleConfirmDeleteData =
|
|
5242
|
+
const handleConfirmDeleteData = m.useCallback(
|
|
5186
5243
|
async (idsToDelete, isStrapiIncluded, isFirebaseIncluded) => {
|
|
5187
5244
|
let destination = null;
|
|
5188
5245
|
if (isStrapiIncluded && isFirebaseIncluded) {
|
|
@@ -5197,20 +5254,20 @@ function ListView({ data, meta }) {
|
|
|
5197
5254
|
},
|
|
5198
5255
|
[handleDeleteRecord]
|
|
5199
5256
|
);
|
|
5200
|
-
const handleNavigateToCreate =
|
|
5257
|
+
const handleNavigateToCreate = m.useCallback(() => {
|
|
5201
5258
|
navigate("users/create");
|
|
5202
5259
|
}, [navigate]);
|
|
5203
|
-
const getCreateAction =
|
|
5204
|
-
() => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5260
|
+
const getCreateAction = m.useCallback(
|
|
5261
|
+
() => /* @__PURE__ */ jsxRuntime.jsx(api.Nn, { onClick: handleNavigateToCreate, startIcon: /* @__PURE__ */ jsxRuntime.jsx(index.sn, {}), children: "Create" }),
|
|
5205
5262
|
[handleNavigateToCreate]
|
|
5206
5263
|
);
|
|
5207
|
-
const handleCloseResetDialogue =
|
|
5264
|
+
const handleCloseResetDialogue = m.useCallback(() => {
|
|
5208
5265
|
setShowResetPasswordDialogue({ isOpen: false, email: "", id: "" });
|
|
5209
5266
|
}, []);
|
|
5210
|
-
const handleCloseDeleteDialogue =
|
|
5267
|
+
const handleCloseDeleteDialogue = m.useCallback(() => {
|
|
5211
5268
|
setShowDeleteAccountDialogue({ isOpen: false, email: "", id: "" });
|
|
5212
5269
|
}, []);
|
|
5213
|
-
const resetPassword =
|
|
5270
|
+
const resetPassword = m.useCallback(
|
|
5214
5271
|
async (newPassword) => {
|
|
5215
5272
|
try {
|
|
5216
5273
|
await resetUserPassword(showResetPasswordDialogue.id, {
|
|
@@ -5230,7 +5287,7 @@ function ListView({ data, meta }) {
|
|
|
5230
5287
|
},
|
|
5231
5288
|
[showResetPasswordDialogue.id, handleCloseResetDialogue, toggleNotification]
|
|
5232
5289
|
);
|
|
5233
|
-
const deleteAccount =
|
|
5290
|
+
const deleteAccount = m.useCallback(
|
|
5234
5291
|
async (isStrapiIncluded, isFirebaseIncluded) => {
|
|
5235
5292
|
const newRowsData = await handleConfirmDeleteData(
|
|
5236
5293
|
showDeleteAccountDialogue.id,
|
|
@@ -5242,14 +5299,14 @@ function ListView({ data, meta }) {
|
|
|
5242
5299
|
},
|
|
5243
5300
|
[showDeleteAccountDialogue.id, handleConfirmDeleteData, handleCloseDeleteDialogue]
|
|
5244
5301
|
);
|
|
5245
|
-
const handleResetPasswordClick =
|
|
5302
|
+
const handleResetPasswordClick = m.useCallback((data2) => {
|
|
5246
5303
|
setShowResetPasswordDialogue({
|
|
5247
5304
|
isOpen: true,
|
|
5248
5305
|
email: data2.email,
|
|
5249
5306
|
id: data2.uid
|
|
5250
5307
|
});
|
|
5251
5308
|
}, []);
|
|
5252
|
-
const handleDeleteAccountClick =
|
|
5309
|
+
const handleDeleteAccountClick = m.useCallback((data2) => {
|
|
5253
5310
|
setShowDeleteAccountDialogue({
|
|
5254
5311
|
isOpen: true,
|
|
5255
5312
|
email: data2.email,
|
|
@@ -5266,7 +5323,7 @@ function ListView({ data, meta }) {
|
|
|
5266
5323
|
{
|
|
5267
5324
|
subtitle: headSubtitle,
|
|
5268
5325
|
title: HEADER_TITLE,
|
|
5269
|
-
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5326
|
+
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(api.zc, { startIcon: /* @__PURE__ */ jsxRuntime.jsx(index.U2, {}), to: "/content-manager/", children: "Back" })
|
|
5270
5327
|
}
|
|
5271
5328
|
),
|
|
5272
5329
|
/* @__PURE__ */ jsxRuntime.jsxs(admin.Layouts.Content, { children: [
|
|
@@ -5348,10 +5405,10 @@ const ContentContainer = styled__default.default.div`
|
|
|
5348
5405
|
`;
|
|
5349
5406
|
const HomePage = () => {
|
|
5350
5407
|
const { toggleNotification } = admin.useNotification();
|
|
5351
|
-
const [isNotConfigured, setIsNotConfigured] =
|
|
5352
|
-
const [isLoading, setIsLoading] =
|
|
5408
|
+
const [isNotConfigured, setIsNotConfigured] = m.useState(false);
|
|
5409
|
+
const [isLoading, setIsLoading] = m.useState(true);
|
|
5353
5410
|
const navigate = reactRouterDom.useNavigate();
|
|
5354
|
-
|
|
5411
|
+
m.useEffect(() => {
|
|
5355
5412
|
const loadData = async () => {
|
|
5356
5413
|
try {
|
|
5357
5414
|
const config = await api.getFirebaseConfig();
|
|
@@ -5378,11 +5435,11 @@ const HomePage = () => {
|
|
|
5378
5435
|
}
|
|
5379
5436
|
return /* @__PURE__ */ jsxRuntime.jsxs(StyledPageMain, { children: [
|
|
5380
5437
|
/* @__PURE__ */ jsxRuntime.jsx(admin.Page.Title, { children: "Firebase Users" }),
|
|
5381
|
-
!isNotConfigured ? /* @__PURE__ */ jsxRuntime.jsx(ContentContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5382
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5383
|
-
/* @__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" }) }),
|
|
5384
5441
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5385
|
-
|
|
5442
|
+
api.Nn,
|
|
5386
5443
|
{
|
|
5387
5444
|
marginTop: 3,
|
|
5388
5445
|
onClick: () => {
|
|
@@ -5397,24 +5454,10 @@ const HomePage = () => {
|
|
|
5397
5454
|
let PhoneInputTemp = PhoneInputModule__namespace;
|
|
5398
5455
|
let unwrapCount = 0;
|
|
5399
5456
|
while (PhoneInputTemp && typeof PhoneInputTemp === "object" && PhoneInputTemp.default && unwrapCount < 5) {
|
|
5400
|
-
console.log(`🔧 Unwrapping PhoneInput layer ${unwrapCount}:`, PhoneInputTemp);
|
|
5401
5457
|
PhoneInputTemp = PhoneInputTemp.default;
|
|
5402
5458
|
unwrapCount++;
|
|
5403
5459
|
}
|
|
5404
5460
|
const PhoneInput = PhoneInputTemp;
|
|
5405
|
-
console.log("🔍 ==================== PhoneInput Final Check ====================");
|
|
5406
|
-
console.log(" Unwrap iterations:", unwrapCount);
|
|
5407
|
-
console.log(" PhoneInput FINAL:", PhoneInput);
|
|
5408
|
-
console.log(" PhoneInput type:", typeof PhoneInput);
|
|
5409
|
-
console.log(" PhoneInput $$typeof:", PhoneInput?.$$typeof);
|
|
5410
|
-
console.log(" PhoneInput name:", PhoneInput?.name);
|
|
5411
|
-
console.log(" PhoneInput displayName:", PhoneInput?.displayName);
|
|
5412
|
-
console.log(" Is function?:", typeof PhoneInput === "function");
|
|
5413
|
-
console.log(
|
|
5414
|
-
" Is valid React component?:",
|
|
5415
|
-
typeof PhoneInput === "function" || PhoneInput && PhoneInput.$$typeof
|
|
5416
|
-
);
|
|
5417
|
-
console.log("🔍 ================================================================");
|
|
5418
5461
|
const StyledPhoneInputWrapper = styled__default.default.div`
|
|
5419
5462
|
width: 100%;
|
|
5420
5463
|
|
|
@@ -5590,14 +5633,14 @@ const UserFormFields = ({
|
|
|
5590
5633
|
}) => {
|
|
5591
5634
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5592
5635
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5593
|
-
|
|
5636
|
+
api.Fm.Root,
|
|
5594
5637
|
{
|
|
5595
5638
|
style: { width: "50%" },
|
|
5596
5639
|
error: emailError || (hasBeenTouched && !userData?.email && !userData?.phoneNumber ? "Email or Phone Number is required" : void 0),
|
|
5597
5640
|
children: [
|
|
5598
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5641
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Label, { children: "Email" }),
|
|
5599
5642
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5600
|
-
|
|
5643
|
+
api.G0,
|
|
5601
5644
|
{
|
|
5602
5645
|
id: "email",
|
|
5603
5646
|
name: "email",
|
|
@@ -5607,14 +5650,14 @@ const UserFormFields = ({
|
|
|
5607
5650
|
value: userData.email || ""
|
|
5608
5651
|
}
|
|
5609
5652
|
),
|
|
5610
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5653
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Error, {})
|
|
5611
5654
|
]
|
|
5612
5655
|
}
|
|
5613
5656
|
),
|
|
5614
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5615
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5657
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.Fm.Root, { style: { width: "50%" }, children: [
|
|
5658
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Label, { children: "Display Name" }),
|
|
5616
5659
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5617
|
-
|
|
5660
|
+
api.G0,
|
|
5618
5661
|
{
|
|
5619
5662
|
id: "displayName",
|
|
5620
5663
|
name: "displayName",
|
|
@@ -5624,8 +5667,8 @@ const UserFormFields = ({
|
|
|
5624
5667
|
}
|
|
5625
5668
|
)
|
|
5626
5669
|
] }),
|
|
5627
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5628
|
-
/* @__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" }),
|
|
5629
5672
|
/* @__PURE__ */ jsxRuntime.jsx(StyledPhoneInputWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5630
5673
|
PhoneInput,
|
|
5631
5674
|
{
|
|
@@ -5655,18 +5698,18 @@ const UserFormFields = ({
|
|
|
5655
5698
|
}
|
|
5656
5699
|
}
|
|
5657
5700
|
) }),
|
|
5658
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5659
|
-
/* @__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)" })
|
|
5660
5703
|
] }),
|
|
5661
5704
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5662
|
-
|
|
5705
|
+
api.Fm.Root,
|
|
5663
5706
|
{
|
|
5664
5707
|
style: { width: "50%" },
|
|
5665
5708
|
error: userData?.password?.length && userData?.password?.length < 6 ? "Password must be at least 6 characters" : void 0,
|
|
5666
5709
|
children: [
|
|
5667
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5710
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Label, { children: "Password" }),
|
|
5668
5711
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5669
|
-
|
|
5712
|
+
api.G0,
|
|
5670
5713
|
{
|
|
5671
5714
|
id: "password",
|
|
5672
5715
|
name: "password",
|
|
@@ -5677,15 +5720,15 @@ const UserFormFields = ({
|
|
|
5677
5720
|
required: isPasswordRequired
|
|
5678
5721
|
}
|
|
5679
5722
|
),
|
|
5680
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5681
|
-
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" })
|
|
5682
5725
|
]
|
|
5683
5726
|
}
|
|
5684
5727
|
),
|
|
5685
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5686
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5728
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.Fm.Root, { maxWidth: "320px", children: [
|
|
5729
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Label, { children: "Disabled" }),
|
|
5687
5730
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5688
|
-
|
|
5731
|
+
api.D1,
|
|
5689
5732
|
{
|
|
5690
5733
|
name: "disabled",
|
|
5691
5734
|
onLabel: "True",
|
|
@@ -5695,10 +5738,10 @@ const UserFormFields = ({
|
|
|
5695
5738
|
}
|
|
5696
5739
|
)
|
|
5697
5740
|
] }),
|
|
5698
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5699
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5741
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.Fm.Root, { maxWidth: "320px", children: [
|
|
5742
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.Fm.Label, { children: "Email Verified" }),
|
|
5700
5743
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5701
|
-
|
|
5744
|
+
api.D1,
|
|
5702
5745
|
{
|
|
5703
5746
|
name: "emailVerified",
|
|
5704
5747
|
onLabel: "True",
|
|
@@ -5711,9 +5754,9 @@ const UserFormFields = ({
|
|
|
5711
5754
|
] });
|
|
5712
5755
|
};
|
|
5713
5756
|
const UserFormLayout = ({ children, sidebar }) => {
|
|
5714
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5757
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(api.T, { direction: "row", alignItems: "stretch", gap: 4, width: "100%", children: [
|
|
5715
5758
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5716
|
-
|
|
5759
|
+
api.R,
|
|
5717
5760
|
{
|
|
5718
5761
|
background: "neutral0",
|
|
5719
5762
|
borderColor: "neutral150",
|
|
@@ -5721,11 +5764,11 @@ const UserFormLayout = ({ children, sidebar }) => {
|
|
|
5721
5764
|
padding: 8,
|
|
5722
5765
|
shadow: "tableShadow",
|
|
5723
5766
|
style: { flex: "9 1 0px", minWidth: 0 },
|
|
5724
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5767
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(api.T, { direction: "column", gap: 4, alignItems: "stretch", children })
|
|
5725
5768
|
}
|
|
5726
5769
|
),
|
|
5727
5770
|
sidebar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5728
|
-
|
|
5771
|
+
api.T,
|
|
5729
5772
|
{
|
|
5730
5773
|
direction: "column",
|
|
5731
5774
|
gap: 4,
|
|
@@ -5762,11 +5805,11 @@ function validatePhoneNumber(phone) {
|
|
|
5762
5805
|
return { isValid: true, error: null };
|
|
5763
5806
|
}
|
|
5764
5807
|
const useUserForm = (initialData = {}) => {
|
|
5765
|
-
const [userData, setUserData] =
|
|
5766
|
-
const [emailError, setEmailError] =
|
|
5767
|
-
const [phoneError, setPhoneError] =
|
|
5768
|
-
const [hasBeenTouched, setHasBeenTouched] =
|
|
5769
|
-
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(
|
|
5770
5813
|
(e2) => {
|
|
5771
5814
|
const { name, value } = e2.target;
|
|
5772
5815
|
setUserData((prevState) => ({
|
|
@@ -5779,13 +5822,13 @@ const useUserForm = (initialData = {}) => {
|
|
|
5779
5822
|
},
|
|
5780
5823
|
[emailError]
|
|
5781
5824
|
);
|
|
5782
|
-
const onEmailBlur =
|
|
5825
|
+
const onEmailBlur = m.useCallback((e2) => {
|
|
5783
5826
|
const { value } = e2.target;
|
|
5784
5827
|
const validation = validateEmail(value);
|
|
5785
5828
|
setEmailError(validation.error);
|
|
5786
5829
|
setHasBeenTouched(true);
|
|
5787
5830
|
}, []);
|
|
5788
|
-
const onPhoneChange =
|
|
5831
|
+
const onPhoneChange = m.useCallback((value) => {
|
|
5789
5832
|
setUserData((prevState) => ({
|
|
5790
5833
|
...prevState,
|
|
5791
5834
|
phoneNumber: value || ""
|
|
@@ -5793,7 +5836,7 @@ const useUserForm = (initialData = {}) => {
|
|
|
5793
5836
|
const validation = validatePhoneNumber(value);
|
|
5794
5837
|
setPhoneError(validation.error);
|
|
5795
5838
|
}, []);
|
|
5796
|
-
const onToggleInputChange =
|
|
5839
|
+
const onToggleInputChange = m.useCallback((e2) => {
|
|
5797
5840
|
setUserData((prevState) => ({
|
|
5798
5841
|
...prevState,
|
|
5799
5842
|
[e2.target.name]: e2.target.checked
|
|
@@ -5818,11 +5861,11 @@ const useUserForm = (initialData = {}) => {
|
|
|
5818
5861
|
};
|
|
5819
5862
|
};
|
|
5820
5863
|
const CreateUserForm = () => {
|
|
5821
|
-
const [isLoading, setIsLoading] =
|
|
5864
|
+
const [isLoading, setIsLoading] = m.useState(false);
|
|
5822
5865
|
const { toggleNotification } = admin.useNotification();
|
|
5823
5866
|
const navigate = reactRouterDom.useNavigate();
|
|
5824
5867
|
const { userData, emailError, phoneError, hasBeenTouched, handlers, isSubmitDisabled } = useUserForm();
|
|
5825
|
-
const createUserHandler =
|
|
5868
|
+
const createUserHandler = m.useCallback(async () => {
|
|
5826
5869
|
setIsLoading(true);
|
|
5827
5870
|
try {
|
|
5828
5871
|
const createdUser = await createUser(userData);
|
|
@@ -5892,11 +5935,11 @@ const PasswordResetButton = ({
|
|
|
5892
5935
|
}
|
|
5893
5936
|
};
|
|
5894
5937
|
const button = /* @__PURE__ */ jsxRuntime.jsx(
|
|
5895
|
-
|
|
5938
|
+
api.Nn,
|
|
5896
5939
|
{
|
|
5897
5940
|
onClick: handleClick,
|
|
5898
5941
|
disabled: !canResetPassword,
|
|
5899
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5942
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(index.m3, {}),
|
|
5900
5943
|
variant,
|
|
5901
5944
|
size,
|
|
5902
5945
|
fullWidth,
|
|
@@ -5904,18 +5947,18 @@ const PasswordResetButton = ({
|
|
|
5904
5947
|
}
|
|
5905
5948
|
);
|
|
5906
5949
|
if (!canResetPassword) {
|
|
5907
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5950
|
+
return /* @__PURE__ */ jsxRuntime.jsx(api.Ar, { label: tooltipMessage, children: /* @__PURE__ */ jsxRuntime.jsx(api.R, { children: button }) });
|
|
5908
5951
|
}
|
|
5909
5952
|
return button;
|
|
5910
5953
|
};
|
|
5911
|
-
const MetaWrapper = styled__default.default(
|
|
5954
|
+
const MetaWrapper = styled__default.default(api.R)`
|
|
5912
5955
|
width: 100%;
|
|
5913
5956
|
display: flex;
|
|
5914
5957
|
flex-direction: column;
|
|
5915
5958
|
justify-content: flex-start;
|
|
5916
5959
|
font-size: 18px;
|
|
5917
5960
|
`;
|
|
5918
|
-
const ContentWrapper = styled__default.default(
|
|
5961
|
+
const ContentWrapper = styled__default.default(api.R)`
|
|
5919
5962
|
width: 100%;
|
|
5920
5963
|
display: flex;
|
|
5921
5964
|
justify-content: space-between;
|
|
@@ -5923,7 +5966,7 @@ const ContentWrapper = styled__default.default(designSystem.Box)`
|
|
|
5923
5966
|
font-size: 18px;
|
|
5924
5967
|
padding: 5px;
|
|
5925
5968
|
`;
|
|
5926
|
-
const DetailsButtonWrapper = styled__default.default(
|
|
5969
|
+
const DetailsButtonWrapper = styled__default.default(api.R)`
|
|
5927
5970
|
width: 100%;
|
|
5928
5971
|
display: flex;
|
|
5929
5972
|
justify-content: flex-end;
|
|
@@ -5931,14 +5974,19 @@ const DetailsButtonWrapper = styled__default.default(designSystem.Box)`
|
|
|
5931
5974
|
padding: 5px;
|
|
5932
5975
|
`;
|
|
5933
5976
|
const EditUserForm = ({ data }) => {
|
|
5934
|
-
const [originalUserData] =
|
|
5935
|
-
const [isLoading, setIsLoading] =
|
|
5936
|
-
const [showResetPasswordDialog, setShowResetPasswordDialog] =
|
|
5977
|
+
const [originalUserData] = m.useState(data);
|
|
5978
|
+
const [isLoading, setIsLoading] = m.useState(false);
|
|
5979
|
+
const [showResetPasswordDialog, setShowResetPasswordDialog] = m.useState({
|
|
5980
|
+
isOpen: false,
|
|
5981
|
+
email: "",
|
|
5982
|
+
id: ""
|
|
5983
|
+
});
|
|
5984
|
+
const [showVerificationDialog, setShowVerificationDialog] = m.useState({
|
|
5937
5985
|
isOpen: false,
|
|
5938
5986
|
email: "",
|
|
5939
5987
|
id: ""
|
|
5940
5988
|
});
|
|
5941
|
-
const [passwordConfig, setPasswordConfig] =
|
|
5989
|
+
const [passwordConfig, setPasswordConfig] = m.useState({
|
|
5942
5990
|
passwordRequirementsRegex: "^.{6,}$",
|
|
5943
5991
|
passwordRequirementsMessage: "Password must be at least 6 characters long"
|
|
5944
5992
|
});
|
|
@@ -5947,7 +5995,7 @@ const EditUserForm = ({ data }) => {
|
|
|
5947
5995
|
const location = reactRouterDom.useLocation();
|
|
5948
5996
|
const locationState = location.state || {};
|
|
5949
5997
|
const { userData, setUserData, emailError, phoneError, handlers, isSubmitDisabled } = useUserForm(data);
|
|
5950
|
-
const updateUserHandler =
|
|
5998
|
+
const updateUserHandler = m.useCallback(async () => {
|
|
5951
5999
|
setIsLoading(true);
|
|
5952
6000
|
try {
|
|
5953
6001
|
const updatedUser = await updateUser(userData.uid, userData);
|
|
@@ -5974,7 +6022,7 @@ const EditUserForm = ({ data }) => {
|
|
|
5974
6022
|
setUserData(data);
|
|
5975
6023
|
}
|
|
5976
6024
|
}, [userData, toggleNotification, data, setUserData]);
|
|
5977
|
-
|
|
6025
|
+
m.useEffect(() => {
|
|
5978
6026
|
const fetchConfig = async () => {
|
|
5979
6027
|
try {
|
|
5980
6028
|
const config = await getFirebaseConfig();
|
|
@@ -5988,10 +6036,10 @@ const EditUserForm = ({ data }) => {
|
|
|
5988
6036
|
};
|
|
5989
6037
|
fetchConfig();
|
|
5990
6038
|
}, []);
|
|
5991
|
-
const handleCloseResetDialog =
|
|
6039
|
+
const handleCloseResetDialog = m.useCallback(() => {
|
|
5992
6040
|
setShowResetPasswordDialog({ isOpen: false, email: "", id: "" });
|
|
5993
6041
|
}, []);
|
|
5994
|
-
const handleResetPassword =
|
|
6042
|
+
const handleResetPassword = m.useCallback(
|
|
5995
6043
|
async (newPassword) => {
|
|
5996
6044
|
try {
|
|
5997
6045
|
await resetUserPassword(userData.uid, { password: newPassword });
|
|
@@ -6010,7 +6058,7 @@ const EditUserForm = ({ data }) => {
|
|
|
6010
6058
|
},
|
|
6011
6059
|
[userData.uid, toggleNotification, handleCloseResetDialog]
|
|
6012
6060
|
);
|
|
6013
|
-
const handleSendResetEmail =
|
|
6061
|
+
const handleSendResetEmail = m.useCallback(async () => {
|
|
6014
6062
|
try {
|
|
6015
6063
|
await sendResetEmail(userData.uid);
|
|
6016
6064
|
toggleNotification({
|
|
@@ -6025,6 +6073,12 @@ const EditUserForm = ({ data }) => {
|
|
|
6025
6073
|
});
|
|
6026
6074
|
}
|
|
6027
6075
|
}, [userData.uid, toggleNotification]);
|
|
6076
|
+
const handleCloseVerificationDialog = m.useCallback(() => {
|
|
6077
|
+
setShowVerificationDialog({ isOpen: false, email: "", id: "" });
|
|
6078
|
+
}, []);
|
|
6079
|
+
const handleSendVerificationEmail = m.useCallback(async () => {
|
|
6080
|
+
await sendVerificationEmail(userData.uid);
|
|
6081
|
+
}, [userData.uid]);
|
|
6028
6082
|
if (isLoading) {
|
|
6029
6083
|
return /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Loading, {});
|
|
6030
6084
|
}
|
|
@@ -6045,7 +6099,7 @@ const EditUserForm = ({ data }) => {
|
|
|
6045
6099
|
{
|
|
6046
6100
|
sidebar: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6047
6101
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6048
|
-
|
|
6102
|
+
api.R,
|
|
6049
6103
|
{
|
|
6050
6104
|
as: "aside",
|
|
6051
6105
|
background: "neutral0",
|
|
@@ -6057,15 +6111,15 @@ const EditUserForm = ({ data }) => {
|
|
|
6057
6111
|
paddingTop: 2,
|
|
6058
6112
|
shadow: "tableShadow",
|
|
6059
6113
|
children: [
|
|
6060
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6061
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6062
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6063
|
-
/* @__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 })
|
|
6064
6118
|
] }),
|
|
6065
|
-
locationState?.strapiId && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6066
|
-
/* @__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:" }),
|
|
6067
6121
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6068
|
-
|
|
6122
|
+
api.E,
|
|
6069
6123
|
{
|
|
6070
6124
|
variant: "sigma",
|
|
6071
6125
|
textColor: "primary600",
|
|
@@ -6085,37 +6139,37 @@ const EditUserForm = ({ data }) => {
|
|
|
6085
6139
|
)
|
|
6086
6140
|
] })
|
|
6087
6141
|
] }),
|
|
6088
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6089
|
-
userData.providerData?.map((provider, index2) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6090
|
-
index2 > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6091
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6092
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6093
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6094
|
-
/* @__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 })
|
|
6095
6149
|
] }),
|
|
6096
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6097
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6098
|
-
/* @__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 })
|
|
6099
6153
|
] })
|
|
6100
6154
|
] })
|
|
6101
6155
|
] }, index2)),
|
|
6102
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6103
|
-
/* @__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: [
|
|
6104
6158
|
userData.metadata?.lastSignInTime && /* @__PURE__ */ jsxRuntime.jsxs(MetaWrapper, { children: [
|
|
6105
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6106
|
-
/* @__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") })
|
|
6107
6161
|
] }),
|
|
6108
6162
|
(userData.metadata?.creationTime || userData.createdAt) && /* @__PURE__ */ jsxRuntime.jsxs(MetaWrapper, { children: [
|
|
6109
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6110
|
-
/* @__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") : "-" })
|
|
6111
6165
|
] })
|
|
6112
6166
|
] })
|
|
6113
6167
|
]
|
|
6114
6168
|
}
|
|
6115
6169
|
),
|
|
6116
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6170
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.R, { marginTop: 5, marginBottom: 5 }),
|
|
6117
6171
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6118
|
-
|
|
6172
|
+
api.R,
|
|
6119
6173
|
{
|
|
6120
6174
|
as: "aside",
|
|
6121
6175
|
background: "neutral0",
|
|
@@ -6127,27 +6181,44 @@ const EditUserForm = ({ data }) => {
|
|
|
6127
6181
|
paddingTop: 4,
|
|
6128
6182
|
shadow: "tableShadow",
|
|
6129
6183
|
children: [
|
|
6130
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6131
|
-
/* @__PURE__ */ jsxRuntime.
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
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: [
|
|
6186
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6187
|
+
PasswordResetButton,
|
|
6188
|
+
{
|
|
6189
|
+
user: userData,
|
|
6190
|
+
fullWidth: true,
|
|
6191
|
+
onClick: () => {
|
|
6192
|
+
setShowResetPasswordDialog({
|
|
6193
|
+
isOpen: true,
|
|
6194
|
+
email: userData.email || "",
|
|
6195
|
+
id: userData.uid || ""
|
|
6196
|
+
});
|
|
6197
|
+
}
|
|
6142
6198
|
}
|
|
6143
|
-
|
|
6144
|
-
|
|
6199
|
+
),
|
|
6200
|
+
userData.email && !userData.emailVerified && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6201
|
+
api.Nn,
|
|
6202
|
+
{
|
|
6203
|
+
variant: "secondary",
|
|
6204
|
+
fullWidth: true,
|
|
6205
|
+
onClick: () => {
|
|
6206
|
+
setShowVerificationDialog({
|
|
6207
|
+
isOpen: true,
|
|
6208
|
+
email: userData.email || "",
|
|
6209
|
+
id: userData.uid || ""
|
|
6210
|
+
});
|
|
6211
|
+
},
|
|
6212
|
+
children: "Resend Verification Email"
|
|
6213
|
+
}
|
|
6214
|
+
)
|
|
6215
|
+
] })
|
|
6145
6216
|
]
|
|
6146
6217
|
}
|
|
6147
6218
|
),
|
|
6148
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6219
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.R, { marginTop: 5, marginBottom: 5 }),
|
|
6149
6220
|
userData.localUser && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6150
|
-
|
|
6221
|
+
api.R,
|
|
6151
6222
|
{
|
|
6152
6223
|
as: "aside",
|
|
6153
6224
|
background: "neutral0",
|
|
@@ -6158,11 +6229,11 @@ const EditUserForm = ({ data }) => {
|
|
|
6158
6229
|
paddingRight: 2,
|
|
6159
6230
|
paddingTop: 1,
|
|
6160
6231
|
shadow: "tableShadow",
|
|
6161
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6232
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(api.R, { paddingTop: 2, paddingBottom: 2, children: [
|
|
6162
6233
|
/* @__PURE__ */ jsxRuntime.jsx(DetailsButtonWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6163
|
-
|
|
6234
|
+
api.zc,
|
|
6164
6235
|
{
|
|
6165
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6236
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(index._3, {}),
|
|
6166
6237
|
onClick: () => navigate(
|
|
6167
6238
|
`/content-manager/collection-types/plugin::users-permissions.user/${userData.localUser?.id}`
|
|
6168
6239
|
),
|
|
@@ -6171,8 +6242,8 @@ const EditUserForm = ({ data }) => {
|
|
|
6171
6242
|
}
|
|
6172
6243
|
) }),
|
|
6173
6244
|
/* @__PURE__ */ jsxRuntime.jsxs(ContentWrapper, { children: [
|
|
6174
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6175
|
-
/* @__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 })
|
|
6176
6247
|
] })
|
|
6177
6248
|
] })
|
|
6178
6249
|
}
|
|
@@ -6206,15 +6277,25 @@ const EditUserForm = ({ data }) => {
|
|
|
6206
6277
|
passwordMessage: passwordConfig.passwordRequirementsMessage,
|
|
6207
6278
|
onSendResetEmail: handleSendResetEmail
|
|
6208
6279
|
}
|
|
6280
|
+
),
|
|
6281
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6282
|
+
ResendVerification,
|
|
6283
|
+
{
|
|
6284
|
+
isOpen: showVerificationDialog.isOpen,
|
|
6285
|
+
onClose: handleCloseVerificationDialog,
|
|
6286
|
+
email: showVerificationDialog.email,
|
|
6287
|
+
userId: showVerificationDialog.id,
|
|
6288
|
+
onSendVerificationEmail: handleSendVerificationEmail
|
|
6289
|
+
}
|
|
6209
6290
|
)
|
|
6210
6291
|
] });
|
|
6211
6292
|
};
|
|
6212
6293
|
const EditView = () => {
|
|
6213
6294
|
const { id } = reactRouterDom.useParams();
|
|
6214
6295
|
const { toggleNotification } = admin.useNotification();
|
|
6215
|
-
const [userData, setUserData] =
|
|
6216
|
-
const [isLoading, setIsLoading] =
|
|
6217
|
-
|
|
6296
|
+
const [userData, setUserData] = m.useState(null);
|
|
6297
|
+
const [isLoading, setIsLoading] = m.useState(true);
|
|
6298
|
+
m.useEffect(() => {
|
|
6218
6299
|
const loadUser = async () => {
|
|
6219
6300
|
try {
|
|
6220
6301
|
if (!id) {
|
|
@@ -6250,7 +6331,7 @@ const CreateView = () => {
|
|
|
6250
6331
|
return /* @__PURE__ */ jsxRuntime.jsx(CreateUserForm, {});
|
|
6251
6332
|
};
|
|
6252
6333
|
const App = () => {
|
|
6253
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6334
|
+
return /* @__PURE__ */ jsxRuntime.jsx(rt.Provider, { delayDuration: 300, skipDelayDuration: 100, children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [
|
|
6254
6335
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: /* @__PURE__ */ jsxRuntime.jsx(HomePage, {}) }),
|
|
6255
6336
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "users/create", element: /* @__PURE__ */ jsxRuntime.jsx(CreateView, {}) }),
|
|
6256
6337
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: ":id", element: /* @__PURE__ */ jsxRuntime.jsx(EditView, {}) }),
|