@wssto2/vue-core 0.4.28 → 0.5.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 +77 -0
- package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js → AccessGate.vue_vue_type_script_setup_true_lang-DZ9GcLC1.js} +1 -1
- package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-QPvYudWc.js → ActionRow.vue_vue_type_script_setup_true_lang-BCgKzUvG.js} +1 -1
- package/dist/{Activity-BWkVX1Nx.js → Activity-dpY2kIs2.js} +7 -7
- package/dist/{Changes-MG77TDwz.js → Changes-CL8F1w8q.js} +6 -6
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-Bnpv9TEj.js → CollectionPage.vue_vue_type_script_setup_true_lang-l-e-6WeS.js} +4 -4
- package/dist/{DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js → DateField.vue_vue_type_script_setup_true_lang-DRuWzSaX.js} +1 -1
- package/dist/{DeadLetters-CkDE71B3.js → DeadLetters-BZLyL5lR.js} +7 -7
- package/dist/{FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js → FormErrors.vue_vue_type_script_setup_true_lang-D7edzNTL.js} +2 -2
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js → FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js} +2 -2
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js → FormView.vue_vue_type_script_setup_true_lang-CPSYV7iQ.js} +2 -2
- package/dist/{General-UTBVEXbN.js → General-mrVzi-5R.js} +10 -10
- package/dist/MenuButton.vue_vue_type_script_setup_true_lang-AGbN9r5q.js +28 -0
- package/dist/{NewRolePage-B7DwFWPk.js → NewRolePage-B2DItwvf.js} +3 -3
- package/dist/{NumberField.vue_vue_type_script_setup_true_lang-DaE5BLm4.js → NumberField.vue_vue_type_script_setup_true_lang-ButMV_sf.js} +1 -1
- package/dist/ProfilePage-EiTIYzZ5.js +764 -0
- package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-BqqilJGF.js +325 -0
- package/dist/RolePage-jMHAt9y8.js +314 -0
- package/dist/{RolesPage-B5RwSZ89.js → RolesPage-B9GaVQBx.js} +6 -6
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dmv6TpCi.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Ci04hApd.js} +1 -1
- package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-Dg-_ZjgR.js → SegmentedField.vue_vue_type_script_setup_true_lang-BwyMvkis.js} +1 -1
- package/dist/{SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js → SelectField.vue_vue_type_script_setup_true_lang-BzQC1qDQ.js} +11 -12
- package/dist/SessionList.vue_vue_type_script_setup_true_lang-DhoTd5D7.js +133 -0
- package/dist/{Sessions-DWj2OGo0.js → Sessions-CHLokZ9e.js} +5 -5
- package/dist/SettingsPage-CudoKdXm.js +632 -0
- package/dist/{SignIn-COThB9XN.js → SignIn-ypRvdmjg.js} +7 -7
- package/dist/{SignInPage-CdzgSvRm.js → SignInPage-CbPeKlAo.js} +4 -4
- package/dist/SignIns-BApzbGq-.js +121 -0
- package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-ALvJisiP.js → SwitchField.vue_vue_type_script_setup_true_lang-D_-HACqT.js} +1 -1
- package/dist/{TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js → TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js} +2 -2
- package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-BJ4__cvJ.js → TextareaField.vue_vue_type_script_setup_true_lang-DsjK2C9T.js} +1 -1
- package/dist/{TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js → TimeField.vue_vue_type_script_setup_true_lang-Cz7KhUqt.js} +1 -1
- package/dist/{UserRecord-BWMnXz4q.js → UserRecord-BCTaBajE.js} +13 -13
- package/dist/{UsersList-Chq8yM5C.js → UsersList-CqSK3cQL.js} +9 -9
- package/dist/access/RoleCompareDialog.vue.d.ts +1 -1
- package/dist/access/RoleEditor.vue.d.ts +2 -0
- package/dist/access/constraints.d.ts +28 -0
- package/dist/access/context.d.ts +5 -0
- package/dist/access/feature.d.ts +17 -0
- package/dist/access/index.d.ts +3 -1
- package/dist/access/index.js +11 -9
- package/dist/access/refusals.d.ts +20 -2
- package/dist/app/index.js +118 -116
- package/dist/app/keepAlive.d.ts +4 -8
- package/dist/client/index.js +19 -11
- package/dist/{client-k9euDWF4.js → client-BHPFfBj3.js} +20 -20
- package/dist/collection/index.js +3 -3
- package/dist/content/index.js +66 -37
- package/dist/{contributions-BVBZP5Jb.js → contributions-fx5q5n1u.js} +1 -1
- package/dist/{describeError-B-NMa--w.js → describeError-BqGAUZgX.js} +1 -1
- package/dist/{error-CD7x0Jrz.js → error-Bb_dr_Ay.js} +2 -2
- package/dist/{fieldMessages-6HVzSDqG.js → fieldMessages-DTXpWnBd.js} +7 -7
- package/dist/form/index.js +1235 -1412
- package/dist/{guards-BJZjc3FZ.js → guards-D4mXf_2X.js} +1 -1
- package/dist/{http-BFfkA7gN.js → http-CdQowFlW.js} +1 -1
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +30 -30
- package/dist/identity/index.d.ts +3 -1
- package/dist/identity/index.js +7 -6
- package/dist/identity/profile/DetailsFields.vue.d.ts +8 -0
- package/dist/identity/profile/{DetailsPanel.vue.d.ts → DetailsGroup.vue.d.ts} +4 -1
- package/dist/identity/profile/{EmailPanel.vue.d.ts → EmailGroup.vue.d.ts} +1 -1
- package/dist/identity/profile/SignInsGroup.vue.d.ts +2 -0
- package/dist/identity/profile/profileSections.d.ts +37 -0
- package/dist/identity/session.d.ts +10 -7
- package/dist/identity/shared/SignInList.vue.d.ts +22 -0
- package/dist/identity/shared/deviceLabel.d.ts +7 -0
- package/dist/identity/useReturnToOwnAccount.d.ts +10 -0
- package/dist/identity/users/context.d.ts +3 -0
- package/dist/identity/users/feature.d.ts +3 -0
- package/dist/index-BTRv8mcf.js +630 -0
- package/dist/index-VPzJJN6Z.js +745 -0
- package/dist/index-auJqVMWC.js +478 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/keepAlive-z3IRFkQq.js +46 -0
- package/dist/modules/notification/entities.d.ts +19 -0
- package/dist/modules/notification/routes.d.ts +25 -1
- package/dist/modules/notification/schemas.d.ts +24 -0
- package/dist/{navigation-DpcDF0rX.js → navigation-Bc5EQ_Si.js} +1 -1
- package/dist/{neighbors-RVQ4O3Qv.js → neighbors-Bv6vnWlW.js} +22 -22
- package/dist/notifications/context.d.ts +24 -1
- package/dist/notifications/feature.d.ts +10 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/notifications/push/DevicesSection.vue.d.ts +12 -0
- package/dist/notifications/push/ThisDeviceSection.vue.d.ts +15 -0
- package/dist/notifications/push/browser.d.ts +40 -0
- package/dist/notifications/push/devices.d.ts +15 -0
- package/dist/notifications/push/thisDevice.d.ts +28 -0
- package/dist/notifications/settings/ChannelsSection.vue.d.ts +16 -0
- package/dist/notifications/settings/{QuietHoursPanel.vue.d.ts → QuietHoursSection.vue.d.ts} +3 -1
- package/dist/notifications/settings/SettingsBody.vue.d.ts +17 -0
- package/dist/notifications/settings/settings.d.ts +4 -3
- package/dist/notifications/settings/state.d.ts +4 -2
- package/dist/options-g8RwEhBk.js +366 -0
- package/dist/overlay/index.js +37 -59
- package/dist/page/index.js +1 -1
- package/dist/phone/index.js +10 -11
- package/dist/platform/index.js +3 -3
- package/dist/platform/platform.d.ts +7 -2
- package/dist/platform/session.d.ts +17 -0
- package/dist/platform-Dx6STiwY.js +283 -0
- package/dist/push-worker/index.d.ts +91 -0
- package/dist/push-worker/index.js +54 -0
- package/dist/resource/index.js +1 -1
- package/dist/{routeResource-DlTsGTg_.js → routeResource-CcYA75T2.js} +2 -2
- package/dist/router/index.js +3 -3
- package/dist/{sections-CeZl-Jxg.js → sections-B0HxIOC2.js} +1 -1
- package/dist/shell/index.js +3 -3
- package/dist/signInEvents-DWShrJox.js +30 -0
- package/dist/state/index.js +1 -1
- package/dist/{status-dGvfh1TP.js → status-BUFELJz2.js} +2 -2
- package/dist/styles.css +1 -1
- package/dist/{suggestions-DHJFKB26.js → suggestions-CfFTHi8y.js} +2 -2
- package/dist/testing/index.js +1 -1
- package/dist/{useCommand-Cj-APj-P.js → useCommand-CtqheKUv.js} +2 -2
- package/dist/useGroupSheet-ATvc0IiM.js +278 -0
- package/dist/{useLoad-M7V-AVwR.js → useLoad-W4tfxmm5.js} +1 -1
- package/dist/{useResourceForm-tGYTfKhH.js → useResourceForm-CJfl8rj_.js} +1 -1
- package/package.json +6 -2
- package/dist/KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js +0 -35
- package/dist/OtpInput.vue_vue_type_script_setup_true_lang-gp4FfWAH.js +0 -95
- package/dist/PanelActions.vue_vue_type_script_setup_true_lang-E9VdIGkf.js +0 -46
- package/dist/ProfilePage-C8VhiKIh.js +0 -654
- package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-DRHmjA9w.js +0 -300
- package/dist/RolePage-ODFu68Ce.js +0 -315
- package/dist/SessionList.vue_vue_type_script_setup_true_lang-D5qm77Zo.js +0 -111
- package/dist/SettingsPage-C3fPSmi7.js +0 -255
- package/dist/SignInTable.vue_vue_type_script_setup_true_lang-Bs0yTi2E.js +0 -79
- package/dist/SignIns-cztICmqt.js +0 -66
- package/dist/control-B4SdblL6.js +0 -350
- package/dist/identity/profile/PanelActions.vue.d.ts +0 -17
- package/dist/index-BhtJR4c_.js +0 -459
- package/dist/index-C3E6DcO0.js +0 -706
- package/dist/index-sTBBHqNG.js +0 -504
- package/dist/keepAlive-CDvMQlcJ.js +0 -49
- package/dist/notifications/settings/EmailPanel.vue.d.ts +0 -14
- package/dist/options-Ba_0uLWN.js +0 -18
- package/dist/platform-PZpUkkMS.js +0 -268
- package/dist/route-goWMxDUN.js +0 -13
- package/dist/transport-BnP7WC0Y.js +0 -4
- /package/dist/identity/{profile/PasswordPanel.vue.d.ts → ReturnMenuItem.vue.d.ts} +0 -0
- /package/dist/identity/profile/{SessionsPanel.vue.d.ts → PasswordGroup.vue.d.ts} +0 -0
- /package/dist/identity/profile/{SignInsPanel.vue.d.ts → SessionsGroup.vue.d.ts} +0 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { defineComponent as D, computed as k, ref as H, openBlock as r, createElementBlock as g, createElementVNode as O, unref as t, Fragment as j, renderList as C, normalizeClass as X, toDisplayString as f, createVNode as q, withCtx as p, createTextVNode as x, createCommentVNode as V, createBlock as _, createSlots as Y, watch as Z, mergeProps as F } from "vue";
|
|
2
|
+
import { useI18n as I } from "vue-i18n";
|
|
3
|
+
import { u as ee } from "./FormErrors.vue_vue_type_script_setup_true_lang-D7edzNTL.js";
|
|
4
|
+
import { _ as Q } from "./FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js";
|
|
5
|
+
import { _ as te } from "./FormView.vue_vue_type_script_setup_true_lang-CPSYV7iQ.js";
|
|
6
|
+
import { _ as ae } from "./SelectField.vue_vue_type_script_setup_true_lang-BzQC1qDQ.js";
|
|
7
|
+
import { _ as se } from "./TextareaField.vue_vue_type_script_setup_true_lang-DsjK2C9T.js";
|
|
8
|
+
import { _ as oe } from "./TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js";
|
|
9
|
+
import { u as ne } from "./useSaveChrome-7huA3FzR.js";
|
|
10
|
+
import { t as le } from "./toast-CqSDTWRX.js";
|
|
11
|
+
import { _ as E } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
12
|
+
import { _ as R } from "./Banner.vue_vue_type_script_setup_true_lang-DSStj_5z.js";
|
|
13
|
+
import { d as W, u as G, p as re, o as T, r as K, g as M, s as ie, e as ce, a as ue, f as de, b as me, h as fe } from "./index-VPzJJN6Z.js";
|
|
14
|
+
import { _ as pe } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
|
|
15
|
+
import { _ as _e } from "./Tabs.vue_vue_type_script_setup_true_lang-CcMcE38r.js";
|
|
16
|
+
import { _ as ve } from "./SegmentedField.vue_vue_type_script_setup_true_lang-BwyMvkis.js";
|
|
17
|
+
import { _ as be } from "./SwitchField.vue_vue_type_script_setup_true_lang-D_-HACqT.js";
|
|
18
|
+
import { u as ge } from "./platform-Dx6STiwY.js";
|
|
19
|
+
function ye(y, c) {
|
|
20
|
+
return Object.fromEntries(
|
|
21
|
+
y.map(({ attribute: d, options: o }) => {
|
|
22
|
+
const u = c.find((l) => l.attribute === d)?.values ?? [];
|
|
23
|
+
return [d, u.length === 1 && o.some((l) => l.value === u[0]) ? u[0] : ""];
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function he(y, c, d, o) {
|
|
28
|
+
const u = new Set(y.map((i) => i.attribute)), l = c.filter((i) => !u.has(i.attribute) || (o[i.attribute] ?? "") === (d[i.attribute] ?? "")), v = y.flatMap(({ attribute: i }) => {
|
|
29
|
+
const b = o[i] ?? "";
|
|
30
|
+
return b !== (d[i] ?? "") && b !== "" ? [{ attribute: i, values: [b] }] : [];
|
|
31
|
+
});
|
|
32
|
+
return [...l, ...v];
|
|
33
|
+
}
|
|
34
|
+
const ke = {
|
|
35
|
+
class: "flex min-w-0 flex-col gap-4 lg:grid lg:grid-cols-[15rem_minmax(0,1fr)] lg:items-start lg:gap-8",
|
|
36
|
+
"data-test": "permission-tree"
|
|
37
|
+
}, xe = ["aria-label"], we = ["data-test", "aria-current", "onClick"], $e = { class: "min-w-0 flex-1 truncate" }, Oe = ["data-test"], Ve = ["data-test"], Le = { class: "flex min-w-0 items-center justify-between gap-3 px-row-inset" }, je = { class: "min-w-0 flex-1 text-title3 font-semibold text-content-strong" }, Ce = { class: "text-footnote tabular-nums text-content-muted" }, qe = {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "contents",
|
|
40
|
+
"data-test": "tree-toggle-all"
|
|
41
|
+
}, Be = /* @__PURE__ */ D({
|
|
42
|
+
__name: "PermissionTree",
|
|
43
|
+
props: {
|
|
44
|
+
grants: {},
|
|
45
|
+
readonly: { type: Boolean }
|
|
46
|
+
},
|
|
47
|
+
setup(y) {
|
|
48
|
+
const c = y, { t: d } = I(), { catalogue: o } = W(), u = G(), l = k(() => re(o)), v = H(l.value[0]?.key ?? ""), i = k(() => l.value.find((a) => a.key === v.value) ?? l.value[0]), b = (a) => Object.entries(o).filter(([, s]) => ce(s) === a).map(([s]) => s), w = (a) => {
|
|
49
|
+
const s = b(a);
|
|
50
|
+
return { granted: s.filter((e) => e in c.grants).length, total: s.length };
|
|
51
|
+
}, B = (a) => `${w(a).granted} / ${w(a).total}`, L = k(() => l.value.map((a) => ({ value: a.key, label: u.groupLabel(a.key), badge: B(a.key) }))), P = k(() => i.value !== void 0 && w(i.value.key).granted === w(i.value.key).total);
|
|
52
|
+
function m() {
|
|
53
|
+
if (i.value)
|
|
54
|
+
for (const a of b(i.value.key))
|
|
55
|
+
P.value ? K(o, c.grants, a) : M(o, c.grants, a);
|
|
56
|
+
}
|
|
57
|
+
const U = (a) => [...new Set(a.permissions.map((s) => s.ownable).filter((s) => s !== null))], N = k(() => ["own", "own_location", "all"].map((a) => ({ value: a, label: u.qualifierLabel(a) })));
|
|
58
|
+
function $(a, s) {
|
|
59
|
+
const e = T(o, c.grants, s) ?? "own", n = a.permissions.some((h) => h.ownable === s && h.unownedIsOwn);
|
|
60
|
+
return [u.qualifierHint(e), e === "own" && n ? d("core.access.unowned") : ""].filter(Boolean).join(" · ");
|
|
61
|
+
}
|
|
62
|
+
function S(a) {
|
|
63
|
+
const s = a.requires.map((e) => u.permissionLabel(e)).join(", ");
|
|
64
|
+
return [u.permissionDescription(a.id), s ? d("core.access.requires", { names: s }) : ""].filter(Boolean).join(" ");
|
|
65
|
+
}
|
|
66
|
+
const A = (a, s) => ie(o, c.grants, a, s), z = (a, s) => s ? M(o, c.grants, a) : K(o, c.grants, a);
|
|
67
|
+
return (a, s) => (r(), g("div", ke, [
|
|
68
|
+
O("nav", {
|
|
69
|
+
class: "hidden flex-col gap-0.5 lg:sticky lg:top-4 lg:flex",
|
|
70
|
+
"aria-label": t(d)("core.access.modules"),
|
|
71
|
+
"data-test": "tree-modules"
|
|
72
|
+
}, [
|
|
73
|
+
(r(!0), g(j, null, C(l.value, (e) => (r(), g("button", {
|
|
74
|
+
key: e.key,
|
|
75
|
+
type: "button",
|
|
76
|
+
"data-test": `tree-module-${e.key}`,
|
|
77
|
+
"aria-current": v.value === e.key ? "true" : void 0,
|
|
78
|
+
class: X(["flex h-9 items-center justify-between gap-3 rounded-control px-3 text-left text-body transition-colors duration-motion-fast hover:bg-fill focus-visible:outline-2 focus-visible:outline-border-focus", v.value === e.key ? "bg-tint-soft font-semibold text-content-strong" : "text-content"]),
|
|
79
|
+
onClick: (n) => v.value = e.key
|
|
80
|
+
}, [
|
|
81
|
+
O("span", $e, f(t(u).groupLabel(e.key)), 1),
|
|
82
|
+
O("span", {
|
|
83
|
+
class: "text-footnote tabular-nums text-content-muted",
|
|
84
|
+
"data-test": `tree-count-${e.key}`
|
|
85
|
+
}, f(B(e.key)), 9, Oe)
|
|
86
|
+
], 10, we))), 128))
|
|
87
|
+
], 8, xe),
|
|
88
|
+
q(t(_e), {
|
|
89
|
+
modelValue: v.value,
|
|
90
|
+
"onUpdate:modelValue": s[0] || (s[0] = (e) => v.value = e),
|
|
91
|
+
tabs: L.value,
|
|
92
|
+
presentation: "scope",
|
|
93
|
+
class: "lg:hidden"
|
|
94
|
+
}, null, 8, ["modelValue", "tabs"]),
|
|
95
|
+
i.value ? (r(), g("div", {
|
|
96
|
+
key: 0,
|
|
97
|
+
class: "flex min-w-0 flex-col gap-6",
|
|
98
|
+
"data-test": `tree-panel-${i.value.key}`
|
|
99
|
+
}, [
|
|
100
|
+
O("div", Le, [
|
|
101
|
+
O("h2", je, f(t(u).groupLabel(i.value.key)), 1),
|
|
102
|
+
O("span", Ce, f(B(i.value.key)), 1),
|
|
103
|
+
c.readonly ? V("", !0) : (r(), g("span", qe, [
|
|
104
|
+
q(t(pe), {
|
|
105
|
+
prominence: "secondary",
|
|
106
|
+
size: "sm",
|
|
107
|
+
onClick: m
|
|
108
|
+
}, {
|
|
109
|
+
default: p(() => [
|
|
110
|
+
x(f(P.value ? t(d)("core.access.turn_off_all") : t(d)("core.access.turn_on_all")), 1)
|
|
111
|
+
]),
|
|
112
|
+
_: 1
|
|
113
|
+
})
|
|
114
|
+
]))
|
|
115
|
+
]),
|
|
116
|
+
(r(!0), g(j, null, C(i.value.screens, (e) => (r(), _(t(Q), {
|
|
117
|
+
key: e.key,
|
|
118
|
+
header: t(u).screenLabel(e.key)
|
|
119
|
+
}, {
|
|
120
|
+
default: p(() => [
|
|
121
|
+
(r(!0), g(j, null, C(U(e), (n) => (r(), _(t(ve), {
|
|
122
|
+
key: n,
|
|
123
|
+
label: t(u).ownableLabel(n),
|
|
124
|
+
hint: $(e, n),
|
|
125
|
+
"model-value": t(T)(t(o), c.grants, n) ?? "own",
|
|
126
|
+
options: N.value,
|
|
127
|
+
disabled: c.readonly || t(T)(t(o), c.grants, n) === null,
|
|
128
|
+
"onUpdate:modelValue": (h) => A(n, h)
|
|
129
|
+
}, null, 8, ["label", "hint", "model-value", "options", "disabled", "onUpdate:modelValue"]))), 128)),
|
|
130
|
+
(r(!0), g(j, null, C(e.permissions, (n) => (r(), _(t(be), {
|
|
131
|
+
key: n.id,
|
|
132
|
+
label: t(u).permissionLabel(n.id),
|
|
133
|
+
hint: S(n),
|
|
134
|
+
"model-value": n.id in c.grants,
|
|
135
|
+
disabled: c.readonly,
|
|
136
|
+
"onUpdate:modelValue": (h) => z(n.id, !!h)
|
|
137
|
+
}, Y({ _: 2 }, [
|
|
138
|
+
n.sensitive || n.system || n.organizationOnly ? {
|
|
139
|
+
name: "before",
|
|
140
|
+
fn: p(() => [
|
|
141
|
+
n.sensitive ? (r(), _(t(E), {
|
|
142
|
+
key: 0,
|
|
143
|
+
tone: "warning"
|
|
144
|
+
}, {
|
|
145
|
+
default: p(() => [
|
|
146
|
+
x(f(t(d)("core.access.sensitive")), 1)
|
|
147
|
+
]),
|
|
148
|
+
_: 1
|
|
149
|
+
})) : V("", !0),
|
|
150
|
+
n.system ? (r(), _(t(E), {
|
|
151
|
+
key: 1,
|
|
152
|
+
tone: "neutral"
|
|
153
|
+
}, {
|
|
154
|
+
default: p(() => [
|
|
155
|
+
x(f(t(d)("core.access.system")), 1)
|
|
156
|
+
]),
|
|
157
|
+
_: 1
|
|
158
|
+
})) : n.organizationOnly ? (r(), _(t(E), {
|
|
159
|
+
key: 2,
|
|
160
|
+
tone: "info"
|
|
161
|
+
}, {
|
|
162
|
+
default: p(() => [
|
|
163
|
+
x(f(t(d)("core.access.organization_only")), 1)
|
|
164
|
+
]),
|
|
165
|
+
_: 1
|
|
166
|
+
})) : V("", !0)
|
|
167
|
+
]),
|
|
168
|
+
key: "0"
|
|
169
|
+
} : void 0
|
|
170
|
+
]), 1032, ["label", "hint", "model-value", "disabled", "onUpdate:modelValue"]))), 128))
|
|
171
|
+
]),
|
|
172
|
+
_: 2
|
|
173
|
+
}, 1032, ["header"]))), 128))
|
|
174
|
+
], 8, Ve)) : V("", !0)
|
|
175
|
+
]));
|
|
176
|
+
}
|
|
177
|
+
}), Ue = {
|
|
178
|
+
class: "flex min-w-0 flex-col gap-group-gap",
|
|
179
|
+
"data-test": "role-editor"
|
|
180
|
+
}, Ae = {
|
|
181
|
+
key: 0,
|
|
182
|
+
class: "flex flex-wrap gap-1.5 px-row-inset py-2",
|
|
183
|
+
"data-test": "role-attrs"
|
|
184
|
+
}, Ye = /* @__PURE__ */ D({
|
|
185
|
+
__name: "RoleEditor",
|
|
186
|
+
props: {
|
|
187
|
+
role: {},
|
|
188
|
+
source: {}
|
|
189
|
+
},
|
|
190
|
+
emits: ["saved"],
|
|
191
|
+
setup(y, { expose: c, emit: d }) {
|
|
192
|
+
const o = y, u = d, { t: l } = I(), v = G(), { catalogue: i, constraints: b } = W(), w = ue(), { access: B } = ge(), L = (a, s) => {
|
|
193
|
+
const e = a ?? s ?? null;
|
|
194
|
+
return {
|
|
195
|
+
name: a ? a.name : s ? l("core.access.copy_name", { name: v.roleName(s) }) : "",
|
|
196
|
+
description: e?.description ?? "",
|
|
197
|
+
grants: Object.fromEntries((e?.grants ?? []).map((n) => [n.permission, n.qualifier])),
|
|
198
|
+
constraints: ye(b, e?.attrs ?? [])
|
|
199
|
+
};
|
|
200
|
+
}, m = ee({
|
|
201
|
+
defaults: () => L(o.role, o.source),
|
|
202
|
+
validator: {
|
|
203
|
+
safeParse(a) {
|
|
204
|
+
const s = a, e = [
|
|
205
|
+
...s.name.trim() === "" ? [{ path: ["name"], message: l("core.access.name_required") }] : [],
|
|
206
|
+
...s.name.length > 100 ? [{ path: ["name"], message: l("core.access.too_long") }] : [],
|
|
207
|
+
...s.description.length > 255 ? [{ path: ["description"], message: l("core.access.too_long") }] : []
|
|
208
|
+
];
|
|
209
|
+
return e.length === 0 ? { success: !0, data: s } : { success: !1, error: { issues: e } };
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
failureMessage: de()
|
|
213
|
+
}), U = H([]);
|
|
214
|
+
function N() {
|
|
215
|
+
m.hydrate(L(o.role, o.source)), U.value = fe(i, m.values.grants);
|
|
216
|
+
}
|
|
217
|
+
N(), Z(() => [o.role, o.source], N);
|
|
218
|
+
const $ = k(() => o.role !== null && (o.role.predefined || o.role.computed) || !B.can(me.manageRoles)), S = k(
|
|
219
|
+
() => U.value.length === 0 || $.value ? "" : l("core.access.completed", { names: U.value.map((a) => v.permissionLabel(a)).join(", ") })
|
|
220
|
+
);
|
|
221
|
+
async function A() {
|
|
222
|
+
if ($.value) return;
|
|
223
|
+
const a = o.role ?? o.source, s = await m.submit(
|
|
224
|
+
(e) => {
|
|
225
|
+
const n = {
|
|
226
|
+
name: e.name.trim(),
|
|
227
|
+
description: e.description,
|
|
228
|
+
grants: Object.entries(e.grants).map(([h, J]) => ({ permission: h, qualifier: J })),
|
|
229
|
+
// The application's constraints are edited; any other attribute stays as the role has it.
|
|
230
|
+
attrs: he(b, a?.attrs ?? [], L(o.role, o.source).constraints, e.constraints)
|
|
231
|
+
};
|
|
232
|
+
return o.role ? w.update({ ref: o.role.ref, ...n }) : w.create(n);
|
|
233
|
+
},
|
|
234
|
+
{ hydrateFrom: (e) => L(e, null) }
|
|
235
|
+
);
|
|
236
|
+
(s.status === "saved" || s.status === "saved-refresh-failed") && (le.success(l("core.access.saved")), u("saved", s.value));
|
|
237
|
+
}
|
|
238
|
+
ne({ form: m, label: () => l("core.access.save"), allowed: () => !$.value, disabledWhileClean: () => o.role !== null, save: () => void A(), cancel: () => m.reset() });
|
|
239
|
+
const z = k(() => (o.role ?? o.source)?.attrs.filter((a) => !b.some((s) => s.attribute === a.attribute)) ?? []);
|
|
240
|
+
return c({ form: m, save: A }), (a, s) => (r(), _(t(te), {
|
|
241
|
+
form: t(m),
|
|
242
|
+
onSubmit: A
|
|
243
|
+
}, {
|
|
244
|
+
default: p(() => [
|
|
245
|
+
O("div", Ue, [
|
|
246
|
+
o.role?.computed ? (r(), _(t(R), {
|
|
247
|
+
key: 0,
|
|
248
|
+
tone: "info",
|
|
249
|
+
"data-test": "role-computed-note"
|
|
250
|
+
}, {
|
|
251
|
+
default: p(() => [
|
|
252
|
+
x(f(t(l)("core.access.notes.computed")), 1)
|
|
253
|
+
]),
|
|
254
|
+
_: 1
|
|
255
|
+
})) : o.role?.predefined ? (r(), _(t(R), {
|
|
256
|
+
key: 1,
|
|
257
|
+
tone: "info",
|
|
258
|
+
"data-test": "role-predefined-note"
|
|
259
|
+
}, {
|
|
260
|
+
default: p(() => [
|
|
261
|
+
x(f(t(l)("core.access.notes.predefined")), 1)
|
|
262
|
+
]),
|
|
263
|
+
_: 1
|
|
264
|
+
})) : V("", !0),
|
|
265
|
+
S.value ? (r(), _(t(R), {
|
|
266
|
+
key: 2,
|
|
267
|
+
tone: "warning",
|
|
268
|
+
"data-test": "role-completed-note"
|
|
269
|
+
}, {
|
|
270
|
+
default: p(() => [
|
|
271
|
+
x(f(S.value), 1)
|
|
272
|
+
]),
|
|
273
|
+
_: 1
|
|
274
|
+
})) : V("", !0),
|
|
275
|
+
q(t(Q), {
|
|
276
|
+
header: t(l)("core.access.groups.role"),
|
|
277
|
+
editable: !$.value,
|
|
278
|
+
"label-width": "12rem"
|
|
279
|
+
}, {
|
|
280
|
+
default: p(() => [
|
|
281
|
+
q(t(oe), F(t(m).bind("name"), {
|
|
282
|
+
label: t(l)("core.access.fields.name"),
|
|
283
|
+
"max-length": 100,
|
|
284
|
+
required: ""
|
|
285
|
+
}), null, 16, ["label"]),
|
|
286
|
+
q(t(se), F(t(m).bind("description"), {
|
|
287
|
+
label: t(l)("core.access.fields.description"),
|
|
288
|
+
rows: 2,
|
|
289
|
+
"max-length": 255
|
|
290
|
+
}), null, 16, ["label"]),
|
|
291
|
+
(r(!0), g(j, null, C(t(b), (e) => (r(), _(t(ae), {
|
|
292
|
+
key: e.attribute,
|
|
293
|
+
label: t(l)(e.labelKey),
|
|
294
|
+
"data-test": `role-constraint-${e.attribute}`,
|
|
295
|
+
"model-value": t(m).values.constraints[e.attribute] ?? "",
|
|
296
|
+
options: [{ value: "", label: t(l)(e.anyLabelKey ?? "core.access.constraints.any") }, ...e.options.map((n) => ({ value: n.value, label: t(l)(n.labelKey) }))],
|
|
297
|
+
"onUpdate:modelValue": (n) => t(m).values.constraints[e.attribute] = n
|
|
298
|
+
}, null, 8, ["label", "data-test", "model-value", "options", "onUpdate:modelValue"]))), 128)),
|
|
299
|
+
z.value.length ? (r(), g("div", Ae, [
|
|
300
|
+
(r(!0), g(j, null, C(z.value, (e) => (r(), _(t(E), {
|
|
301
|
+
key: e.attribute,
|
|
302
|
+
tone: "neutral"
|
|
303
|
+
}, {
|
|
304
|
+
default: p(() => [
|
|
305
|
+
x(f(e.attribute) + ": " + f(e.values.join(", ")), 1)
|
|
306
|
+
]),
|
|
307
|
+
_: 2
|
|
308
|
+
}, 1024))), 128))
|
|
309
|
+
])) : V("", !0)
|
|
310
|
+
]),
|
|
311
|
+
_: 1
|
|
312
|
+
}, 8, ["header", "editable"]),
|
|
313
|
+
q(Be, {
|
|
314
|
+
grants: t(m).values.grants,
|
|
315
|
+
readonly: $.value
|
|
316
|
+
}, null, 8, ["grants", "readonly"])
|
|
317
|
+
])
|
|
318
|
+
]),
|
|
319
|
+
_: 1
|
|
320
|
+
}, 8, ["form"]));
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
export {
|
|
324
|
+
Ye as _
|
|
325
|
+
};
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { defineComponent as I, computed as L, openBlock as a, createBlock as b, unref as e, withCtx as c, createElementVNode as S, createVNode as f, mergeProps as Y, useTemplateRef as F, ref as P, createElementBlock as g, toDisplayString as N, Fragment as D, createCommentVNode as x, renderList as q, createTextVNode as G } from "vue";
|
|
2
|
+
import { useI18n as K } from "vue-i18n";
|
|
3
|
+
import { useRouter as Z } from "vue-router";
|
|
4
|
+
import { _ as ee } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
|
|
5
|
+
import { _ as C } from "./FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js";
|
|
6
|
+
import { g as z } from "./options-g8RwEhBk.js";
|
|
7
|
+
import { _ as oe } from "./AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
|
|
8
|
+
import { t as E } from "./toast-CqSDTWRX.js";
|
|
9
|
+
import { _ as te } from "./RecordHeader.vue_vue_type_script_setup_true_lang-fmx0f8xi.js";
|
|
10
|
+
import { u as ae } from "./platform-Dx6STiwY.js";
|
|
11
|
+
import { a as le, u as se } from "./routeResource-CcYA75T2.js";
|
|
12
|
+
import { a as re } from "./ResourcePage.vue_vue_type_script_setup_true_lang-BFBGvevP.js";
|
|
13
|
+
import { _ as ce } from "./AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js";
|
|
14
|
+
import { _ as H } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
15
|
+
import { u as O, a as U, f as ne, i as ie, d as ue, b as M, c as T } from "./index-VPzJJN6Z.js";
|
|
16
|
+
import { _ as J } from "./SelectField.vue_vue_type_script_setup_true_lang-BzQC1qDQ.js";
|
|
17
|
+
import { u as me, _ as pe } from "./useCommand-CtqheKUv.js";
|
|
18
|
+
import { _ as de } from "./Modal.vue_vue_type_script_setup_true_lang-DpBb8ans.js";
|
|
19
|
+
import { _ as fe } from "./RoleEditor.vue_vue_type_script_setup_true_lang-BqqilJGF.js";
|
|
20
|
+
const _e = { "data-test": "role-replace" }, ve = /* @__PURE__ */ I({
|
|
21
|
+
__name: "ReplaceRoleDialog",
|
|
22
|
+
props: {
|
|
23
|
+
role: {},
|
|
24
|
+
others: {}
|
|
25
|
+
},
|
|
26
|
+
emits: ["replaced"],
|
|
27
|
+
setup(j, { expose: s, emit: y }) {
|
|
28
|
+
const l = j, n = y, { t: _ } = K(), w = O(), m = U(), p = me({
|
|
29
|
+
defaults: () => ({ with: null }),
|
|
30
|
+
validator: {
|
|
31
|
+
safeParse: (i) => i.with ? { success: !0, data: { with: i.with } } : { success: !1, error: { issues: [{ path: ["with"], message: _("core.access.replace.choose") }] } }
|
|
32
|
+
},
|
|
33
|
+
failureMessage: ne(),
|
|
34
|
+
run: (i) => m.replace(l.role.ref, i.with),
|
|
35
|
+
done: (i) => {
|
|
36
|
+
E.success(_("core.access.replace.done", { count: i })), n("replaced", i);
|
|
37
|
+
}
|
|
38
|
+
}), h = L(() => l.others.map((i) => ({ value: i.ref, label: w.roleName(i) })));
|
|
39
|
+
return s({ present: () => p.present() }), (i, B) => (a(), b(e(pe), {
|
|
40
|
+
command: e(p),
|
|
41
|
+
title: e(_)("core.access.replace.title"),
|
|
42
|
+
subtitle: e(w).roleName(l.role),
|
|
43
|
+
size: "md",
|
|
44
|
+
"confirm-label": e(_)("core.access.replace.confirm"),
|
|
45
|
+
message: e(_)("core.access.replace.moves", { count: l.role.holders })
|
|
46
|
+
}, {
|
|
47
|
+
default: c(() => [
|
|
48
|
+
S("div", _e, [
|
|
49
|
+
f(e(C), {
|
|
50
|
+
footer: e(_)("core.access.replace.footer")
|
|
51
|
+
}, {
|
|
52
|
+
default: c(() => [
|
|
53
|
+
f(e(J), Y(e(p).form.bind("with"), {
|
|
54
|
+
label: e(_)("core.access.replace.with"),
|
|
55
|
+
options: h.value
|
|
56
|
+
}), null, 16, ["label", "options"])
|
|
57
|
+
]),
|
|
58
|
+
_: 1
|
|
59
|
+
}, 8, ["footer"])
|
|
60
|
+
])
|
|
61
|
+
]),
|
|
62
|
+
_: 1
|
|
63
|
+
}, 8, ["command", "title", "subtitle", "confirm-label", "message"]));
|
|
64
|
+
}
|
|
65
|
+
}), he = {
|
|
66
|
+
class: "flex flex-col gap-group-gap",
|
|
67
|
+
"data-test": "role-compare"
|
|
68
|
+
}, be = {
|
|
69
|
+
key: 0,
|
|
70
|
+
class: "px-row-inset text-body text-content-muted",
|
|
71
|
+
"data-test": "compare-loading"
|
|
72
|
+
}, ge = {
|
|
73
|
+
key: 1,
|
|
74
|
+
class: "px-row-inset text-body text-content-destructive",
|
|
75
|
+
role: "alert",
|
|
76
|
+
"data-test": "compare-failed"
|
|
77
|
+
}, ye = {
|
|
78
|
+
key: 0,
|
|
79
|
+
class: "px-row-inset text-body text-content-muted",
|
|
80
|
+
"data-test": "compare-identical"
|
|
81
|
+
}, ke = /* @__PURE__ */ I({
|
|
82
|
+
__name: "RoleCompareDialog",
|
|
83
|
+
props: {
|
|
84
|
+
role: {},
|
|
85
|
+
others: {}
|
|
86
|
+
},
|
|
87
|
+
setup(j, { expose: s }) {
|
|
88
|
+
const y = j, { t: l } = K(), n = O(), _ = U(), w = F("modal"), m = P(null), t = P(null), p = P(!1), h = P(!1), i = L(() => y.others.map((d) => ({ value: d.ref, label: n.roleName(d) }))), B = L(() => t.value !== null && !t.value.only_in_role.length && !t.value.only_in_other.length && !t.value.different.length);
|
|
89
|
+
async function V(d) {
|
|
90
|
+
if (m.value = d, t.value = null, h.value = !1, p.value = !1, !!d) {
|
|
91
|
+
p.value = !0;
|
|
92
|
+
try {
|
|
93
|
+
const k = await _.compare(y.role.ref, d);
|
|
94
|
+
m.value === d && (t.value = k);
|
|
95
|
+
} catch {
|
|
96
|
+
m.value === d && (h.value = !0);
|
|
97
|
+
} finally {
|
|
98
|
+
m.value === d && (p.value = !1);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function A() {
|
|
103
|
+
m.value = null, t.value = null, h.value = !1, w.value?.present();
|
|
104
|
+
}
|
|
105
|
+
return s({ present: A }), (d, k) => (a(), b(e(de), {
|
|
106
|
+
ref_key: "modal",
|
|
107
|
+
ref: w,
|
|
108
|
+
title: e(l)("core.access.compare.title"),
|
|
109
|
+
subtitle: e(n).roleName(y.role),
|
|
110
|
+
size: "lg",
|
|
111
|
+
grouped: "",
|
|
112
|
+
"without-footer": ""
|
|
113
|
+
}, {
|
|
114
|
+
default: c(() => [
|
|
115
|
+
S("div", he, [
|
|
116
|
+
f(e(C), {
|
|
117
|
+
footer: e(l)("core.access.compare.footer")
|
|
118
|
+
}, {
|
|
119
|
+
default: c(() => [
|
|
120
|
+
f(e(J), {
|
|
121
|
+
"model-value": m.value,
|
|
122
|
+
label: e(l)("core.access.compare.with"),
|
|
123
|
+
options: i.value,
|
|
124
|
+
"onUpdate:modelValue": k[0] || (k[0] = (u) => V(u))
|
|
125
|
+
}, null, 8, ["model-value", "label", "options"])
|
|
126
|
+
]),
|
|
127
|
+
_: 1
|
|
128
|
+
}, 8, ["footer"]),
|
|
129
|
+
p.value ? (a(), g("p", be, N(e(l)("core.access.compare.loading")), 1)) : h.value ? (a(), g("p", ge, N(e(l)("core.access.compare.failed")), 1)) : t.value ? (a(), g(D, { key: 2 }, [
|
|
130
|
+
B.value ? (a(), g("p", ye, N(e(l)("core.access.compare.identical")), 1)) : x("", !0),
|
|
131
|
+
t.value.only_in_role.length ? (a(), b(e(C), {
|
|
132
|
+
key: 1,
|
|
133
|
+
header: e(l)("core.access.compare.only_in_role", { count: t.value.only_in_role.length })
|
|
134
|
+
}, {
|
|
135
|
+
default: c(() => [
|
|
136
|
+
(a(!0), g(D, null, q(t.value.only_in_role, (u) => (a(), b(e(z), {
|
|
137
|
+
key: u.permission,
|
|
138
|
+
layout: "setting",
|
|
139
|
+
label: e(n).permissionLabel(u.permission)
|
|
140
|
+
}, null, 8, ["label"]))), 128))
|
|
141
|
+
]),
|
|
142
|
+
_: 1
|
|
143
|
+
}, 8, ["header"])) : x("", !0),
|
|
144
|
+
t.value.only_in_other.length ? (a(), b(e(C), {
|
|
145
|
+
key: 2,
|
|
146
|
+
header: e(l)("core.access.compare.only_in_other", { count: t.value.only_in_other.length })
|
|
147
|
+
}, {
|
|
148
|
+
default: c(() => [
|
|
149
|
+
(a(!0), g(D, null, q(t.value.only_in_other, (u) => (a(), b(e(z), {
|
|
150
|
+
key: u.permission,
|
|
151
|
+
layout: "setting",
|
|
152
|
+
label: e(n).permissionLabel(u.permission)
|
|
153
|
+
}, null, 8, ["label"]))), 128))
|
|
154
|
+
]),
|
|
155
|
+
_: 1
|
|
156
|
+
}, 8, ["header"])) : x("", !0),
|
|
157
|
+
t.value.different.length ? (a(), b(e(C), {
|
|
158
|
+
key: 3,
|
|
159
|
+
header: e(l)("core.access.compare.different", { count: t.value.different.length })
|
|
160
|
+
}, {
|
|
161
|
+
default: c(() => [
|
|
162
|
+
(a(!0), g(D, null, q(t.value.different, (u) => (a(), b(e(z), {
|
|
163
|
+
key: u.permission,
|
|
164
|
+
layout: "setting",
|
|
165
|
+
label: e(n).permissionLabel(u.permission),
|
|
166
|
+
value: e(l)("core.access.compare.whose", { role: e(n).qualifierLabel(u.role), other: e(n).qualifierLabel(u.other) })
|
|
167
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
168
|
+
]),
|
|
169
|
+
_: 1
|
|
170
|
+
}, 8, ["header"])) : x("", !0)
|
|
171
|
+
], 64)) : x("", !0)
|
|
172
|
+
])
|
|
173
|
+
]),
|
|
174
|
+
_: 1
|
|
175
|
+
}, 8, ["title", "subtitle"]));
|
|
176
|
+
}
|
|
177
|
+
}), we = { "data-test": "role-holders" }, xe = { class: "flex min-w-0 flex-col gap-group-gap" }, Ke = /* @__PURE__ */ I({
|
|
178
|
+
__name: "RolePage",
|
|
179
|
+
setup(j) {
|
|
180
|
+
const { t: s } = K(), y = Z(), { access: l } = ae(), n = O(), _ = ie(), { subjectRoute: w } = ue(), m = U(), t = le({ param: "ref", parse: (o) => o === "" ? null : o, identify: (o) => o.ref, load: (o, { signal: r }) => m.role(o, { signal: r }) }), p = se({ for: t, load: (o, { signal: r }) => m.holders(o, { signal: r }) }), h = P([]), i = L(() => h.value.filter((o) => o.ref !== t.data.value?.ref)), B = L(() => h.value.filter((o) => o.predefined)), V = F("compareDialog"), A = F("replaceDialog"), d = F("deleteDialog"), k = (o) => !o.predefined && !o.computed;
|
|
181
|
+
async function u(o) {
|
|
182
|
+
if (h.value.length === 0)
|
|
183
|
+
try {
|
|
184
|
+
h.value = await m.roles();
|
|
185
|
+
} catch (r) {
|
|
186
|
+
E.error(_(r));
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
o();
|
|
190
|
+
}
|
|
191
|
+
const Q = L(() => {
|
|
192
|
+
const o = t.data.value;
|
|
193
|
+
if (!o) return [];
|
|
194
|
+
const r = [];
|
|
195
|
+
return l.can(M.manageRoles) && r.push({ id: "copy", label: s("core.access.copy"), icon: "copy", placement: "secondary", onClick: () => void y.push({ ...T.newRole, query: { copy: o.ref } }) }), r.push({ id: "compare", label: s("core.access.compare.action"), icon: "swapBoxLine", placement: "overflow", onClick: () => void u(() => V.value?.present()) }), k(o) && l.can(M.manageRoles) && r.push({ id: "replace", label: s("core.access.replace.action"), icon: "refreshLine", placement: "overflow", onClick: () => void u(() => A.value?.present()) }), k(o) && l.can(M.deleteRoles) && r.push({ id: "delete", label: s("core.access.delete.action"), icon: "deleteBin2Line", placement: "overflow", tone: "critical", onClick: () => d.value?.present(o) }), r;
|
|
196
|
+
});
|
|
197
|
+
async function W(o) {
|
|
198
|
+
await m.remove(o.ref), E.success(s("core.access.deleted")), await y.replace(T.roles);
|
|
199
|
+
}
|
|
200
|
+
const X = (o) => E.error(_(o, { fallback: s("core.access.delete.failed") }));
|
|
201
|
+
return (o, r) => (a(), b(e(re), {
|
|
202
|
+
resource: e(t),
|
|
203
|
+
title: e(t).data.value ? e(n).roleName(e(t).data.value) : "",
|
|
204
|
+
back: { label: e(s)("core.access.title"), to: e(T).roles },
|
|
205
|
+
actions: Q.value
|
|
206
|
+
}, {
|
|
207
|
+
header: c(({ record: v }) => [
|
|
208
|
+
f(e(te), {
|
|
209
|
+
title: e(n).roleName(v),
|
|
210
|
+
subtitle: v.description
|
|
211
|
+
}, {
|
|
212
|
+
leading: c(() => [
|
|
213
|
+
f(e(ee), {
|
|
214
|
+
tone: v.predefined ? "anchor" : "brand",
|
|
215
|
+
icon: "shieldStarFill",
|
|
216
|
+
size: "lg"
|
|
217
|
+
}, null, 8, ["tone"])
|
|
218
|
+
]),
|
|
219
|
+
meta: c(() => [
|
|
220
|
+
f(e(H), {
|
|
221
|
+
tone: v.predefined ? "neutral" : "info"
|
|
222
|
+
}, {
|
|
223
|
+
default: c(() => [
|
|
224
|
+
G(N(e(n).roleKind(v)), 1)
|
|
225
|
+
]),
|
|
226
|
+
_: 2
|
|
227
|
+
}, 1032, ["tone"]),
|
|
228
|
+
S("span", we, N(e(s)("core.access.holders_count", { count: v.holders })), 1)
|
|
229
|
+
]),
|
|
230
|
+
_: 2
|
|
231
|
+
}, 1032, ["title", "subtitle"])
|
|
232
|
+
]),
|
|
233
|
+
default: c(({ record: v }) => [
|
|
234
|
+
S("div", xe, [
|
|
235
|
+
f(fe, {
|
|
236
|
+
role: v,
|
|
237
|
+
onSaved: r[0] || (r[0] = ($) => {
|
|
238
|
+
e(t).update($), e(p).reload();
|
|
239
|
+
})
|
|
240
|
+
}, null, 8, ["role"]),
|
|
241
|
+
f(e(ce), {
|
|
242
|
+
state: e(p).state.value,
|
|
243
|
+
"skeleton-rows": 3,
|
|
244
|
+
"is-empty": () => !1,
|
|
245
|
+
onRetry: r[1] || (r[1] = ($) => e(p).reload())
|
|
246
|
+
}, {
|
|
247
|
+
default: c(({ value: $ }) => [
|
|
248
|
+
f(e(C), {
|
|
249
|
+
header: e(s)("core.access.holders.title"),
|
|
250
|
+
footer: $.length ? void 0 : e(s)("core.access.holders.empty")
|
|
251
|
+
}, {
|
|
252
|
+
default: c(() => [
|
|
253
|
+
(a(!0), g(D, null, q($, (R) => (a(), b(e(z), {
|
|
254
|
+
key: `${R.subject.kind}-${R.subject.id}`,
|
|
255
|
+
layout: "setting",
|
|
256
|
+
label: R.name,
|
|
257
|
+
sub: e(n).scopeLabel(R.scope),
|
|
258
|
+
to: e(w)(R.subject) ?? void 0
|
|
259
|
+
}, {
|
|
260
|
+
default: c(() => [
|
|
261
|
+
R.subject.kind === "service" ? (a(), b(e(H), {
|
|
262
|
+
key: 0,
|
|
263
|
+
tone: "neutral"
|
|
264
|
+
}, {
|
|
265
|
+
default: c(() => [
|
|
266
|
+
G(N(e(s)("core.access.holders.service")), 1)
|
|
267
|
+
]),
|
|
268
|
+
_: 1
|
|
269
|
+
})) : x("", !0)
|
|
270
|
+
]),
|
|
271
|
+
_: 2
|
|
272
|
+
}, 1032, ["label", "sub", "to"]))), 128))
|
|
273
|
+
]),
|
|
274
|
+
_: 2
|
|
275
|
+
}, 1032, ["header", "footer"])
|
|
276
|
+
]),
|
|
277
|
+
_: 1
|
|
278
|
+
}, 8, ["state"]),
|
|
279
|
+
f(ke, {
|
|
280
|
+
ref_key: "compareDialog",
|
|
281
|
+
ref: V,
|
|
282
|
+
role: v,
|
|
283
|
+
others: i.value
|
|
284
|
+
}, null, 8, ["role", "others"]),
|
|
285
|
+
k(v) ? (a(), g(D, { key: 0 }, [
|
|
286
|
+
f(ve, {
|
|
287
|
+
ref_key: "replaceDialog",
|
|
288
|
+
ref: A,
|
|
289
|
+
role: v,
|
|
290
|
+
others: B.value,
|
|
291
|
+
onReplaced: r[2] || (r[2] = ($) => {
|
|
292
|
+
e(t).reload(), e(p).reload();
|
|
293
|
+
})
|
|
294
|
+
}, null, 8, ["role", "others"]),
|
|
295
|
+
f(e(oe), {
|
|
296
|
+
ref_key: "deleteDialog",
|
|
297
|
+
ref: d,
|
|
298
|
+
tone: "critical",
|
|
299
|
+
title: e(s)("core.access.delete.title"),
|
|
300
|
+
message: e(s)("core.access.delete.body", { name: e(n).roleName(v) }),
|
|
301
|
+
"confirm-label": e(s)("core.access.delete.action"),
|
|
302
|
+
action: W,
|
|
303
|
+
onFailed: X
|
|
304
|
+
}, null, 8, ["title", "message", "confirm-label"])
|
|
305
|
+
], 64)) : x("", !0)
|
|
306
|
+
])
|
|
307
|
+
]),
|
|
308
|
+
_: 1
|
|
309
|
+
}, 8, ["resource", "title", "back", "actions"]));
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
export {
|
|
313
|
+
Ke as default
|
|
314
|
+
};
|
|
@@ -3,15 +3,15 @@ import { useI18n as A } from "vue-i18n";
|
|
|
3
3
|
import { useRouter as F } from "vue-router";
|
|
4
4
|
import { _ as S } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
|
|
5
5
|
import { _ as E } from "./Tabs.vue_vue_type_script_setup_true_lang-CcMcE38r.js";
|
|
6
|
-
import { _ as U } from "./FormGroup.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import {
|
|
8
|
-
import { _ as D } from "./TextField.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { _ as U } from "./FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js";
|
|
7
|
+
import { g as j } from "./options-g8RwEhBk.js";
|
|
8
|
+
import { _ as D } from "./TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js";
|
|
9
9
|
import { a as I } from "./AdaptivePageShell.vue_vue_type_script_setup_true_lang-GUTIXuNd.js";
|
|
10
|
-
import { u as K } from "./platform-
|
|
10
|
+
import { u as K } from "./platform-Dx6STiwY.js";
|
|
11
11
|
import { _ as T } from "./AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js";
|
|
12
12
|
import { _ as q } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
13
|
-
import { u as z } from "./useLoad-
|
|
14
|
-
import { u as G, a as H, b as J, c as x } from "./index-
|
|
13
|
+
import { u as z } from "./useLoad-W4tfxmm5.js";
|
|
14
|
+
import { u as G, a as H, b as J, c as x } from "./index-VPzJJN6Z.js";
|
|
15
15
|
const M = {
|
|
16
16
|
class: "flex min-w-0 flex-col gap-group-gap",
|
|
17
17
|
"data-test": "roles-index"
|
|
@@ -5,7 +5,7 @@ import { _ as q } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.
|
|
|
5
5
|
import { _ as G } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
6
6
|
import { a as re } from "./mediaQuery-CygcXmFW.js";
|
|
7
7
|
import { u as ie } from "./access-DmAceEo5.js";
|
|
8
|
-
import { u as ce, a as ue } from "./sections-
|
|
8
|
+
import { u as ce, a as ue } from "./sections-B0HxIOC2.js";
|
|
9
9
|
import { p as de } from "./AdaptivePageShell.vue_vue_type_script_setup_true_lang-GUTIXuNd.js";
|
|
10
10
|
import { p as me } from "./sectionIndex-BS0ic5W7.js";
|
|
11
11
|
import { _ as K, a as pe } from "./SectionList.vue_vue_type_script_setup_true_lang-wyW7n3Uq.js";
|