@7365admin1/layer-common 4.73.1-staging.455 → 4.73.1-staging.456
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/components/MemberMain.vue +6 -3
- package/package.json +1 -1
- package/utils/role.ts +6 -1
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
their access; the company assigns each one a role for this site.
|
|
32
32
|
Shown while any remain (server count), gone at 0. -->
|
|
33
33
|
<v-alert
|
|
34
|
-
v-if="props.assignRole && otherSiteBanner
|
|
34
|
+
v-if="props.assignRole && otherSiteBanner"
|
|
35
35
|
type="warning"
|
|
36
36
|
variant="tonal"
|
|
37
37
|
density="compact"
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
<div class="d-flex align-center flex-wrap ga-2">
|
|
42
42
|
<span class="flex-grow-1">{{ otherSiteBanner }}</span>
|
|
43
43
|
<AppButton
|
|
44
|
+
v-if="!orgLevel"
|
|
44
45
|
data-test="member-other-site-filter"
|
|
45
46
|
@click="toggleOtherSite()"
|
|
46
47
|
>
|
|
@@ -578,7 +579,7 @@ const {
|
|
|
578
579
|
const { data: otherSiteReq, refresh: refreshOtherSite } = useAsyncData(
|
|
579
580
|
`members-other-site-${props.type}-${props.orgId}-${props.siteId}-${props.status}`,
|
|
580
581
|
() =>
|
|
581
|
-
props.assignRole && props.orgId
|
|
582
|
+
props.assignRole && props.orgId
|
|
582
583
|
? _getAll({
|
|
583
584
|
status: props.status,
|
|
584
585
|
org: props.orgId,
|
|
@@ -591,8 +592,10 @@ const { data: otherSiteReq, refresh: refreshOtherSite } = useAsyncData(
|
|
|
591
592
|
: Promise.resolve(null),
|
|
592
593
|
{ watch: [() => props.status, () => props.orgId, () => props.siteId] }
|
|
593
594
|
);
|
|
595
|
+
// At organisation level there is no "this site": the count says what is wrong
|
|
596
|
+
// and points to "Fix roles from other sites" (no per-site filter there).
|
|
594
597
|
const otherSiteBanner = computed(() =>
|
|
595
|
-
otherSiteBannerText(otherSiteReq.value?.total)
|
|
598
|
+
otherSiteBannerText(otherSiteReq.value?.total, orgLevel.value)
|
|
596
599
|
);
|
|
597
600
|
watch(otherSiteBanner, (text) => {
|
|
598
601
|
// the last one fixed: back to the full list
|
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.73.1-staging.
|
|
5
|
+
"version": "4.73.1-staging.456",
|
|
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
|
@@ -82,9 +82,14 @@ export function memberRoleChip(
|
|
|
82
82
|
* re-assign a role for the right site, nobody's access is cut). `null` at 0 so
|
|
83
83
|
* the banner disappears once every member here has this site's role.
|
|
84
84
|
*/
|
|
85
|
-
export function otherSiteBannerText(count: unknown): string | null {
|
|
85
|
+
export function otherSiteBannerText(count: unknown, orgLevel = false): string | null {
|
|
86
86
|
const n = typeof count === "number" && Number.isFinite(count) ? Math.floor(count) : 0;
|
|
87
87
|
if (n <= 0) return null;
|
|
88
|
+
if (orgLevel) {
|
|
89
|
+
return n === 1
|
|
90
|
+
? "1 member holds a role created for one particular site. Fix roles from other sites gives them the right role."
|
|
91
|
+
: `${n} members hold a role created for one particular site. Fix roles from other sites gives each one the right role.`;
|
|
92
|
+
}
|
|
88
93
|
return n === 1
|
|
89
94
|
? "1 member here has a role from another site. Assign them a role for this site."
|
|
90
95
|
: `${n} members here have a role from another site. Assign each one a role for this site.`;
|