@7365admin1/layer-common 4.97.1-staging.514 → 4.97.1-staging.515

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.
@@ -374,7 +374,7 @@
374
374
  v-model="selectedRole"
375
375
  :items="pickerRoles"
376
376
  item-value="_id"
377
- :item-title="roleLabel"
377
+ :item-title="props.siteId ? sitePickerRoleLabel : roleLabel"
378
378
  density="comfortable"
379
379
  :rules="[requiredRule]"
380
380
  :error-messages="
@@ -428,6 +428,7 @@ import {
428
428
  limitedSites,
429
429
  withCurrentRole,
430
430
  roleLabel,
431
+ sitePickerRoleLabel,
431
432
  } from "../utils/role";
432
433
  import { formatLastActive } from "../utils/last-active";
433
434
  import { formatMemberDate, memberAccess, memberPerson } from "../utils/member-row";
@@ -166,7 +166,7 @@
166
166
  <v-select
167
167
  v-model="memberReassignments[member._id]"
168
168
  :items="deletionPreview.replacementRoles"
169
- :item-title="roleLabel"
169
+ :item-title="props.siteId ? sitePickerRoleLabel : roleLabel"
170
170
  item-value="_id"
171
171
  label="Reassign role"
172
172
  density="comfortable"
@@ -206,7 +206,7 @@
206
206
 
207
207
  <script setup lang="ts">
208
208
  // Relative import: this layer's `utils/` is not auto-imported into consumers.
209
- import { roleLabel, safeReturnTo, showSiteField } from "../utils/role";
209
+ import { roleLabel, safeReturnTo, showSiteField, sitePickerRoleLabel } from "../utils/role";
210
210
  import { holdsPermission } from "../utils/permission-spellings";
211
211
  import {
212
212
  catalogueForOrg,
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.514",
5
+ "version": "4.97.1-staging.515",
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.",
@@ -16,7 +16,8 @@ export function inviteRoleOptions(
16
16
  .filter((role) => role && role._id)
17
17
  .map((role) => ({
18
18
  _id: String(role._id),
19
- title: String(role.name ?? ""),
19
+ // Organisation-wide roles read "Administrator (organisation)" (owner, 2026-10-06).
20
+ title: role.site ? String(role.name ?? "") : `${String(role.name ?? "")} (organisation)`,
20
21
  subtitle: role.site ? SITE_ROLE_LABEL : ORG_ROLE_LABEL,
21
22
  }));
22
23
  }
package/utils/role.ts CHANGED
@@ -22,6 +22,19 @@ export function roleLabel(role: { name?: unknown; siteName?: unknown; site?: unk
22
22
  return role?.site && site ? `${name} · ${site}` : name;
23
23
  }
24
24
 
25
+ /**
26
+ * A site-level role picker's label (owner, 2026-10-06): organisation-wide roles
27
+ * stay offered at a site but read "Administrator (organisation)", so nobody
28
+ * mistakes them for a role of this site. Site roles keep `roleLabel`. Display
29
+ * only - the picker still sends the same `_id`. A row the server did not send
30
+ * (`withCurrentRole`'s placeholder has no `type`) is left plain: we do not know
31
+ * whether it is organisation-wide.
32
+ */
33
+ export function sitePickerRoleLabel(role: { name?: unknown; siteName?: unknown; site?: unknown; type?: unknown } | null | undefined): string {
34
+ if (!role || role.site || role.type === undefined) return roleLabel(role);
35
+ return `${roleLabel(role)} (organisation)`;
36
+ }
37
+
25
38
  /**
26
39
  * The Assign Role picker's list, with the member's CURRENT role always in it.
27
40
  *