@archbase/security-ui 4.3.0 → 4.3.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/dist/UserModal.d.ts +11 -0
- package/dist/archbase-security-ui-4.3.1.tgz +0 -0
- package/dist/index.js +495 -481
- package/package.json +6 -6
- package/dist/archbase-security-ui-4.3.0.tgz +0 -0
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as e, jsxs as r, Fragment as
|
|
2
|
-
import { Modal as $e, ScrollArea as ue, Stack as U, Grid as W, Group as O, Button as X, Paper as re, Box as Y, Text as c, List as Me, Checkbox as ca, Tooltip as
|
|
3
|
-
import { getI18nextInstance as
|
|
4
|
-
import { ArchbaseEdit as le, ArchbaseNotifications as ne, ArchbasePasswordEdit as
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as xe } from "react/jsx-runtime";
|
|
2
|
+
import { Modal as $e, ScrollArea as ue, Stack as U, Grid as W, Group as O, Button as X, Paper as re, Box as Y, Text as c, List as Me, Checkbox as ca, Tooltip as Ie, ActionIcon as ye, Flex as Fe, Space as za, Input as Ce, useTree as da, useMantineColorScheme as qe, TextInput as he, Tree as ua, Badge as j, Tabs as we, RingProgress as Xa, SimpleGrid as We, Table as m, Drawer as _a, Loader as se, Alert as ce, Pagination as Ia, CloseButton as Ya, Chip as ha, Popover as Je, UnstyledButton as ze, Select as er } from "@mantine/core";
|
|
3
|
+
import { getI18nextInstance as f, resolveArchbasePasswordPolicy as ar, ARCHBASE_IOC_API_TYPE as K, emit as Ue, builder as Ne, validateArchbasePassword as rr, convertDateToISOString as tr, processErrorMessage as Te, getKeyByEnumValue as Se, useArchbaseTheme as na, useArchbaseValidator as ir, useArchbaseTranslation as or, useValidationErrors as nr, processDetailErrorMessage as Ve } from "@archbase/core";
|
|
4
|
+
import { ArchbaseEdit as le, ArchbaseNotifications as ne, ArchbasePasswordEdit as lr, ArchbaseSelect as sr, ArchbaseCheckbox as Ae, ArchbaseAvatarEdit as cr, ArchbaseAsyncSelect as dr, Columns as Ee, ArchbaseDataGridColumn as L, ArchbaseDataGrid as ka, ArchbaseDialog as ve } from "@archbase/components";
|
|
5
5
|
import { useArchbaseV1V2Compatibility as Oe, useArchbaseDataSourceListener as pa, useArchbaseRemoteServiceApi as J, useArchbaseRemoteDataSource as ia, ArchbaseDataSource as ur, useArchbaseStore as Ea, useArchbaseRemoteDataSourceV2 as Pe, useArchbaseDataSource as hr } from "@archbase/data";
|
|
6
|
-
import { useState as
|
|
7
|
-
import { IconArrowRight as Pa, IconArrowLeft as Da, IconChevronDown as ma, IconBorderCornerSquare as ga, IconEye as mr, IconEdit as Fa, IconTrashX as
|
|
6
|
+
import { useState as S, useCallback as ae, useEffect as ee, forwardRef as pr, useMemo as ie, useRef as Re } from "react";
|
|
7
|
+
import { IconArrowRight as Pa, IconArrowLeft as Da, IconChevronDown as ma, IconBorderCornerSquare as ga, IconEye as mr, IconEdit as Fa, IconTrashX as la, IconShieldCheckered as gr, IconPlus as Na } from "@tabler/icons-react";
|
|
8
8
|
import { UserGroupDto as fa, SecurityType as _, UserDto as fr, GroupDto as br, ProfileDto as vr, ApiTokenDto as yr } from "@archbase/security";
|
|
9
9
|
import { DateTimePicker as Tr } from "@mantine/dates";
|
|
10
10
|
import { useFocusTrap as wr, useDebouncedValue as oa } from "@mantine/hooks";
|
|
11
|
-
import { ArchbaseSpaceFixed as
|
|
11
|
+
import { ArchbaseSpaceFixed as Sr, ArchbaseSpaceFill as xr, ArchbaseSpaceBottom as Cr } from "@archbase/layout";
|
|
12
12
|
const Ar = (a) => {
|
|
13
|
-
const t = { ...a.options ?? {} },
|
|
13
|
+
const t = { ...a.options ?? {} }, l = () => {
|
|
14
14
|
a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (u) => {
|
|
15
15
|
u && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), u);
|
|
16
16
|
}) : a.onClickOk(a.dataSource.getCurrentRecord(), !0);
|
|
@@ -22,7 +22,7 @@ const Ar = (a) => {
|
|
|
22
22
|
{
|
|
23
23
|
opened: a.opened,
|
|
24
24
|
onClose: n,
|
|
25
|
-
title:
|
|
25
|
+
title: f().t("archbase:Perfil"),
|
|
26
26
|
size: "60%",
|
|
27
27
|
styles: { content: { maxWidth: 1e3 } },
|
|
28
28
|
children: /* @__PURE__ */ e(ue, { style: { height: "460px" }, children: /* @__PURE__ */ r(U, { w: "98%", children: [
|
|
@@ -31,8 +31,8 @@ const Ar = (a) => {
|
|
|
31
31
|
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
|
|
32
32
|
le,
|
|
33
33
|
{
|
|
34
|
-
label: `${
|
|
35
|
-
placeholder: `${
|
|
34
|
+
label: `${f().t("archbase:Nome do perfil")}`,
|
|
35
|
+
placeholder: `${f().t("archbase:Informe o nome do perfil")}`,
|
|
36
36
|
dataSource: a.dataSource,
|
|
37
37
|
dataField: "name"
|
|
38
38
|
}
|
|
@@ -40,8 +40,8 @@ const Ar = (a) => {
|
|
|
40
40
|
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
|
|
41
41
|
le,
|
|
42
42
|
{
|
|
43
|
-
label: `${
|
|
44
|
-
placeholder: `${
|
|
43
|
+
label: `${f().t("archbase:Descrição do perfil")}`,
|
|
44
|
+
placeholder: `${f().t("archbase:Informe a descrição do perfil")}`,
|
|
45
45
|
dataSource: a.dataSource,
|
|
46
46
|
dataField: "description"
|
|
47
47
|
}
|
|
@@ -49,8 +49,8 @@ const Ar = (a) => {
|
|
|
49
49
|
] }),
|
|
50
50
|
t?.customContentAfter && t.customContentAfter(a.dataSource.getCurrentRecord()),
|
|
51
51
|
/* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
|
|
52
|
-
/* @__PURE__ */ e(X, { variant: "default", onClick: n, children:
|
|
53
|
-
/* @__PURE__ */ e(X, { onClick:
|
|
52
|
+
/* @__PURE__ */ e(X, { variant: "default", onClick: n, children: f().t("archbase:Cancelar") }),
|
|
53
|
+
/* @__PURE__ */ e(X, { onClick: l, children: f().t("archbase:Salvar") })
|
|
54
54
|
] })
|
|
55
55
|
] }) })
|
|
56
56
|
}
|
|
@@ -59,7 +59,7 @@ const Ar = (a) => {
|
|
|
59
59
|
function Rr({
|
|
60
60
|
availableItemsDS: a,
|
|
61
61
|
assignedItemsDS: t,
|
|
62
|
-
idFieldAvailable:
|
|
62
|
+
idFieldAvailable: l,
|
|
63
63
|
labelFieldAvailable: n,
|
|
64
64
|
idFieldAssigned: u,
|
|
65
65
|
labelFieldAssigned: d,
|
|
@@ -80,7 +80,7 @@ function Rr({
|
|
|
80
80
|
t,
|
|
81
81
|
void 0,
|
|
82
82
|
[]
|
|
83
|
-
), [
|
|
83
|
+
), [x, D] = S([]), [b, w] = S([]), [o, s] = S([]), [p, v] = S([]), $ = ae(() => {
|
|
84
84
|
a && D(a.browseRecords()), t && w(t.browseRecords());
|
|
85
85
|
}, [a, t]);
|
|
86
86
|
pa({
|
|
@@ -92,22 +92,22 @@ function Rr({
|
|
|
92
92
|
}), ee(() => {
|
|
93
93
|
$();
|
|
94
94
|
}, [$]);
|
|
95
|
-
const y = (F,
|
|
96
|
-
F((
|
|
97
|
-
},
|
|
95
|
+
const y = (F, C) => typeof C == "function" ? C(F) : F[C], i = (F, C) => typeof C == "function" ? C(F) : F[C], N = (F, C) => {
|
|
96
|
+
F((k) => k.includes(C) ? k.filter((oe) => oe !== C) : [...k, C]);
|
|
97
|
+
}, I = () => {
|
|
98
98
|
o.forEach((F) => {
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
R.isDataSourceV2 ? (t.insert(
|
|
99
|
+
const C = x.find((k) => y(k, l) === F);
|
|
100
|
+
if (C) {
|
|
101
|
+
const k = h(C);
|
|
102
|
+
R.isDataSourceV2 ? (t.insert(k), t.save()) : (t.insert(k), t.save(), R.v1State.forceUpdate());
|
|
103
103
|
}
|
|
104
|
-
}),
|
|
104
|
+
}), s([]);
|
|
105
105
|
}, M = () => {
|
|
106
106
|
p.forEach((F) => {
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
109
|
-
const
|
|
110
|
-
R.isDataSourceV2 ? t.remove(() => t.locate(
|
|
107
|
+
const C = b.find((k) => y(k, u) === F);
|
|
108
|
+
if (C) {
|
|
109
|
+
const k = typeof u == "function" ? { customId: u(C) } : { [u]: F };
|
|
110
|
+
R.isDataSourceV2 ? t.remove(() => t.locate(k)) : (t.remove(() => t.locate(k)), R.v1State.forceUpdate());
|
|
111
111
|
}
|
|
112
112
|
}), v([]);
|
|
113
113
|
};
|
|
@@ -127,23 +127,23 @@ function Rr({
|
|
|
127
127
|
overflowX: "hidden",
|
|
128
128
|
height: "calc(100% - 32px)"
|
|
129
129
|
},
|
|
130
|
-
children:
|
|
130
|
+
children: x.map((F) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
|
|
131
131
|
ca,
|
|
132
132
|
{
|
|
133
133
|
label: i(F, n),
|
|
134
|
-
checked: o.includes(y(F,
|
|
135
|
-
onChange: () => N(
|
|
136
|
-
disabled:
|
|
137
|
-
(
|
|
134
|
+
checked: o.includes(y(F, l)),
|
|
135
|
+
onChange: () => N(s, y(F, l)),
|
|
136
|
+
disabled: b.some(
|
|
137
|
+
(C) => y(C, u) === y(F, l)
|
|
138
138
|
)
|
|
139
139
|
}
|
|
140
|
-
) }, y(F,
|
|
140
|
+
) }, y(F, l)))
|
|
141
141
|
}
|
|
142
142
|
)
|
|
143
143
|
] }),
|
|
144
144
|
/* @__PURE__ */ r(U, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
|
|
145
|
-
/* @__PURE__ */ e(
|
|
146
|
-
/* @__PURE__ */ e(
|
|
145
|
+
/* @__PURE__ */ e(Ie, { label: "Adicionar", children: /* @__PURE__ */ e(ye, { onClick: I, disabled: !o.length, children: /* @__PURE__ */ e(Pa, {}) }) }),
|
|
146
|
+
/* @__PURE__ */ e(Ie, { label: "Remover", children: /* @__PURE__ */ e(ye, { onClick: M, disabled: !p.length, children: /* @__PURE__ */ e(Da, {}) }) })
|
|
147
147
|
] }),
|
|
148
148
|
/* @__PURE__ */ r(Y, { style: { minWidth: "44%", minHeight: z }, children: [
|
|
149
149
|
/* @__PURE__ */ e(c, { children: T }),
|
|
@@ -160,7 +160,7 @@ function Rr({
|
|
|
160
160
|
overflowX: "hidden",
|
|
161
161
|
height: "calc(100% - 32px)"
|
|
162
162
|
},
|
|
163
|
-
children:
|
|
163
|
+
children: b.map((F) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
|
|
164
164
|
ca,
|
|
165
165
|
{
|
|
166
166
|
label: i(F, d),
|
|
@@ -174,13 +174,15 @@ function Rr({
|
|
|
174
174
|
] });
|
|
175
175
|
}
|
|
176
176
|
const zr = pr(
|
|
177
|
-
({ image: a, label: t, description:
|
|
177
|
+
({ image: a, label: t, description: l, origin: n, ...u }, d) => /* @__PURE__ */ e("div", { ref: d, ...u, children: /* @__PURE__ */ r(Fe, { children: [
|
|
178
178
|
/* @__PURE__ */ e(c, { size: "sm", fw: 600, children: n ? n.name : "" }),
|
|
179
179
|
/* @__PURE__ */ e(za, { w: "lg" })
|
|
180
180
|
] }) })
|
|
181
|
-
),
|
|
181
|
+
), Ir = {
|
|
182
182
|
// Campos de identificação
|
|
183
183
|
showNickname: !0,
|
|
184
|
+
// Desligada por padrão: ver a justificativa em UserModalOptions.showEmployeeId.
|
|
185
|
+
showEmployeeId: !1,
|
|
184
186
|
// Campos de perfil e grupos
|
|
185
187
|
showProfile: !0,
|
|
186
188
|
showGroups: !0,
|
|
@@ -202,11 +204,11 @@ const zr = pr(
|
|
|
202
204
|
avatarImageQuality: 1,
|
|
203
205
|
avatarMaxOutputSizePx: 512,
|
|
204
206
|
allowEditEmail: !0
|
|
205
|
-
},
|
|
206
|
-
const [t,
|
|
207
|
-
const p = a.dataSource.getFieldValue(
|
|
208
|
-
return
|
|
209
|
-
}).filter((
|
|
207
|
+
}, kr = (a) => {
|
|
208
|
+
const [t, l] = S(""), n = { ...Ir, ...a.options ?? {} }, u = a.dataSource.getFieldValue("passwordChangedAt"), d = u ? new Date(u) : void 0, h = d && !Number.isNaN(d.getTime()) ? d.toLocaleString() : void 0, A = ar(n.passwordPolicy), z = n.forbidPersonalDataInPassword ? ["name", "nickname", "email"].map((s) => {
|
|
209
|
+
const p = a.dataSource.getFieldValue(s);
|
|
210
|
+
return s === "email" && p ? p.split("@")[0] : p;
|
|
211
|
+
}).filter((s) => typeof s == "string" && s.trim().length >= 3) : [], g = A ? {
|
|
210
212
|
...A,
|
|
211
213
|
blocklist: [...A.blocklist ?? [], ...z]
|
|
212
214
|
} : void 0, T = J(K.Group), { dataSource: R } = ia({
|
|
@@ -215,55 +217,55 @@ const zr = pr(
|
|
|
215
217
|
pageSize: 9999,
|
|
216
218
|
loadOnStart: !0,
|
|
217
219
|
sort: ["name:asc"],
|
|
218
|
-
onError: (
|
|
219
|
-
ne.showError(
|
|
220
|
+
onError: (s, p) => {
|
|
221
|
+
ne.showError(f().t("archbase:WARNING"), s, p);
|
|
220
222
|
}
|
|
221
223
|
});
|
|
222
224
|
console.log("versão 12/05/2026");
|
|
223
|
-
const
|
|
225
|
+
const x = J(K.Profile), { dataSource: D } = ia({
|
|
224
226
|
name: "dsProfiles",
|
|
225
|
-
service:
|
|
227
|
+
service: x,
|
|
226
228
|
pageSize: 9999,
|
|
227
229
|
loadOnStart: !0,
|
|
228
230
|
sort: ["name:asc"],
|
|
229
|
-
onError: (
|
|
230
|
-
ne.showError(
|
|
231
|
+
onError: (s, p) => {
|
|
232
|
+
ne.showError(f().t("archbase:WARNING"), s, p);
|
|
231
233
|
}
|
|
232
234
|
});
|
|
233
235
|
ee(() => {
|
|
234
|
-
|
|
236
|
+
l("");
|
|
235
237
|
}, [a.dataSource.getFieldValue("password")]);
|
|
236
|
-
const
|
|
238
|
+
const b = async () => {
|
|
237
239
|
if (a.dataSource.isInserting()) {
|
|
238
240
|
if (n.userDefaultProfile) {
|
|
239
|
-
const
|
|
241
|
+
const s = Ue(Ne.eq("name", n.userDefaultProfile)), p = await x.findAllWithFilter(s, 0, 1);
|
|
240
242
|
p && p.content.length > 0 && a.dataSource.setFieldValue("profile", p.content[0]);
|
|
241
243
|
}
|
|
242
244
|
if (n.userDefaultGroups) {
|
|
243
|
-
const
|
|
245
|
+
const s = Ue(Ne.in("name", n.userDefaultGroups)), p = await T.findAllWithFilter(s, 0, 500);
|
|
244
246
|
p && p.content.length > 0 && a.dataSource.setFieldValue("groups", p.content.map((v) => fa.newInstance(v)));
|
|
245
247
|
}
|
|
246
248
|
}
|
|
247
249
|
};
|
|
248
250
|
ee(() => {
|
|
249
|
-
a.opened &&
|
|
251
|
+
a.opened && b();
|
|
250
252
|
}, [a.opened]);
|
|
251
253
|
const w = () => {
|
|
252
|
-
const
|
|
253
|
-
if (!
|
|
254
|
-
|
|
254
|
+
const s = a.dataSource.getCurrentRecord();
|
|
255
|
+
if (!s.password && a.dataSource.isInserting()) {
|
|
256
|
+
l(f().t("archbase:Informe a senha"));
|
|
255
257
|
return;
|
|
256
258
|
}
|
|
257
|
-
if (g &&
|
|
258
|
-
const p = rr(
|
|
259
|
+
if (g && s.password) {
|
|
260
|
+
const p = rr(s.password, g);
|
|
259
261
|
if (!p.valid) {
|
|
260
|
-
|
|
262
|
+
l(p.error);
|
|
261
263
|
return;
|
|
262
264
|
}
|
|
263
265
|
}
|
|
264
|
-
a.onCustomSave ? a.onCustomSave(
|
|
265
|
-
p && a.onAfterSave && a.onAfterSave(
|
|
266
|
-
}) : a.onClickOk(
|
|
266
|
+
a.onCustomSave ? a.onCustomSave(s, (p) => {
|
|
267
|
+
p && a.onAfterSave && a.onAfterSave(s), a.onClickOk(s, p);
|
|
268
|
+
}) : a.onClickOk(s, !0);
|
|
267
269
|
}, o = () => {
|
|
268
270
|
a.onClickCancel(a.dataSource.getCurrentRecord());
|
|
269
271
|
};
|
|
@@ -272,19 +274,19 @@ const zr = pr(
|
|
|
272
274
|
{
|
|
273
275
|
opened: a.opened,
|
|
274
276
|
onClose: o,
|
|
275
|
-
title:
|
|
277
|
+
title: f().t("archbase:Usuário"),
|
|
276
278
|
size: "80%",
|
|
277
279
|
styles: { content: { maxWidth: 1e3 } },
|
|
278
280
|
children: [
|
|
279
281
|
/* @__PURE__ */ e(ue, { style: { height: "500px" }, children: /* @__PURE__ */ r(U, { w: "98%", children: [
|
|
280
|
-
n?.customContentBefore && /* @__PURE__ */ e(
|
|
282
|
+
n?.customContentBefore && /* @__PURE__ */ e(xe, { children: n.customContentBefore(a.dataSource.getCurrentRecord()) }),
|
|
281
283
|
/* @__PURE__ */ r(W, { children: [
|
|
282
284
|
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ r(O, { children: [
|
|
283
285
|
/* @__PURE__ */ e(
|
|
284
286
|
le,
|
|
285
287
|
{
|
|
286
|
-
label: `${
|
|
287
|
-
placeholder: `${
|
|
288
|
+
label: `${f().t("archbase:Nome completo")}`,
|
|
289
|
+
placeholder: `${f().t("archbase:Informe o nome completo do usuário")}`,
|
|
288
290
|
dataSource: a.dataSource,
|
|
289
291
|
dataField: "name",
|
|
290
292
|
required: !0,
|
|
@@ -294,42 +296,54 @@ const zr = pr(
|
|
|
294
296
|
n.showNickname && /* @__PURE__ */ e(
|
|
295
297
|
le,
|
|
296
298
|
{
|
|
297
|
-
label: `${
|
|
298
|
-
placeholder: `${
|
|
299
|
+
label: `${f().t("archbase:Apelido")}`,
|
|
300
|
+
placeholder: `${f().t("archbase:Apelido")}`,
|
|
299
301
|
dataSource: a.dataSource,
|
|
300
302
|
dataField: "nickname",
|
|
301
303
|
required: n.requiredNickname
|
|
302
304
|
}
|
|
303
305
|
)
|
|
304
306
|
] }) }),
|
|
305
|
-
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
307
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ r(O, { children: [
|
|
308
|
+
/* @__PURE__ */ e(
|
|
309
|
+
le,
|
|
310
|
+
{
|
|
311
|
+
label: `${f().t("archbase:Descrição do usuário")}`,
|
|
312
|
+
placeholder: `${f().t("archbase:Informe a descrição do usuário")}`,
|
|
313
|
+
dataSource: a.dataSource,
|
|
314
|
+
dataField: "description",
|
|
315
|
+
required: !0,
|
|
316
|
+
width: n.showEmployeeId ? "calc(100% - 208px)" : void 0
|
|
317
|
+
}
|
|
318
|
+
),
|
|
319
|
+
n.showEmployeeId && /* @__PURE__ */ e(
|
|
320
|
+
le,
|
|
321
|
+
{
|
|
322
|
+
label: `${f().t("archbase:Matrícula")}`,
|
|
323
|
+
placeholder: `${f().t("archbase:Matrícula do funcionário")}`,
|
|
324
|
+
dataSource: a.dataSource,
|
|
325
|
+
dataField: "employeeId"
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
] }) })
|
|
315
329
|
] }),
|
|
316
330
|
/* @__PURE__ */ r(W, { children: [
|
|
317
331
|
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
|
|
318
332
|
le,
|
|
319
333
|
{
|
|
320
|
-
label: `${
|
|
321
|
-
placeholder: `${
|
|
334
|
+
label: `${f().t("archbase:E-mail")}`,
|
|
335
|
+
placeholder: `${f().t("archbase:Informe o e-mail do usuário")}`,
|
|
322
336
|
dataSource: a.dataSource,
|
|
323
|
-
onChangeValue: (
|
|
337
|
+
onChangeValue: (s) => a.dataSource.setFieldValue("userName", s),
|
|
324
338
|
dataField: "email",
|
|
325
339
|
readOnly: a.dataSource.isEditing() ? !n.allowEditEmail : !1,
|
|
326
340
|
required: !0
|
|
327
341
|
}
|
|
328
342
|
) }),
|
|
329
343
|
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
|
|
330
|
-
|
|
344
|
+
lr,
|
|
331
345
|
{
|
|
332
|
-
label: `${
|
|
346
|
+
label: `${f().t("archbase:Senha usuário")}`,
|
|
333
347
|
dataSource: a.dataSource,
|
|
334
348
|
dataField: "password",
|
|
335
349
|
error: t,
|
|
@@ -340,83 +354,83 @@ const zr = pr(
|
|
|
340
354
|
) })
|
|
341
355
|
] }),
|
|
342
356
|
/* @__PURE__ */ e(W, { children: n.showProfile && /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
|
|
343
|
-
|
|
357
|
+
sr,
|
|
344
358
|
{
|
|
345
|
-
label: `${
|
|
359
|
+
label: `${f().t("archbase:Perfil do usuário")}`,
|
|
346
360
|
dataSource: a.dataSource,
|
|
347
361
|
dataField: "profile",
|
|
348
362
|
options: D,
|
|
349
363
|
allowDeselect: !0,
|
|
350
364
|
optionsLabelField: "nome",
|
|
351
365
|
itemComponent: zr,
|
|
352
|
-
getOptionLabel: (
|
|
353
|
-
getOptionValue: (
|
|
366
|
+
getOptionLabel: (s) => s.name,
|
|
367
|
+
getOptionValue: (s) => s.id
|
|
354
368
|
}
|
|
355
369
|
) }) }),
|
|
356
370
|
/* @__PURE__ */ r(W, { children: [
|
|
357
371
|
/* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: n.showAccountConfigLabel && /* @__PURE__ */ e(c, { fz: 14, fw: 500, children: "Informe" }) }),
|
|
358
372
|
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(U, { gap: "lg", children: [
|
|
359
|
-
n.showChangePasswordOnNextLogin && /* @__PURE__ */ e(
|
|
373
|
+
n.showChangePasswordOnNextLogin && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
|
|
360
374
|
Ae,
|
|
361
375
|
{
|
|
362
376
|
dataSource: a.dataSource,
|
|
363
377
|
dataField: "changePasswordOnNextLogin",
|
|
364
|
-
label: `${
|
|
378
|
+
label: `${f().t("archbase:Deve alterar senha próximo login ?")}`
|
|
365
379
|
}
|
|
366
380
|
) }),
|
|
367
|
-
n.showAllowPasswordChange && /* @__PURE__ */ e(
|
|
381
|
+
n.showAllowPasswordChange && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
|
|
368
382
|
Ae,
|
|
369
383
|
{
|
|
370
384
|
dataSource: a.dataSource,
|
|
371
385
|
dataField: "allowPasswordChange",
|
|
372
|
-
label: `${
|
|
386
|
+
label: `${f().t("archbase:Pode alterar a senha ?")}`
|
|
373
387
|
}
|
|
374
388
|
) }),
|
|
375
|
-
n.showPasswordNeverExpires && /* @__PURE__ */ r(
|
|
389
|
+
n.showPasswordNeverExpires && /* @__PURE__ */ r(Ce.Wrapper, { label: "", children: [
|
|
376
390
|
/* @__PURE__ */ e(
|
|
377
391
|
Ae,
|
|
378
392
|
{
|
|
379
393
|
dataSource: a.dataSource,
|
|
380
394
|
dataField: "passwordNeverExpires",
|
|
381
|
-
label: `${
|
|
395
|
+
label: `${f().t("archbase:Senha nunca expira ?")}`
|
|
382
396
|
}
|
|
383
397
|
),
|
|
384
|
-
/* @__PURE__ */ e(c, { fz: 12, c: "dimmed", children:
|
|
398
|
+
/* @__PURE__ */ e(c, { fz: 12, c: "dimmed", children: f().t(
|
|
385
399
|
'archbase:Desmarcado, a senha expira conforme a política de validade do servidor. Para exigir a troca agora, use "Deve alterar senha próximo login".'
|
|
386
400
|
) })
|
|
387
401
|
] }),
|
|
388
|
-
n.showPasswordChangedAt && h && /* @__PURE__ */ e(c, { fz: 12, c: "dimmed", children: `${
|
|
402
|
+
n.showPasswordChangedAt && h && /* @__PURE__ */ e(c, { fz: 12, c: "dimmed", children: `${f().t("archbase:Última troca de senha")}: ${h}` })
|
|
389
403
|
] }) }),
|
|
390
404
|
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(U, { gap: "lg", children: [
|
|
391
|
-
n.showAccountDeactivated && /* @__PURE__ */ e(
|
|
405
|
+
n.showAccountDeactivated && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
|
|
392
406
|
Ae,
|
|
393
407
|
{
|
|
394
408
|
dataSource: a.dataSource,
|
|
395
409
|
dataField: "accountDeactivated",
|
|
396
|
-
label: `${
|
|
410
|
+
label: `${f().t("archbase:Conta desativada ?")}`
|
|
397
411
|
}
|
|
398
412
|
) }),
|
|
399
|
-
n.showAccountLocked && /* @__PURE__ */ e(
|
|
413
|
+
n.showAccountLocked && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
|
|
400
414
|
Ae,
|
|
401
415
|
{
|
|
402
416
|
dataSource: a.dataSource,
|
|
403
417
|
dataField: "accountLocked",
|
|
404
|
-
label: `${
|
|
418
|
+
label: `${f().t("archbase:Conta bloqueada ?")}`
|
|
405
419
|
}
|
|
406
420
|
) }),
|
|
407
|
-
n.showIsAdministrator && /* @__PURE__ */ e(
|
|
421
|
+
n.showIsAdministrator && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
|
|
408
422
|
Ae,
|
|
409
423
|
{
|
|
410
424
|
dataSource: a.dataSource,
|
|
411
425
|
dataField: "isAdministrator",
|
|
412
|
-
label: `${
|
|
426
|
+
label: `${f().t("archbase:Administrador ?")}`
|
|
413
427
|
}
|
|
414
428
|
) })
|
|
415
429
|
] }) }),
|
|
416
430
|
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e(U, { gap: "lg", children: /* @__PURE__ */ e(
|
|
417
431
|
cr,
|
|
418
432
|
{
|
|
419
|
-
label:
|
|
433
|
+
label: f().t("archbase:Foto do usuário"),
|
|
420
434
|
dataSource: a.dataSource,
|
|
421
435
|
dataField: "avatar",
|
|
422
436
|
width: 120,
|
|
@@ -432,8 +446,8 @@ const zr = pr(
|
|
|
432
446
|
/* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
|
|
433
447
|
Rr,
|
|
434
448
|
{
|
|
435
|
-
titleAvailable:
|
|
436
|
-
titleAssigned:
|
|
449
|
+
titleAvailable: f().t("archbase:Disponíveis"),
|
|
450
|
+
titleAssigned: f().t("archbase:Selecionados"),
|
|
437
451
|
assignedItemsDS: new ur("dsDualList", {
|
|
438
452
|
records: a.dataSource.getFieldValue("groups"),
|
|
439
453
|
grandTotalRecords: a.dataSource.getFieldValue("groups").length,
|
|
@@ -444,26 +458,26 @@ const zr = pr(
|
|
|
444
458
|
width: "100%",
|
|
445
459
|
height: "200px",
|
|
446
460
|
availableItemsDS: R,
|
|
447
|
-
handleCreateAssociationObject: (
|
|
448
|
-
idFieldAssigned: (
|
|
461
|
+
handleCreateAssociationObject: (s) => fa.newInstance(s),
|
|
462
|
+
idFieldAssigned: (s) => s && s.group ? s.group.id : "",
|
|
449
463
|
idFieldAvailable: "id",
|
|
450
|
-
labelFieldAssigned: (
|
|
464
|
+
labelFieldAssigned: (s) => s && s.group ? s.group.name : "",
|
|
451
465
|
labelFieldAvailable: "name"
|
|
452
466
|
}
|
|
453
467
|
) })
|
|
454
468
|
] }),
|
|
455
|
-
n?.customContentAfter && /* @__PURE__ */ e(
|
|
469
|
+
n?.customContentAfter && /* @__PURE__ */ e(xe, { children: n.customContentAfter(a.dataSource.getCurrentRecord()) }),
|
|
456
470
|
/* @__PURE__ */ e(za, { h: "12px" })
|
|
457
471
|
] }) }),
|
|
458
472
|
/* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
|
|
459
|
-
/* @__PURE__ */ e(X, { variant: "default", onClick: o, children:
|
|
460
|
-
/* @__PURE__ */ e(X, { onClick: w, children:
|
|
473
|
+
/* @__PURE__ */ e(X, { variant: "default", onClick: o, children: f().t("archbase:Cancelar") }),
|
|
474
|
+
/* @__PURE__ */ e(X, { onClick: w, children: f().t("archbase:Salvar") })
|
|
461
475
|
] })
|
|
462
476
|
]
|
|
463
477
|
}
|
|
464
478
|
);
|
|
465
479
|
}, Er = (a) => {
|
|
466
|
-
const t = { ...a.options ?? {} },
|
|
480
|
+
const t = { ...a.options ?? {} }, l = () => {
|
|
467
481
|
a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (u) => {
|
|
468
482
|
u && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), u);
|
|
469
483
|
}) : a.onClickOk(a.dataSource.getCurrentRecord(), !0);
|
|
@@ -475,7 +489,7 @@ const zr = pr(
|
|
|
475
489
|
{
|
|
476
490
|
opened: a.opened,
|
|
477
491
|
onClose: n,
|
|
478
|
-
title:
|
|
492
|
+
title: f().t("archbase:Grupo"),
|
|
479
493
|
size: "60%",
|
|
480
494
|
styles: { content: { maxWidth: 1e3 } },
|
|
481
495
|
children: /* @__PURE__ */ e(ue, { style: { height: "460px" }, children: /* @__PURE__ */ r(U, { w: "98%", children: [
|
|
@@ -484,8 +498,8 @@ const zr = pr(
|
|
|
484
498
|
/* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
|
|
485
499
|
le,
|
|
486
500
|
{
|
|
487
|
-
label: `${
|
|
488
|
-
placeholder: `${
|
|
501
|
+
label: `${f().t("archbase:Nome do grupo")}`,
|
|
502
|
+
placeholder: `${f().t("archbase:Informe o nome do grupo")}`,
|
|
489
503
|
dataSource: a.dataSource,
|
|
490
504
|
dataField: "name"
|
|
491
505
|
}
|
|
@@ -493,8 +507,8 @@ const zr = pr(
|
|
|
493
507
|
/* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
|
|
494
508
|
le,
|
|
495
509
|
{
|
|
496
|
-
label: `${
|
|
497
|
-
placeholder: `${
|
|
510
|
+
label: `${f().t("archbase:Descrição do grupo")}`,
|
|
511
|
+
placeholder: `${f().t("archbase:Informe a descrição do grupo")}`,
|
|
498
512
|
dataSource: a.dataSource,
|
|
499
513
|
dataField: "description"
|
|
500
514
|
}
|
|
@@ -502,21 +516,21 @@ const zr = pr(
|
|
|
502
516
|
] }),
|
|
503
517
|
t?.customContentAfter && t.customContentAfter(a.dataSource.getCurrentRecord()),
|
|
504
518
|
/* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
|
|
505
|
-
/* @__PURE__ */ e(X, { variant: "default", onClick: n, children:
|
|
506
|
-
/* @__PURE__ */ e(X, { onClick:
|
|
519
|
+
/* @__PURE__ */ e(X, { variant: "default", onClick: n, children: f().t("archbase:Cancelar") }),
|
|
520
|
+
/* @__PURE__ */ e(X, { onClick: l, children: f().t("archbase:Salvar") })
|
|
507
521
|
] })
|
|
508
522
|
] }) })
|
|
509
523
|
}
|
|
510
524
|
);
|
|
511
|
-
}, Pr = ({ image: a, label: t, description:
|
|
525
|
+
}, Pr = ({ image: a, label: t, description: l, ...n }) => /* @__PURE__ */ e("div", { ...n, children: /* @__PURE__ */ r(O, { grow: !0, children: [
|
|
512
526
|
/* @__PURE__ */ e("img", { style: { maxWidth: "32px" }, src: a }),
|
|
513
527
|
/* @__PURE__ */ r("div", { children: [
|
|
514
528
|
/* @__PURE__ */ e(c, { size: "sm", children: t }),
|
|
515
|
-
/* @__PURE__ */ e(c, { size: "xs", opacity: 0.65, children:
|
|
529
|
+
/* @__PURE__ */ e(c, { size: "xs", opacity: 0.65, children: l })
|
|
516
530
|
] })
|
|
517
531
|
] }) }), Dr = (a) => {
|
|
518
532
|
wr();
|
|
519
|
-
const [t,
|
|
533
|
+
const [t, l] = S(), n = J(K.User), u = Oe(
|
|
520
534
|
"ApiTokenModal",
|
|
521
535
|
a.dataSource,
|
|
522
536
|
"expirationDate",
|
|
@@ -530,17 +544,17 @@ const zr = pr(
|
|
|
530
544
|
const T = typeof g == "string" ? new Date(g) : g, R = tr(T);
|
|
531
545
|
u.handleValueChange(R);
|
|
532
546
|
}
|
|
533
|
-
|
|
534
|
-
}, h = async (g, T) => new Promise(async (R,
|
|
547
|
+
l(g);
|
|
548
|
+
}, h = async (g, T) => new Promise(async (R, x) => {
|
|
535
549
|
try {
|
|
536
|
-
const D = Ue(Ne.or(Ne.eq("name", `^*${T.trim()}*`))),
|
|
550
|
+
const D = Ue(Ne.or(Ne.eq("name", `^*${T.trim()}*`))), b = await n.findAllWithFilter(D, g, 20);
|
|
537
551
|
R({
|
|
538
|
-
options:
|
|
539
|
-
page:
|
|
540
|
-
totalPages:
|
|
552
|
+
options: b.content,
|
|
553
|
+
page: b.pageable.pageNumber,
|
|
554
|
+
totalPages: b.totalPages
|
|
541
555
|
});
|
|
542
556
|
} catch (D) {
|
|
543
|
-
|
|
557
|
+
x(Te(D));
|
|
544
558
|
}
|
|
545
559
|
}), A = () => {
|
|
546
560
|
a.onCustomSave ? a.onCustomSave(a.dataSource.current, (g) => {
|
|
@@ -554,15 +568,15 @@ const zr = pr(
|
|
|
554
568
|
{
|
|
555
569
|
opened: a.opened,
|
|
556
570
|
onClose: z,
|
|
557
|
-
title:
|
|
571
|
+
title: f().t("archbase:Token de API"),
|
|
558
572
|
size: "50%",
|
|
559
573
|
children: [
|
|
560
574
|
/* @__PURE__ */ r(ue, { style: { height: "300px" }, children: [
|
|
561
575
|
/* @__PURE__ */ e(
|
|
562
576
|
le,
|
|
563
577
|
{
|
|
564
|
-
label: `${
|
|
565
|
-
placeholder: `${
|
|
578
|
+
label: `${f().t("archbase:Nome do token")}`,
|
|
579
|
+
placeholder: `${f().t("archbase:Informe o nome do token")}`,
|
|
566
580
|
dataSource: a.dataSource,
|
|
567
581
|
dataField: "name"
|
|
568
582
|
}
|
|
@@ -570,8 +584,8 @@ const zr = pr(
|
|
|
570
584
|
/* @__PURE__ */ e(
|
|
571
585
|
le,
|
|
572
586
|
{
|
|
573
|
-
label: `${
|
|
574
|
-
placeholder: `${
|
|
587
|
+
label: `${f().t("archbase:Descrição do token")}`,
|
|
588
|
+
placeholder: `${f().t("archbase:Informe a descrição do token")}`,
|
|
575
589
|
dataSource: a.dataSource,
|
|
576
590
|
dataField: "description"
|
|
577
591
|
}
|
|
@@ -589,10 +603,10 @@ const zr = pr(
|
|
|
589
603
|
/* @__PURE__ */ e(
|
|
590
604
|
dr,
|
|
591
605
|
{
|
|
592
|
-
label: `${
|
|
606
|
+
label: `${f().t("archbase:Usuário")}`,
|
|
593
607
|
dataSource: a.dataSource,
|
|
594
608
|
dataField: "user",
|
|
595
|
-
placeholder: `${
|
|
609
|
+
placeholder: `${f().t("archbase:Digite aqui o nome do usuário")}`,
|
|
596
610
|
getOptionLabel: (g) => g && g.email ? g.email : "",
|
|
597
611
|
getOptionValue: (g) => g && g.id ? g.id.toString() : "",
|
|
598
612
|
getOptions: h,
|
|
@@ -603,18 +617,18 @@ const zr = pr(
|
|
|
603
617
|
)
|
|
604
618
|
] }),
|
|
605
619
|
/* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
|
|
606
|
-
/* @__PURE__ */ e(X, { variant: "default", onClick: z, children:
|
|
607
|
-
/* @__PURE__ */ e(X, { onClick: A, children:
|
|
620
|
+
/* @__PURE__ */ e(X, { variant: "default", onClick: z, children: f().t("archbase:Cancelar") }),
|
|
621
|
+
/* @__PURE__ */ e(X, { onClick: A, children: f().t("archbase:Salvar") })
|
|
608
622
|
] })
|
|
609
623
|
]
|
|
610
624
|
}
|
|
611
625
|
);
|
|
612
626
|
}, ba = (a) => {
|
|
613
627
|
const t = "->";
|
|
614
|
-
return a.includes(t) ? a.split(t).map((u) => u.trim()).map((u) =>
|
|
628
|
+
return a.includes(t) ? a.split(t).map((u) => u.trim()).map((u) => f().t(u)).join(` ${t} `) : f().t(a);
|
|
615
629
|
};
|
|
616
|
-
function Xe({ dataSource: a, opened: t, close:
|
|
617
|
-
const n = ie(() => a?.getFieldValue("name") || "", [a]), u = ie(() => a?.getFieldValue("id") || "", [a]), d = ie(() => a?.getFieldValue("type") || "", [a]), h = da(), A = da(), [z, g] =
|
|
630
|
+
function Xe({ dataSource: a, opened: t, close: l }) {
|
|
631
|
+
const n = ie(() => a?.getFieldValue("name") || "", [a]), u = ie(() => a?.getFieldValue("id") || "", [a]), d = ie(() => a?.getFieldValue("type") || "", [a]), h = da(), A = da(), [z, g] = S([]), [T, R] = S([]), [x, D] = S(), [b, w] = S(), [o, s] = S(""), [p] = oa(o, 200), [v, $] = S(""), [y] = oa(v, 200), i = J(K.Resource), { colorScheme: N } = qe(), I = N === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", M = ie(() => T.sort((E, P) => E.resourceDescription.localeCompare(P.resourceDescription)).map((E) => ({
|
|
618
632
|
value: E.resourceId,
|
|
619
633
|
label: E.resourceDescription,
|
|
620
634
|
children: E.permissions.filter((P) => P.actionDescription.toLowerCase().includes(y.toLowerCase())).sort((P, q) => P.actionDescription.localeCompare(q.actionDescription)).map((P) => ({
|
|
@@ -626,7 +640,7 @@ function Xe({ dataSource: a, opened: t, close: s }) {
|
|
|
626
640
|
owner: E
|
|
627
641
|
}
|
|
628
642
|
}))
|
|
629
|
-
})), [T, y]), F = ie(() => T.map((E) => E.permissions.map((P) => P.actionId)).flat(), [T]),
|
|
643
|
+
})), [T, y]), F = ie(() => T.map((E) => E.permissions.map((P) => P.actionId)).flat(), [T]), C = ie(() => z.sort((E, P) => E.resourceDescription.localeCompare(P.resourceDescription)).map((E) => ({
|
|
630
644
|
value: E.resourceId,
|
|
631
645
|
label: E.resourceDescription,
|
|
632
646
|
children: E.permissions.filter((P) => P.actionDescription.toLowerCase().includes(p.toLowerCase())).sort((P, q) => P.actionDescription.localeCompare(q.actionDescription)).map((P) => {
|
|
@@ -635,28 +649,28 @@ function Xe({ dataSource: a, opened: t, close: s }) {
|
|
|
635
649
|
value: P.actionId,
|
|
636
650
|
label: P.actionDescription,
|
|
637
651
|
nodeProps: {
|
|
638
|
-
granted: F.includes(P.actionId) && q?.types?.includes(
|
|
652
|
+
granted: F.includes(P.actionId) && q?.types?.includes(Se(_, d)),
|
|
639
653
|
owner: E
|
|
640
654
|
}
|
|
641
655
|
};
|
|
642
656
|
})
|
|
643
|
-
})), [z, T, F, d, p]),
|
|
657
|
+
})), [z, T, F, d, p]), k = ae(async () => {
|
|
644
658
|
if (u) {
|
|
645
659
|
const E = await i.getPermissionsBySecurityId(u, d), P = await i.getAllPermissionsAvailable();
|
|
646
660
|
g(P), R(E);
|
|
647
661
|
}
|
|
648
662
|
}, [u, d]), oe = ae(() => {
|
|
649
|
-
|
|
663
|
+
x?.value && u && i.createPermission(u, x.value, d).then((E) => {
|
|
650
664
|
if (E) {
|
|
651
665
|
R((Z) => {
|
|
652
666
|
let B;
|
|
653
|
-
return Z.map((Q) => Q.resourceId).includes(E.resourceId) ? B = Z.map((Q) => Q.resourceId === E.resourceId ? Q.permissions.map((H) => H.actionId).includes(
|
|
667
|
+
return Z.map((Q) => Q.resourceId).includes(E.resourceId) ? B = Z.map((Q) => Q.resourceId === E.resourceId ? Q.permissions.map((H) => H.actionId).includes(x.value) ? {
|
|
654
668
|
...Q,
|
|
655
669
|
permissions: Q.permissions.map(
|
|
656
|
-
(H) => H.actionId ===
|
|
670
|
+
(H) => H.actionId === x.value ? {
|
|
657
671
|
...H,
|
|
658
672
|
permissionId: E.permissionId,
|
|
659
|
-
types: [...H.types ?? [],
|
|
673
|
+
types: [...H.types ?? [], Se(_, d)]
|
|
660
674
|
} : H
|
|
661
675
|
)
|
|
662
676
|
} : {
|
|
@@ -667,7 +681,7 @@ function Xe({ dataSource: a, opened: t, close: s }) {
|
|
|
667
681
|
actionId: E.actionId,
|
|
668
682
|
actionDescription: E.actionDescription,
|
|
669
683
|
permissionId: E.permissionId,
|
|
670
|
-
types: [
|
|
684
|
+
types: [Se(_, d)]
|
|
671
685
|
}
|
|
672
686
|
]
|
|
673
687
|
} : Q) : B = [
|
|
@@ -680,62 +694,62 @@ function Xe({ dataSource: a, opened: t, close: s }) {
|
|
|
680
694
|
actionId: E.actionId,
|
|
681
695
|
actionDescription: E.actionDescription,
|
|
682
696
|
permissionId: E.permissionId,
|
|
683
|
-
types: [
|
|
697
|
+
types: [Se(_, d)]
|
|
684
698
|
}
|
|
685
699
|
]
|
|
686
700
|
}
|
|
687
701
|
], B;
|
|
688
702
|
});
|
|
689
|
-
const P =
|
|
703
|
+
const P = C.filter((Z) => Z.value === x?.nodeProps?.owner?.resourceId).map((Z) => Z.children).flat(), q = P.map((Z) => Z.value).indexOf(x.value), G = P.find((Z, B) => !Z?.nodeProps?.granted && Z?.value !== x.value && (P.length > q + 1 ? B > q : !0));
|
|
690
704
|
G?.value && h.select(G.value), A.expand(E.resourceId), D(G);
|
|
691
705
|
}
|
|
692
706
|
});
|
|
693
|
-
}, [
|
|
694
|
-
|
|
707
|
+
}, [x, u, d, i, C, z, T, h, A]), me = ae(() => {
|
|
708
|
+
b?.nodeProps?.permissionId && i.deletePermission(b.nodeProps.permissionId).then(() => {
|
|
695
709
|
R((G) => [...G].filter((B) => {
|
|
696
710
|
let Q = !0;
|
|
697
711
|
return B.permissions?.forEach((H) => {
|
|
698
|
-
H.permissionId !== void 0 && H.permissionId ===
|
|
712
|
+
H.permissionId !== void 0 && H.permissionId === b?.nodeProps?.permissionId && B.permissions.length === 1 && H?.types?.length === 1 && H.types[0] === Se(_, d) && (Q = !1);
|
|
699
713
|
}), Q;
|
|
700
714
|
}).map((B) => {
|
|
701
|
-
const Q =
|
|
702
|
-
return B.resourceId === Q.resourceId ?
|
|
715
|
+
const Q = b?.nodeProps?.owner;
|
|
716
|
+
return B.resourceId === Q.resourceId ? b?.nodeProps?.types?.length === 1 ? {
|
|
703
717
|
...B,
|
|
704
|
-
permissions: [...(B.permissions ?? []).filter((H) => H.permissionId !==
|
|
718
|
+
permissions: [...(B.permissions ?? []).filter((H) => H.permissionId !== b?.nodeProps?.permissionId)]
|
|
705
719
|
} : {
|
|
706
720
|
...B,
|
|
707
|
-
permissions: (B.permissions ?? []).map((H) => H.actionId ===
|
|
721
|
+
permissions: (B.permissions ?? []).map((H) => H.actionId === b.value ? {
|
|
708
722
|
actionId: H.actionId,
|
|
709
723
|
actionDescription: H.actionDescription,
|
|
710
|
-
types: [...H.types?.filter((de) => de && de !==
|
|
724
|
+
types: [...H.types?.filter((de) => de && de !== Se(_, d)) ?? []]
|
|
711
725
|
} : H)
|
|
712
726
|
} : B;
|
|
713
727
|
}));
|
|
714
|
-
const E = M.filter((G) => G.value ===
|
|
728
|
+
const E = M.filter((G) => G.value === b?.nodeProps?.owner?.resourceId).map((G) => G.children).flat(), P = E.map((G) => G.value).indexOf(b.value), q = E.find((G, Z) => G?.nodeProps?.types.includes(Se(_, d)) && G?.value !== b.value && (E.length > P + 1 ? Z > P : !0));
|
|
715
729
|
q?.value && A.select(q.value), w(q);
|
|
716
730
|
});
|
|
717
|
-
}, [
|
|
731
|
+
}, [b, i, d, M, T, A]);
|
|
718
732
|
return ee(() => {
|
|
719
|
-
t && a && (D(void 0), w(void 0),
|
|
720
|
-
}, [t, d, u,
|
|
721
|
-
/* @__PURE__ */ e(
|
|
733
|
+
t && a && (D(void 0), w(void 0), s(""), $(""), A.collapseAllNodes(), h.collapseAllNodes(), k());
|
|
734
|
+
}, [t, d, u, k]), a ? /* @__PURE__ */ e($e, { opened: t, onClose: l, title: `${f().t(`archbase:${d}`)}: ${n}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ r(Sr, { height: "540px", children: [
|
|
735
|
+
/* @__PURE__ */ e(xr, { children: /* @__PURE__ */ e(re, { withBorder: !0, my: 20, p: 20, style: { height: "calc(100% - 40px)", overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ r("div", { style: { flex: 1, display: "flex", flexDirection: "row", overflow: "hidden", minHeight: 0, gap: "8px" }, children: [
|
|
722
736
|
/* @__PURE__ */ r("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
|
|
723
737
|
/* @__PURE__ */ r(O, { mb: 20, children: [
|
|
724
|
-
/* @__PURE__ */ e(c, { children:
|
|
738
|
+
/* @__PURE__ */ e(c, { children: f().t("archbase:Available") }),
|
|
725
739
|
/* @__PURE__ */ e(
|
|
726
740
|
he,
|
|
727
741
|
{
|
|
728
742
|
size: "xs",
|
|
729
743
|
value: o,
|
|
730
|
-
onChange: (E) =>
|
|
731
|
-
placeholder:
|
|
744
|
+
onChange: (E) => s(E.target.value),
|
|
745
|
+
placeholder: f().t("archbase:Filter available permissions")
|
|
732
746
|
}
|
|
733
747
|
)
|
|
734
748
|
] }),
|
|
735
749
|
/* @__PURE__ */ e(ue, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
|
|
736
750
|
ua,
|
|
737
751
|
{
|
|
738
|
-
data:
|
|
752
|
+
data: C,
|
|
739
753
|
selectOnClick: !0,
|
|
740
754
|
allowRangeSelection: !1,
|
|
741
755
|
tree: h,
|
|
@@ -749,7 +763,7 @@ function Xe({ dataSource: a, opened: t, close: s }) {
|
|
|
749
763
|
ml: G ? 0 : 5,
|
|
750
764
|
gap: 5,
|
|
751
765
|
...B,
|
|
752
|
-
bg: Z && E === 2 ?
|
|
766
|
+
bg: Z && E === 2 ? I : "",
|
|
753
767
|
onClick: je,
|
|
754
768
|
children: [
|
|
755
769
|
G && /* @__PURE__ */ e(
|
|
@@ -782,19 +796,19 @@ function Xe({ dataSource: a, opened: t, close: s }) {
|
|
|
782
796
|
) })
|
|
783
797
|
] }),
|
|
784
798
|
/* @__PURE__ */ e("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ r(U, { gap: 5, align: "center", children: [
|
|
785
|
-
/* @__PURE__ */ e(
|
|
786
|
-
/* @__PURE__ */ e(
|
|
799
|
+
/* @__PURE__ */ e(Ie, { label: f().t("archbase:Add"), children: /* @__PURE__ */ e(ye, { onClick: oe, disabled: !x || x?.nodeProps?.granted || !x.nodeProps, children: /* @__PURE__ */ e(Pa, {}) }) }),
|
|
800
|
+
/* @__PURE__ */ e(Ie, { label: f().t("archbase:Remove"), children: /* @__PURE__ */ e(ye, { onClick: me, disabled: !b || !b?.nodeProps?.permissionId || !b.nodeProps, children: /* @__PURE__ */ e(Da, {}) }) })
|
|
787
801
|
] }) }),
|
|
788
802
|
/* @__PURE__ */ r("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
|
|
789
803
|
/* @__PURE__ */ r(O, { mb: 20, children: [
|
|
790
|
-
/* @__PURE__ */ e(c, { children:
|
|
804
|
+
/* @__PURE__ */ e(c, { children: f().t("archbase:Granted") }),
|
|
791
805
|
/* @__PURE__ */ e(
|
|
792
806
|
he,
|
|
793
807
|
{
|
|
794
808
|
size: "xs",
|
|
795
809
|
value: v,
|
|
796
810
|
onChange: (E) => $(E.target.value),
|
|
797
|
-
placeholder:
|
|
811
|
+
placeholder: f().t("archbase:Filter granted permissions")
|
|
798
812
|
}
|
|
799
813
|
)
|
|
800
814
|
] }),
|
|
@@ -815,7 +829,7 @@ function Xe({ dataSource: a, opened: t, close: s }) {
|
|
|
815
829
|
ml: G ? 0 : 5,
|
|
816
830
|
gap: 5,
|
|
817
831
|
...B,
|
|
818
|
-
bg: Z && E === 2 ?
|
|
832
|
+
bg: Z && E === 2 ? I : "",
|
|
819
833
|
onClick: Q,
|
|
820
834
|
children: [
|
|
821
835
|
G && /* @__PURE__ */ e(
|
|
@@ -833,9 +847,9 @@ function Xe({ dataSource: a, opened: t, close: s }) {
|
|
|
833
847
|
}
|
|
834
848
|
),
|
|
835
849
|
/* @__PURE__ */ e(c, { children: ba(P.label) }),
|
|
836
|
-
P?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e(j, { color: "blue", children:
|
|
837
|
-
P?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e(j, { color: "orange", children:
|
|
838
|
-
P?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e(j, { color: "pink", children:
|
|
850
|
+
P?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e(j, { color: "blue", children: f().t("archbase:user") }),
|
|
851
|
+
P?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e(j, { color: "orange", children: f().t("archbase:group") }),
|
|
852
|
+
P?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e(j, { color: "pink", children: f().t("archbase:profile") })
|
|
839
853
|
]
|
|
840
854
|
}
|
|
841
855
|
);
|
|
@@ -844,10 +858,10 @@ function Xe({ dataSource: a, opened: t, close: s }) {
|
|
|
844
858
|
) })
|
|
845
859
|
] })
|
|
846
860
|
] }) }) }),
|
|
847
|
-
/* @__PURE__ */ e(
|
|
861
|
+
/* @__PURE__ */ e(Cr, { size: "40px", children: /* @__PURE__ */ e(O, { justify: "flex-end", children: /* @__PURE__ */ e(X, { onClick: l, children: f().t("archbase:Close") }) }) })
|
|
848
862
|
] }) }) : null;
|
|
849
863
|
}
|
|
850
|
-
const
|
|
864
|
+
const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAAABj1BMVEUAAADMzMzLy8vAwMDLy8vLy8vLy8vMzMzKysrR0dHPz8/MzMzNzc3KysrMzMzKysrLy8vLy8vLy8vJycnR0dHMzMzPz8/Ozs7MzMxPT0/Nzc1UVFTJyclTU1PMzMzKysrMzMzJycldXV1iYmLMzMzIyMhNTU1NTU3MzMzLy8vNzc3MzMxVVVXLy8vMzMzLy8vLy8tNTU3MzMzOzs5QUFDLy8vKyspRUVFRUVHMzMxZWVlycnLLy8tUVFTJycnKyspZWVlXV1dhYWHGxsZMTExQUFBPT0/Ozs7Ly8vPz89SUlJSUlLMzMxVVVVWVlZVVVXKysptbW1bW1t6enpmZmbLy8tKSkrQ0NDOzs5FRUXNzc1NTU3S0tLU1NRHR0dSUlKzs7ORkZF4eHhPT0/Jycm9vb26urp8fHxYWFisrKylpaWdnZ11dXVubm5fX1+8vLy3t7ehoaFkZGRVVVXBwcG/v7+vr6+ZmZmUlJSNjY2GhoZzc3NcXFzGxsbDw8Ofn5+WlpaBgYGwsLCpqalqampaWRCJAAAAVXRSTlMA+YUG1M7Df1AQ8urbdWdiXjo2HQkE+/vu4qqIcV1bRDEpIRwXFO/q2ZiObWJZSiv+9uTe3cq8s6qkgX55b1pWR0YVDfvJyLCcmZWTi2lZVz82LRcUQGGNCgAAA9pJREFUWMPll2db2zAQgJ0AgUIYDSl7tZRZ6N57793akizZCSSEEJKw9yi0/eHtEwgid5IxfOX9mnvenM93J8s4tZw5391Q3/Hu0mj3lTMnllys+hi6HqBCCCIEDVwPDVddPEEqXW9qiEOoeQAlDqlpGz1eYo2VYSFsE2ELcSPY6FvTV1njUFMDdVqCff48DWGgAdhOuMtPie8JrUaWq+3I5zs76Jg+cG50e3seVxPTF6S63svT0URNn1BSqffUEhvHE/ofgn8x9aZLKJpcja/sZnO57Pp0yqbIVKv2VDUBD93amedsn0QuA1U2eazynG8BceRPnrnWAczdmAERtLoHe6IhAaJWLWaVwNLLBPxXxQskCjogZse1ICz2G+TkDKNGbAb5THELwzaXQB2bzpZ6zt0GD5acZ5bKNA4LGSorET2BDz/NLDVT0FQywGW34GT81YhYForKo4dbCHjsVMLSEJuxgWnUkMAKkTmmE7E52ExhuX2vBGDzj+lFa7AKzRHUQ1K0qheNQZETPHj3FQSKfulF0zCYlpcVpyyAlseypcOdojC6uThxdQLt94mYTpRI2WjvduyL3kqRbGxXk1A+iYJFmywRhEyCIuEZwUXqq7Hxb+M60QYOtlsaZa3BT7PazuZxisP3VkA3/MX79a8QHH5574iWtfbZ2RDRUBDVA5HPzsbvvw6LaMZraLGodu9YdEzPhsRrBCIq985FLDKpto8mKY4WD+VWQymlXWVjpydshaiuILpcEKGxjSkfLE4VwaSqIOq5aioQ40w1IMRUEUEjgrctXkaqEZFDi1lccL1fGd5s94RKRLMMJZSTHrBGcEfiMxJ3Ne5HeYhg7CX03vgsVUZGiuesLBJqSrzUcNxgFBxHMGA2gVeRAjFkFOkJmCqSebekqzeTyrDmQ182IV8NEJtQNtytc+irBn5rwUHLqMJEvSGJlitCCCr2BsVRNFzyGdklcEQcHwAZop58SRmqEt2aZ3iJpChMuyJqlPC1CQRs51RDm08RdIAAhpzD6dCpvPpjNJ2hh5NyhvCFb5DIq0F83NKd/VY2LlWkXHFXjlTTfU1qlzNLC+OTs8Tev0JElHfZQkpkaT0GNEiVWJ8oqIjm8vdQ2GR7bAFrsGphbZHYQnthC5orm8y1fOCy9Fhy2NDyANVYr3IfGB6MXOM+Rdc+GZ48venLxG8+M46g9y734bl7wTiazlZ+hKZ1xPBFb/sA99D0t/cafrnQ3sq50sJb2+FTefOz804/50DC+++MPDeOTe+XD68GeJGXA6/ff4bJ+OfHt2edj+7ff9T59Ptz47TyD0dpv5fjoIC3AAAAAElFTkSuQmCC", Fr = (a) => a.groups ? /* @__PURE__ */ e("div", { style: { display: "flex" }, children: a.groups.slice().sort((t, l) => (t.group?.name ?? "").localeCompare(l.group?.name ?? "")).map((t, l) => /* @__PURE__ */ e("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e(j, { color: "blue", children: t.group?.name }) }, l)) }) : null, Nr = (a) => a.profile ? /* @__PURE__ */ e(j, { color: "green", children: a.profile?.name }) : null, Or = (a) => /* @__PURE__ */ r(Ee, { children: [
|
|
851
865
|
/* @__PURE__ */ e(
|
|
852
866
|
L,
|
|
853
867
|
{
|
|
@@ -859,7 +873,7 @@ const la = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
859
873
|
"img",
|
|
860
874
|
{
|
|
861
875
|
style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
|
|
862
|
-
src: t.row.user && t.row.user.avatar ? atob(t.row.user.avatar) :
|
|
876
|
+
src: t.row.user && t.row.user.avatar ? atob(t.row.user.avatar) : sa
|
|
863
877
|
}
|
|
864
878
|
),
|
|
865
879
|
inputFilterType: "text",
|
|
@@ -938,7 +952,7 @@ const la = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
938
952
|
"img",
|
|
939
953
|
{
|
|
940
954
|
style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
|
|
941
|
-
src: t.row.avatar ? atob(t.row.avatar) :
|
|
955
|
+
src: t.row.avatar ? atob(t.row.avatar) : sa
|
|
942
956
|
}
|
|
943
957
|
),
|
|
944
958
|
enableSorting: !1,
|
|
@@ -1010,7 +1024,7 @@ const la = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1010
1024
|
size: 300,
|
|
1011
1025
|
header: `${a("archbase:Grupos")}`,
|
|
1012
1026
|
render: (t) => Fr(t.row),
|
|
1013
|
-
exportValue: (t) => t.groups?.slice().sort((
|
|
1027
|
+
exportValue: (t) => t.groups?.slice().sort((l, n) => (l.group?.name ?? "").localeCompare(n.group?.name ?? "")).map((l) => l.group?.name).filter(Boolean).join(", ") || "",
|
|
1014
1028
|
enableSorting: !1,
|
|
1015
1029
|
enableColumnFilter: !1,
|
|
1016
1030
|
enableGlobalFilter: !1
|
|
@@ -1162,7 +1176,7 @@ const la = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1162
1176
|
function De({
|
|
1163
1177
|
active: a,
|
|
1164
1178
|
printTitle: t,
|
|
1165
|
-
gridRef:
|
|
1179
|
+
gridRef: l,
|
|
1166
1180
|
dataSource: n,
|
|
1167
1181
|
isLoading: u,
|
|
1168
1182
|
error: d,
|
|
@@ -1172,7 +1186,7 @@ function De({
|
|
|
1172
1186
|
toolbarLeftContent: g,
|
|
1173
1187
|
renderRowActions: T,
|
|
1174
1188
|
actionsColumnWidth: R,
|
|
1175
|
-
children:
|
|
1189
|
+
children: x
|
|
1176
1190
|
}) {
|
|
1177
1191
|
return /* @__PURE__ */ e(
|
|
1178
1192
|
re,
|
|
@@ -1187,9 +1201,9 @@ function De({
|
|
|
1187
1201
|
overflow: "auto"
|
|
1188
1202
|
},
|
|
1189
1203
|
children: /* @__PURE__ */ e(
|
|
1190
|
-
|
|
1204
|
+
ka,
|
|
1191
1205
|
{
|
|
1192
|
-
gridRef:
|
|
1206
|
+
gridRef: l,
|
|
1193
1207
|
printTitle: t,
|
|
1194
1208
|
width: "100%",
|
|
1195
1209
|
height: "100%",
|
|
@@ -1208,7 +1222,7 @@ function De({
|
|
|
1208
1222
|
toolbarLeftContent: g,
|
|
1209
1223
|
renderRowActions: T,
|
|
1210
1224
|
actionsColumnWidth: R,
|
|
1211
|
-
children:
|
|
1225
|
+
children: x
|
|
1212
1226
|
}
|
|
1213
1227
|
)
|
|
1214
1228
|
}
|
|
@@ -1217,7 +1231,7 @@ function De({
|
|
|
1217
1231
|
function _e({
|
|
1218
1232
|
dataSource: a,
|
|
1219
1233
|
securityType: t,
|
|
1220
|
-
newInstance:
|
|
1234
|
+
newInstance: l,
|
|
1221
1235
|
createEntitiesWithId: n,
|
|
1222
1236
|
removeMessageKey: u,
|
|
1223
1237
|
setOpenedModal: d,
|
|
@@ -1228,7 +1242,7 @@ function _e({
|
|
|
1228
1242
|
const g = a, T = (p) => g.isEmpty() ? null : g.gotoRecordByData(p) ?? null;
|
|
1229
1243
|
return {
|
|
1230
1244
|
handleAdd: () => {
|
|
1231
|
-
const p =
|
|
1245
|
+
const p = l();
|
|
1232
1246
|
n || (p.id = void 0), g.insert(p), d(t);
|
|
1233
1247
|
},
|
|
1234
1248
|
handleViewRow: (p) => {
|
|
@@ -1267,41 +1281,41 @@ function _e({
|
|
|
1267
1281
|
function Ye({
|
|
1268
1282
|
row: a,
|
|
1269
1283
|
onView: t,
|
|
1270
|
-
onEdit:
|
|
1284
|
+
onEdit: l,
|
|
1271
1285
|
onRemove: n,
|
|
1272
1286
|
onEditPermissions: u,
|
|
1273
1287
|
before: d,
|
|
1274
1288
|
after: h,
|
|
1275
1289
|
t: A
|
|
1276
1290
|
}) {
|
|
1277
|
-
const z = na(), { colorScheme: g } = qe(), T = g === "dark", R = (
|
|
1291
|
+
const z = na(), { colorScheme: g } = qe(), T = g === "dark", R = (x) => T ? z.colors[x][8] : z.colors[x][4];
|
|
1278
1292
|
return /* @__PURE__ */ r(O, { gap: 1, wrap: "nowrap", children: [
|
|
1279
1293
|
d?.(a),
|
|
1280
1294
|
/* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => t(a), children: /* @__PURE__ */ e(mr, { size: 20, color: R("blue") }) }),
|
|
1281
|
-
/* @__PURE__ */ e(ye, { variant: "transparent", onClick: () =>
|
|
1282
|
-
/* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => n(a), children: /* @__PURE__ */ e(
|
|
1283
|
-
/* @__PURE__ */ e(
|
|
1295
|
+
/* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => l(a), children: /* @__PURE__ */ e(Fa, { size: 20, color: R("yellow") }) }),
|
|
1296
|
+
/* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => n(a), children: /* @__PURE__ */ e(la, { size: 20, color: R("red") }) }),
|
|
1297
|
+
/* @__PURE__ */ e(Ie, { withinPortal: !0, withArrow: !0, position: "left", label: `${A("archbase:Edit permissions")}`, children: /* @__PURE__ */ e(ye, { variant: "transparent", onClick: u, children: /* @__PURE__ */ e(gr, { size: 20, color: R("green") }) }) }),
|
|
1284
1298
|
h?.(a)
|
|
1285
1299
|
] });
|
|
1286
1300
|
}
|
|
1287
|
-
const ea = ({ onAdd: a, onEditPermissions: t, t:
|
|
1301
|
+
const ea = ({ onAdd: a, onEditPermissions: t, t: l }) => /* @__PURE__ */ r(Fe, { justify: "space-between", style: { width: "50%" }, children: [
|
|
1288
1302
|
/* @__PURE__ */ r(O, { align: "end", gap: "4px", wrap: "nowrap", children: [
|
|
1289
|
-
/* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Na, {}), onClick: a, children: `${
|
|
1290
|
-
/* @__PURE__ */ e(X, { color: "blue", leftSection: /* @__PURE__ */ e(Fa, {}), onClick: t, children: `${
|
|
1303
|
+
/* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Na, {}), onClick: a, children: `${l("archbase:New")}` }),
|
|
1304
|
+
/* @__PURE__ */ e(X, { color: "blue", leftSection: /* @__PURE__ */ e(Fa, {}), onClick: t, children: `${l("archbase:Edit permissions")}` })
|
|
1291
1305
|
] }),
|
|
1292
1306
|
/* @__PURE__ */ e(Fe, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
|
|
1293
1307
|
] });
|
|
1294
1308
|
function Tt({
|
|
1295
1309
|
height: a = "400px",
|
|
1296
1310
|
width: t = "100%",
|
|
1297
|
-
createEntitiesWithId:
|
|
1311
|
+
createEntitiesWithId: l = !0,
|
|
1298
1312
|
userModalOptions: n,
|
|
1299
1313
|
profileModalOptions: u,
|
|
1300
1314
|
groupModalOptions: d,
|
|
1301
1315
|
options: h
|
|
1302
1316
|
}) {
|
|
1303
1317
|
na(), Ea("securityStore");
|
|
1304
|
-
const A = ir(), { colorScheme: z } = qe(), [g, T] =
|
|
1318
|
+
const A = ir(), { colorScheme: z } = qe(), [g, T] = S(void 0), [R, x] = S("users"), D = J(K.User), b = J(K.Group), w = J(K.Resource), o = J(K.Profile), [s, p] = S(""), [v, $] = S(""), y = J(K.AccessToken), { t: i } = or(), N = Re(null), I = Re(null), M = Re(null), F = Re(null), C = Re(null), k = (V) => V.id, oe = (V) => V.id, me = (V) => V.id, E = (V) => V.id, P = (V) => V.id, {
|
|
1305
1319
|
dataSource: q,
|
|
1306
1320
|
isLoading: G,
|
|
1307
1321
|
refreshData: Z
|
|
@@ -1332,7 +1346,7 @@ function Tt({
|
|
|
1332
1346
|
refreshData: Ze
|
|
1333
1347
|
} = Pe({
|
|
1334
1348
|
name: "dsGroups",
|
|
1335
|
-
service:
|
|
1349
|
+
service: b,
|
|
1336
1350
|
validator: A,
|
|
1337
1351
|
pageSize: 25,
|
|
1338
1352
|
onError: (V, te) => {
|
|
@@ -1370,7 +1384,7 @@ function Tt({
|
|
|
1370
1384
|
dataSource: B,
|
|
1371
1385
|
securityType: _.USER,
|
|
1372
1386
|
newInstance: () => fr.newInstance(),
|
|
1373
|
-
createEntitiesWithId:
|
|
1387
|
+
createEntitiesWithId: l,
|
|
1374
1388
|
removeMessageKey: "archbase:Deseja remover o usuário ",
|
|
1375
1389
|
setOpenedModal: p,
|
|
1376
1390
|
setOpenedPermissionsModal: $,
|
|
@@ -1380,7 +1394,7 @@ function Tt({
|
|
|
1380
1394
|
dataSource: de,
|
|
1381
1395
|
securityType: _.GROUP,
|
|
1382
1396
|
newInstance: () => br.newInstance(),
|
|
1383
|
-
createEntitiesWithId:
|
|
1397
|
+
createEntitiesWithId: l,
|
|
1384
1398
|
removeMessageKey: "archbase:Deseja remover o grupo ",
|
|
1385
1399
|
setOpenedModal: p,
|
|
1386
1400
|
setOpenedPermissionsModal: $,
|
|
@@ -1390,7 +1404,7 @@ function Tt({
|
|
|
1390
1404
|
dataSource: Le,
|
|
1391
1405
|
securityType: _.PROFILE,
|
|
1392
1406
|
newInstance: () => vr.newInstance(),
|
|
1393
|
-
createEntitiesWithId:
|
|
1407
|
+
createEntitiesWithId: l,
|
|
1394
1408
|
removeMessageKey: "archbase:Deseja remover o perfil ",
|
|
1395
1409
|
setOpenedModal: p,
|
|
1396
1410
|
setOpenedPermissionsModal: $,
|
|
@@ -1461,13 +1475,13 @@ function Tt({
|
|
|
1461
1475
|
{
|
|
1462
1476
|
disabled: !q.getCurrentRecord(),
|
|
1463
1477
|
color: "red",
|
|
1464
|
-
leftSection: /* @__PURE__ */ e(
|
|
1478
|
+
leftSection: /* @__PURE__ */ e(la, {}),
|
|
1465
1479
|
onClick: Ka,
|
|
1466
1480
|
children: `${i("archbase:Revoke")}`
|
|
1467
1481
|
}
|
|
1468
1482
|
) }) });
|
|
1469
1483
|
return /* @__PURE__ */ r(re, { p: "md", style: { height: a, display: "flex", flexDirection: "column" }, children: [
|
|
1470
|
-
/* @__PURE__ */ e(we, { variant: "pills", value: R, onChange:
|
|
1484
|
+
/* @__PURE__ */ e(we, { variant: "pills", value: R, onChange: x, children: /* @__PURE__ */ r(we.List, { children: [
|
|
1471
1485
|
/* @__PURE__ */ e(we.Tab, { value: "users", children: `${i("Usuários")}` }),
|
|
1472
1486
|
/* @__PURE__ */ e(we.Tab, { value: "groups", children: `${i("Grupos")}` }),
|
|
1473
1487
|
/* @__PURE__ */ e(we.Tab, { value: "profiles", children: `${i("Perfis")}` }),
|
|
@@ -1483,7 +1497,7 @@ function Tt({
|
|
|
1483
1497
|
dataSource: B,
|
|
1484
1498
|
isLoading: Q,
|
|
1485
1499
|
error: g,
|
|
1486
|
-
getRowId:
|
|
1500
|
+
getRowId: k,
|
|
1487
1501
|
striped: !0,
|
|
1488
1502
|
toolbarLeftContent: /* @__PURE__ */ e(
|
|
1489
1503
|
ea,
|
|
@@ -1503,7 +1517,7 @@ function Tt({
|
|
|
1503
1517
|
{
|
|
1504
1518
|
active: R === "groups",
|
|
1505
1519
|
printTitle: "Grupos",
|
|
1506
|
-
gridRef:
|
|
1520
|
+
gridRef: I,
|
|
1507
1521
|
dataSource: de,
|
|
1508
1522
|
isLoading: je,
|
|
1509
1523
|
error: g,
|
|
@@ -1563,7 +1577,7 @@ function Tt({
|
|
|
1563
1577
|
{
|
|
1564
1578
|
active: R === "accessTokens",
|
|
1565
1579
|
printTitle: "Tokens de API",
|
|
1566
|
-
gridRef:
|
|
1580
|
+
gridRef: C,
|
|
1567
1581
|
dataSource: q,
|
|
1568
1582
|
isLoading: G,
|
|
1569
1583
|
error: g,
|
|
@@ -1574,8 +1588,8 @@ function Tt({
|
|
|
1574
1588
|
children: Ga
|
|
1575
1589
|
}
|
|
1576
1590
|
),
|
|
1577
|
-
|
|
1578
|
-
|
|
1591
|
+
s === _.USER ? /* @__PURE__ */ e(
|
|
1592
|
+
kr,
|
|
1579
1593
|
{
|
|
1580
1594
|
onClickOk: ge.handleSaveModal,
|
|
1581
1595
|
opened: !0,
|
|
@@ -1584,7 +1598,7 @@ function Tt({
|
|
|
1584
1598
|
options: n
|
|
1585
1599
|
}
|
|
1586
1600
|
) : null,
|
|
1587
|
-
|
|
1601
|
+
s === _.GROUP ? /* @__PURE__ */ e(
|
|
1588
1602
|
Er,
|
|
1589
1603
|
{
|
|
1590
1604
|
onClickOk: fe.handleSaveModal,
|
|
@@ -1594,7 +1608,7 @@ function Tt({
|
|
|
1594
1608
|
options: d
|
|
1595
1609
|
}
|
|
1596
1610
|
) : null,
|
|
1597
|
-
|
|
1611
|
+
s === _.PROFILE ? /* @__PURE__ */ e(
|
|
1598
1612
|
Ar,
|
|
1599
1613
|
{
|
|
1600
1614
|
onClickOk: be.handleSaveModal,
|
|
@@ -1632,34 +1646,34 @@ function Tt({
|
|
|
1632
1646
|
}
|
|
1633
1647
|
function wt({ height: a = "400px", width: t = "100%" }) {
|
|
1634
1648
|
na();
|
|
1635
|
-
const
|
|
1649
|
+
const l = Ea("apiTokenStore"), n = { validateEntity: () => [] }, { colorScheme: u } = qe(), [d, h] = S(void 0), A = J(K.ApiToken), [z, g] = S(""), T = Re(null), R = (I) => I.id, { dataSource: x } = hr({
|
|
1636
1650
|
initialData: [],
|
|
1637
1651
|
name: "dataSource"
|
|
1638
1652
|
}), D = Oe(
|
|
1639
1653
|
"ArchbaseApiTokenView-LocalDataSource",
|
|
1640
|
-
|
|
1654
|
+
x,
|
|
1641
1655
|
void 0,
|
|
1642
1656
|
void 0
|
|
1643
|
-
), { dataSource:
|
|
1657
|
+
), { dataSource: b, isLoading: w } = ia({
|
|
1644
1658
|
name: "dsApiToken",
|
|
1645
1659
|
service: A,
|
|
1646
|
-
store:
|
|
1660
|
+
store: l,
|
|
1647
1661
|
validator: n,
|
|
1648
1662
|
pageSize: 25,
|
|
1649
1663
|
loadOnStart: !0,
|
|
1650
|
-
onLoadComplete: (
|
|
1664
|
+
onLoadComplete: (I) => {
|
|
1651
1665
|
},
|
|
1652
|
-
onDestroy: (
|
|
1666
|
+
onDestroy: (I) => {
|
|
1653
1667
|
},
|
|
1654
|
-
onError: (
|
|
1655
|
-
h(
|
|
1668
|
+
onError: (I, M) => {
|
|
1669
|
+
h(I), ne.showError(f().t("archbase:WARNING"), I, M);
|
|
1656
1670
|
}
|
|
1657
1671
|
}), o = Oe(
|
|
1658
1672
|
"ArchbaseApiTokenView-RemoteDataSource",
|
|
1659
|
-
|
|
1673
|
+
b,
|
|
1660
1674
|
void 0,
|
|
1661
1675
|
void 0
|
|
1662
|
-
),
|
|
1676
|
+
), s = `calc(${a} - 40px)`, p = /* @__PURE__ */ r(Ee, { children: [
|
|
1663
1677
|
/* @__PURE__ */ e(
|
|
1664
1678
|
L,
|
|
1665
1679
|
{
|
|
@@ -1667,11 +1681,11 @@ function wt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1667
1681
|
dataType: "image",
|
|
1668
1682
|
size: 80,
|
|
1669
1683
|
header: "Foto",
|
|
1670
|
-
render: (
|
|
1684
|
+
render: (I) => /* @__PURE__ */ e(
|
|
1671
1685
|
"img",
|
|
1672
1686
|
{
|
|
1673
1687
|
style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
|
|
1674
|
-
src:
|
|
1688
|
+
src: I.row.user && I.row.user.avatar ? atob(I.row.user.avatar) : sa
|
|
1675
1689
|
}
|
|
1676
1690
|
),
|
|
1677
1691
|
inputFilterType: "text",
|
|
@@ -1747,28 +1761,28 @@ function wt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1747
1761
|
dataType: "text",
|
|
1748
1762
|
size: 240,
|
|
1749
1763
|
header: "Validade",
|
|
1750
|
-
render: (
|
|
1751
|
-
if (!
|
|
1764
|
+
render: (I) => {
|
|
1765
|
+
if (!I.row.expirationDate)
|
|
1752
1766
|
return /* @__PURE__ */ e(c, { c: "dimmed", children: "Sem expiração" });
|
|
1753
1767
|
const M = /* @__PURE__ */ new Date();
|
|
1754
1768
|
M.setHours(0, 0, 0, 0);
|
|
1755
|
-
const F = new Date(
|
|
1769
|
+
const F = new Date(I.row.expirationDate);
|
|
1756
1770
|
F.setHours(0, 0, 0, 0);
|
|
1757
|
-
const
|
|
1758
|
-
let me = Math.max(0, Math.min(100,
|
|
1759
|
-
|
|
1760
|
-
const q =
|
|
1761
|
-
return /* @__PURE__ */ e(
|
|
1771
|
+
const C = F.getTime() - M.getTime(), k = Math.ceil(C / (1e3 * 60 * 60 * 24));
|
|
1772
|
+
let me = Math.max(0, Math.min(100, k / 365 * 100)), E = "green", P = "";
|
|
1773
|
+
k < 0 ? (E = "red", me = 100, P = `Vencido há ${Math.abs(k)} dia${Math.abs(k) !== 1 ? "s" : ""}`) : k === 0 ? (E = "red", me = 5, P = "Vence hoje") : k <= 7 ? (E = "red", P = `${k} dia${k !== 1 ? "s" : ""}`) : k <= 30 ? (E = "orange", P = `${k} dias`) : k <= 90 ? (E = "yellow", P = `${k} dias`) : (E = "green", P = `${k} dias`);
|
|
1774
|
+
const q = k < 0 ? `Vencido em ${F.toLocaleDateString()}` : `Expira em ${F.toLocaleDateString()}`;
|
|
1775
|
+
return /* @__PURE__ */ e(Ie, { label: q, withArrow: !0, children: /* @__PURE__ */ r(O, { gap: "xs", wrap: "nowrap", children: [
|
|
1762
1776
|
/* @__PURE__ */ e(
|
|
1763
1777
|
Xa,
|
|
1764
1778
|
{
|
|
1765
1779
|
size: 36,
|
|
1766
1780
|
thickness: 4,
|
|
1767
1781
|
roundCaps: !0,
|
|
1768
|
-
sections: [{ value:
|
|
1782
|
+
sections: [{ value: k < 0 ? 100 : me, color: E }]
|
|
1769
1783
|
}
|
|
1770
1784
|
),
|
|
1771
|
-
/* @__PURE__ */ e(c, { size: "sm", c:
|
|
1785
|
+
/* @__PURE__ */ e(c, { size: "sm", c: k < 0 ? "red" : void 0, fw: k <= 7 ? 600 : void 0, children: P })
|
|
1772
1786
|
] }) });
|
|
1773
1787
|
},
|
|
1774
1788
|
inputFilterType: "text"
|
|
@@ -1793,22 +1807,22 @@ function wt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1793
1807
|
}
|
|
1794
1808
|
)
|
|
1795
1809
|
] }), v = () => {
|
|
1796
|
-
|
|
1810
|
+
x.insert(yr.newInstance()), x && !D.isDataSourceV2 && D.v1State.forceUpdate(), g("apiToken");
|
|
1797
1811
|
}, $ = () => {
|
|
1798
|
-
|
|
1799
|
-
`${
|
|
1800
|
-
`${
|
|
1812
|
+
b.getCurrentRecord() && ve.showConfirmDialogYesNo(
|
|
1813
|
+
`${f().t("archbase:Confirme")}`,
|
|
1814
|
+
`${f().t("archbase:Deseja revogar o token de API do usuário ")}${b.getCurrentRecord().user.name} ?`,
|
|
1801
1815
|
async () => {
|
|
1802
|
-
await A.revoke(
|
|
1816
|
+
await A.revoke(b.getCurrentRecord().token).then(async () => {
|
|
1803
1817
|
ne.showSuccess(
|
|
1804
|
-
`${
|
|
1805
|
-
`${
|
|
1806
|
-
),
|
|
1807
|
-
}).catch((
|
|
1818
|
+
`${f().t("mentors:Informação")}`,
|
|
1819
|
+
`${f().t("mentors:Token de API revogado com sucesso!")}`
|
|
1820
|
+
), b.refreshData(), b && !o.isDataSourceV2 && o.v1State.forceUpdate();
|
|
1821
|
+
}).catch((I) => {
|
|
1808
1822
|
ve.showErrorWithDetails(
|
|
1809
|
-
`${
|
|
1810
|
-
Te(
|
|
1811
|
-
Ve(
|
|
1823
|
+
`${f().t("mentors:Atenção")}`,
|
|
1824
|
+
Te(I),
|
|
1825
|
+
Ve(I)
|
|
1812
1826
|
);
|
|
1813
1827
|
});
|
|
1814
1828
|
},
|
|
@@ -1817,35 +1831,35 @@ function wt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1817
1831
|
);
|
|
1818
1832
|
}, y = () => {
|
|
1819
1833
|
g("");
|
|
1820
|
-
}, i = async (
|
|
1821
|
-
const F =
|
|
1834
|
+
}, i = async (I, M) => {
|
|
1835
|
+
const F = x.getCurrentRecord();
|
|
1822
1836
|
if (F)
|
|
1823
1837
|
try {
|
|
1824
|
-
if (
|
|
1838
|
+
if (x.validate(), !F.user || !F.user.email) {
|
|
1825
1839
|
ve.showErrorWithDetails(
|
|
1826
|
-
`${
|
|
1827
|
-
`${
|
|
1840
|
+
`${f().t("archbase:WARNING")}`,
|
|
1841
|
+
`${f().t("archbase:Selecione um usuário para o token de API")}`,
|
|
1828
1842
|
""
|
|
1829
1843
|
);
|
|
1830
1844
|
return;
|
|
1831
1845
|
}
|
|
1832
|
-
await A.create(F.user.email, F.expirationDate, F.name, F.description).then(async (
|
|
1833
|
-
|
|
1834
|
-
`${
|
|
1835
|
-
`${
|
|
1846
|
+
await A.create(F.user.email, F.expirationDate, F.name, F.description).then(async (C) => {
|
|
1847
|
+
x.cancel(), x && !D.isDataSourceV2 && D.v1State.forceUpdate(), b.append(C), b && !o.isDataSourceV2 && o.v1State.forceUpdate(), ne.showSuccess(
|
|
1848
|
+
`${f().t("mentors:Informação")}`,
|
|
1849
|
+
`${f().t("mentors:Token de API gerado com sucesso!")}`
|
|
1836
1850
|
), M && M(!0);
|
|
1837
|
-
}).catch((
|
|
1851
|
+
}).catch((C) => {
|
|
1838
1852
|
ve.showErrorWithDetails(
|
|
1839
|
-
`${
|
|
1840
|
-
Te(
|
|
1841
|
-
Ve(
|
|
1853
|
+
`${f().t("mentors:Atenção")}`,
|
|
1854
|
+
Te(C),
|
|
1855
|
+
Ve(C)
|
|
1842
1856
|
);
|
|
1843
1857
|
});
|
|
1844
|
-
} catch (
|
|
1858
|
+
} catch (C) {
|
|
1845
1859
|
ve.showErrorWithDetails(
|
|
1846
|
-
`${
|
|
1847
|
-
Te(
|
|
1848
|
-
Ve(
|
|
1860
|
+
`${f().t("mentors:Atenção")}`,
|
|
1861
|
+
Te(C),
|
|
1862
|
+
Ve(C)
|
|
1849
1863
|
);
|
|
1850
1864
|
}
|
|
1851
1865
|
};
|
|
@@ -1855,7 +1869,7 @@ function wt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1855
1869
|
{
|
|
1856
1870
|
withBorder: !0,
|
|
1857
1871
|
style: {
|
|
1858
|
-
height:
|
|
1872
|
+
height: s,
|
|
1859
1873
|
display: "flex",
|
|
1860
1874
|
width: "100%",
|
|
1861
1875
|
flex: 1,
|
|
@@ -1863,14 +1877,14 @@ function wt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1863
1877
|
overflow: "auto"
|
|
1864
1878
|
},
|
|
1865
1879
|
children: /* @__PURE__ */ e(
|
|
1866
|
-
|
|
1880
|
+
ka,
|
|
1867
1881
|
{
|
|
1868
1882
|
gridRef: T,
|
|
1869
1883
|
printTitle: "Tokens de API",
|
|
1870
1884
|
width: "100%",
|
|
1871
1885
|
height: "100%",
|
|
1872
1886
|
withBorder: !1,
|
|
1873
|
-
dataSource:
|
|
1887
|
+
dataSource: b,
|
|
1874
1888
|
withColumnBorders: !0,
|
|
1875
1889
|
striped: !0,
|
|
1876
1890
|
enableTopToolbar: !0,
|
|
@@ -1882,8 +1896,8 @@ function wt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1882
1896
|
enableGlobalFilter: !0,
|
|
1883
1897
|
getRowId: R,
|
|
1884
1898
|
toolbarLeftContent: /* @__PURE__ */ e(Fe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ r(O, { align: "start", gap: "2px", wrap: "nowrap", children: [
|
|
1885
|
-
/* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Na, {}), onClick: v, children:
|
|
1886
|
-
/* @__PURE__ */ e(X, { disabled: !
|
|
1899
|
+
/* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Na, {}), onClick: v, children: f().t("archbase:New") }),
|
|
1900
|
+
/* @__PURE__ */ e(X, { disabled: !b.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e(la, {}), onClick: $, children: f().t("archbase:Revoke") })
|
|
1887
1901
|
] }) }),
|
|
1888
1902
|
children: p
|
|
1889
1903
|
}
|
|
@@ -1895,7 +1909,7 @@ function wt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1895
1909
|
{
|
|
1896
1910
|
onClickOk: y,
|
|
1897
1911
|
opened: !0,
|
|
1898
|
-
dataSource:
|
|
1912
|
+
dataSource: x,
|
|
1899
1913
|
onCustomSave: i,
|
|
1900
1914
|
onClickCancel: y
|
|
1901
1915
|
}
|
|
@@ -1914,23 +1928,23 @@ const Ge = (a) => {
|
|
|
1914
1928
|
return "gray";
|
|
1915
1929
|
}
|
|
1916
1930
|
}, Ur = ({ card: a, onOpen: t }) => {
|
|
1917
|
-
const
|
|
1931
|
+
const l = !!(t && a.metric);
|
|
1918
1932
|
return /* @__PURE__ */ e(
|
|
1919
1933
|
re,
|
|
1920
1934
|
{
|
|
1921
1935
|
withBorder: !0,
|
|
1922
1936
|
radius: "md",
|
|
1923
1937
|
p: "sm",
|
|
1924
|
-
role:
|
|
1925
|
-
tabIndex:
|
|
1926
|
-
"aria-label":
|
|
1927
|
-
onClick:
|
|
1928
|
-
onKeyDown:
|
|
1938
|
+
role: l ? "button" : void 0,
|
|
1939
|
+
tabIndex: l ? 0 : void 0,
|
|
1940
|
+
"aria-label": l ? `Ver os itens de ${a.label}` : void 0,
|
|
1941
|
+
onClick: l ? () => t?.(a) : void 0,
|
|
1942
|
+
onKeyDown: l ? (n) => {
|
|
1929
1943
|
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), t?.(a));
|
|
1930
1944
|
} : void 0,
|
|
1931
1945
|
style: {
|
|
1932
1946
|
borderLeft: `3px solid var(--mantine-color-${Ge(a.severity)}-6)`,
|
|
1933
|
-
cursor:
|
|
1947
|
+
cursor: l ? "pointer" : void 0
|
|
1934
1948
|
},
|
|
1935
1949
|
children: /* @__PURE__ */ r(U, { gap: 4, children: [
|
|
1936
1950
|
/* @__PURE__ */ r(O, { gap: 8, align: "baseline", wrap: "wrap", children: [
|
|
@@ -1942,42 +1956,42 @@ const Ge = (a) => {
|
|
|
1942
1956
|
] })
|
|
1943
1957
|
}
|
|
1944
1958
|
);
|
|
1945
|
-
}, Gr = ({ cards: a, onOpenCard: t }) => /* @__PURE__ */ e(We, { cols: { base: 1, sm: 2, lg: 3, xl: 4 }, spacing: "xs", children: a.map((
|
|
1959
|
+
}, Gr = ({ cards: a, onOpenCard: t }) => /* @__PURE__ */ e(We, { cols: { base: 1, sm: 2, lg: 3, xl: 4 }, spacing: "xs", children: a.map((l, n) => /* @__PURE__ */ e(Ur, { card: l, onOpen: t }, `${l.label}-${n}`)) }), Br = ({ flags: a }) => /* @__PURE__ */ e(We, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: a.map((t) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(U, { gap: 3, children: [
|
|
1946
1960
|
/* @__PURE__ */ e(c, { size: "10px", c: "dimmed", ff: "monospace", style: { wordBreak: "break-all" }, children: t.key }),
|
|
1947
1961
|
/* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
|
|
1948
1962
|
/* @__PURE__ */ e(j, { size: "xs", circle: !0, color: Ge(t.severity) }),
|
|
1949
1963
|
/* @__PURE__ */ e(c, { size: "sm", fw: 550, children: t.value })
|
|
1950
1964
|
] }),
|
|
1951
1965
|
t.description ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.4, children: t.description }) : null
|
|
1952
|
-
] }) }, t.key)) }), Hr = ({ attributes: a }) => /* @__PURE__ */ e(U, { gap: 7, children: a.map((t,
|
|
1966
|
+
] }) }, t.key)) }), Hr = ({ attributes: a }) => /* @__PURE__ */ e(U, { gap: 7, children: a.map((t, l) => /* @__PURE__ */ r(O, { gap: 12, wrap: "nowrap", justify: "space-between", children: [
|
|
1953
1967
|
/* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: t.label }),
|
|
1954
1968
|
/* @__PURE__ */ e(c, { size: "sm", fw: 600, ta: "right", children: t.value })
|
|
1955
|
-
] }, `${t.label}-${
|
|
1969
|
+
] }, `${t.label}-${l}`)) }), pe = ({ title: a, hint: t, children: l }) => /* @__PURE__ */ r(U, { gap: "xs", children: [
|
|
1956
1970
|
/* @__PURE__ */ r(O, { gap: 10, align: "baseline", wrap: "wrap", children: [
|
|
1957
1971
|
/* @__PURE__ */ e(c, { size: "xs", fw: 650, tt: "uppercase", style: { letterSpacing: ".05em" }, children: a }),
|
|
1958
1972
|
t ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: t }) : null
|
|
1959
1973
|
] }),
|
|
1960
|
-
|
|
1961
|
-
] }),
|
|
1962
|
-
const
|
|
1974
|
+
l
|
|
1975
|
+
] }), ke = ({ children: a, maxHeight: t = 420 }) => /* @__PURE__ */ e(ue.Autosize, { mah: t, type: "hover", offsetScrollbars: !0, children: /* @__PURE__ */ e(m.ScrollContainer, { minWidth: 480, type: "native", children: a }) }), qr = 25, Wr = ({ card: a, onClose: t }) => {
|
|
1976
|
+
const l = J(
|
|
1963
1977
|
K.SecurityDiagnostics
|
|
1964
|
-
), [n, u] =
|
|
1978
|
+
), [n, u] = S([]), [d, h] = S(1), [A, z] = S(1), [g, T] = S(0), [R, x] = S(!1), [D, b] = S(null), w = a?.metric;
|
|
1965
1979
|
return ee(() => {
|
|
1966
1980
|
h(1);
|
|
1967
1981
|
}, [w]), ee(() => {
|
|
1968
1982
|
if (!w)
|
|
1969
1983
|
return;
|
|
1970
1984
|
let o = !1;
|
|
1971
|
-
return
|
|
1972
|
-
o || (u(
|
|
1973
|
-
}).catch((
|
|
1974
|
-
o ||
|
|
1985
|
+
return x(!0), b(null), l.getOverviewItems(w, d - 1, qr).then((s) => {
|
|
1986
|
+
o || (u(s.content ?? []), T(s.totalElements ?? 0), z(Math.max(s.totalPages ?? 1, 1)));
|
|
1987
|
+
}).catch((s) => {
|
|
1988
|
+
o || b(s instanceof Error ? s.message : "Não foi possível carregar os itens.");
|
|
1975
1989
|
}).finally(() => {
|
|
1976
|
-
o ||
|
|
1990
|
+
o || x(!1);
|
|
1977
1991
|
}), () => {
|
|
1978
1992
|
o = !0;
|
|
1979
1993
|
};
|
|
1980
|
-
}, [
|
|
1994
|
+
}, [l, w, d]), /* @__PURE__ */ e(
|
|
1981
1995
|
_a,
|
|
1982
1996
|
{
|
|
1983
1997
|
opened: !!a,
|
|
@@ -2003,7 +2017,7 @@ const Ge = (a) => {
|
|
|
2003
2017
|
// O scroll fica NA TABELA, não no drawer: rolando o drawer, o cabeçalho some e
|
|
2004
2018
|
// uma coluna de valores sem cabeçalho deixa de dizer o que é. Aqui o cabeçalho
|
|
2005
2019
|
// gruda e o título, a contagem e a paginação ficam onde estavam.
|
|
2006
|
-
/* @__PURE__ */ e(
|
|
2020
|
+
/* @__PURE__ */ e(ke, { maxHeight: "calc(100vh - 260px)", children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2007
2021
|
/* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
|
|
2008
2022
|
/* @__PURE__ */ e(m.Th, { children: "Item" }),
|
|
2009
2023
|
/* @__PURE__ */ e(m.Th, { children: "Onde" }),
|
|
@@ -2016,7 +2030,7 @@ const Ge = (a) => {
|
|
|
2016
2030
|
] }, o.id)) })
|
|
2017
2031
|
] }) })
|
|
2018
2032
|
) : null,
|
|
2019
|
-
A > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(
|
|
2033
|
+
A > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(Ia, { value: d, onChange: h, total: A, size: "sm" }) }) : null
|
|
2020
2034
|
] })
|
|
2021
2035
|
}
|
|
2022
2036
|
);
|
|
@@ -2102,16 +2116,16 @@ const Ge = (a) => {
|
|
|
2102
2116
|
description: "Capacidade existe no catálogo e não foi concedida a ninguém."
|
|
2103
2117
|
}
|
|
2104
2118
|
], va = ({ slots: a, onError: t }) => {
|
|
2105
|
-
const
|
|
2119
|
+
const l = J(
|
|
2106
2120
|
K.SecurityDiagnostics
|
|
2107
|
-
), [n, u] =
|
|
2121
|
+
), [n, u] = S(void 0), [d, h] = S(!0), [A, z] = S(void 0), [g, T] = S(null);
|
|
2108
2122
|
ee(() => {
|
|
2109
2123
|
let D = !0;
|
|
2110
|
-
return h(!0),
|
|
2111
|
-
D && (u(
|
|
2112
|
-
}).catch((
|
|
2124
|
+
return h(!0), l.getOverview().then((b) => {
|
|
2125
|
+
D && (u(b), z(void 0));
|
|
2126
|
+
}).catch((b) => {
|
|
2113
2127
|
if (D) {
|
|
2114
|
-
const w = Te(
|
|
2128
|
+
const w = Te(b);
|
|
2115
2129
|
z(w), t?.(w);
|
|
2116
2130
|
}
|
|
2117
2131
|
}).finally(() => {
|
|
@@ -2119,11 +2133,11 @@ const Ge = (a) => {
|
|
|
2119
2133
|
}), () => {
|
|
2120
2134
|
D = !1;
|
|
2121
2135
|
};
|
|
2122
|
-
}, [
|
|
2136
|
+
}, [l]);
|
|
2123
2137
|
const R = ie(
|
|
2124
2138
|
() => n ? [...Zr(n), ...a?.additionalFlags?.(n) ?? []] : [],
|
|
2125
2139
|
[n, a]
|
|
2126
|
-
),
|
|
2140
|
+
), x = ie(
|
|
2127
2141
|
() => n ? [...Qr(n), ...a?.additionalOverviewCards?.(n) ?? []] : [],
|
|
2128
2142
|
[n, a]
|
|
2129
2143
|
);
|
|
@@ -2132,11 +2146,11 @@ const Ge = (a) => {
|
|
|
2132
2146
|
/* @__PURE__ */ e(Br, { flags: R }),
|
|
2133
2147
|
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.45, children: "Todas nascem com o padrão compatível — ligadas só quando alguém decide." })
|
|
2134
2148
|
] }),
|
|
2135
|
-
/* @__PURE__ */ e(pe, { title: "Catálogo e concessões", hint: "contagens vivas", children: /* @__PURE__ */ e(Gr, { cards:
|
|
2149
|
+
/* @__PURE__ */ e(pe, { title: "Catálogo e concessões", hint: "contagens vivas", children: /* @__PURE__ */ e(Gr, { cards: x, onOpenCard: T }) }),
|
|
2136
2150
|
a?.afterOverview?.(n),
|
|
2137
2151
|
/* @__PURE__ */ e(Wr, { card: g, onClose: () => T(null) })
|
|
2138
2152
|
] }) : null;
|
|
2139
|
-
}, Be = ({ value: a, onChange: t, assunto:
|
|
2153
|
+
}, Be = ({ value: a, onChange: t, assunto: l, visiveis: n, total: u }) => {
|
|
2140
2154
|
const d = typeof n == "number" && typeof u == "number" && n < u;
|
|
2141
2155
|
return /* @__PURE__ */ e(
|
|
2142
2156
|
he,
|
|
@@ -2144,20 +2158,20 @@ const Ge = (a) => {
|
|
|
2144
2158
|
size: "xs",
|
|
2145
2159
|
value: a,
|
|
2146
2160
|
onChange: (h) => t(h.currentTarget.value),
|
|
2147
|
-
placeholder:
|
|
2148
|
-
"aria-label":
|
|
2161
|
+
placeholder: l ? `Filtrar ${l}…` : "Filtrar…",
|
|
2162
|
+
"aria-label": l ? `Filtrar ${l}` : "Filtrar",
|
|
2149
2163
|
description: d ? `${n} de ${u}` : void 0,
|
|
2150
2164
|
rightSection: a ? /* @__PURE__ */ e(Ya, { size: "sm", onClick: () => t(""), "aria-label": "Limpar filtro" }) : null
|
|
2151
2165
|
}
|
|
2152
2166
|
);
|
|
2153
2167
|
}, Kr = /[̀-ͯ]/g, ya = (a) => a.toLocaleLowerCase().normalize("NFD").replace(Kr, ""), He = (a, t) => {
|
|
2154
|
-
const [
|
|
2155
|
-
const d = ya(
|
|
2168
|
+
const [l, n] = S(""), u = ie(() => {
|
|
2169
|
+
const d = ya(l.trim());
|
|
2156
2170
|
return d ? a.filter(
|
|
2157
2171
|
(h) => t(h).some((A) => A ? ya(A).includes(d) : !1)
|
|
2158
2172
|
) : a;
|
|
2159
|
-
}, [a,
|
|
2160
|
-
return { filtro:
|
|
2173
|
+
}, [a, l]);
|
|
2174
|
+
return { filtro: l, setFiltro: n, filtrados: u };
|
|
2161
2175
|
}, Ta = {
|
|
2162
2176
|
EFFECTIVE: { label: "Efetiva", color: "green" },
|
|
2163
2177
|
INERT: { label: "Inerte", color: "orange" },
|
|
@@ -2168,19 +2182,19 @@ const Ge = (a) => {
|
|
|
2168
2182
|
{ value: "INERT", label: "Só inertes" },
|
|
2169
2183
|
{ value: "DENIED", label: "Negadas" },
|
|
2170
2184
|
{ value: "inherited", label: "Só herdadas" }
|
|
2171
|
-
], _r = ({ slots: a, onError: t, userId:
|
|
2185
|
+
], _r = ({ slots: a, onError: t, userId: l }) => {
|
|
2172
2186
|
const n = J(
|
|
2173
2187
|
K.SecurityDiagnostics
|
|
2174
|
-
), [u, d] =
|
|
2188
|
+
), [u, d] = S(""), [h, A] = S(void 0), [z, g] = S(!1), [T, R] = S(void 0), [x, D] = S("all"), b = !!l, w = ae(
|
|
2175
2189
|
async (i) => {
|
|
2176
2190
|
const N = i.trim();
|
|
2177
2191
|
if (N) {
|
|
2178
2192
|
g(!0), R(void 0);
|
|
2179
2193
|
try {
|
|
2180
|
-
const
|
|
2181
|
-
A(
|
|
2182
|
-
} catch (
|
|
2183
|
-
const M = Te(
|
|
2194
|
+
const I = N.includes("@") ? await n.getEffectiveAccessByEmail(N) : await n.getEffectiveAccessByUserId(N);
|
|
2195
|
+
A(I);
|
|
2196
|
+
} catch (I) {
|
|
2197
|
+
const M = Te(I);
|
|
2184
2198
|
R(M), t?.(M), A(void 0);
|
|
2185
2199
|
} finally {
|
|
2186
2200
|
g(!1);
|
|
@@ -2192,17 +2206,17 @@ const Ge = (a) => {
|
|
|
2192
2206
|
{ label: "Perfil", value: h.profileName || "—" },
|
|
2193
2207
|
{ label: "Grupos", value: h.groupNames.length ? h.groupNames.join(", ") : "—" },
|
|
2194
2208
|
...a?.userAttributes?.(h) ?? []
|
|
2195
|
-
] : [], [h, a]),
|
|
2209
|
+
] : [], [h, a]), s = ie(() => h ? x === "all" ? h.capabilities : x === "inherited" ? h.capabilities.filter((i) => i.grantedByType !== "USER") : h.capabilities.filter((i) => i.situation === x) : [], [h, x]), {
|
|
2196
2210
|
filtro: p,
|
|
2197
2211
|
setFiltro: v,
|
|
2198
2212
|
filtrados: $
|
|
2199
|
-
} = He(
|
|
2213
|
+
} = He(s, (i) => [i.resource, i.action, i.grantedByName]);
|
|
2200
2214
|
ee(() => {
|
|
2201
|
-
|
|
2202
|
-
}, [
|
|
2215
|
+
l && (D("all"), w(l));
|
|
2216
|
+
}, [l, w]);
|
|
2203
2217
|
const y = a?.additionalCapabilityColumns ?? [];
|
|
2204
2218
|
return /* @__PURE__ */ r(U, { gap: "lg", children: [
|
|
2205
|
-
|
|
2219
|
+
b ? null : /* @__PURE__ */ e(pe, { title: "Consultar", hint: "por e-mail ou id do usuário", children: a?.renderUserSearch ? a.renderUserSearch((i) => {
|
|
2206
2220
|
d(i), w(i);
|
|
2207
2221
|
}) : /* @__PURE__ */ r(O, { gap: "xs", align: "flex-end", children: [
|
|
2208
2222
|
/* @__PURE__ */ e(
|
|
@@ -2222,7 +2236,7 @@ const Ge = (a) => {
|
|
|
2222
2236
|
] }) }),
|
|
2223
2237
|
T ? /* @__PURE__ */ e(ce, { color: "red", title: "Não foi possível ler o efetivo", children: T }) : null,
|
|
2224
2238
|
z && !h ? /* @__PURE__ */ e(se, { size: "sm" }) : null,
|
|
2225
|
-
h ? /* @__PURE__ */ r(
|
|
2239
|
+
h ? /* @__PURE__ */ r(xe, { children: [
|
|
2226
2240
|
/* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(U, { gap: "sm", children: [
|
|
2227
2241
|
/* @__PURE__ */ r(O, { gap: 8, wrap: "wrap", align: "center", children: [
|
|
2228
2242
|
/* @__PURE__ */ e(c, { fw: 620, children: h.userLabel }),
|
|
@@ -2242,13 +2256,13 @@ const Ge = (a) => {
|
|
|
2242
2256
|
["efetivas", h.effective, "ok"],
|
|
2243
2257
|
["inertes", h.inert, "warning"],
|
|
2244
2258
|
["negadas", h.denied, "critical"]
|
|
2245
|
-
].map(([i, N,
|
|
2246
|
-
/* @__PURE__ */ e(c, { size: "1.3rem", fw: 620, c: Ge(
|
|
2259
|
+
].map(([i, N, I]) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(U, { gap: 2, children: [
|
|
2260
|
+
/* @__PURE__ */ e(c, { size: "1.3rem", fw: 620, c: Ge(I), children: N }),
|
|
2247
2261
|
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: i })
|
|
2248
2262
|
] }) }, i)) }),
|
|
2249
2263
|
a?.afterEffectiveTally?.(h),
|
|
2250
2264
|
/* @__PURE__ */ r(pe, { title: "Capacidades", hint: `${h.capabilities.length} no total`, children: [
|
|
2251
|
-
/* @__PURE__ */ e(ha.Group, { multiple: !1, value:
|
|
2265
|
+
/* @__PURE__ */ e(ha.Group, { multiple: !1, value: x, onChange: (i) => D(i), children: /* @__PURE__ */ e(O, { gap: 6, children: Xr.map((i) => /* @__PURE__ */ e(ha, { value: i.value, size: "xs", variant: "outline", children: i.label }, i.value)) }) }),
|
|
2252
2266
|
/* @__PURE__ */ e(
|
|
2253
2267
|
Be,
|
|
2254
2268
|
{
|
|
@@ -2256,10 +2270,10 @@ const Ge = (a) => {
|
|
|
2256
2270
|
onChange: v,
|
|
2257
2271
|
assunto: "capacidades",
|
|
2258
2272
|
visiveis: $.length,
|
|
2259
|
-
total:
|
|
2273
|
+
total: s.length
|
|
2260
2274
|
}
|
|
2261
2275
|
),
|
|
2262
|
-
/* @__PURE__ */ e(
|
|
2276
|
+
/* @__PURE__ */ e(ke, { maxHeight: "calc(100vh - 460px)", children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2263
2277
|
/* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
|
|
2264
2278
|
/* @__PURE__ */ e(m.Th, { children: "Capacidade" }),
|
|
2265
2279
|
/* @__PURE__ */ e(m.Th, { children: "Origem" }),
|
|
@@ -2281,18 +2295,18 @@ const Ge = (a) => {
|
|
|
2281
2295
|
i.grantedByName
|
|
2282
2296
|
] }) }),
|
|
2283
2297
|
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(j, { color: Ta[i.situation].color, variant: "light", children: Ta[i.situation].label }) }),
|
|
2284
|
-
y.map((
|
|
2298
|
+
y.map((I) => /* @__PURE__ */ e(m.Td, { children: I.render(i, h) }, I.header))
|
|
2285
2299
|
] }, `${i.resource}:${i.action}:${N}`)),
|
|
2286
|
-
|
|
2300
|
+
s.length === 0 ? /* @__PURE__ */ e(m.Tr, { children: /* @__PURE__ */ e(m.Td, { colSpan: 3 + y.length, children: /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", ta: "center", py: "md", children: "Nenhuma capacidade neste filtro." }) }) }) : null
|
|
2287
2301
|
] })
|
|
2288
2302
|
] }) })
|
|
2289
2303
|
] })
|
|
2290
2304
|
] }) : null
|
|
2291
2305
|
] });
|
|
2292
|
-
}, wa = 40,
|
|
2306
|
+
}, wa = 40, Sa = ({
|
|
2293
2307
|
label: a,
|
|
2294
2308
|
valor: t,
|
|
2295
|
-
placeholder:
|
|
2309
|
+
placeholder: l,
|
|
2296
2310
|
branch: n,
|
|
2297
2311
|
somenteFolhas: u,
|
|
2298
2312
|
branchDosFilhos: d,
|
|
@@ -2300,14 +2314,14 @@ const Ge = (a) => {
|
|
|
2300
2314
|
}) => {
|
|
2301
2315
|
const A = J(
|
|
2302
2316
|
K.SecurityDiagnostics
|
|
2303
|
-
), [z, g] =
|
|
2304
|
-
async (
|
|
2317
|
+
), [z, g] = S(!1), [T, R] = S(""), [x, D] = S([]), [b, w] = S({}), [o, s] = S(), [p, v] = S(!1), [$, y] = S(), i = ae(
|
|
2318
|
+
async (C) => {
|
|
2305
2319
|
v(!0), y(void 0);
|
|
2306
2320
|
try {
|
|
2307
|
-
const
|
|
2308
|
-
D(
|
|
2309
|
-
} catch (
|
|
2310
|
-
y(
|
|
2321
|
+
const k = await A.browse(n, { q: C || void 0, page: 0, size: wa });
|
|
2322
|
+
D(k.content ?? []);
|
|
2323
|
+
} catch (k) {
|
|
2324
|
+
y(k instanceof Error ? k.message : "Não foi possível carregar.");
|
|
2311
2325
|
} finally {
|
|
2312
2326
|
v(!1);
|
|
2313
2327
|
}
|
|
@@ -2317,63 +2331,63 @@ const Ge = (a) => {
|
|
|
2317
2331
|
ee(() => {
|
|
2318
2332
|
if (!z)
|
|
2319
2333
|
return;
|
|
2320
|
-
const
|
|
2321
|
-
return () => clearTimeout(
|
|
2334
|
+
const C = setTimeout(() => void i(T), T ? 300 : 0);
|
|
2335
|
+
return () => clearTimeout(C);
|
|
2322
2336
|
}, [z, T, i]);
|
|
2323
2337
|
const N = ae(
|
|
2324
|
-
async (
|
|
2325
|
-
if (o ===
|
|
2326
|
-
|
|
2338
|
+
async (C) => {
|
|
2339
|
+
if (o === C.id) {
|
|
2340
|
+
s(void 0);
|
|
2327
2341
|
return;
|
|
2328
2342
|
}
|
|
2329
|
-
if (
|
|
2343
|
+
if (s(C.id), !b[C.id])
|
|
2330
2344
|
try {
|
|
2331
|
-
const
|
|
2332
|
-
parentId:
|
|
2345
|
+
const k = await A.browse(d ?? n, {
|
|
2346
|
+
parentId: C.id,
|
|
2333
2347
|
page: 0,
|
|
2334
2348
|
size: wa
|
|
2335
2349
|
});
|
|
2336
|
-
w((oe) => ({ ...oe, [
|
|
2337
|
-
} catch (
|
|
2338
|
-
y(
|
|
2350
|
+
w((oe) => ({ ...oe, [C.id]: k.content ?? [] }));
|
|
2351
|
+
} catch (k) {
|
|
2352
|
+
y(k instanceof Error ? k.message : "Não foi possível abrir.");
|
|
2339
2353
|
}
|
|
2340
2354
|
},
|
|
2341
|
-
[A, n, d, o,
|
|
2342
|
-
),
|
|
2343
|
-
h(
|
|
2344
|
-
}, M = (
|
|
2345
|
-
const oe =
|
|
2355
|
+
[A, n, d, o, b]
|
|
2356
|
+
), I = (C, k) => {
|
|
2357
|
+
h(C, k), g(!1);
|
|
2358
|
+
}, M = (C, k) => {
|
|
2359
|
+
const oe = C.hasChildren;
|
|
2346
2360
|
return /* @__PURE__ */ e(
|
|
2347
2361
|
ze,
|
|
2348
2362
|
{
|
|
2349
|
-
onClick: () => oe && u ? void N(
|
|
2363
|
+
onClick: () => oe && u ? void N(C) : I(C, k),
|
|
2350
2364
|
style: {
|
|
2351
2365
|
display: "block",
|
|
2352
2366
|
width: "100%",
|
|
2353
2367
|
padding: "5px 8px",
|
|
2354
|
-
paddingLeft:
|
|
2368
|
+
paddingLeft: k ? 24 : 8,
|
|
2355
2369
|
borderRadius: 4
|
|
2356
2370
|
},
|
|
2357
2371
|
children: /* @__PURE__ */ r(O, { gap: 6, wrap: "nowrap", children: [
|
|
2358
|
-
/* @__PURE__ */ e(c, { size: "sm", fw: !u || !oe ? 500 : 600, truncate: !0, children:
|
|
2359
|
-
|
|
2372
|
+
/* @__PURE__ */ e(c, { size: "sm", fw: !u || !oe ? 500 : 600, truncate: !0, children: C.label }),
|
|
2373
|
+
C.badge ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: C.badge }) : null
|
|
2360
2374
|
] })
|
|
2361
2375
|
},
|
|
2362
|
-
`${
|
|
2376
|
+
`${k?.id ?? "raiz"}:${C.id}`
|
|
2363
2377
|
);
|
|
2364
|
-
}, F = (
|
|
2365
|
-
M(
|
|
2366
|
-
o ===
|
|
2367
|
-
] }, `ramo:${
|
|
2378
|
+
}, F = (C) => /* @__PURE__ */ r(Y, { children: [
|
|
2379
|
+
M(C),
|
|
2380
|
+
o === C.id ? (b[C.id] ?? []).map((k) => M(k, C)) : null
|
|
2381
|
+
] }, `ramo:${C.id}`);
|
|
2368
2382
|
return /* @__PURE__ */ r(Je, { opened: z, onChange: g, width: 340, position: "bottom-start", withinPortal: !0, shadow: "md", children: [
|
|
2369
2383
|
/* @__PURE__ */ e(Je.Target, { children: /* @__PURE__ */ e(
|
|
2370
2384
|
he,
|
|
2371
2385
|
{
|
|
2372
2386
|
label: a,
|
|
2373
|
-
placeholder:
|
|
2387
|
+
placeholder: l,
|
|
2374
2388
|
value: t ?? "",
|
|
2375
2389
|
readOnly: !0,
|
|
2376
|
-
onClick: () => g((
|
|
2390
|
+
onClick: () => g((C) => !C),
|
|
2377
2391
|
styles: { input: { cursor: "pointer" } }
|
|
2378
2392
|
}
|
|
2379
2393
|
) }),
|
|
@@ -2384,7 +2398,7 @@ const Ge = (a) => {
|
|
|
2384
2398
|
size: "xs",
|
|
2385
2399
|
placeholder: "Buscar…",
|
|
2386
2400
|
value: T,
|
|
2387
|
-
onChange: (
|
|
2401
|
+
onChange: (C) => R(C.currentTarget.value),
|
|
2388
2402
|
mb: 6,
|
|
2389
2403
|
autoFocus: !0
|
|
2390
2404
|
}
|
|
@@ -2394,8 +2408,8 @@ const Ge = (a) => {
|
|
|
2394
2408
|
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "Carregando…" })
|
|
2395
2409
|
] }) : null,
|
|
2396
2410
|
$ ? /* @__PURE__ */ e(c, { size: "xs", c: "red", p: 6, children: $ }) : null,
|
|
2397
|
-
!p && !$ &&
|
|
2398
|
-
/* @__PURE__ */ e(ue.Autosize, { mah: 280, type: "hover", children:
|
|
2411
|
+
!p && !$ && x.length === 0 ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", p: 6, children: "Nada encontrado." }) : null,
|
|
2412
|
+
/* @__PURE__ */ e(ue.Autosize, { mah: 280, type: "hover", children: x.map((C) => F(C)) })
|
|
2399
2413
|
] })
|
|
2400
2414
|
] });
|
|
2401
2415
|
}, Yr = [
|
|
@@ -2404,41 +2418,41 @@ const Ge = (a) => {
|
|
|
2404
2418
|
{ gate: "RESTRICTION", titulo: "Restrições", papel: "só nega", pergunta: "Perfil, papel e persona exigidos pela anotação." },
|
|
2405
2419
|
{ gate: "LEVEL", titulo: "Nível", papel: "só nega", pergunta: "O nível da pessoa alcança o piso da capacidade?" },
|
|
2406
2420
|
{ gate: "GRANT", titulo: "Concessão", papel: "concede", pergunta: "Existe permissão, sem negação explícita?" }
|
|
2407
|
-
], et = ({ slots: a, onError: t, initial:
|
|
2421
|
+
], et = ({ slots: a, onError: t, initial: l }) => {
|
|
2408
2422
|
const n = J(
|
|
2409
2423
|
K.SecurityDiagnostics
|
|
2410
|
-
), [u, d] =
|
|
2424
|
+
), [u, d] = S(""), [h, A] = S(""), [z, g] = S(""), [T, R] = S(""), [x, D] = S({}), [b, w] = S(void 0), [o, s] = S(!1), [p, v] = S(void 0);
|
|
2411
2425
|
ee(() => {
|
|
2412
|
-
|
|
2413
|
-
}, [
|
|
2426
|
+
l && (l.userId && d(l.userId), l.userLabel && A(l.userLabel), l.resource && g(l.resource), l.action && R(l.action), w(void 0));
|
|
2427
|
+
}, [l?.userId, l?.userLabel, l?.resource, l?.action]);
|
|
2414
2428
|
const $ = ae(async () => {
|
|
2415
2429
|
if (!(!u.trim() || !z.trim() || !T.trim())) {
|
|
2416
|
-
|
|
2430
|
+
s(!0), v(void 0);
|
|
2417
2431
|
try {
|
|
2418
2432
|
const i = u.trim(), N = await n.simulate({
|
|
2419
2433
|
...i.includes("@") ? { email: i } : { userId: i },
|
|
2420
2434
|
resource: z.trim(),
|
|
2421
2435
|
action: T.trim(),
|
|
2422
|
-
companyId:
|
|
2423
|
-
projectId:
|
|
2436
|
+
companyId: x.companyId,
|
|
2437
|
+
projectId: x.projectId
|
|
2424
2438
|
});
|
|
2425
2439
|
w(N);
|
|
2426
2440
|
} catch (i) {
|
|
2427
2441
|
const N = Te(i);
|
|
2428
2442
|
v(N), t?.(N), w(void 0);
|
|
2429
2443
|
} finally {
|
|
2430
|
-
|
|
2444
|
+
s(!1);
|
|
2431
2445
|
}
|
|
2432
2446
|
}
|
|
2433
|
-
}, [n, u, z, T,
|
|
2434
|
-
const
|
|
2435
|
-
return
|
|
2447
|
+
}, [n, u, z, T, x, t]), y = (i, N) => {
|
|
2448
|
+
const I = N.chain?.find((M) => M.gate === i);
|
|
2449
|
+
return I ? I.passed ? "passou" : "negou" : "nao-avaliado";
|
|
2436
2450
|
};
|
|
2437
2451
|
return /* @__PURE__ */ r(U, { gap: "lg", children: [
|
|
2438
2452
|
/* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(U, { gap: "sm", children: [
|
|
2439
2453
|
/* @__PURE__ */ r(We, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: [
|
|
2440
2454
|
/* @__PURE__ */ e(
|
|
2441
|
-
|
|
2455
|
+
Sa,
|
|
2442
2456
|
{
|
|
2443
2457
|
label: "Usuário",
|
|
2444
2458
|
placeholder: "escolher pessoa",
|
|
@@ -2450,7 +2464,7 @@ const Ge = (a) => {
|
|
|
2450
2464
|
}
|
|
2451
2465
|
),
|
|
2452
2466
|
/* @__PURE__ */ e(
|
|
2453
|
-
|
|
2467
|
+
Sa,
|
|
2454
2468
|
{
|
|
2455
2469
|
label: "Recurso e ação",
|
|
2456
2470
|
placeholder: "escolher capacidade",
|
|
@@ -2468,7 +2482,7 @@ const Ge = (a) => {
|
|
|
2468
2482
|
{
|
|
2469
2483
|
label: "Empresa (opcional)",
|
|
2470
2484
|
placeholder: "companyId",
|
|
2471
|
-
value:
|
|
2485
|
+
value: x.companyId ?? "",
|
|
2472
2486
|
onChange: (i) => D((N) => ({ ...N, companyId: i.currentTarget.value || void 0 }))
|
|
2473
2487
|
}
|
|
2474
2488
|
)
|
|
@@ -2480,10 +2494,10 @@ const Ge = (a) => {
|
|
|
2480
2494
|
] })
|
|
2481
2495
|
] }) }),
|
|
2482
2496
|
p ? /* @__PURE__ */ e(ce, { color: "red", title: "Não foi possível simular", children: p }) : null,
|
|
2483
|
-
o && !
|
|
2484
|
-
|
|
2497
|
+
o && !b ? /* @__PURE__ */ e(se, { size: "sm" }) : null,
|
|
2498
|
+
b ? /* @__PURE__ */ r(xe, { children: [
|
|
2485
2499
|
/* @__PURE__ */ e(pe, { title: "Cadeia de decisão", hint: "os quatro primeiros só negam; só o quinto concede", children: /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ e(U, { gap: "sm", children: Yr.map((i, N) => {
|
|
2486
|
-
const
|
|
2500
|
+
const I = y(i.gate, b), M = b.chain?.find((F) => F.gate === i.gate)?.detail;
|
|
2487
2501
|
return /* @__PURE__ */ r(O, { align: "flex-start", wrap: "nowrap", gap: "sm", children: [
|
|
2488
2502
|
/* @__PURE__ */ e(c, { size: "xs", ff: "monospace", c: "dimmed", w: 16, children: N + 1 }),
|
|
2489
2503
|
/* @__PURE__ */ r(U, { gap: 2, style: { flex: 1, minWidth: 0 }, children: [
|
|
@@ -2493,8 +2507,8 @@ const Ge = (a) => {
|
|
|
2493
2507
|
{
|
|
2494
2508
|
size: "sm",
|
|
2495
2509
|
fw: 600,
|
|
2496
|
-
c:
|
|
2497
|
-
opacity:
|
|
2510
|
+
c: I === "negou" ? "red" : void 0,
|
|
2511
|
+
opacity: I === "nao-avaliado" ? 0.5 : 1,
|
|
2498
2512
|
children: i.titulo
|
|
2499
2513
|
}
|
|
2500
2514
|
),
|
|
@@ -2503,29 +2517,29 @@ const Ge = (a) => {
|
|
|
2503
2517
|
i.papel
|
|
2504
2518
|
] })
|
|
2505
2519
|
] }),
|
|
2506
|
-
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", opacity:
|
|
2520
|
+
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", opacity: I === "nao-avaliado" ? 0.5 : 1, children: i.pergunta }),
|
|
2507
2521
|
M ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: M }) : null
|
|
2508
2522
|
] }),
|
|
2509
2523
|
/* @__PURE__ */ e(
|
|
2510
2524
|
j,
|
|
2511
2525
|
{
|
|
2512
2526
|
variant: "light",
|
|
2513
|
-
color:
|
|
2514
|
-
children:
|
|
2527
|
+
color: I === "negou" ? "red" : I === "passou" ? "green" : "gray",
|
|
2528
|
+
children: I === "nao-avaliado" ? "não avaliado" : I
|
|
2515
2529
|
}
|
|
2516
2530
|
)
|
|
2517
2531
|
] }, i.gate);
|
|
2518
2532
|
}) }) }) }),
|
|
2519
|
-
/* @__PURE__ */ e(ce, { color:
|
|
2520
|
-
/* @__PURE__ */ e(c, { size: "sm", children:
|
|
2533
|
+
/* @__PURE__ */ e(ce, { color: b.allowed ? "green" : "red", title: b.allowed ? "Pode" : "Não pode", children: /* @__PURE__ */ r(U, { gap: 6, children: [
|
|
2534
|
+
/* @__PURE__ */ e(c, { size: "sm", children: b.message }),
|
|
2521
2535
|
/* @__PURE__ */ r(c, { size: "xs", ff: "monospace", c: "dimmed", children: [
|
|
2522
2536
|
"reasonCode: ",
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2537
|
+
b.reasonCode,
|
|
2538
|
+
b.deniedAt ? ` · deniedAt: ${b.deniedAt}` : "",
|
|
2539
|
+
b.grantedByName ? ` · grantedBy: ${b.grantedByName}` : ""
|
|
2526
2540
|
] })
|
|
2527
2541
|
] }) }),
|
|
2528
|
-
a?.afterDecision?.(
|
|
2542
|
+
a?.afterDecision?.(b)
|
|
2529
2543
|
] }) : null
|
|
2530
2544
|
] });
|
|
2531
2545
|
}, Oa = (a) => {
|
|
@@ -2539,22 +2553,22 @@ const Ge = (a) => {
|
|
|
2539
2553
|
default:
|
|
2540
2554
|
return /* @__PURE__ */ e(j, { size: "sm", color: "gray", variant: "light", children: "—" });
|
|
2541
2555
|
}
|
|
2542
|
-
}, at = ({ id: a, label: t, slots:
|
|
2556
|
+
}, at = ({ id: a, label: t, slots: l, onSelectUser: n, onSimulate: u }) => {
|
|
2543
2557
|
const d = J(
|
|
2544
2558
|
K.SecurityDiagnostics
|
|
2545
|
-
), [h, A] =
|
|
2559
|
+
), [h, A] = S([]), {
|
|
2546
2560
|
filtro: z,
|
|
2547
2561
|
setFiltro: g,
|
|
2548
2562
|
filtrados: T
|
|
2549
|
-
} = He(h, (o) => [o.userName, o.email, o.via]), [R,
|
|
2563
|
+
} = He(h, (o) => [o.userName, o.email, o.via]), [R, x] = S(!0), [D, b] = S();
|
|
2550
2564
|
ee(() => {
|
|
2551
2565
|
let o = !1;
|
|
2552
|
-
return
|
|
2553
|
-
o || A(
|
|
2554
|
-
}).catch((
|
|
2555
|
-
o ||
|
|
2566
|
+
return x(!0), b(void 0), d.getReach(a).then((s) => {
|
|
2567
|
+
o || A(s ?? []);
|
|
2568
|
+
}).catch((s) => {
|
|
2569
|
+
o || b(s instanceof Error ? s.message : "Não foi possível carregar.");
|
|
2556
2570
|
}).finally(() => {
|
|
2557
|
-
o ||
|
|
2571
|
+
o || x(!1);
|
|
2558
2572
|
}), () => {
|
|
2559
2573
|
o = !0;
|
|
2560
2574
|
};
|
|
@@ -2571,7 +2585,7 @@ const Ge = (a) => {
|
|
|
2571
2585
|
{
|
|
2572
2586
|
title: "Quem alcança",
|
|
2573
2587
|
hint: R ? "carregando…" : `${h.length} ${h.length === 1 ? "pessoa" : "pessoas"}`,
|
|
2574
|
-
children: R ? /* @__PURE__ */ e(se, { size: "sm" }) : h.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Ninguém. A capacidade existe no catálogo e nunca foi concedida." }) : /* @__PURE__ */ r(
|
|
2588
|
+
children: R ? /* @__PURE__ */ e(se, { size: "sm" }) : h.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Ninguém. A capacidade existe no catálogo e nunca foi concedida." }) : /* @__PURE__ */ r(xe, { children: [
|
|
2575
2589
|
/* @__PURE__ */ e(
|
|
2576
2590
|
Be,
|
|
2577
2591
|
{
|
|
@@ -2582,7 +2596,7 @@ const Ge = (a) => {
|
|
|
2582
2596
|
total: h.length
|
|
2583
2597
|
}
|
|
2584
2598
|
),
|
|
2585
|
-
/* @__PURE__ */ e(
|
|
2599
|
+
/* @__PURE__ */ e(ke, { children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2586
2600
|
/* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
|
|
2587
2601
|
/* @__PURE__ */ e(m.Th, { children: "Pessoa" }),
|
|
2588
2602
|
/* @__PURE__ */ e(m.Th, { children: "Por qual via" }),
|
|
@@ -2615,22 +2629,22 @@ const Ge = (a) => {
|
|
|
2615
2629
|
] })
|
|
2616
2630
|
}
|
|
2617
2631
|
),
|
|
2618
|
-
|
|
2632
|
+
l?.afterReachList?.(a, h),
|
|
2619
2633
|
u ? /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", children: [
|
|
2620
2634
|
"Para testar uma pessoa específica contra esta capacidade, use ",
|
|
2621
2635
|
/* @__PURE__ */ e("strong", { children: "Simular" }),
|
|
2622
2636
|
" na árvore — ela já vem escolhida."
|
|
2623
2637
|
] }) : null
|
|
2624
2638
|
] });
|
|
2625
|
-
},
|
|
2639
|
+
}, xa = ({ id: a, kind: t, slots: l, onSelectUser: n }) => {
|
|
2626
2640
|
const u = J(
|
|
2627
2641
|
K.SecurityDiagnostics
|
|
2628
|
-
), [d, h] =
|
|
2642
|
+
), [d, h] = S(), [A, z] = S(!0), [g, T] = S(), {
|
|
2629
2643
|
filtro: R,
|
|
2630
|
-
setFiltro:
|
|
2644
|
+
setFiltro: x,
|
|
2631
2645
|
filtrados: D
|
|
2632
2646
|
} = He(d?.members ?? [], (v) => [v.name, v.email, v.profileName ?? void 0]), {
|
|
2633
|
-
filtro:
|
|
2647
|
+
filtro: b,
|
|
2634
2648
|
setFiltro: w,
|
|
2635
2649
|
filtrados: o
|
|
2636
2650
|
} = He(d?.grants ?? [], (v) => [v.resource, v.action]);
|
|
@@ -2654,12 +2668,12 @@ const Ge = (a) => {
|
|
|
2654
2668
|
return /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao carregar", children: g });
|
|
2655
2669
|
if (!d)
|
|
2656
2670
|
return null;
|
|
2657
|
-
const
|
|
2671
|
+
const s = t === "GROUP" ? "grupo" : "perfil", p = l?.additionalMemberColumns ?? [];
|
|
2658
2672
|
return /* @__PURE__ */ r(U, { gap: "lg", children: [
|
|
2659
2673
|
/* @__PURE__ */ r(U, { gap: 4, children: [
|
|
2660
2674
|
/* @__PURE__ */ r(O, { gap: 8, children: [
|
|
2661
2675
|
/* @__PURE__ */ e(c, { fw: 620, size: "xl", children: d.groupName }),
|
|
2662
|
-
/* @__PURE__ */ e(j, { variant: "light", children:
|
|
2676
|
+
/* @__PURE__ */ e(j, { variant: "light", children: s })
|
|
2663
2677
|
] }),
|
|
2664
2678
|
d.description ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: d.description }) : null
|
|
2665
2679
|
] }),
|
|
@@ -2673,18 +2687,18 @@ const Ge = (a) => {
|
|
|
2673
2687
|
"Ninguém está ",
|
|
2674
2688
|
t === "GROUP" ? "neste grupo" : "com este perfil",
|
|
2675
2689
|
"."
|
|
2676
|
-
] }) : /* @__PURE__ */ r(
|
|
2690
|
+
] }) : /* @__PURE__ */ r(xe, { children: [
|
|
2677
2691
|
/* @__PURE__ */ e(
|
|
2678
2692
|
Be,
|
|
2679
2693
|
{
|
|
2680
2694
|
value: R,
|
|
2681
|
-
onChange:
|
|
2695
|
+
onChange: x,
|
|
2682
2696
|
assunto: "pessoas",
|
|
2683
2697
|
visiveis: D.length,
|
|
2684
2698
|
total: d.members.length
|
|
2685
2699
|
}
|
|
2686
2700
|
),
|
|
2687
|
-
/* @__PURE__ */ e(
|
|
2701
|
+
/* @__PURE__ */ e(ke, { children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2688
2702
|
/* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
|
|
2689
2703
|
/* @__PURE__ */ e(m.Th, { children: "Pessoa" }),
|
|
2690
2704
|
/* @__PURE__ */ e(m.Th, { children: "Perfil" }),
|
|
@@ -2728,18 +2742,18 @@ const Ge = (a) => {
|
|
|
2728
2742
|
]
|
|
2729
2743
|
}
|
|
2730
2744
|
),
|
|
2731
|
-
/* @__PURE__ */ e(pe, { title: `O que este ${
|
|
2745
|
+
/* @__PURE__ */ e(pe, { title: `O que este ${s} concede`, hint: "a parte que é responsabilidade dele", children: d.grants.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Nada concedido por esta via." }) : /* @__PURE__ */ r(xe, { children: [
|
|
2732
2746
|
/* @__PURE__ */ e(
|
|
2733
2747
|
Be,
|
|
2734
2748
|
{
|
|
2735
|
-
value:
|
|
2749
|
+
value: b,
|
|
2736
2750
|
onChange: w,
|
|
2737
2751
|
assunto: "capacidades",
|
|
2738
2752
|
visiveis: o.length,
|
|
2739
2753
|
total: d.grants.length
|
|
2740
2754
|
}
|
|
2741
2755
|
),
|
|
2742
|
-
/* @__PURE__ */ e(
|
|
2756
|
+
/* @__PURE__ */ e(ke, { children: /* @__PURE__ */ r(m, { striped: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2743
2757
|
/* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
|
|
2744
2758
|
/* @__PURE__ */ e(m.Th, { children: "Capacidade" }),
|
|
2745
2759
|
/* @__PURE__ */ e(m.Th, { children: "Situação" })
|
|
@@ -2754,9 +2768,9 @@ const Ge = (a) => {
|
|
|
2754
2768
|
] }, `${v.resource}-${v.action}-${$}`)) })
|
|
2755
2769
|
] }) })
|
|
2756
2770
|
] }) }),
|
|
2757
|
-
|
|
2771
|
+
l?.afterGroupMembers?.(d)
|
|
2758
2772
|
] });
|
|
2759
|
-
},
|
|
2773
|
+
}, Ca = 50, aa = [
|
|
2760
2774
|
{ branch: "USERS", label: "Pessoas" },
|
|
2761
2775
|
{ branch: "GROUPS", label: "Grupos" },
|
|
2762
2776
|
{ branch: "PROFILES", label: "Perfis" },
|
|
@@ -2791,21 +2805,21 @@ const Ge = (a) => {
|
|
|
2791
2805
|
)
|
|
2792
2806
|
}
|
|
2793
2807
|
), tt = ({ selected: a, onSelect: t }) => {
|
|
2794
|
-
const
|
|
2808
|
+
const l = J(
|
|
2795
2809
|
K.SecurityDiagnostics
|
|
2796
|
-
), [n, u] =
|
|
2797
|
-
async (o,
|
|
2798
|
-
const v = T(o,
|
|
2810
|
+
), [n, u] = S(""), [d] = oa(n, 300), [h, A] = S({}), [z, g] = S({}), T = (o, s) => s ? `${o}:${s}` : o, R = ae(
|
|
2811
|
+
async (o, s, p) => {
|
|
2812
|
+
const v = T(o, s), $ = z[v] ?? ra;
|
|
2799
2813
|
if ($.carregando || p && $.carregouTudo)
|
|
2800
2814
|
return;
|
|
2801
|
-
const y = p ? Math.floor($.nodes.length /
|
|
2815
|
+
const y = p ? Math.floor($.nodes.length / Ca) : 0;
|
|
2802
2816
|
g((i) => ({ ...i, [v]: { ...i[v] ?? ra, carregando: !0, erro: void 0 } }));
|
|
2803
2817
|
try {
|
|
2804
|
-
const i = await
|
|
2805
|
-
parentId:
|
|
2818
|
+
const i = await l.browse(o, {
|
|
2819
|
+
parentId: s,
|
|
2806
2820
|
q: d || void 0,
|
|
2807
2821
|
page: y,
|
|
2808
|
-
size:
|
|
2822
|
+
size: Ca
|
|
2809
2823
|
});
|
|
2810
2824
|
g((N) => {
|
|
2811
2825
|
const M = [...p ? N[v]?.nodes ?? [] : [], ...i.content ?? []];
|
|
@@ -2830,28 +2844,28 @@ const Ge = (a) => {
|
|
|
2830
2844
|
}));
|
|
2831
2845
|
}
|
|
2832
2846
|
},
|
|
2833
|
-
[
|
|
2847
|
+
[l, d, z]
|
|
2834
2848
|
);
|
|
2835
2849
|
ee(() => {
|
|
2836
2850
|
if (g({}), d) {
|
|
2837
2851
|
const o = {};
|
|
2838
|
-
aa.forEach((
|
|
2839
|
-
o[
|
|
2840
|
-
}), A((
|
|
2852
|
+
aa.forEach((s) => {
|
|
2853
|
+
o[s.branch] = !0;
|
|
2854
|
+
}), A((s) => ({ ...s, ...o }));
|
|
2841
2855
|
}
|
|
2842
2856
|
}, [d]), ee(() => {
|
|
2843
2857
|
aa.forEach((o) => {
|
|
2844
2858
|
h[o.branch] && !z[o.branch] && R(o.branch, void 0, !1);
|
|
2845
2859
|
});
|
|
2846
2860
|
}, [h, z, d]);
|
|
2847
|
-
const
|
|
2861
|
+
const x = (o) => A((s) => ({ ...s, [o]: !s[o] })), D = (o) => o === "critical" ? "red" : o === "warning" ? "yellow" : void 0, b = (o, s, p) => {
|
|
2848
2862
|
const v = T("ACTIONS_OF_RESOURCE", o.id), $ = !!h[v], y = z[v], i = a?.kind === o.kind && a?.id === o.id;
|
|
2849
2863
|
return /* @__PURE__ */ r(Y, { children: [
|
|
2850
2864
|
/* @__PURE__ */ e(
|
|
2851
2865
|
ze,
|
|
2852
2866
|
{
|
|
2853
2867
|
onClick: () => {
|
|
2854
|
-
t({ kind: o.kind, id: o.id, label: o.label, parentLabel: p }), o.hasChildren && (
|
|
2868
|
+
t({ kind: o.kind, id: o.id, label: o.label, parentLabel: p }), o.hasChildren && (x(v), y || R("ACTIONS_OF_RESOURCE", o.id, !1));
|
|
2855
2869
|
},
|
|
2856
2870
|
"aria-current": i ? "true" : void 0,
|
|
2857
2871
|
"aria-expanded": o.hasChildren ? $ : void 0,
|
|
@@ -2859,7 +2873,7 @@ const Ge = (a) => {
|
|
|
2859
2873
|
display: "block",
|
|
2860
2874
|
width: "100%",
|
|
2861
2875
|
padding: "5px 8px",
|
|
2862
|
-
paddingLeft: 8 +
|
|
2876
|
+
paddingLeft: 8 + s * 14,
|
|
2863
2877
|
borderRadius: 5,
|
|
2864
2878
|
background: i ? "var(--mantine-color-blue-light)" : void 0
|
|
2865
2879
|
},
|
|
@@ -2871,8 +2885,8 @@ const Ge = (a) => {
|
|
|
2871
2885
|
}
|
|
2872
2886
|
),
|
|
2873
2887
|
o.hasChildren && $ ? /* @__PURE__ */ r(Y, { children: [
|
|
2874
|
-
y?.nodes.map((N) =>
|
|
2875
|
-
y?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 8 + (
|
|
2888
|
+
y?.nodes.map((N) => b(N, s + 1, o.label)),
|
|
2889
|
+
y?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 8 + (s + 1) * 14, py: 4, children: [
|
|
2876
2890
|
/* @__PURE__ */ e(se, { size: "xs" }),
|
|
2877
2891
|
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "carregando…" })
|
|
2878
2892
|
] }) : null,
|
|
@@ -2880,7 +2894,7 @@ const Ge = (a) => {
|
|
|
2880
2894
|
ze,
|
|
2881
2895
|
{
|
|
2882
2896
|
onClick: () => void R("ACTIONS_OF_RESOURCE", o.id, !0),
|
|
2883
|
-
style: { paddingLeft: 8 + (
|
|
2897
|
+
style: { paddingLeft: 8 + (s + 1) * 14, paddingTop: 3, paddingBottom: 3 },
|
|
2884
2898
|
children: /* @__PURE__ */ r(c, { size: "xs", c: "blue", children: [
|
|
2885
2899
|
"mais ",
|
|
2886
2900
|
y.total - y.nodes.length,
|
|
@@ -2905,26 +2919,26 @@ const Ge = (a) => {
|
|
|
2905
2919
|
}
|
|
2906
2920
|
),
|
|
2907
2921
|
w.map((o) => {
|
|
2908
|
-
const
|
|
2922
|
+
const s = !!h[o.branch], p = z[o.branch];
|
|
2909
2923
|
return /* @__PURE__ */ r(Y, { mb: 2, children: [
|
|
2910
2924
|
/* @__PURE__ */ e(
|
|
2911
2925
|
ze,
|
|
2912
2926
|
{
|
|
2913
2927
|
onClick: () => {
|
|
2914
|
-
|
|
2928
|
+
x(o.branch), p || R(o.branch, void 0, !1);
|
|
2915
2929
|
},
|
|
2916
|
-
"aria-expanded":
|
|
2930
|
+
"aria-expanded": s,
|
|
2917
2931
|
style: { display: "block", width: "100%", padding: "5px 8px", borderRadius: 5 },
|
|
2918
2932
|
children: /* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
|
|
2919
|
-
/* @__PURE__ */ e(rt, { aberta:
|
|
2933
|
+
/* @__PURE__ */ e(rt, { aberta: s }),
|
|
2920
2934
|
/* @__PURE__ */ e(c, { size: "sm", fw: 600, style: { flex: 1 }, children: o.label }),
|
|
2921
2935
|
p ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", ff: "monospace", children: p.total }) : null
|
|
2922
2936
|
] })
|
|
2923
2937
|
}
|
|
2924
2938
|
),
|
|
2925
|
-
|
|
2939
|
+
s ? /* @__PURE__ */ r(Y, { children: [
|
|
2926
2940
|
p?.erro ? /* @__PURE__ */ e(c, { size: "xs", c: "red", pl: 22, py: 4, children: p.erro }) : null,
|
|
2927
|
-
p?.nodes.map((v) =>
|
|
2941
|
+
p?.nodes.map((v) => b(v, 1)),
|
|
2928
2942
|
p?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 22, py: 4, children: [
|
|
2929
2943
|
/* @__PURE__ */ e(se, { size: "xs" }),
|
|
2930
2944
|
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "carregando…" })
|
|
@@ -2953,24 +2967,24 @@ const Ge = (a) => {
|
|
|
2953
2967
|
ACESSO_NEGADO: { label: "Acesso negado", cor: "red" },
|
|
2954
2968
|
SIMULACAO: { label: "Simulação", cor: "blue" }
|
|
2955
2969
|
}, ot = ({ slots: a, onError: t }) => {
|
|
2956
|
-
const
|
|
2970
|
+
const l = J(
|
|
2957
2971
|
K.SecurityDiagnostics
|
|
2958
|
-
), [n, u] =
|
|
2972
|
+
), [n, u] = S([]), [d, h] = S(1), [A, z] = S(1), [g, T] = S(0), [R, x] = S(""), [D, b] = S(null), [w, o] = S(!1), [s, p] = S(null), [v, $] = S(!1);
|
|
2959
2973
|
return ee(() => {
|
|
2960
2974
|
let y = !1;
|
|
2961
2975
|
o(!0), p(null);
|
|
2962
2976
|
const N = setTimeout(() => {
|
|
2963
|
-
|
|
2977
|
+
l.getAuditEvents({
|
|
2964
2978
|
usuario: R || void 0,
|
|
2965
2979
|
tipo: D ?? void 0,
|
|
2966
2980
|
page: d - 1,
|
|
2967
2981
|
size: it
|
|
2968
|
-
}).then((
|
|
2969
|
-
y || (u(
|
|
2970
|
-
}).catch((
|
|
2982
|
+
}).then((I) => {
|
|
2983
|
+
y || (u(I.content ?? []), T(I.totalElements ?? 0), z(Math.max(I.totalPages ?? 1, 1)), $(!1));
|
|
2984
|
+
}).catch((I) => {
|
|
2971
2985
|
if (y)
|
|
2972
2986
|
return;
|
|
2973
|
-
const M =
|
|
2987
|
+
const M = I instanceof Error ? I.message : "Não foi possível ler a trilha.";
|
|
2974
2988
|
/404/.test(M) ? ($(!0), u([])) : (p(M), t?.(M));
|
|
2975
2989
|
}).finally(() => {
|
|
2976
2990
|
y || o(!1);
|
|
@@ -2979,7 +2993,7 @@ const Ge = (a) => {
|
|
|
2979
2993
|
return () => {
|
|
2980
2994
|
y = !0, clearTimeout(N);
|
|
2981
2995
|
};
|
|
2982
|
-
}, [
|
|
2996
|
+
}, [l, R, D, d, t]), v ? /* @__PURE__ */ r(ce, { color: "yellow", title: "Trilha desligada", children: [
|
|
2983
2997
|
"O servidor está com ",
|
|
2984
2998
|
/* @__PURE__ */ e("code", { children: "archbase.security.audit.enabled=false" }),
|
|
2985
2999
|
'. Nada é registrado enquanto estiver assim — a lista vazia aqui significaria "nada aconteceu", e não é o caso.'
|
|
@@ -2997,7 +3011,7 @@ const Ge = (a) => {
|
|
|
2997
3011
|
placeholder: "e-mail ou parte dele",
|
|
2998
3012
|
value: R,
|
|
2999
3013
|
onChange: (y) => {
|
|
3000
|
-
|
|
3014
|
+
x(y.currentTarget.value), h(1);
|
|
3001
3015
|
},
|
|
3002
3016
|
style: { minWidth: 220 }
|
|
3003
3017
|
}
|
|
@@ -3011,7 +3025,7 @@ const Ge = (a) => {
|
|
|
3011
3025
|
clearable: !0,
|
|
3012
3026
|
value: D,
|
|
3013
3027
|
onChange: (y) => {
|
|
3014
|
-
|
|
3028
|
+
b(y ?? null), h(1);
|
|
3015
3029
|
},
|
|
3016
3030
|
data: Object.entries(ta).map(([y, { label: i }]) => ({ value: y, label: i })),
|
|
3017
3031
|
style: { minWidth: 180 }
|
|
@@ -3024,9 +3038,9 @@ const Ge = (a) => {
|
|
|
3024
3038
|
] }),
|
|
3025
3039
|
w ? /* @__PURE__ */ e(se, { size: "xs" }) : null
|
|
3026
3040
|
] }),
|
|
3027
|
-
|
|
3028
|
-
!w && !
|
|
3029
|
-
n.length > 0 ? /* @__PURE__ */ e(pe, { title: "Eventos", hint: "do mais recente para o mais antigo", children: /* @__PURE__ */ e(
|
|
3041
|
+
s ? /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao ler a trilha", children: s }) : null,
|
|
3042
|
+
!w && !s && n.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Nenhum evento no período." }) : null,
|
|
3043
|
+
n.length > 0 ? /* @__PURE__ */ e(pe, { title: "Eventos", hint: "do mais recente para o mais antigo", children: /* @__PURE__ */ e(ke, { maxHeight: "calc(100vh - 420px)", children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
3030
3044
|
/* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
|
|
3031
3045
|
/* @__PURE__ */ e(m.Th, { children: "Quando" }),
|
|
3032
3046
|
/* @__PURE__ */ e(m.Th, { children: "O quê" }),
|
|
@@ -3048,7 +3062,7 @@ const Ge = (a) => {
|
|
|
3048
3062
|
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: y.origem ?? "—" }) })
|
|
3049
3063
|
] }, y.id)) })
|
|
3050
3064
|
] }) }) }) : null,
|
|
3051
|
-
A > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(
|
|
3065
|
+
A > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(Ia, { value: d, onChange: h, total: A, size: "sm" }) }) : null,
|
|
3052
3066
|
a?.afterAuditTrail?.(n)
|
|
3053
3067
|
] });
|
|
3054
3068
|
}, nt = (a) => {
|
|
@@ -3057,7 +3071,7 @@ const Ge = (a) => {
|
|
|
3057
3071
|
} catch {
|
|
3058
3072
|
return a;
|
|
3059
3073
|
}
|
|
3060
|
-
},
|
|
3074
|
+
}, lt = () => /* @__PURE__ */ e(
|
|
3061
3075
|
Y,
|
|
3062
3076
|
{
|
|
3063
3077
|
"aria-hidden": !0,
|
|
@@ -3069,20 +3083,20 @@ const Ge = (a) => {
|
|
|
3069
3083
|
borderBottom: "4px solid transparent"
|
|
3070
3084
|
}
|
|
3071
3085
|
}
|
|
3072
|
-
), Aa = { kind: "OVERVIEW", id: "overview", label: "Panorama" }, Ra = { kind: "SIMULATE", id: "simulate", label: "Simular acesso" },
|
|
3086
|
+
), Aa = { kind: "OVERVIEW", id: "overview", label: "Panorama" }, Ra = { kind: "SIMULATE", id: "simulate", label: "Simular acesso" }, st = { kind: "AUDIT", id: "audit", label: "Trilha de auditoria" }, St = ({
|
|
3073
3087
|
height: a = "100%",
|
|
3074
3088
|
width: t = "100%",
|
|
3075
|
-
slots:
|
|
3089
|
+
slots: l,
|
|
3076
3090
|
onError: n
|
|
3077
3091
|
}) => {
|
|
3078
|
-
const [u, d] =
|
|
3079
|
-
d((o) => o.kind === w.kind && o.id === w.id ? o : (A((
|
|
3092
|
+
const [u, d] = S(Aa), [h, A] = S([]), [z, g] = S({}), T = ae((w) => {
|
|
3093
|
+
d((o) => o.kind === w.kind && o.id === w.id ? o : (A((s) => [...s, o]), w)), w.kind === "USER" && g((o) => ({ ...o, userId: w.id, userLabel: w.label })), w.kind === "ACTION" && g((o) => ({ ...o, action: w.label, resource: w.parentLabel }));
|
|
3080
3094
|
}, []), R = ae(() => {
|
|
3081
3095
|
A((w) => {
|
|
3082
3096
|
const o = w[w.length - 1];
|
|
3083
3097
|
return o ? (d(o), w.slice(0, -1)) : w;
|
|
3084
3098
|
});
|
|
3085
|
-
}, []),
|
|
3099
|
+
}, []), x = ae(
|
|
3086
3100
|
(w, o) => T({ kind: "USER", id: w, label: o }),
|
|
3087
3101
|
[T]
|
|
3088
3102
|
), D = (w) => /* @__PURE__ */ e(
|
|
@@ -3100,28 +3114,28 @@ const Ge = (a) => {
|
|
|
3100
3114
|
children: /* @__PURE__ */ e(c, { size: "sm", fw: u.kind === w.kind ? 600 : 500, children: w.label })
|
|
3101
3115
|
},
|
|
3102
3116
|
w.id
|
|
3103
|
-
),
|
|
3117
|
+
), b = () => {
|
|
3104
3118
|
switch (u.kind) {
|
|
3105
3119
|
case "OVERVIEW":
|
|
3106
|
-
return /* @__PURE__ */ e(va, { slots:
|
|
3120
|
+
return /* @__PURE__ */ e(va, { slots: l, onError: n });
|
|
3107
3121
|
case "SIMULATE":
|
|
3108
|
-
return /* @__PURE__ */ e(et, { slots:
|
|
3122
|
+
return /* @__PURE__ */ e(et, { slots: l, onError: n, initial: z });
|
|
3109
3123
|
case "AUDIT":
|
|
3110
|
-
return /* @__PURE__ */ e(ot, { slots:
|
|
3124
|
+
return /* @__PURE__ */ e(ot, { slots: l, onError: n });
|
|
3111
3125
|
case "USER":
|
|
3112
|
-
return /* @__PURE__ */ e(_r, { slots:
|
|
3126
|
+
return /* @__PURE__ */ e(_r, { slots: l, onError: n, userId: u.id });
|
|
3113
3127
|
case "GROUP":
|
|
3114
|
-
return /* @__PURE__ */ e(
|
|
3128
|
+
return /* @__PURE__ */ e(xa, { id: u.id, kind: "GROUP", slots: l, onSelectUser: x });
|
|
3115
3129
|
case "PROFILE":
|
|
3116
|
-
return /* @__PURE__ */ e(
|
|
3130
|
+
return /* @__PURE__ */ e(xa, { id: u.id, kind: "PROFILE", slots: l, onSelectUser: x });
|
|
3117
3131
|
case "ACTION":
|
|
3118
3132
|
return /* @__PURE__ */ e(
|
|
3119
3133
|
at,
|
|
3120
3134
|
{
|
|
3121
3135
|
id: u.id,
|
|
3122
3136
|
label: u.parentLabel ? `${u.parentLabel} · ${u.label}` : u.label,
|
|
3123
|
-
slots:
|
|
3124
|
-
onSelectUser:
|
|
3137
|
+
slots: l,
|
|
3138
|
+
onSelectUser: x,
|
|
3125
3139
|
onSimulate: () => T(Ra)
|
|
3126
3140
|
}
|
|
3127
3141
|
);
|
|
@@ -3131,7 +3145,7 @@ const Ge = (a) => {
|
|
|
3131
3145
|
/* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Abra o recurso na árvore para ver as ações. Cada ação responde quem alcança." })
|
|
3132
3146
|
] });
|
|
3133
3147
|
default:
|
|
3134
|
-
return /* @__PURE__ */ e(va, { slots:
|
|
3148
|
+
return /* @__PURE__ */ e(va, { slots: l, onError: n });
|
|
3135
3149
|
}
|
|
3136
3150
|
};
|
|
3137
3151
|
return (
|
|
@@ -3163,12 +3177,12 @@ const Ge = (a) => {
|
|
|
3163
3177
|
p: "xs",
|
|
3164
3178
|
style: { display: "flex", flexDirection: "column", minHeight: 0, overflow: "hidden" },
|
|
3165
3179
|
children: /* @__PURE__ */ r(U, { gap: 2, style: { flex: 1, minHeight: 0 }, children: [
|
|
3166
|
-
|
|
3180
|
+
l?.renderUserSearch ? /* @__PURE__ */ e(Y, { mb: 4, children: l.renderUserSearch(
|
|
3167
3181
|
(w) => T({ kind: "USER", id: w, label: w })
|
|
3168
3182
|
) }) : null,
|
|
3169
3183
|
D(Aa),
|
|
3170
3184
|
D(Ra),
|
|
3171
|
-
D(
|
|
3185
|
+
D(st),
|
|
3172
3186
|
/* @__PURE__ */ e(Y, { my: 6, style: { borderTop: "1px solid var(--mantine-color-default-border)" } }),
|
|
3173
3187
|
/* @__PURE__ */ e(ue, { type: "hover", style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(tt, { selected: u, onSelect: T }) })
|
|
3174
3188
|
] })
|
|
@@ -3189,7 +3203,7 @@ const Ge = (a) => {
|
|
|
3189
3203
|
size: "compact-sm",
|
|
3190
3204
|
variant: "subtle",
|
|
3191
3205
|
onClick: R,
|
|
3192
|
-
leftSection: /* @__PURE__ */ e(
|
|
3206
|
+
leftSection: /* @__PURE__ */ e(lt, {}),
|
|
3193
3207
|
"aria-label": "Voltar para o item anterior",
|
|
3194
3208
|
children: "Voltar"
|
|
3195
3209
|
}
|
|
@@ -3199,7 +3213,7 @@ const Ge = (a) => {
|
|
|
3199
3213
|
h[h.length - 1]?.label
|
|
3200
3214
|
] })
|
|
3201
3215
|
] }) : null,
|
|
3202
|
-
/* @__PURE__ */ e(Y, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children:
|
|
3216
|
+
/* @__PURE__ */ e(Y, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: b() })
|
|
3203
3217
|
]
|
|
3204
3218
|
}
|
|
3205
3219
|
)
|
|
@@ -3213,13 +3227,13 @@ export {
|
|
|
3213
3227
|
Dr as ApiTokenModal,
|
|
3214
3228
|
wt as ArchbaseApiTokenView,
|
|
3215
3229
|
Rr as ArchbaseDualListSelector,
|
|
3216
|
-
|
|
3230
|
+
St as ArchbaseSecurityDiagnosticsView,
|
|
3217
3231
|
Tt as ArchbaseSecurityView,
|
|
3218
3232
|
Hr as AttributeList,
|
|
3219
3233
|
_r as EffectiveAccessPanel,
|
|
3220
3234
|
Br as FlagStrip,
|
|
3221
3235
|
Er as GroupModal,
|
|
3222
|
-
|
|
3236
|
+
xa as GroupNodePanel,
|
|
3223
3237
|
Ur as MetricCard,
|
|
3224
3238
|
Gr as MetricCards,
|
|
3225
3239
|
Wr as OverviewItemsDrawer,
|
|
@@ -3230,8 +3244,8 @@ export {
|
|
|
3230
3244
|
pe as Section,
|
|
3231
3245
|
tt as SecurityTree,
|
|
3232
3246
|
et as SimulationPanel,
|
|
3233
|
-
|
|
3234
|
-
|
|
3247
|
+
ke as TabelaRolavel,
|
|
3248
|
+
kr as UserModal,
|
|
3235
3249
|
Ge as severityColor,
|
|
3236
3250
|
Oa as situacaoBadge
|
|
3237
3251
|
};
|