@7365admin1/layer-common 4.97.1-staging.718 → 4.97.1-staging.719

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.
@@ -714,7 +714,7 @@ const siteAccessUser = ref("");
714
714
  const siteAccessName = ref("");
715
715
  function openSiteAccess(item: Record<string, any>) {
716
716
  siteAccessUser.value = String(item.user ?? "");
717
- siteAccessName.value = String(item.name || item.email || "");
717
+ siteAccessName.value = memberPerson(item).name;
718
718
  siteAccessDialog.value = true;
719
719
  }
720
720
  function onSiteAccessSaved(msg: string) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.97.1-staging.718",
5
+ "version": "4.97.1-staging.719",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
@@ -66,9 +66,17 @@ export function memberAccess(item: Record<string, any> | null | undefined, orgLe
66
66
  return { roles: text ? [text] : [], tone: chip?.tone ?? "info", scope, sites: [] };
67
67
  }
68
68
 
69
- /** Name on top, email underneath - the email only when it adds something. */
69
+ /**
70
+ * Name on top, email underneath - the email only when it adds something.
71
+ *
72
+ * The ACCOUNT's name (`userName`, from GET /api/members) first, then the
73
+ * membership's. A membership is often saved with the e-mail as its name (core
74
+ * `createMemberDirect`), while the account holds the name the person signed up
75
+ * with (DV-1857). Same order as the HID picker (`memberCandidateOf`).
76
+ */
70
77
  export function memberPerson(item: Record<string, any> | null | undefined): { name: string; email: string } {
71
- const name = typeof item?.name === "string" ? item.name.trim() : "";
78
+ const text = (value: unknown) => (typeof value === "string" ? value.trim() : "");
79
+ const name = text(item?.userName) || text(item?.name);
72
80
  const email = typeof item?.email === "string" ? item.email.trim() : "";
73
81
  if (!name) return { name: email, email: "" };
74
82
  return { name, email: email.toLowerCase() === name.toLowerCase() ? "" : email };