@archbase/security-ui 4.2.4 → 4.2.6
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/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as xe } from "react/jsx-runtime";
|
|
2
|
-
import { Modal as $e, ScrollArea as
|
|
3
|
-
import { getI18nextInstance as g, resolveArchbasePasswordPolicy as _a, ARCHBASE_IOC_API_TYPE as K, emit as Ge, builder as De, validateArchbasePassword as er, convertDateToISOString as ar, processErrorMessage as
|
|
4
|
-
import { ArchbaseEdit as
|
|
2
|
+
import { Modal as $e, ScrollArea as de, Stack as V, Grid as H, Group as O, Button as X, Paper as re, Box as _, Text as h, List as Me, Checkbox as la, Tooltip as ke, ActionIcon as fe, Flex as Fe, Space as Ra, Input as Te, useTree as ca, useMantineColorScheme as qe, TextInput as ve, Tree as da, Badge as Q, Tabs as Ce, RingProgress as Ka, SimpleGrid as He, Table as S, Drawer as Ja, Loader as le, Alert as ye, Pagination as Xa, CloseButton as Ya, Chip as ua, Popover as Je, UnstyledButton as ze } from "@mantine/core";
|
|
3
|
+
import { getI18nextInstance as g, resolveArchbasePasswordPolicy as _a, ARCHBASE_IOC_API_TYPE as K, emit as Ge, builder as De, validateArchbasePassword as er, convertDateToISOString as ar, processErrorMessage as be, getKeyByEnumValue as Se, useArchbaseTheme as oa, useArchbaseValidator as rr, useArchbaseTranslation as tr, useValidationErrors as ir, processDetailErrorMessage as Ve } from "@archbase/core";
|
|
4
|
+
import { ArchbaseEdit as se, ArchbaseNotifications as ne, ArchbasePasswordEdit as or, ArchbaseSelect as nr, ArchbaseCheckbox as Ae, ArchbaseAvatarEdit as sr, ArchbaseAsyncSelect as lr, Columns as Ie, ArchbaseDataGridColumn as $, ArchbaseDataGrid as za, ArchbaseDialog as ge } from "@archbase/components";
|
|
5
5
|
import { useArchbaseV1V2Compatibility as Ne, useArchbaseDataSourceListener as ha, useArchbaseRemoteServiceApi as J, useArchbaseRemoteDataSource as ta, ArchbaseDataSource as cr, useArchbaseStore as ka, useArchbaseRemoteDataSourceV2 as Ee, useArchbaseDataSource as dr } from "@archbase/data";
|
|
6
|
-
import { useState as
|
|
6
|
+
import { useState as T, useCallback as ae, useEffect as ee, forwardRef as ur, useMemo as ie, useRef as Re } from "react";
|
|
7
7
|
import { IconArrowRight as Ia, IconArrowLeft as Ea, IconChevronDown as pa, IconBorderCornerSquare as ma, IconEye as hr, IconEdit as Pa, IconTrashX as na, IconShieldCheckered as pr, IconPlus as Fa } from "@tabler/icons-react";
|
|
8
8
|
import { UserGroupDto as ga, SecurityType as Y, UserDto as mr, GroupDto as gr, ProfileDto as fr, ApiTokenDto as br } from "@archbase/security";
|
|
9
9
|
import { DateTimePicker as vr } from "@mantine/dates";
|
|
@@ -11,8 +11,8 @@ import { useFocusTrap as yr, useDebouncedValue as ia } from "@mantine/hooks";
|
|
|
11
11
|
import { ArchbaseSpaceFixed as wr, ArchbaseSpaceFill as Cr, ArchbaseSpaceBottom as Sr } from "@archbase/layout";
|
|
12
12
|
const xr = (a) => {
|
|
13
13
|
const t = { ...a.options ?? {} }, n = () => {
|
|
14
|
-
a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (
|
|
15
|
-
|
|
14
|
+
a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (c) => {
|
|
15
|
+
c && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), c);
|
|
16
16
|
}) : a.onClickOk(a.dataSource.getCurrentRecord(), !0);
|
|
17
17
|
}, s = () => {
|
|
18
18
|
a.onClickCancel(a.dataSource.getCurrentRecord());
|
|
@@ -25,11 +25,11 @@ const xr = (a) => {
|
|
|
25
25
|
title: g().t("archbase:Perfil"),
|
|
26
26
|
size: "60%",
|
|
27
27
|
styles: { content: { maxWidth: 1e3 } },
|
|
28
|
-
children: /* @__PURE__ */ e(
|
|
28
|
+
children: /* @__PURE__ */ e(de, { style: { height: "460px" }, children: /* @__PURE__ */ r(V, { w: "98%", children: [
|
|
29
29
|
t?.customContentBefore && t.customContentBefore(a.dataSource.getCurrentRecord()),
|
|
30
30
|
/* @__PURE__ */ r(H, { children: [
|
|
31
31
|
/* @__PURE__ */ e(H.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
|
|
32
|
-
|
|
32
|
+
se,
|
|
33
33
|
{
|
|
34
34
|
label: `${g().t("archbase:Nome do perfil")}`,
|
|
35
35
|
placeholder: `${g().t("archbase:Informe o nome do perfil")}`,
|
|
@@ -38,7 +38,7 @@ const xr = (a) => {
|
|
|
38
38
|
}
|
|
39
39
|
) }),
|
|
40
40
|
/* @__PURE__ */ e(H.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
|
|
41
|
-
|
|
41
|
+
se,
|
|
42
42
|
{
|
|
43
43
|
label: `${g().t("archbase:Descrição do perfil")}`,
|
|
44
44
|
placeholder: `${g().t("archbase:Informe a descrição do perfil")}`,
|
|
@@ -61,13 +61,13 @@ function Tr({
|
|
|
61
61
|
assignedItemsDS: t,
|
|
62
62
|
idFieldAvailable: n,
|
|
63
63
|
labelFieldAvailable: s,
|
|
64
|
-
idFieldAssigned:
|
|
65
|
-
labelFieldAssigned:
|
|
66
|
-
handleCreateAssociationObject:
|
|
67
|
-
width:
|
|
64
|
+
idFieldAssigned: c,
|
|
65
|
+
labelFieldAssigned: d,
|
|
66
|
+
handleCreateAssociationObject: u,
|
|
67
|
+
width: x = "400px",
|
|
68
68
|
height: R = "200px",
|
|
69
69
|
titleAvailable: m = "Disponíveis",
|
|
70
|
-
titleAssigned:
|
|
70
|
+
titleAssigned: v = "Selecionados"
|
|
71
71
|
}) {
|
|
72
72
|
Ne(
|
|
73
73
|
"ArchbaseDualListSelector-Available",
|
|
@@ -80,8 +80,8 @@ function Tr({
|
|
|
80
80
|
t,
|
|
81
81
|
void 0,
|
|
82
82
|
[]
|
|
83
|
-
), [
|
|
84
|
-
a &&
|
|
83
|
+
), [y, P] = T([]), [f, w] = T([]), [o, l] = T([]), [p, b] = T([]), L = ae(() => {
|
|
84
|
+
a && P(a.browseRecords()), t && w(t.browseRecords());
|
|
85
85
|
}, [a, t]);
|
|
86
86
|
ha({
|
|
87
87
|
dataSource: a,
|
|
@@ -92,26 +92,26 @@ function Tr({
|
|
|
92
92
|
}), ee(() => {
|
|
93
93
|
L();
|
|
94
94
|
}, [L]);
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
o.forEach((
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
A.isDataSourceV2 ? (t.insert(
|
|
95
|
+
const E = (D, C) => typeof C == "function" ? C(D) : D[C], i = (D, C) => typeof C == "function" ? C(D) : D[C], N = (D, C) => {
|
|
96
|
+
D((z) => z.includes(C) ? z.filter((oe) => oe !== C) : [...z, C]);
|
|
97
|
+
}, F = () => {
|
|
98
|
+
o.forEach((D) => {
|
|
99
|
+
const C = y.find((z) => E(z, n) === D);
|
|
100
|
+
if (C) {
|
|
101
|
+
const z = u(C);
|
|
102
|
+
A.isDataSourceV2 ? (t.insert(z), t.save()) : (t.insert(z), t.save(), A.v1State.forceUpdate());
|
|
103
103
|
}
|
|
104
104
|
}), l([]);
|
|
105
105
|
}, G = () => {
|
|
106
|
-
p.forEach((
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
109
|
-
const
|
|
110
|
-
A.isDataSourceV2 ? t.remove(() => t.locate(
|
|
106
|
+
p.forEach((D) => {
|
|
107
|
+
const C = f.find((z) => E(z, c) === D);
|
|
108
|
+
if (C) {
|
|
109
|
+
const z = typeof c == "function" ? { customId: c(C) } : { [c]: D };
|
|
110
|
+
A.isDataSourceV2 ? t.remove(() => t.locate(z)) : (t.remove(() => t.locate(z)), A.v1State.forceUpdate());
|
|
111
111
|
}
|
|
112
112
|
}), b([]);
|
|
113
113
|
};
|
|
114
|
-
return /* @__PURE__ */ r(re, { withBorder: !0, style: { display: "flex", width:
|
|
114
|
+
return /* @__PURE__ */ r(re, { withBorder: !0, style: { display: "flex", width: x, height: R }, children: [
|
|
115
115
|
/* @__PURE__ */ r(_, { style: { minWidth: "44%", minHeight: R }, children: [
|
|
116
116
|
/* @__PURE__ */ e(h, { children: m }),
|
|
117
117
|
/* @__PURE__ */ e(
|
|
@@ -127,26 +127,26 @@ function Tr({
|
|
|
127
127
|
overflowX: "hidden",
|
|
128
128
|
height: "calc(100% - 32px)"
|
|
129
129
|
},
|
|
130
|
-
children:
|
|
130
|
+
children: y.map((D) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
|
|
131
131
|
la,
|
|
132
132
|
{
|
|
133
|
-
label: i(
|
|
134
|
-
checked: o.includes(
|
|
135
|
-
onChange: () =>
|
|
136
|
-
disabled:
|
|
137
|
-
(
|
|
133
|
+
label: i(D, s),
|
|
134
|
+
checked: o.includes(E(D, n)),
|
|
135
|
+
onChange: () => N(l, E(D, n)),
|
|
136
|
+
disabled: f.some(
|
|
137
|
+
(C) => E(C, c) === E(D, n)
|
|
138
138
|
)
|
|
139
139
|
}
|
|
140
|
-
) },
|
|
140
|
+
) }, E(D, n)))
|
|
141
141
|
}
|
|
142
142
|
)
|
|
143
143
|
] }),
|
|
144
144
|
/* @__PURE__ */ r(V, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
|
|
145
|
-
/* @__PURE__ */ e(ke, { label: "Adicionar", children: /* @__PURE__ */ e(
|
|
146
|
-
/* @__PURE__ */ e(ke, { label: "Remover", children: /* @__PURE__ */ e(
|
|
145
|
+
/* @__PURE__ */ e(ke, { label: "Adicionar", children: /* @__PURE__ */ e(fe, { onClick: F, disabled: !o.length, children: /* @__PURE__ */ e(Ia, {}) }) }),
|
|
146
|
+
/* @__PURE__ */ e(ke, { label: "Remover", children: /* @__PURE__ */ e(fe, { onClick: G, disabled: !p.length, children: /* @__PURE__ */ e(Ea, {}) }) })
|
|
147
147
|
] }),
|
|
148
148
|
/* @__PURE__ */ r(_, { style: { minWidth: "44%", minHeight: R }, children: [
|
|
149
|
-
/* @__PURE__ */ e(h, { children:
|
|
149
|
+
/* @__PURE__ */ e(h, { children: v }),
|
|
150
150
|
/* @__PURE__ */ e(
|
|
151
151
|
Me,
|
|
152
152
|
{
|
|
@@ -160,21 +160,21 @@ function Tr({
|
|
|
160
160
|
overflowX: "hidden",
|
|
161
161
|
height: "calc(100% - 32px)"
|
|
162
162
|
},
|
|
163
|
-
children:
|
|
163
|
+
children: f.map((D) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
|
|
164
164
|
la,
|
|
165
165
|
{
|
|
166
|
-
label: i(
|
|
167
|
-
checked: p.includes(
|
|
168
|
-
onChange: () =>
|
|
166
|
+
label: i(D, d),
|
|
167
|
+
checked: p.includes(E(D, c)),
|
|
168
|
+
onChange: () => N(b, E(D, c))
|
|
169
169
|
}
|
|
170
|
-
) },
|
|
170
|
+
) }, E(D, c)))
|
|
171
171
|
}
|
|
172
172
|
)
|
|
173
173
|
] })
|
|
174
174
|
] });
|
|
175
175
|
}
|
|
176
176
|
const Ar = ur(
|
|
177
|
-
({ image: a, label: t, description: n, origin: s, ...
|
|
177
|
+
({ image: a, label: t, description: n, origin: s, ...c }, d) => /* @__PURE__ */ e("div", { ref: d, ...c, children: /* @__PURE__ */ r(Fe, { children: [
|
|
178
178
|
/* @__PURE__ */ e(h, { size: "sm", fw: 600, children: s ? s.name : "" }),
|
|
179
179
|
/* @__PURE__ */ e(Ra, { w: "lg" })
|
|
180
180
|
] }) })
|
|
@@ -203,52 +203,52 @@ const Ar = ur(
|
|
|
203
203
|
avatarMaxOutputSizePx: 512,
|
|
204
204
|
allowEditEmail: !0
|
|
205
205
|
}, zr = (a) => {
|
|
206
|
-
const [t, n] =
|
|
206
|
+
const [t, n] = T(""), s = { ...Rr, ...a.options ?? {} }, c = a.dataSource.getFieldValue("passwordChangedAt"), d = c ? new Date(c) : void 0, u = d && !Number.isNaN(d.getTime()) ? d.toLocaleString() : void 0, x = _a(s.passwordPolicy), R = s.forbidPersonalDataInPassword ? ["name", "nickname", "email"].map((l) => {
|
|
207
207
|
const p = a.dataSource.getFieldValue(l);
|
|
208
208
|
return l === "email" && p ? p.split("@")[0] : p;
|
|
209
|
-
}).filter((l) => typeof l == "string" && l.trim().length >= 3) : [], m =
|
|
210
|
-
...
|
|
211
|
-
blocklist: [...
|
|
212
|
-
} : void 0,
|
|
209
|
+
}).filter((l) => typeof l == "string" && l.trim().length >= 3) : [], m = x ? {
|
|
210
|
+
...x,
|
|
211
|
+
blocklist: [...x.blocklist ?? [], ...R]
|
|
212
|
+
} : void 0, v = J(K.Group), { dataSource: A } = ta({
|
|
213
213
|
name: "dsGroups",
|
|
214
|
-
service:
|
|
214
|
+
service: v,
|
|
215
215
|
pageSize: 9999,
|
|
216
216
|
loadOnStart: !0,
|
|
217
217
|
sort: ["name:asc"],
|
|
218
218
|
onError: (l, p) => {
|
|
219
|
-
|
|
219
|
+
ne.showError(g().t("archbase:WARNING"), l, p);
|
|
220
220
|
}
|
|
221
221
|
});
|
|
222
222
|
console.log("versão 12/05/2026");
|
|
223
|
-
const
|
|
223
|
+
const y = J(K.Profile), { dataSource: P } = ta({
|
|
224
224
|
name: "dsProfiles",
|
|
225
|
-
service:
|
|
225
|
+
service: y,
|
|
226
226
|
pageSize: 9999,
|
|
227
227
|
loadOnStart: !0,
|
|
228
228
|
sort: ["name:asc"],
|
|
229
229
|
onError: (l, p) => {
|
|
230
|
-
|
|
230
|
+
ne.showError(g().t("archbase:WARNING"), l, p);
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
233
|
ee(() => {
|
|
234
234
|
n("");
|
|
235
235
|
}, [a.dataSource.getFieldValue("password")]);
|
|
236
|
-
const
|
|
236
|
+
const f = async () => {
|
|
237
237
|
if (a.dataSource.isInserting()) {
|
|
238
238
|
if (s.userDefaultProfile) {
|
|
239
|
-
const l = Ge(De.eq("name", s.userDefaultProfile)), p = await
|
|
239
|
+
const l = Ge(De.eq("name", s.userDefaultProfile)), p = await y.findAllWithFilter(l, 0, 1);
|
|
240
240
|
p && p.content.length > 0 && a.dataSource.setFieldValue("profile", p.content[0]);
|
|
241
241
|
}
|
|
242
242
|
if (s.userDefaultGroups) {
|
|
243
|
-
const l = Ge(De.in("name", s.userDefaultGroups)), p = await
|
|
243
|
+
const l = Ge(De.in("name", s.userDefaultGroups)), p = await v.findAllWithFilter(l, 0, 500);
|
|
244
244
|
p && p.content.length > 0 && a.dataSource.setFieldValue("groups", p.content.map((b) => ga.newInstance(b)));
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
248
|
ee(() => {
|
|
249
|
-
a.opened &&
|
|
249
|
+
a.opened && f();
|
|
250
250
|
}, [a.opened]);
|
|
251
|
-
const
|
|
251
|
+
const w = () => {
|
|
252
252
|
const l = a.dataSource.getCurrentRecord();
|
|
253
253
|
if (!l.password && a.dataSource.isInserting()) {
|
|
254
254
|
n(g().t("archbase:Informe a senha"));
|
|
@@ -276,12 +276,12 @@ const Ar = ur(
|
|
|
276
276
|
size: "80%",
|
|
277
277
|
styles: { content: { maxWidth: 1e3 } },
|
|
278
278
|
children: [
|
|
279
|
-
/* @__PURE__ */ e(
|
|
279
|
+
/* @__PURE__ */ e(de, { style: { height: "500px" }, children: /* @__PURE__ */ r(V, { w: "98%", children: [
|
|
280
280
|
s?.customContentBefore && /* @__PURE__ */ e(xe, { children: s.customContentBefore(a.dataSource.getCurrentRecord()) }),
|
|
281
281
|
/* @__PURE__ */ r(H, { children: [
|
|
282
282
|
/* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ r(O, { children: [
|
|
283
283
|
/* @__PURE__ */ e(
|
|
284
|
-
|
|
284
|
+
se,
|
|
285
285
|
{
|
|
286
286
|
label: `${g().t("archbase:Nome completo")}`,
|
|
287
287
|
placeholder: `${g().t("archbase:Informe o nome completo do usuário")}`,
|
|
@@ -292,7 +292,7 @@ const Ar = ur(
|
|
|
292
292
|
}
|
|
293
293
|
),
|
|
294
294
|
s.showNickname && /* @__PURE__ */ e(
|
|
295
|
-
|
|
295
|
+
se,
|
|
296
296
|
{
|
|
297
297
|
label: `${g().t("archbase:Apelido")}`,
|
|
298
298
|
placeholder: `${g().t("archbase:Apelido")}`,
|
|
@@ -303,7 +303,7 @@ const Ar = ur(
|
|
|
303
303
|
)
|
|
304
304
|
] }) }),
|
|
305
305
|
/* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
|
|
306
|
-
|
|
306
|
+
se,
|
|
307
307
|
{
|
|
308
308
|
label: `${g().t("archbase:Descrição do usuário")}`,
|
|
309
309
|
placeholder: `${g().t("archbase:Informe a descrição do usuário")}`,
|
|
@@ -315,7 +315,7 @@ const Ar = ur(
|
|
|
315
315
|
] }),
|
|
316
316
|
/* @__PURE__ */ r(H, { children: [
|
|
317
317
|
/* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
|
|
318
|
-
|
|
318
|
+
se,
|
|
319
319
|
{
|
|
320
320
|
label: `${g().t("archbase:E-mail")}`,
|
|
321
321
|
placeholder: `${g().t("archbase:Informe o e-mail do usuário")}`,
|
|
@@ -345,7 +345,7 @@ const Ar = ur(
|
|
|
345
345
|
label: `${g().t("archbase:Perfil do usuário")}`,
|
|
346
346
|
dataSource: a.dataSource,
|
|
347
347
|
dataField: "profile",
|
|
348
|
-
options:
|
|
348
|
+
options: P,
|
|
349
349
|
allowDeselect: !0,
|
|
350
350
|
optionsLabelField: "nome",
|
|
351
351
|
itemComponent: Ar,
|
|
@@ -385,7 +385,7 @@ const Ar = ur(
|
|
|
385
385
|
'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
386
|
) })
|
|
387
387
|
] }),
|
|
388
|
-
s.showPasswordChangedAt &&
|
|
388
|
+
s.showPasswordChangedAt && u && /* @__PURE__ */ e(h, { fz: 12, c: "dimmed", children: `${g().t("archbase:Última troca de senha")}: ${u}` })
|
|
389
389
|
] }) }),
|
|
390
390
|
/* @__PURE__ */ e(H.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(V, { gap: "lg", children: [
|
|
391
391
|
s.showAccountDeactivated && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
|
|
@@ -457,15 +457,15 @@ const Ar = ur(
|
|
|
457
457
|
] }) }),
|
|
458
458
|
/* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
|
|
459
459
|
/* @__PURE__ */ e(X, { variant: "default", onClick: o, children: g().t("archbase:Cancelar") }),
|
|
460
|
-
/* @__PURE__ */ e(X, { onClick:
|
|
460
|
+
/* @__PURE__ */ e(X, { onClick: w, children: g().t("archbase:Salvar") })
|
|
461
461
|
] })
|
|
462
462
|
]
|
|
463
463
|
}
|
|
464
464
|
);
|
|
465
465
|
}, kr = (a) => {
|
|
466
466
|
const t = { ...a.options ?? {} }, n = () => {
|
|
467
|
-
a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (
|
|
468
|
-
|
|
467
|
+
a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (c) => {
|
|
468
|
+
c && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), c);
|
|
469
469
|
}) : a.onClickOk(a.dataSource.getCurrentRecord(), !0);
|
|
470
470
|
}, s = () => {
|
|
471
471
|
a.onClickCancel(a.dataSource.getCurrentRecord());
|
|
@@ -478,11 +478,11 @@ const Ar = ur(
|
|
|
478
478
|
title: g().t("archbase:Grupo"),
|
|
479
479
|
size: "60%",
|
|
480
480
|
styles: { content: { maxWidth: 1e3 } },
|
|
481
|
-
children: /* @__PURE__ */ e(
|
|
481
|
+
children: /* @__PURE__ */ e(de, { style: { height: "460px" }, children: /* @__PURE__ */ r(V, { w: "98%", children: [
|
|
482
482
|
t?.customContentBefore && t.customContentBefore(a.dataSource.getCurrentRecord()),
|
|
483
483
|
/* @__PURE__ */ r(H, { children: [
|
|
484
484
|
/* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
|
|
485
|
-
|
|
485
|
+
se,
|
|
486
486
|
{
|
|
487
487
|
label: `${g().t("archbase:Nome do grupo")}`,
|
|
488
488
|
placeholder: `${g().t("archbase:Informe o nome do grupo")}`,
|
|
@@ -491,7 +491,7 @@ const Ar = ur(
|
|
|
491
491
|
}
|
|
492
492
|
) }),
|
|
493
493
|
/* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
|
|
494
|
-
|
|
494
|
+
se,
|
|
495
495
|
{
|
|
496
496
|
label: `${g().t("archbase:Descrição do grupo")}`,
|
|
497
497
|
placeholder: `${g().t("archbase:Informe a descrição do grupo")}`,
|
|
@@ -516,33 +516,33 @@ const Ar = ur(
|
|
|
516
516
|
] })
|
|
517
517
|
] }) }), Er = (a) => {
|
|
518
518
|
yr();
|
|
519
|
-
const [t, n] =
|
|
519
|
+
const [t, n] = T(), s = J(K.User), c = Ne(
|
|
520
520
|
"ApiTokenModal",
|
|
521
521
|
a.dataSource,
|
|
522
522
|
"expirationDate",
|
|
523
523
|
""
|
|
524
524
|
);
|
|
525
|
-
process.env.NODE_ENV === "development" && a.dataSource && console.log(`[ApiTokenModal] DataSource version: ${
|
|
526
|
-
const
|
|
525
|
+
process.env.NODE_ENV === "development" && a.dataSource && console.log(`[ApiTokenModal] DataSource version: ${c.dataSourceVersion}`);
|
|
526
|
+
const d = (m) => {
|
|
527
527
|
if (!m)
|
|
528
|
-
|
|
528
|
+
c.handleValueChange(void 0);
|
|
529
529
|
else {
|
|
530
|
-
const
|
|
531
|
-
|
|
530
|
+
const v = typeof m == "string" ? new Date(m) : m, A = ar(v);
|
|
531
|
+
c.handleValueChange(A);
|
|
532
532
|
}
|
|
533
533
|
n(m);
|
|
534
|
-
},
|
|
534
|
+
}, u = async (m, v) => new Promise(async (A, y) => {
|
|
535
535
|
try {
|
|
536
|
-
const
|
|
536
|
+
const P = Ge(De.or(De.eq("name", `^*${v.trim()}*`))), f = await s.findAllWithFilter(P, m, 20);
|
|
537
537
|
A({
|
|
538
|
-
options:
|
|
539
|
-
page:
|
|
540
|
-
totalPages:
|
|
538
|
+
options: f.content,
|
|
539
|
+
page: f.pageable.pageNumber,
|
|
540
|
+
totalPages: f.totalPages
|
|
541
541
|
});
|
|
542
|
-
} catch (
|
|
543
|
-
|
|
542
|
+
} catch (P) {
|
|
543
|
+
y(be(P));
|
|
544
544
|
}
|
|
545
|
-
}),
|
|
545
|
+
}), x = () => {
|
|
546
546
|
a.onCustomSave ? a.onCustomSave(a.dataSource.current, (m) => {
|
|
547
547
|
m && a.onAfterSave && a.onAfterSave(a.dataSource.current), a.onClickOk(a.dataSource.current, m);
|
|
548
548
|
}) : a.onClickOk(a.dataSource.current, !0);
|
|
@@ -557,9 +557,9 @@ const Ar = ur(
|
|
|
557
557
|
title: g().t("archbase:Token de API"),
|
|
558
558
|
size: "50%",
|
|
559
559
|
children: [
|
|
560
|
-
/* @__PURE__ */ r(
|
|
560
|
+
/* @__PURE__ */ r(de, { style: { height: "300px" }, children: [
|
|
561
561
|
/* @__PURE__ */ e(
|
|
562
|
-
|
|
562
|
+
se,
|
|
563
563
|
{
|
|
564
564
|
label: `${g().t("archbase:Nome do token")}`,
|
|
565
565
|
placeholder: `${g().t("archbase:Informe o nome do token")}`,
|
|
@@ -568,7 +568,7 @@ const Ar = ur(
|
|
|
568
568
|
}
|
|
569
569
|
),
|
|
570
570
|
/* @__PURE__ */ e(
|
|
571
|
-
|
|
571
|
+
se,
|
|
572
572
|
{
|
|
573
573
|
label: `${g().t("archbase:Descrição do token")}`,
|
|
574
574
|
placeholder: `${g().t("archbase:Informe a descrição do token")}`,
|
|
@@ -581,7 +581,7 @@ const Ar = ur(
|
|
|
581
581
|
{
|
|
582
582
|
withSeconds: !0,
|
|
583
583
|
value: t,
|
|
584
|
-
onChange:
|
|
584
|
+
onChange: d,
|
|
585
585
|
label: "Data/hora expiração",
|
|
586
586
|
placeholder: "Selecione a data de expiração"
|
|
587
587
|
}
|
|
@@ -595,7 +595,7 @@ const Ar = ur(
|
|
|
595
595
|
placeholder: `${g().t("archbase:Digite aqui o nome do usuário")}`,
|
|
596
596
|
getOptionLabel: (m) => m && m.email ? m.email : "",
|
|
597
597
|
getOptionValue: (m) => m && m.id ? m.id.toString() : "",
|
|
598
|
-
getOptions:
|
|
598
|
+
getOptions: u,
|
|
599
599
|
debounceTime: 500,
|
|
600
600
|
minCharsToSearch: 1,
|
|
601
601
|
itemComponent: Ir
|
|
@@ -604,59 +604,59 @@ const Ar = ur(
|
|
|
604
604
|
] }),
|
|
605
605
|
/* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
|
|
606
606
|
/* @__PURE__ */ e(X, { variant: "default", onClick: R, children: g().t("archbase:Cancelar") }),
|
|
607
|
-
/* @__PURE__ */ e(X, { onClick:
|
|
607
|
+
/* @__PURE__ */ e(X, { onClick: x, children: g().t("archbase:Salvar") })
|
|
608
608
|
] })
|
|
609
609
|
]
|
|
610
610
|
}
|
|
611
611
|
);
|
|
612
612
|
}, fa = (a) => {
|
|
613
613
|
const t = "->";
|
|
614
|
-
return a.includes(t) ? a.split(t).map((
|
|
614
|
+
return a.includes(t) ? a.split(t).map((c) => c.trim()).map((c) => g().t(c)).join(` ${t} `) : g().t(a);
|
|
615
615
|
};
|
|
616
616
|
function Xe({ dataSource: a, opened: t, close: n }) {
|
|
617
|
-
const s = ie(() => a?.getFieldValue("name") || "", [a]),
|
|
618
|
-
value:
|
|
619
|
-
label:
|
|
620
|
-
children:
|
|
621
|
-
value:
|
|
622
|
-
label:
|
|
617
|
+
const s = ie(() => a?.getFieldValue("name") || "", [a]), c = ie(() => a?.getFieldValue("id") || "", [a]), d = ie(() => a?.getFieldValue("type") || "", [a]), u = ca(), x = ca(), [R, m] = T([]), [v, A] = T([]), [y, P] = T(), [f, w] = T(), [o, l] = T(""), [p] = ia(o, 200), [b, L] = T(""), [E] = ia(b, 200), i = J(K.Resource), { colorScheme: N } = qe(), F = N === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", G = ie(() => v.sort((k, I) => k.resourceDescription.localeCompare(I.resourceDescription)).map((k) => ({
|
|
618
|
+
value: k.resourceId,
|
|
619
|
+
label: k.resourceDescription,
|
|
620
|
+
children: k.permissions.filter((I) => I.actionDescription.toLowerCase().includes(E.toLowerCase())).sort((I, q) => I.actionDescription.localeCompare(q.actionDescription)).map((I) => ({
|
|
621
|
+
value: I.actionId,
|
|
622
|
+
label: I.actionDescription,
|
|
623
623
|
nodeProps: {
|
|
624
|
-
permissionId:
|
|
625
|
-
types:
|
|
626
|
-
owner:
|
|
624
|
+
permissionId: I.permissionId,
|
|
625
|
+
types: I.types ?? [],
|
|
626
|
+
owner: k
|
|
627
627
|
}
|
|
628
628
|
}))
|
|
629
|
-
})), [
|
|
630
|
-
value:
|
|
631
|
-
label:
|
|
632
|
-
children:
|
|
633
|
-
const q =
|
|
629
|
+
})), [v, E]), D = ie(() => v.map((k) => k.permissions.map((I) => I.actionId)).flat(), [v]), C = ie(() => R.sort((k, I) => k.resourceDescription.localeCompare(I.resourceDescription)).map((k) => ({
|
|
630
|
+
value: k.resourceId,
|
|
631
|
+
label: k.resourceDescription,
|
|
632
|
+
children: k.permissions.filter((I) => I.actionDescription.toLowerCase().includes(p.toLowerCase())).sort((I, q) => I.actionDescription.localeCompare(q.actionDescription)).map((I) => {
|
|
633
|
+
const q = v.find((U) => U.resourceId === k.resourceId)?.permissions.find((U) => U.actionId === I.actionId);
|
|
634
634
|
return {
|
|
635
|
-
value:
|
|
636
|
-
label:
|
|
635
|
+
value: I.actionId,
|
|
636
|
+
label: I.actionDescription,
|
|
637
637
|
nodeProps: {
|
|
638
|
-
granted:
|
|
639
|
-
owner:
|
|
638
|
+
granted: D.includes(I.actionId) && q?.types?.includes(Se(Y, d)),
|
|
639
|
+
owner: k
|
|
640
640
|
}
|
|
641
641
|
};
|
|
642
642
|
})
|
|
643
|
-
})), [R,
|
|
644
|
-
if (
|
|
645
|
-
const
|
|
646
|
-
m(
|
|
643
|
+
})), [R, v, D, d, p]), z = ae(async () => {
|
|
644
|
+
if (c) {
|
|
645
|
+
const k = await i.getPermissionsBySecurityId(c, d), I = await i.getAllPermissionsAvailable();
|
|
646
|
+
m(I), A(k);
|
|
647
647
|
}
|
|
648
|
-
}, [
|
|
649
|
-
|
|
650
|
-
if (
|
|
648
|
+
}, [c, d]), oe = ae(() => {
|
|
649
|
+
y?.value && c && i.createPermission(c, y.value, d).then((k) => {
|
|
650
|
+
if (k) {
|
|
651
651
|
A((j) => {
|
|
652
652
|
let B;
|
|
653
|
-
return j.map((Z) => Z.resourceId).includes(
|
|
653
|
+
return j.map((Z) => Z.resourceId).includes(k.resourceId) ? B = j.map((Z) => Z.resourceId === k.resourceId ? Z.permissions.map((W) => W.actionId).includes(y.value) ? {
|
|
654
654
|
...Z,
|
|
655
655
|
permissions: Z.permissions.map(
|
|
656
|
-
(W) => W.actionId ===
|
|
656
|
+
(W) => W.actionId === y.value ? {
|
|
657
657
|
...W,
|
|
658
|
-
permissionId:
|
|
659
|
-
types: [...W.types ?? [], Se(Y,
|
|
658
|
+
permissionId: k.permissionId,
|
|
659
|
+
types: [...W.types ?? [], Se(Y, d)]
|
|
660
660
|
} : W
|
|
661
661
|
)
|
|
662
662
|
} : {
|
|
@@ -664,92 +664,92 @@ function Xe({ dataSource: a, opened: t, close: n }) {
|
|
|
664
664
|
permissions: [
|
|
665
665
|
...Z.permissions ?? [],
|
|
666
666
|
{
|
|
667
|
-
actionId:
|
|
668
|
-
actionDescription:
|
|
669
|
-
permissionId:
|
|
670
|
-
types: [Se(Y,
|
|
667
|
+
actionId: k.actionId,
|
|
668
|
+
actionDescription: k.actionDescription,
|
|
669
|
+
permissionId: k.permissionId,
|
|
670
|
+
types: [Se(Y, d)]
|
|
671
671
|
}
|
|
672
672
|
]
|
|
673
673
|
} : Z) : B = [
|
|
674
674
|
...j,
|
|
675
675
|
{
|
|
676
|
-
resourceId:
|
|
677
|
-
resourceDescription:
|
|
676
|
+
resourceId: k.resourceId,
|
|
677
|
+
resourceDescription: k.resourceDescription,
|
|
678
678
|
permissions: [
|
|
679
679
|
{
|
|
680
|
-
actionId:
|
|
681
|
-
actionDescription:
|
|
682
|
-
permissionId:
|
|
683
|
-
types: [Se(Y,
|
|
680
|
+
actionId: k.actionId,
|
|
681
|
+
actionDescription: k.actionDescription,
|
|
682
|
+
permissionId: k.permissionId,
|
|
683
|
+
types: [Se(Y, d)]
|
|
684
684
|
}
|
|
685
685
|
]
|
|
686
686
|
}
|
|
687
687
|
], B;
|
|
688
688
|
});
|
|
689
|
-
const
|
|
690
|
-
U?.value &&
|
|
689
|
+
const I = C.filter((j) => j.value === y?.nodeProps?.owner?.resourceId).map((j) => j.children).flat(), q = I.map((j) => j.value).indexOf(y.value), U = I.find((j, B) => !j?.nodeProps?.granted && j?.value !== y.value && (I.length > q + 1 ? B > q : !0));
|
|
690
|
+
U?.value && u.select(U.value), x.expand(k.resourceId), P(U);
|
|
691
691
|
}
|
|
692
692
|
});
|
|
693
|
-
}, [
|
|
694
|
-
|
|
693
|
+
}, [y, c, d, i, C, R, v, u, x]), ue = ae(() => {
|
|
694
|
+
f?.nodeProps?.permissionId && i.deletePermission(f.nodeProps.permissionId).then(() => {
|
|
695
695
|
A((U) => [...U].filter((B) => {
|
|
696
696
|
let Z = !0;
|
|
697
697
|
return B.permissions?.forEach((W) => {
|
|
698
|
-
W.permissionId !== void 0 && W.permissionId ===
|
|
698
|
+
W.permissionId !== void 0 && W.permissionId === f?.nodeProps?.permissionId && B.permissions.length === 1 && W?.types?.length === 1 && W.types[0] === Se(Y, d) && (Z = !1);
|
|
699
699
|
}), Z;
|
|
700
700
|
}).map((B) => {
|
|
701
|
-
const Z =
|
|
702
|
-
return B.resourceId === Z.resourceId ?
|
|
701
|
+
const Z = f?.nodeProps?.owner;
|
|
702
|
+
return B.resourceId === Z.resourceId ? f?.nodeProps?.types?.length === 1 ? {
|
|
703
703
|
...B,
|
|
704
|
-
permissions: [...(B.permissions ?? []).filter((W) => W.permissionId !==
|
|
704
|
+
permissions: [...(B.permissions ?? []).filter((W) => W.permissionId !== f?.nodeProps?.permissionId)]
|
|
705
705
|
} : {
|
|
706
706
|
...B,
|
|
707
|
-
permissions: (B.permissions ?? []).map((W) => W.actionId ===
|
|
707
|
+
permissions: (B.permissions ?? []).map((W) => W.actionId === f.value ? {
|
|
708
708
|
actionId: W.actionId,
|
|
709
709
|
actionDescription: W.actionDescription,
|
|
710
|
-
types: [...W.types?.filter((
|
|
710
|
+
types: [...W.types?.filter((ce) => ce && ce !== Se(Y, d)) ?? []]
|
|
711
711
|
} : W)
|
|
712
712
|
} : B;
|
|
713
713
|
}));
|
|
714
|
-
const
|
|
715
|
-
q?.value &&
|
|
714
|
+
const k = G.filter((U) => U.value === f?.nodeProps?.owner?.resourceId).map((U) => U.children).flat(), I = k.map((U) => U.value).indexOf(f.value), q = k.find((U, j) => U?.nodeProps?.types.includes(Se(Y, d)) && U?.value !== f.value && (k.length > I + 1 ? j > I : !0));
|
|
715
|
+
q?.value && x.select(q.value), w(q);
|
|
716
716
|
});
|
|
717
|
-
}, [
|
|
717
|
+
}, [f, i, d, G, v, x]);
|
|
718
718
|
return ee(() => {
|
|
719
|
-
t && a && (
|
|
720
|
-
}, [t,
|
|
719
|
+
t && a && (P(void 0), w(void 0), l(""), L(""), x.collapseAllNodes(), u.collapseAllNodes(), z());
|
|
720
|
+
}, [t, d, c, z]), a ? /* @__PURE__ */ e($e, { opened: t, onClose: n, title: `${g().t(`archbase:${d}`)}: ${s}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ r(wr, { height: "540px", children: [
|
|
721
721
|
/* @__PURE__ */ e(Cr, { 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
722
|
/* @__PURE__ */ r("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
|
|
723
723
|
/* @__PURE__ */ r(O, { mb: 20, children: [
|
|
724
724
|
/* @__PURE__ */ e(h, { children: g().t("archbase:Available") }),
|
|
725
725
|
/* @__PURE__ */ e(
|
|
726
|
-
|
|
726
|
+
ve,
|
|
727
727
|
{
|
|
728
728
|
size: "xs",
|
|
729
729
|
value: o,
|
|
730
|
-
onChange: (
|
|
730
|
+
onChange: (k) => l(k.target.value),
|
|
731
731
|
placeholder: g().t("archbase:Filter available permissions")
|
|
732
732
|
}
|
|
733
733
|
)
|
|
734
734
|
] }),
|
|
735
|
-
/* @__PURE__ */ e(
|
|
735
|
+
/* @__PURE__ */ e(de, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
|
|
736
736
|
da,
|
|
737
737
|
{
|
|
738
|
-
data:
|
|
738
|
+
data: C,
|
|
739
739
|
selectOnClick: !0,
|
|
740
740
|
allowRangeSelection: !1,
|
|
741
|
-
tree:
|
|
742
|
-
renderNode: ({ level:
|
|
743
|
-
const Z =
|
|
744
|
-
|
|
745
|
-
}, [
|
|
741
|
+
tree: u,
|
|
742
|
+
renderNode: ({ level: k, node: I, expanded: q, hasChildren: U, selected: j, elementProps: B }) => {
|
|
743
|
+
const Z = I?.nodeProps?.granted, W = Z ? "dimmed" : void 0, ce = Z ? "line-through" : void 0, je = ae((Ze) => {
|
|
744
|
+
P(I), B.onClick(Ze);
|
|
745
|
+
}, [I, B.onClick]);
|
|
746
746
|
return /* @__PURE__ */ r(
|
|
747
747
|
O,
|
|
748
748
|
{
|
|
749
749
|
ml: U ? 0 : 5,
|
|
750
750
|
gap: 5,
|
|
751
751
|
...B,
|
|
752
|
-
bg: j &&
|
|
752
|
+
bg: j && k === 2 ? F : "",
|
|
753
753
|
onClick: je,
|
|
754
754
|
children: [
|
|
755
755
|
U && /* @__PURE__ */ e(
|
|
@@ -770,8 +770,8 @@ function Xe({ dataSource: a, opened: t, close: n }) {
|
|
|
770
770
|
h,
|
|
771
771
|
{
|
|
772
772
|
c: W,
|
|
773
|
-
td:
|
|
774
|
-
children: fa(
|
|
773
|
+
td: ce,
|
|
774
|
+
children: fa(I.label)
|
|
775
775
|
}
|
|
776
776
|
)
|
|
777
777
|
]
|
|
@@ -782,40 +782,40 @@ function Xe({ dataSource: a, opened: t, close: n }) {
|
|
|
782
782
|
) })
|
|
783
783
|
] }),
|
|
784
784
|
/* @__PURE__ */ e("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ r(V, { gap: 5, align: "center", children: [
|
|
785
|
-
/* @__PURE__ */ e(ke, { label: g().t("archbase:Add"), children: /* @__PURE__ */ e(
|
|
786
|
-
/* @__PURE__ */ e(ke, { label: g().t("archbase:Remove"), children: /* @__PURE__ */ e(
|
|
785
|
+
/* @__PURE__ */ e(ke, { label: g().t("archbase:Add"), children: /* @__PURE__ */ e(fe, { onClick: oe, disabled: !y || y?.nodeProps?.granted || !y.nodeProps, children: /* @__PURE__ */ e(Ia, {}) }) }),
|
|
786
|
+
/* @__PURE__ */ e(ke, { label: g().t("archbase:Remove"), children: /* @__PURE__ */ e(fe, { onClick: ue, disabled: !f || !f?.nodeProps?.permissionId || !f.nodeProps, children: /* @__PURE__ */ e(Ea, {}) }) })
|
|
787
787
|
] }) }),
|
|
788
788
|
/* @__PURE__ */ r("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
|
|
789
789
|
/* @__PURE__ */ r(O, { mb: 20, children: [
|
|
790
790
|
/* @__PURE__ */ e(h, { children: g().t("archbase:Granted") }),
|
|
791
791
|
/* @__PURE__ */ e(
|
|
792
|
-
|
|
792
|
+
ve,
|
|
793
793
|
{
|
|
794
794
|
size: "xs",
|
|
795
795
|
value: b,
|
|
796
|
-
onChange: (
|
|
796
|
+
onChange: (k) => L(k.target.value),
|
|
797
797
|
placeholder: g().t("archbase:Filter granted permissions")
|
|
798
798
|
}
|
|
799
799
|
)
|
|
800
800
|
] }),
|
|
801
|
-
/* @__PURE__ */ e(
|
|
801
|
+
/* @__PURE__ */ e(de, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
|
|
802
802
|
da,
|
|
803
803
|
{
|
|
804
804
|
data: G,
|
|
805
805
|
selectOnClick: !0,
|
|
806
806
|
allowRangeSelection: !1,
|
|
807
|
-
tree:
|
|
808
|
-
renderNode: ({ level:
|
|
807
|
+
tree: x,
|
|
808
|
+
renderNode: ({ level: k, node: I, expanded: q, hasChildren: U, selected: j, elementProps: B }) => {
|
|
809
809
|
const Z = ae((W) => {
|
|
810
|
-
|
|
811
|
-
}, [
|
|
810
|
+
w(I), B.onClick(W);
|
|
811
|
+
}, [I, B.onClick]);
|
|
812
812
|
return /* @__PURE__ */ r(
|
|
813
813
|
O,
|
|
814
814
|
{
|
|
815
815
|
ml: U ? 0 : 5,
|
|
816
816
|
gap: 5,
|
|
817
817
|
...B,
|
|
818
|
-
bg: j &&
|
|
818
|
+
bg: j && k === 2 ? F : "",
|
|
819
819
|
onClick: Z,
|
|
820
820
|
children: [
|
|
821
821
|
U && /* @__PURE__ */ e(
|
|
@@ -832,10 +832,10 @@ function Xe({ dataSource: a, opened: t, close: n }) {
|
|
|
832
832
|
style: { transform: "rotate(-90deg)", marginTop: "-5px" }
|
|
833
833
|
}
|
|
834
834
|
),
|
|
835
|
-
/* @__PURE__ */ e(h, { children: fa(
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
835
|
+
/* @__PURE__ */ e(h, { children: fa(I.label) }),
|
|
836
|
+
I?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e(Q, { color: "blue", children: g().t("archbase:user") }),
|
|
837
|
+
I?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e(Q, { color: "orange", children: g().t("archbase:group") }),
|
|
838
|
+
I?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e(Q, { color: "pink", children: g().t("archbase:profile") })
|
|
839
839
|
]
|
|
840
840
|
}
|
|
841
841
|
);
|
|
@@ -1164,15 +1164,15 @@ function Pe({
|
|
|
1164
1164
|
printTitle: t,
|
|
1165
1165
|
gridRef: n,
|
|
1166
1166
|
dataSource: s,
|
|
1167
|
-
isLoading:
|
|
1168
|
-
error:
|
|
1169
|
-
getRowId:
|
|
1170
|
-
striped:
|
|
1167
|
+
isLoading: c,
|
|
1168
|
+
error: d,
|
|
1169
|
+
getRowId: u,
|
|
1170
|
+
striped: x = !1,
|
|
1171
1171
|
enableRowActions: R = !0,
|
|
1172
1172
|
toolbarLeftContent: m,
|
|
1173
|
-
renderRowActions:
|
|
1173
|
+
renderRowActions: v,
|
|
1174
1174
|
actionsColumnWidth: A,
|
|
1175
|
-
children:
|
|
1175
|
+
children: y
|
|
1176
1176
|
}) {
|
|
1177
1177
|
return /* @__PURE__ */ e(
|
|
1178
1178
|
re,
|
|
@@ -1196,19 +1196,19 @@ function Pe({
|
|
|
1196
1196
|
withBorder: !1,
|
|
1197
1197
|
dataSource: s,
|
|
1198
1198
|
withColumnBorders: !0,
|
|
1199
|
-
striped:
|
|
1199
|
+
striped: x,
|
|
1200
1200
|
enableTopToolbar: !0,
|
|
1201
1201
|
enableRowActions: R,
|
|
1202
1202
|
pageSize: 50,
|
|
1203
|
-
isLoading:
|
|
1204
|
-
isError: !!
|
|
1205
|
-
error:
|
|
1203
|
+
isLoading: c,
|
|
1204
|
+
isError: !!d,
|
|
1205
|
+
error: d,
|
|
1206
1206
|
enableGlobalFilter: !0,
|
|
1207
|
-
getRowId:
|
|
1207
|
+
getRowId: u,
|
|
1208
1208
|
toolbarLeftContent: m,
|
|
1209
|
-
renderRowActions:
|
|
1209
|
+
renderRowActions: v,
|
|
1210
1210
|
actionsColumnWidth: A,
|
|
1211
|
-
children:
|
|
1211
|
+
children: y
|
|
1212
1212
|
}
|
|
1213
1213
|
)
|
|
1214
1214
|
}
|
|
@@ -1219,28 +1219,28 @@ function Ye({
|
|
|
1219
1219
|
securityType: t,
|
|
1220
1220
|
newInstance: n,
|
|
1221
1221
|
createEntitiesWithId: s,
|
|
1222
|
-
removeMessageKey:
|
|
1223
|
-
setOpenedModal:
|
|
1224
|
-
setOpenedPermissionsModal:
|
|
1225
|
-
validationContext:
|
|
1222
|
+
removeMessageKey: c,
|
|
1223
|
+
setOpenedModal: d,
|
|
1224
|
+
setOpenedPermissionsModal: u,
|
|
1225
|
+
validationContext: x,
|
|
1226
1226
|
t: R
|
|
1227
1227
|
}) {
|
|
1228
|
-
const m = a,
|
|
1228
|
+
const m = a, v = (p) => m.isEmpty() ? null : m.gotoRecordByData(p) ?? null;
|
|
1229
1229
|
return {
|
|
1230
1230
|
handleAdd: () => {
|
|
1231
1231
|
const p = n();
|
|
1232
|
-
s || (p.id = void 0), m.insert(p),
|
|
1232
|
+
s || (p.id = void 0), m.insert(p), d(t);
|
|
1233
1233
|
},
|
|
1234
1234
|
handleViewRow: (p) => {
|
|
1235
|
-
|
|
1235
|
+
v(p) && d(t);
|
|
1236
1236
|
},
|
|
1237
1237
|
handleEditRow: (p) => {
|
|
1238
|
-
|
|
1238
|
+
v(p) && (m.isEditing() || m.edit(), d(t));
|
|
1239
1239
|
},
|
|
1240
1240
|
handleRemoveRow: (p) => {
|
|
1241
|
-
|
|
1241
|
+
v(p) && ge.showConfirmDialogYesNo(
|
|
1242
1242
|
`${R("archbase:Confirme")}`,
|
|
1243
|
-
`${R(
|
|
1243
|
+
`${R(c)}${p.name} ?`,
|
|
1244
1244
|
() => {
|
|
1245
1245
|
m.remove();
|
|
1246
1246
|
},
|
|
@@ -1254,13 +1254,13 @@ function Ye({
|
|
|
1254
1254
|
} catch {
|
|
1255
1255
|
return;
|
|
1256
1256
|
}
|
|
1257
|
-
|
|
1257
|
+
d(""), x?.clearAll();
|
|
1258
1258
|
},
|
|
1259
1259
|
handleCancelModal: () => {
|
|
1260
|
-
|
|
1260
|
+
d(""), m.isBrowsing() || m.cancel(), x?.clearAll();
|
|
1261
1261
|
},
|
|
1262
1262
|
handleOpenPermissionsModal: () => {
|
|
1263
|
-
|
|
1263
|
+
u(t);
|
|
1264
1264
|
}
|
|
1265
1265
|
};
|
|
1266
1266
|
}
|
|
@@ -1269,19 +1269,19 @@ function _e({
|
|
|
1269
1269
|
onView: t,
|
|
1270
1270
|
onEdit: n,
|
|
1271
1271
|
onRemove: s,
|
|
1272
|
-
onEditPermissions:
|
|
1273
|
-
before:
|
|
1274
|
-
after:
|
|
1275
|
-
t:
|
|
1272
|
+
onEditPermissions: c,
|
|
1273
|
+
before: d,
|
|
1274
|
+
after: u,
|
|
1275
|
+
t: x
|
|
1276
1276
|
}) {
|
|
1277
|
-
const R = oa(), { colorScheme: m } = qe(),
|
|
1277
|
+
const R = oa(), { colorScheme: m } = qe(), v = m === "dark", A = (y) => v ? R.colors[y][8] : R.colors[y][4];
|
|
1278
1278
|
return /* @__PURE__ */ r(O, { gap: 1, wrap: "nowrap", children: [
|
|
1279
|
-
|
|
1280
|
-
/* @__PURE__ */ e(
|
|
1281
|
-
/* @__PURE__ */ e(
|
|
1282
|
-
/* @__PURE__ */ e(
|
|
1283
|
-
/* @__PURE__ */ e(ke, { withinPortal: !0, withArrow: !0, position: "left", label: `${
|
|
1284
|
-
|
|
1279
|
+
d?.(a),
|
|
1280
|
+
/* @__PURE__ */ e(fe, { variant: "transparent", onClick: () => t(a), children: /* @__PURE__ */ e(hr, { size: 20, color: A("blue") }) }),
|
|
1281
|
+
/* @__PURE__ */ e(fe, { variant: "transparent", onClick: () => n(a), children: /* @__PURE__ */ e(Pa, { size: 20, color: A("yellow") }) }),
|
|
1282
|
+
/* @__PURE__ */ e(fe, { variant: "transparent", onClick: () => s(a), children: /* @__PURE__ */ e(na, { size: 20, color: A("red") }) }),
|
|
1283
|
+
/* @__PURE__ */ e(ke, { withinPortal: !0, withArrow: !0, position: "left", label: `${x("archbase:Edit permissions")}`, children: /* @__PURE__ */ e(fe, { variant: "transparent", onClick: c, children: /* @__PURE__ */ e(pr, { size: 20, color: A("green") }) }) }),
|
|
1284
|
+
u?.(a)
|
|
1285
1285
|
] });
|
|
1286
1286
|
}
|
|
1287
1287
|
const ea = ({ onAdd: a, onEditPermissions: t, t: n }) => /* @__PURE__ */ r(Fe, { justify: "space-between", style: { width: "50%" }, children: [
|
|
@@ -1296,23 +1296,23 @@ function mt({
|
|
|
1296
1296
|
width: t = "100%",
|
|
1297
1297
|
createEntitiesWithId: n = !0,
|
|
1298
1298
|
userModalOptions: s,
|
|
1299
|
-
profileModalOptions:
|
|
1300
|
-
groupModalOptions:
|
|
1301
|
-
options:
|
|
1299
|
+
profileModalOptions: c,
|
|
1300
|
+
groupModalOptions: d,
|
|
1301
|
+
options: u
|
|
1302
1302
|
}) {
|
|
1303
1303
|
oa(), ka("securityStore");
|
|
1304
|
-
const
|
|
1304
|
+
const x = rr(), { colorScheme: R } = qe(), [m, v] = T(void 0), [A, y] = T("users"), P = J(K.User), f = J(K.Group), w = J(K.Resource), o = J(K.Profile), [l, p] = T(""), [b, L] = T(""), E = J(K.AccessToken), { t: i } = tr(), N = Re(null), F = Re(null), G = Re(null), D = Re(null), C = Re(null), z = (M) => M.id, oe = (M) => M.id, ue = (M) => M.id, k = (M) => M.id, I = (M) => M.id, {
|
|
1305
1305
|
dataSource: q,
|
|
1306
1306
|
isLoading: U,
|
|
1307
1307
|
refreshData: j
|
|
1308
1308
|
} = Ee({
|
|
1309
1309
|
name: "accessTokenApi",
|
|
1310
|
-
service:
|
|
1311
|
-
validator:
|
|
1310
|
+
service: E,
|
|
1311
|
+
validator: x,
|
|
1312
1312
|
pageSize: 25,
|
|
1313
1313
|
defaultSortFields: ["user.email", "expirationTime:desc"],
|
|
1314
1314
|
onError: (M, te) => {
|
|
1315
|
-
|
|
1315
|
+
v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
|
|
1316
1316
|
}
|
|
1317
1317
|
}), {
|
|
1318
1318
|
dataSource: B,
|
|
@@ -1320,23 +1320,23 @@ function mt({
|
|
|
1320
1320
|
refreshData: W
|
|
1321
1321
|
} = Ee({
|
|
1322
1322
|
name: "dsUsers",
|
|
1323
|
-
service:
|
|
1324
|
-
validator:
|
|
1323
|
+
service: P,
|
|
1324
|
+
validator: x,
|
|
1325
1325
|
pageSize: 25,
|
|
1326
1326
|
onError: (M, te) => {
|
|
1327
|
-
|
|
1327
|
+
v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
|
|
1328
1328
|
}
|
|
1329
1329
|
}), {
|
|
1330
|
-
dataSource:
|
|
1330
|
+
dataSource: ce,
|
|
1331
1331
|
isLoading: je,
|
|
1332
1332
|
refreshData: Ze
|
|
1333
1333
|
} = Ee({
|
|
1334
1334
|
name: "dsGroups",
|
|
1335
|
-
service:
|
|
1336
|
-
validator:
|
|
1335
|
+
service: f,
|
|
1336
|
+
validator: x,
|
|
1337
1337
|
pageSize: 25,
|
|
1338
1338
|
onError: (M, te) => {
|
|
1339
|
-
|
|
1339
|
+
v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
|
|
1340
1340
|
}
|
|
1341
1341
|
}), {
|
|
1342
1342
|
dataSource: Le,
|
|
@@ -1345,10 +1345,10 @@ function mt({
|
|
|
1345
1345
|
} = Ee({
|
|
1346
1346
|
name: "dsProfile",
|
|
1347
1347
|
service: o,
|
|
1348
|
-
validator:
|
|
1348
|
+
validator: x,
|
|
1349
1349
|
pageSize: 25,
|
|
1350
1350
|
onError: (M, te) => {
|
|
1351
|
-
|
|
1351
|
+
v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
|
|
1352
1352
|
}
|
|
1353
1353
|
}), {
|
|
1354
1354
|
dataSource: $a,
|
|
@@ -1356,17 +1356,17 @@ function mt({
|
|
|
1356
1356
|
refreshData: Ma
|
|
1357
1357
|
} = Ee({
|
|
1358
1358
|
name: "dsResources",
|
|
1359
|
-
service:
|
|
1360
|
-
validator:
|
|
1359
|
+
service: w,
|
|
1360
|
+
validator: x,
|
|
1361
1361
|
pageSize: 25,
|
|
1362
1362
|
onError: (M, te) => {
|
|
1363
|
-
|
|
1363
|
+
v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
|
|
1364
1364
|
}
|
|
1365
1365
|
});
|
|
1366
1366
|
ee(() => {
|
|
1367
1367
|
j({ filter: Ge(De.eq("revoked", "false")) }), W(), Ze(), Oa(), Ma();
|
|
1368
1368
|
}, []);
|
|
1369
|
-
const Va = Dr(i), Ga = Nr(i), Ua = Or(i), Ba = $r(i), Wa = Lr(i), Qe = ir(),
|
|
1369
|
+
const Va = Dr(i), Ga = Nr(i), Ua = Or(i), Ba = $r(i), Wa = Lr(i), Qe = ir(), he = Ye({
|
|
1370
1370
|
dataSource: B,
|
|
1371
1371
|
securityType: Y.USER,
|
|
1372
1372
|
newInstance: () => mr.newInstance(),
|
|
@@ -1376,8 +1376,8 @@ function mt({
|
|
|
1376
1376
|
setOpenedPermissionsModal: L,
|
|
1377
1377
|
validationContext: Qe,
|
|
1378
1378
|
t: i
|
|
1379
|
-
}),
|
|
1380
|
-
dataSource:
|
|
1379
|
+
}), pe = Ye({
|
|
1380
|
+
dataSource: ce,
|
|
1381
1381
|
securityType: Y.GROUP,
|
|
1382
1382
|
newInstance: () => gr.newInstance(),
|
|
1383
1383
|
createEntitiesWithId: n,
|
|
@@ -1386,7 +1386,7 @@ function mt({
|
|
|
1386
1386
|
setOpenedPermissionsModal: L,
|
|
1387
1387
|
validationContext: Qe,
|
|
1388
1388
|
t: i
|
|
1389
|
-
}),
|
|
1389
|
+
}), me = Ye({
|
|
1390
1390
|
dataSource: Le,
|
|
1391
1391
|
securityType: Y.PROFILE,
|
|
1392
1392
|
newInstance: () => fr.newInstance(),
|
|
@@ -1400,53 +1400,53 @@ function mt({
|
|
|
1400
1400
|
_e,
|
|
1401
1401
|
{
|
|
1402
1402
|
row: M,
|
|
1403
|
-
onView:
|
|
1404
|
-
onEdit:
|
|
1405
|
-
onRemove:
|
|
1406
|
-
onEditPermissions:
|
|
1407
|
-
before:
|
|
1408
|
-
after:
|
|
1403
|
+
onView: he.handleViewRow,
|
|
1404
|
+
onEdit: he.handleEditRow,
|
|
1405
|
+
onRemove: he.handleRemoveRow,
|
|
1406
|
+
onEditPermissions: he.handleOpenPermissionsModal,
|
|
1407
|
+
before: u?.beforeDefaultUserActions,
|
|
1408
|
+
after: u?.afterDefaultUserActions,
|
|
1409
1409
|
t: i
|
|
1410
1410
|
}
|
|
1411
1411
|
), Ha = (M) => /* @__PURE__ */ e(
|
|
1412
1412
|
_e,
|
|
1413
1413
|
{
|
|
1414
1414
|
row: M,
|
|
1415
|
-
onView:
|
|
1416
|
-
onEdit:
|
|
1417
|
-
onRemove:
|
|
1418
|
-
onEditPermissions:
|
|
1419
|
-
before:
|
|
1420
|
-
after:
|
|
1415
|
+
onView: pe.handleViewRow,
|
|
1416
|
+
onEdit: pe.handleEditRow,
|
|
1417
|
+
onRemove: pe.handleRemoveRow,
|
|
1418
|
+
onEditPermissions: pe.handleOpenPermissionsModal,
|
|
1419
|
+
before: u?.beforeDefaultGroupActions,
|
|
1420
|
+
after: u?.afterDefaultGroupActions,
|
|
1421
1421
|
t: i
|
|
1422
1422
|
}
|
|
1423
1423
|
), ja = (M) => /* @__PURE__ */ e(
|
|
1424
1424
|
_e,
|
|
1425
1425
|
{
|
|
1426
1426
|
row: M,
|
|
1427
|
-
onView:
|
|
1428
|
-
onEdit:
|
|
1429
|
-
onRemove:
|
|
1430
|
-
onEditPermissions:
|
|
1431
|
-
before:
|
|
1432
|
-
after:
|
|
1427
|
+
onView: me.handleViewRow,
|
|
1428
|
+
onEdit: me.handleEditRow,
|
|
1429
|
+
onRemove: me.handleRemoveRow,
|
|
1430
|
+
onEditPermissions: me.handleOpenPermissionsModal,
|
|
1431
|
+
before: u?.beforeDefaultProfileActions,
|
|
1432
|
+
after: u?.afterDefaultProfileActions,
|
|
1433
1433
|
t: i
|
|
1434
1434
|
}
|
|
1435
1435
|
), Za = () => {
|
|
1436
1436
|
const M = q.getCurrentRecord();
|
|
1437
|
-
M &&
|
|
1437
|
+
M && ge.showConfirmDialogYesNo(
|
|
1438
1438
|
`${i("archbase:Confirme")}`,
|
|
1439
1439
|
`${i("archbase:Deseja revogar o token de Acesso do usuário ")}${M.user.name} ?`,
|
|
1440
1440
|
async () => {
|
|
1441
|
-
await
|
|
1442
|
-
|
|
1441
|
+
await E.revoke(M.token).then(async () => {
|
|
1442
|
+
ne.showSuccess(
|
|
1443
1443
|
`${i("mentors:Informação")}`,
|
|
1444
1444
|
`${i("mentors:Token de Acesso revogado com sucesso!")}`
|
|
1445
1445
|
), q.refreshData();
|
|
1446
1446
|
}).catch((te) => {
|
|
1447
|
-
|
|
1447
|
+
ge.showErrorWithDetails(
|
|
1448
1448
|
`${i("mentors:Atenção")}`,
|
|
1449
|
-
|
|
1449
|
+
be(te),
|
|
1450
1450
|
Ve(te)
|
|
1451
1451
|
);
|
|
1452
1452
|
});
|
|
@@ -1467,7 +1467,7 @@ function mt({
|
|
|
1467
1467
|
}
|
|
1468
1468
|
) }) });
|
|
1469
1469
|
return /* @__PURE__ */ r(re, { p: "md", style: { height: a, display: "flex", flexDirection: "column" }, children: [
|
|
1470
|
-
/* @__PURE__ */ e(Ce, { variant: "pills", value: A, onChange:
|
|
1470
|
+
/* @__PURE__ */ e(Ce, { variant: "pills", value: A, onChange: y, children: /* @__PURE__ */ r(Ce.List, { children: [
|
|
1471
1471
|
/* @__PURE__ */ e(Ce.Tab, { value: "users", children: `${i("Usuários")}` }),
|
|
1472
1472
|
/* @__PURE__ */ e(Ce.Tab, { value: "groups", children: `${i("Grupos")}` }),
|
|
1473
1473
|
/* @__PURE__ */ e(Ce.Tab, { value: "profiles", children: `${i("Perfis")}` }),
|
|
@@ -1479,22 +1479,22 @@ function mt({
|
|
|
1479
1479
|
{
|
|
1480
1480
|
active: A === "users",
|
|
1481
1481
|
printTitle: "Usuários",
|
|
1482
|
-
gridRef:
|
|
1482
|
+
gridRef: N,
|
|
1483
1483
|
dataSource: B,
|
|
1484
1484
|
isLoading: Z,
|
|
1485
1485
|
error: m,
|
|
1486
|
-
getRowId:
|
|
1486
|
+
getRowId: z,
|
|
1487
1487
|
striped: !0,
|
|
1488
1488
|
toolbarLeftContent: /* @__PURE__ */ e(
|
|
1489
1489
|
ea,
|
|
1490
1490
|
{
|
|
1491
|
-
onAdd:
|
|
1492
|
-
onEditPermissions:
|
|
1491
|
+
onAdd: he.handleAdd,
|
|
1492
|
+
onEditPermissions: he.handleOpenPermissionsModal,
|
|
1493
1493
|
t: i
|
|
1494
1494
|
}
|
|
1495
1495
|
),
|
|
1496
1496
|
renderRowActions: qa,
|
|
1497
|
-
actionsColumnWidth:
|
|
1497
|
+
actionsColumnWidth: u?.userActionsColumnWidth,
|
|
1498
1498
|
children: Ga
|
|
1499
1499
|
}
|
|
1500
1500
|
),
|
|
@@ -1503,21 +1503,21 @@ function mt({
|
|
|
1503
1503
|
{
|
|
1504
1504
|
active: A === "groups",
|
|
1505
1505
|
printTitle: "Grupos",
|
|
1506
|
-
gridRef:
|
|
1507
|
-
dataSource:
|
|
1506
|
+
gridRef: F,
|
|
1507
|
+
dataSource: ce,
|
|
1508
1508
|
isLoading: je,
|
|
1509
1509
|
error: m,
|
|
1510
|
-
getRowId:
|
|
1510
|
+
getRowId: oe,
|
|
1511
1511
|
toolbarLeftContent: /* @__PURE__ */ e(
|
|
1512
1512
|
ea,
|
|
1513
1513
|
{
|
|
1514
|
-
onAdd:
|
|
1515
|
-
onEditPermissions:
|
|
1514
|
+
onAdd: pe.handleAdd,
|
|
1515
|
+
onEditPermissions: pe.handleOpenPermissionsModal,
|
|
1516
1516
|
t: i
|
|
1517
1517
|
}
|
|
1518
1518
|
),
|
|
1519
1519
|
renderRowActions: Ha,
|
|
1520
|
-
actionsColumnWidth:
|
|
1520
|
+
actionsColumnWidth: u?.groupActionsColumnWidth,
|
|
1521
1521
|
children: Ua
|
|
1522
1522
|
}
|
|
1523
1523
|
),
|
|
@@ -1530,17 +1530,17 @@ function mt({
|
|
|
1530
1530
|
dataSource: Le,
|
|
1531
1531
|
isLoading: Na,
|
|
1532
1532
|
error: m,
|
|
1533
|
-
getRowId:
|
|
1533
|
+
getRowId: ue,
|
|
1534
1534
|
toolbarLeftContent: /* @__PURE__ */ e(
|
|
1535
1535
|
ea,
|
|
1536
1536
|
{
|
|
1537
|
-
onAdd:
|
|
1538
|
-
onEditPermissions:
|
|
1537
|
+
onAdd: me.handleAdd,
|
|
1538
|
+
onEditPermissions: me.handleOpenPermissionsModal,
|
|
1539
1539
|
t: i
|
|
1540
1540
|
}
|
|
1541
1541
|
),
|
|
1542
1542
|
renderRowActions: ja,
|
|
1543
|
-
actionsColumnWidth:
|
|
1543
|
+
actionsColumnWidth: u?.profileActionsColumnWidth,
|
|
1544
1544
|
children: Ba
|
|
1545
1545
|
}
|
|
1546
1546
|
),
|
|
@@ -1549,11 +1549,11 @@ function mt({
|
|
|
1549
1549
|
{
|
|
1550
1550
|
active: A === "resources",
|
|
1551
1551
|
printTitle: "Recursos",
|
|
1552
|
-
gridRef:
|
|
1552
|
+
gridRef: D,
|
|
1553
1553
|
dataSource: $a,
|
|
1554
1554
|
isLoading: La,
|
|
1555
1555
|
error: m,
|
|
1556
|
-
getRowId:
|
|
1556
|
+
getRowId: k,
|
|
1557
1557
|
enableRowActions: !1,
|
|
1558
1558
|
children: Wa
|
|
1559
1559
|
}
|
|
@@ -1563,11 +1563,11 @@ function mt({
|
|
|
1563
1563
|
{
|
|
1564
1564
|
active: A === "accessTokens",
|
|
1565
1565
|
printTitle: "Tokens de API",
|
|
1566
|
-
gridRef:
|
|
1566
|
+
gridRef: C,
|
|
1567
1567
|
dataSource: q,
|
|
1568
1568
|
isLoading: U,
|
|
1569
1569
|
error: m,
|
|
1570
|
-
getRowId:
|
|
1570
|
+
getRowId: I,
|
|
1571
1571
|
striped: !0,
|
|
1572
1572
|
enableRowActions: !1,
|
|
1573
1573
|
toolbarLeftContent: Qa(),
|
|
@@ -1577,31 +1577,31 @@ function mt({
|
|
|
1577
1577
|
l === Y.USER ? /* @__PURE__ */ e(
|
|
1578
1578
|
zr,
|
|
1579
1579
|
{
|
|
1580
|
-
onClickOk:
|
|
1580
|
+
onClickOk: he.handleSaveModal,
|
|
1581
1581
|
opened: !0,
|
|
1582
1582
|
dataSource: B,
|
|
1583
|
-
onClickCancel:
|
|
1583
|
+
onClickCancel: he.handleCancelModal,
|
|
1584
1584
|
options: s
|
|
1585
1585
|
}
|
|
1586
1586
|
) : null,
|
|
1587
1587
|
l === Y.GROUP ? /* @__PURE__ */ e(
|
|
1588
1588
|
kr,
|
|
1589
1589
|
{
|
|
1590
|
-
onClickOk:
|
|
1590
|
+
onClickOk: pe.handleSaveModal,
|
|
1591
1591
|
opened: !0,
|
|
1592
|
-
dataSource:
|
|
1593
|
-
onClickCancel:
|
|
1594
|
-
options:
|
|
1592
|
+
dataSource: ce,
|
|
1593
|
+
onClickCancel: pe.handleCancelModal,
|
|
1594
|
+
options: d
|
|
1595
1595
|
}
|
|
1596
1596
|
) : null,
|
|
1597
1597
|
l === Y.PROFILE ? /* @__PURE__ */ e(
|
|
1598
1598
|
xr,
|
|
1599
1599
|
{
|
|
1600
|
-
onClickOk:
|
|
1600
|
+
onClickOk: me.handleSaveModal,
|
|
1601
1601
|
opened: !0,
|
|
1602
1602
|
dataSource: Le,
|
|
1603
|
-
onClickCancel:
|
|
1604
|
-
options:
|
|
1603
|
+
onClickCancel: me.handleCancelModal,
|
|
1604
|
+
options: c
|
|
1605
1605
|
}
|
|
1606
1606
|
) : null,
|
|
1607
1607
|
b === Y.USER ? /* @__PURE__ */ e(
|
|
@@ -1615,7 +1615,7 @@ function mt({
|
|
|
1615
1615
|
b === Y.GROUP ? /* @__PURE__ */ e(
|
|
1616
1616
|
Xe,
|
|
1617
1617
|
{
|
|
1618
|
-
dataSource:
|
|
1618
|
+
dataSource: ce,
|
|
1619
1619
|
opened: !!b,
|
|
1620
1620
|
close: Ke
|
|
1621
1621
|
}
|
|
@@ -1632,31 +1632,31 @@ function mt({
|
|
|
1632
1632
|
}
|
|
1633
1633
|
function gt({ height: a = "400px", width: t = "100%" }) {
|
|
1634
1634
|
oa();
|
|
1635
|
-
const n = ka("apiTokenStore"), s = { validateEntity: () => [] }, { colorScheme:
|
|
1635
|
+
const n = ka("apiTokenStore"), s = { validateEntity: () => [] }, { colorScheme: c } = qe(), [d, u] = T(void 0), x = J(K.ApiToken), [R, m] = T(""), v = Re(null), A = (F) => F.id, { dataSource: y } = dr({
|
|
1636
1636
|
initialData: [],
|
|
1637
1637
|
name: "dataSource"
|
|
1638
|
-
}),
|
|
1638
|
+
}), P = Ne(
|
|
1639
1639
|
"ArchbaseApiTokenView-LocalDataSource",
|
|
1640
|
-
|
|
1640
|
+
y,
|
|
1641
1641
|
void 0,
|
|
1642
1642
|
void 0
|
|
1643
|
-
), { dataSource:
|
|
1643
|
+
), { dataSource: f, isLoading: w } = ta({
|
|
1644
1644
|
name: "dsApiToken",
|
|
1645
|
-
service:
|
|
1645
|
+
service: x,
|
|
1646
1646
|
store: n,
|
|
1647
1647
|
validator: s,
|
|
1648
1648
|
pageSize: 25,
|
|
1649
1649
|
loadOnStart: !0,
|
|
1650
|
-
onLoadComplete: (
|
|
1650
|
+
onLoadComplete: (F) => {
|
|
1651
1651
|
},
|
|
1652
|
-
onDestroy: (
|
|
1652
|
+
onDestroy: (F) => {
|
|
1653
1653
|
},
|
|
1654
|
-
onError: (
|
|
1655
|
-
|
|
1654
|
+
onError: (F, G) => {
|
|
1655
|
+
u(F), ne.showError(g().t("archbase:WARNING"), F, G);
|
|
1656
1656
|
}
|
|
1657
1657
|
}), o = Ne(
|
|
1658
1658
|
"ArchbaseApiTokenView-RemoteDataSource",
|
|
1659
|
-
|
|
1659
|
+
f,
|
|
1660
1660
|
void 0,
|
|
1661
1661
|
void 0
|
|
1662
1662
|
), l = `calc(${a} - 40px)`, p = /* @__PURE__ */ r(Ie, { children: [
|
|
@@ -1667,11 +1667,11 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1667
1667
|
dataType: "image",
|
|
1668
1668
|
size: 80,
|
|
1669
1669
|
header: "Foto",
|
|
1670
|
-
render: (
|
|
1670
|
+
render: (F) => /* @__PURE__ */ e(
|
|
1671
1671
|
"img",
|
|
1672
1672
|
{
|
|
1673
1673
|
style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
|
|
1674
|
-
src:
|
|
1674
|
+
src: F.row.user && F.row.user.avatar ? atob(F.row.user.avatar) : sa
|
|
1675
1675
|
}
|
|
1676
1676
|
),
|
|
1677
1677
|
inputFilterType: "text",
|
|
@@ -1747,17 +1747,17 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1747
1747
|
dataType: "text",
|
|
1748
1748
|
size: 240,
|
|
1749
1749
|
header: "Validade",
|
|
1750
|
-
render: (
|
|
1751
|
-
if (!
|
|
1750
|
+
render: (F) => {
|
|
1751
|
+
if (!F.row.expirationDate)
|
|
1752
1752
|
return /* @__PURE__ */ e(h, { c: "dimmed", children: "Sem expiração" });
|
|
1753
1753
|
const G = /* @__PURE__ */ new Date();
|
|
1754
1754
|
G.setHours(0, 0, 0, 0);
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1757
|
-
const
|
|
1758
|
-
let
|
|
1759
|
-
|
|
1760
|
-
const q =
|
|
1755
|
+
const D = new Date(F.row.expirationDate);
|
|
1756
|
+
D.setHours(0, 0, 0, 0);
|
|
1757
|
+
const C = D.getTime() - G.getTime(), z = Math.ceil(C / (1e3 * 60 * 60 * 24));
|
|
1758
|
+
let ue = Math.max(0, Math.min(100, z / 365 * 100)), k = "green", I = "";
|
|
1759
|
+
z < 0 ? (k = "red", ue = 100, I = `Vencido há ${Math.abs(z)} dia${Math.abs(z) !== 1 ? "s" : ""}`) : z === 0 ? (k = "red", ue = 5, I = "Vence hoje") : z <= 7 ? (k = "red", I = `${z} dia${z !== 1 ? "s" : ""}`) : z <= 30 ? (k = "orange", I = `${z} dias`) : z <= 90 ? (k = "yellow", I = `${z} dias`) : (k = "green", I = `${z} dias`);
|
|
1760
|
+
const q = z < 0 ? `Vencido em ${D.toLocaleDateString()}` : `Expira em ${D.toLocaleDateString()}`;
|
|
1761
1761
|
return /* @__PURE__ */ e(ke, { label: q, withArrow: !0, children: /* @__PURE__ */ r(O, { gap: "xs", wrap: "nowrap", children: [
|
|
1762
1762
|
/* @__PURE__ */ e(
|
|
1763
1763
|
Ka,
|
|
@@ -1765,10 +1765,10 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1765
1765
|
size: 36,
|
|
1766
1766
|
thickness: 4,
|
|
1767
1767
|
roundCaps: !0,
|
|
1768
|
-
sections: [{ value:
|
|
1768
|
+
sections: [{ value: z < 0 ? 100 : ue, color: k }]
|
|
1769
1769
|
}
|
|
1770
1770
|
),
|
|
1771
|
-
/* @__PURE__ */ e(h, { size: "sm", c:
|
|
1771
|
+
/* @__PURE__ */ e(h, { size: "sm", c: z < 0 ? "red" : void 0, fw: z <= 7 ? 600 : void 0, children: I })
|
|
1772
1772
|
] }) });
|
|
1773
1773
|
},
|
|
1774
1774
|
inputFilterType: "text"
|
|
@@ -1793,59 +1793,59 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1793
1793
|
}
|
|
1794
1794
|
)
|
|
1795
1795
|
] }), b = () => {
|
|
1796
|
-
|
|
1796
|
+
y.insert(br.newInstance()), y && !P.isDataSourceV2 && P.v1State.forceUpdate(), m("apiToken");
|
|
1797
1797
|
}, L = () => {
|
|
1798
|
-
|
|
1798
|
+
f.getCurrentRecord() && ge.showConfirmDialogYesNo(
|
|
1799
1799
|
`${g().t("archbase:Confirme")}`,
|
|
1800
|
-
`${g().t("archbase:Deseja revogar o token de API do usuário ")}${
|
|
1800
|
+
`${g().t("archbase:Deseja revogar o token de API do usuário ")}${f.getCurrentRecord().user.name} ?`,
|
|
1801
1801
|
async () => {
|
|
1802
|
-
await
|
|
1803
|
-
|
|
1802
|
+
await x.revoke(f.getCurrentRecord().token).then(async () => {
|
|
1803
|
+
ne.showSuccess(
|
|
1804
1804
|
`${g().t("mentors:Informação")}`,
|
|
1805
1805
|
`${g().t("mentors:Token de API revogado com sucesso!")}`
|
|
1806
|
-
),
|
|
1807
|
-
}).catch((
|
|
1808
|
-
|
|
1806
|
+
), f.refreshData(), f && !o.isDataSourceV2 && o.v1State.forceUpdate();
|
|
1807
|
+
}).catch((F) => {
|
|
1808
|
+
ge.showErrorWithDetails(
|
|
1809
1809
|
`${g().t("mentors:Atenção")}`,
|
|
1810
|
-
|
|
1811
|
-
Ve(
|
|
1810
|
+
be(F),
|
|
1811
|
+
Ve(F)
|
|
1812
1812
|
);
|
|
1813
1813
|
});
|
|
1814
1814
|
},
|
|
1815
1815
|
() => {
|
|
1816
1816
|
}
|
|
1817
1817
|
);
|
|
1818
|
-
},
|
|
1818
|
+
}, E = () => {
|
|
1819
1819
|
m("");
|
|
1820
|
-
}, i = async (
|
|
1821
|
-
const
|
|
1822
|
-
if (
|
|
1820
|
+
}, i = async (F, G) => {
|
|
1821
|
+
const D = y.getCurrentRecord();
|
|
1822
|
+
if (D)
|
|
1823
1823
|
try {
|
|
1824
|
-
if (
|
|
1825
|
-
|
|
1824
|
+
if (y.validate(), !D.user || !D.user.email) {
|
|
1825
|
+
ge.showErrorWithDetails(
|
|
1826
1826
|
`${g().t("archbase:WARNING")}`,
|
|
1827
1827
|
`${g().t("archbase:Selecione um usuário para o token de API")}`,
|
|
1828
1828
|
""
|
|
1829
1829
|
);
|
|
1830
1830
|
return;
|
|
1831
1831
|
}
|
|
1832
|
-
await
|
|
1833
|
-
|
|
1832
|
+
await x.create(D.user.email, D.expirationDate, D.name, D.description).then(async (C) => {
|
|
1833
|
+
y.cancel(), y && !P.isDataSourceV2 && P.v1State.forceUpdate(), f.append(C), f && !o.isDataSourceV2 && o.v1State.forceUpdate(), ne.showSuccess(
|
|
1834
1834
|
`${g().t("mentors:Informação")}`,
|
|
1835
1835
|
`${g().t("mentors:Token de API gerado com sucesso!")}`
|
|
1836
1836
|
), G && G(!0);
|
|
1837
|
-
}).catch((
|
|
1838
|
-
|
|
1837
|
+
}).catch((C) => {
|
|
1838
|
+
ge.showErrorWithDetails(
|
|
1839
1839
|
`${g().t("mentors:Atenção")}`,
|
|
1840
|
-
|
|
1841
|
-
Ve(
|
|
1840
|
+
be(C),
|
|
1841
|
+
Ve(C)
|
|
1842
1842
|
);
|
|
1843
1843
|
});
|
|
1844
|
-
} catch (
|
|
1845
|
-
|
|
1844
|
+
} catch (C) {
|
|
1845
|
+
ge.showErrorWithDetails(
|
|
1846
1846
|
`${g().t("mentors:Atenção")}`,
|
|
1847
|
-
|
|
1848
|
-
Ve(
|
|
1847
|
+
be(C),
|
|
1848
|
+
Ve(C)
|
|
1849
1849
|
);
|
|
1850
1850
|
}
|
|
1851
1851
|
};
|
|
@@ -1865,25 +1865,25 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1865
1865
|
children: /* @__PURE__ */ e(
|
|
1866
1866
|
za,
|
|
1867
1867
|
{
|
|
1868
|
-
gridRef:
|
|
1868
|
+
gridRef: v,
|
|
1869
1869
|
printTitle: "Tokens de API",
|
|
1870
1870
|
width: "100%",
|
|
1871
1871
|
height: "100%",
|
|
1872
1872
|
withBorder: !1,
|
|
1873
|
-
dataSource:
|
|
1873
|
+
dataSource: f,
|
|
1874
1874
|
withColumnBorders: !0,
|
|
1875
1875
|
striped: !0,
|
|
1876
1876
|
enableTopToolbar: !0,
|
|
1877
1877
|
enableRowActions: !1,
|
|
1878
1878
|
pageSize: 50,
|
|
1879
|
-
isLoading:
|
|
1880
|
-
isError: !!
|
|
1881
|
-
error:
|
|
1879
|
+
isLoading: w,
|
|
1880
|
+
isError: !!d,
|
|
1881
|
+
error: d,
|
|
1882
1882
|
enableGlobalFilter: !0,
|
|
1883
1883
|
getRowId: A,
|
|
1884
1884
|
toolbarLeftContent: /* @__PURE__ */ e(Fe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ r(O, { align: "start", gap: "2px", wrap: "nowrap", children: [
|
|
1885
1885
|
/* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Fa, {}), onClick: b, children: g().t("archbase:New") }),
|
|
1886
|
-
/* @__PURE__ */ e(X, { disabled: !
|
|
1886
|
+
/* @__PURE__ */ e(X, { disabled: !f.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e(na, {}), onClick: L, children: g().t("archbase:Revoke") })
|
|
1887
1887
|
] }) }),
|
|
1888
1888
|
children: p
|
|
1889
1889
|
}
|
|
@@ -1893,11 +1893,11 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1893
1893
|
R === "apiToken" ? /* @__PURE__ */ e(
|
|
1894
1894
|
Er,
|
|
1895
1895
|
{
|
|
1896
|
-
onClickOk:
|
|
1896
|
+
onClickOk: E,
|
|
1897
1897
|
opened: !0,
|
|
1898
|
-
dataSource:
|
|
1898
|
+
dataSource: y,
|
|
1899
1899
|
onCustomSave: i,
|
|
1900
|
-
onClickCancel:
|
|
1900
|
+
onClickCancel: E
|
|
1901
1901
|
}
|
|
1902
1902
|
) : null
|
|
1903
1903
|
] });
|
|
@@ -1952,32 +1952,32 @@ const Ue = (a) => {
|
|
|
1952
1952
|
] }) }, t.key)) }), Ur = ({ attributes: a }) => /* @__PURE__ */ e(V, { gap: 7, children: a.map((t, n) => /* @__PURE__ */ r(O, { gap: 12, wrap: "nowrap", justify: "space-between", children: [
|
|
1953
1953
|
/* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: t.label }),
|
|
1954
1954
|
/* @__PURE__ */ e(h, { size: "sm", fw: 600, ta: "right", children: t.value })
|
|
1955
|
-
] }, `${t.label}-${n}`)) }),
|
|
1955
|
+
] }, `${t.label}-${n}`)) }), we = ({ title: a, hint: t, children: n }) => /* @__PURE__ */ r(V, { gap: "xs", children: [
|
|
1956
1956
|
/* @__PURE__ */ r(O, { gap: 10, align: "baseline", wrap: "wrap", children: [
|
|
1957
1957
|
/* @__PURE__ */ e(h, { size: "xs", fw: 650, tt: "uppercase", style: { letterSpacing: ".05em" }, children: a }),
|
|
1958
1958
|
t ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: t }) : null
|
|
1959
1959
|
] }),
|
|
1960
1960
|
n
|
|
1961
|
-
] }), Oe = ({ children: a, maxHeight: t = 420 }) => /* @__PURE__ */ e(
|
|
1961
|
+
] }), Oe = ({ children: a, maxHeight: t = 420 }) => /* @__PURE__ */ e(de.Autosize, { mah: t, type: "hover", offsetScrollbars: !0, children: /* @__PURE__ */ e(S.ScrollContainer, { minWidth: 480, type: "native", children: a }) }), Br = 25, Wr = ({ card: a, onClose: t }) => {
|
|
1962
1962
|
const n = J(
|
|
1963
1963
|
K.SecurityDiagnostics
|
|
1964
|
-
), [s,
|
|
1964
|
+
), [s, c] = T([]), [d, u] = T(1), [x, R] = T(1), [m, v] = T(0), [A, y] = T(!1), [P, f] = T(null), w = a?.metric;
|
|
1965
1965
|
return ee(() => {
|
|
1966
|
-
|
|
1967
|
-
}, [
|
|
1968
|
-
if (!
|
|
1966
|
+
u(1);
|
|
1967
|
+
}, [w]), ee(() => {
|
|
1968
|
+
if (!w)
|
|
1969
1969
|
return;
|
|
1970
1970
|
let o = !1;
|
|
1971
|
-
return
|
|
1972
|
-
o || (
|
|
1971
|
+
return y(!0), f(null), n.getOverviewItems(w, d - 1, Br).then((l) => {
|
|
1972
|
+
o || (c(l.content ?? []), v(l.totalElements ?? 0), R(Math.max(l.totalPages ?? 1, 1)));
|
|
1973
1973
|
}).catch((l) => {
|
|
1974
|
-
o ||
|
|
1974
|
+
o || f(l instanceof Error ? l.message : "Não foi possível carregar os itens.");
|
|
1975
1975
|
}).finally(() => {
|
|
1976
|
-
o ||
|
|
1976
|
+
o || y(!1);
|
|
1977
1977
|
}), () => {
|
|
1978
1978
|
o = !0;
|
|
1979
1979
|
};
|
|
1980
|
-
}, [n,
|
|
1980
|
+
}, [n, w, d]), /* @__PURE__ */ e(
|
|
1981
1981
|
Ja,
|
|
1982
1982
|
{
|
|
1983
1983
|
opened: !!a,
|
|
@@ -1995,28 +1995,28 @@ const Ue = (a) => {
|
|
|
1995
1995
|
" ",
|
|
1996
1996
|
m === 1 ? "item" : "itens"
|
|
1997
1997
|
] }),
|
|
1998
|
-
A ? /* @__PURE__ */ e(
|
|
1998
|
+
A ? /* @__PURE__ */ e(le, { size: "xs" }) : null
|
|
1999
1999
|
] }),
|
|
2000
|
-
|
|
2001
|
-
!A && !
|
|
2000
|
+
P ? /* @__PURE__ */ e(ye, { color: "red", title: "Erro ao carregar", children: P }) : null,
|
|
2001
|
+
!A && !P && s.length === 0 ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Nada aqui — o número é zero." }) : null,
|
|
2002
2002
|
s.length > 0 ? (
|
|
2003
2003
|
// O scroll fica NA TABELA, não no drawer: rolando o drawer, o cabeçalho some e
|
|
2004
2004
|
// uma coluna de valores sem cabeçalho deixa de dizer o que é. Aqui o cabeçalho
|
|
2005
2005
|
// gruda e o título, a contagem e a paginação ficam onde estavam.
|
|
2006
|
-
/* @__PURE__ */ e(Oe, { maxHeight: "calc(100vh - 260px)", children: /* @__PURE__ */ r(
|
|
2007
|
-
/* @__PURE__ */ e(
|
|
2008
|
-
/* @__PURE__ */ e(
|
|
2009
|
-
/* @__PURE__ */ e(
|
|
2010
|
-
/* @__PURE__ */ e(
|
|
2006
|
+
/* @__PURE__ */ e(Oe, { maxHeight: "calc(100vh - 260px)", children: /* @__PURE__ */ r(S, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2007
|
+
/* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
|
|
2008
|
+
/* @__PURE__ */ e(S.Th, { children: "Item" }),
|
|
2009
|
+
/* @__PURE__ */ e(S.Th, { children: "Onde" }),
|
|
2010
|
+
/* @__PURE__ */ e(S.Th, { children: "Por que está aqui" })
|
|
2011
2011
|
] }) }),
|
|
2012
|
-
/* @__PURE__ */ e(
|
|
2013
|
-
/* @__PURE__ */ e(
|
|
2014
|
-
/* @__PURE__ */ e(
|
|
2015
|
-
/* @__PURE__ */ e(
|
|
2012
|
+
/* @__PURE__ */ e(S.Tbody, { children: s.map((o) => /* @__PURE__ */ r(S.Tr, { children: [
|
|
2013
|
+
/* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(h, { size: "sm", fw: 550, children: o.label }) }),
|
|
2014
|
+
/* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: o.detail }) }),
|
|
2015
|
+
/* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(h, { size: "xs", children: o.reason }) })
|
|
2016
2016
|
] }, o.id)) })
|
|
2017
2017
|
] }) })
|
|
2018
2018
|
) : null,
|
|
2019
|
-
|
|
2019
|
+
x > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(Xa, { value: d, onChange: u, total: x, size: "sm" }) }) : null
|
|
2020
2020
|
] })
|
|
2021
2021
|
}
|
|
2022
2022
|
);
|
|
@@ -2104,60 +2104,60 @@ const Ue = (a) => {
|
|
|
2104
2104
|
], ba = ({ slots: a, onError: t }) => {
|
|
2105
2105
|
const n = J(
|
|
2106
2106
|
K.SecurityDiagnostics
|
|
2107
|
-
), [s,
|
|
2107
|
+
), [s, c] = T(void 0), [d, u] = T(!0), [x, R] = T(void 0), [m, v] = T(null);
|
|
2108
2108
|
ee(() => {
|
|
2109
|
-
let
|
|
2110
|
-
return
|
|
2111
|
-
|
|
2112
|
-
}).catch((
|
|
2113
|
-
if (
|
|
2114
|
-
const
|
|
2115
|
-
R(
|
|
2109
|
+
let P = !0;
|
|
2110
|
+
return u(!0), n.getOverview().then((f) => {
|
|
2111
|
+
P && (c(f), R(void 0));
|
|
2112
|
+
}).catch((f) => {
|
|
2113
|
+
if (P) {
|
|
2114
|
+
const w = be(f);
|
|
2115
|
+
R(w), t?.(w);
|
|
2116
2116
|
}
|
|
2117
2117
|
}).finally(() => {
|
|
2118
|
-
|
|
2118
|
+
P && u(!1);
|
|
2119
2119
|
}), () => {
|
|
2120
|
-
|
|
2120
|
+
P = !1;
|
|
2121
2121
|
};
|
|
2122
2122
|
}, [n]);
|
|
2123
2123
|
const A = ie(
|
|
2124
2124
|
() => s ? [...Hr(s), ...a?.additionalFlags?.(s) ?? []] : [],
|
|
2125
2125
|
[s, a]
|
|
2126
|
-
),
|
|
2126
|
+
), y = ie(
|
|
2127
2127
|
() => s ? [...jr(s), ...a?.additionalOverviewCards?.(s) ?? []] : [],
|
|
2128
2128
|
[s, a]
|
|
2129
2129
|
);
|
|
2130
|
-
return
|
|
2131
|
-
/* @__PURE__ */ r(
|
|
2130
|
+
return d ? /* @__PURE__ */ e(le, { size: "sm" }) : x ? /* @__PURE__ */ e(ye, { color: "red", title: "Não foi possível ler o diagnóstico", children: x }) : s ? /* @__PURE__ */ r(V, { gap: "lg", children: [
|
|
2131
|
+
/* @__PURE__ */ r(we, { title: "Proteções", hint: "de AccessOverview.flags", children: [
|
|
2132
2132
|
/* @__PURE__ */ e(Gr, { flags: A }),
|
|
2133
2133
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", lh: 1.45, children: "Todas nascem com o padrão compatível — ligadas só quando alguém decide." })
|
|
2134
2134
|
] }),
|
|
2135
|
-
/* @__PURE__ */ e(
|
|
2135
|
+
/* @__PURE__ */ e(we, { title: "Catálogo e concessões", hint: "contagens vivas", children: /* @__PURE__ */ e(Vr, { cards: y, onOpenCard: v }) }),
|
|
2136
2136
|
a?.afterOverview?.(s),
|
|
2137
|
-
/* @__PURE__ */ e(Wr, { card: m, onClose: () =>
|
|
2137
|
+
/* @__PURE__ */ e(Wr, { card: m, onClose: () => v(null) })
|
|
2138
2138
|
] }) : null;
|
|
2139
|
-
}, Be = ({ value: a, onChange: t, assunto: n, visiveis: s, total:
|
|
2140
|
-
const
|
|
2139
|
+
}, Be = ({ value: a, onChange: t, assunto: n, visiveis: s, total: c }) => {
|
|
2140
|
+
const d = typeof s == "number" && typeof c == "number" && s < c;
|
|
2141
2141
|
return /* @__PURE__ */ e(
|
|
2142
|
-
|
|
2142
|
+
ve,
|
|
2143
2143
|
{
|
|
2144
2144
|
size: "xs",
|
|
2145
2145
|
value: a,
|
|
2146
|
-
onChange: (
|
|
2146
|
+
onChange: (u) => t(u.currentTarget.value),
|
|
2147
2147
|
placeholder: n ? `Filtrar ${n}…` : "Filtrar…",
|
|
2148
2148
|
"aria-label": n ? `Filtrar ${n}` : "Filtrar",
|
|
2149
|
-
description:
|
|
2149
|
+
description: d ? `${s} de ${c}` : void 0,
|
|
2150
2150
|
rightSection: a ? /* @__PURE__ */ e(Ya, { size: "sm", onClick: () => t(""), "aria-label": "Limpar filtro" }) : null
|
|
2151
2151
|
}
|
|
2152
2152
|
);
|
|
2153
2153
|
}, Zr = /[̀-ͯ]/g, va = (a) => a.toLocaleLowerCase().normalize("NFD").replace(Zr, ""), We = (a, t) => {
|
|
2154
|
-
const [n, s] =
|
|
2155
|
-
const
|
|
2156
|
-
return
|
|
2157
|
-
(
|
|
2154
|
+
const [n, s] = T(""), c = ie(() => {
|
|
2155
|
+
const d = va(n.trim());
|
|
2156
|
+
return d ? a.filter(
|
|
2157
|
+
(u) => t(u).some((x) => x ? va(x).includes(d) : !1)
|
|
2158
2158
|
) : a;
|
|
2159
2159
|
}, [a, n]);
|
|
2160
|
-
return { filtro: n, setFiltro: s, filtrados:
|
|
2160
|
+
return { filtro: n, setFiltro: s, filtrados: c };
|
|
2161
2161
|
}, ya = {
|
|
2162
2162
|
EFFECTIVE: { label: "Efetiva", color: "green" },
|
|
2163
2163
|
INERT: { label: "Inerte", color: "orange" },
|
|
@@ -2171,84 +2171,84 @@ const Ue = (a) => {
|
|
|
2171
2171
|
], Jr = ({ slots: a, onError: t, userId: n }) => {
|
|
2172
2172
|
const s = J(
|
|
2173
2173
|
K.SecurityDiagnostics
|
|
2174
|
-
), [
|
|
2174
|
+
), [c, d] = T(""), [u, x] = T(void 0), [R, m] = T(!1), [v, A] = T(void 0), [y, P] = T("all"), f = !!n, w = ae(
|
|
2175
2175
|
async (i) => {
|
|
2176
|
-
const
|
|
2177
|
-
if (
|
|
2176
|
+
const N = i.trim();
|
|
2177
|
+
if (N) {
|
|
2178
2178
|
m(!0), A(void 0);
|
|
2179
2179
|
try {
|
|
2180
|
-
const
|
|
2181
|
-
|
|
2182
|
-
} catch (
|
|
2183
|
-
const G =
|
|
2184
|
-
A(G), t?.(G),
|
|
2180
|
+
const F = N.includes("@") ? await s.getEffectiveAccessByEmail(N) : await s.getEffectiveAccessByUserId(N);
|
|
2181
|
+
x(F);
|
|
2182
|
+
} catch (F) {
|
|
2183
|
+
const G = be(F);
|
|
2184
|
+
A(G), t?.(G), x(void 0);
|
|
2185
2185
|
} finally {
|
|
2186
2186
|
m(!1);
|
|
2187
2187
|
}
|
|
2188
2188
|
}
|
|
2189
2189
|
},
|
|
2190
2190
|
[s, t]
|
|
2191
|
-
), o = ie(() =>
|
|
2192
|
-
{ label: "Perfil", value:
|
|
2193
|
-
{ label: "Grupos", value:
|
|
2194
|
-
...a?.userAttributes?.(
|
|
2195
|
-
] : [], [
|
|
2191
|
+
), o = ie(() => u ? [
|
|
2192
|
+
{ label: "Perfil", value: u.profileName || "—" },
|
|
2193
|
+
{ label: "Grupos", value: u.groupNames.length ? u.groupNames.join(", ") : "—" },
|
|
2194
|
+
...a?.userAttributes?.(u) ?? []
|
|
2195
|
+
] : [], [u, a]), l = ie(() => u ? y === "all" ? u.capabilities : y === "inherited" ? u.capabilities.filter((i) => i.grantedByType !== "USER") : u.capabilities.filter((i) => i.situation === y) : [], [u, y]), {
|
|
2196
2196
|
filtro: p,
|
|
2197
2197
|
setFiltro: b,
|
|
2198
2198
|
filtrados: L
|
|
2199
2199
|
} = We(l, (i) => [i.resource, i.action, i.grantedByName]);
|
|
2200
2200
|
ee(() => {
|
|
2201
|
-
n && (
|
|
2202
|
-
}, [n,
|
|
2203
|
-
const
|
|
2201
|
+
n && (P("all"), w(n));
|
|
2202
|
+
}, [n, w]);
|
|
2203
|
+
const E = a?.additionalCapabilityColumns ?? [];
|
|
2204
2204
|
return /* @__PURE__ */ r(V, { gap: "lg", children: [
|
|
2205
|
-
|
|
2206
|
-
|
|
2205
|
+
f ? null : /* @__PURE__ */ e(we, { title: "Consultar", hint: "por e-mail ou id do usuário", children: a?.renderUserSearch ? a.renderUserSearch((i) => {
|
|
2206
|
+
d(i), w(i);
|
|
2207
2207
|
}) : /* @__PURE__ */ r(O, { gap: "xs", align: "flex-end", children: [
|
|
2208
2208
|
/* @__PURE__ */ e(
|
|
2209
|
-
|
|
2209
|
+
ve,
|
|
2210
2210
|
{
|
|
2211
2211
|
style: { flex: 1, minWidth: 240 },
|
|
2212
2212
|
label: "Usuário",
|
|
2213
2213
|
placeholder: "pessoa@empresa.com.br",
|
|
2214
|
-
value:
|
|
2215
|
-
onChange: (i) =>
|
|
2214
|
+
value: c,
|
|
2215
|
+
onChange: (i) => d(i.currentTarget.value),
|
|
2216
2216
|
onKeyDown: (i) => {
|
|
2217
|
-
i.key === "Enter" &&
|
|
2217
|
+
i.key === "Enter" && w(c);
|
|
2218
2218
|
}
|
|
2219
2219
|
}
|
|
2220
2220
|
),
|
|
2221
|
-
/* @__PURE__ */ e(X, { onClick: () => void
|
|
2221
|
+
/* @__PURE__ */ e(X, { onClick: () => void w(c), loading: R, children: "Consultar" })
|
|
2222
2222
|
] }) }),
|
|
2223
|
-
|
|
2224
|
-
R && !
|
|
2225
|
-
|
|
2223
|
+
v ? /* @__PURE__ */ e(ye, { color: "red", title: "Não foi possível ler o efetivo", children: v }) : null,
|
|
2224
|
+
R && !u ? /* @__PURE__ */ e(le, { size: "sm" }) : null,
|
|
2225
|
+
u ? /* @__PURE__ */ r(xe, { children: [
|
|
2226
2226
|
/* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(V, { gap: "sm", children: [
|
|
2227
2227
|
/* @__PURE__ */ r(O, { gap: 8, wrap: "wrap", align: "center", children: [
|
|
2228
|
-
/* @__PURE__ */ e(h, { fw: 620, children:
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
a?.afterUserBadges?.(
|
|
2228
|
+
/* @__PURE__ */ e(h, { fw: 620, children: u.userLabel }),
|
|
2229
|
+
u.administrator ? /* @__PURE__ */ e(Q, { color: "red", children: "administrador" }) : null,
|
|
2230
|
+
u.enabled ? null : /* @__PURE__ */ e(Q, { color: "red", children: "conta desativada" }),
|
|
2231
|
+
a?.afterUserBadges?.(u)
|
|
2232
2232
|
] }),
|
|
2233
2233
|
/* @__PURE__ */ e(Ur, { attributes: o })
|
|
2234
2234
|
] }) }),
|
|
2235
|
-
|
|
2235
|
+
u.administrator ? /* @__PURE__ */ r(ye, { color: "orange", title: "Administrador passa direto", children: [
|
|
2236
2236
|
"O portão GRANT concede sem consultar o catálogo. A lista abaixo vir vazia não é falta de dado — é o atalho que a flag ",
|
|
2237
2237
|
/* @__PURE__ */ e("code", { children: "isAdministrator" }),
|
|
2238
2238
|
" representa."
|
|
2239
2239
|
] }) : null,
|
|
2240
2240
|
/* @__PURE__ */ e(He, { cols: { base: 2, sm: 4 }, spacing: "xs", children: [
|
|
2241
|
-
["concedidas",
|
|
2242
|
-
["efetivas",
|
|
2243
|
-
["inertes",
|
|
2244
|
-
["negadas",
|
|
2245
|
-
].map(([i,
|
|
2246
|
-
/* @__PURE__ */ e(h, { size: "1.3rem", fw: 620, c: Ue(
|
|
2241
|
+
["concedidas", u.granted, "neutral"],
|
|
2242
|
+
["efetivas", u.effective, "ok"],
|
|
2243
|
+
["inertes", u.inert, "warning"],
|
|
2244
|
+
["negadas", u.denied, "critical"]
|
|
2245
|
+
].map(([i, N, F]) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(V, { gap: 2, children: [
|
|
2246
|
+
/* @__PURE__ */ e(h, { size: "1.3rem", fw: 620, c: Ue(F), children: N }),
|
|
2247
2247
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: i })
|
|
2248
2248
|
] }) }, i)) }),
|
|
2249
|
-
a?.afterEffectiveTally?.(
|
|
2250
|
-
/* @__PURE__ */ r(
|
|
2251
|
-
/* @__PURE__ */ e(ua.Group, { multiple: !1, value:
|
|
2249
|
+
a?.afterEffectiveTally?.(u),
|
|
2250
|
+
/* @__PURE__ */ r(we, { title: "Capacidades", hint: `${u.capabilities.length} no total`, children: [
|
|
2251
|
+
/* @__PURE__ */ e(ua.Group, { multiple: !1, value: y, onChange: (i) => P(i), children: /* @__PURE__ */ e(O, { gap: 6, children: Kr.map((i) => /* @__PURE__ */ e(ua, { value: i.value, size: "xs", variant: "outline", children: i.label }, i.value)) }) }),
|
|
2252
2252
|
/* @__PURE__ */ e(
|
|
2253
2253
|
Be,
|
|
2254
2254
|
{
|
|
@@ -2259,31 +2259,31 @@ const Ue = (a) => {
|
|
|
2259
2259
|
total: l.length
|
|
2260
2260
|
}
|
|
2261
2261
|
),
|
|
2262
|
-
/* @__PURE__ */ e(Oe, { maxHeight: "calc(100vh - 460px)", children: /* @__PURE__ */ r(
|
|
2263
|
-
/* @__PURE__ */ e(
|
|
2264
|
-
/* @__PURE__ */ e(
|
|
2265
|
-
/* @__PURE__ */ e(
|
|
2266
|
-
/* @__PURE__ */ e(
|
|
2267
|
-
|
|
2262
|
+
/* @__PURE__ */ e(Oe, { maxHeight: "calc(100vh - 460px)", children: /* @__PURE__ */ r(S, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2263
|
+
/* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
|
|
2264
|
+
/* @__PURE__ */ e(S.Th, { children: "Capacidade" }),
|
|
2265
|
+
/* @__PURE__ */ e(S.Th, { children: "Origem" }),
|
|
2266
|
+
/* @__PURE__ */ e(S.Th, { children: "Situação" }),
|
|
2267
|
+
E.map((i) => /* @__PURE__ */ e(S.Th, { children: i.header }, i.header))
|
|
2268
2268
|
] }) }),
|
|
2269
|
-
/* @__PURE__ */ r(
|
|
2270
|
-
L.map((i,
|
|
2271
|
-
/* @__PURE__ */ e(
|
|
2269
|
+
/* @__PURE__ */ r(S.Tbody, { children: [
|
|
2270
|
+
L.map((i, N) => /* @__PURE__ */ r(S.Tr, { children: [
|
|
2271
|
+
/* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(h, { size: "sm", ff: "monospace", children: [
|
|
2272
2272
|
i.resource,
|
|
2273
2273
|
":",
|
|
2274
2274
|
i.action
|
|
2275
2275
|
] }) }),
|
|
2276
|
-
/* @__PURE__ */ e(
|
|
2276
|
+
/* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(h, { size: "sm", children: [
|
|
2277
2277
|
/* @__PURE__ */ r(h, { span: !0, c: "dimmed", children: [
|
|
2278
2278
|
Qr[i.grantedByType] ?? i.grantedByType,
|
|
2279
2279
|
" "
|
|
2280
2280
|
] }),
|
|
2281
2281
|
i.grantedByName
|
|
2282
2282
|
] }) }),
|
|
2283
|
-
/* @__PURE__ */ e(
|
|
2284
|
-
|
|
2285
|
-
] }, `${i.resource}:${i.action}:${
|
|
2286
|
-
l.length === 0 ? /* @__PURE__ */ e(
|
|
2283
|
+
/* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(Q, { color: ya[i.situation].color, variant: "light", children: ya[i.situation].label }) }),
|
|
2284
|
+
E.map((F) => /* @__PURE__ */ e(S.Td, { children: F.render(i, u) }, F.header))
|
|
2285
|
+
] }, `${i.resource}:${i.action}:${N}`)),
|
|
2286
|
+
l.length === 0 ? /* @__PURE__ */ e(S.Tr, { children: /* @__PURE__ */ e(S.Td, { colSpan: 3 + E.length, children: /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", ta: "center", py: "md", children: "Nenhuma capacidade neste filtro." }) }) }) : null
|
|
2287
2287
|
] })
|
|
2288
2288
|
] }) })
|
|
2289
2289
|
] })
|
|
@@ -2294,103 +2294,108 @@ const Ue = (a) => {
|
|
|
2294
2294
|
valor: t,
|
|
2295
2295
|
placeholder: n,
|
|
2296
2296
|
branch: s,
|
|
2297
|
-
somenteFolhas:
|
|
2297
|
+
somenteFolhas: c,
|
|
2298
|
+
branchDosFilhos: d,
|
|
2298
2299
|
onSelecionar: u
|
|
2299
2300
|
}) => {
|
|
2300
|
-
const
|
|
2301
|
+
const x = J(
|
|
2301
2302
|
K.SecurityDiagnostics
|
|
2302
|
-
), [
|
|
2303
|
-
async (
|
|
2304
|
-
|
|
2303
|
+
), [R, m] = T(!1), [v, A] = T(""), [y, P] = T([]), [f, w] = T({}), [o, l] = T(), [p, b] = T(!1), [L, E] = T(), i = ae(
|
|
2304
|
+
async (C) => {
|
|
2305
|
+
b(!0), E(void 0);
|
|
2305
2306
|
try {
|
|
2306
|
-
const
|
|
2307
|
-
|
|
2308
|
-
} catch (
|
|
2309
|
-
|
|
2307
|
+
const z = await x.browse(s, { q: C || void 0, page: 0, size: wa });
|
|
2308
|
+
P(z.content ?? []);
|
|
2309
|
+
} catch (z) {
|
|
2310
|
+
E(z instanceof Error ? z.message : "Não foi possível carregar.");
|
|
2310
2311
|
} finally {
|
|
2311
|
-
|
|
2312
|
+
b(!1);
|
|
2312
2313
|
}
|
|
2313
2314
|
},
|
|
2314
|
-
[
|
|
2315
|
+
[x, s]
|
|
2315
2316
|
);
|
|
2316
2317
|
ee(() => {
|
|
2317
|
-
if (!
|
|
2318
|
+
if (!R)
|
|
2318
2319
|
return;
|
|
2319
|
-
const
|
|
2320
|
-
return () => clearTimeout(
|
|
2321
|
-
}, [
|
|
2322
|
-
const
|
|
2323
|
-
async (
|
|
2324
|
-
if (
|
|
2325
|
-
|
|
2320
|
+
const C = setTimeout(() => void i(v), v ? 300 : 0);
|
|
2321
|
+
return () => clearTimeout(C);
|
|
2322
|
+
}, [R, v, i]);
|
|
2323
|
+
const N = ae(
|
|
2324
|
+
async (C) => {
|
|
2325
|
+
if (o === C.id) {
|
|
2326
|
+
l(void 0);
|
|
2326
2327
|
return;
|
|
2327
2328
|
}
|
|
2328
|
-
if (
|
|
2329
|
+
if (l(C.id), !f[C.id])
|
|
2329
2330
|
try {
|
|
2330
|
-
const
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2331
|
+
const z = await x.browse(d ?? s, {
|
|
2332
|
+
parentId: C.id,
|
|
2333
|
+
page: 0,
|
|
2334
|
+
size: wa
|
|
2335
|
+
});
|
|
2336
|
+
w((oe) => ({ ...oe, [C.id]: z.content ?? [] }));
|
|
2337
|
+
} catch (z) {
|
|
2338
|
+
E(z instanceof Error ? z.message : "Não foi possível abrir.");
|
|
2334
2339
|
}
|
|
2335
2340
|
},
|
|
2336
|
-
[
|
|
2337
|
-
),
|
|
2338
|
-
u(
|
|
2339
|
-
},
|
|
2340
|
-
const
|
|
2341
|
+
[x, s, d, o, f]
|
|
2342
|
+
), F = (C, z) => {
|
|
2343
|
+
u(C, z), m(!1);
|
|
2344
|
+
}, G = (C, z) => {
|
|
2345
|
+
const oe = C.hasChildren;
|
|
2341
2346
|
return /* @__PURE__ */ e(
|
|
2342
2347
|
ze,
|
|
2343
2348
|
{
|
|
2344
|
-
onClick: () =>
|
|
2349
|
+
onClick: () => oe && c ? void N(C) : F(C, z),
|
|
2345
2350
|
style: {
|
|
2346
2351
|
display: "block",
|
|
2347
2352
|
width: "100%",
|
|
2348
2353
|
padding: "5px 8px",
|
|
2349
|
-
paddingLeft:
|
|
2354
|
+
paddingLeft: z ? 24 : 8,
|
|
2350
2355
|
borderRadius: 4
|
|
2351
2356
|
},
|
|
2352
2357
|
children: /* @__PURE__ */ r(O, { gap: 6, wrap: "nowrap", children: [
|
|
2353
|
-
/* @__PURE__ */ e(h, { size: "sm", fw: !
|
|
2354
|
-
|
|
2358
|
+
/* @__PURE__ */ e(h, { size: "sm", fw: !c || !oe ? 500 : 600, truncate: !0, children: C.label }),
|
|
2359
|
+
C.badge ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: C.badge }) : null
|
|
2355
2360
|
] })
|
|
2356
2361
|
},
|
|
2357
|
-
`${
|
|
2362
|
+
`${z?.id ?? "raiz"}:${C.id}`
|
|
2358
2363
|
);
|
|
2359
|
-
},
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
] }, `ramo:${
|
|
2363
|
-
return /* @__PURE__ */ r(Je, { opened:
|
|
2364
|
+
}, D = (C) => /* @__PURE__ */ r(_, { children: [
|
|
2365
|
+
G(C),
|
|
2366
|
+
o === C.id ? (f[C.id] ?? []).map((z) => G(z, C)) : null
|
|
2367
|
+
] }, `ramo:${C.id}`);
|
|
2368
|
+
return /* @__PURE__ */ r(Je, { opened: R, onChange: m, width: 340, position: "bottom-start", withinPortal: !0, shadow: "md", children: [
|
|
2364
2369
|
/* @__PURE__ */ e(Je.Target, { children: /* @__PURE__ */ e(
|
|
2365
|
-
|
|
2370
|
+
ve,
|
|
2366
2371
|
{
|
|
2367
2372
|
label: a,
|
|
2368
2373
|
placeholder: n,
|
|
2369
2374
|
value: t ?? "",
|
|
2370
2375
|
readOnly: !0,
|
|
2371
|
-
onClick: () =>
|
|
2376
|
+
onClick: () => m((C) => !C),
|
|
2372
2377
|
styles: { input: { cursor: "pointer" } }
|
|
2373
2378
|
}
|
|
2374
2379
|
) }),
|
|
2375
2380
|
/* @__PURE__ */ r(Je.Dropdown, { p: 6, children: [
|
|
2376
2381
|
/* @__PURE__ */ e(
|
|
2377
|
-
|
|
2382
|
+
ve,
|
|
2378
2383
|
{
|
|
2379
2384
|
size: "xs",
|
|
2380
2385
|
placeholder: "Buscar…",
|
|
2381
|
-
value:
|
|
2382
|
-
onChange: (
|
|
2386
|
+
value: v,
|
|
2387
|
+
onChange: (C) => A(C.currentTarget.value),
|
|
2383
2388
|
mb: 6,
|
|
2384
2389
|
autoFocus: !0
|
|
2385
2390
|
}
|
|
2386
2391
|
),
|
|
2387
|
-
|
|
2388
|
-
/* @__PURE__ */ e(
|
|
2392
|
+
p ? /* @__PURE__ */ r(O, { gap: 6, p: 6, children: [
|
|
2393
|
+
/* @__PURE__ */ e(le, { size: "xs" }),
|
|
2389
2394
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "Carregando…" })
|
|
2390
2395
|
] }) : null,
|
|
2391
|
-
|
|
2392
|
-
!
|
|
2393
|
-
/* @__PURE__ */ e(
|
|
2396
|
+
L ? /* @__PURE__ */ e(h, { size: "xs", c: "red", p: 6, children: L }) : null,
|
|
2397
|
+
!p && !L && y.length === 0 ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", p: 6, children: "Nada encontrado." }) : null,
|
|
2398
|
+
/* @__PURE__ */ e(de.Autosize, { mah: 280, type: "hover", children: y.map((C) => D(C)) })
|
|
2394
2399
|
] })
|
|
2395
2400
|
] });
|
|
2396
2401
|
}, Xr = [
|
|
@@ -2402,32 +2407,32 @@ const Ue = (a) => {
|
|
|
2402
2407
|
], Yr = ({ slots: a, onError: t, initial: n }) => {
|
|
2403
2408
|
const s = J(
|
|
2404
2409
|
K.SecurityDiagnostics
|
|
2405
|
-
), [
|
|
2410
|
+
), [c, d] = T(""), [u, x] = T(""), [R, m] = T(""), [v, A] = T(""), [y, P] = T({}), [f, w] = T(void 0), [o, l] = T(!1), [p, b] = T(void 0);
|
|
2406
2411
|
ee(() => {
|
|
2407
|
-
n && (n.userId &&
|
|
2412
|
+
n && (n.userId && d(n.userId), n.userLabel && x(n.userLabel), n.resource && m(n.resource), n.action && A(n.action), w(void 0));
|
|
2408
2413
|
}, [n?.userId, n?.userLabel, n?.resource, n?.action]);
|
|
2409
2414
|
const L = ae(async () => {
|
|
2410
|
-
if (!(!
|
|
2415
|
+
if (!(!c.trim() || !R.trim() || !v.trim())) {
|
|
2411
2416
|
l(!0), b(void 0);
|
|
2412
2417
|
try {
|
|
2413
|
-
const i =
|
|
2418
|
+
const i = c.trim(), N = await s.simulate({
|
|
2414
2419
|
...i.includes("@") ? { email: i } : { userId: i },
|
|
2415
2420
|
resource: R.trim(),
|
|
2416
|
-
action:
|
|
2417
|
-
companyId:
|
|
2418
|
-
projectId:
|
|
2421
|
+
action: v.trim(),
|
|
2422
|
+
companyId: y.companyId,
|
|
2423
|
+
projectId: y.projectId
|
|
2419
2424
|
});
|
|
2420
|
-
|
|
2425
|
+
w(N);
|
|
2421
2426
|
} catch (i) {
|
|
2422
|
-
const
|
|
2423
|
-
b(
|
|
2427
|
+
const N = be(i);
|
|
2428
|
+
b(N), t?.(N), w(void 0);
|
|
2424
2429
|
} finally {
|
|
2425
2430
|
l(!1);
|
|
2426
2431
|
}
|
|
2427
2432
|
}
|
|
2428
|
-
}, [s,
|
|
2429
|
-
const
|
|
2430
|
-
return
|
|
2433
|
+
}, [s, c, R, v, y, t]), E = (i, N) => {
|
|
2434
|
+
const F = N.chain?.find((G) => G.gate === i);
|
|
2435
|
+
return F ? F.passed ? "passou" : "negou" : "nao-avaliado";
|
|
2431
2436
|
};
|
|
2432
2437
|
return /* @__PURE__ */ r(V, { gap: "lg", children: [
|
|
2433
2438
|
/* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(V, { gap: "sm", children: [
|
|
@@ -2438,9 +2443,9 @@ const Ue = (a) => {
|
|
|
2438
2443
|
label: "Usuário",
|
|
2439
2444
|
placeholder: "escolher pessoa",
|
|
2440
2445
|
branch: "USERS",
|
|
2441
|
-
valor:
|
|
2446
|
+
valor: u || c,
|
|
2442
2447
|
onSelecionar: (i) => {
|
|
2443
|
-
|
|
2448
|
+
d(i.id), x(i.label);
|
|
2444
2449
|
}
|
|
2445
2450
|
}
|
|
2446
2451
|
),
|
|
@@ -2450,36 +2455,37 @@ const Ue = (a) => {
|
|
|
2450
2455
|
label: "Recurso e ação",
|
|
2451
2456
|
placeholder: "escolher capacidade",
|
|
2452
2457
|
branch: "RESOURCES",
|
|
2458
|
+
branchDosFilhos: "ACTIONS_OF_RESOURCE",
|
|
2453
2459
|
somenteFolhas: !0,
|
|
2454
|
-
valor: R &&
|
|
2455
|
-
onSelecionar: (i,
|
|
2456
|
-
A(i.label),
|
|
2460
|
+
valor: R && v ? `${R} · ${v}` : "",
|
|
2461
|
+
onSelecionar: (i, N) => {
|
|
2462
|
+
A(i.label), N && m(N.label);
|
|
2457
2463
|
}
|
|
2458
2464
|
}
|
|
2459
2465
|
),
|
|
2460
2466
|
/* @__PURE__ */ e(
|
|
2461
|
-
|
|
2467
|
+
ve,
|
|
2462
2468
|
{
|
|
2463
2469
|
label: "Empresa (opcional)",
|
|
2464
2470
|
placeholder: "companyId",
|
|
2465
|
-
value:
|
|
2466
|
-
onChange: (i) =>
|
|
2471
|
+
value: y.companyId ?? "",
|
|
2472
|
+
onChange: (i) => P((N) => ({ ...N, companyId: i.currentTarget.value || void 0 }))
|
|
2467
2473
|
}
|
|
2468
2474
|
)
|
|
2469
2475
|
] }),
|
|
2470
|
-
a?.afterSimulationFields?.((i) =>
|
|
2476
|
+
a?.afterSimulationFields?.((i) => P((N) => ({ ...N, ...i }))),
|
|
2471
2477
|
/* @__PURE__ */ r(O, { gap: "xs", align: "center", children: [
|
|
2472
2478
|
/* @__PURE__ */ e(X, { onClick: () => void L(), loading: o, children: "Simular" }),
|
|
2473
2479
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "Somente leitura — não altera permissão nenhuma." })
|
|
2474
2480
|
] })
|
|
2475
2481
|
] }) }),
|
|
2476
|
-
p ? /* @__PURE__ */ e(
|
|
2477
|
-
o && !
|
|
2478
|
-
|
|
2479
|
-
/* @__PURE__ */ e(
|
|
2480
|
-
const
|
|
2482
|
+
p ? /* @__PURE__ */ e(ye, { color: "red", title: "Não foi possível simular", children: p }) : null,
|
|
2483
|
+
o && !f ? /* @__PURE__ */ e(le, { size: "sm" }) : null,
|
|
2484
|
+
f ? /* @__PURE__ */ r(xe, { children: [
|
|
2485
|
+
/* @__PURE__ */ e(we, { 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(V, { gap: "sm", children: Xr.map((i, N) => {
|
|
2486
|
+
const F = E(i.gate, f), G = f.chain?.find((D) => D.gate === i.gate)?.detail;
|
|
2481
2487
|
return /* @__PURE__ */ r(O, { align: "flex-start", wrap: "nowrap", gap: "sm", children: [
|
|
2482
|
-
/* @__PURE__ */ e(h, { size: "xs", ff: "monospace", c: "dimmed", w: 16, children:
|
|
2488
|
+
/* @__PURE__ */ e(h, { size: "xs", ff: "monospace", c: "dimmed", w: 16, children: N + 1 }),
|
|
2483
2489
|
/* @__PURE__ */ r(V, { gap: 2, style: { flex: 1, minWidth: 0 }, children: [
|
|
2484
2490
|
/* @__PURE__ */ r(O, { gap: 8, align: "baseline", wrap: "wrap", children: [
|
|
2485
2491
|
/* @__PURE__ */ e(
|
|
@@ -2487,8 +2493,8 @@ const Ue = (a) => {
|
|
|
2487
2493
|
{
|
|
2488
2494
|
size: "sm",
|
|
2489
2495
|
fw: 600,
|
|
2490
|
-
c:
|
|
2491
|
-
opacity:
|
|
2496
|
+
c: F === "negou" ? "red" : void 0,
|
|
2497
|
+
opacity: F === "nao-avaliado" ? 0.5 : 1,
|
|
2492
2498
|
children: i.titulo
|
|
2493
2499
|
}
|
|
2494
2500
|
),
|
|
@@ -2497,29 +2503,29 @@ const Ue = (a) => {
|
|
|
2497
2503
|
i.papel
|
|
2498
2504
|
] })
|
|
2499
2505
|
] }),
|
|
2500
|
-
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", opacity:
|
|
2506
|
+
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", opacity: F === "nao-avaliado" ? 0.5 : 1, children: i.pergunta }),
|
|
2501
2507
|
G ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: G }) : null
|
|
2502
2508
|
] }),
|
|
2503
2509
|
/* @__PURE__ */ e(
|
|
2504
2510
|
Q,
|
|
2505
2511
|
{
|
|
2506
2512
|
variant: "light",
|
|
2507
|
-
color:
|
|
2508
|
-
children:
|
|
2513
|
+
color: F === "negou" ? "red" : F === "passou" ? "green" : "gray",
|
|
2514
|
+
children: F === "nao-avaliado" ? "não avaliado" : F
|
|
2509
2515
|
}
|
|
2510
2516
|
)
|
|
2511
2517
|
] }, i.gate);
|
|
2512
2518
|
}) }) }) }),
|
|
2513
|
-
/* @__PURE__ */ e(
|
|
2514
|
-
/* @__PURE__ */ e(h, { size: "sm", children:
|
|
2519
|
+
/* @__PURE__ */ e(ye, { color: f.allowed ? "green" : "red", title: f.allowed ? "Pode" : "Não pode", children: /* @__PURE__ */ r(V, { gap: 6, children: [
|
|
2520
|
+
/* @__PURE__ */ e(h, { size: "sm", children: f.message }),
|
|
2515
2521
|
/* @__PURE__ */ r(h, { size: "xs", ff: "monospace", c: "dimmed", children: [
|
|
2516
2522
|
"reasonCode: ",
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2523
|
+
f.reasonCode,
|
|
2524
|
+
f.deniedAt ? ` · deniedAt: ${f.deniedAt}` : "",
|
|
2525
|
+
f.grantedByName ? ` · grantedBy: ${f.grantedByName}` : ""
|
|
2520
2526
|
] })
|
|
2521
2527
|
] }) }),
|
|
2522
|
-
a?.afterDecision?.(
|
|
2528
|
+
a?.afterDecision?.(f)
|
|
2523
2529
|
] }) : null
|
|
2524
2530
|
] });
|
|
2525
2531
|
}, Da = (a) => {
|
|
@@ -2533,137 +2539,137 @@ const Ue = (a) => {
|
|
|
2533
2539
|
default:
|
|
2534
2540
|
return /* @__PURE__ */ e(Q, { size: "sm", color: "gray", variant: "light", children: "—" });
|
|
2535
2541
|
}
|
|
2536
|
-
}, _r = ({ id: a, label: t, slots: n, onSelectUser: s, onSimulate:
|
|
2537
|
-
const
|
|
2542
|
+
}, _r = ({ id: a, label: t, slots: n, onSelectUser: s, onSimulate: c }) => {
|
|
2543
|
+
const d = J(
|
|
2538
2544
|
K.SecurityDiagnostics
|
|
2539
|
-
), [
|
|
2545
|
+
), [u, x] = T([]), {
|
|
2540
2546
|
filtro: R,
|
|
2541
2547
|
setFiltro: m,
|
|
2542
|
-
filtrados:
|
|
2543
|
-
} = We(
|
|
2548
|
+
filtrados: v
|
|
2549
|
+
} = We(u, (o) => [o.userName, o.email, o.via]), [A, y] = T(!0), [P, f] = T();
|
|
2544
2550
|
ee(() => {
|
|
2545
2551
|
let o = !1;
|
|
2546
|
-
return
|
|
2547
|
-
o ||
|
|
2552
|
+
return y(!0), f(void 0), d.getReach(a).then((l) => {
|
|
2553
|
+
o || x(l ?? []);
|
|
2548
2554
|
}).catch((l) => {
|
|
2549
|
-
o ||
|
|
2555
|
+
o || f(l instanceof Error ? l.message : "Não foi possível carregar.");
|
|
2550
2556
|
}).finally(() => {
|
|
2551
|
-
o ||
|
|
2557
|
+
o || y(!1);
|
|
2552
2558
|
}), () => {
|
|
2553
2559
|
o = !0;
|
|
2554
2560
|
};
|
|
2555
|
-
}, [
|
|
2556
|
-
const
|
|
2561
|
+
}, [d, a]);
|
|
2562
|
+
const w = u.filter((o) => o.kind === "ADMINISTRADOR").length;
|
|
2557
2563
|
return /* @__PURE__ */ r(V, { gap: "lg", children: [
|
|
2558
2564
|
/* @__PURE__ */ r(V, { gap: 4, children: [
|
|
2559
2565
|
/* @__PURE__ */ e(h, { fw: 620, size: "xl", ff: "monospace", children: t }),
|
|
2560
2566
|
/* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Quem alcança esta capacidade, e por qual via." })
|
|
2561
2567
|
] }),
|
|
2562
|
-
|
|
2568
|
+
P ? /* @__PURE__ */ e(ye, { color: "red", title: "Erro ao carregar", children: P }) : null,
|
|
2563
2569
|
/* @__PURE__ */ e(
|
|
2564
|
-
|
|
2570
|
+
we,
|
|
2565
2571
|
{
|
|
2566
2572
|
title: "Quem alcança",
|
|
2567
|
-
hint: A ? "carregando…" : `${
|
|
2568
|
-
children: A ? /* @__PURE__ */ e(
|
|
2573
|
+
hint: A ? "carregando…" : `${u.length} ${u.length === 1 ? "pessoa" : "pessoas"}`,
|
|
2574
|
+
children: A ? /* @__PURE__ */ e(le, { size: "sm" }) : u.length === 0 ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Ninguém. A capacidade existe no catálogo e nunca foi concedida." }) : /* @__PURE__ */ r(xe, { children: [
|
|
2569
2575
|
/* @__PURE__ */ e(
|
|
2570
2576
|
Be,
|
|
2571
2577
|
{
|
|
2572
2578
|
value: R,
|
|
2573
2579
|
onChange: m,
|
|
2574
2580
|
assunto: "pessoas",
|
|
2575
|
-
visiveis:
|
|
2576
|
-
total:
|
|
2581
|
+
visiveis: v.length,
|
|
2582
|
+
total: u.length
|
|
2577
2583
|
}
|
|
2578
2584
|
),
|
|
2579
|
-
/* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(
|
|
2580
|
-
/* @__PURE__ */ e(
|
|
2581
|
-
/* @__PURE__ */ e(
|
|
2582
|
-
/* @__PURE__ */ e(
|
|
2583
|
-
/* @__PURE__ */ e(
|
|
2585
|
+
/* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(S, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2586
|
+
/* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
|
|
2587
|
+
/* @__PURE__ */ e(S.Th, { children: "Pessoa" }),
|
|
2588
|
+
/* @__PURE__ */ e(S.Th, { children: "Por qual via" }),
|
|
2589
|
+
/* @__PURE__ */ e(S.Th, { children: "Situação" })
|
|
2584
2590
|
] }) }),
|
|
2585
|
-
/* @__PURE__ */ e(
|
|
2586
|
-
|
|
2591
|
+
/* @__PURE__ */ e(S.Tbody, { children: v.map((o) => /* @__PURE__ */ r(
|
|
2592
|
+
S.Tr,
|
|
2587
2593
|
{
|
|
2588
2594
|
style: { cursor: s ? "pointer" : void 0 },
|
|
2589
2595
|
onClick: () => s?.(o.userId, o.userName),
|
|
2590
2596
|
children: [
|
|
2591
|
-
/* @__PURE__ */ e(
|
|
2597
|
+
/* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(V, { gap: 0, children: [
|
|
2592
2598
|
/* @__PURE__ */ e(h, { size: "sm", fw: 550, children: o.userName }),
|
|
2593
2599
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: o.email })
|
|
2594
2600
|
] }) }),
|
|
2595
|
-
/* @__PURE__ */ e(
|
|
2601
|
+
/* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(O, { gap: 6, children: [
|
|
2596
2602
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: o.via }),
|
|
2597
2603
|
o.kind === "ADMINISTRADOR" ? /* @__PURE__ */ e(Q, { size: "xs", color: "yellow", variant: "light", children: "atalho" }) : null
|
|
2598
2604
|
] }) }),
|
|
2599
|
-
/* @__PURE__ */ e(
|
|
2605
|
+
/* @__PURE__ */ e(S.Td, { children: Da(o.situation) })
|
|
2600
2606
|
]
|
|
2601
2607
|
},
|
|
2602
2608
|
o.userId
|
|
2603
2609
|
)) })
|
|
2604
2610
|
] }) }),
|
|
2605
|
-
|
|
2606
|
-
|
|
2611
|
+
w > 0 ? /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", lh: 1.5, children: [
|
|
2612
|
+
w === 1 ? "Uma conta alcança" : `${w} contas alcançam`,
|
|
2607
2613
|
" pelo atalho de administrador — sem concessão nenhuma. Revisar permissões não muda o que elas podem."
|
|
2608
2614
|
] }) : null
|
|
2609
2615
|
] })
|
|
2610
2616
|
}
|
|
2611
2617
|
),
|
|
2612
|
-
n?.afterReachList?.(a,
|
|
2613
|
-
|
|
2618
|
+
n?.afterReachList?.(a, u),
|
|
2619
|
+
c ? /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", children: [
|
|
2614
2620
|
"Para testar uma pessoa específica contra esta capacidade, use ",
|
|
2615
2621
|
/* @__PURE__ */ e("strong", { children: "Simular" }),
|
|
2616
2622
|
" na árvore — ela já vem escolhida."
|
|
2617
2623
|
] }) : null
|
|
2618
2624
|
] });
|
|
2619
2625
|
}, Sa = ({ id: a, kind: t, slots: n, onSelectUser: s }) => {
|
|
2620
|
-
const
|
|
2626
|
+
const c = J(
|
|
2621
2627
|
K.SecurityDiagnostics
|
|
2622
|
-
), [
|
|
2628
|
+
), [d, u] = T(), [x, R] = T(!0), [m, v] = T(), {
|
|
2623
2629
|
filtro: A,
|
|
2624
|
-
setFiltro: w,
|
|
2625
|
-
filtrados: E
|
|
2626
|
-
} = We(u?.members ?? [], (b) => [b.name, b.email, b.profileName ?? void 0]), {
|
|
2627
|
-
filtro: v,
|
|
2628
2630
|
setFiltro: y,
|
|
2631
|
+
filtrados: P
|
|
2632
|
+
} = We(d?.members ?? [], (b) => [b.name, b.email, b.profileName ?? void 0]), {
|
|
2633
|
+
filtro: f,
|
|
2634
|
+
setFiltro: w,
|
|
2629
2635
|
filtrados: o
|
|
2630
|
-
} = We(
|
|
2636
|
+
} = We(d?.grants ?? [], (b) => [b.resource, b.action]);
|
|
2631
2637
|
if (ee(() => {
|
|
2632
2638
|
let b = !1;
|
|
2633
|
-
return R(!0),
|
|
2634
|
-
b ||
|
|
2635
|
-
}).catch((
|
|
2636
|
-
b ||
|
|
2639
|
+
return R(!0), v(void 0), (t === "GROUP" ? c.getGroup(a) : c.getProfile(a)).then((E) => {
|
|
2640
|
+
b || u(E);
|
|
2641
|
+
}).catch((E) => {
|
|
2642
|
+
b || v(E instanceof Error ? E.message : "Não foi possível carregar.");
|
|
2637
2643
|
}).finally(() => {
|
|
2638
2644
|
b || R(!1);
|
|
2639
2645
|
}), () => {
|
|
2640
2646
|
b = !0;
|
|
2641
2647
|
};
|
|
2642
|
-
}, [
|
|
2648
|
+
}, [c, a, t]), x)
|
|
2643
2649
|
return /* @__PURE__ */ r(O, { gap: 8, children: [
|
|
2644
|
-
/* @__PURE__ */ e(
|
|
2650
|
+
/* @__PURE__ */ e(le, { size: "sm" }),
|
|
2645
2651
|
/* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Carregando…" })
|
|
2646
2652
|
] });
|
|
2647
2653
|
if (m)
|
|
2648
|
-
return /* @__PURE__ */ e(
|
|
2649
|
-
if (!
|
|
2654
|
+
return /* @__PURE__ */ e(ye, { color: "red", title: "Erro ao carregar", children: m });
|
|
2655
|
+
if (!d)
|
|
2650
2656
|
return null;
|
|
2651
2657
|
const l = t === "GROUP" ? "grupo" : "perfil", p = n?.additionalMemberColumns ?? [];
|
|
2652
2658
|
return /* @__PURE__ */ r(V, { gap: "lg", children: [
|
|
2653
2659
|
/* @__PURE__ */ r(V, { gap: 4, children: [
|
|
2654
2660
|
/* @__PURE__ */ r(O, { gap: 8, children: [
|
|
2655
|
-
/* @__PURE__ */ e(h, { fw: 620, size: "xl", children:
|
|
2661
|
+
/* @__PURE__ */ e(h, { fw: 620, size: "xl", children: d.groupName }),
|
|
2656
2662
|
/* @__PURE__ */ e(Q, { variant: "light", children: l })
|
|
2657
2663
|
] }),
|
|
2658
|
-
|
|
2664
|
+
d.description ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: d.description }) : null
|
|
2659
2665
|
] }),
|
|
2660
2666
|
/* @__PURE__ */ r(
|
|
2661
|
-
|
|
2667
|
+
we,
|
|
2662
2668
|
{
|
|
2663
2669
|
title: "Membros",
|
|
2664
|
-
hint: `${
|
|
2670
|
+
hint: `${d.members.length} — o total de cada um soma todas as origens`,
|
|
2665
2671
|
children: [
|
|
2666
|
-
|
|
2672
|
+
d.members.length === 0 ? /* @__PURE__ */ r(h, { size: "sm", c: "dimmed", children: [
|
|
2667
2673
|
"Ninguém está ",
|
|
2668
2674
|
t === "GROUP" ? "neste grupo" : "com este perfil",
|
|
2669
2675
|
"."
|
|
@@ -2672,29 +2678,29 @@ const Ue = (a) => {
|
|
|
2672
2678
|
Be,
|
|
2673
2679
|
{
|
|
2674
2680
|
value: A,
|
|
2675
|
-
onChange:
|
|
2681
|
+
onChange: y,
|
|
2676
2682
|
assunto: "pessoas",
|
|
2677
|
-
visiveis:
|
|
2678
|
-
total:
|
|
2683
|
+
visiveis: P.length,
|
|
2684
|
+
total: d.members.length
|
|
2679
2685
|
}
|
|
2680
2686
|
),
|
|
2681
|
-
/* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(
|
|
2682
|
-
/* @__PURE__ */ e(
|
|
2683
|
-
/* @__PURE__ */ e(
|
|
2684
|
-
/* @__PURE__ */ e(
|
|
2685
|
-
/* @__PURE__ */ e(
|
|
2686
|
-
/* @__PURE__ */ e(
|
|
2687
|
-
/* @__PURE__ */ e(
|
|
2688
|
-
/* @__PURE__ */ e(
|
|
2689
|
-
p.map((b) => /* @__PURE__ */ e(
|
|
2687
|
+
/* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(S, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2688
|
+
/* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
|
|
2689
|
+
/* @__PURE__ */ e(S.Th, { children: "Pessoa" }),
|
|
2690
|
+
/* @__PURE__ */ e(S.Th, { children: "Perfil" }),
|
|
2691
|
+
/* @__PURE__ */ e(S.Th, { ta: "right", children: "Concedidas" }),
|
|
2692
|
+
/* @__PURE__ */ e(S.Th, { ta: "right", children: "Valem" }),
|
|
2693
|
+
/* @__PURE__ */ e(S.Th, { ta: "right", children: "Não valem" }),
|
|
2694
|
+
/* @__PURE__ */ e(S.Th, { ta: "right", children: "Bloqueadas" }),
|
|
2695
|
+
p.map((b) => /* @__PURE__ */ e(S.Th, { children: b.header }, b.header))
|
|
2690
2696
|
] }) }),
|
|
2691
|
-
/* @__PURE__ */ e(
|
|
2692
|
-
|
|
2697
|
+
/* @__PURE__ */ e(S.Tbody, { children: P.map((b) => /* @__PURE__ */ r(
|
|
2698
|
+
S.Tr,
|
|
2693
2699
|
{
|
|
2694
2700
|
style: { cursor: s ? "pointer" : void 0 },
|
|
2695
2701
|
onClick: () => s?.(b.userId, b.name),
|
|
2696
2702
|
children: [
|
|
2697
|
-
/* @__PURE__ */ e(
|
|
2703
|
+
/* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(V, { gap: 0, children: [
|
|
2698
2704
|
/* @__PURE__ */ r(O, { gap: 6, children: [
|
|
2699
2705
|
/* @__PURE__ */ e(h, { size: "sm", fw: 550, children: b.name }),
|
|
2700
2706
|
b.administrator ? /* @__PURE__ */ e(Q, { size: "xs", color: "yellow", variant: "light", children: "administrador" }) : null,
|
|
@@ -2702,12 +2708,12 @@ const Ue = (a) => {
|
|
|
2702
2708
|
] }),
|
|
2703
2709
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: b.email })
|
|
2704
2710
|
] }) }),
|
|
2705
|
-
/* @__PURE__ */ e(
|
|
2706
|
-
/* @__PURE__ */ e(
|
|
2707
|
-
/* @__PURE__ */ e(
|
|
2708
|
-
/* @__PURE__ */ e(
|
|
2709
|
-
/* @__PURE__ */ e(
|
|
2710
|
-
p.map((L) => /* @__PURE__ */ e(
|
|
2711
|
+
/* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: b.profileName ?? "—" }) }),
|
|
2712
|
+
/* @__PURE__ */ e(S.Td, { ta: "right", children: b.total }),
|
|
2713
|
+
/* @__PURE__ */ e(S.Td, { ta: "right", c: "green", children: b.effective }),
|
|
2714
|
+
/* @__PURE__ */ e(S.Td, { ta: "right", c: "yellow.7", children: b.inert }),
|
|
2715
|
+
/* @__PURE__ */ e(S.Td, { ta: "right", c: "red", children: b.denied }),
|
|
2716
|
+
p.map((L) => /* @__PURE__ */ e(S.Td, { children: L.render(b, d) }, L.header))
|
|
2711
2717
|
]
|
|
2712
2718
|
},
|
|
2713
2719
|
b.userId
|
|
@@ -2722,33 +2728,33 @@ const Ue = (a) => {
|
|
|
2722
2728
|
]
|
|
2723
2729
|
}
|
|
2724
2730
|
),
|
|
2725
|
-
/* @__PURE__ */ e(
|
|
2731
|
+
/* @__PURE__ */ e(we, { title: `O que este ${l} concede`, hint: "a parte que é responsabilidade dele", children: d.grants.length === 0 ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Nada concedido por esta via." }) : /* @__PURE__ */ r(xe, { children: [
|
|
2726
2732
|
/* @__PURE__ */ e(
|
|
2727
2733
|
Be,
|
|
2728
2734
|
{
|
|
2729
|
-
value:
|
|
2730
|
-
onChange:
|
|
2735
|
+
value: f,
|
|
2736
|
+
onChange: w,
|
|
2731
2737
|
assunto: "capacidades",
|
|
2732
2738
|
visiveis: o.length,
|
|
2733
|
-
total:
|
|
2739
|
+
total: d.grants.length
|
|
2734
2740
|
}
|
|
2735
2741
|
),
|
|
2736
|
-
/* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(
|
|
2737
|
-
/* @__PURE__ */ e(
|
|
2738
|
-
/* @__PURE__ */ e(
|
|
2739
|
-
/* @__PURE__ */ e(
|
|
2742
|
+
/* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(S, { striped: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2743
|
+
/* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
|
|
2744
|
+
/* @__PURE__ */ e(S.Th, { children: "Capacidade" }),
|
|
2745
|
+
/* @__PURE__ */ e(S.Th, { children: "Situação" })
|
|
2740
2746
|
] }) }),
|
|
2741
|
-
/* @__PURE__ */ e(
|
|
2742
|
-
/* @__PURE__ */ e(
|
|
2747
|
+
/* @__PURE__ */ e(S.Tbody, { children: o.map((b, L) => /* @__PURE__ */ r(S.Tr, { children: [
|
|
2748
|
+
/* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(h, { size: "sm", ff: "monospace", children: [
|
|
2743
2749
|
b.resource,
|
|
2744
2750
|
" · ",
|
|
2745
2751
|
b.action
|
|
2746
2752
|
] }) }),
|
|
2747
|
-
/* @__PURE__ */ e(
|
|
2753
|
+
/* @__PURE__ */ e(S.Td, { children: Da(b.situation) })
|
|
2748
2754
|
] }, `${b.resource}-${b.action}-${L}`)) })
|
|
2749
2755
|
] }) })
|
|
2750
2756
|
] }) }),
|
|
2751
|
-
n?.afterGroupMembers?.(
|
|
2757
|
+
n?.afterGroupMembers?.(d)
|
|
2752
2758
|
] });
|
|
2753
2759
|
}, xa = 50, aa = [
|
|
2754
2760
|
{ branch: "USERS", label: "Pessoas" },
|
|
@@ -2787,24 +2793,24 @@ const Ue = (a) => {
|
|
|
2787
2793
|
), at = ({ selected: a, onSelect: t }) => {
|
|
2788
2794
|
const n = J(
|
|
2789
2795
|
K.SecurityDiagnostics
|
|
2790
|
-
), [s,
|
|
2796
|
+
), [s, c] = T(""), [d] = ia(s, 300), [u, x] = T({}), [R, m] = T({}), v = (o, l) => l ? `${o}:${l}` : o, A = ae(
|
|
2791
2797
|
async (o, l, p) => {
|
|
2792
|
-
const b =
|
|
2798
|
+
const b = v(o, l), L = R[b] ?? ra;
|
|
2793
2799
|
if (L.carregando || p && L.carregouTudo)
|
|
2794
2800
|
return;
|
|
2795
|
-
const
|
|
2801
|
+
const E = p ? Math.floor(L.nodes.length / xa) : 0;
|
|
2796
2802
|
m((i) => ({ ...i, [b]: { ...i[b] ?? ra, carregando: !0, erro: void 0 } }));
|
|
2797
2803
|
try {
|
|
2798
2804
|
const i = await n.browse(o, {
|
|
2799
2805
|
parentId: l,
|
|
2800
|
-
q:
|
|
2801
|
-
page:
|
|
2806
|
+
q: d || void 0,
|
|
2807
|
+
page: E,
|
|
2802
2808
|
size: xa
|
|
2803
2809
|
});
|
|
2804
|
-
m((
|
|
2805
|
-
const G = [...p ?
|
|
2810
|
+
m((N) => {
|
|
2811
|
+
const G = [...p ? N[b]?.nodes ?? [] : [], ...i.content ?? []];
|
|
2806
2812
|
return {
|
|
2807
|
-
...
|
|
2813
|
+
...N,
|
|
2808
2814
|
[b]: {
|
|
2809
2815
|
nodes: G,
|
|
2810
2816
|
total: i.totalElements ?? G.length,
|
|
@@ -2814,38 +2820,38 @@ const Ue = (a) => {
|
|
|
2814
2820
|
};
|
|
2815
2821
|
});
|
|
2816
2822
|
} catch (i) {
|
|
2817
|
-
m((
|
|
2818
|
-
...
|
|
2823
|
+
m((N) => ({
|
|
2824
|
+
...N,
|
|
2819
2825
|
[b]: {
|
|
2820
|
-
...
|
|
2826
|
+
...N[b] ?? ra,
|
|
2821
2827
|
carregando: !1,
|
|
2822
2828
|
erro: i instanceof Error ? i.message : "Não foi possível carregar."
|
|
2823
2829
|
}
|
|
2824
2830
|
}));
|
|
2825
2831
|
}
|
|
2826
2832
|
},
|
|
2827
|
-
[n,
|
|
2833
|
+
[n, d, R]
|
|
2828
2834
|
);
|
|
2829
2835
|
ee(() => {
|
|
2830
|
-
if (m({}),
|
|
2836
|
+
if (m({}), d) {
|
|
2831
2837
|
const o = {};
|
|
2832
2838
|
aa.forEach((l) => {
|
|
2833
2839
|
o[l.branch] = !0;
|
|
2834
|
-
}),
|
|
2840
|
+
}), x((l) => ({ ...l, ...o }));
|
|
2835
2841
|
}
|
|
2836
|
-
}, [
|
|
2842
|
+
}, [d]), ee(() => {
|
|
2837
2843
|
aa.forEach((o) => {
|
|
2838
|
-
|
|
2844
|
+
u[o.branch] && !R[o.branch] && A(o.branch, void 0, !1);
|
|
2839
2845
|
});
|
|
2840
|
-
}, [
|
|
2841
|
-
const
|
|
2842
|
-
const b =
|
|
2846
|
+
}, [u, R, d]);
|
|
2847
|
+
const y = (o) => x((l) => ({ ...l, [o]: !l[o] })), P = (o) => o === "critical" ? "red" : o === "warning" ? "yellow" : void 0, f = (o, l, p) => {
|
|
2848
|
+
const b = v("ACTIONS_OF_RESOURCE", o.id), L = !!u[b], E = R[b], i = a?.kind === o.kind && a?.id === o.id;
|
|
2843
2849
|
return /* @__PURE__ */ r(_, { children: [
|
|
2844
2850
|
/* @__PURE__ */ e(
|
|
2845
2851
|
ze,
|
|
2846
2852
|
{
|
|
2847
2853
|
onClick: () => {
|
|
2848
|
-
t({ kind: o.kind, id: o.id, label: o.label, parentLabel: p }), o.hasChildren && (
|
|
2854
|
+
t({ kind: o.kind, id: o.id, label: o.label, parentLabel: p }), o.hasChildren && (y(b), E || A("ACTIONS_OF_RESOURCE", o.id, !1));
|
|
2849
2855
|
},
|
|
2850
2856
|
"aria-current": i ? "true" : void 0,
|
|
2851
2857
|
"aria-expanded": o.hasChildren ? L : void 0,
|
|
@@ -2858,54 +2864,54 @@ const Ue = (a) => {
|
|
|
2858
2864
|
background: i ? "var(--mantine-color-blue-light)" : void 0
|
|
2859
2865
|
},
|
|
2860
2866
|
children: /* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
|
|
2861
|
-
o.severity ? /* @__PURE__ */ e(Q, { size: "xs", circle: !0, color:
|
|
2867
|
+
o.severity ? /* @__PURE__ */ e(Q, { size: "xs", circle: !0, color: P(o.severity) }) : /* @__PURE__ */ e(_, { w: 8 }),
|
|
2862
2868
|
/* @__PURE__ */ e(h, { size: "sm", fw: i ? 600 : 400, truncate: !0, style: { flex: 1 }, children: o.label }),
|
|
2863
2869
|
o.badge ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", ff: "monospace", children: o.badge }) : null
|
|
2864
2870
|
] })
|
|
2865
2871
|
}
|
|
2866
2872
|
),
|
|
2867
2873
|
o.hasChildren && L ? /* @__PURE__ */ r(_, { children: [
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
/* @__PURE__ */ e(
|
|
2874
|
+
E?.nodes.map((N) => f(N, l + 1, o.label)),
|
|
2875
|
+
E?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 8 + (l + 1) * 14, py: 4, children: [
|
|
2876
|
+
/* @__PURE__ */ e(le, { size: "xs" }),
|
|
2871
2877
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "carregando…" })
|
|
2872
2878
|
] }) : null,
|
|
2873
|
-
|
|
2879
|
+
E && !E.erro && !E.carregouTudo && !E.carregando && E.total > E.nodes.length ? /* @__PURE__ */ e(
|
|
2874
2880
|
ze,
|
|
2875
2881
|
{
|
|
2876
2882
|
onClick: () => void A("ACTIONS_OF_RESOURCE", o.id, !0),
|
|
2877
2883
|
style: { paddingLeft: 8 + (l + 1) * 14, paddingTop: 3, paddingBottom: 3 },
|
|
2878
2884
|
children: /* @__PURE__ */ r(h, { size: "xs", c: "blue", children: [
|
|
2879
2885
|
"mais ",
|
|
2880
|
-
|
|
2886
|
+
E.total - E.nodes.length,
|
|
2881
2887
|
" →"
|
|
2882
2888
|
] })
|
|
2883
2889
|
}
|
|
2884
2890
|
) : null
|
|
2885
2891
|
] }) : null
|
|
2886
2892
|
] }, `${o.kind}-${o.id}`);
|
|
2887
|
-
},
|
|
2893
|
+
}, w = ie(() => aa, []);
|
|
2888
2894
|
return /* @__PURE__ */ r(_, { children: [
|
|
2889
2895
|
/* @__PURE__ */ e(
|
|
2890
|
-
|
|
2896
|
+
ve,
|
|
2891
2897
|
{
|
|
2892
2898
|
size: "xs",
|
|
2893
2899
|
placeholder: "Buscar pessoa, grupo, capacidade…",
|
|
2894
2900
|
value: s,
|
|
2895
|
-
onChange: (o) =>
|
|
2901
|
+
onChange: (o) => c(o.currentTarget.value),
|
|
2896
2902
|
"aria-label": "Buscar na árvore",
|
|
2897
2903
|
mb: "xs",
|
|
2898
|
-
rightSection: s && s !==
|
|
2904
|
+
rightSection: s && s !== d ? /* @__PURE__ */ e(le, { size: "xs" }) : null
|
|
2899
2905
|
}
|
|
2900
2906
|
),
|
|
2901
|
-
|
|
2902
|
-
const l = !!
|
|
2907
|
+
w.map((o) => {
|
|
2908
|
+
const l = !!u[o.branch], p = R[o.branch];
|
|
2903
2909
|
return /* @__PURE__ */ r(_, { mb: 2, children: [
|
|
2904
2910
|
/* @__PURE__ */ e(
|
|
2905
2911
|
ze,
|
|
2906
2912
|
{
|
|
2907
2913
|
onClick: () => {
|
|
2908
|
-
|
|
2914
|
+
y(o.branch), p || A(o.branch, void 0, !1);
|
|
2909
2915
|
},
|
|
2910
2916
|
"aria-expanded": l,
|
|
2911
2917
|
style: { display: "block", width: "100%", padding: "5px 8px", borderRadius: 5 },
|
|
@@ -2918,9 +2924,9 @@ const Ue = (a) => {
|
|
|
2918
2924
|
),
|
|
2919
2925
|
l ? /* @__PURE__ */ r(_, { children: [
|
|
2920
2926
|
p?.erro ? /* @__PURE__ */ e(h, { size: "xs", c: "red", pl: 22, py: 4, children: p.erro }) : null,
|
|
2921
|
-
p?.nodes.map((b) =>
|
|
2927
|
+
p?.nodes.map((b) => f(b, 1)),
|
|
2922
2928
|
p?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 22, py: 4, children: [
|
|
2923
|
-
/* @__PURE__ */ e(
|
|
2929
|
+
/* @__PURE__ */ e(le, { size: "xs" }),
|
|
2924
2930
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "carregando…" })
|
|
2925
2931
|
] }) : null,
|
|
2926
2932
|
p && !p.erro && !p.carregouTudo && !p.carregando && p.total > p.nodes.length ? /* @__PURE__ */ e(
|
|
@@ -2935,7 +2941,7 @@ const Ue = (a) => {
|
|
|
2935
2941
|
] })
|
|
2936
2942
|
}
|
|
2937
2943
|
) : null,
|
|
2938
|
-
p && !p.erro && p.nodes.length === 0 && !p.carregando ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", pl: 22, py: 4, children:
|
|
2944
|
+
p && !p.erro && p.nodes.length === 0 && !p.carregando ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", pl: 22, py: 4, children: d ? "Nada encontrado." : "Vazio." }) : null
|
|
2939
2945
|
] }) : null
|
|
2940
2946
|
] }, o.branch);
|
|
2941
2947
|
})
|
|
@@ -2958,57 +2964,57 @@ const Ue = (a) => {
|
|
|
2958
2964
|
slots: n,
|
|
2959
2965
|
onError: s
|
|
2960
2966
|
}) => {
|
|
2961
|
-
const [
|
|
2962
|
-
|
|
2967
|
+
const [c, d] = T(Ta), [u, x] = T([]), [R, m] = T({}), v = ae((w) => {
|
|
2968
|
+
d((o) => o.kind === w.kind && o.id === w.id ? o : (x((l) => [...l, o]), w)), w.kind === "USER" && m((o) => ({ ...o, userId: w.id, userLabel: w.label })), w.kind === "ACTION" && m((o) => ({ ...o, action: w.label, resource: w.parentLabel }));
|
|
2963
2969
|
}, []), A = ae(() => {
|
|
2964
|
-
|
|
2965
|
-
const o =
|
|
2966
|
-
return o ? (
|
|
2970
|
+
x((w) => {
|
|
2971
|
+
const o = w[w.length - 1];
|
|
2972
|
+
return o ? (d(o), w.slice(0, -1)) : w;
|
|
2967
2973
|
});
|
|
2968
|
-
}, []),
|
|
2969
|
-
(
|
|
2970
|
-
[
|
|
2971
|
-
),
|
|
2974
|
+
}, []), y = ae(
|
|
2975
|
+
(w, o) => v({ kind: "USER", id: w, label: o }),
|
|
2976
|
+
[v]
|
|
2977
|
+
), P = (w) => /* @__PURE__ */ e(
|
|
2972
2978
|
ze,
|
|
2973
2979
|
{
|
|
2974
|
-
onClick: () =>
|
|
2975
|
-
"aria-current":
|
|
2980
|
+
onClick: () => v(w),
|
|
2981
|
+
"aria-current": c.kind === w.kind ? "true" : void 0,
|
|
2976
2982
|
style: {
|
|
2977
2983
|
display: "block",
|
|
2978
2984
|
width: "100%",
|
|
2979
2985
|
padding: "6px 8px",
|
|
2980
2986
|
borderRadius: 5,
|
|
2981
|
-
background:
|
|
2987
|
+
background: c.kind === w.kind ? "var(--mantine-color-blue-light)" : void 0
|
|
2982
2988
|
},
|
|
2983
|
-
children: /* @__PURE__ */ e(h, { size: "sm", fw:
|
|
2989
|
+
children: /* @__PURE__ */ e(h, { size: "sm", fw: c.kind === w.kind ? 600 : 500, children: w.label })
|
|
2984
2990
|
},
|
|
2985
|
-
|
|
2986
|
-
),
|
|
2987
|
-
switch (
|
|
2991
|
+
w.id
|
|
2992
|
+
), f = () => {
|
|
2993
|
+
switch (c.kind) {
|
|
2988
2994
|
case "OVERVIEW":
|
|
2989
2995
|
return /* @__PURE__ */ e(ba, { slots: n, onError: s });
|
|
2990
2996
|
case "SIMULATE":
|
|
2991
2997
|
return /* @__PURE__ */ e(Yr, { slots: n, onError: s, initial: R });
|
|
2992
2998
|
case "USER":
|
|
2993
|
-
return /* @__PURE__ */ e(Jr, { slots: n, onError: s, userId:
|
|
2999
|
+
return /* @__PURE__ */ e(Jr, { slots: n, onError: s, userId: c.id });
|
|
2994
3000
|
case "GROUP":
|
|
2995
|
-
return /* @__PURE__ */ e(Sa, { id:
|
|
3001
|
+
return /* @__PURE__ */ e(Sa, { id: c.id, kind: "GROUP", slots: n, onSelectUser: y });
|
|
2996
3002
|
case "PROFILE":
|
|
2997
|
-
return /* @__PURE__ */ e(Sa, { id:
|
|
3003
|
+
return /* @__PURE__ */ e(Sa, { id: c.id, kind: "PROFILE", slots: n, onSelectUser: y });
|
|
2998
3004
|
case "ACTION":
|
|
2999
3005
|
return /* @__PURE__ */ e(
|
|
3000
3006
|
_r,
|
|
3001
3007
|
{
|
|
3002
|
-
id:
|
|
3003
|
-
label:
|
|
3008
|
+
id: c.id,
|
|
3009
|
+
label: c.parentLabel ? `${c.parentLabel} · ${c.label}` : c.label,
|
|
3004
3010
|
slots: n,
|
|
3005
|
-
onSelectUser:
|
|
3006
|
-
onSimulate: () =>
|
|
3011
|
+
onSelectUser: y,
|
|
3012
|
+
onSimulate: () => v(Aa)
|
|
3007
3013
|
}
|
|
3008
3014
|
);
|
|
3009
3015
|
case "RESOURCE":
|
|
3010
3016
|
return /* @__PURE__ */ r(V, { gap: "xs", children: [
|
|
3011
|
-
/* @__PURE__ */ e(h, { fw: 620, size: "xl", ff: "monospace", children:
|
|
3017
|
+
/* @__PURE__ */ e(h, { fw: 620, size: "xl", ff: "monospace", children: c.label }),
|
|
3012
3018
|
/* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Abra o recurso na árvore para ver as ações. Cada ação responde quem alcança." })
|
|
3013
3019
|
] });
|
|
3014
3020
|
default:
|
|
@@ -3045,12 +3051,12 @@ const Ue = (a) => {
|
|
|
3045
3051
|
style: { display: "flex", flexDirection: "column", minHeight: 0, overflow: "hidden" },
|
|
3046
3052
|
children: /* @__PURE__ */ r(V, { gap: 2, style: { flex: 1, minHeight: 0 }, children: [
|
|
3047
3053
|
n?.renderUserSearch ? /* @__PURE__ */ e(_, { mb: 4, children: n.renderUserSearch(
|
|
3048
|
-
(
|
|
3054
|
+
(w) => v({ kind: "USER", id: w, label: w })
|
|
3049
3055
|
) }) : null,
|
|
3050
|
-
|
|
3051
|
-
|
|
3056
|
+
P(Ta),
|
|
3057
|
+
P(Aa),
|
|
3052
3058
|
/* @__PURE__ */ e(_, { my: 6, style: { borderTop: "1px solid var(--mantine-color-default-border)" } }),
|
|
3053
|
-
/* @__PURE__ */ e(
|
|
3059
|
+
/* @__PURE__ */ e(de, { type: "hover", style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(at, { selected: c, onSelect: v }) })
|
|
3054
3060
|
] })
|
|
3055
3061
|
}
|
|
3056
3062
|
),
|
|
@@ -3062,7 +3068,7 @@ const Ue = (a) => {
|
|
|
3062
3068
|
p: "md",
|
|
3063
3069
|
style: { minWidth: 0, minHeight: 0, display: "flex", flexDirection: "column", overflow: "hidden" },
|
|
3064
3070
|
children: [
|
|
3065
|
-
|
|
3071
|
+
u.length > 0 ? /* @__PURE__ */ r(O, { gap: 6, mb: "xs", style: { flexShrink: 0 }, children: [
|
|
3066
3072
|
/* @__PURE__ */ e(
|
|
3067
3073
|
X,
|
|
3068
3074
|
{
|
|
@@ -3076,10 +3082,10 @@ const Ue = (a) => {
|
|
|
3076
3082
|
),
|
|
3077
3083
|
/* @__PURE__ */ r(h, { size: "xs", c: "dimmed", truncate: !0, children: [
|
|
3078
3084
|
"para ",
|
|
3079
|
-
|
|
3085
|
+
u[u.length - 1]?.label
|
|
3080
3086
|
] })
|
|
3081
3087
|
] }) : null,
|
|
3082
|
-
/* @__PURE__ */ e(_, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children:
|
|
3088
|
+
/* @__PURE__ */ e(_, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: f() })
|
|
3083
3089
|
]
|
|
3084
3090
|
}
|
|
3085
3091
|
)
|
|
@@ -3107,7 +3113,7 @@ export {
|
|
|
3107
3113
|
Xe as PermissionsSelectorModal,
|
|
3108
3114
|
xr as ProfileModal,
|
|
3109
3115
|
Ar as RenderProfileUserItem,
|
|
3110
|
-
|
|
3116
|
+
we as Section,
|
|
3111
3117
|
at as SecurityTree,
|
|
3112
3118
|
Yr as SimulationPanel,
|
|
3113
3119
|
Oe as TabelaRolavel,
|