strapi-plugin-magic-sessionmanager 4.16.0 → 4.17.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.
Files changed (31) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +84 -36
  3. package/dist/admin/{Analytics-D4gsVwL0.mjs → Analytics-B-p2Q7th.mjs} +1 -1
  4. package/dist/admin/{Analytics-me4qzS0I.js → Analytics-BTIByTUY.js} +1 -1
  5. package/dist/admin/{App-BTG-2Q26.js → App-CH6635JB.js} +112 -184
  6. package/dist/admin/{App-BJwtFWxl.mjs → App-DmesuM2g.mjs} +82 -154
  7. package/dist/admin/{OnlineUsersWidget-Yd283YDy.mjs → OnlineUsersWidget-CuqeQ0tb.mjs} +1 -1
  8. package/dist/admin/{OnlineUsersWidget-DYS3Vy1Q.js → OnlineUsersWidget-TlOp8nie.js} +1 -1
  9. package/dist/admin/{Settings-DIlvfdjZ.mjs → Settings-C4IgGBjQ.mjs} +1347 -109
  10. package/dist/admin/{Settings-TPZ9_75s.js → Settings-DtP_H4JS.js} +1351 -113
  11. package/dist/admin/dashboardModel-0ROcWcB1.mjs +189 -0
  12. package/dist/admin/dashboardModel-BSJhZdXI.js +188 -0
  13. package/dist/admin/{de-DB9ldYwN.mjs → de-BoahnYIP.mjs} +126 -11
  14. package/dist/admin/{de-BuMw1gBJ.js → de-C_ooq6EF.js} +126 -11
  15. package/dist/admin/{en-BqGhOJDy.js → en-CuUVE2K0.js} +126 -11
  16. package/dist/admin/{en-BbLMPQB3.mjs → en-DHme92L-.mjs} +126 -11
  17. package/dist/admin/{es-C5iaiE9G.mjs → es-CjcTgS9Z.mjs} +126 -11
  18. package/dist/admin/{es-BaIeckl9.js → es-lbDNXcQi.js} +126 -11
  19. package/dist/admin/{fr-BEvBUCwI.mjs → fr-BPwnrSaC.mjs} +126 -11
  20. package/dist/admin/{fr-D1YKyTex.js → fr-RtypjgGp.js} +126 -11
  21. package/dist/admin/{index-DUESEUaO.mjs → index-B102RF2H.mjs} +45 -38
  22. package/dist/admin/{index-CgZiLcJ1.js → index-w0OuPYFm.js} +17 -10
  23. package/dist/admin/index.js +1 -1
  24. package/dist/admin/index.mjs +1 -1
  25. package/dist/admin/{pt-DtnW-s0V.js → pt-BMCAKRQ4.js} +126 -11
  26. package/dist/admin/{pt-DeDih9cR.mjs → pt-D5FHSP2y.mjs} +126 -11
  27. package/dist/server/index.js +3577 -1293
  28. package/dist/server/index.mjs +3577 -1293
  29. package/package.json +1 -1
  30. package/dist/admin/riskData-BVs9GpgD.js +0 -26
  31. package/dist/admin/riskData-CI1gm2yI.mjs +0 -27
@@ -1,14 +1,14 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useFetchClient, useNotification, useClipboard, useRBAC, useQueryParams, Pagination, Page } from "@strapi/strapi/admin";
3
3
  import { NavLink, Link as Link$1, Routes, Route } from "react-router-dom";
4
- import { useMemo, useState, useEffect, useRef, useCallback, useId, useLayoutEffect } from "react";
4
+ import { useMemo, useState, useEffect, useRef, useId, useCallback, useLayoutEffect } from "react";
5
5
  import { useIntl } from "react-intl";
6
6
  import { Typography, Flex, Loader, Button, Modal, Accordion, Box, IconButton, Link, SimpleMenu, MenuItem, Grid, Table, Thead, Tr, Th, VisuallyHidden, Tbody, Td, Tooltip, SearchForm, Searchbar, TextButton, SingleSelect, SingleSelectOption, EmptyStateLayout, LinkButton, Badge, Tabs, Dialog } from "@strapi/design-system";
