@7365admin1/layer-common 4.13.0 → 4.13.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.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b3563db: Invite Client takes one application per invitation, its dialog scrolls so every module, the owner role and Submit are reachable, and Feedback is offered once (both spellings sent together). Screen modals shown outside a v-dialog now scroll their body.
|
|
8
|
+
|
|
3
9
|
## 4.13.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -1107,11 +1113,11 @@
|
|
|
1107
1113
|
`utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
|
|
1108
1114
|
own rule from two endpoints the console already calls, unprojected:
|
|
1109
1115
|
|
|
1110
|
-
|
|
1111
|
-
|
|
1116
|
+
GET /api/members/user/:user/app/admin the Seven365 staff membership
|
|
1117
|
+
GET /api/roles/id/:role that membership's role document
|
|
1112
1118
|
|
|
1113
|
-
|
|
1114
|
-
|
|
1119
|
+
owner = member.type === "admin" && role.type === "admin" && role.default === true
|
|
1120
|
+
staff = member.type === "admin" && role.type === "admin"
|
|
1115
1121
|
|
|
1116
1122
|
`role.default` is the marker because it is the only property of a platform
|
|
1117
1123
|
staff role no API caller can set - `role.controller.ts` validates create and
|
package/assets/css/screens.css
CHANGED
|
@@ -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
|
-
<!--
|
|
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
|
-
|
|
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
|
|
|
@@ -467,10 +458,15 @@ const ownerRoleComplete = computed(() =>
|
|
|
467
458
|
)
|
|
468
459
|
|
|
469
460
|
/* ================= EVENTS ================= */
|
|
470
|
-
async function handleUpdateApp(value: string
|
|
461
|
+
async function handleUpdateApp(value: string | null) {
|
|
462
|
+
const chosen = value ? [value] : []
|
|
463
|
+
invite.value.app = chosen
|
|
471
464
|
invite.value.role = ""
|
|
472
465
|
invite.value.site = ""
|
|
473
|
-
|
|
466
|
+
// A different application starts again: all its modules and permissions ticked.
|
|
467
|
+
modulesByApp.value = {}
|
|
468
|
+
uncheckedByApp.value = {}
|
|
469
|
+
syncModules(chosen)
|
|
474
470
|
await refreshRoles()
|
|
475
471
|
}
|
|
476
472
|
|
|
@@ -558,7 +554,7 @@ async function submit() {
|
|
|
558
554
|
modules: [
|
|
559
555
|
...new Set([
|
|
560
556
|
...ALWAYS_ALLOWED_MODULES,
|
|
561
|
-
...(modulesByApp.value[app] ?? inviteModuleGroups(app).flatMap(group => group.modules)),
|
|
557
|
+
...inviteModuleKeys(modulesByApp.value[app] ?? inviteModuleGroups(app).flatMap(group => group.modules)),
|
|
562
558
|
]),
|
|
563
559
|
],
|
|
564
560
|
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.13.
|
|
5
|
+
"version": "4.13.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.",
|
|
@@ -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
|
-
|
|
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. */
|
package/utils/org-modules.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
|