@7365admin1/layer-common 4.75.0 → 4.75.1

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.75.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b84da6e: Organization Members: keep the "Fix roles from other sites" banner at organisation level, worded for the organisation ("N members hold a role created for one particular site…"), without the per-site "Show them" filter. 4.75.0 had hidden the whole banner there.
8
+
3
9
  ## 4.75.0
4
10
 
5
11
  ### Minor Changes
@@ -1902,11 +1908,11 @@
1902
1908
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
1903
1909
  own rule from two endpoints the console already calls, unprojected:
1904
1910
 
1905
- GET /api/members/user/:user/app/admin the Seven365 staff membership
1906
- GET /api/roles/id/:role that membership's role document
1911
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
1912
+ GET /api/roles/id/:role that membership's role document
1907
1913
 
1908
- owner = member.type === "admin" && role.type === "admin" && role.default === true
1909
- staff = member.type === "admin" && role.type === "admin"
1914
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
1915
+ staff = member.type === "admin" && role.type === "admin"
1910
1916
 
1911
1917
  `role.default` is the marker because it is the only property of a platform
1912
1918
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -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 && !orgLevel"
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 && !orgLevel.value
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.75.0",
5
+ "version": "4.75.1",
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.`;