@archbase/security-ui 4.2.3 → 4.2.4
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 ce, Stack 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 ne, ArchbaseNotifications as oe, 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
|
|
2
|
+
import { Modal as $e, ScrollArea as ce, 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 me, Flex as Fe, Space as Ra, Input as Te, useTree as ca, useMantineColorScheme as qe, TextInput as fe, Tree as da, Badge as Q, Tabs as Ce, RingProgress as Ka, SimpleGrid as He, Table as C, Drawer as Ja, Loader as se, Alert as be, 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 ge, 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 ne, ArchbaseNotifications as oe, 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 pe } 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 x, 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";
|
|
@@ -25,7 +25,7 @@ const xr = (a) => {
|
|
|
25
25
|
title: g().t("archbase:Perfil"),
|
|
26
26
|
size: "60%",
|
|
27
27
|
styles: { content: { maxWidth: 1e3 } },
|
|
28
|
-
children: /* @__PURE__ */ e(ce, { style: { height: "460px" }, children: /* @__PURE__ */ r(
|
|
28
|
+
children: /* @__PURE__ */ e(ce, { 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(
|
|
@@ -64,10 +64,10 @@ function Tr({
|
|
|
64
64
|
idFieldAssigned: d,
|
|
65
65
|
labelFieldAssigned: u,
|
|
66
66
|
handleCreateAssociationObject: c,
|
|
67
|
-
width:
|
|
68
|
-
height:
|
|
67
|
+
width: T = "400px",
|
|
68
|
+
height: R = "200px",
|
|
69
69
|
titleAvailable: m = "Disponíveis",
|
|
70
|
-
titleAssigned:
|
|
70
|
+
titleAssigned: S = "Selecionados"
|
|
71
71
|
}) {
|
|
72
72
|
Ne(
|
|
73
73
|
"ArchbaseDualListSelector-Available",
|
|
@@ -80,39 +80,39 @@ function Tr({
|
|
|
80
80
|
t,
|
|
81
81
|
void 0,
|
|
82
82
|
[]
|
|
83
|
-
), [
|
|
84
|
-
a && E(a.browseRecords()), t &&
|
|
83
|
+
), [w, E] = x([]), [v, y] = x([]), [o, l] = x([]), [p, b] = x([]), L = ae(() => {
|
|
84
|
+
a && E(a.browseRecords()), t && y(t.browseRecords());
|
|
85
85
|
}, [a, t]);
|
|
86
86
|
ha({
|
|
87
87
|
dataSource: a,
|
|
88
|
-
listener: () =>
|
|
88
|
+
listener: () => L()
|
|
89
89
|
}), ha({
|
|
90
90
|
dataSource: t,
|
|
91
|
-
listener: () =>
|
|
91
|
+
listener: () => L()
|
|
92
92
|
}), ee(() => {
|
|
93
|
-
|
|
94
|
-
}, [
|
|
95
|
-
const F = (
|
|
96
|
-
|
|
93
|
+
L();
|
|
94
|
+
}, [L]);
|
|
95
|
+
const F = (f, I) => typeof I == "function" ? I(f) : f[I], i = (f, I) => typeof I == "function" ? I(f) : f[I], D = (f, I) => {
|
|
96
|
+
f((N) => N.includes(I) ? N.filter((ye) => ye !== I) : [...N, I]);
|
|
97
97
|
}, P = () => {
|
|
98
|
-
o.forEach((
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
A.isDataSourceV2 ? (t.insert(
|
|
98
|
+
o.forEach((f) => {
|
|
99
|
+
const I = w.find((N) => F(N, n) === f);
|
|
100
|
+
if (I) {
|
|
101
|
+
const N = c(I);
|
|
102
|
+
A.isDataSourceV2 ? (t.insert(N), t.save()) : (t.insert(N), t.save(), A.v1State.forceUpdate());
|
|
103
103
|
}
|
|
104
104
|
}), l([]);
|
|
105
|
-
},
|
|
106
|
-
p.forEach((
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
109
|
-
const
|
|
110
|
-
A.isDataSourceV2 ? t.remove(() => t.locate(
|
|
105
|
+
}, G = () => {
|
|
106
|
+
p.forEach((f) => {
|
|
107
|
+
const I = v.find((N) => F(N, d) === f);
|
|
108
|
+
if (I) {
|
|
109
|
+
const N = typeof d == "function" ? { customId: d(I) } : { [d]: f };
|
|
110
|
+
A.isDataSourceV2 ? t.remove(() => t.locate(N)) : (t.remove(() => t.locate(N)), A.v1State.forceUpdate());
|
|
111
111
|
}
|
|
112
|
-
}),
|
|
112
|
+
}), b([]);
|
|
113
113
|
};
|
|
114
|
-
return /* @__PURE__ */ r(re, { withBorder: !0, style: { display: "flex", width:
|
|
115
|
-
/* @__PURE__ */ r(_, { style: { minWidth: "44%", minHeight:
|
|
114
|
+
return /* @__PURE__ */ r(re, { withBorder: !0, style: { display: "flex", width: T, height: R }, children: [
|
|
115
|
+
/* @__PURE__ */ r(_, { style: { minWidth: "44%", minHeight: R }, children: [
|
|
116
116
|
/* @__PURE__ */ e(h, { children: m }),
|
|
117
117
|
/* @__PURE__ */ e(
|
|
118
118
|
Me,
|
|
@@ -127,26 +127,26 @@ function Tr({
|
|
|
127
127
|
overflowX: "hidden",
|
|
128
128
|
height: "calc(100% - 32px)"
|
|
129
129
|
},
|
|
130
|
-
children:
|
|
130
|
+
children: w.map((f) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
|
|
131
131
|
la,
|
|
132
132
|
{
|
|
133
|
-
label: i(
|
|
134
|
-
checked: o.includes(F(
|
|
135
|
-
onChange: () => D(l, F(
|
|
136
|
-
disabled:
|
|
137
|
-
(
|
|
133
|
+
label: i(f, s),
|
|
134
|
+
checked: o.includes(F(f, n)),
|
|
135
|
+
onChange: () => D(l, F(f, n)),
|
|
136
|
+
disabled: v.some(
|
|
137
|
+
(I) => F(I, d) === F(f, n)
|
|
138
138
|
)
|
|
139
139
|
}
|
|
140
|
-
) }, F(
|
|
140
|
+
) }, F(f, n)))
|
|
141
141
|
}
|
|
142
142
|
)
|
|
143
143
|
] }),
|
|
144
|
-
/* @__PURE__ */ r(
|
|
145
|
-
/* @__PURE__ */ e(ke, { label: "Adicionar", children: /* @__PURE__ */ e(
|
|
146
|
-
/* @__PURE__ */ e(ke, { label: "Remover", children: /* @__PURE__ */ e(
|
|
144
|
+
/* @__PURE__ */ r(V, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
|
|
145
|
+
/* @__PURE__ */ e(ke, { label: "Adicionar", children: /* @__PURE__ */ e(me, { onClick: P, disabled: !o.length, children: /* @__PURE__ */ e(Ia, {}) }) }),
|
|
146
|
+
/* @__PURE__ */ e(ke, { label: "Remover", children: /* @__PURE__ */ e(me, { onClick: G, disabled: !p.length, children: /* @__PURE__ */ e(Ea, {}) }) })
|
|
147
147
|
] }),
|
|
148
|
-
/* @__PURE__ */ r(_, { style: { minWidth: "44%", minHeight:
|
|
149
|
-
/* @__PURE__ */ e(h, { children:
|
|
148
|
+
/* @__PURE__ */ r(_, { style: { minWidth: "44%", minHeight: R }, children: [
|
|
149
|
+
/* @__PURE__ */ e(h, { children: S }),
|
|
150
150
|
/* @__PURE__ */ e(
|
|
151
151
|
Me,
|
|
152
152
|
{
|
|
@@ -160,14 +160,14 @@ function Tr({
|
|
|
160
160
|
overflowX: "hidden",
|
|
161
161
|
height: "calc(100% - 32px)"
|
|
162
162
|
},
|
|
163
|
-
children:
|
|
163
|
+
children: v.map((f) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
|
|
164
164
|
la,
|
|
165
165
|
{
|
|
166
|
-
label: i(
|
|
167
|
-
checked: p.includes(F(
|
|
168
|
-
onChange: () => D(
|
|
166
|
+
label: i(f, u),
|
|
167
|
+
checked: p.includes(F(f, d)),
|
|
168
|
+
onChange: () => D(b, F(f, d))
|
|
169
169
|
}
|
|
170
|
-
) }, F(
|
|
170
|
+
) }, F(f, d)))
|
|
171
171
|
}
|
|
172
172
|
)
|
|
173
173
|
] })
|
|
@@ -203,15 +203,15 @@ const Ar = ur(
|
|
|
203
203
|
avatarMaxOutputSizePx: 512,
|
|
204
204
|
allowEditEmail: !0
|
|
205
205
|
}, zr = (a) => {
|
|
206
|
-
const [t, n] =
|
|
206
|
+
const [t, n] = x(""), s = { ...Rr, ...a.options ?? {} }, d = a.dataSource.getFieldValue("passwordChangedAt"), u = d ? new Date(d) : void 0, c = u && !Number.isNaN(u.getTime()) ? u.toLocaleString() : void 0, T = _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 = T ? {
|
|
210
|
+
...T,
|
|
211
|
+
blocklist: [...T.blocklist ?? [], ...R]
|
|
212
|
+
} : void 0, S = J(K.Group), { dataSource: A } = ta({
|
|
213
213
|
name: "dsGroups",
|
|
214
|
-
service:
|
|
214
|
+
service: S,
|
|
215
215
|
pageSize: 9999,
|
|
216
216
|
loadOnStart: !0,
|
|
217
217
|
sort: ["name:asc"],
|
|
@@ -220,9 +220,9 @@ const Ar = ur(
|
|
|
220
220
|
}
|
|
221
221
|
});
|
|
222
222
|
console.log("versão 12/05/2026");
|
|
223
|
-
const
|
|
223
|
+
const w = J(K.Profile), { dataSource: E } = ta({
|
|
224
224
|
name: "dsProfiles",
|
|
225
|
-
service:
|
|
225
|
+
service: w,
|
|
226
226
|
pageSize: 9999,
|
|
227
227
|
loadOnStart: !0,
|
|
228
228
|
sort: ["name:asc"],
|
|
@@ -233,22 +233,22 @@ const Ar = ur(
|
|
|
233
233
|
ee(() => {
|
|
234
234
|
n("");
|
|
235
235
|
}, [a.dataSource.getFieldValue("password")]);
|
|
236
|
-
const
|
|
236
|
+
const v = 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 w.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
|
|
244
|
-
p && p.content.length > 0 && a.dataSource.setFieldValue("groups", p.content.map((
|
|
243
|
+
const l = Ge(De.in("name", s.userDefaultGroups)), p = await S.findAllWithFilter(l, 0, 500);
|
|
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 && v();
|
|
250
250
|
}, [a.opened]);
|
|
251
|
-
const
|
|
251
|
+
const y = () => {
|
|
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,7 +276,7 @@ const Ar = ur(
|
|
|
276
276
|
size: "80%",
|
|
277
277
|
styles: { content: { maxWidth: 1e3 } },
|
|
278
278
|
children: [
|
|
279
|
-
/* @__PURE__ */ e(ce, { style: { height: "500px" }, children: /* @__PURE__ */ r(
|
|
279
|
+
/* @__PURE__ */ e(ce, { 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: [
|
|
@@ -355,7 +355,7 @@ const Ar = ur(
|
|
|
355
355
|
) }) }),
|
|
356
356
|
/* @__PURE__ */ r(H, { children: [
|
|
357
357
|
/* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: s.showAccountConfigLabel && /* @__PURE__ */ e(h, { fz: 14, fw: 500, children: "Informe" }) }),
|
|
358
|
-
/* @__PURE__ */ e(H.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(
|
|
358
|
+
/* @__PURE__ */ e(H.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(V, { gap: "lg", children: [
|
|
359
359
|
s.showChangePasswordOnNextLogin && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
|
|
360
360
|
Ae,
|
|
361
361
|
{
|
|
@@ -387,7 +387,7 @@ const Ar = ur(
|
|
|
387
387
|
] }),
|
|
388
388
|
s.showPasswordChangedAt && c && /* @__PURE__ */ e(h, { fz: 12, c: "dimmed", children: `${g().t("archbase:Última troca de senha")}: ${c}` })
|
|
389
389
|
] }) }),
|
|
390
|
-
/* @__PURE__ */ e(H.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(
|
|
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(
|
|
392
392
|
Ae,
|
|
393
393
|
{
|
|
@@ -413,7 +413,7 @@ const Ar = ur(
|
|
|
413
413
|
}
|
|
414
414
|
) })
|
|
415
415
|
] }) }),
|
|
416
|
-
/* @__PURE__ */ e(H.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e(
|
|
416
|
+
/* @__PURE__ */ e(H.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e(V, { gap: "lg", children: /* @__PURE__ */ e(
|
|
417
417
|
sr,
|
|
418
418
|
{
|
|
419
419
|
label: g().t("archbase:Foto do usuário"),
|
|
@@ -457,7 +457,7 @@ 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: y, children: g().t("archbase:Salvar") })
|
|
461
461
|
] })
|
|
462
462
|
]
|
|
463
463
|
}
|
|
@@ -478,7 +478,7 @@ const Ar = ur(
|
|
|
478
478
|
title: g().t("archbase:Grupo"),
|
|
479
479
|
size: "60%",
|
|
480
480
|
styles: { content: { maxWidth: 1e3 } },
|
|
481
|
-
children: /* @__PURE__ */ e(ce, { style: { height: "460px" }, children: /* @__PURE__ */ r(
|
|
481
|
+
children: /* @__PURE__ */ e(ce, { 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(
|
|
@@ -516,7 +516,7 @@ const Ar = ur(
|
|
|
516
516
|
] })
|
|
517
517
|
] }) }), Er = (a) => {
|
|
518
518
|
yr();
|
|
519
|
-
const [t, n] =
|
|
519
|
+
const [t, n] = x(), s = J(K.User), d = Ne(
|
|
520
520
|
"ApiTokenModal",
|
|
521
521
|
a.dataSource,
|
|
522
522
|
"expirationDate",
|
|
@@ -527,33 +527,33 @@ const Ar = ur(
|
|
|
527
527
|
if (!m)
|
|
528
528
|
d.handleValueChange(void 0);
|
|
529
529
|
else {
|
|
530
|
-
const
|
|
530
|
+
const S = typeof m == "string" ? new Date(m) : m, A = ar(S);
|
|
531
531
|
d.handleValueChange(A);
|
|
532
532
|
}
|
|
533
533
|
n(m);
|
|
534
|
-
}, c = async (m,
|
|
534
|
+
}, c = async (m, S) => new Promise(async (A, w) => {
|
|
535
535
|
try {
|
|
536
|
-
const E = Ge(De.or(De.eq("name", `^*${
|
|
536
|
+
const E = Ge(De.or(De.eq("name", `^*${S.trim()}*`))), v = await s.findAllWithFilter(E, m, 20);
|
|
537
537
|
A({
|
|
538
|
-
options:
|
|
539
|
-
page:
|
|
540
|
-
totalPages:
|
|
538
|
+
options: v.content,
|
|
539
|
+
page: v.pageable.pageNumber,
|
|
540
|
+
totalPages: v.totalPages
|
|
541
541
|
});
|
|
542
542
|
} catch (E) {
|
|
543
|
-
|
|
543
|
+
w(ge(E));
|
|
544
544
|
}
|
|
545
|
-
}),
|
|
545
|
+
}), T = () => {
|
|
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);
|
|
549
|
-
},
|
|
549
|
+
}, R = () => {
|
|
550
550
|
a.onClickCancel(a.dataSource.current);
|
|
551
551
|
};
|
|
552
552
|
return /* @__PURE__ */ r(
|
|
553
553
|
$e,
|
|
554
554
|
{
|
|
555
555
|
opened: a.opened,
|
|
556
|
-
onClose:
|
|
556
|
+
onClose: R,
|
|
557
557
|
title: g().t("archbase:Token de API"),
|
|
558
558
|
size: "50%",
|
|
559
559
|
children: [
|
|
@@ -603,8 +603,8 @@ const Ar = ur(
|
|
|
603
603
|
)
|
|
604
604
|
] }),
|
|
605
605
|
/* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
|
|
606
|
-
/* @__PURE__ */ e(X, { variant: "default", onClick:
|
|
607
|
-
/* @__PURE__ */ e(X, { onClick:
|
|
606
|
+
/* @__PURE__ */ e(X, { variant: "default", onClick: R, children: g().t("archbase:Cancelar") }),
|
|
607
|
+
/* @__PURE__ */ e(X, { onClick: T, children: g().t("archbase:Salvar") })
|
|
608
608
|
] })
|
|
609
609
|
]
|
|
610
610
|
}
|
|
@@ -614,48 +614,48 @@ const Ar = ur(
|
|
|
614
614
|
return a.includes(t) ? a.split(t).map((d) => d.trim()).map((d) => g().t(d)).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]), d = ie(() => a?.getFieldValue("id") || "", [a]), u = ie(() => a?.getFieldValue("type") || "", [a]), c = ca(),
|
|
618
|
-
value:
|
|
619
|
-
label:
|
|
620
|
-
children:
|
|
621
|
-
value:
|
|
622
|
-
label:
|
|
617
|
+
const s = ie(() => a?.getFieldValue("name") || "", [a]), d = ie(() => a?.getFieldValue("id") || "", [a]), u = ie(() => a?.getFieldValue("type") || "", [a]), c = ca(), T = ca(), [R, m] = x([]), [S, A] = x([]), [w, E] = x(), [v, y] = x(), [o, l] = x(""), [p] = ia(o, 200), [b, L] = x(""), [F] = ia(b, 200), i = J(K.Resource), { colorScheme: D } = qe(), P = D === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", G = ie(() => S.sort((z, k) => z.resourceDescription.localeCompare(k.resourceDescription)).map((z) => ({
|
|
618
|
+
value: z.resourceId,
|
|
619
|
+
label: z.resourceDescription,
|
|
620
|
+
children: z.permissions.filter((k) => k.actionDescription.toLowerCase().includes(F.toLowerCase())).sort((k, q) => k.actionDescription.localeCompare(q.actionDescription)).map((k) => ({
|
|
621
|
+
value: k.actionId,
|
|
622
|
+
label: k.actionDescription,
|
|
623
623
|
nodeProps: {
|
|
624
|
-
permissionId:
|
|
625
|
-
types:
|
|
626
|
-
owner:
|
|
624
|
+
permissionId: k.permissionId,
|
|
625
|
+
types: k.types ?? [],
|
|
626
|
+
owner: z
|
|
627
627
|
}
|
|
628
628
|
}))
|
|
629
|
-
})), [
|
|
630
|
-
value:
|
|
631
|
-
label:
|
|
632
|
-
children:
|
|
633
|
-
const q =
|
|
629
|
+
})), [S, F]), f = ie(() => S.map((z) => z.permissions.map((k) => k.actionId)).flat(), [S]), I = ie(() => R.sort((z, k) => z.resourceDescription.localeCompare(k.resourceDescription)).map((z) => ({
|
|
630
|
+
value: z.resourceId,
|
|
631
|
+
label: z.resourceDescription,
|
|
632
|
+
children: z.permissions.filter((k) => k.actionDescription.toLowerCase().includes(p.toLowerCase())).sort((k, q) => k.actionDescription.localeCompare(q.actionDescription)).map((k) => {
|
|
633
|
+
const q = S.find((U) => U.resourceId === z.resourceId)?.permissions.find((U) => U.actionId === k.actionId);
|
|
634
634
|
return {
|
|
635
|
-
value:
|
|
636
|
-
label:
|
|
635
|
+
value: k.actionId,
|
|
636
|
+
label: k.actionDescription,
|
|
637
637
|
nodeProps: {
|
|
638
|
-
granted:
|
|
639
|
-
owner:
|
|
638
|
+
granted: f.includes(k.actionId) && q?.types?.includes(Se(Y, u)),
|
|
639
|
+
owner: z
|
|
640
640
|
}
|
|
641
641
|
};
|
|
642
642
|
})
|
|
643
|
-
})), [
|
|
643
|
+
})), [R, S, f, u, p]), N = ae(async () => {
|
|
644
644
|
if (d) {
|
|
645
|
-
const
|
|
646
|
-
m(
|
|
645
|
+
const z = await i.getPermissionsBySecurityId(d, u), k = await i.getAllPermissionsAvailable();
|
|
646
|
+
m(k), A(z);
|
|
647
647
|
}
|
|
648
|
-
}, [d, u]),
|
|
649
|
-
|
|
650
|
-
if (
|
|
648
|
+
}, [d, u]), ye = ae(() => {
|
|
649
|
+
w?.value && d && i.createPermission(d, w.value, u).then((z) => {
|
|
650
|
+
if (z) {
|
|
651
651
|
A((j) => {
|
|
652
652
|
let B;
|
|
653
|
-
return j.map((Z) => Z.resourceId).includes(
|
|
653
|
+
return j.map((Z) => Z.resourceId).includes(z.resourceId) ? B = j.map((Z) => Z.resourceId === z.resourceId ? Z.permissions.map((W) => W.actionId).includes(w.value) ? {
|
|
654
654
|
...Z,
|
|
655
655
|
permissions: Z.permissions.map(
|
|
656
|
-
(W) => W.actionId ===
|
|
656
|
+
(W) => W.actionId === w.value ? {
|
|
657
657
|
...W,
|
|
658
|
-
permissionId:
|
|
658
|
+
permissionId: z.permissionId,
|
|
659
659
|
types: [...W.types ?? [], Se(Y, u)]
|
|
660
660
|
} : W
|
|
661
661
|
)
|
|
@@ -664,70 +664,70 @@ function Xe({ dataSource: a, opened: t, close: n }) {
|
|
|
664
664
|
permissions: [
|
|
665
665
|
...Z.permissions ?? [],
|
|
666
666
|
{
|
|
667
|
-
actionId:
|
|
668
|
-
actionDescription:
|
|
669
|
-
permissionId:
|
|
667
|
+
actionId: z.actionId,
|
|
668
|
+
actionDescription: z.actionDescription,
|
|
669
|
+
permissionId: z.permissionId,
|
|
670
670
|
types: [Se(Y, u)]
|
|
671
671
|
}
|
|
672
672
|
]
|
|
673
673
|
} : Z) : B = [
|
|
674
674
|
...j,
|
|
675
675
|
{
|
|
676
|
-
resourceId:
|
|
677
|
-
resourceDescription:
|
|
676
|
+
resourceId: z.resourceId,
|
|
677
|
+
resourceDescription: z.resourceDescription,
|
|
678
678
|
permissions: [
|
|
679
679
|
{
|
|
680
|
-
actionId:
|
|
681
|
-
actionDescription:
|
|
682
|
-
permissionId:
|
|
680
|
+
actionId: z.actionId,
|
|
681
|
+
actionDescription: z.actionDescription,
|
|
682
|
+
permissionId: z.permissionId,
|
|
683
683
|
types: [Se(Y, u)]
|
|
684
684
|
}
|
|
685
685
|
]
|
|
686
686
|
}
|
|
687
687
|
], B;
|
|
688
688
|
});
|
|
689
|
-
const
|
|
690
|
-
U?.value && c.select(U.value),
|
|
689
|
+
const k = I.filter((j) => j.value === w?.nodeProps?.owner?.resourceId).map((j) => j.children).flat(), q = k.map((j) => j.value).indexOf(w.value), U = k.find((j, B) => !j?.nodeProps?.granted && j?.value !== w.value && (k.length > q + 1 ? B > q : !0));
|
|
690
|
+
U?.value && c.select(U.value), T.expand(z.resourceId), E(U);
|
|
691
691
|
}
|
|
692
692
|
});
|
|
693
|
-
}, [
|
|
694
|
-
|
|
693
|
+
}, [w, d, u, i, I, R, S, c, T]), we = ae(() => {
|
|
694
|
+
v?.nodeProps?.permissionId && i.deletePermission(v.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 === v?.nodeProps?.permissionId && B.permissions.length === 1 && W?.types?.length === 1 && W.types[0] === Se(Y, u) && (Z = !1);
|
|
699
699
|
}), Z;
|
|
700
700
|
}).map((B) => {
|
|
701
|
-
const Z =
|
|
702
|
-
return B.resourceId === Z.resourceId ?
|
|
701
|
+
const Z = v?.nodeProps?.owner;
|
|
702
|
+
return B.resourceId === Z.resourceId ? v?.nodeProps?.types?.length === 1 ? {
|
|
703
703
|
...B,
|
|
704
|
-
permissions: [...(B.permissions ?? []).filter((W) => W.permissionId !==
|
|
704
|
+
permissions: [...(B.permissions ?? []).filter((W) => W.permissionId !== v?.nodeProps?.permissionId)]
|
|
705
705
|
} : {
|
|
706
706
|
...B,
|
|
707
|
-
permissions: (B.permissions ?? []).map((W) => W.actionId ===
|
|
707
|
+
permissions: (B.permissions ?? []).map((W) => W.actionId === v.value ? {
|
|
708
708
|
actionId: W.actionId,
|
|
709
709
|
actionDescription: W.actionDescription,
|
|
710
710
|
types: [...W.types?.filter((le) => le && le !== Se(Y, u)) ?? []]
|
|
711
711
|
} : W)
|
|
712
712
|
} : B;
|
|
713
713
|
}));
|
|
714
|
-
const
|
|
715
|
-
q?.value &&
|
|
714
|
+
const z = G.filter((U) => U.value === v?.nodeProps?.owner?.resourceId).map((U) => U.children).flat(), k = z.map((U) => U.value).indexOf(v.value), q = z.find((U, j) => U?.nodeProps?.types.includes(Se(Y, u)) && U?.value !== v.value && (z.length > k + 1 ? j > k : !0));
|
|
715
|
+
q?.value && T.select(q.value), y(q);
|
|
716
716
|
});
|
|
717
|
-
}, [
|
|
717
|
+
}, [v, i, u, G, S, T]);
|
|
718
718
|
return ee(() => {
|
|
719
|
-
t && a && (E(void 0),
|
|
720
|
-
}, [t, u, d,
|
|
719
|
+
t && a && (E(void 0), y(void 0), l(""), L(""), T.collapseAllNodes(), c.collapseAllNodes(), N());
|
|
720
|
+
}, [t, u, d, N]), a ? /* @__PURE__ */ e($e, { opened: t, onClose: n, title: `${g().t(`archbase:${u}`)}: ${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
|
+
fe,
|
|
727
727
|
{
|
|
728
728
|
size: "xs",
|
|
729
729
|
value: o,
|
|
730
|
-
onChange: (
|
|
730
|
+
onChange: (z) => l(z.target.value),
|
|
731
731
|
placeholder: g().t("archbase:Filter available permissions")
|
|
732
732
|
}
|
|
733
733
|
)
|
|
@@ -735,21 +735,21 @@ function Xe({ dataSource: a, opened: t, close: n }) {
|
|
|
735
735
|
/* @__PURE__ */ e(ce, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
|
|
736
736
|
da,
|
|
737
737
|
{
|
|
738
|
-
data:
|
|
738
|
+
data: I,
|
|
739
739
|
selectOnClick: !0,
|
|
740
740
|
allowRangeSelection: !1,
|
|
741
741
|
tree: c,
|
|
742
|
-
renderNode: ({ level:
|
|
743
|
-
const Z =
|
|
744
|
-
E(
|
|
745
|
-
}, [
|
|
742
|
+
renderNode: ({ level: z, node: k, expanded: q, hasChildren: U, selected: j, elementProps: B }) => {
|
|
743
|
+
const Z = k?.nodeProps?.granted, W = Z ? "dimmed" : void 0, le = Z ? "line-through" : void 0, je = ae((Ze) => {
|
|
744
|
+
E(k), B.onClick(Ze);
|
|
745
|
+
}, [k, 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 && z === 2 ? P : "",
|
|
753
753
|
onClick: je,
|
|
754
754
|
children: [
|
|
755
755
|
U && /* @__PURE__ */ e(
|
|
@@ -771,7 +771,7 @@ function Xe({ dataSource: a, opened: t, close: n }) {
|
|
|
771
771
|
{
|
|
772
772
|
c: W,
|
|
773
773
|
td: le,
|
|
774
|
-
children: fa(
|
|
774
|
+
children: fa(k.label)
|
|
775
775
|
}
|
|
776
776
|
)
|
|
777
777
|
]
|
|
@@ -781,19 +781,19 @@ function Xe({ dataSource: a, opened: t, close: n }) {
|
|
|
781
781
|
}
|
|
782
782
|
) })
|
|
783
783
|
] }),
|
|
784
|
-
/* @__PURE__ */ e("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ r(
|
|
785
|
-
/* @__PURE__ */ e(ke, { label: g().t("archbase:Add"), children: /* @__PURE__ */ e(
|
|
786
|
-
/* @__PURE__ */ e(ke, { label: g().t("archbase:Remove"), children: /* @__PURE__ */ e(
|
|
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(me, { onClick: ye, disabled: !w || w?.nodeProps?.granted || !w.nodeProps, children: /* @__PURE__ */ e(Ia, {}) }) }),
|
|
786
|
+
/* @__PURE__ */ e(ke, { label: g().t("archbase:Remove"), children: /* @__PURE__ */ e(me, { onClick: we, disabled: !v || !v?.nodeProps?.permissionId || !v.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
|
+
fe,
|
|
793
793
|
{
|
|
794
794
|
size: "xs",
|
|
795
|
-
value:
|
|
796
|
-
onChange: (
|
|
795
|
+
value: b,
|
|
796
|
+
onChange: (z) => L(z.target.value),
|
|
797
797
|
placeholder: g().t("archbase:Filter granted permissions")
|
|
798
798
|
}
|
|
799
799
|
)
|
|
@@ -801,21 +801,21 @@ function Xe({ dataSource: a, opened: t, close: n }) {
|
|
|
801
801
|
/* @__PURE__ */ e(ce, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
|
|
802
802
|
da,
|
|
803
803
|
{
|
|
804
|
-
data:
|
|
804
|
+
data: G,
|
|
805
805
|
selectOnClick: !0,
|
|
806
806
|
allowRangeSelection: !1,
|
|
807
|
-
tree:
|
|
808
|
-
renderNode: ({ level:
|
|
807
|
+
tree: T,
|
|
808
|
+
renderNode: ({ level: z, node: k, expanded: q, hasChildren: U, selected: j, elementProps: B }) => {
|
|
809
809
|
const Z = ae((W) => {
|
|
810
|
-
|
|
811
|
-
}, [
|
|
810
|
+
y(k), B.onClick(W);
|
|
811
|
+
}, [k, 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 && z === 2 ? P : "",
|
|
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(k.label) }),
|
|
836
|
+
k?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e(Q, { color: "blue", children: g().t("archbase:user") }),
|
|
837
|
+
k?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e(Q, { color: "orange", children: g().t("archbase:group") }),
|
|
838
|
+
k?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e(Q, { color: "pink", children: g().t("archbase:profile") })
|
|
839
839
|
]
|
|
840
840
|
}
|
|
841
841
|
);
|
|
@@ -1167,12 +1167,12 @@ function Pe({
|
|
|
1167
1167
|
isLoading: d,
|
|
1168
1168
|
error: u,
|
|
1169
1169
|
getRowId: c,
|
|
1170
|
-
striped:
|
|
1171
|
-
enableRowActions:
|
|
1170
|
+
striped: T = !1,
|
|
1171
|
+
enableRowActions: R = !0,
|
|
1172
1172
|
toolbarLeftContent: m,
|
|
1173
|
-
renderRowActions:
|
|
1173
|
+
renderRowActions: S,
|
|
1174
1174
|
actionsColumnWidth: A,
|
|
1175
|
-
children:
|
|
1175
|
+
children: w
|
|
1176
1176
|
}) {
|
|
1177
1177
|
return /* @__PURE__ */ e(
|
|
1178
1178
|
re,
|
|
@@ -1196,9 +1196,9 @@ function Pe({
|
|
|
1196
1196
|
withBorder: !1,
|
|
1197
1197
|
dataSource: s,
|
|
1198
1198
|
withColumnBorders: !0,
|
|
1199
|
-
striped:
|
|
1199
|
+
striped: T,
|
|
1200
1200
|
enableTopToolbar: !0,
|
|
1201
|
-
enableRowActions:
|
|
1201
|
+
enableRowActions: R,
|
|
1202
1202
|
pageSize: 50,
|
|
1203
1203
|
isLoading: d,
|
|
1204
1204
|
isError: !!u,
|
|
@@ -1206,9 +1206,9 @@ function Pe({
|
|
|
1206
1206
|
enableGlobalFilter: !0,
|
|
1207
1207
|
getRowId: c,
|
|
1208
1208
|
toolbarLeftContent: m,
|
|
1209
|
-
renderRowActions:
|
|
1209
|
+
renderRowActions: S,
|
|
1210
1210
|
actionsColumnWidth: A,
|
|
1211
|
-
children:
|
|
1211
|
+
children: w
|
|
1212
1212
|
}
|
|
1213
1213
|
)
|
|
1214
1214
|
}
|
|
@@ -1222,25 +1222,25 @@ function Ye({
|
|
|
1222
1222
|
removeMessageKey: d,
|
|
1223
1223
|
setOpenedModal: u,
|
|
1224
1224
|
setOpenedPermissionsModal: c,
|
|
1225
|
-
validationContext:
|
|
1226
|
-
t:
|
|
1225
|
+
validationContext: T,
|
|
1226
|
+
t: R
|
|
1227
1227
|
}) {
|
|
1228
|
-
const m = a,
|
|
1228
|
+
const m = a, S = (p) => m.isEmpty() ? null : m.gotoRecordByData(p) ?? null;
|
|
1229
1229
|
return {
|
|
1230
1230
|
handleAdd: () => {
|
|
1231
1231
|
const p = n();
|
|
1232
1232
|
s || (p.id = void 0), m.insert(p), u(t);
|
|
1233
1233
|
},
|
|
1234
1234
|
handleViewRow: (p) => {
|
|
1235
|
-
|
|
1235
|
+
S(p) && u(t);
|
|
1236
1236
|
},
|
|
1237
1237
|
handleEditRow: (p) => {
|
|
1238
|
-
|
|
1238
|
+
S(p) && (m.isEditing() || m.edit(), u(t));
|
|
1239
1239
|
},
|
|
1240
1240
|
handleRemoveRow: (p) => {
|
|
1241
|
-
|
|
1242
|
-
`${
|
|
1243
|
-
`${
|
|
1241
|
+
S(p) && pe.showConfirmDialogYesNo(
|
|
1242
|
+
`${R("archbase:Confirme")}`,
|
|
1243
|
+
`${R(d)}${p.name} ?`,
|
|
1244
1244
|
() => {
|
|
1245
1245
|
m.remove();
|
|
1246
1246
|
},
|
|
@@ -1254,10 +1254,10 @@ function Ye({
|
|
|
1254
1254
|
} catch {
|
|
1255
1255
|
return;
|
|
1256
1256
|
}
|
|
1257
|
-
u(""),
|
|
1257
|
+
u(""), T?.clearAll();
|
|
1258
1258
|
},
|
|
1259
1259
|
handleCancelModal: () => {
|
|
1260
|
-
u(""), m.isBrowsing() || m.cancel(),
|
|
1260
|
+
u(""), m.isBrowsing() || m.cancel(), T?.clearAll();
|
|
1261
1261
|
},
|
|
1262
1262
|
handleOpenPermissionsModal: () => {
|
|
1263
1263
|
c(t);
|
|
@@ -1272,15 +1272,15 @@ function _e({
|
|
|
1272
1272
|
onEditPermissions: d,
|
|
1273
1273
|
before: u,
|
|
1274
1274
|
after: c,
|
|
1275
|
-
t:
|
|
1275
|
+
t: T
|
|
1276
1276
|
}) {
|
|
1277
|
-
const
|
|
1277
|
+
const R = oa(), { colorScheme: m } = qe(), S = m === "dark", A = (w) => S ? R.colors[w][8] : R.colors[w][4];
|
|
1278
1278
|
return /* @__PURE__ */ r(O, { gap: 1, wrap: "nowrap", children: [
|
|
1279
1279
|
u?.(a),
|
|
1280
|
-
/* @__PURE__ */ e(
|
|
1281
|
-
/* @__PURE__ */ e(
|
|
1282
|
-
/* @__PURE__ */ e(
|
|
1283
|
-
/* @__PURE__ */ e(ke, { withinPortal: !0, withArrow: !0, position: "left", label: `${
|
|
1280
|
+
/* @__PURE__ */ e(me, { variant: "transparent", onClick: () => t(a), children: /* @__PURE__ */ e(hr, { size: 20, color: A("blue") }) }),
|
|
1281
|
+
/* @__PURE__ */ e(me, { variant: "transparent", onClick: () => n(a), children: /* @__PURE__ */ e(Pa, { size: 20, color: A("yellow") }) }),
|
|
1282
|
+
/* @__PURE__ */ e(me, { 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: `${T("archbase:Edit permissions")}`, children: /* @__PURE__ */ e(me, { variant: "transparent", onClick: d, children: /* @__PURE__ */ e(pr, { size: 20, color: A("green") }) }) }),
|
|
1284
1284
|
c?.(a)
|
|
1285
1285
|
] });
|
|
1286
1286
|
}
|
|
@@ -1301,18 +1301,18 @@ function mt({
|
|
|
1301
1301
|
options: c
|
|
1302
1302
|
}) {
|
|
1303
1303
|
oa(), ka("securityStore");
|
|
1304
|
-
const
|
|
1304
|
+
const T = rr(), { colorScheme: R } = qe(), [m, S] = x(void 0), [A, w] = x("users"), E = J(K.User), v = J(K.Group), y = J(K.Resource), o = J(K.Profile), [l, p] = x(""), [b, L] = x(""), F = J(K.AccessToken), { t: i } = tr(), D = Re(null), P = Re(null), G = Re(null), f = Re(null), I = Re(null), N = (M) => M.id, ye = (M) => M.id, we = (M) => M.id, z = (M) => M.id, k = (M) => M.id, {
|
|
1305
1305
|
dataSource: q,
|
|
1306
1306
|
isLoading: U,
|
|
1307
1307
|
refreshData: j
|
|
1308
1308
|
} = Ee({
|
|
1309
1309
|
name: "accessTokenApi",
|
|
1310
1310
|
service: F,
|
|
1311
|
-
validator:
|
|
1311
|
+
validator: T,
|
|
1312
1312
|
pageSize: 25,
|
|
1313
1313
|
defaultSortFields: ["user.email", "expirationTime:desc"],
|
|
1314
|
-
onError: (
|
|
1315
|
-
|
|
1314
|
+
onError: (M, te) => {
|
|
1315
|
+
S(M), oe.showError(`${i("archbase:WARNING")}`, M, te);
|
|
1316
1316
|
}
|
|
1317
1317
|
}), {
|
|
1318
1318
|
dataSource: B,
|
|
@@ -1321,10 +1321,10 @@ function mt({
|
|
|
1321
1321
|
} = Ee({
|
|
1322
1322
|
name: "dsUsers",
|
|
1323
1323
|
service: E,
|
|
1324
|
-
validator:
|
|
1324
|
+
validator: T,
|
|
1325
1325
|
pageSize: 25,
|
|
1326
|
-
onError: (
|
|
1327
|
-
|
|
1326
|
+
onError: (M, te) => {
|
|
1327
|
+
S(M), oe.showError(`${i("archbase:WARNING")}`, M, te);
|
|
1328
1328
|
}
|
|
1329
1329
|
}), {
|
|
1330
1330
|
dataSource: le,
|
|
@@ -1332,11 +1332,11 @@ function mt({
|
|
|
1332
1332
|
refreshData: Ze
|
|
1333
1333
|
} = Ee({
|
|
1334
1334
|
name: "dsGroups",
|
|
1335
|
-
service:
|
|
1336
|
-
validator:
|
|
1335
|
+
service: v,
|
|
1336
|
+
validator: T,
|
|
1337
1337
|
pageSize: 25,
|
|
1338
|
-
onError: (
|
|
1339
|
-
|
|
1338
|
+
onError: (M, te) => {
|
|
1339
|
+
S(M), oe.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: T,
|
|
1349
1349
|
pageSize: 25,
|
|
1350
|
-
onError: (
|
|
1351
|
-
|
|
1350
|
+
onError: (M, te) => {
|
|
1351
|
+
S(M), oe.showError(`${i("archbase:WARNING")}`, M, te);
|
|
1352
1352
|
}
|
|
1353
1353
|
}), {
|
|
1354
1354
|
dataSource: $a,
|
|
@@ -1356,97 +1356,97 @@ function mt({
|
|
|
1356
1356
|
refreshData: Ma
|
|
1357
1357
|
} = Ee({
|
|
1358
1358
|
name: "dsResources",
|
|
1359
|
-
service:
|
|
1360
|
-
validator:
|
|
1359
|
+
service: y,
|
|
1360
|
+
validator: T,
|
|
1361
1361
|
pageSize: 25,
|
|
1362
|
-
onError: (
|
|
1363
|
-
|
|
1362
|
+
onError: (M, te) => {
|
|
1363
|
+
S(M), oe.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(), de = Ye({
|
|
1370
1370
|
dataSource: B,
|
|
1371
1371
|
securityType: Y.USER,
|
|
1372
1372
|
newInstance: () => mr.newInstance(),
|
|
1373
1373
|
createEntitiesWithId: n,
|
|
1374
1374
|
removeMessageKey: "archbase:Deseja remover o usuário ",
|
|
1375
1375
|
setOpenedModal: p,
|
|
1376
|
-
setOpenedPermissionsModal:
|
|
1376
|
+
setOpenedPermissionsModal: L,
|
|
1377
1377
|
validationContext: Qe,
|
|
1378
1378
|
t: i
|
|
1379
|
-
}),
|
|
1379
|
+
}), ue = Ye({
|
|
1380
1380
|
dataSource: le,
|
|
1381
1381
|
securityType: Y.GROUP,
|
|
1382
1382
|
newInstance: () => gr.newInstance(),
|
|
1383
1383
|
createEntitiesWithId: n,
|
|
1384
1384
|
removeMessageKey: "archbase:Deseja remover o grupo ",
|
|
1385
1385
|
setOpenedModal: p,
|
|
1386
|
-
setOpenedPermissionsModal:
|
|
1386
|
+
setOpenedPermissionsModal: L,
|
|
1387
1387
|
validationContext: Qe,
|
|
1388
1388
|
t: i
|
|
1389
|
-
}),
|
|
1389
|
+
}), he = Ye({
|
|
1390
1390
|
dataSource: Le,
|
|
1391
1391
|
securityType: Y.PROFILE,
|
|
1392
1392
|
newInstance: () => fr.newInstance(),
|
|
1393
1393
|
createEntitiesWithId: n,
|
|
1394
1394
|
removeMessageKey: "archbase:Deseja remover o perfil ",
|
|
1395
1395
|
setOpenedModal: p,
|
|
1396
|
-
setOpenedPermissionsModal:
|
|
1396
|
+
setOpenedPermissionsModal: L,
|
|
1397
1397
|
validationContext: Qe,
|
|
1398
1398
|
t: i
|
|
1399
|
-
}), qa = (
|
|
1399
|
+
}), qa = (M) => /* @__PURE__ */ e(
|
|
1400
1400
|
_e,
|
|
1401
1401
|
{
|
|
1402
|
-
row:
|
|
1403
|
-
onView:
|
|
1404
|
-
onEdit:
|
|
1405
|
-
onRemove:
|
|
1406
|
-
onEditPermissions:
|
|
1402
|
+
row: M,
|
|
1403
|
+
onView: de.handleViewRow,
|
|
1404
|
+
onEdit: de.handleEditRow,
|
|
1405
|
+
onRemove: de.handleRemoveRow,
|
|
1406
|
+
onEditPermissions: de.handleOpenPermissionsModal,
|
|
1407
1407
|
before: c?.beforeDefaultUserActions,
|
|
1408
1408
|
after: c?.afterDefaultUserActions,
|
|
1409
1409
|
t: i
|
|
1410
1410
|
}
|
|
1411
|
-
), Ha = (
|
|
1411
|
+
), Ha = (M) => /* @__PURE__ */ e(
|
|
1412
1412
|
_e,
|
|
1413
1413
|
{
|
|
1414
|
-
row:
|
|
1415
|
-
onView:
|
|
1416
|
-
onEdit:
|
|
1417
|
-
onRemove:
|
|
1418
|
-
onEditPermissions:
|
|
1414
|
+
row: M,
|
|
1415
|
+
onView: ue.handleViewRow,
|
|
1416
|
+
onEdit: ue.handleEditRow,
|
|
1417
|
+
onRemove: ue.handleRemoveRow,
|
|
1418
|
+
onEditPermissions: ue.handleOpenPermissionsModal,
|
|
1419
1419
|
before: c?.beforeDefaultGroupActions,
|
|
1420
1420
|
after: c?.afterDefaultGroupActions,
|
|
1421
1421
|
t: i
|
|
1422
1422
|
}
|
|
1423
|
-
), ja = (
|
|
1423
|
+
), ja = (M) => /* @__PURE__ */ e(
|
|
1424
1424
|
_e,
|
|
1425
1425
|
{
|
|
1426
|
-
row:
|
|
1427
|
-
onView:
|
|
1428
|
-
onEdit:
|
|
1429
|
-
onRemove:
|
|
1430
|
-
onEditPermissions:
|
|
1426
|
+
row: M,
|
|
1427
|
+
onView: he.handleViewRow,
|
|
1428
|
+
onEdit: he.handleEditRow,
|
|
1429
|
+
onRemove: he.handleRemoveRow,
|
|
1430
|
+
onEditPermissions: he.handleOpenPermissionsModal,
|
|
1431
1431
|
before: c?.beforeDefaultProfileActions,
|
|
1432
1432
|
after: c?.afterDefaultProfileActions,
|
|
1433
1433
|
t: i
|
|
1434
1434
|
}
|
|
1435
1435
|
), Za = () => {
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1436
|
+
const M = q.getCurrentRecord();
|
|
1437
|
+
M && pe.showConfirmDialogYesNo(
|
|
1438
1438
|
`${i("archbase:Confirme")}`,
|
|
1439
|
-
`${i("archbase:Deseja revogar o token de Acesso do usuário ")}${
|
|
1439
|
+
`${i("archbase:Deseja revogar o token de Acesso do usuário ")}${M.user.name} ?`,
|
|
1440
1440
|
async () => {
|
|
1441
|
-
await F.revoke(
|
|
1441
|
+
await F.revoke(M.token).then(async () => {
|
|
1442
1442
|
oe.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
|
+
pe.showErrorWithDetails(
|
|
1448
1448
|
`${i("mentors:Atenção")}`,
|
|
1449
|
-
|
|
1449
|
+
ge(te),
|
|
1450
1450
|
Ve(te)
|
|
1451
1451
|
);
|
|
1452
1452
|
});
|
|
@@ -1455,7 +1455,7 @@ function mt({
|
|
|
1455
1455
|
}
|
|
1456
1456
|
);
|
|
1457
1457
|
}, Ke = () => {
|
|
1458
|
-
|
|
1458
|
+
L("");
|
|
1459
1459
|
}, Qa = () => /* @__PURE__ */ e(Fe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e(O, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e(
|
|
1460
1460
|
X,
|
|
1461
1461
|
{
|
|
@@ -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: w, 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")}` }),
|
|
@@ -1483,13 +1483,13 @@ function mt({
|
|
|
1483
1483
|
dataSource: B,
|
|
1484
1484
|
isLoading: Z,
|
|
1485
1485
|
error: m,
|
|
1486
|
-
getRowId:
|
|
1486
|
+
getRowId: N,
|
|
1487
1487
|
striped: !0,
|
|
1488
1488
|
toolbarLeftContent: /* @__PURE__ */ e(
|
|
1489
1489
|
ea,
|
|
1490
1490
|
{
|
|
1491
|
-
onAdd:
|
|
1492
|
-
onEditPermissions:
|
|
1491
|
+
onAdd: de.handleAdd,
|
|
1492
|
+
onEditPermissions: de.handleOpenPermissionsModal,
|
|
1493
1493
|
t: i
|
|
1494
1494
|
}
|
|
1495
1495
|
),
|
|
@@ -1507,12 +1507,12 @@ function mt({
|
|
|
1507
1507
|
dataSource: le,
|
|
1508
1508
|
isLoading: je,
|
|
1509
1509
|
error: m,
|
|
1510
|
-
getRowId:
|
|
1510
|
+
getRowId: ye,
|
|
1511
1511
|
toolbarLeftContent: /* @__PURE__ */ e(
|
|
1512
1512
|
ea,
|
|
1513
1513
|
{
|
|
1514
|
-
onAdd:
|
|
1515
|
-
onEditPermissions:
|
|
1514
|
+
onAdd: ue.handleAdd,
|
|
1515
|
+
onEditPermissions: ue.handleOpenPermissionsModal,
|
|
1516
1516
|
t: i
|
|
1517
1517
|
}
|
|
1518
1518
|
),
|
|
@@ -1526,7 +1526,7 @@ function mt({
|
|
|
1526
1526
|
{
|
|
1527
1527
|
active: A === "profiles",
|
|
1528
1528
|
printTitle: "Perfis",
|
|
1529
|
-
gridRef:
|
|
1529
|
+
gridRef: G,
|
|
1530
1530
|
dataSource: Le,
|
|
1531
1531
|
isLoading: Na,
|
|
1532
1532
|
error: m,
|
|
@@ -1534,8 +1534,8 @@ function mt({
|
|
|
1534
1534
|
toolbarLeftContent: /* @__PURE__ */ e(
|
|
1535
1535
|
ea,
|
|
1536
1536
|
{
|
|
1537
|
-
onAdd:
|
|
1538
|
-
onEditPermissions:
|
|
1537
|
+
onAdd: he.handleAdd,
|
|
1538
|
+
onEditPermissions: he.handleOpenPermissionsModal,
|
|
1539
1539
|
t: i
|
|
1540
1540
|
}
|
|
1541
1541
|
),
|
|
@@ -1549,11 +1549,11 @@ function mt({
|
|
|
1549
1549
|
{
|
|
1550
1550
|
active: A === "resources",
|
|
1551
1551
|
printTitle: "Recursos",
|
|
1552
|
-
gridRef:
|
|
1552
|
+
gridRef: f,
|
|
1553
1553
|
dataSource: $a,
|
|
1554
1554
|
isLoading: La,
|
|
1555
1555
|
error: m,
|
|
1556
|
-
getRowId:
|
|
1556
|
+
getRowId: z,
|
|
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: I,
|
|
1567
1567
|
dataSource: q,
|
|
1568
1568
|
isLoading: U,
|
|
1569
1569
|
error: m,
|
|
1570
|
-
getRowId:
|
|
1570
|
+
getRowId: k,
|
|
1571
1571
|
striped: !0,
|
|
1572
1572
|
enableRowActions: !1,
|
|
1573
1573
|
toolbarLeftContent: Qa(),
|
|
@@ -1577,54 +1577,54 @@ function mt({
|
|
|
1577
1577
|
l === Y.USER ? /* @__PURE__ */ e(
|
|
1578
1578
|
zr,
|
|
1579
1579
|
{
|
|
1580
|
-
onClickOk:
|
|
1580
|
+
onClickOk: de.handleSaveModal,
|
|
1581
1581
|
opened: !0,
|
|
1582
1582
|
dataSource: B,
|
|
1583
|
-
onClickCancel:
|
|
1583
|
+
onClickCancel: de.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: ue.handleSaveModal,
|
|
1591
1591
|
opened: !0,
|
|
1592
1592
|
dataSource: le,
|
|
1593
|
-
onClickCancel:
|
|
1593
|
+
onClickCancel: ue.handleCancelModal,
|
|
1594
1594
|
options: u
|
|
1595
1595
|
}
|
|
1596
1596
|
) : null,
|
|
1597
1597
|
l === Y.PROFILE ? /* @__PURE__ */ e(
|
|
1598
1598
|
xr,
|
|
1599
1599
|
{
|
|
1600
|
-
onClickOk:
|
|
1600
|
+
onClickOk: he.handleSaveModal,
|
|
1601
1601
|
opened: !0,
|
|
1602
1602
|
dataSource: Le,
|
|
1603
|
-
onClickCancel:
|
|
1603
|
+
onClickCancel: he.handleCancelModal,
|
|
1604
1604
|
options: d
|
|
1605
1605
|
}
|
|
1606
1606
|
) : null,
|
|
1607
|
-
|
|
1607
|
+
b === Y.USER ? /* @__PURE__ */ e(
|
|
1608
1608
|
Xe,
|
|
1609
1609
|
{
|
|
1610
1610
|
dataSource: B,
|
|
1611
|
-
opened: !!
|
|
1611
|
+
opened: !!b,
|
|
1612
1612
|
close: Ke
|
|
1613
1613
|
}
|
|
1614
1614
|
) : null,
|
|
1615
|
-
|
|
1615
|
+
b === Y.GROUP ? /* @__PURE__ */ e(
|
|
1616
1616
|
Xe,
|
|
1617
1617
|
{
|
|
1618
1618
|
dataSource: le,
|
|
1619
|
-
opened: !!
|
|
1619
|
+
opened: !!b,
|
|
1620
1620
|
close: Ke
|
|
1621
1621
|
}
|
|
1622
1622
|
) : null,
|
|
1623
|
-
|
|
1623
|
+
b === Y.PROFILE ? /* @__PURE__ */ e(
|
|
1624
1624
|
Xe,
|
|
1625
1625
|
{
|
|
1626
1626
|
dataSource: Le,
|
|
1627
|
-
opened: !!
|
|
1627
|
+
opened: !!b,
|
|
1628
1628
|
close: Ke
|
|
1629
1629
|
}
|
|
1630
1630
|
) : null
|
|
@@ -1632,17 +1632,17 @@ 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: d } = qe(), [u, c] =
|
|
1635
|
+
const n = ka("apiTokenStore"), s = { validateEntity: () => [] }, { colorScheme: d } = qe(), [u, c] = x(void 0), T = J(K.ApiToken), [R, m] = x(""), S = Re(null), A = (P) => P.id, { dataSource: w } = dr({
|
|
1636
1636
|
initialData: [],
|
|
1637
1637
|
name: "dataSource"
|
|
1638
1638
|
}), E = Ne(
|
|
1639
1639
|
"ArchbaseApiTokenView-LocalDataSource",
|
|
1640
|
-
|
|
1640
|
+
w,
|
|
1641
1641
|
void 0,
|
|
1642
1642
|
void 0
|
|
1643
|
-
), { dataSource:
|
|
1643
|
+
), { dataSource: v, isLoading: y } = ta({
|
|
1644
1644
|
name: "dsApiToken",
|
|
1645
|
-
service:
|
|
1645
|
+
service: T,
|
|
1646
1646
|
store: n,
|
|
1647
1647
|
validator: s,
|
|
1648
1648
|
pageSize: 25,
|
|
@@ -1651,12 +1651,12 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1651
1651
|
},
|
|
1652
1652
|
onDestroy: (P) => {
|
|
1653
1653
|
},
|
|
1654
|
-
onError: (P,
|
|
1655
|
-
c(P), oe.showError(g().t("archbase:WARNING"), P,
|
|
1654
|
+
onError: (P, G) => {
|
|
1655
|
+
c(P), oe.showError(g().t("archbase:WARNING"), P, G);
|
|
1656
1656
|
}
|
|
1657
1657
|
}), o = Ne(
|
|
1658
1658
|
"ArchbaseApiTokenView-RemoteDataSource",
|
|
1659
|
-
|
|
1659
|
+
v,
|
|
1660
1660
|
void 0,
|
|
1661
1661
|
void 0
|
|
1662
1662
|
), l = `calc(${a} - 40px)`, p = /* @__PURE__ */ r(Ie, { children: [
|
|
@@ -1750,14 +1750,14 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1750
1750
|
render: (P) => {
|
|
1751
1751
|
if (!P.row.expirationDate)
|
|
1752
1752
|
return /* @__PURE__ */ e(h, { c: "dimmed", children: "Sem expiração" });
|
|
1753
|
-
const
|
|
1754
|
-
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1757
|
-
const
|
|
1758
|
-
let we = Math.max(0, Math.min(100,
|
|
1759
|
-
|
|
1760
|
-
const q =
|
|
1753
|
+
const G = /* @__PURE__ */ new Date();
|
|
1754
|
+
G.setHours(0, 0, 0, 0);
|
|
1755
|
+
const f = new Date(P.row.expirationDate);
|
|
1756
|
+
f.setHours(0, 0, 0, 0);
|
|
1757
|
+
const I = f.getTime() - G.getTime(), N = Math.ceil(I / (1e3 * 60 * 60 * 24));
|
|
1758
|
+
let we = Math.max(0, Math.min(100, N / 365 * 100)), z = "green", k = "";
|
|
1759
|
+
N < 0 ? (z = "red", we = 100, k = `Vencido há ${Math.abs(N)} dia${Math.abs(N) !== 1 ? "s" : ""}`) : N === 0 ? (z = "red", we = 5, k = "Vence hoje") : N <= 7 ? (z = "red", k = `${N} dia${N !== 1 ? "s" : ""}`) : N <= 30 ? (z = "orange", k = `${N} dias`) : N <= 90 ? (z = "yellow", k = `${N} dias`) : (z = "green", k = `${N} dias`);
|
|
1760
|
+
const q = N < 0 ? `Vencido em ${f.toLocaleDateString()}` : `Expira em ${f.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: N < 0 ? 100 : we, color: z }]
|
|
1769
1769
|
}
|
|
1770
1770
|
),
|
|
1771
|
-
/* @__PURE__ */ e(h, { size: "sm", c:
|
|
1771
|
+
/* @__PURE__ */ e(h, { size: "sm", c: N < 0 ? "red" : void 0, fw: N <= 7 ? 600 : void 0, children: k })
|
|
1772
1772
|
] }) });
|
|
1773
1773
|
},
|
|
1774
1774
|
inputFilterType: "text"
|
|
@@ -1792,22 +1792,22 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1792
1792
|
inputFilterType: "checkbox"
|
|
1793
1793
|
}
|
|
1794
1794
|
)
|
|
1795
|
-
] }),
|
|
1796
|
-
|
|
1797
|
-
},
|
|
1798
|
-
|
|
1795
|
+
] }), b = () => {
|
|
1796
|
+
w.insert(br.newInstance()), w && !E.isDataSourceV2 && E.v1State.forceUpdate(), m("apiToken");
|
|
1797
|
+
}, L = () => {
|
|
1798
|
+
v.getCurrentRecord() && pe.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 ")}${v.getCurrentRecord().user.name} ?`,
|
|
1801
1801
|
async () => {
|
|
1802
|
-
await
|
|
1802
|
+
await T.revoke(v.getCurrentRecord().token).then(async () => {
|
|
1803
1803
|
oe.showSuccess(
|
|
1804
1804
|
`${g().t("mentors:Informação")}`,
|
|
1805
1805
|
`${g().t("mentors:Token de API revogado com sucesso!")}`
|
|
1806
|
-
),
|
|
1806
|
+
), v.refreshData(), v && !o.isDataSourceV2 && o.v1State.forceUpdate();
|
|
1807
1807
|
}).catch((P) => {
|
|
1808
|
-
|
|
1808
|
+
pe.showErrorWithDetails(
|
|
1809
1809
|
`${g().t("mentors:Atenção")}`,
|
|
1810
|
-
|
|
1810
|
+
ge(P),
|
|
1811
1811
|
Ve(P)
|
|
1812
1812
|
);
|
|
1813
1813
|
});
|
|
@@ -1817,35 +1817,35 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1817
1817
|
);
|
|
1818
1818
|
}, F = () => {
|
|
1819
1819
|
m("");
|
|
1820
|
-
}, i = async (P,
|
|
1821
|
-
const
|
|
1822
|
-
if (
|
|
1820
|
+
}, i = async (P, G) => {
|
|
1821
|
+
const f = w.getCurrentRecord();
|
|
1822
|
+
if (f)
|
|
1823
1823
|
try {
|
|
1824
|
-
if (
|
|
1825
|
-
|
|
1824
|
+
if (w.validate(), !f.user || !f.user.email) {
|
|
1825
|
+
pe.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 T.create(f.user.email, f.expirationDate, f.name, f.description).then(async (I) => {
|
|
1833
|
+
w.cancel(), w && !E.isDataSourceV2 && E.v1State.forceUpdate(), v.append(I), v && !o.isDataSourceV2 && o.v1State.forceUpdate(), oe.showSuccess(
|
|
1834
1834
|
`${g().t("mentors:Informação")}`,
|
|
1835
1835
|
`${g().t("mentors:Token de API gerado com sucesso!")}`
|
|
1836
|
-
),
|
|
1837
|
-
}).catch((
|
|
1838
|
-
|
|
1836
|
+
), G && G(!0);
|
|
1837
|
+
}).catch((I) => {
|
|
1838
|
+
pe.showErrorWithDetails(
|
|
1839
1839
|
`${g().t("mentors:Atenção")}`,
|
|
1840
|
-
|
|
1841
|
-
Ve(
|
|
1840
|
+
ge(I),
|
|
1841
|
+
Ve(I)
|
|
1842
1842
|
);
|
|
1843
1843
|
});
|
|
1844
|
-
} catch (
|
|
1845
|
-
|
|
1844
|
+
} catch (I) {
|
|
1845
|
+
pe.showErrorWithDetails(
|
|
1846
1846
|
`${g().t("mentors:Atenção")}`,
|
|
1847
|
-
|
|
1848
|
-
Ve(
|
|
1847
|
+
ge(I),
|
|
1848
|
+
Ve(I)
|
|
1849
1849
|
);
|
|
1850
1850
|
}
|
|
1851
1851
|
};
|
|
@@ -1865,37 +1865,37 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1865
1865
|
children: /* @__PURE__ */ e(
|
|
1866
1866
|
za,
|
|
1867
1867
|
{
|
|
1868
|
-
gridRef:
|
|
1868
|
+
gridRef: S,
|
|
1869
1869
|
printTitle: "Tokens de API",
|
|
1870
1870
|
width: "100%",
|
|
1871
1871
|
height: "100%",
|
|
1872
1872
|
withBorder: !1,
|
|
1873
|
-
dataSource:
|
|
1873
|
+
dataSource: v,
|
|
1874
1874
|
withColumnBorders: !0,
|
|
1875
1875
|
striped: !0,
|
|
1876
1876
|
enableTopToolbar: !0,
|
|
1877
1877
|
enableRowActions: !1,
|
|
1878
1878
|
pageSize: 50,
|
|
1879
|
-
isLoading:
|
|
1879
|
+
isLoading: y,
|
|
1880
1880
|
isError: !!u,
|
|
1881
1881
|
error: u,
|
|
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
|
-
/* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Fa, {}), onClick:
|
|
1886
|
-
/* @__PURE__ */ e(X, { disabled: !
|
|
1885
|
+
/* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Fa, {}), onClick: b, children: g().t("archbase:New") }),
|
|
1886
|
+
/* @__PURE__ */ e(X, { disabled: !v.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e(na, {}), onClick: L, children: g().t("archbase:Revoke") })
|
|
1887
1887
|
] }) }),
|
|
1888
1888
|
children: p
|
|
1889
1889
|
}
|
|
1890
1890
|
)
|
|
1891
1891
|
}
|
|
1892
1892
|
),
|
|
1893
|
-
|
|
1893
|
+
R === "apiToken" ? /* @__PURE__ */ e(
|
|
1894
1894
|
Er,
|
|
1895
1895
|
{
|
|
1896
1896
|
onClickOk: F,
|
|
1897
1897
|
opened: !0,
|
|
1898
|
-
dataSource:
|
|
1898
|
+
dataSource: w,
|
|
1899
1899
|
onCustomSave: i,
|
|
1900
1900
|
onClickCancel: F
|
|
1901
1901
|
}
|
|
@@ -1932,7 +1932,7 @@ const Ue = (a) => {
|
|
|
1932
1932
|
borderLeft: `3px solid var(--mantine-color-${Ue(a.severity)}-6)`,
|
|
1933
1933
|
cursor: n ? "pointer" : void 0
|
|
1934
1934
|
},
|
|
1935
|
-
children: /* @__PURE__ */ r(
|
|
1935
|
+
children: /* @__PURE__ */ r(V, { gap: 4, children: [
|
|
1936
1936
|
/* @__PURE__ */ r(O, { gap: 8, align: "baseline", wrap: "wrap", children: [
|
|
1937
1937
|
/* @__PURE__ */ e(h, { fw: 600, size: "1.7rem", lh: 1.05, c: Ue(a.severity), children: a.value }),
|
|
1938
1938
|
a.of ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: a.of }) : null
|
|
@@ -1942,53 +1942,53 @@ const Ue = (a) => {
|
|
|
1942
1942
|
] })
|
|
1943
1943
|
}
|
|
1944
1944
|
);
|
|
1945
|
-
}, Vr = ({ cards: a, onOpenCard: t }) => /* @__PURE__ */ e(He, { cols: { base: 1, sm: 2, lg: 3, xl: 4 }, spacing: "xs", children: a.map((n, s) => /* @__PURE__ */ e(Mr, { card: n, onOpen: t }, `${n.label}-${s}`)) }), Gr = ({ flags: a }) => /* @__PURE__ */ e(He, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: a.map((t) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(
|
|
1945
|
+
}, Vr = ({ cards: a, onOpenCard: t }) => /* @__PURE__ */ e(He, { cols: { base: 1, sm: 2, lg: 3, xl: 4 }, spacing: "xs", children: a.map((n, s) => /* @__PURE__ */ e(Mr, { card: n, onOpen: t }, `${n.label}-${s}`)) }), Gr = ({ flags: a }) => /* @__PURE__ */ e(He, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: a.map((t) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(V, { gap: 3, children: [
|
|
1946
1946
|
/* @__PURE__ */ e(h, { size: "10px", c: "dimmed", ff: "monospace", style: { wordBreak: "break-all" }, children: t.key }),
|
|
1947
1947
|
/* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
|
|
1948
1948
|
/* @__PURE__ */ e(Q, { size: "xs", circle: !0, color: Ue(t.severity) }),
|
|
1949
1949
|
/* @__PURE__ */ e(h, { size: "sm", fw: 550, children: t.value })
|
|
1950
1950
|
] }),
|
|
1951
1951
|
t.description ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", lh: 1.4, children: t.description }) : null
|
|
1952
|
-
] }) }, t.key)) }), Ur = ({ attributes: a }) => /* @__PURE__ */ e(
|
|
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}`)) }), ve = ({ 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(ce.Autosize, { mah: t, type: "hover", offsetScrollbars: !0, children: /* @__PURE__ */ e(
|
|
1961
|
+
] }), Oe = ({ children: a, maxHeight: t = 420 }) => /* @__PURE__ */ e(ce.Autosize, { mah: t, type: "hover", offsetScrollbars: !0, children: /* @__PURE__ */ e(C.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, d] =
|
|
1964
|
+
), [s, d] = x([]), [u, c] = x(1), [T, R] = x(1), [m, S] = x(0), [A, w] = x(!1), [E, v] = x(null), y = a?.metric;
|
|
1965
1965
|
return ee(() => {
|
|
1966
1966
|
c(1);
|
|
1967
|
-
}, [
|
|
1968
|
-
if (!
|
|
1967
|
+
}, [y]), ee(() => {
|
|
1968
|
+
if (!y)
|
|
1969
1969
|
return;
|
|
1970
1970
|
let o = !1;
|
|
1971
|
-
return
|
|
1972
|
-
o || (d(l.content ?? []),
|
|
1971
|
+
return w(!0), v(null), n.getOverviewItems(y, u - 1, Br).then((l) => {
|
|
1972
|
+
o || (d(l.content ?? []), S(l.totalElements ?? 0), R(Math.max(l.totalPages ?? 1, 1)));
|
|
1973
1973
|
}).catch((l) => {
|
|
1974
|
-
o ||
|
|
1974
|
+
o || v(l instanceof Error ? l.message : "Não foi possível carregar os itens.");
|
|
1975
1975
|
}).finally(() => {
|
|
1976
|
-
o ||
|
|
1976
|
+
o || w(!1);
|
|
1977
1977
|
}), () => {
|
|
1978
1978
|
o = !0;
|
|
1979
1979
|
};
|
|
1980
|
-
}, [n,
|
|
1980
|
+
}, [n, y, u]), /* @__PURE__ */ e(
|
|
1981
1981
|
Ja,
|
|
1982
1982
|
{
|
|
1983
1983
|
opened: !!a,
|
|
1984
1984
|
onClose: t,
|
|
1985
1985
|
position: "right",
|
|
1986
1986
|
size: "xl",
|
|
1987
|
-
title: /* @__PURE__ */ r(
|
|
1987
|
+
title: /* @__PURE__ */ r(V, { gap: 2, children: [
|
|
1988
1988
|
/* @__PURE__ */ e(h, { fw: 600, children: a?.label }),
|
|
1989
1989
|
a?.description ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", lh: 1.4, children: a.description }) : null
|
|
1990
1990
|
] }),
|
|
1991
|
-
children: /* @__PURE__ */ r(
|
|
1991
|
+
children: /* @__PURE__ */ r(V, { gap: "sm", children: [
|
|
1992
1992
|
/* @__PURE__ */ r(O, { gap: 8, children: [
|
|
1993
1993
|
/* @__PURE__ */ r(Q, { variant: "light", children: [
|
|
1994
1994
|
m,
|
|
@@ -1997,26 +1997,26 @@ const Ue = (a) => {
|
|
|
1997
1997
|
] }),
|
|
1998
1998
|
A ? /* @__PURE__ */ e(se, { size: "xs" }) : null
|
|
1999
1999
|
] }),
|
|
2000
|
-
E ? /* @__PURE__ */ e(
|
|
2000
|
+
E ? /* @__PURE__ */ e(be, { color: "red", title: "Erro ao carregar", children: E }) : null,
|
|
2001
2001
|
!A && !E && 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(C, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2007
|
+
/* @__PURE__ */ e(C.Thead, { children: /* @__PURE__ */ r(C.Tr, { children: [
|
|
2008
|
+
/* @__PURE__ */ e(C.Th, { children: "Item" }),
|
|
2009
|
+
/* @__PURE__ */ e(C.Th, { children: "Onde" }),
|
|
2010
|
+
/* @__PURE__ */ e(C.Th, { children: "Por que está aqui" })
|
|
2011
2011
|
] }) }),
|
|
2012
|
-
/* @__PURE__ */ e(
|
|
2013
|
-
/* @__PURE__ */ e(
|
|
2014
|
-
/* @__PURE__ */ e(
|
|
2015
|
-
/* @__PURE__ */ e(
|
|
2012
|
+
/* @__PURE__ */ e(C.Tbody, { children: s.map((o) => /* @__PURE__ */ r(C.Tr, { children: [
|
|
2013
|
+
/* @__PURE__ */ e(C.Td, { children: /* @__PURE__ */ e(h, { size: "sm", fw: 550, children: o.label }) }),
|
|
2014
|
+
/* @__PURE__ */ e(C.Td, { children: /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: o.detail }) }),
|
|
2015
|
+
/* @__PURE__ */ e(C.Td, { children: /* @__PURE__ */ e(h, { size: "xs", children: o.reason }) })
|
|
2016
2016
|
] }, o.id)) })
|
|
2017
2017
|
] }) })
|
|
2018
2018
|
) : null,
|
|
2019
|
-
|
|
2019
|
+
T > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(Xa, { value: u, onChange: c, total: T, size: "sm" }) }) : null
|
|
2020
2020
|
] })
|
|
2021
2021
|
}
|
|
2022
2022
|
);
|
|
@@ -2104,15 +2104,15 @@ const Ue = (a) => {
|
|
|
2104
2104
|
], ba = ({ slots: a, onError: t }) => {
|
|
2105
2105
|
const n = J(
|
|
2106
2106
|
K.SecurityDiagnostics
|
|
2107
|
-
), [s, d] =
|
|
2107
|
+
), [s, d] = x(void 0), [u, c] = x(!0), [T, R] = x(void 0), [m, S] = x(null);
|
|
2108
2108
|
ee(() => {
|
|
2109
2109
|
let E = !0;
|
|
2110
|
-
return c(!0), n.getOverview().then((
|
|
2111
|
-
E && (d(
|
|
2112
|
-
}).catch((
|
|
2110
|
+
return c(!0), n.getOverview().then((v) => {
|
|
2111
|
+
E && (d(v), R(void 0));
|
|
2112
|
+
}).catch((v) => {
|
|
2113
2113
|
if (E) {
|
|
2114
|
-
const
|
|
2115
|
-
|
|
2114
|
+
const y = ge(v);
|
|
2115
|
+
R(y), t?.(y);
|
|
2116
2116
|
}
|
|
2117
2117
|
}).finally(() => {
|
|
2118
2118
|
E && c(!1);
|
|
@@ -2123,23 +2123,23 @@ const Ue = (a) => {
|
|
|
2123
2123
|
const A = ie(
|
|
2124
2124
|
() => s ? [...Hr(s), ...a?.additionalFlags?.(s) ?? []] : [],
|
|
2125
2125
|
[s, a]
|
|
2126
|
-
),
|
|
2126
|
+
), w = ie(
|
|
2127
2127
|
() => s ? [...jr(s), ...a?.additionalOverviewCards?.(s) ?? []] : [],
|
|
2128
2128
|
[s, a]
|
|
2129
2129
|
);
|
|
2130
|
-
return u ? /* @__PURE__ */ e(se, { size: "sm" }) :
|
|
2131
|
-
/* @__PURE__ */ r(
|
|
2130
|
+
return u ? /* @__PURE__ */ e(se, { size: "sm" }) : T ? /* @__PURE__ */ e(be, { color: "red", title: "Não foi possível ler o diagnóstico", children: T }) : s ? /* @__PURE__ */ r(V, { gap: "lg", children: [
|
|
2131
|
+
/* @__PURE__ */ r(ve, { 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(ve, { title: "Catálogo e concessões", hint: "contagens vivas", children: /* @__PURE__ */ e(Vr, { cards: w, onOpenCard: S }) }),
|
|
2136
2136
|
a?.afterOverview?.(s),
|
|
2137
|
-
/* @__PURE__ */ e(Wr, { card: m, onClose: () =>
|
|
2137
|
+
/* @__PURE__ */ e(Wr, { card: m, onClose: () => S(null) })
|
|
2138
2138
|
] }) : null;
|
|
2139
2139
|
}, Be = ({ value: a, onChange: t, assunto: n, visiveis: s, total: d }) => {
|
|
2140
2140
|
const u = typeof s == "number" && typeof d == "number" && s < d;
|
|
2141
2141
|
return /* @__PURE__ */ e(
|
|
2142
|
-
|
|
2142
|
+
fe,
|
|
2143
2143
|
{
|
|
2144
2144
|
size: "xs",
|
|
2145
2145
|
value: a,
|
|
@@ -2151,10 +2151,10 @@ const Ue = (a) => {
|
|
|
2151
2151
|
}
|
|
2152
2152
|
);
|
|
2153
2153
|
}, Zr = /[̀-ͯ]/g, va = (a) => a.toLocaleLowerCase().normalize("NFD").replace(Zr, ""), We = (a, t) => {
|
|
2154
|
-
const [n, s] =
|
|
2154
|
+
const [n, s] = x(""), d = ie(() => {
|
|
2155
2155
|
const u = va(n.trim());
|
|
2156
2156
|
return u ? a.filter(
|
|
2157
|
-
(c) => t(c).some((
|
|
2157
|
+
(c) => t(c).some((T) => T ? va(T).includes(u) : !1)
|
|
2158
2158
|
) : a;
|
|
2159
2159
|
}, [a, n]);
|
|
2160
2160
|
return { filtro: n, setFiltro: s, filtrados: d };
|
|
@@ -2171,17 +2171,17 @@ const Ue = (a) => {
|
|
|
2171
2171
|
], Jr = ({ slots: a, onError: t, userId: n }) => {
|
|
2172
2172
|
const s = J(
|
|
2173
2173
|
K.SecurityDiagnostics
|
|
2174
|
-
), [d, u] =
|
|
2174
|
+
), [d, u] = x(""), [c, T] = x(void 0), [R, m] = x(!1), [S, A] = x(void 0), [w, E] = x("all"), v = !!n, y = ae(
|
|
2175
2175
|
async (i) => {
|
|
2176
2176
|
const D = i.trim();
|
|
2177
2177
|
if (D) {
|
|
2178
2178
|
m(!0), A(void 0);
|
|
2179
2179
|
try {
|
|
2180
2180
|
const P = D.includes("@") ? await s.getEffectiveAccessByEmail(D) : await s.getEffectiveAccessByUserId(D);
|
|
2181
|
-
|
|
2181
|
+
T(P);
|
|
2182
2182
|
} catch (P) {
|
|
2183
|
-
const
|
|
2184
|
-
A(
|
|
2183
|
+
const G = ge(P);
|
|
2184
|
+
A(G), t?.(G), T(void 0);
|
|
2185
2185
|
} finally {
|
|
2186
2186
|
m(!1);
|
|
2187
2187
|
}
|
|
@@ -2192,21 +2192,21 @@ const Ue = (a) => {
|
|
|
2192
2192
|
{ label: "Perfil", value: c.profileName || "—" },
|
|
2193
2193
|
{ label: "Grupos", value: c.groupNames.length ? c.groupNames.join(", ") : "—" },
|
|
2194
2194
|
...a?.userAttributes?.(c) ?? []
|
|
2195
|
-
] : [], [c, a]), l = ie(() => c ?
|
|
2195
|
+
] : [], [c, a]), l = ie(() => c ? w === "all" ? c.capabilities : w === "inherited" ? c.capabilities.filter((i) => i.grantedByType !== "USER") : c.capabilities.filter((i) => i.situation === w) : [], [c, w]), {
|
|
2196
2196
|
filtro: p,
|
|
2197
|
-
setFiltro:
|
|
2198
|
-
filtrados:
|
|
2197
|
+
setFiltro: b,
|
|
2198
|
+
filtrados: L
|
|
2199
2199
|
} = We(l, (i) => [i.resource, i.action, i.grantedByName]);
|
|
2200
2200
|
ee(() => {
|
|
2201
|
-
n && (E("all"),
|
|
2202
|
-
}, [n,
|
|
2201
|
+
n && (E("all"), y(n));
|
|
2202
|
+
}, [n, y]);
|
|
2203
2203
|
const F = a?.additionalCapabilityColumns ?? [];
|
|
2204
|
-
return /* @__PURE__ */ r(
|
|
2205
|
-
|
|
2206
|
-
u(i),
|
|
2204
|
+
return /* @__PURE__ */ r(V, { gap: "lg", children: [
|
|
2205
|
+
v ? null : /* @__PURE__ */ e(ve, { title: "Consultar", hint: "por e-mail ou id do usuário", children: a?.renderUserSearch ? a.renderUserSearch((i) => {
|
|
2206
|
+
u(i), y(i);
|
|
2207
2207
|
}) : /* @__PURE__ */ r(O, { gap: "xs", align: "flex-end", children: [
|
|
2208
2208
|
/* @__PURE__ */ e(
|
|
2209
|
-
|
|
2209
|
+
fe,
|
|
2210
2210
|
{
|
|
2211
2211
|
style: { flex: 1, minWidth: 240 },
|
|
2212
2212
|
label: "Usuário",
|
|
@@ -2214,16 +2214,16 @@ const Ue = (a) => {
|
|
|
2214
2214
|
value: d,
|
|
2215
2215
|
onChange: (i) => u(i.currentTarget.value),
|
|
2216
2216
|
onKeyDown: (i) => {
|
|
2217
|
-
i.key === "Enter" &&
|
|
2217
|
+
i.key === "Enter" && y(d);
|
|
2218
2218
|
}
|
|
2219
2219
|
}
|
|
2220
2220
|
),
|
|
2221
|
-
/* @__PURE__ */ e(X, { onClick: () => void
|
|
2221
|
+
/* @__PURE__ */ e(X, { onClick: () => void y(d), loading: R, children: "Consultar" })
|
|
2222
2222
|
] }) }),
|
|
2223
|
-
|
|
2224
|
-
|
|
2223
|
+
S ? /* @__PURE__ */ e(be, { color: "red", title: "Não foi possível ler o efetivo", children: S }) : null,
|
|
2224
|
+
R && !c ? /* @__PURE__ */ e(se, { size: "sm" }) : null,
|
|
2225
2225
|
c ? /* @__PURE__ */ r(xe, { children: [
|
|
2226
|
-
/* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(
|
|
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
2228
|
/* @__PURE__ */ e(h, { fw: 620, children: c.userLabel }),
|
|
2229
2229
|
c.administrator ? /* @__PURE__ */ e(Q, { color: "red", children: "administrador" }) : null,
|
|
@@ -2232,7 +2232,7 @@ const Ue = (a) => {
|
|
|
2232
2232
|
] }),
|
|
2233
2233
|
/* @__PURE__ */ e(Ur, { attributes: o })
|
|
2234
2234
|
] }) }),
|
|
2235
|
-
c.administrator ? /* @__PURE__ */ r(
|
|
2235
|
+
c.administrator ? /* @__PURE__ */ r(be, { 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."
|
|
@@ -2242,48 +2242,48 @@ const Ue = (a) => {
|
|
|
2242
2242
|
["efetivas", c.effective, "ok"],
|
|
2243
2243
|
["inertes", c.inert, "warning"],
|
|
2244
2244
|
["negadas", c.denied, "critical"]
|
|
2245
|
-
].map(([i, D, P]) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(
|
|
2245
|
+
].map(([i, D, P]) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(V, { gap: 2, children: [
|
|
2246
2246
|
/* @__PURE__ */ e(h, { size: "1.3rem", fw: 620, c: Ue(P), children: D }),
|
|
2247
2247
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: i })
|
|
2248
2248
|
] }) }, i)) }),
|
|
2249
2249
|
a?.afterEffectiveTally?.(c),
|
|
2250
|
-
/* @__PURE__ */ r(
|
|
2251
|
-
/* @__PURE__ */ e(ua.Group, { multiple: !1, value:
|
|
2250
|
+
/* @__PURE__ */ r(ve, { title: "Capacidades", hint: `${c.capabilities.length} no total`, children: [
|
|
2251
|
+
/* @__PURE__ */ e(ua.Group, { multiple: !1, value: w, onChange: (i) => E(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
|
{
|
|
2255
2255
|
value: p,
|
|
2256
|
-
onChange:
|
|
2256
|
+
onChange: b,
|
|
2257
2257
|
assunto: "capacidades",
|
|
2258
|
-
visiveis:
|
|
2258
|
+
visiveis: L.length,
|
|
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
|
-
F.map((i) => /* @__PURE__ */ e(
|
|
2262
|
+
/* @__PURE__ */ e(Oe, { maxHeight: "calc(100vh - 460px)", children: /* @__PURE__ */ r(C, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2263
|
+
/* @__PURE__ */ e(C.Thead, { children: /* @__PURE__ */ r(C.Tr, { children: [
|
|
2264
|
+
/* @__PURE__ */ e(C.Th, { children: "Capacidade" }),
|
|
2265
|
+
/* @__PURE__ */ e(C.Th, { children: "Origem" }),
|
|
2266
|
+
/* @__PURE__ */ e(C.Th, { children: "Situação" }),
|
|
2267
|
+
F.map((i) => /* @__PURE__ */ e(C.Th, { children: i.header }, i.header))
|
|
2268
2268
|
] }) }),
|
|
2269
|
-
/* @__PURE__ */ r(
|
|
2270
|
-
|
|
2271
|
-
/* @__PURE__ */ e(
|
|
2269
|
+
/* @__PURE__ */ r(C.Tbody, { children: [
|
|
2270
|
+
L.map((i, D) => /* @__PURE__ */ r(C.Tr, { children: [
|
|
2271
|
+
/* @__PURE__ */ e(C.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(C.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
|
-
F.map((P) => /* @__PURE__ */ e(
|
|
2283
|
+
/* @__PURE__ */ e(C.Td, { children: /* @__PURE__ */ e(Q, { color: ya[i.situation].color, variant: "light", children: ya[i.situation].label }) }),
|
|
2284
|
+
F.map((P) => /* @__PURE__ */ e(C.Td, { children: P.render(i, c) }, P.header))
|
|
2285
2285
|
] }, `${i.resource}:${i.action}:${D}`)),
|
|
2286
|
-
l.length === 0 ? /* @__PURE__ */ e(
|
|
2286
|
+
l.length === 0 ? /* @__PURE__ */ e(C.Tr, { children: /* @__PURE__ */ e(C.Td, { colSpan: 3 + F.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
|
] })
|
|
@@ -2299,14 +2299,14 @@ const Ue = (a) => {
|
|
|
2299
2299
|
}) => {
|
|
2300
2300
|
const c = J(
|
|
2301
2301
|
K.SecurityDiagnostics
|
|
2302
|
-
), [
|
|
2303
|
-
async (
|
|
2304
|
-
p(!0),
|
|
2302
|
+
), [T, R] = x(!1), [m, S] = x(""), [A, w] = x([]), [E, v] = x({}), [y, o] = x(), [l, p] = x(!1), [b, L] = x(), F = ae(
|
|
2303
|
+
async (f) => {
|
|
2304
|
+
p(!0), L(void 0);
|
|
2305
2305
|
try {
|
|
2306
|
-
const
|
|
2307
|
-
|
|
2308
|
-
} catch (
|
|
2309
|
-
|
|
2306
|
+
const I = await c.browse(s, { q: f || void 0, page: 0, size: wa });
|
|
2307
|
+
w(I.content ?? []);
|
|
2308
|
+
} catch (I) {
|
|
2309
|
+
L(I instanceof Error ? I.message : "Não foi possível carregar.");
|
|
2310
2310
|
} finally {
|
|
2311
2311
|
p(!1);
|
|
2312
2312
|
}
|
|
@@ -2314,71 +2314,72 @@ const Ue = (a) => {
|
|
|
2314
2314
|
[c, s]
|
|
2315
2315
|
);
|
|
2316
2316
|
ee(() => {
|
|
2317
|
-
if (!
|
|
2317
|
+
if (!T)
|
|
2318
2318
|
return;
|
|
2319
|
-
const
|
|
2320
|
-
return () => clearTimeout(
|
|
2321
|
-
}, [
|
|
2319
|
+
const f = setTimeout(() => void F(m), m ? 300 : 0);
|
|
2320
|
+
return () => clearTimeout(f);
|
|
2321
|
+
}, [T, m, F]);
|
|
2322
2322
|
const i = ae(
|
|
2323
|
-
async (
|
|
2324
|
-
if (
|
|
2323
|
+
async (f) => {
|
|
2324
|
+
if (y === f.id) {
|
|
2325
2325
|
o(void 0);
|
|
2326
2326
|
return;
|
|
2327
2327
|
}
|
|
2328
|
-
if (o(
|
|
2328
|
+
if (o(f.id), !E[f.id])
|
|
2329
2329
|
try {
|
|
2330
|
-
const
|
|
2331
|
-
|
|
2332
|
-
} catch (
|
|
2333
|
-
|
|
2330
|
+
const I = await c.browse(s, { parentId: f.id, page: 0, size: wa });
|
|
2331
|
+
v((N) => ({ ...N, [f.id]: I.content ?? [] }));
|
|
2332
|
+
} catch (I) {
|
|
2333
|
+
L(I instanceof Error ? I.message : "Não foi possível abrir.");
|
|
2334
2334
|
}
|
|
2335
2335
|
},
|
|
2336
|
-
[c, s,
|
|
2337
|
-
), D = (
|
|
2338
|
-
u(
|
|
2339
|
-
}, P = (
|
|
2340
|
-
const N =
|
|
2341
|
-
return /* @__PURE__ */
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2336
|
+
[c, s, y, E]
|
|
2337
|
+
), D = (f, I) => {
|
|
2338
|
+
u(f, I), R(!1);
|
|
2339
|
+
}, P = (f, I) => {
|
|
2340
|
+
const N = f.hasChildren;
|
|
2341
|
+
return /* @__PURE__ */ e(
|
|
2342
|
+
ze,
|
|
2343
|
+
{
|
|
2344
|
+
onClick: () => N && d ? void i(f) : D(f, I),
|
|
2345
|
+
style: {
|
|
2346
|
+
display: "block",
|
|
2347
|
+
width: "100%",
|
|
2348
|
+
padding: "5px 8px",
|
|
2349
|
+
paddingLeft: I ? 24 : 8,
|
|
2350
|
+
borderRadius: 4
|
|
2351
|
+
},
|
|
2352
|
+
children: /* @__PURE__ */ r(O, { gap: 6, wrap: "nowrap", children: [
|
|
2353
|
+
/* @__PURE__ */ e(h, { size: "sm", fw: !d || !N ? 500 : 600, truncate: !0, children: f.label }),
|
|
2354
|
+
f.badge ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: f.badge }) : null
|
|
2355
|
+
] })
|
|
2356
|
+
},
|
|
2357
|
+
`${I?.id ?? "raiz"}:${f.id}`
|
|
2358
|
+
);
|
|
2359
|
+
}, G = (f) => /* @__PURE__ */ r(_, { children: [
|
|
2360
|
+
P(f),
|
|
2361
|
+
y === f.id ? (E[f.id] ?? []).map((I) => P(I, f)) : null
|
|
2362
|
+
] }, `ramo:${f.id}`);
|
|
2363
|
+
return /* @__PURE__ */ r(Je, { opened: T, onChange: R, width: 340, position: "bottom-start", withinPortal: !0, shadow: "md", children: [
|
|
2363
2364
|
/* @__PURE__ */ e(Je.Target, { children: /* @__PURE__ */ e(
|
|
2364
|
-
|
|
2365
|
+
fe,
|
|
2365
2366
|
{
|
|
2366
2367
|
label: a,
|
|
2367
2368
|
placeholder: n,
|
|
2368
2369
|
value: t ?? "",
|
|
2369
2370
|
readOnly: !0,
|
|
2370
|
-
onClick: () =>
|
|
2371
|
+
onClick: () => R((f) => !f),
|
|
2371
2372
|
styles: { input: { cursor: "pointer" } }
|
|
2372
2373
|
}
|
|
2373
2374
|
) }),
|
|
2374
2375
|
/* @__PURE__ */ r(Je.Dropdown, { p: 6, children: [
|
|
2375
2376
|
/* @__PURE__ */ e(
|
|
2376
|
-
|
|
2377
|
+
fe,
|
|
2377
2378
|
{
|
|
2378
2379
|
size: "xs",
|
|
2379
2380
|
placeholder: "Buscar…",
|
|
2380
2381
|
value: m,
|
|
2381
|
-
onChange: (
|
|
2382
|
+
onChange: (f) => S(f.currentTarget.value),
|
|
2382
2383
|
mb: 6,
|
|
2383
2384
|
autoFocus: !0
|
|
2384
2385
|
}
|
|
@@ -2387,9 +2388,9 @@ const Ue = (a) => {
|
|
|
2387
2388
|
/* @__PURE__ */ e(se, { size: "xs" }),
|
|
2388
2389
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "Carregando…" })
|
|
2389
2390
|
] }) : null,
|
|
2390
|
-
|
|
2391
|
-
!l && !
|
|
2392
|
-
/* @__PURE__ */ e(ce.Autosize, { mah: 280, type: "hover", children: A.map((
|
|
2391
|
+
b ? /* @__PURE__ */ e(h, { size: "xs", c: "red", p: 6, children: b }) : null,
|
|
2392
|
+
!l && !b && A.length === 0 ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", p: 6, children: "Nada encontrado." }) : null,
|
|
2393
|
+
/* @__PURE__ */ e(ce.Autosize, { mah: 280, type: "hover", children: A.map((f) => G(f)) })
|
|
2393
2394
|
] })
|
|
2394
2395
|
] });
|
|
2395
2396
|
}, Xr = [
|
|
@@ -2401,35 +2402,35 @@ const Ue = (a) => {
|
|
|
2401
2402
|
], Yr = ({ slots: a, onError: t, initial: n }) => {
|
|
2402
2403
|
const s = J(
|
|
2403
2404
|
K.SecurityDiagnostics
|
|
2404
|
-
), [d, u] =
|
|
2405
|
+
), [d, u] = x(""), [c, T] = x(""), [R, m] = x(""), [S, A] = x(""), [w, E] = x({}), [v, y] = x(void 0), [o, l] = x(!1), [p, b] = x(void 0);
|
|
2405
2406
|
ee(() => {
|
|
2406
|
-
n && (n.userId && u(n.userId), n.userLabel &&
|
|
2407
|
+
n && (n.userId && u(n.userId), n.userLabel && T(n.userLabel), n.resource && m(n.resource), n.action && A(n.action), y(void 0));
|
|
2407
2408
|
}, [n?.userId, n?.userLabel, n?.resource, n?.action]);
|
|
2408
|
-
const
|
|
2409
|
-
if (!(!d.trim() || !
|
|
2410
|
-
l(!0),
|
|
2409
|
+
const L = ae(async () => {
|
|
2410
|
+
if (!(!d.trim() || !R.trim() || !S.trim())) {
|
|
2411
|
+
l(!0), b(void 0);
|
|
2411
2412
|
try {
|
|
2412
2413
|
const i = d.trim(), D = await s.simulate({
|
|
2413
2414
|
...i.includes("@") ? { email: i } : { userId: i },
|
|
2414
|
-
resource:
|
|
2415
|
-
action:
|
|
2416
|
-
companyId:
|
|
2417
|
-
projectId:
|
|
2415
|
+
resource: R.trim(),
|
|
2416
|
+
action: S.trim(),
|
|
2417
|
+
companyId: w.companyId,
|
|
2418
|
+
projectId: w.projectId
|
|
2418
2419
|
});
|
|
2419
|
-
|
|
2420
|
+
y(D);
|
|
2420
2421
|
} catch (i) {
|
|
2421
|
-
const D =
|
|
2422
|
-
|
|
2422
|
+
const D = ge(i);
|
|
2423
|
+
b(D), t?.(D), y(void 0);
|
|
2423
2424
|
} finally {
|
|
2424
2425
|
l(!1);
|
|
2425
2426
|
}
|
|
2426
2427
|
}
|
|
2427
|
-
}, [s, d,
|
|
2428
|
-
const P = D.chain?.find((
|
|
2428
|
+
}, [s, d, R, S, w, t]), F = (i, D) => {
|
|
2429
|
+
const P = D.chain?.find((G) => G.gate === i);
|
|
2429
2430
|
return P ? P.passed ? "passou" : "negou" : "nao-avaliado";
|
|
2430
2431
|
};
|
|
2431
|
-
return /* @__PURE__ */ r(
|
|
2432
|
-
/* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(
|
|
2432
|
+
return /* @__PURE__ */ r(V, { gap: "lg", children: [
|
|
2433
|
+
/* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(V, { gap: "sm", children: [
|
|
2433
2434
|
/* @__PURE__ */ r(He, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: [
|
|
2434
2435
|
/* @__PURE__ */ e(
|
|
2435
2436
|
Ca,
|
|
@@ -2439,7 +2440,7 @@ const Ue = (a) => {
|
|
|
2439
2440
|
branch: "USERS",
|
|
2440
2441
|
valor: c || d,
|
|
2441
2442
|
onSelecionar: (i) => {
|
|
2442
|
-
u(i.id),
|
|
2443
|
+
u(i.id), T(i.label);
|
|
2443
2444
|
}
|
|
2444
2445
|
}
|
|
2445
2446
|
),
|
|
@@ -2450,36 +2451,36 @@ const Ue = (a) => {
|
|
|
2450
2451
|
placeholder: "escolher capacidade",
|
|
2451
2452
|
branch: "RESOURCES",
|
|
2452
2453
|
somenteFolhas: !0,
|
|
2453
|
-
valor:
|
|
2454
|
+
valor: R && S ? `${R} · ${S}` : "",
|
|
2454
2455
|
onSelecionar: (i, D) => {
|
|
2455
2456
|
A(i.label), D && m(D.label);
|
|
2456
2457
|
}
|
|
2457
2458
|
}
|
|
2458
2459
|
),
|
|
2459
2460
|
/* @__PURE__ */ e(
|
|
2460
|
-
|
|
2461
|
+
fe,
|
|
2461
2462
|
{
|
|
2462
2463
|
label: "Empresa (opcional)",
|
|
2463
2464
|
placeholder: "companyId",
|
|
2464
|
-
value:
|
|
2465
|
+
value: w.companyId ?? "",
|
|
2465
2466
|
onChange: (i) => E((D) => ({ ...D, companyId: i.currentTarget.value || void 0 }))
|
|
2466
2467
|
}
|
|
2467
2468
|
)
|
|
2468
2469
|
] }),
|
|
2469
2470
|
a?.afterSimulationFields?.((i) => E((D) => ({ ...D, ...i }))),
|
|
2470
2471
|
/* @__PURE__ */ r(O, { gap: "xs", align: "center", children: [
|
|
2471
|
-
/* @__PURE__ */ e(X, { onClick: () => void
|
|
2472
|
+
/* @__PURE__ */ e(X, { onClick: () => void L(), loading: o, children: "Simular" }),
|
|
2472
2473
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "Somente leitura — não altera permissão nenhuma." })
|
|
2473
2474
|
] })
|
|
2474
2475
|
] }) }),
|
|
2475
|
-
p ? /* @__PURE__ */ e(
|
|
2476
|
-
o && !
|
|
2477
|
-
|
|
2478
|
-
/* @__PURE__ */ e(
|
|
2479
|
-
const P = F(i.gate,
|
|
2476
|
+
p ? /* @__PURE__ */ e(be, { color: "red", title: "Não foi possível simular", children: p }) : null,
|
|
2477
|
+
o && !v ? /* @__PURE__ */ e(se, { size: "sm" }) : null,
|
|
2478
|
+
v ? /* @__PURE__ */ r(xe, { children: [
|
|
2479
|
+
/* @__PURE__ */ e(ve, { 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, D) => {
|
|
2480
|
+
const P = F(i.gate, v), G = v.chain?.find((f) => f.gate === i.gate)?.detail;
|
|
2480
2481
|
return /* @__PURE__ */ r(O, { align: "flex-start", wrap: "nowrap", gap: "sm", children: [
|
|
2481
2482
|
/* @__PURE__ */ e(h, { size: "xs", ff: "monospace", c: "dimmed", w: 16, children: D + 1 }),
|
|
2482
|
-
/* @__PURE__ */ r(
|
|
2483
|
+
/* @__PURE__ */ r(V, { gap: 2, style: { flex: 1, minWidth: 0 }, children: [
|
|
2483
2484
|
/* @__PURE__ */ r(O, { gap: 8, align: "baseline", wrap: "wrap", children: [
|
|
2484
2485
|
/* @__PURE__ */ e(
|
|
2485
2486
|
h,
|
|
@@ -2497,7 +2498,7 @@ const Ue = (a) => {
|
|
|
2497
2498
|
] })
|
|
2498
2499
|
] }),
|
|
2499
2500
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", opacity: P === "nao-avaliado" ? 0.5 : 1, children: i.pergunta }),
|
|
2500
|
-
|
|
2501
|
+
G ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: G }) : null
|
|
2501
2502
|
] }),
|
|
2502
2503
|
/* @__PURE__ */ e(
|
|
2503
2504
|
Q,
|
|
@@ -2509,16 +2510,16 @@ const Ue = (a) => {
|
|
|
2509
2510
|
)
|
|
2510
2511
|
] }, i.gate);
|
|
2511
2512
|
}) }) }) }),
|
|
2512
|
-
/* @__PURE__ */ e(
|
|
2513
|
-
/* @__PURE__ */ e(h, { size: "sm", children:
|
|
2513
|
+
/* @__PURE__ */ e(be, { color: v.allowed ? "green" : "red", title: v.allowed ? "Pode" : "Não pode", children: /* @__PURE__ */ r(V, { gap: 6, children: [
|
|
2514
|
+
/* @__PURE__ */ e(h, { size: "sm", children: v.message }),
|
|
2514
2515
|
/* @__PURE__ */ r(h, { size: "xs", ff: "monospace", c: "dimmed", children: [
|
|
2515
2516
|
"reasonCode: ",
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2517
|
+
v.reasonCode,
|
|
2518
|
+
v.deniedAt ? ` · deniedAt: ${v.deniedAt}` : "",
|
|
2519
|
+
v.grantedByName ? ` · grantedBy: ${v.grantedByName}` : ""
|
|
2519
2520
|
] })
|
|
2520
2521
|
] }) }),
|
|
2521
|
-
a?.afterDecision?.(
|
|
2522
|
+
a?.afterDecision?.(v)
|
|
2522
2523
|
] }) : null
|
|
2523
2524
|
] });
|
|
2524
2525
|
}, Da = (a) => {
|
|
@@ -2535,32 +2536,32 @@ const Ue = (a) => {
|
|
|
2535
2536
|
}, _r = ({ id: a, label: t, slots: n, onSelectUser: s, onSimulate: d }) => {
|
|
2536
2537
|
const u = J(
|
|
2537
2538
|
K.SecurityDiagnostics
|
|
2538
|
-
), [c,
|
|
2539
|
-
filtro:
|
|
2539
|
+
), [c, T] = x([]), {
|
|
2540
|
+
filtro: R,
|
|
2540
2541
|
setFiltro: m,
|
|
2541
|
-
filtrados:
|
|
2542
|
-
} = We(c, (o) => [o.userName, o.email, o.via]), [A,
|
|
2542
|
+
filtrados: S
|
|
2543
|
+
} = We(c, (o) => [o.userName, o.email, o.via]), [A, w] = x(!0), [E, v] = x();
|
|
2543
2544
|
ee(() => {
|
|
2544
2545
|
let o = !1;
|
|
2545
|
-
return
|
|
2546
|
-
o ||
|
|
2546
|
+
return w(!0), v(void 0), u.getReach(a).then((l) => {
|
|
2547
|
+
o || T(l ?? []);
|
|
2547
2548
|
}).catch((l) => {
|
|
2548
|
-
o ||
|
|
2549
|
+
o || v(l instanceof Error ? l.message : "Não foi possível carregar.");
|
|
2549
2550
|
}).finally(() => {
|
|
2550
|
-
o ||
|
|
2551
|
+
o || w(!1);
|
|
2551
2552
|
}), () => {
|
|
2552
2553
|
o = !0;
|
|
2553
2554
|
};
|
|
2554
2555
|
}, [u, a]);
|
|
2555
|
-
const
|
|
2556
|
-
return /* @__PURE__ */ r(
|
|
2557
|
-
/* @__PURE__ */ r(
|
|
2556
|
+
const y = c.filter((o) => o.kind === "ADMINISTRADOR").length;
|
|
2557
|
+
return /* @__PURE__ */ r(V, { gap: "lg", children: [
|
|
2558
|
+
/* @__PURE__ */ r(V, { gap: 4, children: [
|
|
2558
2559
|
/* @__PURE__ */ e(h, { fw: 620, size: "xl", ff: "monospace", children: t }),
|
|
2559
2560
|
/* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Quem alcança esta capacidade, e por qual via." })
|
|
2560
2561
|
] }),
|
|
2561
|
-
E ? /* @__PURE__ */ e(
|
|
2562
|
+
E ? /* @__PURE__ */ e(be, { color: "red", title: "Erro ao carregar", children: E }) : null,
|
|
2562
2563
|
/* @__PURE__ */ e(
|
|
2563
|
-
|
|
2564
|
+
ve,
|
|
2564
2565
|
{
|
|
2565
2566
|
title: "Quem alcança",
|
|
2566
2567
|
hint: A ? "carregando…" : `${c.length} ${c.length === 1 ? "pessoa" : "pessoas"}`,
|
|
@@ -2568,41 +2569,41 @@ const Ue = (a) => {
|
|
|
2568
2569
|
/* @__PURE__ */ e(
|
|
2569
2570
|
Be,
|
|
2570
2571
|
{
|
|
2571
|
-
value:
|
|
2572
|
+
value: R,
|
|
2572
2573
|
onChange: m,
|
|
2573
2574
|
assunto: "pessoas",
|
|
2574
|
-
visiveis:
|
|
2575
|
+
visiveis: S.length,
|
|
2575
2576
|
total: c.length
|
|
2576
2577
|
}
|
|
2577
2578
|
),
|
|
2578
|
-
/* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(
|
|
2579
|
-
/* @__PURE__ */ e(
|
|
2580
|
-
/* @__PURE__ */ e(
|
|
2581
|
-
/* @__PURE__ */ e(
|
|
2582
|
-
/* @__PURE__ */ e(
|
|
2579
|
+
/* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(C, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2580
|
+
/* @__PURE__ */ e(C.Thead, { children: /* @__PURE__ */ r(C.Tr, { children: [
|
|
2581
|
+
/* @__PURE__ */ e(C.Th, { children: "Pessoa" }),
|
|
2582
|
+
/* @__PURE__ */ e(C.Th, { children: "Por qual via" }),
|
|
2583
|
+
/* @__PURE__ */ e(C.Th, { children: "Situação" })
|
|
2583
2584
|
] }) }),
|
|
2584
|
-
/* @__PURE__ */ e(
|
|
2585
|
-
|
|
2585
|
+
/* @__PURE__ */ e(C.Tbody, { children: S.map((o) => /* @__PURE__ */ r(
|
|
2586
|
+
C.Tr,
|
|
2586
2587
|
{
|
|
2587
2588
|
style: { cursor: s ? "pointer" : void 0 },
|
|
2588
2589
|
onClick: () => s?.(o.userId, o.userName),
|
|
2589
2590
|
children: [
|
|
2590
|
-
/* @__PURE__ */ e(
|
|
2591
|
+
/* @__PURE__ */ e(C.Td, { children: /* @__PURE__ */ r(V, { gap: 0, children: [
|
|
2591
2592
|
/* @__PURE__ */ e(h, { size: "sm", fw: 550, children: o.userName }),
|
|
2592
2593
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: o.email })
|
|
2593
2594
|
] }) }),
|
|
2594
|
-
/* @__PURE__ */ e(
|
|
2595
|
+
/* @__PURE__ */ e(C.Td, { children: /* @__PURE__ */ r(O, { gap: 6, children: [
|
|
2595
2596
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: o.via }),
|
|
2596
2597
|
o.kind === "ADMINISTRADOR" ? /* @__PURE__ */ e(Q, { size: "xs", color: "yellow", variant: "light", children: "atalho" }) : null
|
|
2597
2598
|
] }) }),
|
|
2598
|
-
/* @__PURE__ */ e(
|
|
2599
|
+
/* @__PURE__ */ e(C.Td, { children: Da(o.situation) })
|
|
2599
2600
|
]
|
|
2600
2601
|
},
|
|
2601
2602
|
o.userId
|
|
2602
2603
|
)) })
|
|
2603
2604
|
] }) }),
|
|
2604
|
-
|
|
2605
|
-
|
|
2605
|
+
y > 0 ? /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", lh: 1.5, children: [
|
|
2606
|
+
y === 1 ? "Uma conta alcança" : `${y} contas alcançam`,
|
|
2606
2607
|
" pelo atalho de administrador — sem concessão nenhuma. Revisar permissões não muda o que elas podem."
|
|
2607
2608
|
] }) : null
|
|
2608
2609
|
] })
|
|
@@ -2618,38 +2619,38 @@ const Ue = (a) => {
|
|
|
2618
2619
|
}, Sa = ({ id: a, kind: t, slots: n, onSelectUser: s }) => {
|
|
2619
2620
|
const d = J(
|
|
2620
2621
|
K.SecurityDiagnostics
|
|
2621
|
-
), [u, c] =
|
|
2622
|
+
), [u, c] = x(), [T, R] = x(!0), [m, S] = x(), {
|
|
2622
2623
|
filtro: A,
|
|
2623
|
-
setFiltro:
|
|
2624
|
+
setFiltro: w,
|
|
2624
2625
|
filtrados: E
|
|
2625
|
-
} = We(u?.members ?? [], (
|
|
2626
|
-
filtro:
|
|
2627
|
-
setFiltro:
|
|
2626
|
+
} = We(u?.members ?? [], (b) => [b.name, b.email, b.profileName ?? void 0]), {
|
|
2627
|
+
filtro: v,
|
|
2628
|
+
setFiltro: y,
|
|
2628
2629
|
filtrados: o
|
|
2629
|
-
} = We(u?.grants ?? [], (
|
|
2630
|
+
} = We(u?.grants ?? [], (b) => [b.resource, b.action]);
|
|
2630
2631
|
if (ee(() => {
|
|
2631
|
-
let
|
|
2632
|
-
return
|
|
2633
|
-
|
|
2632
|
+
let b = !1;
|
|
2633
|
+
return R(!0), S(void 0), (t === "GROUP" ? d.getGroup(a) : d.getProfile(a)).then((F) => {
|
|
2634
|
+
b || c(F);
|
|
2634
2635
|
}).catch((F) => {
|
|
2635
|
-
|
|
2636
|
+
b || S(F instanceof Error ? F.message : "Não foi possível carregar.");
|
|
2636
2637
|
}).finally(() => {
|
|
2637
|
-
|
|
2638
|
+
b || R(!1);
|
|
2638
2639
|
}), () => {
|
|
2639
|
-
|
|
2640
|
+
b = !0;
|
|
2640
2641
|
};
|
|
2641
|
-
}, [d, a, t]),
|
|
2642
|
+
}, [d, a, t]), T)
|
|
2642
2643
|
return /* @__PURE__ */ r(O, { gap: 8, children: [
|
|
2643
2644
|
/* @__PURE__ */ e(se, { size: "sm" }),
|
|
2644
2645
|
/* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Carregando…" })
|
|
2645
2646
|
] });
|
|
2646
2647
|
if (m)
|
|
2647
|
-
return /* @__PURE__ */ e(
|
|
2648
|
+
return /* @__PURE__ */ e(be, { color: "red", title: "Erro ao carregar", children: m });
|
|
2648
2649
|
if (!u)
|
|
2649
2650
|
return null;
|
|
2650
2651
|
const l = t === "GROUP" ? "grupo" : "perfil", p = n?.additionalMemberColumns ?? [];
|
|
2651
|
-
return /* @__PURE__ */ r(
|
|
2652
|
-
/* @__PURE__ */ r(
|
|
2652
|
+
return /* @__PURE__ */ r(V, { gap: "lg", children: [
|
|
2653
|
+
/* @__PURE__ */ r(V, { gap: 4, children: [
|
|
2653
2654
|
/* @__PURE__ */ r(O, { gap: 8, children: [
|
|
2654
2655
|
/* @__PURE__ */ e(h, { fw: 620, size: "xl", children: u.groupName }),
|
|
2655
2656
|
/* @__PURE__ */ e(Q, { variant: "light", children: l })
|
|
@@ -2657,7 +2658,7 @@ const Ue = (a) => {
|
|
|
2657
2658
|
u.description ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: u.description }) : null
|
|
2658
2659
|
] }),
|
|
2659
2660
|
/* @__PURE__ */ r(
|
|
2660
|
-
|
|
2661
|
+
ve,
|
|
2661
2662
|
{
|
|
2662
2663
|
title: "Membros",
|
|
2663
2664
|
hint: `${u.members.length} — o total de cada um soma todas as origens`,
|
|
@@ -2671,45 +2672,45 @@ const Ue = (a) => {
|
|
|
2671
2672
|
Be,
|
|
2672
2673
|
{
|
|
2673
2674
|
value: A,
|
|
2674
|
-
onChange:
|
|
2675
|
+
onChange: w,
|
|
2675
2676
|
assunto: "pessoas",
|
|
2676
2677
|
visiveis: E.length,
|
|
2677
2678
|
total: u.members.length
|
|
2678
2679
|
}
|
|
2679
2680
|
),
|
|
2680
|
-
/* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(
|
|
2681
|
-
/* @__PURE__ */ e(
|
|
2682
|
-
/* @__PURE__ */ e(
|
|
2683
|
-
/* @__PURE__ */ e(
|
|
2684
|
-
/* @__PURE__ */ e(
|
|
2685
|
-
/* @__PURE__ */ e(
|
|
2686
|
-
/* @__PURE__ */ e(
|
|
2687
|
-
/* @__PURE__ */ e(
|
|
2688
|
-
p.map((
|
|
2681
|
+
/* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(C, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2682
|
+
/* @__PURE__ */ e(C.Thead, { children: /* @__PURE__ */ r(C.Tr, { children: [
|
|
2683
|
+
/* @__PURE__ */ e(C.Th, { children: "Pessoa" }),
|
|
2684
|
+
/* @__PURE__ */ e(C.Th, { children: "Perfil" }),
|
|
2685
|
+
/* @__PURE__ */ e(C.Th, { ta: "right", children: "Concedidas" }),
|
|
2686
|
+
/* @__PURE__ */ e(C.Th, { ta: "right", children: "Valem" }),
|
|
2687
|
+
/* @__PURE__ */ e(C.Th, { ta: "right", children: "Não valem" }),
|
|
2688
|
+
/* @__PURE__ */ e(C.Th, { ta: "right", children: "Bloqueadas" }),
|
|
2689
|
+
p.map((b) => /* @__PURE__ */ e(C.Th, { children: b.header }, b.header))
|
|
2689
2690
|
] }) }),
|
|
2690
|
-
/* @__PURE__ */ e(
|
|
2691
|
-
|
|
2691
|
+
/* @__PURE__ */ e(C.Tbody, { children: E.map((b) => /* @__PURE__ */ r(
|
|
2692
|
+
C.Tr,
|
|
2692
2693
|
{
|
|
2693
2694
|
style: { cursor: s ? "pointer" : void 0 },
|
|
2694
|
-
onClick: () => s?.(
|
|
2695
|
+
onClick: () => s?.(b.userId, b.name),
|
|
2695
2696
|
children: [
|
|
2696
|
-
/* @__PURE__ */ e(
|
|
2697
|
+
/* @__PURE__ */ e(C.Td, { children: /* @__PURE__ */ r(V, { gap: 0, children: [
|
|
2697
2698
|
/* @__PURE__ */ r(O, { gap: 6, children: [
|
|
2698
|
-
/* @__PURE__ */ e(h, { size: "sm", fw: 550, children:
|
|
2699
|
-
|
|
2700
|
-
|
|
2699
|
+
/* @__PURE__ */ e(h, { size: "sm", fw: 550, children: b.name }),
|
|
2700
|
+
b.administrator ? /* @__PURE__ */ e(Q, { size: "xs", color: "yellow", variant: "light", children: "administrador" }) : null,
|
|
2701
|
+
b.enabled ? null : /* @__PURE__ */ e(Q, { size: "xs", color: "red", variant: "light", children: "desativada" })
|
|
2701
2702
|
] }),
|
|
2702
|
-
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children:
|
|
2703
|
+
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: b.email })
|
|
2703
2704
|
] }) }),
|
|
2704
|
-
/* @__PURE__ */ e(
|
|
2705
|
-
/* @__PURE__ */ e(
|
|
2706
|
-
/* @__PURE__ */ e(
|
|
2707
|
-
/* @__PURE__ */ e(
|
|
2708
|
-
/* @__PURE__ */ e(
|
|
2709
|
-
p.map((
|
|
2705
|
+
/* @__PURE__ */ e(C.Td, { children: /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: b.profileName ?? "—" }) }),
|
|
2706
|
+
/* @__PURE__ */ e(C.Td, { ta: "right", children: b.total }),
|
|
2707
|
+
/* @__PURE__ */ e(C.Td, { ta: "right", c: "green", children: b.effective }),
|
|
2708
|
+
/* @__PURE__ */ e(C.Td, { ta: "right", c: "yellow.7", children: b.inert }),
|
|
2709
|
+
/* @__PURE__ */ e(C.Td, { ta: "right", c: "red", children: b.denied }),
|
|
2710
|
+
p.map((L) => /* @__PURE__ */ e(C.Td, { children: L.render(b, u) }, L.header))
|
|
2710
2711
|
]
|
|
2711
2712
|
},
|
|
2712
|
-
|
|
2713
|
+
b.userId
|
|
2713
2714
|
)) })
|
|
2714
2715
|
] }) })
|
|
2715
2716
|
] }),
|
|
@@ -2721,30 +2722,30 @@ const Ue = (a) => {
|
|
|
2721
2722
|
]
|
|
2722
2723
|
}
|
|
2723
2724
|
),
|
|
2724
|
-
/* @__PURE__ */ e(
|
|
2725
|
+
/* @__PURE__ */ e(ve, { title: `O que este ${l} concede`, hint: "a parte que é responsabilidade dele", children: u.grants.length === 0 ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Nada concedido por esta via." }) : /* @__PURE__ */ r(xe, { children: [
|
|
2725
2726
|
/* @__PURE__ */ e(
|
|
2726
2727
|
Be,
|
|
2727
2728
|
{
|
|
2728
|
-
value:
|
|
2729
|
-
onChange:
|
|
2729
|
+
value: v,
|
|
2730
|
+
onChange: y,
|
|
2730
2731
|
assunto: "capacidades",
|
|
2731
2732
|
visiveis: o.length,
|
|
2732
2733
|
total: u.grants.length
|
|
2733
2734
|
}
|
|
2734
2735
|
),
|
|
2735
|
-
/* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(
|
|
2736
|
-
/* @__PURE__ */ e(
|
|
2737
|
-
/* @__PURE__ */ e(
|
|
2738
|
-
/* @__PURE__ */ e(
|
|
2736
|
+
/* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(C, { striped: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2737
|
+
/* @__PURE__ */ e(C.Thead, { children: /* @__PURE__ */ r(C.Tr, { children: [
|
|
2738
|
+
/* @__PURE__ */ e(C.Th, { children: "Capacidade" }),
|
|
2739
|
+
/* @__PURE__ */ e(C.Th, { children: "Situação" })
|
|
2739
2740
|
] }) }),
|
|
2740
|
-
/* @__PURE__ */ e(
|
|
2741
|
-
/* @__PURE__ */ e(
|
|
2742
|
-
|
|
2741
|
+
/* @__PURE__ */ e(C.Tbody, { children: o.map((b, L) => /* @__PURE__ */ r(C.Tr, { children: [
|
|
2742
|
+
/* @__PURE__ */ e(C.Td, { children: /* @__PURE__ */ r(h, { size: "sm", ff: "monospace", children: [
|
|
2743
|
+
b.resource,
|
|
2743
2744
|
" · ",
|
|
2744
|
-
|
|
2745
|
+
b.action
|
|
2745
2746
|
] }) }),
|
|
2746
|
-
/* @__PURE__ */ e(
|
|
2747
|
-
] }, `${
|
|
2747
|
+
/* @__PURE__ */ e(C.Td, { children: Da(b.situation) })
|
|
2748
|
+
] }, `${b.resource}-${b.action}-${L}`)) })
|
|
2748
2749
|
] }) })
|
|
2749
2750
|
] }) }),
|
|
2750
2751
|
n?.afterGroupMembers?.(u)
|
|
@@ -2786,13 +2787,13 @@ const Ue = (a) => {
|
|
|
2786
2787
|
), at = ({ selected: a, onSelect: t }) => {
|
|
2787
2788
|
const n = J(
|
|
2788
2789
|
K.SecurityDiagnostics
|
|
2789
|
-
), [s, d] =
|
|
2790
|
+
), [s, d] = x(""), [u] = ia(s, 300), [c, T] = x({}), [R, m] = x({}), S = (o, l) => l ? `${o}:${l}` : o, A = ae(
|
|
2790
2791
|
async (o, l, p) => {
|
|
2791
|
-
const
|
|
2792
|
-
if (
|
|
2792
|
+
const b = S(o, l), L = R[b] ?? ra;
|
|
2793
|
+
if (L.carregando || p && L.carregouTudo)
|
|
2793
2794
|
return;
|
|
2794
|
-
const F = p ? Math.floor(
|
|
2795
|
-
m((i) => ({ ...i, [
|
|
2795
|
+
const F = p ? Math.floor(L.nodes.length / xa) : 0;
|
|
2796
|
+
m((i) => ({ ...i, [b]: { ...i[b] ?? ra, carregando: !0, erro: void 0 } }));
|
|
2796
2797
|
try {
|
|
2797
2798
|
const i = await n.browse(o, {
|
|
2798
2799
|
parentId: l,
|
|
@@ -2801,53 +2802,53 @@ const Ue = (a) => {
|
|
|
2801
2802
|
size: xa
|
|
2802
2803
|
});
|
|
2803
2804
|
m((D) => {
|
|
2804
|
-
const
|
|
2805
|
+
const G = [...p ? D[b]?.nodes ?? [] : [], ...i.content ?? []];
|
|
2805
2806
|
return {
|
|
2806
2807
|
...D,
|
|
2807
|
-
[
|
|
2808
|
-
nodes:
|
|
2809
|
-
total: i.totalElements ??
|
|
2808
|
+
[b]: {
|
|
2809
|
+
nodes: G,
|
|
2810
|
+
total: i.totalElements ?? G.length,
|
|
2810
2811
|
carregando: !1,
|
|
2811
|
-
carregouTudo:
|
|
2812
|
+
carregouTudo: G.length >= (i.totalElements ?? 0)
|
|
2812
2813
|
}
|
|
2813
2814
|
};
|
|
2814
2815
|
});
|
|
2815
2816
|
} catch (i) {
|
|
2816
2817
|
m((D) => ({
|
|
2817
2818
|
...D,
|
|
2818
|
-
[
|
|
2819
|
-
...D[
|
|
2819
|
+
[b]: {
|
|
2820
|
+
...D[b] ?? ra,
|
|
2820
2821
|
carregando: !1,
|
|
2821
2822
|
erro: i instanceof Error ? i.message : "Não foi possível carregar."
|
|
2822
2823
|
}
|
|
2823
2824
|
}));
|
|
2824
2825
|
}
|
|
2825
2826
|
},
|
|
2826
|
-
[n, u,
|
|
2827
|
+
[n, u, R]
|
|
2827
2828
|
);
|
|
2828
2829
|
ee(() => {
|
|
2829
2830
|
if (m({}), u) {
|
|
2830
2831
|
const o = {};
|
|
2831
2832
|
aa.forEach((l) => {
|
|
2832
2833
|
o[l.branch] = !0;
|
|
2833
|
-
}),
|
|
2834
|
+
}), T((l) => ({ ...l, ...o }));
|
|
2834
2835
|
}
|
|
2835
2836
|
}, [u]), ee(() => {
|
|
2836
2837
|
aa.forEach((o) => {
|
|
2837
|
-
c[o.branch] && !
|
|
2838
|
+
c[o.branch] && !R[o.branch] && A(o.branch, void 0, !1);
|
|
2838
2839
|
});
|
|
2839
|
-
}, [c,
|
|
2840
|
-
const
|
|
2841
|
-
const
|
|
2840
|
+
}, [c, R, u]);
|
|
2841
|
+
const w = (o) => T((l) => ({ ...l, [o]: !l[o] })), E = (o) => o === "critical" ? "red" : o === "warning" ? "yellow" : void 0, v = (o, l, p) => {
|
|
2842
|
+
const b = S("ACTIONS_OF_RESOURCE", o.id), L = !!c[b], F = R[b], i = a?.kind === o.kind && a?.id === o.id;
|
|
2842
2843
|
return /* @__PURE__ */ r(_, { children: [
|
|
2843
2844
|
/* @__PURE__ */ e(
|
|
2844
2845
|
ze,
|
|
2845
2846
|
{
|
|
2846
2847
|
onClick: () => {
|
|
2847
|
-
t({ kind: o.kind, id: o.id, label: o.label, parentLabel: p }), o.hasChildren && (
|
|
2848
|
+
t({ kind: o.kind, id: o.id, label: o.label, parentLabel: p }), o.hasChildren && (w(b), F || A("ACTIONS_OF_RESOURCE", o.id, !1));
|
|
2848
2849
|
},
|
|
2849
2850
|
"aria-current": i ? "true" : void 0,
|
|
2850
|
-
"aria-expanded": o.hasChildren ?
|
|
2851
|
+
"aria-expanded": o.hasChildren ? L : void 0,
|
|
2851
2852
|
style: {
|
|
2852
2853
|
display: "block",
|
|
2853
2854
|
width: "100%",
|
|
@@ -2863,8 +2864,8 @@ const Ue = (a) => {
|
|
|
2863
2864
|
] })
|
|
2864
2865
|
}
|
|
2865
2866
|
),
|
|
2866
|
-
o.hasChildren &&
|
|
2867
|
-
F?.nodes.map((D) =>
|
|
2867
|
+
o.hasChildren && L ? /* @__PURE__ */ r(_, { children: [
|
|
2868
|
+
F?.nodes.map((D) => v(D, l + 1, o.label)),
|
|
2868
2869
|
F?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 8 + (l + 1) * 14, py: 4, children: [
|
|
2869
2870
|
/* @__PURE__ */ e(se, { size: "xs" }),
|
|
2870
2871
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "carregando…" })
|
|
@@ -2883,10 +2884,10 @@ const Ue = (a) => {
|
|
|
2883
2884
|
) : null
|
|
2884
2885
|
] }) : null
|
|
2885
2886
|
] }, `${o.kind}-${o.id}`);
|
|
2886
|
-
},
|
|
2887
|
+
}, y = ie(() => aa, []);
|
|
2887
2888
|
return /* @__PURE__ */ r(_, { children: [
|
|
2888
2889
|
/* @__PURE__ */ e(
|
|
2889
|
-
|
|
2890
|
+
fe,
|
|
2890
2891
|
{
|
|
2891
2892
|
size: "xs",
|
|
2892
2893
|
placeholder: "Buscar pessoa, grupo, capacidade…",
|
|
@@ -2897,14 +2898,14 @@ const Ue = (a) => {
|
|
|
2897
2898
|
rightSection: s && s !== u ? /* @__PURE__ */ e(se, { size: "xs" }) : null
|
|
2898
2899
|
}
|
|
2899
2900
|
),
|
|
2900
|
-
|
|
2901
|
-
const l = !!c[o.branch], p =
|
|
2901
|
+
y.map((o) => {
|
|
2902
|
+
const l = !!c[o.branch], p = R[o.branch];
|
|
2902
2903
|
return /* @__PURE__ */ r(_, { mb: 2, children: [
|
|
2903
2904
|
/* @__PURE__ */ e(
|
|
2904
2905
|
ze,
|
|
2905
2906
|
{
|
|
2906
2907
|
onClick: () => {
|
|
2907
|
-
|
|
2908
|
+
w(o.branch), p || A(o.branch, void 0, !1);
|
|
2908
2909
|
},
|
|
2909
2910
|
"aria-expanded": l,
|
|
2910
2911
|
style: { display: "block", width: "100%", padding: "5px 8px", borderRadius: 5 },
|
|
@@ -2917,7 +2918,7 @@ const Ue = (a) => {
|
|
|
2917
2918
|
),
|
|
2918
2919
|
l ? /* @__PURE__ */ r(_, { children: [
|
|
2919
2920
|
p?.erro ? /* @__PURE__ */ e(h, { size: "xs", c: "red", pl: 22, py: 4, children: p.erro }) : null,
|
|
2920
|
-
p?.nodes.map((
|
|
2921
|
+
p?.nodes.map((b) => v(b, 1)),
|
|
2921
2922
|
p?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 22, py: 4, children: [
|
|
2922
2923
|
/* @__PURE__ */ e(se, { size: "xs" }),
|
|
2923
2924
|
/* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "carregando…" })
|
|
@@ -2957,43 +2958,43 @@ const Ue = (a) => {
|
|
|
2957
2958
|
slots: n,
|
|
2958
2959
|
onError: s
|
|
2959
2960
|
}) => {
|
|
2960
|
-
const [d, u] =
|
|
2961
|
-
u((o) => o.kind ===
|
|
2961
|
+
const [d, u] = x(Ta), [c, T] = x([]), [R, m] = x({}), S = ae((y) => {
|
|
2962
|
+
u((o) => o.kind === y.kind && o.id === y.id ? o : (T((l) => [...l, o]), y)), y.kind === "USER" && m((o) => ({ ...o, userId: y.id, userLabel: y.label })), y.kind === "ACTION" && m((o) => ({ ...o, action: y.label, resource: y.parentLabel }));
|
|
2962
2963
|
}, []), A = ae(() => {
|
|
2963
|
-
|
|
2964
|
-
const o =
|
|
2965
|
-
return o ? (u(o),
|
|
2964
|
+
T((y) => {
|
|
2965
|
+
const o = y[y.length - 1];
|
|
2966
|
+
return o ? (u(o), y.slice(0, -1)) : y;
|
|
2966
2967
|
});
|
|
2967
|
-
}, []),
|
|
2968
|
-
(
|
|
2969
|
-
[
|
|
2970
|
-
), E = (
|
|
2968
|
+
}, []), w = ae(
|
|
2969
|
+
(y, o) => S({ kind: "USER", id: y, label: o }),
|
|
2970
|
+
[S]
|
|
2971
|
+
), E = (y) => /* @__PURE__ */ e(
|
|
2971
2972
|
ze,
|
|
2972
2973
|
{
|
|
2973
|
-
onClick: () =>
|
|
2974
|
-
"aria-current": d.kind ===
|
|
2974
|
+
onClick: () => S(y),
|
|
2975
|
+
"aria-current": d.kind === y.kind ? "true" : void 0,
|
|
2975
2976
|
style: {
|
|
2976
2977
|
display: "block",
|
|
2977
2978
|
width: "100%",
|
|
2978
2979
|
padding: "6px 8px",
|
|
2979
2980
|
borderRadius: 5,
|
|
2980
|
-
background: d.kind ===
|
|
2981
|
+
background: d.kind === y.kind ? "var(--mantine-color-blue-light)" : void 0
|
|
2981
2982
|
},
|
|
2982
|
-
children: /* @__PURE__ */ e(h, { size: "sm", fw: d.kind ===
|
|
2983
|
+
children: /* @__PURE__ */ e(h, { size: "sm", fw: d.kind === y.kind ? 600 : 500, children: y.label })
|
|
2983
2984
|
},
|
|
2984
|
-
|
|
2985
|
-
),
|
|
2985
|
+
y.id
|
|
2986
|
+
), v = () => {
|
|
2986
2987
|
switch (d.kind) {
|
|
2987
2988
|
case "OVERVIEW":
|
|
2988
2989
|
return /* @__PURE__ */ e(ba, { slots: n, onError: s });
|
|
2989
2990
|
case "SIMULATE":
|
|
2990
|
-
return /* @__PURE__ */ e(Yr, { slots: n, onError: s, initial:
|
|
2991
|
+
return /* @__PURE__ */ e(Yr, { slots: n, onError: s, initial: R });
|
|
2991
2992
|
case "USER":
|
|
2992
2993
|
return /* @__PURE__ */ e(Jr, { slots: n, onError: s, userId: d.id });
|
|
2993
2994
|
case "GROUP":
|
|
2994
|
-
return /* @__PURE__ */ e(Sa, { id: d.id, kind: "GROUP", slots: n, onSelectUser:
|
|
2995
|
+
return /* @__PURE__ */ e(Sa, { id: d.id, kind: "GROUP", slots: n, onSelectUser: w });
|
|
2995
2996
|
case "PROFILE":
|
|
2996
|
-
return /* @__PURE__ */ e(Sa, { id: d.id, kind: "PROFILE", slots: n, onSelectUser:
|
|
2997
|
+
return /* @__PURE__ */ e(Sa, { id: d.id, kind: "PROFILE", slots: n, onSelectUser: w });
|
|
2997
2998
|
case "ACTION":
|
|
2998
2999
|
return /* @__PURE__ */ e(
|
|
2999
3000
|
_r,
|
|
@@ -3001,12 +3002,12 @@ const Ue = (a) => {
|
|
|
3001
3002
|
id: d.id,
|
|
3002
3003
|
label: d.parentLabel ? `${d.parentLabel} · ${d.label}` : d.label,
|
|
3003
3004
|
slots: n,
|
|
3004
|
-
onSelectUser:
|
|
3005
|
-
onSimulate: () =>
|
|
3005
|
+
onSelectUser: w,
|
|
3006
|
+
onSimulate: () => S(Aa)
|
|
3006
3007
|
}
|
|
3007
3008
|
);
|
|
3008
3009
|
case "RESOURCE":
|
|
3009
|
-
return /* @__PURE__ */ r(
|
|
3010
|
+
return /* @__PURE__ */ r(V, { gap: "xs", children: [
|
|
3010
3011
|
/* @__PURE__ */ e(h, { fw: 620, size: "xl", ff: "monospace", children: d.label }),
|
|
3011
3012
|
/* @__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." })
|
|
3012
3013
|
] });
|
|
@@ -3042,14 +3043,14 @@ const Ue = (a) => {
|
|
|
3042
3043
|
radius: "md",
|
|
3043
3044
|
p: "xs",
|
|
3044
3045
|
style: { display: "flex", flexDirection: "column", minHeight: 0, overflow: "hidden" },
|
|
3045
|
-
children: /* @__PURE__ */ r(
|
|
3046
|
+
children: /* @__PURE__ */ r(V, { gap: 2, style: { flex: 1, minHeight: 0 }, children: [
|
|
3046
3047
|
n?.renderUserSearch ? /* @__PURE__ */ e(_, { mb: 4, children: n.renderUserSearch(
|
|
3047
|
-
(
|
|
3048
|
+
(y) => S({ kind: "USER", id: y, label: y })
|
|
3048
3049
|
) }) : null,
|
|
3049
3050
|
E(Ta),
|
|
3050
3051
|
E(Aa),
|
|
3051
3052
|
/* @__PURE__ */ e(_, { my: 6, style: { borderTop: "1px solid var(--mantine-color-default-border)" } }),
|
|
3052
|
-
/* @__PURE__ */ e(ce, { type: "hover", style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(at, { selected: d, onSelect:
|
|
3053
|
+
/* @__PURE__ */ e(ce, { type: "hover", style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(at, { selected: d, onSelect: S }) })
|
|
3053
3054
|
] })
|
|
3054
3055
|
}
|
|
3055
3056
|
),
|
|
@@ -3078,7 +3079,7 @@ const Ue = (a) => {
|
|
|
3078
3079
|
c[c.length - 1]?.label
|
|
3079
3080
|
] })
|
|
3080
3081
|
] }) : null,
|
|
3081
|
-
/* @__PURE__ */ e(_, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children:
|
|
3082
|
+
/* @__PURE__ */ e(_, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: v() })
|
|
3082
3083
|
]
|
|
3083
3084
|
}
|
|
3084
3085
|
)
|
|
@@ -3106,7 +3107,7 @@ export {
|
|
|
3106
3107
|
Xe as PermissionsSelectorModal,
|
|
3107
3108
|
xr as ProfileModal,
|
|
3108
3109
|
Ar as RenderProfileUserItem,
|
|
3109
|
-
|
|
3110
|
+
ve as Section,
|
|
3110
3111
|
at as SecurityTree,
|
|
3111
3112
|
Yr as SimulationPanel,
|
|
3112
3113
|
Oe as TabelaRolavel,
|