@7365admin1/layer-common 4.2.22 → 4.2.23
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,20 @@
|
|
|
1
1
|
# @iservice365/layer-common
|
|
2
2
|
|
|
3
|
+
## 4.2.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8290f3c: Remove the web/mobile split from the role permission dialogs
|
|
8
|
+
|
|
9
|
+
A role is one permission list. If a granted module also exists in a mobile app,
|
|
10
|
+
the grant applies there. The dialogs no longer draw a "Web and Mobile" / "Web
|
|
11
|
+
only" legend, no longer suffix module labels with "(Web Only)", no longer take a
|
|
12
|
+
`webOnlyResources` prop, and no longer write a `platform` onto new roles.
|
|
13
|
+
|
|
14
|
+
None of this was ever a gate: `webOnlyResources` was a hardcoded per-app array
|
|
15
|
+
that only chose a chip colour and a label suffix, and the role document's
|
|
16
|
+
`platform` field is read by nothing. Existing role documents are untouched.
|
|
17
|
+
|
|
3
18
|
## 4.2.22
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -740,11 +755,11 @@
|
|
|
740
755
|
`utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
|
|
741
756
|
own rule from two endpoints the console already calls, unprojected:
|
|
742
757
|
|
|
743
|
-
|
|
744
|
-
|
|
758
|
+
GET /api/members/user/:user/app/admin the Seven365 staff membership
|
|
759
|
+
GET /api/roles/id/:role that membership's role document
|
|
745
760
|
|
|
746
|
-
|
|
747
|
-
|
|
761
|
+
owner = member.type === "admin" && role.type === "admin" && role.default === true
|
|
762
|
+
staff = member.type === "admin" && role.type === "admin"
|
|
748
763
|
|
|
749
764
|
`role.default` is the marker because it is the only property of a platform
|
|
750
765
|
staff role no API caller can set - `role.controller.ts` validates create and
|
|
@@ -36,19 +36,6 @@
|
|
|
36
36
|
</v-row>
|
|
37
37
|
</v-col>
|
|
38
38
|
|
|
39
|
-
<v-col cols="12" class="mt-3">
|
|
40
|
-
<div class="role-create__legend">
|
|
41
|
-
<span class="d-flex align-center ga-2">
|
|
42
|
-
<v-icon class="role-create__dot--both" size="14">mdi-circle</v-icon>
|
|
43
|
-
Web and Mobile
|
|
44
|
-
</span>
|
|
45
|
-
<span class="d-flex align-center ga-2">
|
|
46
|
-
<v-icon class="role-create__dot--web" size="14">mdi-circle</v-icon>
|
|
47
|
-
Web only
|
|
48
|
-
</span>
|
|
49
|
-
</div>
|
|
50
|
-
</v-col>
|
|
51
|
-
|
|
52
39
|
<v-col cols="12" class="mt-2">
|
|
53
40
|
<AppButton
|
|
54
41
|
variant="ghost"
|
|
@@ -73,7 +60,7 @@
|
|
|
73
60
|
<StatusChip
|
|
74
61
|
class="mr-3"
|
|
75
62
|
:dot="false"
|
|
76
|
-
|
|
63
|
+
tone="info"
|
|
77
64
|
:label="String(selectedActionCount(String(resourceKey)))"
|
|
78
65
|
/>
|
|
79
66
|
</template>
|
|
@@ -181,10 +168,6 @@ const props = defineProps({
|
|
|
181
168
|
type: Boolean,
|
|
182
169
|
default: true,
|
|
183
170
|
},
|
|
184
|
-
webOnlyResources: {
|
|
185
|
-
type: Array as PropType<string[]>,
|
|
186
|
-
default: () => [],
|
|
187
|
-
},
|
|
188
171
|
cancelText: {
|
|
189
172
|
type: String,
|
|
190
173
|
default: "Cancel",
|
|
@@ -213,12 +196,7 @@ const resourceLabels: Record<string, string> = {
|
|
|
213
196
|
};
|
|
214
197
|
|
|
215
198
|
function formatResourceLabel(key: string): string {
|
|
216
|
-
|
|
217
|
-
return props.webOnlyResources.includes(key) ? `${label} (Web Only)` : label;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function isWebOnly(resource: string) {
|
|
221
|
-
return props.webOnlyResources.includes(resource);
|
|
199
|
+
return resourceLabels[key] ?? key.replace(/-/g, " ");
|
|
222
200
|
}
|
|
223
201
|
|
|
224
202
|
function isCategoryEnabled(resource: string) {
|
|
@@ -313,7 +291,6 @@ async function submit() {
|
|
|
313
291
|
type: props.type,
|
|
314
292
|
org: props.org,
|
|
315
293
|
site: props.siteId,
|
|
316
|
-
platform: "website",
|
|
317
294
|
});
|
|
318
295
|
emit("success");
|
|
319
296
|
} catch (error: any) {
|
|
@@ -381,25 +358,6 @@ const isAllSelected = computed(() => {
|
|
|
381
358
|
max-height: calc(100vh - 160px);
|
|
382
359
|
}
|
|
383
360
|
|
|
384
|
-
.role-create__legend {
|
|
385
|
-
display: flex;
|
|
386
|
-
align-items: center;
|
|
387
|
-
gap: 16px;
|
|
388
|
-
font-size: var(--fs-breadcrumb);
|
|
389
|
-
color: var(--text2);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
/* Were `amber-darken-2` / `blue-darken-2` - fixed Vuetify hues that do not
|
|
393
|
-
follow the theme, and the same two the count chip used. Design tones now,
|
|
394
|
-
and the dot and the chip read the same `isWebOnly`, so they cannot drift. */
|
|
395
|
-
.role-create__dot--both {
|
|
396
|
-
color: var(--warn);
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.role-create__dot--web {
|
|
400
|
-
color: var(--info);
|
|
401
|
-
}
|
|
402
|
-
|
|
403
361
|
/* Was a `variant="outlined"` v-card inside the card - a card on a card. It is
|
|
404
362
|
the list frame, so it takes the design's border and radius and no second
|
|
405
363
|
surface. */
|
|
@@ -7,16 +7,6 @@
|
|
|
7
7
|
<v-form v-model="validForm" :disabled="disable">
|
|
8
8
|
<v-row no-gutters>
|
|
9
9
|
<v-col cols="12" class="mt-4">
|
|
10
|
-
<div class="role-perm__legend">
|
|
11
|
-
<span class="d-flex align-center ga-2">
|
|
12
|
-
<v-icon class="role-perm__dot--both" size="14">mdi-circle</v-icon>
|
|
13
|
-
Web and Mobile
|
|
14
|
-
</span>
|
|
15
|
-
<span class="d-flex align-center ga-2">
|
|
16
|
-
<v-icon class="role-perm__dot--web" size="14">mdi-circle</v-icon>
|
|
17
|
-
Web only
|
|
18
|
-
</span>
|
|
19
|
-
</div>
|
|
20
10
|
<AppButton
|
|
21
11
|
v-if="edit"
|
|
22
12
|
variant="ghost"
|
|
@@ -36,7 +26,7 @@
|
|
|
36
26
|
<StatusChip
|
|
37
27
|
class="mr-3"
|
|
38
28
|
:dot="false"
|
|
39
|
-
|
|
29
|
+
tone="info"
|
|
40
30
|
:label="String(selectedActionCount(String(resourceKey)))"
|
|
41
31
|
/>
|
|
42
32
|
</template>
|
|
@@ -157,10 +147,6 @@ const props = defineProps({
|
|
|
157
147
|
type: Object,
|
|
158
148
|
default: () => ({}),
|
|
159
149
|
},
|
|
160
|
-
webOnlyResources: {
|
|
161
|
-
type: Array as PropType<string[]>,
|
|
162
|
-
default: () => [],
|
|
163
|
-
},
|
|
164
150
|
// "Update role". This dialog had no permission prop at all, so it showed Edit
|
|
165
151
|
// to everyone -- including on the seeded platform-owner role -- and the
|
|
166
152
|
// `canUpdateRole` the apps have been passing to `RolePermissionMain` in good
|
|
@@ -182,12 +168,7 @@ const resourceLabels: Record<string, string> = {
|
|
|
182
168
|
};
|
|
183
169
|
|
|
184
170
|
function formatResourceLabel(key: string) {
|
|
185
|
-
|
|
186
|
-
return props.webOnlyResources.includes(key) ? `${label} (Web Only)` : label;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function isWebOnly(resource: string) {
|
|
190
|
-
return props.webOnlyResources.includes(resource);
|
|
171
|
+
return resourceLabels[key] ?? key.replace(/-/g, " ");
|
|
191
172
|
}
|
|
192
173
|
|
|
193
174
|
/**
|
|
@@ -340,27 +321,6 @@ async function submit() {
|
|
|
340
321
|
max-height: calc(100vh - 160px);
|
|
341
322
|
}
|
|
342
323
|
|
|
343
|
-
.role-perm__legend {
|
|
344
|
-
display: flex;
|
|
345
|
-
align-items: center;
|
|
346
|
-
gap: 16px;
|
|
347
|
-
margin-bottom: 12px;
|
|
348
|
-
font-size: var(--fs-breadcrumb);
|
|
349
|
-
color: var(--text2);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
/* The two legend dots carried `amber-darken-2` and `blue-darken-2` - fixed
|
|
353
|
-
Vuetify hues that do not follow the theme, and the same two hues the count
|
|
354
|
-
chip beside each row used. Both are the design's tones now, and the chip and
|
|
355
|
-
the dot stay in step because they read the same `isWebOnly`. */
|
|
356
|
-
.role-perm__dot--both {
|
|
357
|
-
color: var(--warn);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.role-perm__dot--web {
|
|
361
|
-
color: var(--info);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
324
|
/* Was a `variant="outlined"` v-card, i.e. a card inside a card. It is the list
|
|
365
325
|
frame, so it takes the design's card border and radius without laying a
|
|
366
326
|
second surface over the first. */
|
|
@@ -100,7 +100,6 @@
|
|
|
100
100
|
:org="props.orgId"
|
|
101
101
|
:site-id="props.siteId"
|
|
102
102
|
:site-state="siteFieldShown"
|
|
103
|
-
:web-only-resources="props.webOnlyResources"
|
|
104
103
|
@success="success()"
|
|
105
104
|
:type="props.type"
|
|
106
105
|
@success:create-more="getRoles()"
|
|
@@ -118,7 +117,6 @@
|
|
|
118
117
|
:name="name"
|
|
119
118
|
:id="roleId"
|
|
120
119
|
:can-update-role="props.canUpdateRole"
|
|
121
|
-
:web-only-resources="props.webOnlyResources"
|
|
122
120
|
/>
|
|
123
121
|
</v-dialog>
|
|
124
122
|
|
|
@@ -263,10 +261,6 @@ const props = defineProps({
|
|
|
263
261
|
required: true,
|
|
264
262
|
default: () => ({}),
|
|
265
263
|
},
|
|
266
|
-
webOnlyResources: {
|
|
267
|
-
type: Array as PropType<string[]>,
|
|
268
|
-
default: () => [],
|
|
269
|
-
},
|
|
270
264
|
headers: {
|
|
271
265
|
type: Array as PropType<Array<Record<string, any>>>,
|
|
272
266
|
default: () => [
|
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.
|
|
5
|
+
"version": "4.2.23",
|
|
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.",
|