@archbase/security-ui 4.0.32 → 4.0.33
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/archbase-security-ui-4.0.33.tgz +0 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +287 -287
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/dist/archbase-security-ui-4.0.32.tgz +0 -0
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Modal as
|
|
2
|
-
import { getI18nextInstance as t, ARCHBASE_IOC_API_TYPE as X, emit as ze, builder as
|
|
3
|
-
import { ArchbaseEdit as ee, ArchbaseNotifications as Q, ArchbasePasswordEdit as Kr, ArchbaseSelect as _r, ArchbaseCheckbox as
|
|
4
|
-
import { useArchbaseV1V2Compatibility as
|
|
5
|
-
import { useState as M, useCallback as ge, useEffect as
|
|
1
|
+
import { Modal as Fe, ScrollArea as ye, Stack as oe, Grid as D, Group as $, Button as U, Paper as Y, Box as He, Text as H, List as De, Checkbox as Je, Tooltip as se, ActionIcon as B, Flex as te, Space as sr, Input as he, useTree as Ze, useMantineColorScheme as Oe, TextInput as Qe, Tree as Ye, Badge as Se, Tabs as ie, RingProgress as Jr } from "@mantine/core";
|
|
2
|
+
import { getI18nextInstance as t, ARCHBASE_IOC_API_TYPE as X, emit as ze, builder as Te, convertDateToISOString as Zr, processErrorMessage as Ae, getKeyByEnumValue as le, useArchbaseTheme as nr, useArchbaseValidator as Qr, useArchbaseTranslation as Yr, useValidationErrors as Xr, processDetailErrorMessage as Ie } from "@archbase/core";
|
|
3
|
+
import { ArchbaseEdit as ee, ArchbaseNotifications as Q, ArchbasePasswordEdit as Kr, ArchbaseSelect as _r, ArchbaseCheckbox as xe, ArchbaseAvatarEdit as ea, ArchbaseAsyncSelect as ra, Columns as me, ArchbaseDataGridColumn as y, ArchbaseDataGrid as be, ArchbaseDialog as K } from "@archbase/components";
|
|
4
|
+
import { useArchbaseV1V2Compatibility as ke, useArchbaseDataSourceListener as Xe, useArchbaseRemoteServiceApi as _, useArchbaseRemoteDataSource as Me, ArchbaseDataSource as aa, useArchbaseStore as ir, useArchbaseRemoteDataSourceV2 as we, useArchbaseDataSource as ta } from "@archbase/data";
|
|
5
|
+
import { useState as M, useCallback as ge, useEffect as Re, forwardRef as oa, useMemo as pe, useRef as je } from "react";
|
|
6
6
|
import { IconArrowRight as lr, IconArrowLeft as cr, IconChevronDown as Ke, IconBorderCornerSquare as _e, IconEye as $e, IconEdit as fe, IconTrashX as Ce, IconShieldCheckered as Le, IconPlus as Ee } from "@tabler/icons-react";
|
|
7
|
-
import { UserGroupDto as er, SecurityType as
|
|
7
|
+
import { UserGroupDto as er, SecurityType as k, UserDto as sa, GroupDto as na, ProfileDto as ia, ApiTokenDto as la } from "@archbase/security";
|
|
8
8
|
import { DateTimePicker as ca } from "@mantine/dates";
|
|
9
9
|
import { useFocusTrap as da, useDebouncedValue as rr } from "@mantine/hooks";
|
|
10
|
-
import { ArchbaseSpaceFixed as ua, ArchbaseSpaceFill as ha, ArchbaseSpaceBottom as
|
|
11
|
-
var Ve = { exports: {} },
|
|
10
|
+
import { ArchbaseSpaceFixed as ua, ArchbaseSpaceFill as ha, ArchbaseSpaceBottom as xa } from "@archbase/layout";
|
|
11
|
+
var Ve = { exports: {} }, ve = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
@@ -19,9 +19,9 @@ var Ve = { exports: {} }, we = {};
|
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
21
|
var ar;
|
|
22
|
-
function
|
|
22
|
+
function pa() {
|
|
23
23
|
if (ar)
|
|
24
|
-
return
|
|
24
|
+
return ve;
|
|
25
25
|
ar = 1;
|
|
26
26
|
var r = Symbol.for("react.transitional.element"), h = Symbol.for("react.fragment");
|
|
27
27
|
function w(d, l, f) {
|
|
@@ -40,11 +40,11 @@ function xa() {
|
|
|
40
40
|
props: f
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return ve.Fragment = h, ve.jsx = w, ve.jsxs = w, ve;
|
|
44
44
|
}
|
|
45
45
|
var tr;
|
|
46
46
|
function fa() {
|
|
47
|
-
return tr || (tr = 1, Ve.exports =
|
|
47
|
+
return tr || (tr = 1, Ve.exports = pa()), Ve.exports;
|
|
48
48
|
}
|
|
49
49
|
var e = fa();
|
|
50
50
|
const ma = (r) => {
|
|
@@ -56,17 +56,17 @@ const ma = (r) => {
|
|
|
56
56
|
r.onClickCancel(r.dataSource.getCurrentRecord());
|
|
57
57
|
};
|
|
58
58
|
return /* @__PURE__ */ e.jsx(
|
|
59
|
-
|
|
59
|
+
Fe,
|
|
60
60
|
{
|
|
61
61
|
opened: r.opened,
|
|
62
62
|
onClose: d,
|
|
63
63
|
title: t().t("archbase:Perfil"),
|
|
64
64
|
size: "60%",
|
|
65
65
|
styles: { content: { maxWidth: 1e3 } },
|
|
66
|
-
children: /* @__PURE__ */ e.jsx(
|
|
66
|
+
children: /* @__PURE__ */ e.jsx(ye, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
|
|
67
67
|
h?.customContentBefore && h.customContentBefore(r.dataSource.getCurrentRecord()),
|
|
68
|
-
/* @__PURE__ */ e.jsxs(
|
|
69
|
-
/* @__PURE__ */ e.jsx(
|
|
68
|
+
/* @__PURE__ */ e.jsxs(D, { children: [
|
|
69
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
|
|
70
70
|
ee,
|
|
71
71
|
{
|
|
72
72
|
label: `${t().t("archbase:Nome do perfil")}`,
|
|
@@ -75,7 +75,7 @@ const ma = (r) => {
|
|
|
75
75
|
dataField: "name"
|
|
76
76
|
}
|
|
77
77
|
) }),
|
|
78
|
-
/* @__PURE__ */ e.jsx(
|
|
78
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
|
|
79
79
|
ee,
|
|
80
80
|
{
|
|
81
81
|
label: `${t().t("archbase:Descrição do perfil")}`,
|
|
@@ -104,21 +104,21 @@ function ba({
|
|
|
104
104
|
handleCreateAssociationObject: S,
|
|
105
105
|
width: u = "400px",
|
|
106
106
|
height: P = "200px",
|
|
107
|
-
titleAvailable:
|
|
108
|
-
titleAssigned:
|
|
107
|
+
titleAvailable: p = "Disponíveis",
|
|
108
|
+
titleAssigned: C = "Selecionados"
|
|
109
109
|
}) {
|
|
110
|
-
|
|
110
|
+
ke(
|
|
111
111
|
"ArchbaseDualListSelector-Available",
|
|
112
112
|
r,
|
|
113
113
|
void 0,
|
|
114
114
|
[]
|
|
115
115
|
);
|
|
116
|
-
const i =
|
|
116
|
+
const i = ke(
|
|
117
117
|
"ArchbaseDualListSelector-Assigned",
|
|
118
118
|
h,
|
|
119
119
|
void 0,
|
|
120
120
|
[]
|
|
121
|
-
), [c, L] = M([]), [b, re] = M([]), [J, ae] = M([]), [Z,
|
|
121
|
+
), [c, L] = M([]), [b, re] = M([]), [J, ae] = M([]), [Z, F] = M([]), N = ge(() => {
|
|
122
122
|
r && L(r.browseRecords()), h && re(h.browseRecords());
|
|
123
123
|
}, [r, h]);
|
|
124
124
|
Xe({
|
|
@@ -127,33 +127,33 @@ function ba({
|
|
|
127
127
|
}), Xe({
|
|
128
128
|
dataSource: h,
|
|
129
129
|
listener: () => N()
|
|
130
|
-
}),
|
|
130
|
+
}), Re(() => {
|
|
131
131
|
N();
|
|
132
132
|
}, [N]);
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
},
|
|
136
|
-
J.forEach((
|
|
137
|
-
const g = c.find((m) =>
|
|
133
|
+
const I = (x, g) => typeof g == "function" ? g(x) : x[g], q = (x, g) => typeof g == "function" ? g(x) : x[g], o = (x, g) => {
|
|
134
|
+
x((m) => m.includes(g) ? m.filter((ce) => ce !== g) : [...m, g]);
|
|
135
|
+
}, R = () => {
|
|
136
|
+
J.forEach((x) => {
|
|
137
|
+
const g = c.find((m) => I(m, w) === x);
|
|
138
138
|
if (g) {
|
|
139
139
|
const m = S(g);
|
|
140
140
|
i.isDataSourceV2 ? (h.insert(m), h.save()) : (h.insert(m), h.save(), i.v1State.forceUpdate());
|
|
141
141
|
}
|
|
142
142
|
}), ae([]);
|
|
143
143
|
}, W = () => {
|
|
144
|
-
Z.forEach((
|
|
145
|
-
const g = b.find((m) =>
|
|
144
|
+
Z.forEach((x) => {
|
|
145
|
+
const g = b.find((m) => I(m, l) === x);
|
|
146
146
|
if (g) {
|
|
147
|
-
const m = typeof l == "function" ? { customId: l(g) } : { [l]:
|
|
147
|
+
const m = typeof l == "function" ? { customId: l(g) } : { [l]: x };
|
|
148
148
|
i.isDataSourceV2 ? h.remove(() => h.locate(m)) : (h.remove(() => h.locate(m)), i.v1State.forceUpdate());
|
|
149
149
|
}
|
|
150
|
-
}),
|
|
150
|
+
}), F([]);
|
|
151
151
|
};
|
|
152
152
|
return /* @__PURE__ */ e.jsxs(Y, { withBorder: !0, style: { display: "flex", width: u, height: P }, children: [
|
|
153
153
|
/* @__PURE__ */ e.jsxs(He, { style: { minWidth: "44%", minHeight: P }, children: [
|
|
154
|
-
/* @__PURE__ */ e.jsx(H, { children:
|
|
154
|
+
/* @__PURE__ */ e.jsx(H, { children: p }),
|
|
155
155
|
/* @__PURE__ */ e.jsx(
|
|
156
|
-
|
|
156
|
+
De,
|
|
157
157
|
{
|
|
158
158
|
spacing: "xs",
|
|
159
159
|
size: "sm",
|
|
@@ -165,28 +165,28 @@ function ba({
|
|
|
165
165
|
overflowX: "hidden",
|
|
166
166
|
height: "calc(100% - 32px)"
|
|
167
167
|
},
|
|
168
|
-
children: c.map((
|
|
168
|
+
children: c.map((x) => /* @__PURE__ */ e.jsx(De.Item, { children: /* @__PURE__ */ e.jsx(
|
|
169
169
|
Je,
|
|
170
170
|
{
|
|
171
|
-
label: q(
|
|
172
|
-
checked: J.includes(
|
|
173
|
-
onChange: () => o(ae,
|
|
171
|
+
label: q(x, d),
|
|
172
|
+
checked: J.includes(I(x, w)),
|
|
173
|
+
onChange: () => o(ae, I(x, w)),
|
|
174
174
|
disabled: b.some(
|
|
175
|
-
(g) =>
|
|
175
|
+
(g) => I(g, l) === I(x, w)
|
|
176
176
|
)
|
|
177
177
|
}
|
|
178
|
-
) },
|
|
178
|
+
) }, I(x, w)))
|
|
179
179
|
}
|
|
180
180
|
)
|
|
181
181
|
] }),
|
|
182
182
|
/* @__PURE__ */ e.jsxs(oe, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
|
|
183
|
-
/* @__PURE__ */ e.jsx(se, { label: "Adicionar", children: /* @__PURE__ */ e.jsx(B, { onClick:
|
|
183
|
+
/* @__PURE__ */ e.jsx(se, { label: "Adicionar", children: /* @__PURE__ */ e.jsx(B, { onClick: R, disabled: !J.length, children: /* @__PURE__ */ e.jsx(lr, {}) }) }),
|
|
184
184
|
/* @__PURE__ */ e.jsx(se, { label: "Remover", children: /* @__PURE__ */ e.jsx(B, { onClick: W, disabled: !Z.length, children: /* @__PURE__ */ e.jsx(cr, {}) }) })
|
|
185
185
|
] }),
|
|
186
186
|
/* @__PURE__ */ e.jsxs(He, { style: { minWidth: "44%", minHeight: P }, children: [
|
|
187
|
-
/* @__PURE__ */ e.jsx(H, { children:
|
|
187
|
+
/* @__PURE__ */ e.jsx(H, { children: C }),
|
|
188
188
|
/* @__PURE__ */ e.jsx(
|
|
189
|
-
|
|
189
|
+
De,
|
|
190
190
|
{
|
|
191
191
|
spacing: "xs",
|
|
192
192
|
size: "sm",
|
|
@@ -198,14 +198,14 @@ function ba({
|
|
|
198
198
|
overflowX: "hidden",
|
|
199
199
|
height: "calc(100% - 32px)"
|
|
200
200
|
},
|
|
201
|
-
children: b.map((
|
|
201
|
+
children: b.map((x) => /* @__PURE__ */ e.jsx(De.Item, { children: /* @__PURE__ */ e.jsx(
|
|
202
202
|
Je,
|
|
203
203
|
{
|
|
204
|
-
label: q(
|
|
205
|
-
checked: Z.includes(
|
|
206
|
-
onChange: () => o(
|
|
204
|
+
label: q(x, f),
|
|
205
|
+
checked: Z.includes(I(x, l)),
|
|
206
|
+
onChange: () => o(F, I(x, l))
|
|
207
207
|
}
|
|
208
|
-
) },
|
|
208
|
+
) }, I(x, l)))
|
|
209
209
|
}
|
|
210
210
|
)
|
|
211
211
|
] })
|
|
@@ -258,25 +258,25 @@ const ga = oa(
|
|
|
258
258
|
Q.showError(t().t("archbase:WARNING"), i, c);
|
|
259
259
|
}
|
|
260
260
|
});
|
|
261
|
-
|
|
261
|
+
Re(() => {
|
|
262
262
|
w("");
|
|
263
263
|
}, [r.dataSource.getFieldValue("password")]);
|
|
264
264
|
const P = async () => {
|
|
265
265
|
if (r.dataSource.isInserting()) {
|
|
266
266
|
if (d.userDefaultProfile) {
|
|
267
|
-
const i = ze(
|
|
267
|
+
const i = ze(Te.eq("name", d.userDefaultProfile)), c = await S.findAllWithFilter(i, 0, 1);
|
|
268
268
|
c && c.content.length > 0 && r.dataSource.setFieldValue("profile", c.content[0]);
|
|
269
269
|
}
|
|
270
270
|
if (d.userDefaultGroups) {
|
|
271
|
-
const i = ze(
|
|
271
|
+
const i = ze(Te.in("name", d.userDefaultGroups)), c = await l.findAllWithFilter(i, 0, 500);
|
|
272
272
|
c && c.content.length > 0 && r.dataSource.setFieldValue("groups", c.content.map((L) => er.newInstance(L)));
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
};
|
|
276
|
-
|
|
276
|
+
Re(() => {
|
|
277
277
|
r.opened && P();
|
|
278
278
|
}, [r.opened]);
|
|
279
|
-
const
|
|
279
|
+
const p = () => {
|
|
280
280
|
const i = r.dataSource.getCurrentRecord();
|
|
281
281
|
if (!i.password && r.dataSource.isInserting()) {
|
|
282
282
|
w(t().t("archbase:Informe a senha"));
|
|
@@ -285,22 +285,22 @@ const ga = oa(
|
|
|
285
285
|
r.onCustomSave ? r.onCustomSave(i, (c) => {
|
|
286
286
|
c && r.onAfterSave && r.onAfterSave(i), r.onClickOk(i, c);
|
|
287
287
|
}) : r.onClickOk(i, !0);
|
|
288
|
-
},
|
|
288
|
+
}, C = () => {
|
|
289
289
|
r.onClickCancel(r.dataSource.getCurrentRecord());
|
|
290
290
|
};
|
|
291
291
|
return /* @__PURE__ */ e.jsxs(
|
|
292
|
-
|
|
292
|
+
Fe,
|
|
293
293
|
{
|
|
294
294
|
opened: r.opened,
|
|
295
|
-
onClose:
|
|
295
|
+
onClose: C,
|
|
296
296
|
title: t().t("archbase:Usuário"),
|
|
297
297
|
size: "80%",
|
|
298
298
|
styles: { content: { maxWidth: 1e3 } },
|
|
299
299
|
children: [
|
|
300
|
-
/* @__PURE__ */ e.jsx(
|
|
300
|
+
/* @__PURE__ */ e.jsx(ye, { style: { height: "500px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
|
|
301
301
|
d?.customContentBefore && /* @__PURE__ */ e.jsx(e.Fragment, { children: d.customContentBefore(r.dataSource.getCurrentRecord()) }),
|
|
302
|
-
/* @__PURE__ */ e.jsxs(
|
|
303
|
-
/* @__PURE__ */ e.jsx(
|
|
302
|
+
/* @__PURE__ */ e.jsxs(D, { children: [
|
|
303
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsxs($, { children: [
|
|
304
304
|
/* @__PURE__ */ e.jsx(
|
|
305
305
|
ee,
|
|
306
306
|
{
|
|
@@ -323,7 +323,7 @@ const ga = oa(
|
|
|
323
323
|
}
|
|
324
324
|
)
|
|
325
325
|
] }) }),
|
|
326
|
-
/* @__PURE__ */ e.jsx(
|
|
326
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
|
|
327
327
|
ee,
|
|
328
328
|
{
|
|
329
329
|
label: `${t().t("archbase:Descrição do usuário")}`,
|
|
@@ -334,8 +334,8 @@ const ga = oa(
|
|
|
334
334
|
}
|
|
335
335
|
) })
|
|
336
336
|
] }),
|
|
337
|
-
/* @__PURE__ */ e.jsxs(
|
|
338
|
-
/* @__PURE__ */ e.jsx(
|
|
337
|
+
/* @__PURE__ */ e.jsxs(D, { children: [
|
|
338
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
|
|
339
339
|
ee,
|
|
340
340
|
{
|
|
341
341
|
label: `${t().t("archbase:E-mail")}`,
|
|
@@ -347,7 +347,7 @@ const ga = oa(
|
|
|
347
347
|
required: !0
|
|
348
348
|
}
|
|
349
349
|
) }),
|
|
350
|
-
/* @__PURE__ */ e.jsx(
|
|
350
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
|
|
351
351
|
Kr,
|
|
352
352
|
{
|
|
353
353
|
label: `${t().t("archbase:Senha usuário")}`,
|
|
@@ -358,7 +358,7 @@ const ga = oa(
|
|
|
358
358
|
}
|
|
359
359
|
) })
|
|
360
360
|
] }),
|
|
361
|
-
/* @__PURE__ */ e.jsx(
|
|
361
|
+
/* @__PURE__ */ e.jsx(D, { children: d.showProfile && /* @__PURE__ */ e.jsx(D.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
|
|
362
362
|
_r,
|
|
363
363
|
{
|
|
364
364
|
label: `${t().t("archbase:Perfil do usuário")}`,
|
|
@@ -372,11 +372,11 @@ const ga = oa(
|
|
|
372
372
|
getOptionValue: (i) => i.id
|
|
373
373
|
}
|
|
374
374
|
) }) }),
|
|
375
|
-
/* @__PURE__ */ e.jsxs(
|
|
376
|
-
/* @__PURE__ */ e.jsx(
|
|
377
|
-
/* @__PURE__ */ e.jsx(
|
|
375
|
+
/* @__PURE__ */ e.jsxs(D, { children: [
|
|
376
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12 }, children: d.showAccountConfigLabel && /* @__PURE__ */ e.jsx(H, { fz: 14, fw: 500, children: "Informe" }) }),
|
|
377
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(oe, { gap: "lg", children: [
|
|
378
378
|
d.showChangePasswordOnNextLogin && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
|
|
379
|
-
|
|
379
|
+
xe,
|
|
380
380
|
{
|
|
381
381
|
dataSource: r.dataSource,
|
|
382
382
|
dataField: "changePasswordOnNextLogin",
|
|
@@ -384,7 +384,7 @@ const ga = oa(
|
|
|
384
384
|
}
|
|
385
385
|
) }),
|
|
386
386
|
d.showAllowPasswordChange && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
|
|
387
|
-
|
|
387
|
+
xe,
|
|
388
388
|
{
|
|
389
389
|
dataSource: r.dataSource,
|
|
390
390
|
dataField: "allowPasswordChange",
|
|
@@ -392,7 +392,7 @@ const ga = oa(
|
|
|
392
392
|
}
|
|
393
393
|
) }),
|
|
394
394
|
d.showPasswordNeverExpires && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
|
|
395
|
-
|
|
395
|
+
xe,
|
|
396
396
|
{
|
|
397
397
|
dataSource: r.dataSource,
|
|
398
398
|
dataField: "passwordNeverExpires",
|
|
@@ -400,9 +400,9 @@ const ga = oa(
|
|
|
400
400
|
}
|
|
401
401
|
) })
|
|
402
402
|
] }) }),
|
|
403
|
-
/* @__PURE__ */ e.jsx(
|
|
403
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(oe, { gap: "lg", children: [
|
|
404
404
|
d.showAccountDeactivated && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
|
|
405
|
-
|
|
405
|
+
xe,
|
|
406
406
|
{
|
|
407
407
|
dataSource: r.dataSource,
|
|
408
408
|
dataField: "accountDeactivated",
|
|
@@ -410,7 +410,7 @@ const ga = oa(
|
|
|
410
410
|
}
|
|
411
411
|
) }),
|
|
412
412
|
d.showAccountLocked && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
|
|
413
|
-
|
|
413
|
+
xe,
|
|
414
414
|
{
|
|
415
415
|
dataSource: r.dataSource,
|
|
416
416
|
dataField: "accountLocked",
|
|
@@ -418,7 +418,7 @@ const ga = oa(
|
|
|
418
418
|
}
|
|
419
419
|
) }),
|
|
420
420
|
d.showIsAdministrator && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
|
|
421
|
-
|
|
421
|
+
xe,
|
|
422
422
|
{
|
|
423
423
|
dataSource: r.dataSource,
|
|
424
424
|
dataField: "isAdministrator",
|
|
@@ -426,7 +426,7 @@ const ga = oa(
|
|
|
426
426
|
}
|
|
427
427
|
) })
|
|
428
428
|
] }) }),
|
|
429
|
-
/* @__PURE__ */ e.jsx(
|
|
429
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsx(oe, { gap: "lg", children: /* @__PURE__ */ e.jsx(
|
|
430
430
|
ea,
|
|
431
431
|
{
|
|
432
432
|
label: t().t("archbase:Foto do usuário"),
|
|
@@ -439,9 +439,9 @@ const ga = oa(
|
|
|
439
439
|
}
|
|
440
440
|
) }) })
|
|
441
441
|
] }),
|
|
442
|
-
d.showGroups && /* @__PURE__ */ e.jsxs(
|
|
443
|
-
/* @__PURE__ */ e.jsx(
|
|
444
|
-
/* @__PURE__ */ e.jsx(
|
|
442
|
+
d.showGroups && /* @__PURE__ */ e.jsxs(D, { children: [
|
|
443
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(H, { fz: 14, fw: 500, children: "Grupos" }) }),
|
|
444
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
|
|
445
445
|
ba,
|
|
446
446
|
{
|
|
447
447
|
titleAvailable: t().t("archbase:Disponíveis"),
|
|
@@ -468,8 +468,8 @@ const ga = oa(
|
|
|
468
468
|
/* @__PURE__ */ e.jsx(sr, { h: "12px" })
|
|
469
469
|
] }) }),
|
|
470
470
|
/* @__PURE__ */ e.jsxs($, { justify: "flex-end", mt: "md", children: [
|
|
471
|
-
/* @__PURE__ */ e.jsx(U, { variant: "default", onClick:
|
|
472
|
-
/* @__PURE__ */ e.jsx(U, { onClick:
|
|
471
|
+
/* @__PURE__ */ e.jsx(U, { variant: "default", onClick: C, children: t().t("archbase:Cancelar") }),
|
|
472
|
+
/* @__PURE__ */ e.jsx(U, { onClick: p, children: t().t("archbase:Salvar") })
|
|
473
473
|
] })
|
|
474
474
|
]
|
|
475
475
|
}
|
|
@@ -483,17 +483,17 @@ const ga = oa(
|
|
|
483
483
|
r.onClickCancel(r.dataSource.getCurrentRecord());
|
|
484
484
|
};
|
|
485
485
|
return /* @__PURE__ */ e.jsx(
|
|
486
|
-
|
|
486
|
+
Fe,
|
|
487
487
|
{
|
|
488
488
|
opened: r.opened,
|
|
489
489
|
onClose: d,
|
|
490
490
|
title: t().t("archbase:Grupo"),
|
|
491
491
|
size: "60%",
|
|
492
492
|
styles: { content: { maxWidth: 1e3 } },
|
|
493
|
-
children: /* @__PURE__ */ e.jsx(
|
|
493
|
+
children: /* @__PURE__ */ e.jsx(ye, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
|
|
494
494
|
h?.customContentBefore && h.customContentBefore(r.dataSource.getCurrentRecord()),
|
|
495
|
-
/* @__PURE__ */ e.jsxs(
|
|
496
|
-
/* @__PURE__ */ e.jsx(
|
|
495
|
+
/* @__PURE__ */ e.jsxs(D, { children: [
|
|
496
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
|
|
497
497
|
ee,
|
|
498
498
|
{
|
|
499
499
|
label: `${t().t("archbase:Nome do grupo")}`,
|
|
@@ -502,7 +502,7 @@ const ga = oa(
|
|
|
502
502
|
dataField: "name"
|
|
503
503
|
}
|
|
504
504
|
) }),
|
|
505
|
-
/* @__PURE__ */ e.jsx(
|
|
505
|
+
/* @__PURE__ */ e.jsx(D.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
|
|
506
506
|
ee,
|
|
507
507
|
{
|
|
508
508
|
label: `${t().t("archbase:Descrição do grupo")}`,
|
|
@@ -520,54 +520,54 @@ const ga = oa(
|
|
|
520
520
|
] }) })
|
|
521
521
|
}
|
|
522
522
|
);
|
|
523
|
-
},
|
|
523
|
+
}, va = ({ image: r, label: h, description: w, ...d }) => /* @__PURE__ */ e.jsx("div", { ...d, children: /* @__PURE__ */ e.jsxs($, { grow: !0, children: [
|
|
524
524
|
/* @__PURE__ */ e.jsx("img", { style: { maxWidth: "32px" }, src: r }),
|
|
525
525
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
526
526
|
/* @__PURE__ */ e.jsx(H, { size: "sm", children: h }),
|
|
527
527
|
/* @__PURE__ */ e.jsx(H, { size: "xs", opacity: 0.65, children: w })
|
|
528
528
|
] })
|
|
529
|
-
] }) }),
|
|
529
|
+
] }) }), Ca = (r) => {
|
|
530
530
|
da();
|
|
531
|
-
const [h, w] = M(), d = _(X.User), l =
|
|
531
|
+
const [h, w] = M(), d = _(X.User), l = ke(
|
|
532
532
|
"ApiTokenModal",
|
|
533
533
|
r.dataSource,
|
|
534
534
|
"expirationDate",
|
|
535
535
|
""
|
|
536
|
-
), f = (
|
|
537
|
-
if (!
|
|
536
|
+
), f = (p) => {
|
|
537
|
+
if (!p)
|
|
538
538
|
l.handleValueChange(void 0);
|
|
539
539
|
else {
|
|
540
|
-
const
|
|
540
|
+
const C = typeof p == "string" ? new Date(p) : p, i = Zr(C);
|
|
541
541
|
l.handleValueChange(i);
|
|
542
542
|
}
|
|
543
|
-
w(
|
|
544
|
-
}, S = async (
|
|
543
|
+
w(p);
|
|
544
|
+
}, S = async (p, C) => new Promise(async (i, c) => {
|
|
545
545
|
try {
|
|
546
|
-
const L = ze(
|
|
546
|
+
const L = ze(Te.or(Te.eq("name", `^*${C.trim()}*`))), b = await d.findAllWithFilter(L, p, 20);
|
|
547
547
|
i({
|
|
548
548
|
options: b.content,
|
|
549
549
|
page: b.pageable.pageNumber,
|
|
550
550
|
totalPages: b.totalPages
|
|
551
551
|
});
|
|
552
552
|
} catch (L) {
|
|
553
|
-
c(
|
|
553
|
+
c(Ae(L));
|
|
554
554
|
}
|
|
555
555
|
}), u = () => {
|
|
556
|
-
r.onCustomSave ? r.onCustomSave(r.dataSource.current, (
|
|
557
|
-
|
|
556
|
+
r.onCustomSave ? r.onCustomSave(r.dataSource.current, (p) => {
|
|
557
|
+
p && r.onAfterSave && r.onAfterSave(r.dataSource.current), r.onClickOk(r.dataSource.current, p);
|
|
558
558
|
}) : r.onClickOk(r.dataSource.current, !0);
|
|
559
559
|
}, P = () => {
|
|
560
560
|
r.onClickCancel(r.dataSource.current);
|
|
561
561
|
};
|
|
562
562
|
return /* @__PURE__ */ e.jsxs(
|
|
563
|
-
|
|
563
|
+
Fe,
|
|
564
564
|
{
|
|
565
565
|
opened: r.opened,
|
|
566
566
|
onClose: P,
|
|
567
567
|
title: t().t("archbase:Token de API"),
|
|
568
568
|
size: "50%",
|
|
569
569
|
children: [
|
|
570
|
-
/* @__PURE__ */ e.jsxs(
|
|
570
|
+
/* @__PURE__ */ e.jsxs(ye, { style: { height: "300px" }, children: [
|
|
571
571
|
/* @__PURE__ */ e.jsx(
|
|
572
572
|
ee,
|
|
573
573
|
{
|
|
@@ -603,12 +603,12 @@ const ga = oa(
|
|
|
603
603
|
dataSource: r.dataSource,
|
|
604
604
|
dataField: "user",
|
|
605
605
|
placeholder: `${t().t("archbase:Digite aqui o nome do usuário")}`,
|
|
606
|
-
getOptionLabel: (
|
|
607
|
-
getOptionValue: (
|
|
606
|
+
getOptionLabel: (p) => p && p.email ? p.email : "",
|
|
607
|
+
getOptionValue: (p) => p && p.id ? p.id.toString() : "",
|
|
608
608
|
getOptions: S,
|
|
609
609
|
debounceTime: 500,
|
|
610
610
|
minCharsToSearch: 1,
|
|
611
|
-
itemComponent:
|
|
611
|
+
itemComponent: va
|
|
612
612
|
}
|
|
613
613
|
)
|
|
614
614
|
] }),
|
|
@@ -624,10 +624,10 @@ const ga = oa(
|
|
|
624
624
|
return r.includes(h) ? r.split(h).map((l) => l.trim()).map((l) => t().t(l)).join(` ${h} `) : t().t(r);
|
|
625
625
|
};
|
|
626
626
|
function Ue({ dataSource: r, opened: h, close: w }) {
|
|
627
|
-
const d =
|
|
627
|
+
const d = pe(() => r?.getFieldValue("name") || "", [r]), l = pe(() => r?.getFieldValue("id") || "", [r]), f = pe(() => r?.getFieldValue("type") || "", [r]), S = Ze(), u = Ze(), [P, p] = M([]), [C, i] = M([]), [c, L] = M(), [b, re] = M(), [J, ae] = M(""), [Z] = rr(J, 200), [F, N] = M(""), [I] = rr(F, 200), q = _(X.Resource), { colorScheme: o } = Oe(), R = o === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", W = pe(() => C.sort((s, n) => s.resourceDescription.localeCompare(n.resourceDescription)).map((s) => ({
|
|
628
628
|
value: s.resourceId,
|
|
629
629
|
label: s.resourceDescription,
|
|
630
|
-
children: s.permissions.filter((n) => n.actionDescription.toLowerCase().includes(
|
|
630
|
+
children: s.permissions.filter((n) => n.actionDescription.toLowerCase().includes(I.toLowerCase())).sort((n, G) => n.actionDescription.localeCompare(G.actionDescription)).map((n) => ({
|
|
631
631
|
value: n.actionId,
|
|
632
632
|
label: n.actionDescription,
|
|
633
633
|
nodeProps: {
|
|
@@ -636,38 +636,38 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
636
636
|
owner: s
|
|
637
637
|
}
|
|
638
638
|
}))
|
|
639
|
-
})), [
|
|
639
|
+
})), [C, I]), x = pe(() => C.map((s) => s.permissions.map((n) => n.actionId)).flat(), [C]), g = pe(() => P.sort((s, n) => s.resourceDescription.localeCompare(n.resourceDescription)).map((s) => ({
|
|
640
640
|
value: s.resourceId,
|
|
641
641
|
label: s.resourceDescription,
|
|
642
642
|
children: s.permissions.filter((n) => n.actionDescription.toLowerCase().includes(Z.toLowerCase())).sort((n, G) => n.actionDescription.localeCompare(G.actionDescription)).map((n) => {
|
|
643
|
-
const G =
|
|
643
|
+
const G = C.find((v) => v.resourceId === s.resourceId)?.permissions.find((v) => v.actionId === n.actionId);
|
|
644
644
|
return {
|
|
645
645
|
value: n.actionId,
|
|
646
646
|
label: n.actionDescription,
|
|
647
647
|
nodeProps: {
|
|
648
|
-
granted:
|
|
648
|
+
granted: x.includes(n.actionId) && G?.types?.includes(le(k, f)),
|
|
649
649
|
owner: s
|
|
650
650
|
}
|
|
651
651
|
};
|
|
652
652
|
})
|
|
653
|
-
})), [P,
|
|
653
|
+
})), [P, C, x, f, Z]), m = ge(async () => {
|
|
654
654
|
if (l) {
|
|
655
655
|
const s = await q.getPermissionsBySecurityId(l, f), n = await q.getAllPermissionsAvailable();
|
|
656
|
-
|
|
656
|
+
p(n), i(s);
|
|
657
657
|
}
|
|
658
658
|
}, [l, f]), ce = ge(() => {
|
|
659
659
|
c?.value && l && q.createPermission(l, c.value, f).then((s) => {
|
|
660
660
|
if (s) {
|
|
661
661
|
i((E) => {
|
|
662
|
-
let
|
|
663
|
-
return E.map((j) => j.resourceId).includes(s.resourceId) ?
|
|
662
|
+
let A;
|
|
663
|
+
return E.map((j) => j.resourceId).includes(s.resourceId) ? A = E.map((j) => j.resourceId === s.resourceId ? j.permissions.map((T) => T.actionId).includes(c.value) ? {
|
|
664
664
|
...j,
|
|
665
665
|
permissions: j.permissions.map(
|
|
666
|
-
(
|
|
667
|
-
...
|
|
666
|
+
(T) => T.actionId === c.value ? {
|
|
667
|
+
...T,
|
|
668
668
|
permissionId: s.permissionId,
|
|
669
|
-
types: [...
|
|
670
|
-
} :
|
|
669
|
+
types: [...T.types ?? [], le(k, f)]
|
|
670
|
+
} : T
|
|
671
671
|
)
|
|
672
672
|
} : {
|
|
673
673
|
...j,
|
|
@@ -677,10 +677,10 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
677
677
|
actionId: s.actionId,
|
|
678
678
|
actionDescription: s.actionDescription,
|
|
679
679
|
permissionId: s.permissionId,
|
|
680
|
-
types: [le(
|
|
680
|
+
types: [le(k, f)]
|
|
681
681
|
}
|
|
682
682
|
]
|
|
683
|
-
} : j) :
|
|
683
|
+
} : j) : A = [
|
|
684
684
|
...E,
|
|
685
685
|
{
|
|
686
686
|
resourceId: s.resourceId,
|
|
@@ -690,46 +690,46 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
690
690
|
actionId: s.actionId,
|
|
691
691
|
actionDescription: s.actionDescription,
|
|
692
692
|
permissionId: s.permissionId,
|
|
693
|
-
types: [le(
|
|
693
|
+
types: [le(k, f)]
|
|
694
694
|
}
|
|
695
695
|
]
|
|
696
696
|
}
|
|
697
|
-
],
|
|
697
|
+
], A;
|
|
698
698
|
});
|
|
699
|
-
const n = g.filter((E) => E.value === c?.nodeProps?.owner?.resourceId).map((E) => E.children).flat(), G = n.map((E) => E.value).indexOf(c.value),
|
|
700
|
-
|
|
699
|
+
const n = g.filter((E) => E.value === c?.nodeProps?.owner?.resourceId).map((E) => E.children).flat(), G = n.map((E) => E.value).indexOf(c.value), v = n.find((E, A) => !E?.nodeProps?.granted && E?.value !== c.value && (n.length > G + 1 ? A > G : !0));
|
|
700
|
+
v?.value && S.select(v.value), u.expand(s.resourceId), L(v);
|
|
701
701
|
}
|
|
702
702
|
});
|
|
703
|
-
}, [c, l, f, q, g, P,
|
|
703
|
+
}, [c, l, f, q, g, P, C, S, u]), ne = ge(() => {
|
|
704
704
|
b?.nodeProps?.permissionId && q.deletePermission(b.nodeProps.permissionId).then(() => {
|
|
705
|
-
i((
|
|
705
|
+
i((v) => [...v].filter((A) => {
|
|
706
706
|
let j = !0;
|
|
707
|
-
return
|
|
708
|
-
|
|
707
|
+
return A.permissions?.forEach((T) => {
|
|
708
|
+
T.permissionId !== void 0 && T.permissionId === b?.nodeProps?.permissionId && A.permissions.length === 1 && T?.types?.length === 1 && T.types[0] === le(k, f) && (j = !1);
|
|
709
709
|
}), j;
|
|
710
|
-
}).map((
|
|
710
|
+
}).map((A) => {
|
|
711
711
|
const j = b?.nodeProps?.owner;
|
|
712
|
-
return
|
|
713
|
-
...
|
|
714
|
-
permissions: [...(
|
|
712
|
+
return A.resourceId === j.resourceId ? b?.nodeProps?.types?.length === 1 ? {
|
|
713
|
+
...A,
|
|
714
|
+
permissions: [...(A.permissions ?? []).filter((T) => T.permissionId !== b?.nodeProps?.permissionId)]
|
|
715
715
|
} : {
|
|
716
|
-
...
|
|
717
|
-
permissions: (
|
|
718
|
-
actionId:
|
|
719
|
-
actionDescription:
|
|
720
|
-
types: [...
|
|
721
|
-
} :
|
|
722
|
-
} :
|
|
716
|
+
...A,
|
|
717
|
+
permissions: (A.permissions ?? []).map((T) => T.actionId === b.value ? {
|
|
718
|
+
actionId: T.actionId,
|
|
719
|
+
actionDescription: T.actionDescription,
|
|
720
|
+
types: [...T.types?.filter((de) => de && de !== le(k, f)) ?? []]
|
|
721
|
+
} : T)
|
|
722
|
+
} : A;
|
|
723
723
|
}));
|
|
724
|
-
const s = W.filter((
|
|
724
|
+
const s = W.filter((v) => v.value === b?.nodeProps?.owner?.resourceId).map((v) => v.children).flat(), n = s.map((v) => v.value).indexOf(b.value), G = s.find((v, E) => v?.nodeProps?.types.includes(le(k, f)) && v?.value !== b.value && (s.length > n + 1 ? E > n : !0));
|
|
725
725
|
G?.value && u.select(G.value), re(G);
|
|
726
726
|
});
|
|
727
|
-
}, [b, q, f, W,
|
|
728
|
-
return
|
|
727
|
+
}, [b, q, f, W, C, u]);
|
|
728
|
+
return Re(() => {
|
|
729
729
|
h && r && (L(void 0), re(void 0), ae(""), N(""), u.collapseAllNodes(), S.collapseAllNodes(), m());
|
|
730
|
-
}, [h, f, l, m]), r ? /* @__PURE__ */ e.jsx(
|
|
731
|
-
/* @__PURE__ */ e.jsx(ha, { children: /* @__PURE__ */ e.jsx(
|
|
732
|
-
/* @__PURE__ */ e.jsxs(
|
|
730
|
+
}, [h, f, l, m]), r ? /* @__PURE__ */ e.jsx(Fe, { opened: h, onClose: w, title: `${t().t(`archbase:${f}`)}: ${d}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ e.jsxs(ua, { height: "540px", children: [
|
|
731
|
+
/* @__PURE__ */ e.jsx(ha, { children: /* @__PURE__ */ e.jsx(Y, { withBorder: !0, my: 20, p: 20, style: { height: "calc(100% - 40px)", overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ e.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "row", overflow: "hidden", minHeight: 0, gap: "8px" }, children: [
|
|
732
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
|
|
733
733
|
/* @__PURE__ */ e.jsxs($, { mb: 20, children: [
|
|
734
734
|
/* @__PURE__ */ e.jsx(H, { children: t().t("archbase:Available") }),
|
|
735
735
|
/* @__PURE__ */ e.jsx(
|
|
@@ -742,34 +742,34 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
742
742
|
}
|
|
743
743
|
)
|
|
744
744
|
] }),
|
|
745
|
-
/* @__PURE__ */ e.jsx(
|
|
745
|
+
/* @__PURE__ */ e.jsx(ye, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e.jsx(
|
|
746
746
|
Ye,
|
|
747
747
|
{
|
|
748
748
|
data: g,
|
|
749
749
|
selectOnClick: !0,
|
|
750
750
|
allowRangeSelection: !1,
|
|
751
751
|
tree: S,
|
|
752
|
-
renderNode: ({ level: s, node: n, expanded: G, hasChildren:
|
|
753
|
-
const j = n?.nodeProps?.granted,
|
|
754
|
-
L(n),
|
|
755
|
-
}, [n,
|
|
752
|
+
renderNode: ({ level: s, node: n, expanded: G, hasChildren: v, selected: E, elementProps: A }) => {
|
|
753
|
+
const j = n?.nodeProps?.granted, T = j ? "dimmed" : void 0, de = j ? "line-through" : void 0, V = ge((Pe) => {
|
|
754
|
+
L(n), A.onClick(Pe);
|
|
755
|
+
}, [n, A.onClick]);
|
|
756
756
|
return /* @__PURE__ */ e.jsxs(
|
|
757
757
|
$,
|
|
758
758
|
{
|
|
759
|
-
ml:
|
|
759
|
+
ml: v ? 0 : 5,
|
|
760
760
|
gap: 5,
|
|
761
|
-
...
|
|
762
|
-
bg: E && s === 2 ?
|
|
761
|
+
...A,
|
|
762
|
+
bg: E && s === 2 ? R : "",
|
|
763
763
|
onClick: V,
|
|
764
764
|
children: [
|
|
765
|
-
|
|
765
|
+
v && /* @__PURE__ */ e.jsx(
|
|
766
766
|
Ke,
|
|
767
767
|
{
|
|
768
768
|
size: 18,
|
|
769
769
|
style: { transform: G ? "rotate(0deg)" : "rotate(-90deg)" }
|
|
770
770
|
}
|
|
771
771
|
),
|
|
772
|
-
!
|
|
772
|
+
!v && /* @__PURE__ */ e.jsx(
|
|
773
773
|
_e,
|
|
774
774
|
{
|
|
775
775
|
size: 12,
|
|
@@ -779,7 +779,7 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
779
779
|
/* @__PURE__ */ e.jsx(
|
|
780
780
|
H,
|
|
781
781
|
{
|
|
782
|
-
c:
|
|
782
|
+
c: T,
|
|
783
783
|
td: de,
|
|
784
784
|
children: or(n.label)
|
|
785
785
|
}
|
|
@@ -789,53 +789,53 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
789
789
|
);
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
|
-
)
|
|
792
|
+
) })
|
|
793
793
|
] }),
|
|
794
|
-
/* @__PURE__ */ e.jsx(
|
|
794
|
+
/* @__PURE__ */ e.jsx("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e.jsxs(oe, { gap: 5, align: "center", children: [
|
|
795
795
|
/* @__PURE__ */ e.jsx(se, { label: t().t("archbase:Add"), children: /* @__PURE__ */ e.jsx(B, { onClick: ce, disabled: !c || c?.nodeProps?.granted || !c.nodeProps, children: /* @__PURE__ */ e.jsx(lr, {}) }) }),
|
|
796
796
|
/* @__PURE__ */ e.jsx(se, { label: t().t("archbase:Remove"), children: /* @__PURE__ */ e.jsx(B, { onClick: ne, disabled: !b || !b?.nodeProps?.permissionId || !b.nodeProps, children: /* @__PURE__ */ e.jsx(cr, {}) }) })
|
|
797
797
|
] }) }),
|
|
798
|
-
/* @__PURE__ */ e.jsxs(
|
|
798
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
|
|
799
799
|
/* @__PURE__ */ e.jsxs($, { mb: 20, children: [
|
|
800
800
|
/* @__PURE__ */ e.jsx(H, { children: t().t("archbase:Granted") }),
|
|
801
801
|
/* @__PURE__ */ e.jsx(
|
|
802
802
|
Qe,
|
|
803
803
|
{
|
|
804
804
|
size: "xs",
|
|
805
|
-
value:
|
|
805
|
+
value: F,
|
|
806
806
|
onChange: (s) => N(s.target.value),
|
|
807
807
|
placeholder: t().t("archbase:Filter granted permissions")
|
|
808
808
|
}
|
|
809
809
|
)
|
|
810
810
|
] }),
|
|
811
|
-
/* @__PURE__ */ e.jsx(
|
|
811
|
+
/* @__PURE__ */ e.jsx(ye, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e.jsx(
|
|
812
812
|
Ye,
|
|
813
813
|
{
|
|
814
814
|
data: W,
|
|
815
815
|
selectOnClick: !0,
|
|
816
816
|
allowRangeSelection: !1,
|
|
817
817
|
tree: u,
|
|
818
|
-
renderNode: ({ level: s, node: n, expanded: G, hasChildren:
|
|
819
|
-
const j = ge((
|
|
820
|
-
re(n),
|
|
821
|
-
}, [n,
|
|
818
|
+
renderNode: ({ level: s, node: n, expanded: G, hasChildren: v, selected: E, elementProps: A }) => {
|
|
819
|
+
const j = ge((T) => {
|
|
820
|
+
re(n), A.onClick(T);
|
|
821
|
+
}, [n, A.onClick]);
|
|
822
822
|
return /* @__PURE__ */ e.jsxs(
|
|
823
823
|
$,
|
|
824
824
|
{
|
|
825
|
-
ml:
|
|
825
|
+
ml: v ? 0 : 5,
|
|
826
826
|
gap: 5,
|
|
827
|
-
...
|
|
828
|
-
bg: E && s === 2 ?
|
|
827
|
+
...A,
|
|
828
|
+
bg: E && s === 2 ? R : "",
|
|
829
829
|
onClick: j,
|
|
830
830
|
children: [
|
|
831
|
-
|
|
831
|
+
v && /* @__PURE__ */ e.jsx(
|
|
832
832
|
Ke,
|
|
833
833
|
{
|
|
834
834
|
size: 18,
|
|
835
835
|
style: { transform: G ? "rotate(0deg)" : "rotate(-90deg)" }
|
|
836
836
|
}
|
|
837
837
|
),
|
|
838
|
-
!
|
|
838
|
+
!v && /* @__PURE__ */ e.jsx(
|
|
839
839
|
_e,
|
|
840
840
|
{
|
|
841
841
|
size: 12,
|
|
@@ -843,21 +843,21 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
843
843
|
}
|
|
844
844
|
),
|
|
845
845
|
/* @__PURE__ */ e.jsx(H, { children: or(n.label) }),
|
|
846
|
-
n?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e.jsx(
|
|
847
|
-
n?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e.jsx(
|
|
848
|
-
n?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e.jsx(
|
|
846
|
+
n?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e.jsx(Se, { color: "blue", children: t().t("archbase:user") }),
|
|
847
|
+
n?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e.jsx(Se, { color: "orange", children: t().t("archbase:group") }),
|
|
848
|
+
n?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e.jsx(Se, { color: "pink", children: t().t("archbase:profile") })
|
|
849
849
|
]
|
|
850
850
|
}
|
|
851
851
|
);
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
|
-
)
|
|
854
|
+
) })
|
|
855
855
|
] })
|
|
856
|
-
] }) }) })
|
|
857
|
-
/* @__PURE__ */ e.jsx(
|
|
856
|
+
] }) }) }),
|
|
857
|
+
/* @__PURE__ */ e.jsx(xa, { size: "40px", children: /* @__PURE__ */ e.jsx($, { justify: "flex-end", children: /* @__PURE__ */ e.jsx(U, { onClick: w, children: t().t("archbase:Close") }) }) })
|
|
858
858
|
] }) }) : null;
|
|
859
859
|
}
|
|
860
|
-
const Ne = "data:image/png;base64,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", Sa = (r) => r.groups ? /* @__PURE__ */ e.jsx("div", { style: { display: "flex" }, children: r.groups ? r.groups.map((h, w) => /* @__PURE__ */ e.jsx("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e.jsx(
|
|
860
|
+
const Ne = "data:image/png;base64,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", Sa = (r) => r.groups ? /* @__PURE__ */ e.jsx("div", { style: { display: "flex" }, children: r.groups ? r.groups.map((h, w) => /* @__PURE__ */ e.jsx("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e.jsx(Se, { color: "blue", children: h.group?.name }) }, w)) : null }) : null, Aa = (r) => r.profile ? /* @__PURE__ */ e.jsx(Se, { color: "green", children: r.profile?.name }) : null;
|
|
861
861
|
function $a({
|
|
862
862
|
height: r = "400px",
|
|
863
863
|
width: h = "100%",
|
|
@@ -869,11 +869,11 @@ function $a({
|
|
|
869
869
|
}) {
|
|
870
870
|
const u = nr();
|
|
871
871
|
ir("securityStore");
|
|
872
|
-
const P = Qr(), { colorScheme:
|
|
873
|
-
dataSource:
|
|
872
|
+
const P = Qr(), { colorScheme: p } = Oe(), [C, i] = M(void 0), [c, L] = M("users"), b = _(X.User), re = _(X.Group), J = _(X.Resource), ae = _(X.Profile), [Z, F] = M(""), [N, I] = M(""), q = _(X.AccessToken), { t: o } = Yr(), R = je(null), W = je(null), x = je(null), g = je(null), m = je(null), ce = (a) => a.id, ne = (a) => a.id, s = (a) => a.id, n = (a) => a.id, G = (a) => a.id, {
|
|
873
|
+
dataSource: v,
|
|
874
874
|
isLoading: E,
|
|
875
|
-
refreshData:
|
|
876
|
-
} =
|
|
875
|
+
refreshData: A
|
|
876
|
+
} = we({
|
|
877
877
|
name: "accessTokenApi",
|
|
878
878
|
service: q,
|
|
879
879
|
validator: P,
|
|
@@ -884,9 +884,9 @@ function $a({
|
|
|
884
884
|
}
|
|
885
885
|
}), {
|
|
886
886
|
dataSource: j,
|
|
887
|
-
isLoading:
|
|
887
|
+
isLoading: T,
|
|
888
888
|
refreshData: de
|
|
889
|
-
} =
|
|
889
|
+
} = we({
|
|
890
890
|
name: "dsUsers",
|
|
891
891
|
service: b,
|
|
892
892
|
validator: P,
|
|
@@ -898,7 +898,7 @@ function $a({
|
|
|
898
898
|
dataSource: V,
|
|
899
899
|
isLoading: Pe,
|
|
900
900
|
refreshData: dr
|
|
901
|
-
} =
|
|
901
|
+
} = we({
|
|
902
902
|
name: "dsGroups",
|
|
903
903
|
service: re,
|
|
904
904
|
validator: P,
|
|
@@ -910,7 +910,7 @@ function $a({
|
|
|
910
910
|
dataSource: O,
|
|
911
911
|
isLoading: ur,
|
|
912
912
|
refreshData: hr
|
|
913
|
-
} =
|
|
913
|
+
} = we({
|
|
914
914
|
name: "dsProfile",
|
|
915
915
|
service: ae,
|
|
916
916
|
validator: P,
|
|
@@ -919,10 +919,10 @@ function $a({
|
|
|
919
919
|
i(a), Q.showError(`${o("archbase:WARNING")}`, a, z);
|
|
920
920
|
}
|
|
921
921
|
}), {
|
|
922
|
-
dataSource:
|
|
923
|
-
isLoading:
|
|
922
|
+
dataSource: xr,
|
|
923
|
+
isLoading: pr,
|
|
924
924
|
refreshData: fr
|
|
925
|
-
} =
|
|
925
|
+
} = we({
|
|
926
926
|
name: "dsResources",
|
|
927
927
|
service: J,
|
|
928
928
|
validator: P,
|
|
@@ -931,8 +931,8 @@ function $a({
|
|
|
931
931
|
i(a), Q.showError(`${o("archbase:WARNING")}`, a, z);
|
|
932
932
|
}
|
|
933
933
|
});
|
|
934
|
-
|
|
935
|
-
|
|
934
|
+
Re(() => {
|
|
935
|
+
A({ filter: ze(Te.eq("revoked", "false")) }), de(), dr(), hr(), fr();
|
|
936
936
|
}, []);
|
|
937
937
|
const mr = /* @__PURE__ */ e.jsxs(me, { children: [
|
|
938
938
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1231,10 +1231,10 @@ function $a({
|
|
|
1231
1231
|
)
|
|
1232
1232
|
] }), wr = () => {
|
|
1233
1233
|
const a = sa.newInstance();
|
|
1234
|
-
w || (a.id = void 0), j.insert(a),
|
|
1235
|
-
}, Cr = (a) => {
|
|
1236
|
-
j.isEmpty() || j.gotoRecordByData(a) && (j.edit(), I(R.USER));
|
|
1234
|
+
w || (a.id = void 0), j.insert(a), F(k.USER);
|
|
1237
1235
|
}, vr = (a) => {
|
|
1236
|
+
j.isEmpty() || j.gotoRecordByData(a) && (j.edit(), F(k.USER));
|
|
1237
|
+
}, Cr = (a) => {
|
|
1238
1238
|
j.isEmpty() || j.gotoRecordByData(a) && K.showConfirmDialogYesNo(
|
|
1239
1239
|
`${o("archbase:Confirme")}`,
|
|
1240
1240
|
`${o("archbase:Deseja remover o usuário ")}${a.name} ?`,
|
|
@@ -1245,19 +1245,19 @@ function $a({
|
|
|
1245
1245
|
}
|
|
1246
1246
|
);
|
|
1247
1247
|
}, Sr = (a) => {
|
|
1248
|
-
j.isEmpty() || j.gotoRecordByData(a) &&
|
|
1248
|
+
j.isEmpty() || j.gotoRecordByData(a) && F(k.USER);
|
|
1249
1249
|
}, Ar = (a) => /* @__PURE__ */ e.jsxs($, { gap: 1, wrap: "nowrap", children: [
|
|
1250
1250
|
S?.beforeDefaultUserActions?.(a),
|
|
1251
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Sr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color:
|
|
1252
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () =>
|
|
1253
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () =>
|
|
1254
|
-
/* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: Be, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color:
|
|
1251
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Sr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: p === "dark" ? u.colors.blue[8] : u.colors.blue[4] }) }),
|
|
1252
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => vr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color: p === "dark" ? u.colors.yellow[8] : u.colors.yellow[4] }) }),
|
|
1253
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Cr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: p === "dark" ? u.colors.red[8] : u.colors.red[4] }) }),
|
|
1254
|
+
/* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: Be, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: p === "dark" ? u.colors.green[8] : u.colors.green[4] }) }) }),
|
|
1255
1255
|
S?.afterDefaultUserActions?.(a)
|
|
1256
1256
|
] }), Tr = () => {
|
|
1257
1257
|
const a = na.newInstance();
|
|
1258
|
-
w || (a.id = void 0), V.insert(a),
|
|
1258
|
+
w || (a.id = void 0), V.insert(a), F(k.GROUP);
|
|
1259
1259
|
}, kr = (a) => {
|
|
1260
|
-
V.isEmpty() || V.gotoRecordByData(a) && (V.isEditing() || V.edit(),
|
|
1260
|
+
V.isEmpty() || V.gotoRecordByData(a) && (V.isEditing() || V.edit(), F(k.GROUP));
|
|
1261
1261
|
}, Rr = (a) => {
|
|
1262
1262
|
V.isEmpty() || V.gotoRecordByData(a) && K.showConfirmDialogYesNo(
|
|
1263
1263
|
`${o("archbase:Confirme")}`,
|
|
@@ -1269,46 +1269,46 @@ function $a({
|
|
|
1269
1269
|
}
|
|
1270
1270
|
);
|
|
1271
1271
|
}, Fr = (a) => {
|
|
1272
|
-
V.isEmpty() || V.gotoRecordByData(a) &&
|
|
1273
|
-
},
|
|
1272
|
+
V.isEmpty() || V.gotoRecordByData(a) && F(k.GROUP);
|
|
1273
|
+
}, Dr = (a) => /* @__PURE__ */ e.jsxs($, { gap: 1, wrap: "nowrap", children: [
|
|
1274
1274
|
S?.beforeDefaultGroupActions?.(a),
|
|
1275
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Fr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color:
|
|
1276
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => kr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color:
|
|
1277
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Rr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color:
|
|
1278
|
-
/* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: We, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color:
|
|
1275
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Fr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: p === "dark" ? u.colors.blue[8] : u.colors.blue[4] }) }),
|
|
1276
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => kr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color: p === "dark" ? u.colors.yellow[8] : u.colors.yellow[4] }) }),
|
|
1277
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Rr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: p === "dark" ? u.colors.red[8] : u.colors.red[4] }) }),
|
|
1278
|
+
/* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: We, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: p === "dark" ? u.colors.green[8] : u.colors.green[4] }) }) }),
|
|
1279
1279
|
S?.afterDefaultGroupActions?.(a)
|
|
1280
|
-
] }), ue = Xr(),
|
|
1280
|
+
] }), ue = Xr(), Ir = async () => {
|
|
1281
1281
|
try {
|
|
1282
1282
|
await j.save();
|
|
1283
1283
|
} catch {
|
|
1284
1284
|
return;
|
|
1285
1285
|
}
|
|
1286
|
-
|
|
1286
|
+
F(""), ue?.clearAll();
|
|
1287
1287
|
}, Er = () => {
|
|
1288
|
-
|
|
1288
|
+
F(""), j.isBrowsing() || j.cancel(), ue?.clearAll();
|
|
1289
1289
|
}, zr = async () => {
|
|
1290
1290
|
try {
|
|
1291
1291
|
await V.save();
|
|
1292
1292
|
} catch {
|
|
1293
1293
|
return;
|
|
1294
1294
|
}
|
|
1295
|
-
|
|
1295
|
+
F(""), ue?.clearAll();
|
|
1296
1296
|
}, Pr = () => {
|
|
1297
|
-
|
|
1297
|
+
F(""), V.isBrowsing() || V.cancel(), ue?.clearAll();
|
|
1298
1298
|
}, Gr = async () => {
|
|
1299
1299
|
try {
|
|
1300
1300
|
await O.save();
|
|
1301
1301
|
} catch {
|
|
1302
1302
|
return;
|
|
1303
1303
|
}
|
|
1304
|
-
|
|
1304
|
+
F(""), ue?.clearAll();
|
|
1305
1305
|
}, $r = () => {
|
|
1306
|
-
|
|
1306
|
+
F(""), O.isBrowsing() || O.cancel(), ue?.clearAll();
|
|
1307
1307
|
}, Lr = () => {
|
|
1308
1308
|
const a = ia.newInstance();
|
|
1309
|
-
w || (a.id = void 0), O.insert(a),
|
|
1309
|
+
w || (a.id = void 0), O.insert(a), F(k.PROFILE);
|
|
1310
1310
|
}, Vr = (a) => {
|
|
1311
|
-
O.isEmpty() || O.gotoRecordByData(a) && (O.isEditing() || O.edit(),
|
|
1311
|
+
O.isEmpty() || O.gotoRecordByData(a) && (O.isEditing() || O.edit(), F(k.PROFILE));
|
|
1312
1312
|
}, Ur = (a) => {
|
|
1313
1313
|
O.isEmpty() || O.gotoRecordByData(a) && K.showConfirmDialogYesNo(
|
|
1314
1314
|
`${o("archbase:Confirme")}`,
|
|
@@ -1320,16 +1320,16 @@ function $a({
|
|
|
1320
1320
|
}
|
|
1321
1321
|
);
|
|
1322
1322
|
}, Mr = (a) => {
|
|
1323
|
-
O.isEmpty() || O.gotoRecordByData(a) &&
|
|
1323
|
+
O.isEmpty() || O.gotoRecordByData(a) && F(k.PROFILE);
|
|
1324
1324
|
}, Nr = (a) => /* @__PURE__ */ e.jsxs($, { gap: 1, wrap: "nowrap", children: [
|
|
1325
1325
|
S?.beforeDefaultProfileActions?.(a),
|
|
1326
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Mr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color:
|
|
1327
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Vr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color:
|
|
1328
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Ur(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color:
|
|
1329
|
-
/* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: qe, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color:
|
|
1326
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Mr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: p === "dark" ? u.colors.blue[8] : u.colors.blue[4] }) }),
|
|
1327
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Vr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color: p === "dark" ? u.colors.yellow[8] : u.colors.yellow[4] }) }),
|
|
1328
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Ur(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: p === "dark" ? u.colors.red[8] : u.colors.red[4] }) }),
|
|
1329
|
+
/* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: qe, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: p === "dark" ? u.colors.green[8] : u.colors.green[4] }) }) }),
|
|
1330
1330
|
S?.afterDefaultProfileActions?.(a)
|
|
1331
1331
|
] }), Or = () => {
|
|
1332
|
-
const a =
|
|
1332
|
+
const a = v.getCurrentRecord();
|
|
1333
1333
|
a && K.showConfirmDialogYesNo(
|
|
1334
1334
|
`${o("archbase:Confirme")}`,
|
|
1335
1335
|
`${o("archbase:Deseja revogar o token de Acesso do usuário ")}${a.user.name} ?`,
|
|
@@ -1338,12 +1338,12 @@ function $a({
|
|
|
1338
1338
|
Q.showSuccess(
|
|
1339
1339
|
`${o("mentors:Informação")}`,
|
|
1340
1340
|
`${o("mentors:Token de Acesso revogado com sucesso!")}`
|
|
1341
|
-
),
|
|
1341
|
+
), v.refreshData();
|
|
1342
1342
|
}).catch((z) => {
|
|
1343
1343
|
K.showErrorWithDetails(
|
|
1344
1344
|
`${o("mentors:Atenção")}`,
|
|
1345
|
-
|
|
1346
|
-
|
|
1345
|
+
Ae(z),
|
|
1346
|
+
Ie(z)
|
|
1347
1347
|
);
|
|
1348
1348
|
});
|
|
1349
1349
|
},
|
|
@@ -1351,13 +1351,13 @@ function $a({
|
|
|
1351
1351
|
}
|
|
1352
1352
|
);
|
|
1353
1353
|
}, Be = () => {
|
|
1354
|
-
|
|
1354
|
+
I(k.USER);
|
|
1355
1355
|
}, We = () => {
|
|
1356
|
-
|
|
1356
|
+
I(k.GROUP);
|
|
1357
1357
|
}, qe = () => {
|
|
1358
|
-
|
|
1358
|
+
I(k.PROFILE);
|
|
1359
1359
|
}, Ge = () => {
|
|
1360
|
-
|
|
1360
|
+
I("");
|
|
1361
1361
|
}, Br = () => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", style: { width: "50%" }, children: [
|
|
1362
1362
|
/* @__PURE__ */ e.jsxs($, { align: "end", gap: "4px", wrap: "nowrap", children: [
|
|
1363
1363
|
/* @__PURE__ */ e.jsx(U, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Ee, {}), onClick: wr, children: `${o("archbase:New")}` }),
|
|
@@ -1379,7 +1379,7 @@ function $a({
|
|
|
1379
1379
|
] }), Hr = () => /* @__PURE__ */ e.jsx(te, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsx($, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e.jsx(
|
|
1380
1380
|
U,
|
|
1381
1381
|
{
|
|
1382
|
-
disabled: !
|
|
1382
|
+
disabled: !v.getCurrentRecord(),
|
|
1383
1383
|
color: "red",
|
|
1384
1384
|
leftSection: /* @__PURE__ */ e.jsx(Ce, {}),
|
|
1385
1385
|
onClick: Or,
|
|
@@ -1409,7 +1409,7 @@ function $a({
|
|
|
1409
1409
|
children: /* @__PURE__ */ e.jsx(
|
|
1410
1410
|
be,
|
|
1411
1411
|
{
|
|
1412
|
-
gridRef:
|
|
1412
|
+
gridRef: R,
|
|
1413
1413
|
printTitle: "Usuários",
|
|
1414
1414
|
width: "100%",
|
|
1415
1415
|
height: "100%",
|
|
@@ -1420,9 +1420,9 @@ function $a({
|
|
|
1420
1420
|
enableTopToolbar: !0,
|
|
1421
1421
|
enableRowActions: !0,
|
|
1422
1422
|
pageSize: 50,
|
|
1423
|
-
isLoading:
|
|
1424
|
-
isError: !!
|
|
1425
|
-
error:
|
|
1423
|
+
isLoading: T,
|
|
1424
|
+
isError: !!C,
|
|
1425
|
+
error: C,
|
|
1426
1426
|
enableGlobalFilter: !0,
|
|
1427
1427
|
getRowId: ce,
|
|
1428
1428
|
toolbarLeftContent: Br(),
|
|
@@ -1459,11 +1459,11 @@ function $a({
|
|
|
1459
1459
|
enableRowActions: !0,
|
|
1460
1460
|
pageSize: 50,
|
|
1461
1461
|
isLoading: Pe,
|
|
1462
|
-
isError: !!
|
|
1463
|
-
error:
|
|
1462
|
+
isError: !!C,
|
|
1463
|
+
error: C,
|
|
1464
1464
|
enableGlobalFilter: !0,
|
|
1465
1465
|
getRowId: ne,
|
|
1466
|
-
renderRowActions:
|
|
1466
|
+
renderRowActions: Dr,
|
|
1467
1467
|
actionsColumnWidth: S?.groupActionsColumnWidth,
|
|
1468
1468
|
children: gr,
|
|
1469
1469
|
toolbarLeftContent: Wr()
|
|
@@ -1485,7 +1485,7 @@ function $a({
|
|
|
1485
1485
|
children: /* @__PURE__ */ e.jsx(
|
|
1486
1486
|
be,
|
|
1487
1487
|
{
|
|
1488
|
-
gridRef:
|
|
1488
|
+
gridRef: x,
|
|
1489
1489
|
printTitle: "Perfis",
|
|
1490
1490
|
width: "100%",
|
|
1491
1491
|
height: "100%",
|
|
@@ -1497,8 +1497,8 @@ function $a({
|
|
|
1497
1497
|
enableRowActions: !0,
|
|
1498
1498
|
pageSize: 50,
|
|
1499
1499
|
isLoading: ur,
|
|
1500
|
-
isError: !!
|
|
1501
|
-
error:
|
|
1500
|
+
isError: !!C,
|
|
1501
|
+
error: C,
|
|
1502
1502
|
enableGlobalFilter: !0,
|
|
1503
1503
|
getRowId: s,
|
|
1504
1504
|
toolbarLeftContent: qr(),
|
|
@@ -1528,15 +1528,15 @@ function $a({
|
|
|
1528
1528
|
width: "100%",
|
|
1529
1529
|
height: "100%",
|
|
1530
1530
|
withBorder: !1,
|
|
1531
|
-
dataSource:
|
|
1531
|
+
dataSource: xr,
|
|
1532
1532
|
withColumnBorders: !0,
|
|
1533
1533
|
striped: !1,
|
|
1534
1534
|
enableTopToolbar: !0,
|
|
1535
1535
|
enableRowActions: !1,
|
|
1536
1536
|
pageSize: 50,
|
|
1537
|
-
isLoading:
|
|
1538
|
-
isError: !!
|
|
1539
|
-
error:
|
|
1537
|
+
isLoading: pr,
|
|
1538
|
+
isError: !!C,
|
|
1539
|
+
error: C,
|
|
1540
1540
|
enableGlobalFilter: !0,
|
|
1541
1541
|
getRowId: n,
|
|
1542
1542
|
children: yr
|
|
@@ -1564,15 +1564,15 @@ function $a({
|
|
|
1564
1564
|
width: "100%",
|
|
1565
1565
|
height: "100%",
|
|
1566
1566
|
withBorder: !1,
|
|
1567
|
-
dataSource:
|
|
1567
|
+
dataSource: v,
|
|
1568
1568
|
withColumnBorders: !0,
|
|
1569
1569
|
striped: !0,
|
|
1570
1570
|
enableTopToolbar: !0,
|
|
1571
1571
|
enableRowActions: !1,
|
|
1572
1572
|
pageSize: 50,
|
|
1573
1573
|
isLoading: E,
|
|
1574
|
-
isError: !!
|
|
1575
|
-
error:
|
|
1574
|
+
isError: !!C,
|
|
1575
|
+
error: C,
|
|
1576
1576
|
enableGlobalFilter: !0,
|
|
1577
1577
|
getRowId: G,
|
|
1578
1578
|
toolbarLeftContent: Hr(),
|
|
@@ -1581,17 +1581,17 @@ function $a({
|
|
|
1581
1581
|
)
|
|
1582
1582
|
}
|
|
1583
1583
|
),
|
|
1584
|
-
Z ===
|
|
1584
|
+
Z === k.USER ? /* @__PURE__ */ e.jsx(
|
|
1585
1585
|
ya,
|
|
1586
1586
|
{
|
|
1587
|
-
onClickOk:
|
|
1587
|
+
onClickOk: Ir,
|
|
1588
1588
|
opened: !0,
|
|
1589
1589
|
dataSource: j,
|
|
1590
1590
|
onClickCancel: Er,
|
|
1591
1591
|
options: d
|
|
1592
1592
|
}
|
|
1593
1593
|
) : null,
|
|
1594
|
-
Z ===
|
|
1594
|
+
Z === k.GROUP ? /* @__PURE__ */ e.jsx(
|
|
1595
1595
|
wa,
|
|
1596
1596
|
{
|
|
1597
1597
|
onClickOk: zr,
|
|
@@ -1601,7 +1601,7 @@ function $a({
|
|
|
1601
1601
|
options: f
|
|
1602
1602
|
}
|
|
1603
1603
|
) : null,
|
|
1604
|
-
Z ===
|
|
1604
|
+
Z === k.PROFILE ? /* @__PURE__ */ e.jsx(
|
|
1605
1605
|
ma,
|
|
1606
1606
|
{
|
|
1607
1607
|
onClickOk: Gr,
|
|
@@ -1611,7 +1611,7 @@ function $a({
|
|
|
1611
1611
|
options: l
|
|
1612
1612
|
}
|
|
1613
1613
|
) : null,
|
|
1614
|
-
N ===
|
|
1614
|
+
N === k.USER ? /* @__PURE__ */ e.jsx(
|
|
1615
1615
|
Ue,
|
|
1616
1616
|
{
|
|
1617
1617
|
dataSource: j,
|
|
@@ -1619,7 +1619,7 @@ function $a({
|
|
|
1619
1619
|
close: Ge
|
|
1620
1620
|
}
|
|
1621
1621
|
) : null,
|
|
1622
|
-
N ===
|
|
1622
|
+
N === k.GROUP ? /* @__PURE__ */ e.jsx(
|
|
1623
1623
|
Ue,
|
|
1624
1624
|
{
|
|
1625
1625
|
dataSource: V,
|
|
@@ -1627,7 +1627,7 @@ function $a({
|
|
|
1627
1627
|
close: Ge
|
|
1628
1628
|
}
|
|
1629
1629
|
) : null,
|
|
1630
|
-
N ===
|
|
1630
|
+
N === k.PROFILE ? /* @__PURE__ */ e.jsx(
|
|
1631
1631
|
Ue,
|
|
1632
1632
|
{
|
|
1633
1633
|
dataSource: O,
|
|
@@ -1639,10 +1639,10 @@ function $a({
|
|
|
1639
1639
|
}
|
|
1640
1640
|
function La({ height: r = "400px", width: h = "100%" }) {
|
|
1641
1641
|
nr();
|
|
1642
|
-
const w = ir("apiTokenStore"), d = { validateEntity: () => [] }, { colorScheme: l } = Oe(), [f, S] = M(void 0), u = _(X.ApiToken), [P,
|
|
1642
|
+
const w = ir("apiTokenStore"), d = { validateEntity: () => [] }, { colorScheme: l } = Oe(), [f, S] = M(void 0), u = _(X.ApiToken), [P, p] = M(""), C = je(null), i = (R) => R.id, { dataSource: c } = ta({
|
|
1643
1643
|
initialData: [],
|
|
1644
1644
|
name: "dataSource"
|
|
1645
|
-
}), L =
|
|
1645
|
+
}), L = ke(
|
|
1646
1646
|
"ArchbaseApiTokenView-LocalDataSource",
|
|
1647
1647
|
c,
|
|
1648
1648
|
void 0,
|
|
@@ -1654,14 +1654,14 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1654
1654
|
validator: d,
|
|
1655
1655
|
pageSize: 25,
|
|
1656
1656
|
loadOnStart: !0,
|
|
1657
|
-
onLoadComplete: (
|
|
1657
|
+
onLoadComplete: (R) => {
|
|
1658
1658
|
},
|
|
1659
|
-
onDestroy: (
|
|
1659
|
+
onDestroy: (R) => {
|
|
1660
1660
|
},
|
|
1661
|
-
onError: (
|
|
1662
|
-
S(
|
|
1661
|
+
onError: (R, W) => {
|
|
1662
|
+
S(R), Q.showError(t().t("archbase:WARNING"), R, W);
|
|
1663
1663
|
}
|
|
1664
|
-
}), J =
|
|
1664
|
+
}), J = ke(
|
|
1665
1665
|
"ArchbaseApiTokenView-RemoteDataSource",
|
|
1666
1666
|
b,
|
|
1667
1667
|
void 0,
|
|
@@ -1674,11 +1674,11 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1674
1674
|
dataType: "image",
|
|
1675
1675
|
size: 80,
|
|
1676
1676
|
header: "Foto",
|
|
1677
|
-
render: (
|
|
1677
|
+
render: (R) => /* @__PURE__ */ e.jsx(
|
|
1678
1678
|
"img",
|
|
1679
1679
|
{
|
|
1680
1680
|
style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
|
|
1681
|
-
src:
|
|
1681
|
+
src: R.row.user && R.row.user.avatar ? atob(R.row.user.avatar) : Ne
|
|
1682
1682
|
}
|
|
1683
1683
|
),
|
|
1684
1684
|
inputFilterType: "text",
|
|
@@ -1734,17 +1734,17 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1734
1734
|
dataType: "text",
|
|
1735
1735
|
size: 240,
|
|
1736
1736
|
header: "Validade",
|
|
1737
|
-
render: (
|
|
1738
|
-
if (!
|
|
1737
|
+
render: (R) => {
|
|
1738
|
+
if (!R.row.expirationDate)
|
|
1739
1739
|
return /* @__PURE__ */ e.jsx(H, { c: "dimmed", children: "Sem expiração" });
|
|
1740
1740
|
const W = /* @__PURE__ */ new Date();
|
|
1741
1741
|
W.setHours(0, 0, 0, 0);
|
|
1742
|
-
const
|
|
1743
|
-
|
|
1744
|
-
const g =
|
|
1742
|
+
const x = new Date(R.row.expirationDate);
|
|
1743
|
+
x.setHours(0, 0, 0, 0);
|
|
1744
|
+
const g = x.getTime() - W.getTime(), m = Math.ceil(g / (1e3 * 60 * 60 * 24));
|
|
1745
1745
|
let ne = Math.max(0, Math.min(100, m / 365 * 100)), s = "green", n = "";
|
|
1746
1746
|
m < 0 ? (s = "red", ne = 100, n = `Vencido há ${Math.abs(m)} dia${Math.abs(m) !== 1 ? "s" : ""}`) : m === 0 ? (s = "red", ne = 5, n = "Vence hoje") : m <= 7 ? (s = "red", n = `${m} dia${m !== 1 ? "s" : ""}`) : m <= 30 ? (s = "orange", n = `${m} dias`) : m <= 90 ? (s = "yellow", n = `${m} dias`) : (s = "green", n = `${m} dias`);
|
|
1747
|
-
const G = m < 0 ? `Vencido em ${
|
|
1747
|
+
const G = m < 0 ? `Vencido em ${x.toLocaleDateString()}` : `Expira em ${x.toLocaleDateString()}`;
|
|
1748
1748
|
return /* @__PURE__ */ e.jsx(se, { label: G, withArrow: !0, children: /* @__PURE__ */ e.jsxs($, { gap: "xs", wrap: "nowrap", children: [
|
|
1749
1749
|
/* @__PURE__ */ e.jsx(
|
|
1750
1750
|
Jr,
|
|
@@ -1779,8 +1779,8 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1779
1779
|
inputFilterType: "checkbox"
|
|
1780
1780
|
}
|
|
1781
1781
|
)
|
|
1782
|
-
] }),
|
|
1783
|
-
c.insert(la.newInstance()), c && !L.isDataSourceV2 && L.v1State.forceUpdate(),
|
|
1782
|
+
] }), F = () => {
|
|
1783
|
+
c.insert(la.newInstance()), c && !L.isDataSourceV2 && L.v1State.forceUpdate(), p("apiToken");
|
|
1784
1784
|
}, N = () => {
|
|
1785
1785
|
b.getCurrentRecord() && K.showConfirmDialogYesNo(
|
|
1786
1786
|
`${t().t("archbase:Confirme")}`,
|
|
@@ -1791,24 +1791,24 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1791
1791
|
`${t().t("mentors:Informação")}`,
|
|
1792
1792
|
`${t().t("mentors:Token de API revogado com sucesso!")}`
|
|
1793
1793
|
), b.refreshData(), b && !J.isDataSourceV2 && J.v1State.forceUpdate();
|
|
1794
|
-
}).catch((
|
|
1794
|
+
}).catch((R) => {
|
|
1795
1795
|
K.showErrorWithDetails(
|
|
1796
1796
|
`${t().t("mentors:Atenção")}`,
|
|
1797
|
-
|
|
1798
|
-
|
|
1797
|
+
Ae(R),
|
|
1798
|
+
Ie(R)
|
|
1799
1799
|
);
|
|
1800
1800
|
});
|
|
1801
1801
|
},
|
|
1802
1802
|
() => {
|
|
1803
1803
|
}
|
|
1804
1804
|
);
|
|
1805
|
-
},
|
|
1806
|
-
|
|
1807
|
-
}, q = async (
|
|
1808
|
-
const
|
|
1809
|
-
if (
|
|
1805
|
+
}, I = () => {
|
|
1806
|
+
p("");
|
|
1807
|
+
}, q = async (R, W) => {
|
|
1808
|
+
const x = c.getCurrentRecord();
|
|
1809
|
+
if (x)
|
|
1810
1810
|
try {
|
|
1811
|
-
if (c.validate(), !
|
|
1811
|
+
if (c.validate(), !x.user || !x.user.email) {
|
|
1812
1812
|
K.showErrorWithDetails(
|
|
1813
1813
|
`${t().t("archbase:WARNING")}`,
|
|
1814
1814
|
`${t().t("archbase:Selecione um usuário para o token de API")}`,
|
|
@@ -1816,7 +1816,7 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1816
1816
|
);
|
|
1817
1817
|
return;
|
|
1818
1818
|
}
|
|
1819
|
-
await u.create(
|
|
1819
|
+
await u.create(x.user.email, x.expirationDate, x.name, x.description).then(async (g) => {
|
|
1820
1820
|
c.cancel(), c && !L.isDataSourceV2 && L.v1State.forceUpdate(), b.append(g), b && !J.isDataSourceV2 && J.v1State.forceUpdate(), Q.showSuccess(
|
|
1821
1821
|
`${t().t("mentors:Informação")}`,
|
|
1822
1822
|
`${t().t("mentors:Token de API gerado com sucesso!")}`
|
|
@@ -1824,19 +1824,19 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1824
1824
|
}).catch((g) => {
|
|
1825
1825
|
K.showErrorWithDetails(
|
|
1826
1826
|
`${t().t("mentors:Atenção")}`,
|
|
1827
|
-
|
|
1828
|
-
|
|
1827
|
+
Ae(g),
|
|
1828
|
+
Ie(g)
|
|
1829
1829
|
);
|
|
1830
1830
|
});
|
|
1831
1831
|
} catch (g) {
|
|
1832
1832
|
K.showErrorWithDetails(
|
|
1833
1833
|
`${t().t("mentors:Atenção")}`,
|
|
1834
|
-
|
|
1835
|
-
|
|
1834
|
+
Ae(g),
|
|
1835
|
+
Ie(g)
|
|
1836
1836
|
);
|
|
1837
1837
|
}
|
|
1838
1838
|
}, o = () => /* @__PURE__ */ e.jsx(te, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsxs($, { align: "start", gap: "2px", wrap: "nowrap", children: [
|
|
1839
|
-
/* @__PURE__ */ e.jsx(U, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Ee, {}), onClick:
|
|
1839
|
+
/* @__PURE__ */ e.jsx(U, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Ee, {}), onClick: F, children: t().t("archbase:New") }),
|
|
1840
1840
|
/* @__PURE__ */ e.jsx(U, { disabled: !b.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e.jsx(Ce, {}), onClick: N, children: t().t("archbase:Revoke") })
|
|
1841
1841
|
] }) });
|
|
1842
1842
|
return /* @__PURE__ */ e.jsxs(Y, { p: "md", style: { height: r, display: "flex", flexDirection: "column" }, children: [
|
|
@@ -1855,7 +1855,7 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1855
1855
|
children: /* @__PURE__ */ e.jsx(
|
|
1856
1856
|
be,
|
|
1857
1857
|
{
|
|
1858
|
-
gridRef:
|
|
1858
|
+
gridRef: C,
|
|
1859
1859
|
printTitle: "Tokens de API",
|
|
1860
1860
|
width: "100%",
|
|
1861
1861
|
height: "100%",
|
|
@@ -1878,19 +1878,19 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
),
|
|
1880
1880
|
P === "apiToken" ? /* @__PURE__ */ e.jsx(
|
|
1881
|
-
|
|
1881
|
+
Ca,
|
|
1882
1882
|
{
|
|
1883
|
-
onClickOk:
|
|
1883
|
+
onClickOk: I,
|
|
1884
1884
|
opened: !0,
|
|
1885
1885
|
dataSource: c,
|
|
1886
1886
|
onCustomSave: q,
|
|
1887
|
-
onClickCancel:
|
|
1887
|
+
onClickCancel: I
|
|
1888
1888
|
}
|
|
1889
1889
|
) : null
|
|
1890
1890
|
] });
|
|
1891
1891
|
}
|
|
1892
1892
|
export {
|
|
1893
|
-
|
|
1893
|
+
Ca as ApiTokenModal,
|
|
1894
1894
|
La as ArchbaseApiTokenView,
|
|
1895
1895
|
ba as ArchbaseDualListSelector,
|
|
1896
1896
|
$a as ArchbaseSecurityView,
|