7
7
  import { Earth, Duplicate, Cross, Eye, Trash, More, CaretDown, Download, ArrowClockwise, Check, Clock, User, ChartBubble, Cog, SignOut } from "@strapi/icons";
8
8
  import { EmptyDocuments } from "@strapi/icons/symbols";
9
9
  import styled, { useTheme } from "styled-components";
10
- import { g as getSessionEndReason, a as getEndReasonPresentation, b as getTranslation, p as presentText, i as isSessionFilter, D as DEFAULT_SESSION_FILTER, c as isEndReasonFilter, d as DEFAULT_END_REASON_FILTER, e as getDevicePresentation, u as useSessionFormatters, f as getSessionStatus, h as isNativeOnlySession, j as getSessionEndReasonPresentation, k as DeviceIcon, S as StatusBadge, P as PropertyList, C as ConfirmAction, t as toValidDate, l as pluginId, m as logSafeAdminError, n as PersistentAlert, R as ReadableText, o as pluginPermissions, M as MissingValue, V as ValueOrMissing, q as SESSION_STATES, r as SESSION_STATUS_PRESENTATION, s as isCancelledRequest, v as SESSION_FILTER_OPTIONS, E as END_REASON_FILTER_OPTIONS, w as PageShell, x as StatGrid, y as StatCard, z as restoreDialogFocus, A as requireSessionList, B as getBadgeColors, T as TargetLink$1 } from "./index-DUESEUaO.mjs";
11
- import { i as isRiskSource, R as RISK_SETTINGS_PATH } from "./riskData-CI1gm2yI.mjs";
10
+ import { g as getSessionEndReason, a as getEndReasonPresentation, b as getTranslation, p as presentText, u as useSessionFormatters, c as getSessionStatus, d as getDevicePresentation, i as isNativeOnlySession, e as getSessionEndReasonPresentation, D as DeviceIcon, S as StatusBadge, P as PropertyList, C as ConfirmAction, t as toValidDate, f as pluginId, l as logSafeAdminError, h as PersistentAlert, R as ReadableText, j as pluginPermissions, M as MissingValue, V as ValueOrMissing, k as SESSION_STATES, m as SESSION_STATUS_PRESENTATION, n as isCancelledRequest, o as SESSION_FILTER_OPTIONS, E as END_REASON_FILTER_OPTIONS, q as PageShell, r as StatGrid, s as StatCard, v as restoreDialogFocus, w as requireSessionList, x as getBadgeColors, T as TargetLink$1 } from "./index-B102RF2H.mjs";
11
+ import { i as isRiskSource, g as getSessionUserLabels, a as getUserEditPath, R as RISK_SETTINGS_PATH, b as RowActions, s as shouldIsolateActionKey, c as shouldRedispatchEscape, D as DASHBOARD_COMPACT_TABLE_COLUMNS, d as DASHBOARD_TABLE_COLUMNS, r as readDisclosureOpen, e as getBrowserStorage, w as writeDisclosureOpen, u as useElementWidth, p as parseDashboardQuery, A as AUTO_REFRESH_INTERVAL_MS, f as pickFocusSessionId, h as encodeSearchQuery, j as shouldUseCompactTable, P as PAGE_SIZE_OPTIONS, k as DEFAULT_PAGE_SIZE, l as getExportDeviceInfo, m as getErrorStatus, n as hasActiveFilters } from "./dashboardModel-0ROcWcB1.mjs";
12
12
  import { S as SectionCard } from "./SectionCard-D51bv4Hi.mjs";
13
13
  const EndReason = ({ session, reason, variant = "omega", textColor = "neutral800" }) => {
14
14
  const { formatMessage } = useIntl();
@@ -21,7 +21,6 @@ const EndReason = ({ session, reason, variant = "omega", textColor = "neutral800
21
21
  });
22
22
  return /* @__PURE__ */ jsx(Typography, { variant, textColor, "data-end-reason": presentation.reason, children: translate(presentation) });
23
23
  };
