strapi-plugin-magic-sessionmanager 4.19.1 → 4.21.0
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/CHANGELOG.md +38 -0
- package/README.md +189 -35
- package/dist/admin/{Analytics-BElmzyNJ.js → Analytics-BqdZIBV4.js} +1 -1
- package/dist/admin/{Analytics-BqFlgLnN.mjs → Analytics-C-OLLzoB.mjs} +1 -1
- package/dist/admin/{App-0thsC_P9.mjs → App-BswHmNQT.mjs} +338 -4
- package/dist/admin/{App-D_J2eeEG.js → App-Cx9v6n_7.js} +337 -3
- package/dist/admin/{OnlineUsersWidget-DMZBwqdY.js → OnlineUsersWidget-BRmQPPp9.js} +1 -1
- package/dist/admin/{OnlineUsersWidget-BgJ1ws-5.mjs → OnlineUsersWidget-Dusgjc1d.mjs} +1 -1
- package/dist/admin/{Settings-FOkui_ke.js → Settings-DWGuf_Z3.js} +288 -65
- package/dist/admin/{Settings-QN3Mu4AQ.mjs → Settings-DZyQheUS.mjs} +258 -35
- package/dist/admin/{de-CEyi4lpp.js → de-24TPqzG6.js} +94 -1
- package/dist/admin/{de-uGKSKVYD.mjs → de-DUnrmFWk.mjs} +94 -1
- package/dist/admin/{en-CSXeJYKy.js → en-8mBSkWOF.js} +94 -1
- package/dist/admin/{en-Yu7tfwqx.mjs → en-D8J__tyF.mjs} +94 -1
- package/dist/admin/{es-iNG9Amf9.mjs → es-BgpgWdk0.mjs} +94 -1
- package/dist/admin/{es-BrKqXhAU.js → es-ChUKey-Q.js} +94 -1
- package/dist/admin/{fr-DKZNfdlH.js → fr-DE_CWmgq.js} +94 -1
- package/dist/admin/{fr-CaFICHlf.mjs → fr-k1MHYKJo.mjs} +94 -1
- package/dist/admin/{index-DEYtqPc3.js → index-Ceh3Q1Ki.js} +622 -46
- package/dist/admin/{index-h-ksmM8A.mjs → index-meLDPPwt.mjs} +638 -62
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/{pt-IEagyVDL.js → pt-BjqU5ioB.js} +94 -1
- package/dist/admin/{pt-Bz2hWVrq.mjs → pt-DPO4DmDc.mjs} +94 -1
- package/dist/admin/{settingsTabs-D02CuEvs.mjs → settingsTabs-C1q5iMMw.mjs} +5 -1
- package/dist/admin/{settingsTabs-N4TFn-mw.js → settingsTabs-CfquZuKH.js} +5 -1
- package/dist/server/index.js +1965 -15
- package/dist/server/index.mjs +1965 -15
- package/package.json +1 -1
|
@@ -6,9 +6,9 @@ const designSystem = require("@strapi/design-system");
|
|
|
6
6
|
const StrapiAdmin = require("@strapi/strapi/admin");
|
|
7
7
|
const icons = require("@strapi/icons");
|
|
8
8
|
const styled = require("styled-components");
|
|
9
|
-
const index = require("./index-
|
|
10
|
-
|
|
11
|
-
const settingsTabs = require("./settingsTabs-
|
|
9
|
+
const index = require("./index-Ceh3Q1Ki.js");
|
|
10
|
+
require("react-intl");
|
|
11
|
+
const settingsTabs = require("./settingsTabs-CfquZuKH.js");
|
|
12
12
|
const SectionCard = require("./SectionCard-BlWv8CRt.js");
|
|
13
13
|
const symbols = require("@strapi/icons/symbols");
|
|
14
14
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
@@ -290,18 +290,6 @@ const SecretTextInput = ({
|
|
|
290
290
|
}
|
|
291
291
|
);
|
|
292
292
|
};
|
|
293
|
-
function useSettingsTranslate() {
|
|
294
|
-
const { formatMessage, locale } = reactIntl.useIntl();
|
|
295
|
-
const t = react.useCallback(
|
|
296
|
-
(id, defaultMessage, values) => formatMessage({ id: index.getTranslation(id), defaultMessage }, values),
|
|
297
|
-
[formatMessage]
|
|
298
|
-
);
|
|
299
|
-
const tError = react.useCallback(
|
|
300
|
-
(descriptor) => descriptor ? t(descriptor.messageId, descriptor.defaultMessage, descriptor.values) : void 0,
|
|
301
|
-
[t]
|
|
302
|
-
);
|
|
303
|
-
return { t, tError, locale };
|
|
304
|
-
}
|
|
305
293
|
const EnvPreview = styled__default.default(designSystem.Box)`
|
|
306
294
|
overflow-wrap: anywhere;
|
|
307
295
|
|
|
@@ -316,7 +304,7 @@ const useEncryptionKeyDraft = () => {
|
|
|
316
304
|
return { encryptionKey, setEncryptionKey, showEncryptionKey, setShowEncryptionKey };
|
|
317
305
|
};
|
|
318
306
|
const EncryptionKeyCard = ({ draft, copyValue, notify }) => {
|
|
319
|
-
const { t } = useSettingsTranslate();
|
|
307
|
+
const { t } = index.useSettingsTranslate();
|
|
320
308
|
const { encryptionKey, setEncryptionKey, showEncryptionKey, setShowEncryptionKey } = draft;
|
|
321
309
|
const handleGenerate = () => {
|
|
322
310
|
try {
|
|
@@ -429,7 +417,7 @@ const SettingsTabLink = ({ tab, children }) => {
|
|
|
429
417
|
);
|
|
430
418
|
};
|
|
431
419
|
function useOptionLabels() {
|
|
432
|
-
const { t } = useSettingsTranslate();
|
|
420
|
+
const { t } = index.useSettingsTranslate();
|
|
433
421
|
return react.useMemo(() => {
|
|
434
422
|
const minutes = (count) => t("settings.config.unit.minutes", "{count} min", { count });
|
|
435
423
|
const seconds = (count) => t("settings.config.unit.seconds", "{count} s", { count });
|
|
@@ -447,18 +435,18 @@ function useOptionLabels() {
|
|
|
447
435
|
const IntroText = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(index.ReadableText, { variant: "omega", textColor: "neutral600", tag: "p", children });
|
|
448
436
|
const RequiresNotice = ({ tab, children }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", tag: "p", "data-requires": "", children: tab ? /* @__PURE__ */ jsxRuntime.jsx(SettingsTabLink, { tab, children }) : children });
|
|
449
437
|
const ProtectedNotice = () => {
|
|
450
|
-
const { t } = useSettingsTranslate();
|
|
438
|
+
const { t } = index.useSettingsTranslate();
|
|
451
439
|
return /* @__PURE__ */ jsxRuntime.jsx(RequiresNotice, { children: t(
|
|
452
440
|
"settings.config.protected.notice",
|
|
453
441
|
"Read-only for your role: changing this needs the “Change protected settings” permission."
|
|
454
442
|
) });
|
|
455
443
|
};
|
|
456
444
|
const RequiresGeolocation = () => {
|
|
457
|
-
const { t } = useSettingsTranslate();
|
|
445
|
+
const { t } = index.useSettingsTranslate();
|
|
458
446
|
return /* @__PURE__ */ jsxRuntime.jsx(RequiresNotice, { tab: "location-data", children: t("settings.config.requires.geolocation", "Requires IP location lookup") });
|
|
459
447
|
};
|
|
460
448
|
const RiskSourceNotice = ({ savedOn = false, tab = "location-data" }) => {
|
|
461
|
-
const { t } = useSettingsTranslate();
|
|
449
|
+
const { t } = index.useSettingsTranslate();
|
|
462
450
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", gap: 1, "data-risk-source-notice": "", children: [
|
|
463
451
|
/* @__PURE__ */ jsxRuntime.jsx(RequiresNotice, { tab: tab || void 0, children: t("settings.config.requires.riskData", "Needs a risk data source") }),
|
|
464
452
|
savedOn ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", tag: "p", children: t(
|
|
@@ -474,7 +462,7 @@ const AdvancedTrigger = styled__default.default(designSystem.Accordion.Trigger)`
|
|
|
474
462
|
}
|
|
475
463
|
`;
|
|
476
464
|
const AdvancedSection = ({ label, hasError = false, disabled = false, children }) => {
|
|
477
|
-
const { t } = useSettingsTranslate();
|
|
465
|
+
const { t } = index.useSettingsTranslate();
|
|
478
466
|
const itemValue = react.useId();
|
|
479
467
|
const [open, setOpen] = react.useState("");
|
|
480
468
|
const [hadError, setHadError] = react.useState(false);
|
|
@@ -694,8 +682,8 @@ function sortLocks(locks) {
|
|
|
694
682
|
return Number.isFinite(until) && until !== 0 ? until : String(a.id).localeCompare(b.id);
|
|
695
683
|
});
|
|
696
684
|
}
|
|
697
|
-
const TABLE_MIN_WIDTH$
|
|
698
|
-
const keepActionKeys$
|
|
685
|
+
const TABLE_MIN_WIDTH$2 = 640;
|
|
686
|
+
const keepActionKeys$2 = (event) => {
|
|
699
687
|
if (settingsTabs.shouldIsolateActionKey(event.key, true)) event.stopPropagation();
|
|
700
688
|
};
|
|
701
689
|
const EMPTY_DRAFT = Object.freeze({
|
|
@@ -705,14 +693,14 @@ const EMPTY_DRAFT = Object.freeze({
|
|
|
705
693
|
maxFailedLoginsPerAccount: void 0
|
|
706
694
|
});
|
|
707
695
|
const RuleValue = ({ value, format }) => {
|
|
708
|
-
const { t } = useSettingsTranslate();
|
|
696
|
+
const { t } = index.useSettingsTranslate();
|
|
709
697
|
if (value === null || value === void 0) {
|
|
710
698
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", children: t("settings.roleRules.general", "General setting") });
|
|
711
699
|
}
|
|
712
700
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral800", children: format(value) });
|
|
713
701
|
};
|
|
714
702
|
const RoleRulesSection = ({ form }) => {
|
|
715
|
-
const { t, tError } = useSettingsTranslate();
|
|
703
|
+
const { t, tError } = index.useSettingsTranslate();
|
|
716
704
|
const { get } = StrapiAdmin.useFetchClient();
|
|
717
705
|
const { settings, handleChange } = form;
|
|
718
706
|
const locked = form.canChangeProtected === false;
|
|
@@ -782,10 +770,10 @@ const RoleRulesSection = ({ form }) => {
|
|
|
782
770
|
};
|
|
783
771
|
const fieldError = (key) => showErrors ? tError(draftErrors[key]) : void 0;
|
|
784
772
|
const availableRoles = (roles || []).filter((role) => !taken.includes(role.documentId));
|
|
785
|
-
const asTable = width === 0 || width >= TABLE_MIN_WIDTH$
|
|
773
|
+
const asTable = width === 0 || width >= TABLE_MIN_WIDTH$2;
|
|
786
774
|
const actions = (rule) => {
|
|
787
775
|
const name = roleName(rule.role);
|
|
788
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(settingsTabs.RowActions, { onKeyDown: keepActionKeys$
|
|
776
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(settingsTabs.RowActions, { onKeyDown: keepActionKeys$2, children: [
|
|
789
777
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
790
778
|
designSystem.IconButton,
|
|
791
779
|
{
|
|
@@ -1023,7 +1011,7 @@ const formatReasonCodes = (locale) => {
|
|
|
1023
1011
|
}
|
|
1024
1012
|
};
|
|
1025
1013
|
const SessionsTab = ({ form }) => {
|
|
1026
|
-
const { t, tError, locale } = useSettingsTranslate();
|
|
1014
|
+
const { t, tError, locale } = index.useSettingsTranslate();
|
|
1027
1015
|
const units = useOptionLabels();
|
|
1028
1016
|
const encryptionKeyDraft = useEncryptionKeyDraft();
|
|
1029
1017
|
const { settings, handleChange, relaxedWarningDismissed, setRelaxedWarningDismissed, errors } = form;
|
|
@@ -2114,7 +2102,9 @@ const SETTINGS_DEFAULTS = Object.freeze({
|
|
|
2114
2102
|
securityLogGeoLookup: false,
|
|
2115
2103
|
securityLogRetentionDays: 90,
|
|
2116
2104
|
...POLICY_FORM_DEFAULTS,
|
|
2117
|
-
...SIGNALS_FORM_DEFAULTS
|
|
2105
|
+
...SIGNALS_FORM_DEFAULTS,
|
|
2106
|
+
// Impersonation of app users (4.20), off by default.
|
|
2107
|
+
impersonationEnabled: false
|
|
2118
2108
|
});
|
|
2119
2109
|
const WRITE_ONLY_SETTINGS_KEYS = Object.freeze([
|
|
2120
2110
|
"discordWebhookUrl",
|
|
@@ -2239,12 +2229,12 @@ function getAdjustedFields(submitted, stored, previous) {
|
|
|
2239
2229
|
(key) => !WRITE_ONLY_SETTINGS_KEYS.includes(key) && !areSettingsEqual(source[key], stored?.[key]) && (previous === void 0 || !areSettingsEqual(source[key], previous?.[key]))
|
|
2240
2230
|
);
|
|
2241
2231
|
}
|
|
2242
|
-
const TABLE_MIN_WIDTH = 640;
|
|
2243
|
-
const keepActionKeys = (event) => {
|
|
2232
|
+
const TABLE_MIN_WIDTH$1 = 640;
|
|
2233
|
+
const keepActionKeys$1 = (event) => {
|
|
2244
2234
|
if (settingsTabs.shouldIsolateActionKey(event.key, true)) event.stopPropagation();
|
|
2245
2235
|
};
|
|
2246
2236
|
const LockTarget = ({ lock }) => {
|
|
2247
|
-
const { t } = useSettingsTranslate();
|
|
2237
|
+
const { t } = index.useSettingsTranslate();
|
|
2248
2238
|
if (lock.kind === "ip") {
|
|
2249
2239
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2250
2240
|
designSystem.Typography,
|
|
@@ -2285,7 +2275,7 @@ const LockTarget = ({ lock }) => {
|
|
|
2285
2275
|
] });
|
|
2286
2276
|
};
|
|
2287
2277
|
const KindBadge = ({ kind }) => {
|
|
2288
|
-
const { t } = useSettingsTranslate();
|
|
2278
|
+
const { t } = index.useSettingsTranslate();
|
|
2289
2279
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "neutral150", textColor: "neutral800", children: kind === "ip" ? t("settings.lockouts.kind.ip", "IP address") : t("settings.lockouts.kind.account", "Account") });
|
|
2290
2280
|
};
|
|
2291
2281
|
const lockName = (lock, t) => {
|
|
@@ -2295,7 +2285,7 @@ const lockName = (lock, t) => {
|
|
|
2295
2285
|
return t("settings.lockouts.unknownAccount", "Account that does not exist");
|
|
2296
2286
|
};
|
|
2297
2287
|
const LockedNowCard = () => {
|
|
2298
|
-
const { t } = useSettingsTranslate();
|
|
2288
|
+
const { t } = index.useSettingsTranslate();
|
|
2299
2289
|
const { get, post } = StrapiAdmin.useFetchClient();
|
|
2300
2290
|
const { toggleNotification } = StrapiAdmin.useNotification();
|
|
2301
2291
|
const { formatDate } = index.useSessionFormatters();
|
|
@@ -2360,7 +2350,7 @@ const LockedNowCard = () => {
|
|
|
2360
2350
|
}
|
|
2361
2351
|
};
|
|
2362
2352
|
const showActions = !permissionsLoading && canUnlock;
|
|
2363
|
-
const asTable = width === 0 || width >= TABLE_MIN_WIDTH;
|
|
2353
|
+
const asTable = width === 0 || width >= TABLE_MIN_WIDTH$1;
|
|
2364
2354
|
const unlockAction = (lock) => showActions ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2365
2355
|
index.ConfirmAction,
|
|
2366
2356
|
{
|
|
@@ -2427,7 +2417,7 @@ const LockedNowCard = () => {
|
|
|
2427
2417
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(KindBadge, { kind: lock.kind }) }),
|
|
2428
2418
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral800", children: lock.failures }) }),
|
|
2429
2419
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: ends(lock) }),
|
|
2430
|
-
showActions ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(settingsTabs.RowActions, { onKeyDown: keepActionKeys, children: unlockAction(lock) }) }) : null
|
|
2420
|
+
showActions ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(settingsTabs.RowActions, { onKeyDown: keepActionKeys$1, children: unlockAction(lock) }) }) : null
|
|
2431
2421
|
] }, lock.id)) })
|
|
2432
2422
|
] }) });
|
|
2433
2423
|
} else {
|
|
@@ -2450,7 +2440,7 @@ const LockedNowCard = () => {
|
|
|
2450
2440
|
}) })
|
|
2451
2441
|
] })
|
|
2452
2442
|
] }),
|
|
2453
|
-
/* @__PURE__ */ jsxRuntime.jsx(settingsTabs.RowActions, { onKeyDown: keepActionKeys, children: unlockAction(lock) })
|
|
2443
|
+
/* @__PURE__ */ jsxRuntime.jsx(settingsTabs.RowActions, { onKeyDown: keepActionKeys$1, children: unlockAction(lock) })
|
|
2454
2444
|
] })
|
|
2455
2445
|
},
|
|
2456
2446
|
lock.id
|
|
@@ -2509,7 +2499,7 @@ const LockedNowCard = () => {
|
|
|
2509
2499
|
);
|
|
2510
2500
|
};
|
|
2511
2501
|
const TrustedAddressesField = ({ form, disabled = false }) => {
|
|
2512
|
-
const { t, tError } = useSettingsTranslate();
|
|
2502
|
+
const { t, tError } = index.useSettingsTranslate();
|
|
2513
2503
|
const { settings, handleChange, errors, draftVersion } = form;
|
|
2514
2504
|
const [text, setText] = react.useState(
|
|
2515
2505
|
() => formatTrustedAddressText(settings.lockoutTrustedAddresses)
|
|
@@ -2546,7 +2536,7 @@ const TrustedAddressesField = ({ form, disabled = false }) => {
|
|
|
2546
2536
|
);
|
|
2547
2537
|
};
|
|
2548
2538
|
const ImpossibleTravelCard = ({ form }) => {
|
|
2549
|
-
const { t, tError } = useSettingsTranslate();
|
|
2539
|
+
const { t, tError } = index.useSettingsTranslate();
|
|
2550
2540
|
const { settings, handleChange, errors } = form;
|
|
2551
2541
|
const lookupOff = !settings.enableGeolocation;
|
|
2552
2542
|
const enabled = settings.impossibleTravelEnabled === true;
|
|
@@ -2827,7 +2817,7 @@ const ChipList = styled__default.default(designSystem.Flex)`
|
|
|
2827
2817
|
}
|
|
2828
2818
|
`;
|
|
2829
2819
|
const CountryListEditor = ({ settings, handleChange }) => {
|
|
2830
|
-
const { t, tError, locale } = useSettingsTranslate();
|
|
2820
|
+
const { t, tError, locale } = index.useSettingsTranslate();
|
|
2831
2821
|
const modeLabelId = react.useId();
|
|
2832
2822
|
const listLabelId = react.useId();
|
|
2833
2823
|
const [mode, setMode] = react.useState(() => inferGeofencingMode(settings));
|
|
@@ -3110,7 +3100,7 @@ const describeLockout = (t, { ip, account, window: window2, duration }) => {
|
|
|
3110
3100
|
return parts.join(" ");
|
|
3111
3101
|
};
|
|
3112
3102
|
const LoginProtectionTab = ({ form }) => {
|
|
3113
|
-
const { t, tError } = useSettingsTranslate();
|
|
3103
|
+
const { t, tError } = index.useSettingsTranslate();
|
|
3114
3104
|
const { settings, handleChange, errors } = form;
|
|
3115
3105
|
const maxFailedError = tError(errors.maxFailedLogins);
|
|
3116
3106
|
const maxFailedValue = Number(settings.maxFailedLogins);
|
|
@@ -3503,7 +3493,7 @@ const PathValue = ({ path }) => {
|
|
|
3503
3493
|
] }, index2)) });
|
|
3504
3494
|
};
|
|
3505
3495
|
const GeoIpDatabaseCard = ({ form }) => {
|
|
3506
|
-
const { t, tError, locale } = useSettingsTranslate();
|
|
3496
|
+
const { t, tError, locale } = index.useSettingsTranslate();
|
|
3507
3497
|
const { settings, handleChange, errors, hasChanges, geoIp } = form;
|
|
3508
3498
|
const geoIpStatus = geoIp.status;
|
|
3509
3499
|
const accountIdRef = react.useRef(null);
|
|
@@ -3778,7 +3768,7 @@ const BADGE_COLOURS = Object.freeze({
|
|
|
3778
3768
|
missing: { backgroundColor: "neutral150", textColor: "neutral700" }
|
|
3779
3769
|
});
|
|
3780
3770
|
const RiskDatabase = ({ id, title, shortName, description, entry, form, lookupOff }) => {
|
|
3781
|
-
const { t, locale } = useSettingsTranslate();
|
|
3771
|
+
const { t, locale } = index.useSettingsTranslate();
|
|
3782
3772
|
const buttonRef = react.useRef(null);
|
|
3783
3773
|
const { geoIp } = form;
|
|
3784
3774
|
const state = databaseState(entry);
|
|
@@ -3837,7 +3827,7 @@ const RiskDatabase = ({ id, title, shortName, description, entry, form, lookupOf
|
|
|
3837
3827
|
);
|
|
3838
3828
|
};
|
|
3839
3829
|
const RiskDataCard = ({ form }) => {
|
|
3840
|
-
const { t } = useSettingsTranslate();
|
|
3830
|
+
const { t } = index.useSettingsTranslate();
|
|
3841
3831
|
const { settings, geoIp } = form;
|
|
3842
3832
|
const lookupOff = !settings.enableGeolocation;
|
|
3843
3833
|
const risk = settingsTabs.getRiskAvailability(geoIp.status);
|
|
@@ -3905,7 +3895,7 @@ const RiskDataCard = ({ form }) => {
|
|
|
3905
3895
|
);
|
|
3906
3896
|
};
|
|
3907
3897
|
const LocationDataTab = ({ form }) => {
|
|
3908
|
-
const { t } = useSettingsTranslate();
|
|
3898
|
+
const { t } = index.useSettingsTranslate();
|
|
3909
3899
|
const { settings, handleChange } = form;
|
|
3910
3900
|
const risk = settingsTabs.getRiskAvailability(form.geoIp.status);
|
|
3911
3901
|
const scoring = settingsTabs.riskDependentControl(settings.enableSecurityScoring, risk.state);
|
|
@@ -4046,7 +4036,7 @@ const TEMPLATE_TAB_LABELS = {
|
|
|
4046
4036
|
};
|
|
4047
4037
|
const BlockLabel = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "bold", tag: "div", textColor: "neutral800", children });
|
|
4048
4038
|
const TemplateEditor = ({ templateKey, template, templates, handleChange, copyValue, errors }) => {
|
|
4049
|
-
const { t, tError } = useSettingsTranslate();
|
|
4039
|
+
const { t, tError } = index.useSettingsTranslate();
|
|
4050
4040
|
const { toggleNotification } = StrapiAdmin.useNotification();
|
|
4051
4041
|
const defaults = getDefaultTemplates()[templateKey];
|
|
4052
4042
|
const setField = (field, value) => {
|
|
@@ -4246,7 +4236,7 @@ const TemplateEditor = ({ templateKey, template, templates, handleChange, copyVa
|
|
|
4246
4236
|
] });
|
|
4247
4237
|
};
|
|
4248
4238
|
const EmailTemplatesCard = ({ form }) => {
|
|
4249
|
-
const { t } = useSettingsTranslate();
|
|
4239
|
+
const { t } = index.useSettingsTranslate();
|
|
4250
4240
|
const { settings, handleChange, copyValue, errors } = form;
|
|
4251
4241
|
const [activeTemplateTab, setActiveTemplateTab] = react.useState("suspiciousLogin");
|
|
4252
4242
|
const templates = settings.emailTemplates;
|
|
@@ -4324,7 +4314,7 @@ const WebhookUrlField = ({
|
|
|
4324
4314
|
error,
|
|
4325
4315
|
disabled = false
|
|
4326
4316
|
}) => {
|
|
4327
|
-
const { t } = useSettingsTranslate();
|
|
4317
|
+
const { t } = index.useSettingsTranslate();
|
|
4328
4318
|
const { settings, handleChange } = form;
|
|
4329
4319
|
const stored = settings[hasKey] === true;
|
|
4330
4320
|
const draft = settings[field];
|
|
@@ -4402,7 +4392,7 @@ const WriteOnlyField = ({
|
|
|
4402
4392
|
disabled = false,
|
|
4403
4393
|
extra
|
|
4404
4394
|
}) => {
|
|
4405
|
-
const { t, tError } = useSettingsTranslate();
|
|
4395
|
+
const { t, tError } = index.useSettingsTranslate();
|
|
4406
4396
|
const { settings, handleChange, errors } = form;
|
|
4407
4397
|
const draft = settings[field];
|
|
4408
4398
|
const [editing, setEditing] = react.useState(false);
|
|
@@ -4484,7 +4474,7 @@ const WriteOnlyField = ({
|
|
|
4484
4474
|
);
|
|
4485
4475
|
};
|
|
4486
4476
|
const SignedWebhookCard = ({ form }) => {
|
|
4487
|
-
const { t } = useSettingsTranslate();
|
|
4477
|
+
const { t } = index.useSettingsTranslate();
|
|
4488
4478
|
const { post } = StrapiAdmin.useFetchClient();
|
|
4489
4479
|
const { settings, handleChange } = form;
|
|
4490
4480
|
const [testing, setTesting] = react.useState(false);
|
|
@@ -4647,7 +4637,7 @@ const EventGrid = styled__default.default.div`
|
|
|
4647
4637
|
}
|
|
4648
4638
|
`;
|
|
4649
4639
|
const WebhookEventsCard = ({ form }) => {
|
|
4650
|
-
const { t } = useSettingsTranslate();
|
|
4640
|
+
const { t } = index.useSettingsTranslate();
|
|
4651
4641
|
const { settings, handleChange } = form;
|
|
4652
4642
|
const locked = form.canChangeProtected === false;
|
|
4653
4643
|
const selected = Array.isArray(settings.webhookEvents) ? settings.webhookEvents : [];
|
|
@@ -4716,7 +4706,7 @@ const AlertTypeCell = ({ checked, disabled, children }) => /* @__PURE__ */ jsxRu
|
|
|
4716
4706
|
}
|
|
4717
4707
|
);
|
|
4718
4708
|
const AlertsTab = ({ form }) => {
|
|
4719
|
-
const { t, tError } = useSettingsTranslate();
|
|
4709
|
+
const { t, tError } = index.useSettingsTranslate();
|
|
4720
4710
|
const { settings, handleChange, errors } = form;
|
|
4721
4711
|
const hintIds = {
|
|
4722
4712
|
suspicious: react.useId(),
|
|
@@ -4944,7 +4934,7 @@ const DangerButton = styled__default.default(designSystem.Button)`
|
|
|
4944
4934
|
white-space: nowrap;
|
|
4945
4935
|
`;
|
|
4946
4936
|
const DataRetentionTab = ({ form }) => {
|
|
4947
|
-
const { t } = useSettingsTranslate();
|
|
4937
|
+
const { t } = index.useSettingsTranslate();
|
|
4948
4938
|
const units = useOptionLabels();
|
|
4949
4939
|
const { settings, handleChange, handleCleanInactive } = form;
|
|
4950
4940
|
const {
|
|
@@ -5084,7 +5074,7 @@ const DataRetentionTab = ({ form }) => {
|
|
|
5084
5074
|
] });
|
|
5085
5075
|
};
|
|
5086
5076
|
const AdminActivityTab = ({ form }) => {
|
|
5087
|
-
const { t } = useSettingsTranslate();
|
|
5077
|
+
const { t } = index.useSettingsTranslate();
|
|
5088
5078
|
const units = useOptionLabels();
|
|
5089
5079
|
const { settings, handleChange } = form;
|
|
5090
5080
|
const locked = form.canChangeProtected === false;
|
|
@@ -5212,15 +5202,247 @@ const AdminActivityTab = ({ form }) => {
|
|
|
5212
5202
|
)
|
|
5213
5203
|
] });
|
|
5214
5204
|
};
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5205
|
+
const TABLE_MIN_WIDTH = 720;
|
|
5206
|
+
const keepActionKeys = (event) => {
|
|
5207
|
+
if (settingsTabs.shouldIsolateActionKey(event.key, true)) event.stopPropagation();
|
|
5208
|
+
};
|
|
5209
|
+
const ActiveImpersonationsCard = () => {
|
|
5210
|
+
const { t } = index.useSettingsTranslate();
|
|
5211
|
+
const { get, post } = StrapiAdmin.useFetchClient();
|
|
5212
|
+
const { toggleNotification } = StrapiAdmin.useNotification();
|
|
5213
|
+
const { formatDate } = index.useSessionFormatters();
|
|
5214
|
+
const [widthRef, width] = settingsTabs.useElementWidth();
|
|
5215
|
+
const [rows, setRows] = react.useState(null);
|
|
5216
|
+
const [error, setError] = react.useState(false);
|
|
5217
|
+
const [refreshing, setRefreshing] = react.useState(false);
|
|
5218
|
+
const refreshRef = react.useRef(null);
|
|
5219
|
+
const requestRef = react.useRef(0);
|
|
5220
|
+
const apply = react.useCallback(async (request, pending) => {
|
|
5221
|
+
try {
|
|
5222
|
+
const { data } = await pending;
|
|
5223
|
+
if (request !== requestRef.current) return;
|
|
5224
|
+
if (!Array.isArray(data?.data)) throw new Error("Invalid impersonation list");
|
|
5225
|
+
setRows(data.data);
|
|
5226
|
+
setError(false);
|
|
5227
|
+
} catch (err) {
|
|
5228
|
+
if (index.isCancelledRequest(err) || request !== requestRef.current) return;
|
|
5229
|
+
index.logSafeAdminError("impersonation.list", err);
|
|
5230
|
+
setError(true);
|
|
5231
|
+
} finally {
|
|
5232
|
+
if (request === requestRef.current) setRefreshing(false);
|
|
5233
|
+
}
|
|
5234
|
+
}, []);
|
|
5235
|
+
const load = react.useCallback(() => {
|
|
5236
|
+
const request = ++requestRef.current;
|
|
5237
|
+
setRefreshing(true);
|
|
5238
|
+
return apply(request, get(`/${index.pluginId}/impersonation/active`));
|
|
5239
|
+
}, [apply, get]);
|
|
5240
|
+
react.useEffect(() => {
|
|
5241
|
+
apply(++requestRef.current, get(`/${index.pluginId}/impersonation/active`));
|
|
5242
|
+
}, [apply, get]);
|
|
5243
|
+
const end = async (row) => {
|
|
5244
|
+
try {
|
|
5245
|
+
await post(`/${index.pluginId}/impersonation/${row.id}/end`, {});
|
|
5246
|
+
toggleNotification({
|
|
5247
|
+
type: "success",
|
|
5248
|
+
message: t("impersonation.ended", "Impersonation ended.")
|
|
5249
|
+
});
|
|
5250
|
+
} catch (err) {
|
|
5251
|
+
index.logSafeAdminError("impersonation.end", err);
|
|
5252
|
+
toggleNotification({
|
|
5253
|
+
type: "danger",
|
|
5254
|
+
message: t("impersonation.error.end", "The impersonation could not be ended.")
|
|
5255
|
+
});
|
|
5256
|
+
throw err;
|
|
5257
|
+
} finally {
|
|
5258
|
+
await load();
|
|
5259
|
+
}
|
|
5260
|
+
};
|
|
5261
|
+
const endAction = (row) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5262
|
+
index.ConfirmAction,
|
|
5263
|
+
{
|
|
5264
|
+
fallbackFocusRef: refreshRef,
|
|
5265
|
+
title: t("impersonation.confirm.title", "End the impersonation of {user}?", {
|
|
5266
|
+
user: label(row)
|
|
5267
|
+
}),
|
|
5268
|
+
body: t(
|
|
5269
|
+
"impersonation.confirm.body",
|
|
5270
|
+
"The short-lived sign-in stops working at once. This is recorded in the security log."
|
|
5271
|
+
),
|
|
5272
|
+
confirmLabel: t("impersonation.end", "End impersonation"),
|
|
5273
|
+
onConfirm: () => end(row),
|
|
5274
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5275
|
+
designSystem.IconButton,
|
|
5276
|
+
{
|
|
5277
|
+
variant: "ghost",
|
|
5278
|
+
label: t("impersonation.endLabel", "End impersonation of {user}", {
|
|
5279
|
+
user: label(row)
|
|
5280
|
+
}),
|
|
5281
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.SignOut, {})
|
|
5282
|
+
}
|
|
5283
|
+
)
|
|
5284
|
+
},
|
|
5285
|
+
row.id
|
|
5286
|
+
);
|
|
5287
|
+
const label = (row) => row.targetLabel || (row.targetType === "admin" ? t("impersonation.list.adminFallback", "Admin #{id}", { id: row.targetId }) : row.targetId);
|
|
5288
|
+
const kind = (row) => row.targetType === "admin" ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "primary100", textColor: "neutral800", children: t("impersonation.list.kind.admin", "Admin, view only") }) : null;
|
|
5289
|
+
const time = (iso) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "time", dateTime: iso, variant: "omega", textColor: "neutral800", children: formatDate(iso, { hour: "2-digit", minute: "2-digit" }) });
|
|
5290
|
+
const startedBy = (row) => row.startedByYou ? t("impersonation.list.you", "You") : row.actorLabel || "—";
|
|
5291
|
+
let content;
|
|
5292
|
+
if (rows === null && !error) {
|
|
5293
|
+
content = /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", padding: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: t("impersonation.list.loading", "Loading impersonations…") }) });
|
|
5294
|
+
} else if (error && rows === null) {
|
|
5295
|
+
content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
5296
|
+
index.PersistentAlert,
|
|
5297
|
+
{
|
|
5298
|
+
variant: "danger",
|
|
5299
|
+
closeLabel: t("common.close", "Close"),
|
|
5300
|
+
title: t("impersonation.list.error", "Impersonations could not be loaded."),
|
|
5301
|
+
action: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: load, children: t("common.tryAgain", "Try again") }),
|
|
5302
|
+
children: t(
|
|
5303
|
+
"impersonation.list.errorBody",
|
|
5304
|
+
"Running impersonations still end on time; only this list is missing."
|
|
5305
|
+
)
|
|
5306
|
+
}
|
|
5307
|
+
);
|
|
5308
|
+
} else if (rows.length === 0) {
|
|
5309
|
+
content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
5310
|
+
designSystem.EmptyStateLayout,
|
|
5311
|
+
{
|
|
5312
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyPermissions, { width: "16rem", height: "8rem" }),
|
|
5313
|
+
content: t(
|
|
5314
|
+
"impersonation.list.empty",
|
|
5315
|
+
"No impersonation is running. Start one from a user’s entry in the Content Manager."
|
|
5316
|
+
)
|
|
5317
|
+
}
|
|
5318
|
+
);
|
|
5319
|
+
} else if (width === 0 || width >= TABLE_MIN_WIDTH) {
|
|
5320
|
+
content = /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { hasRadius: true, borderColor: "neutral150", "data-impersonations-table": "", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Table, { colCount: 5, rowCount: rows.length + 1, "aria-busy": refreshing, children: [
|
|
5321
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Thead, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
5322
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", children: t("impersonation.list.col.user", "User") }) }),
|
|
5323
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", children: t("impersonation.list.col.startedBy", "Started by") }) }),
|
|
5324
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", children: t("impersonation.list.col.reason", "Reason") }) }),
|
|
5325
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", children: t("impersonation.list.col.ends", "Ends") }) }),
|
|
5326
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { children: t("impersonation.list.col.actions", "Actions") }) })
|
|
5327
|
+
] }) }),
|
|
5328
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tbody, { children: rows.map((row) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { "data-impersonation-row": "", children: [
|
|
5329
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, wrap: "wrap", alignItems: "center", children: [
|
|
5330
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral800", fontWeight: "semiBold", children: label(row) }),
|
|
5331
|
+
kind(row)
|
|
5332
|
+
] }) }),
|
|
5333
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral800", children: startedBy(row) }) }),
|
|
5334
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { style: { maxWidth: 0, width: "40%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5335
|
+
designSystem.Typography,
|
|
5336
|
+
{
|
|
5337
|
+
variant: "omega",
|
|
5338
|
+
textColor: "neutral800",
|
|
5339
|
+
tag: "p",
|
|
5340
|
+
style: { overflowWrap: "anywhere" },
|
|
5341
|
+
children: row.reason
|
|
5342
|
+
}
|
|
5343
|
+
) }),
|
|
5344
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: time(row.expiresAt) }),
|
|
5345
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(settingsTabs.RowActions, { onKeyDown: keepActionKeys, children: endAction(row) }) })
|
|
5346
|
+
] }, row.id)) })
|
|
5347
|
+
] }) });
|
|
5348
|
+
} else {
|
|
5349
|
+
content = /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, tag: "ul", "data-impersonations-list": "", children: rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { tag: "li", padding: 4, hasRadius: true, borderColor: "neutral150", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "flex-start", gap: 3, children: [
|
|
5350
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", gap: 1, minWidth: 0, children: [
|
|
5351
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, wrap: "wrap", alignItems: "center", children: [
|
|
5352
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral800", fontWeight: "semiBold", children: label(row) }),
|
|
5353
|
+
kind(row)
|
|
5354
|
+
] }),
|
|
5355
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5356
|
+
designSystem.Typography,
|
|
5357
|
+
{
|
|
5358
|
+
variant: "pi",
|
|
5359
|
+
textColor: "neutral800",
|
|
5360
|
+
tag: "p",
|
|
5361
|
+
style: { overflowWrap: "anywhere" },
|
|
5362
|
+
children: row.reason
|
|
5363
|
+
}
|
|
5364
|
+
),
|
|
5365
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: t("impersonation.list.summary", "{admin}, until {time}", {
|
|
5366
|
+
admin: startedBy(row),
|
|
5367
|
+
time: formatDate(row.expiresAt, { hour: "2-digit", minute: "2-digit" })
|
|
5368
|
+
}) })
|
|
5369
|
+
] }),
|
|
5370
|
+
/* @__PURE__ */ jsxRuntime.jsx(settingsTabs.RowActions, { onKeyDown: keepActionKeys, children: endAction(row) })
|
|
5371
|
+
] }) }, row.id)) });
|
|
5221
5372
|
}
|
|
5222
|
-
|
|
5223
|
-
|
|
5373
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5374
|
+
SectionCard.SectionCard,
|
|
5375
|
+
{
|
|
5376
|
+
id: "active-impersonations",
|
|
5377
|
+
title: t("impersonation.list.title", "Active impersonations"),
|
|
5378
|
+
subtitle: t(
|
|
5379
|
+
"impersonation.list.intro",
|
|
5380
|
+
"Each one ends by itself at the time shown. End stops it at once."
|
|
5381
|
+
),
|
|
5382
|
+
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5383
|
+
designSystem.Button,
|
|
5384
|
+
{
|
|
5385
|
+
ref: refreshRef,
|
|
5386
|
+
variant: "tertiary",
|
|
5387
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowClockwise, {}),
|
|
5388
|
+
onClick: load,
|
|
5389
|
+
loading: refreshing && rows !== null,
|
|
5390
|
+
children: t("impersonation.list.refresh", "Refresh")
|
|
5391
|
+
}
|
|
5392
|
+
),
|
|
5393
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: widthRef, "aria-live": "polite", children: [
|
|
5394
|
+
error && rows !== null ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5395
|
+
index.PersistentAlert,
|
|
5396
|
+
{
|
|
5397
|
+
variant: "warning",
|
|
5398
|
+
closeLabel: t("common.close", "Close"),
|
|
5399
|
+
title: t("impersonation.list.refreshErrorTitle", "Not refreshed"),
|
|
5400
|
+
children: t(
|
|
5401
|
+
"impersonation.list.refreshError",
|
|
5402
|
+
"The list could not be refreshed. It shows the last known impersonations."
|
|
5403
|
+
)
|
|
5404
|
+
}
|
|
5405
|
+
) }) : null,
|
|
5406
|
+
content
|
|
5407
|
+
] })
|
|
5408
|
+
}
|
|
5409
|
+
);
|
|
5410
|
+
};
|
|
5411
|
+
const ImpersonationTab = ({ form }) => {
|
|
5412
|
+
const { t } = index.useSettingsTranslate();
|
|
5413
|
+
const { settings, handleChange } = form;
|
|
5414
|
+
const locked = form.canChangeProtected === false;
|
|
5415
|
+
const {
|
|
5416
|
+
isLoading,
|
|
5417
|
+
allowedActions: { canUsers, canAdmins }
|
|
5418
|
+
} = StrapiAdmin.useRBAC([...index.pluginPermissions.impersonateUsers, ...index.pluginPermissions.impersonateAdmins]);
|
|
5419
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
|
|
5420
|
+
/* @__PURE__ */ jsxRuntime.jsx(IntroText, { children: t(
|
|
5421
|
+
"settings.impersonation.intro",
|
|
5422
|
+
"Support staff can act as an app user for up to an hour to reproduce a problem, with a reason that is recorded. Who may do this is set per role under Settings > Roles > Session Manager."
|
|
5423
|
+
) }),
|
|
5424
|
+
locked ? /* @__PURE__ */ jsxRuntime.jsx(ProtectedNotice, {}) : null,
|
|
5425
|
+
/* @__PURE__ */ jsxRuntime.jsx(SectionCard.SectionCard, { title: t("settings.impersonation.title", "Impersonation of app users"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5426
|
+
SettingsToggleRow,
|
|
5427
|
+
{
|
|
5428
|
+
id: "impersonation-enabled",
|
|
5429
|
+
title: t("settings.impersonation.enable.label", "Allow impersonation"),
|
|
5430
|
+
description: t(
|
|
5431
|
+
"settings.impersonation.enable.hint",
|
|
5432
|
+
"Off by default. Turning it off ends every running impersonation at once."
|
|
5433
|
+
),
|
|
5434
|
+
checked: settings.impersonationEnabled === true,
|
|
5435
|
+
disabled: locked,
|
|
5436
|
+
onChange: (checked) => handleChange("impersonationEnabled", checked),
|
|
5437
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(index.ReadableText, { variant: "pi", textColor: "neutral700", tag: "p", "data-privacy-note": "", children: t(
|
|
5438
|
+
"settings.impersonation.notice",
|
|
5439
|
+
"Acting as a person processes their personal data. Tell your users in the privacy notice, and in Germany check whether the works council must agree, because the log shows what each admin did."
|
|
5440
|
+
) })
|
|
5441
|
+
}
|
|
5442
|
+
) }),
|
|
5443
|
+
!isLoading && (canUsers || canAdmins) ? /* @__PURE__ */ jsxRuntime.jsx(ActiveImpersonationsCard, {}) : null
|
|
5444
|
+
] });
|
|
5445
|
+
};
|
|
5224
5446
|
const INITIAL_SETTINGS = { ...SETTINGS_DEFAULTS, emailTemplates: fillMissingTemplates({}) };
|
|
5225
5447
|
const BUILD_DATE_OPTIONS = Object.freeze({ dateStyle: "medium" });
|
|
5226
5448
|
const getServerMessage = (error) => {
|
|
@@ -5237,7 +5459,7 @@ const formatList = (names, locale) => {
|
|
|
5237
5459
|
}
|
|
5238
5460
|
};
|
|
5239
5461
|
function useSettingsForm() {
|
|
5240
|
-
const { t, locale } = useSettingsTranslate();
|
|
5462
|
+
const { t, locale } = index.useSettingsTranslate();
|
|
5241
5463
|
const { get, post, put } = StrapiAdmin.useFetchClient();
|
|
5242
5464
|
const { toggleNotification } = StrapiAdmin.useNotification();
|
|
5243
5465
|
const [loading, setLoading] = react.useState(true);
|
|
@@ -5269,7 +5491,7 @@ function useSettingsForm() {
|
|
|
5269
5491
|
const copyValue = react.useCallback(
|
|
5270
5492
|
async (value, successMessage, scope) => {
|
|
5271
5493
|
try {
|
|
5272
|
-
await copyText(value);
|
|
5494
|
+
await index.copyText(value);
|
|
5273
5495
|
toggleNotification({ type: "success", message: successMessage });
|
|
5274
5496
|
} catch (error) {
|
|
5275
5497
|
index.logSafeAdminError(scope, error);
|
|
@@ -5592,6 +5814,7 @@ const TAB_COMPONENTS = {
|
|
|
5592
5814
|
"location-data": LocationDataTab,
|
|
5593
5815
|
alerts: AlertsTab,
|
|
5594
5816
|
"data-retention": DataRetentionTab,
|
|
5817
|
+
impersonation: ImpersonationTab,
|
|
5595
5818
|
"admin-activity": AdminActivityTab
|
|
5596
5819
|
};
|
|
5597
5820
|
const DraftSync = ({ values }) => {
|
|
@@ -5609,7 +5832,7 @@ const writeTabToAddressBar = (tab) => {
|
|
|
5609
5832
|
window.history.replaceState(window.history.state, "", `${pathname}${nextSearch}${hash}`);
|
|
5610
5833
|
};
|
|
5611
5834
|
const SettingsPage = () => {
|
|
5612
|
-
const { t } = useSettingsTranslate();
|
|
5835
|
+
const { t } = index.useSettingsTranslate();
|
|
5613
5836
|
const form = useSettingsForm();
|
|
5614
5837
|
const [{ query }] = StrapiAdmin.useQueryParams();
|
|
5615
5838
|
const {
|