@7365admin1/layer-common 4.2.25 → 4.2.27

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,21 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.2.27
4
+
5
+ ### Patch Changes
6
+
7
+ - 21cddf9: Invite Client: stop offering Seven365 console staff roles on a client invitation.
8
+
9
+ The console's Invite Client picker lists the org-less roles, which includes the platform's own `type: "admin"` staff roles. The App field on that form only offers the seven service types, so the server (`core invite-role-scope.util roleInvitable`) refuses a staff role on every invitation the form can send — two of the twelve options could only ever be picked and then fail. They are now hidden. Display only: the request is unchanged and every role the server accepts is still offered.
10
+
11
+ ## 4.2.26
12
+
13
+ ### Patch Changes
14
+
15
+ - 0b370e9: Notification Settings: say which channels are on, and stop drawing a switch that cannot move.
16
+
17
+ Every category read "On everywhere" while the Email row beneath it was disabled with a sentence explaining that nothing emails anyone about it — the screen offered a control it could not honour, then counted the two controls it could as all three. The summary now names the channels that are on ("On: In the app, Phone alerts"), and only the channels a category can actually deliver on are drawn. Both mobile settings screens get the same treatment in their own repositories.
18
+
3
19
  ## 4.2.25
4
20
 
5
21
  ### Patch Changes
@@ -785,11 +801,11 @@
785
801
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
786
802
  own rule from two endpoints the console already calls, unprojected:
787
803
 
788
- GET /api/members/user/:user/app/admin the Seven365 staff membership
789
- GET /api/roles/id/:role that membership's role document
804
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
805
+ GET /api/roles/id/:role that membership's role document
790
806
 
791
- owner = member.type === "admin" && role.type === "admin" && role.default === true
792
- staff = member.type === "admin" && role.type === "admin"
807
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
808
+ staff = member.type === "admin" && role.type === "admin"
793
809
 
794
810
  `role.default` is the marker because it is the only property of a platform
795
811
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -258,7 +258,21 @@ const { data: roleData, refresh: refreshRoles } = await useLazyAsyncData(
258
258
  )
259
259
 
260
260
  watchEffect(() => {
261
- if (roleData.value) roles.value = roleData.value.items
261
+ /*
262
+ * The App field above offers the seven service types and never the Seven365
263
+ * staff type (`APP_LIST`), so every invitation this screen can send is a
264
+ * non-staff one -- and `core invite-role-scope.util roleInvitable` refuses a
265
+ * `type: "admin"` role on any of those, without exception. The request that
266
+ * fills this list goes out as `org: "", type: ""`, which is the ORG-LESS set:
267
+ * on staging that is 12 roles, 2 of them `type: "admin"`. So 2 of the 12
268
+ * options could only ever be picked and then refused.
269
+ *
270
+ * Display only. The server's decision is unchanged, and nothing this form can
271
+ * successfully send is removed -- the 10 `type: "organization"` templates,
272
+ * including "Org Owner" (117 live members, 321 invitations), all stay.
273
+ */
274
+ if (roleData.value)
275
+ roles.value = roleData.value.items.filter((r: any) => r?.type !== 'admin')
262
276
  })
263
277
 
264
278
  watch(
@@ -109,28 +109,24 @@
109
109
  </AppButton>
110
110
 
111
111
  <!-- one channel per row: a switch must never sit beside the
112
- NEXT channel's label, which is what a three-up grid does -->
112
+ NEXT channel's label, which is what a three-up grid does.
113
+ Only channels this category can really deliver on are
114
+ drawn — a switch that will not move is not a setting. -->
113
115
  <v-row no-gutters>
114
116
  <v-col
115
- v-for="(channel, index) in category.channels"
117
+ v-for="(channel, index) in switchableIn(category)"
116
118
  :key="channel.key"
117
119
  cols="12"
118
- :class="index < category.channels.length - 1 ? 'border-b-thin' : ''"
120
+ :class="index < switchableIn(category).length - 1 ? 'border-b-thin' : ''"
119
121
  >
120
- <div
121
- class="d-flex align-center justify-space-between py-2"
122
- :class="{ 'channel-unavailable': !channel.supported }"
123
- >
122
+ <div class="d-flex align-center justify-space-between py-2">
124
123
  <div class="pr-4">
125
124
  <div class="channel-label">{{ channel.label }}</div>
126
- <div v-if="!channel.supported" class="channel-note mt-1">
127
- {{ channel.note }}
128
- </div>
129
125
  </div>
130
126
 
131
127
  <v-switch
132
128
  :model-value="channel.enabled"
133
- :disabled="!channel.supported || saving"
129
+ :disabled="saving"
134
130
  color="primary"
135
131
  hide-details
136
132
  density="compact"
@@ -206,11 +202,17 @@ const allOn = computed(
206
202
  categories.value.every((category) => categoryAllOn(category)),
207
203
  );
208
204
 
209
- /** what is on, in words — so a collapsed panel still says what it is doing */
205
+ /**
206
+ * What is on, in words — so a collapsed panel still says what it is doing.
207
+ *
208
+ * The channels are NAMED rather than summarised as "on everywhere". Not every
209
+ * category can reach a person every way, so "everywhere" was a claim about
210
+ * three channels for a category that only ever had two — the screen said the
211
+ * email nobody sends was on.
212
+ */
210
213
  function summaryFor(category: TNotificationCategorySetting) {
211
214
  const on = switchableIn(category).filter((c) => c.enabled);
212
215
  if (!on.length) return "Off";
213
- if (on.length === switchableIn(category).length) return "On everywhere";
214
216
  return `On: ${on.map((c) => c.label).join(", ")}`;
215
217
  }
216
218
 
@@ -357,17 +359,4 @@ onMounted(load);
357
359
  font-size: var(--fs-breadcrumb);
358
360
  color: var(--text2);
359
361
  }
360
-
361
- /* Unavailable channels are shown and explained, never hidden.
362
- *
363
- * They are NOT faded. The disabled switch already says the control cannot be
364
- * moved, and the sentence beside it is the only place a person is told why —
365
- * dimming that sentence is dimming the explanation. A blanket opacity here
366
- * measured 2.3:1 against the card, which is unreadable; the row is now marked
367
- * by a rule down its edge instead, and every word stays at full strength. */
368
- .channel-unavailable {
369
- border-left: 2px solid rgb(var(--v-border-color));
370
- padding-left: 12px;
371
- opacity: 1;
372
- }
373
362
  </style>
@@ -14,10 +14,13 @@
14
14
  export type TNotificationChannelSetting = {
15
15
  key: string;
16
16
  label: string;
17
- /** false = this category cannot reach them this way; drawn, dimmed, explained */
17
+ /**
18
+ * Whether this category can reach them this way at all. The server now sends
19
+ * only the channels that can, so this is true for everything it sends; the
20
+ * screen still filters on it so an older server, which sent all three and
21
+ * marked the dead one false, draws the same two switches.
22
+ */
18
23
  supported: boolean;
19
- /** the plain-English reason, present only when unsupported */
20
- note?: string;
21
24
  enabled: boolean;
22
25
  };
23
26
 
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.2.25",
5
+ "version": "4.2.27",
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.",