@7365admin1/layer-common 4.48.0 → 4.49.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 +10 -4
- package/components/MemberMain.vue +12 -0
- package/package.json +1 -1
- package/utils/role.ts +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @iservice365/layer-common
|
|
2
2
|
|
|
3
|
+
## 4.49.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7dc771c: Members list: a member holding a role that belongs to another site shows a warning chip ("<role> — belongs to <site>. Assign a role for this site.", server roleState "other-site"), and the Assign Role action in the row menu is highlighted whenever the role chip is a warning.
|
|
8
|
+
|
|
3
9
|
## 4.48.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -1527,11 +1533,11 @@
|
|
|
1527
1533
|
`utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
|
|
1528
1534
|
own rule from two endpoints the console already calls, unprojected:
|
|
1529
1535
|
|
|
1530
|
-
|
|
1531
|
-
|
|
1536
|
+
GET /api/members/user/:user/app/admin the Seven365 staff membership
|
|
1537
|
+
GET /api/roles/id/:role that membership's role document
|
|
1532
1538
|
|
|
1533
|
-
|
|
1534
|
-
|
|
1539
|
+
owner = member.type === "admin" && role.type === "admin" && role.default === true
|
|
1540
|
+
staff = member.type === "admin" && role.type === "admin"
|
|
1535
1541
|
|
|
1536
1542
|
`role.default` is the marker because it is the only property of a platform
|
|
1537
1543
|
staff role no API caller can set - `role.controller.ts` validates create and
|
|
@@ -121,8 +121,20 @@
|
|
|
121
121
|
/>
|
|
122
122
|
</template>
|
|
123
123
|
<v-list>
|
|
124
|
+
<!-- Highlighted when the row's role chip is a warning (no /
|
|
125
|
+
deleted / other org / other site role): this is the fix. -->
|
|
124
126
|
<v-list-item
|
|
125
127
|
v-if="props.assignRole"
|
|
128
|
+
:class="{
|
|
129
|
+
'text-warning font-weight-bold':
|
|
130
|
+
memberRoleChip(item)?.tone === 'warn',
|
|
131
|
+
}"
|
|
132
|
+
:prepend-icon="
|
|
133
|
+
memberRoleChip(item)?.tone === 'warn'
|
|
134
|
+
? 'mdi-alert-circle-outline'
|
|
135
|
+
: undefined
|
|
136
|
+
"
|
|
137
|
+
data-test="member-assign-role"
|
|
126
138
|
@click="
|
|
127
139
|
setMember({
|
|
128
140
|
dialog: true,
|
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.
|
|
5
|
+
"version": "4.49.0",
|
|
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.",
|
package/utils/role.ts
CHANGED
|
@@ -39,6 +39,7 @@ export function withCurrentRole<T extends { _id?: unknown; name?: unknown }>(
|
|
|
39
39
|
export function memberRoleChip(item: {
|
|
40
40
|
roleName?: unknown;
|
|
41
41
|
roleState?: unknown;
|
|
42
|
+
roleSiteName?: unknown;
|
|
42
43
|
}): { text: string; tone: "info" | "warn" } | null {
|
|
43
44
|
const name = typeof item?.roleName === "string" ? item.roleName : "";
|
|
44
45
|
switch (item?.roleState) {
|
|
@@ -48,6 +49,13 @@ export function memberRoleChip(item: {
|
|
|
48
49
|
return { text: `${name || "Role"} (deleted) - assign a new role`, tone: "warn" };
|
|
49
50
|
case "other-org":
|
|
50
51
|
return { text: "Invalid role - assign a new role", tone: "warn" };
|
|
52
|
+
// The organisation's own role, but pinned to a different site than this
|
|
53
|
+
// membership's (owner report 2026-09-25: a Newton 200 member showed
|
|
54
|
+
// "Security", a role of The Loft).
|
|
55
|
+
case "other-site": {
|
|
56
|
+
const site = typeof item?.roleSiteName === "string" && item.roleSiteName ? item.roleSiteName : "another site";
|
|
57
|
+
return { text: `${name || "Role"} — belongs to ${site}. Assign a role for this site.`, tone: "warn" };
|
|
58
|
+
}
|
|
51
59
|
default:
|
|
52
60
|
return name ? { text: name, tone: "info" } : null;
|
|
53
61
|
}
|