@7365admin1/layer-common 4.11.1-staging.319 → 4.11.1-staging.320

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.
@@ -246,6 +246,19 @@
246
246
  box-shadow: var(--shadow-modal) !important;
247
247
  background: var(--card) !important;
248
248
  max-height: calc(100vh - 32px);
249
+ /*
250
+ * A column, so the body below can take what is left and scroll. Inside a
251
+ * `v-dialog` Vuetify already makes the card a column; a card shown in a
252
+ * plain overlay (Client list's Invite Client) did not, so its body grew past
253
+ * the max-height, the card clipped it, and Submit was unreachable.
254
+ */
255
+ display: flex;
256
+ flex-direction: column;
257
+ }
258
+
259
+ .screen-modal > .v-card-title,
260
+ .screen-modal > .screen-modal__footer {
261
+ flex-shrink: 0;
249
262
  }
250
263
 
251
264
  .screen-modal .v-card-title {
@@ -258,6 +271,8 @@
258
271
 
259
272
  .screen-modal__body {
260
273
  overflow-y: auto;
274
+ flex: 1 1 auto;
275
+ min-height: 0;
261
276
  font-size: var(--fs-cell);
262
277
  }
263
278
 
@@ -21,17 +21,18 @@
21
21
  </div>
22
22
  </v-col>
23
23
 
24
- <!-- APP MULTI SELECT -->
24
+ <!--
25
+ ONE APPLICATION PER INVITATION (owner, 2026-09-15: "you should not
26
+ allowing to choose multiple application during the invite"). The
27
+ modules and the owner role below belong to that one application.
28
+ -->
25
29
  <v-col v-if="APP" cols="12" class="mt-2">
26
30
  <InputLabel title="App" required />
27
31
  <v-autocomplete
28
- v-model="invite.app"
32
+ :model-value="invite.app[0] ?? null"
29
33
  :items="apps"
30
34
  item-title="title"
31
35
  item-value="value"
32
- multiple
33
- chips
34
- closable-chips
35
36
  class="filter-field"
36
37
  density="comfortable"
37
38
  :rules="[requiredRule]"
@@ -42,16 +43,6 @@
42
43
  v-bind="itemProps"
43
44
  :disabled="item.raw.disabled"
44
45
  >
45
- <template #prepend>
46
- <v-checkbox-btn
47
- :model-value="invite.app.includes(item.raw.value)"
48
- :disabled="item.raw.disabled"
49
- color="primary"
50
- class="filter-field"
51
- density="comfortable"
52
- />
53
- </template>
54
-
55
46
  <template #title>
56
47
  <span :class="item.raw.disabled ? 'text-disabled' : ''">
57
48
  {{ item.raw.title }}
@@ -231,7 +222,7 @@ import useUser from '../composables/useUser'
231
222
  import useUtils from '../composables/useUtils'
232
223
  import useOrg from '../composables/useOrg'
233
224
  import useMember from '../composables/useMember'
234
- import { catalogueStrings, inviteModuleGroups, inviteRoleCatalogue } from '../utils/client-invite-modules'
225
+ import { catalogueStrings, inviteModuleGroups, inviteModuleKeys, inviteRoleCatalogue } from '../utils/client-invite-modules'
235
226
  import { ALWAYS_ALLOWED_MODULES } from '../utils/org-modules'
236
227
  import { formatResourceLabel } from '../utils/permission-labels'
237
228
 
@@ -485,10 +476,15 @@ const ownerRoleComplete = computed(() =>
485
476
  )
486
477
 
487
478
  /* ================= EVENTS ================= */
488
- async function handleUpdateApp(value: string[]) {
479
+ async function handleUpdateApp(value: string | null) {
480
+ const chosen = value ? [value] : []
481
+ invite.value.app = chosen
489
482
  invite.value.role = ""
490
483
  invite.value.site = ""
491
- syncModules(value)
484
+ // A different application starts again: all its modules and permissions ticked.
485
+ modulesByApp.value = {}
486
+ uncheckedByApp.value = {}
487
+ syncModules(chosen)
492
488
  await refreshRoles()
493
489
  }
494
490
 
@@ -576,7 +572,7 @@ async function submit() {
576
572
  modules: [
577
573
  ...new Set([
578
574
  ...ALWAYS_ALLOWED_MODULES,
579
- ...(modulesByApp.value[app] ?? inviteModuleGroups(app).flatMap(group => group.modules)),
575
+ ...inviteModuleKeys(modulesByApp.value[app] ?? inviteModuleGroups(app).flatMap(group => group.modules)),
580
576
  ]),
581
577
  ],
582
578
  permissions: ownerPermissions(app),
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.11.1-staging.319",
5
+ "version": "4.11.1-staging.320",
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.",
@@ -1,6 +1,6 @@
1
1
  import { PERMISSIONS } from "../constants/permissions";
2
2
  import { APPLICATIONS, applicationModules, groupModulesByApplication } from "./module-applications";
3
- import { catalogueForOrg } from "./org-modules";
3
+ import { catalogueForOrg, spellingsOf } from "./org-modules";
4
4
 
5
5
  /**
6
6
  * THE MODULES A NEW CLIENT IS OFFERED ON "INVITE CLIENT".
@@ -51,9 +51,33 @@ export function inviteModuleGroups(nature: string): ModuleGroup[] {
51
51
  const applications = Object.hasOwn(NATURE_APPLICATIONS, nature) ? NATURE_APPLICATIONS[nature] : null;
52
52
 
53
53
  const shown = applications ? groups.filter((group) => applications.includes(group.key)) : groups;
54
- return ungrouped.length
54
+ const all = ungrouped.length
55
55
  ? [...shown, { key: "other", label: "Not tied to a service application", modules: ungrouped }]
56
56
  : shown;
57
+
58
+ /*
59
+ * One module, one checkbox. Security's catalogue carries both `feedbacks`
60
+ * and the legacy `feedback`, which the server treats as ONE module (core
61
+ * `SPELLING_GROUPS`: ticking either spelling allows both) - so two boxes both
62
+ * read "Feedback", and unticking one while the other stayed ticked hid
63
+ * nothing. The first spelling shown stands for the module; `inviteModuleKeys`
64
+ * sends every spelling of each ticked one.
65
+ */
66
+ const seen = new Set<string>();
67
+ return all.map((group) => ({
68
+ ...group,
69
+ modules: group.modules.filter((key) => {
70
+ const id = spellingsOf(key)[0];
71
+ if (seen.has(id)) return false;
72
+ seen.add(id);
73
+ return true;
74
+ }),
75
+ }));
76
+ }
77
+
78
+ /** The module keys to send for the ticked checkboxes: every spelling of each. */
79
+ export function inviteModuleKeys(ticked: readonly string[]): string[] {
80
+ return [...new Set(ticked.flatMap((key) => spellingsOf(key)))];
57
81
  }
58
82
 
59
83
  /** `{ resource: { action: { description } } }` - every `use*Permission` shape. */
@@ -95,7 +95,8 @@ export const MODULE_SPELLING_GROUPS: readonly (readonly string[])[] = (() => {
95
95
  return Object.freeze([...groups.values()].map((group) => Object.freeze([...group])));
96
96
  })();
97
97
 
98
- function spellingsOf(key: string): readonly string[] {
98
+ /** Every spelling of this module, `key` included. */
99
+ export function spellingsOf(key: string): readonly string[] {
99
100
  return MODULE_SPELLING_GROUPS.find((group) => group.includes(key)) ?? [key];
100
101
  }
101
102
 
@@ -50,6 +50,8 @@ export const RESOURCE_LABELS: Record<string, string> = {
50
50
  "bulletin-videos-mgmt": "Bulletin videos",
51
51
  "access-card-mgmt": "Access cards",
52
52
  feedbacks: "Feedback",
53
+ // The legacy singular resource: its own permission, same module (see `feedbacks`).
54
+ feedback: "Feedback (older app permission)",
53
55
  roles: "Roles and permissions",
54
56
  };
55
57