24
- const RowActions = ({ children, ...props }) => /* @__PURE__ */ jsx(Flex, { justifyContent: "flex-end", alignItems: "center", gap: 1, "data-row-actions": "", ...props, children });
25
24
  const MAX_EXPORT_ROWS = 5e4;
26
25
  const EXPORT_BATCH_SIZE = 1e3;
27
26
  const EMPTY_SESSION_STATS = Object.freeze({
@@ -107,7 +106,7 @@ const CSV_HEADERS = Object.freeze([
107
106
  "Minutes Idle",
108
107
  "End Reason"
109
108
  ]);
110
- const FORMULA_START = /^[=+\-@\t\r]/;
109
+ const FORMULA_START = /^[\s\u00ad\u200b-\u200f\u2060-\u2064\ufeff]*[=+\-@\uff1d\uff0b\uff0d\uff20\t\r\n]/;
111
110
  const escapeCsvValue = (value) => {
112
111
  const text = String(value ?? "");
113
112
  const safe = typeof value === "string" && FORMULA_START.test(text) ? `'${text}` : text;
@@ -256,23 +255,6 @@ function useBreakpoint() {
256
255
  isBelowLarge: isBelowBreakpoint(breakpoint, "large")
257
256
  };
258
257
  }
259
- function useElementWidth() {
260
- const [width, setWidth] = useState(0);
261
- const observerRef = useRef(null);
262
- const ref = useCallback((node) => {
263
- observerRef.current?.disconnect();
264
- observerRef.current = null;
265
- if (!node || typeof ResizeObserver === "undefined") return;
266
- const observer = new ResizeObserver((entries) => {
267
- const next = Math.round(entries[0]?.contentRect?.width || 0);
268
- setWidth((previous) => previous === next ? previous : next);
269
- });
270
- observer.observe(node);
271
- observerRef.current = observer;
272
- }, []);
273
- useEffect(() => () => observerRef.current?.disconnect(), []);
274
- return [ref, width];
275
- }
276
258
  const RISK_LEVEL_MESSAGES = Object.freeze({
277
259
  none: Object.freeze({ messageId: "modal.security.risk.none", defaultMessage: "None" }),
278
260
  low: Object.freeze({ messageId: "modal.security.risk.low", defaultMessage: "Low" }),
@@ -349,125 +331,6 @@ function interpretLookupResult(payload) {
349
331
  const geo = normalizeGeoData(data);
350
332
  return geo ? { status: "ok", geo } : { status: "failed", geo: null };
351
333
  }
352
- const PAGE_SIZE_OPTIONS = Object.freeze(["10", "25", "50", "100"]);
353
- const DEFAULT_PAGE_SIZE = "25";
354
- const DASHBOARD_TABLE_COLUMNS = 7;
355
- const DASHBOARD_COMPACT_TABLE_COLUMNS = 5;
356
- const AUTO_REFRESH_INTERVAL_MS = 10 * 60 * 1e3;
357
- const HOW_IT_WORKS_STORAGE_KEY = "magic-sessionmanager.dashboard.howSessionsWork";
358
- const USER_EDIT_PATH = "/content-manager/collection-types/plugin::users-permissions.user/";
359
- const readQueryText = (value) => {
360
- if (typeof value !== "string") return "";
361
- try {
362
- return decodeURIComponent(value).trim();
363
- } catch {
364
- return value.trim();
365
- }
366
- };
367
- function parseDashboardQuery(query = {}) {
368
- const source = query || {};
369
- const page = Number.parseInt(String(source.page ?? "1"), 10);
370
- const pageSize = PAGE_SIZE_OPTIONS.includes(String(source.pageSize)) ? String(source.pageSize) : DEFAULT_PAGE_SIZE;
371
- const status = isSessionFilter(source.status) ? (
372
- /** @type {string} */
373
- source.status
374
- ) : DEFAULT_SESSION_FILTER;
375
- const reason = status === "ended" && isEndReasonFilter(source.reason) ? (
376
- /** @type {string} */
377
- source.reason
378
- ) : DEFAULT_END_REASON_FILTER;
379
- const search = readQueryText(source.search) || readQueryText(source._q);
380
- return { page: Number.isFinite(page) && page >= 1 ? page : 1, pageSize, status, reason, search };
381
- }
382
- function encodeSearchQuery(value) {
383
- const text = typeof value === "string" ? value.trim() : "";
384
- return text ? encodeURIComponent(text) : void 0;
385
- }
386
- function hasActiveFilters(state) {
387
- if (!state) return false;
388
- return state.status !== DEFAULT_SESSION_FILTER || Boolean(state.reason) && state.reason !== DEFAULT_END_REASON_FILTER || Boolean(state.search);
389
- }
390
- function getSessionUserLabels(session) {
391
- const username = presentText(session?.user?.username);
392
- const email = presentText(session?.user?.email);
393
- const primary = username || email;
394
- return {
395
- primary,
396
- secondary: username && email ? email : "",
397
- accessible: primary || presentText(session?.id)
398
- };
399
- }
400
- function getUserEditPath(session) {
401
- const documentId = presentText(session?.user?.documentId);
402
- return documentId ? `${USER_EDIT_PATH}${encodeURIComponent(documentId)}` : null;
403
- }
404
- function getExportDeviceInfo(session, unavailableValue = "") {
405
- const device = getDevicePresentation(session);
406
- return {
407
- device: device.deviceType || unavailableValue,
408
- browser: device.browser || unavailableValue,
409
- browserVersion: device.browserVersion || "",
410
- os: device.os || unavailableValue
411
- };
412
- }
413
- function readDisclosureOpen(storage) {
414
- try {
415
- return storage?.getItem(HOW_IT_WORKS_STORAGE_KEY) === "open";
416
- } catch {
417
- return false;
418
- }
419
- }
420
- function writeDisclosureOpen(storage, open) {
421
- try {
422
- storage?.setItem(HOW_IT_WORKS_STORAGE_KEY, open ? "open" : "closed");
423
- } catch {
424
- }
425
- }
426
- function getBrowserStorage() {
427
- try {
428
- return typeof window !== "undefined" ? window.localStorage : null;
429
- } catch {
430
- return null;
431
- }
432
- }
433
- function shouldIsolateActionKey(key, fromInsideGroup) {
434
- if (!fromInsideGroup) return true;
435
- return key === "Enter" || key === " " || key === "Spacebar";
436
- }
437
- const FULL_TABLE_MIN_WIDTH = 1200;
438
- function shouldUseCompactTable(listWidth, isBelowLarge) {
439
- if (isBelowLarge) return true;
440
- if (!Number.isFinite(listWidth) || listWidth <= 0) return false;
441
- return listWidth < FULL_TABLE_MIN_WIDTH;
442
- }
443
- function shouldRedispatchEscape(key, fromInsideGroup) {
444
- return !fromInsideGroup && key === "Escape";
445
- }
446
- function pickFocusSessionId(previousIds, currentIds, sessionId) {
447
- const current = Array.isArray(currentIds) ? currentIds.map(String) : [];
448
- if (current.length === 0) return null;
449
- const target = String(sessionId);
450
- if (current.includes(target)) return target;
451
- const previous = Array.isArray(previousIds) ? previousIds.map(String) : [];
452
- const index = previous.indexOf(target);
453
- if (index >= 0) {
454
- for (let next = index + 1; next < previous.length; next += 1) {
455
- if (current.includes(previous[next])) return previous[next];
456
- }
457
- for (let before = index - 1; before >= 0; before -= 1) {
458
- if (current.includes(previous[before])) return previous[before];
459
- }
460
- }
461
- return current[0];
462
- }
463
- function getErrorStatus(error) {
464
- const err = (
465
- /** @type {any} */
466
- error
467
- );
468
- const status = err?.status ?? err?.response?.status;
469
- return typeof status === "number" ? status : null;
470
- }
471
334
  const TargetLink = styled(Link)`
472
335
  min-height: 3.2rem;
473
336
  display: inline-flex;
@@ -2557,6 +2420,25 @@ function getSignOutErrorMessage(error) {
2557
2420
  defaultMessage: "The admin could not be signed out. Try again."
2558
2421
  };
2559
2422
  }
2423
+ function withIdentityPlaceholders(admin, placeholderName, identity) {
2424
+ if (!admin || typeof admin !== "object") return admin;
2425
+ const hidden = !admin.self && !admin.name;
2426
+ return {
2427
+ ...admin,
2428
+ name: admin.name || placeholderName(admin.id),
2429
+ identityHidden: hidden,
2430
+ rolesHidden: hidden && identity?.roles === false
2431
+ };
2432
+ }
2433
+ function withEventAdminNames(row, placeholderName) {
2434
+ if (!row || typeof row !== "object") return row;
2435
+ const fill = (admin) => admin && typeof admin === "object" && !admin.name ? { ...admin, name: placeholderName(admin.id), identityHidden: true } : admin;
2436
+ return {
2437
+ ...row,
2438
+ ...row.admin !== void 0 ? { admin: fill(row.admin) } : {},
2439
+ ...row.actor !== void 0 ? { actor: fill(row.actor) } : {}
2440
+ };
2441
+ }
2560
2442
  const HIGHLIGHT_BADGE = { backgroundColor: "primary100", textColor: "neutral800" };
2561
2443
  const keepActionKeys = (event) => {
2562
2444
  if (shouldIsolateActionKey(event.key, true)) event.stopPropagation();
@@ -2584,13 +2466,13 @@ const AdminIdentity = ({ admin }) => {
2584
2466
  ),
2585
2467
  admin.self ? /* @__PURE__ */ jsx(Badge, { ...HIGHLIGHT_BADGE, shrink: 0, children: t("adminPanel.you", "You") }) : null
2586
2468
  ] }),
2587
- /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", ellipsis: true, title: admin.email, children: admin.email })
2469
+ admin.identityHidden ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: t("adminPanel.identity.emailHidden", "Email hidden (needs “Read” on Users)") }) : /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", ellipsis: true, title: admin.email, children: admin.email })
2588
2470
  ] });
2589
2471
  };
2590
2472
  const AdminRoles = ({ admin }) => {
2591
2473
  const t = useT$3();
2592
2474
  const names = (admin.roles || []).map((role) => role.name).filter(Boolean);
2593
- const text = names.length ? names.join(", ") : t("adminPanel.roles.none", "No role");
2475
+ const text = admin.rolesHidden ? t("adminPanel.roles.hidden", "Hidden (needs “Read” on Roles)") : names.length ? names.join(", ") : t("adminPanel.roles.none", "No role");
2594
2476
  return /* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral800", ellipsis: true, title: text, children: text });
2595
2477
  };
2596
2478
  const AdminStatus = ({ admin }) => {
@@ -3014,6 +2896,15 @@ const SignInEventRow = ({ row, showAdmin = false, onOpenAdmin }) => {
3014
2896
  }
3015
2897
  if (row.actor)
3016
2898
  facts.push(t("adminPanel.activity.byAdmin", "by {name}", { name: row.actor.name }));
2899
+ if (Number.isInteger(row.attempts) && row.attempts > 1) {
2900
+ facts.push(
2901
+ t(
2902
+ "adminPanel.activity.attempts",
2903
+ "{count, plural, one {# attempt} other {# attempts}} within 5 minutes",
2904
+ { count: row.attempts }
2905
+ )
2906
+ );
2907
+ }
3017
2908
  return /* @__PURE__ */ jsxs(EventItem, { id: row.id, kind: event.key, children: [
3018
2909
  /* @__PURE__ */ jsxs(Flex, { gap: 2, wrap: "wrap", alignItems: "center", justifyContent: "space-between", children: [
3019
2910
  /* @__PURE__ */ jsxs(Flex, { gap: 2, wrap: "wrap", alignItems: "center", minWidth: 0, children: [
@@ -3063,6 +2954,22 @@ const ActivityEventRow = ({ row, showAdmin = false, onOpenAdmin }) => {
3063
2954
  };
3064
2955
  function useEventList({ path, params, logKey }) {
3065
2956
  const { get } = useFetchClient();
2957
+ const { formatMessage } = useIntl();
2958
+ const fillNames = useCallback(
2959
+ (list) => list.map(
2960
+ (row) => withEventAdminNames(
2961
+ row,
2962
+ (id) => formatMessage(
2963
+ {
2964
+ id: getTranslation("adminPanel.identity.placeholder"),
2965
+ defaultMessage: "Admin #{id}"
2966
+ },
2967
+ { id }
2968
+ )
2969
+ )
2970
+ ),
2971
+ [formatMessage]
2972
+ );
3066
2973
  const [rows, setRows] = useState([]);
3067
2974
  const [meta, setMeta] = useState(null);
3068
2975
  const [page, setPage] = useState(1);
@@ -3081,7 +2988,7 @@ function useEventList({ path, params, logKey }) {
3081
2988
  const response = await get(path, { params: { ...JSON.parse(key), page: nextPage } });
3082
2989
  if (requestId !== requestRef.current) return;
3083
2990
  const body = response?.data || {};
3084
- const data = Array.isArray(body.data) ? body.data : [];
2991
+ const data = fillNames(Array.isArray(body.data) ? body.data : []);
3085
2992
  setRows((current) => nextPage === 1 ? data : [...current, ...data]);
3086
2993
  setMeta(body.meta || null);
3087
2994
  setPage(nextPage);
@@ -3097,7 +3004,7 @@ function useEventList({ path, params, logKey }) {
3097
3004
  }
3098
3005
  }
3099
3006
  },
3100
- [get, path, key, logKey]
3007
+ [get, path, key, logKey, fillNames]
3101
3008
  );
3102
3009
  useEffect(() => {
3103
3010
  load(1);
@@ -3116,14 +3023,14 @@ function useEventList({ path, params, logKey }) {
3116
3023
  });
3117
3024
  const body = response?.data || {};
3118
3025
  if (!Array.isArray(body.data)) throw new Error("Invalid export response");
3119
- all.push(...body.data);
3026
+ all.push(...fillNames(body.data));
3120
3027
  cursor = typeof body.meta?.nextCursor === "string" ? body.meta.nextCursor : null;
3121
3028
  } while (cursor && all.length < MAX_EVENT_EXPORT_ROWS);
3122
3029
  return {
3123
3030
  rows: all.slice(0, MAX_EVENT_EXPORT_ROWS),
3124
3031
  capped: all.length > MAX_EVENT_EXPORT_ROWS || Boolean(cursor)
3125
3032
  };
3126
- }, [get, path, key]);
3033
+ }, [get, path, key, fillNames]);
3127
3034
  return {
3128
3035
  rows,
3129
3036
  meta,
@@ -3581,8 +3488,8 @@ const AdminSessionsModal = ({
3581
3488
  {
3582
3489
  id: "email",
3583
3490
  label: t("adminPanel.dialog.email", "Email"),
3584
- value: admin.email,
3585
- kind: "email"
3491
+ value: admin.identityHidden ? t("adminPanel.identity.emailHidden", "Email hidden (needs “Read” on Users)") : admin.email,
3492
+ kind: admin.identityHidden ? void 0 : "email"
3586
3493
  },
3587
3494
  {
3588
3495
  id: "roles",
@@ -3730,7 +3637,15 @@ const AdminPanelPage = () => {
3730
3637
  const response = await get(`/${pluginId}/admin-sessions/admins`, { params: listParams });
3731
3638
  if (requestId !== requestIdRef.current) return;
3732
3639
  const body = response?.data || {};
3733
- setAdmins(Array.isArray(body.data) ? body.data : []);
3640
+ const placeholder = (id) => formatMessage(
3641
+ { id: getTranslation("adminPanel.identity.placeholder"), defaultMessage: "Admin #{id}" },
3642
+ { id }
3643
+ );
3644
+ setAdmins(
3645
+ (Array.isArray(body.data) ? body.data : []).map(
3646
+ (row) => withIdentityPlaceholders(row, placeholder, body.meta?.identity)
3647
+ )
3648
+ );
3734
3649
  setMeta(body.meta || null);
3735
3650
  setLoadError(false);
3736
3651
  hasLoadedRef.current = true;
@@ -3744,7 +3659,7 @@ const AdminPanelPage = () => {
3744
3659
  setRefreshing(false);
3745
3660
  }
3746
3661
  }
3747
- }, [get, listParams]);
3662
+ }, [get, listParams, formatMessage]);
3748
3663
  useEffect(() => {
3749
3664
  fetchAdmins();
3750
3665
  }, [fetchAdmins]);
@@ -3758,7 +3673,20 @@ const AdminPanelPage = () => {
3758
3673
  if (requestId !== dialogRequestRef.current) return;
3759
3674
  const body = response?.data || {};
3760
3675
  setDialogSessions(Array.isArray(body.data) ? body.data : []);
3761
- if (body.meta?.admin) setSelected((current) => current ? body.meta.admin : current);
3676
+ if (body.meta?.admin) {
3677
+ const placeholder = (id) => formatMessage(
3678
+ {
3679
+ id: getTranslation("adminPanel.identity.placeholder"),
3680
+ defaultMessage: "Admin #{id}"
3681
+ },
3682
+ { id }
3683
+ );
3684
+ setSelected(
3685
+ (current) => current ? withIdentityPlaceholders(body.meta.admin, placeholder, {
3686
+ roles: current.rolesHidden ? false : void 0
3687
+ }) : current
3688
+ );
3689
+ }
3762
3690
  setDialogError(false);
3763
3691
  } catch (err) {
3764
3692
  if (requestId !== dialogRequestRef.current || isCancelledRequest(err)) return;
@@ -3768,7 +3696,7 @@ const AdminPanelPage = () => {
3768
3696
  if (requestId === dialogRequestRef.current) setDialogLoading(false);
3769
3697
  }
3770
3698
  },
3771
- [get]
3699
+ [get, formatMessage]
3772
3700
  );
3773
3701
  const openDialog = (admin, trigger, tab = "sessions") => {
3774
3702
  openerRef.current = trigger;
@@ -4053,7 +3981,7 @@ const AdminPanelPage = () => {
4053
3981
  value: view.search,
4054
3982
  onSearch: handleSearch,
4055
3983
  label: t("adminPanel.search.label", "Search admins"),
4056
- placeholder: t("adminPanel.search.placeholder", "Search name or email")
3984
+ placeholder: meta?.identity?.names === false ? t("adminPanel.search.placeholderId", "Search by admin ID") : t("adminPanel.search.placeholder", "Search name or email")
4057
3985
  }
4058
3986
  ) }),
4059
3987
  /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", shrink: 0, children: [
@@ -6,7 +6,7 @@ import { Flex, Loader, Button, Box, Typography } from "@strapi/design-system";
6
6
  import { User, Lightning, Clock, Lock, WarningCircle } from "@strapi/icons";
7
7
  import * as StrapiAdmin from "@strapi/strapi/admin";
8
8
  import { useFetchClient } from "@strapi/strapi/admin";
9
- import { m as logSafeAdminError, s as isCancelledRequest, b as getTranslation, R as ReadableText, M as MissingValue } from "./index-DUESEUaO.mjs";
9
+ import { l as logSafeAdminError, n as isCancelledRequest, b as getTranslation, R as ReadableText, M as MissingValue } from "./index-B102RF2H.mjs";
10
10
  function normalizeUserCounts(response) {
11
11
  const totalUsers = response?.data?.totalUsers;
12
12
  const blockedUsers = response?.data?.blockedUsers;
@@ -7,7 +7,7 @@ const styled = require("styled-components");
7
7
  const designSystem = require("@strapi/design-system");
8
8
  const icons = require("@strapi/icons");
9
9
  const StrapiAdmin = require("@strapi/strapi/admin");
10
- const index = require("./index-CgZiLcJ1.js");
10
+ const index = require("./index-w0OuPYFm.js");
11
11
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
12
12
  function _interopNamespace(e) {
13
13
  if (e && e.__esModule) return e;