@archbase/security-ui 4.0.35 → 4.0.37
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.37.tgz +0 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +449 -421
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/dist/archbase-security-ui-4.0.35.tgz +0 -0
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Modal as Fe, ScrollArea as ye, Stack as oe, Grid as
|
|
2
|
-
import { getI18nextInstance as t, ARCHBASE_IOC_API_TYPE as X, emit as
|
|
3
|
-
import { ArchbaseEdit as ee, ArchbaseNotifications as Q, ArchbasePasswordEdit as
|
|
4
|
-
import { useArchbaseV1V2Compatibility as ke, useArchbaseDataSourceListener as Xe, useArchbaseRemoteServiceApi as _, useArchbaseRemoteDataSource as
|
|
5
|
-
import { useState as
|
|
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
|
|
7
|
-
import { UserGroupDto as er, SecurityType as
|
|
8
|
-
import { DateTimePicker as
|
|
9
|
-
import { useFocusTrap as
|
|
10
|
-
import { ArchbaseSpaceFixed as
|
|
1
|
+
import { Modal as Fe, ScrollArea as ye, Stack as oe, Grid as z, Group as $, Button as M, 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 Zr } from "@mantine/core";
|
|
2
|
+
import { getI18nextInstance as t, ARCHBASE_IOC_API_TYPE as X, emit as Ee, builder as Te, convertDateToISOString as Qr, processErrorMessage as Ae, getKeyByEnumValue as le, useArchbaseTheme as nr, useArchbaseValidator as Yr, useArchbaseTranslation as Xr, useValidationErrors as Kr, processDetailErrorMessage as ze } from "@archbase/core";
|
|
3
|
+
import { ArchbaseEdit as ee, ArchbaseNotifications as Q, ArchbasePasswordEdit as _r, ArchbaseSelect as ea, ArchbaseCheckbox as xe, ArchbaseAvatarEdit as ra, ArchbaseAsyncSelect as aa, Columns as me, ArchbaseDataGridColumn as f, ArchbaseDataGrid as be, ArchbaseDialog as K } from "@archbase/components";
|
|
4
|
+
import { useArchbaseV1V2Compatibility as ke, useArchbaseDataSourceListener as Xe, useArchbaseRemoteServiceApi as _, useArchbaseRemoteDataSource as Ue, ArchbaseDataSource as ta, useArchbaseStore as ir, useArchbaseRemoteDataSourceV2 as we, useArchbaseDataSource as oa } from "@archbase/data";
|
|
5
|
+
import { useState as U, useCallback as ge, useEffect as Re, forwardRef as sa, useMemo as pe, useRef as je } from "react";
|
|
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 Ie } from "@tabler/icons-react";
|
|
7
|
+
import { UserGroupDto as er, SecurityType as R, UserDto as na, GroupDto as ia, ProfileDto as la, ApiTokenDto as ca } from "@archbase/security";
|
|
8
|
+
import { DateTimePicker as da } from "@mantine/dates";
|
|
9
|
+
import { useFocusTrap as ua, useDebouncedValue as rr } from "@mantine/hooks";
|
|
10
|
+
import { ArchbaseSpaceFixed as ha, ArchbaseSpaceFill as xa, ArchbaseSpaceBottom as pa } from "@archbase/layout";
|
|
11
11
|
var Ve = { exports: {} }, ve = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
@@ -19,54 +19,54 @@ var Ve = { exports: {} }, ve = {};
|
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
21
|
var ar;
|
|
22
|
-
function
|
|
22
|
+
function fa() {
|
|
23
23
|
if (ar)
|
|
24
24
|
return ve;
|
|
25
25
|
ar = 1;
|
|
26
|
-
var r = Symbol.for("react.transitional.element"),
|
|
27
|
-
function w(
|
|
26
|
+
var r = Symbol.for("react.transitional.element"), u = Symbol.for("react.fragment");
|
|
27
|
+
function w(l, c, m) {
|
|
28
28
|
var S = null;
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
for (var
|
|
32
|
-
|
|
29
|
+
if (m !== void 0 && (S = "" + m), c.key !== void 0 && (S = "" + c.key), "key" in c) {
|
|
30
|
+
m = {};
|
|
31
|
+
for (var h in c)
|
|
32
|
+
h !== "key" && (m[h] = c[h]);
|
|
33
33
|
} else
|
|
34
|
-
|
|
35
|
-
return
|
|
34
|
+
m = c;
|
|
35
|
+
return c = m.ref, {
|
|
36
36
|
$$typeof: r,
|
|
37
|
-
type:
|
|
37
|
+
type: l,
|
|
38
38
|
key: S,
|
|
39
|
-
ref:
|
|
40
|
-
props:
|
|
39
|
+
ref: c !== void 0 ? c : null,
|
|
40
|
+
props: m
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
return ve.Fragment =
|
|
43
|
+
return ve.Fragment = u, ve.jsx = w, ve.jsxs = w, ve;
|
|
44
44
|
}
|
|
45
45
|
var tr;
|
|
46
|
-
function
|
|
47
|
-
return tr || (tr = 1, Ve.exports =
|
|
46
|
+
function ma() {
|
|
47
|
+
return tr || (tr = 1, Ve.exports = fa()), Ve.exports;
|
|
48
48
|
}
|
|
49
|
-
var e =
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
r.onCustomSave ? r.onCustomSave(r.dataSource.getCurrentRecord(), (
|
|
53
|
-
|
|
49
|
+
var e = ma();
|
|
50
|
+
const ba = (r) => {
|
|
51
|
+
const u = { ...r.options ?? {} }, w = () => {
|
|
52
|
+
r.onCustomSave ? r.onCustomSave(r.dataSource.getCurrentRecord(), (c) => {
|
|
53
|
+
c && r.onAfterSave && r.onAfterSave(r.dataSource.getCurrentRecord()), r.onClickOk(r.dataSource.getCurrentRecord(), c);
|
|
54
54
|
}) : r.onClickOk(r.dataSource.getCurrentRecord(), !0);
|
|
55
|
-
},
|
|
55
|
+
}, l = () => {
|
|
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
|
-
onClose:
|
|
62
|
+
onClose: l,
|
|
63
63
|
title: t().t("archbase:Perfil"),
|
|
64
64
|
size: "60%",
|
|
65
65
|
styles: { content: { maxWidth: 1e3 } },
|
|
66
66
|
children: /* @__PURE__ */ e.jsx(ye, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
|
|
67
|
-
|
|
68
|
-
/* @__PURE__ */ e.jsxs(
|
|
69
|
-
/* @__PURE__ */ e.jsx(
|
|
67
|
+
u?.customContentBefore && u.customContentBefore(r.dataSource.getCurrentRecord()),
|
|
68
|
+
/* @__PURE__ */ e.jsxs(z, { children: [
|
|
69
|
+
/* @__PURE__ */ e.jsx(z.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(z.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")}`,
|
|
@@ -85,24 +85,24 @@ const ma = (r) => {
|
|
|
85
85
|
}
|
|
86
86
|
) })
|
|
87
87
|
] }),
|
|
88
|
-
|
|
88
|
+
u?.customContentAfter && u.customContentAfter(r.dataSource.getCurrentRecord()),
|
|
89
89
|
/* @__PURE__ */ e.jsxs($, { justify: "flex-end", mt: "md", children: [
|
|
90
|
-
/* @__PURE__ */ e.jsx(
|
|
91
|
-
/* @__PURE__ */ e.jsx(
|
|
90
|
+
/* @__PURE__ */ e.jsx(M, { variant: "default", onClick: l, children: t().t("archbase:Cancelar") }),
|
|
91
|
+
/* @__PURE__ */ e.jsx(M, { onClick: w, children: t().t("archbase:Salvar") })
|
|
92
92
|
] })
|
|
93
93
|
] }) })
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
96
|
};
|
|
97
|
-
function
|
|
97
|
+
function ga({
|
|
98
98
|
availableItemsDS: r,
|
|
99
|
-
assignedItemsDS:
|
|
99
|
+
assignedItemsDS: u,
|
|
100
100
|
idFieldAvailable: w,
|
|
101
|
-
labelFieldAvailable:
|
|
102
|
-
idFieldAssigned:
|
|
103
|
-
labelFieldAssigned:
|
|
101
|
+
labelFieldAvailable: l,
|
|
102
|
+
idFieldAssigned: c,
|
|
103
|
+
labelFieldAssigned: m,
|
|
104
104
|
handleCreateAssociationObject: S,
|
|
105
|
-
width:
|
|
105
|
+
width: h = "400px",
|
|
106
106
|
height: P = "200px",
|
|
107
107
|
titleAvailable: p = "Disponíveis",
|
|
108
108
|
titleAssigned: C = "Selecionados"
|
|
@@ -115,41 +115,41 @@ function ba({
|
|
|
115
115
|
);
|
|
116
116
|
const i = ke(
|
|
117
117
|
"ArchbaseDualListSelector-Assigned",
|
|
118
|
-
|
|
118
|
+
u,
|
|
119
119
|
void 0,
|
|
120
120
|
[]
|
|
121
|
-
), [
|
|
122
|
-
r && L(r.browseRecords()),
|
|
123
|
-
}, [r,
|
|
121
|
+
), [d, L] = U([]), [g, re] = U([]), [J, ae] = U([]), [Z, D] = U([]), N = ge(() => {
|
|
122
|
+
r && L(r.browseRecords()), u && re(u.browseRecords());
|
|
123
|
+
}, [r, u]);
|
|
124
124
|
Xe({
|
|
125
125
|
dataSource: r,
|
|
126
126
|
listener: () => N()
|
|
127
127
|
}), Xe({
|
|
128
|
-
dataSource:
|
|
128
|
+
dataSource: u,
|
|
129
129
|
listener: () => N()
|
|
130
130
|
}), Re(() => {
|
|
131
131
|
N();
|
|
132
132
|
}, [N]);
|
|
133
|
-
const I = (x,
|
|
134
|
-
x((
|
|
135
|
-
},
|
|
133
|
+
const I = (x, j) => typeof j == "function" ? j(x) : x[j], q = (x, j) => typeof j == "function" ? j(x) : x[j], o = (x, j) => {
|
|
134
|
+
x((b) => b.includes(j) ? b.filter((ce) => ce !== j) : [...b, j]);
|
|
135
|
+
}, F = () => {
|
|
136
136
|
J.forEach((x) => {
|
|
137
|
-
const
|
|
138
|
-
if (
|
|
139
|
-
const
|
|
140
|
-
i.isDataSourceV2 ? (
|
|
137
|
+
const j = d.find((b) => I(b, w) === x);
|
|
138
|
+
if (j) {
|
|
139
|
+
const b = S(j);
|
|
140
|
+
i.isDataSourceV2 ? (u.insert(b), u.save()) : (u.insert(b), u.save(), i.v1State.forceUpdate());
|
|
141
141
|
}
|
|
142
142
|
}), ae([]);
|
|
143
143
|
}, W = () => {
|
|
144
144
|
Z.forEach((x) => {
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
147
|
-
const
|
|
148
|
-
i.isDataSourceV2 ?
|
|
145
|
+
const j = g.find((b) => I(b, c) === x);
|
|
146
|
+
if (j) {
|
|
147
|
+
const b = typeof c == "function" ? { customId: c(j) } : { [c]: x };
|
|
148
|
+
i.isDataSourceV2 ? u.remove(() => u.locate(b)) : (u.remove(() => u.locate(b)), i.v1State.forceUpdate());
|
|
149
149
|
}
|
|
150
|
-
}),
|
|
150
|
+
}), D([]);
|
|
151
151
|
};
|
|
152
|
-
return /* @__PURE__ */ e.jsxs(Y, { withBorder: !0, style: { display: "flex", width:
|
|
152
|
+
return /* @__PURE__ */ e.jsxs(Y, { withBorder: !0, style: { display: "flex", width: h, height: P }, children: [
|
|
153
153
|
/* @__PURE__ */ e.jsxs(He, { style: { minWidth: "44%", minHeight: P }, children: [
|
|
154
154
|
/* @__PURE__ */ e.jsx(H, { children: p }),
|
|
155
155
|
/* @__PURE__ */ e.jsx(
|
|
@@ -165,14 +165,14 @@ function ba({
|
|
|
165
165
|
overflowX: "hidden",
|
|
166
166
|
height: "calc(100% - 32px)"
|
|
167
167
|
},
|
|
168
|
-
children:
|
|
168
|
+
children: d.map((x) => /* @__PURE__ */ e.jsx(De.Item, { children: /* @__PURE__ */ e.jsx(
|
|
169
169
|
Je,
|
|
170
170
|
{
|
|
171
|
-
label: q(x,
|
|
171
|
+
label: q(x, l),
|
|
172
172
|
checked: J.includes(I(x, w)),
|
|
173
173
|
onChange: () => o(ae, I(x, w)),
|
|
174
|
-
disabled:
|
|
175
|
-
(
|
|
174
|
+
disabled: g.some(
|
|
175
|
+
(j) => I(j, c) === I(x, w)
|
|
176
176
|
)
|
|
177
177
|
}
|
|
178
178
|
) }, I(x, w)))
|
|
@@ -180,7 +180,7 @@ function ba({
|
|
|
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: F, 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: [
|
|
@@ -198,25 +198,25 @@ function ba({
|
|
|
198
198
|
overflowX: "hidden",
|
|
199
199
|
height: "calc(100% - 32px)"
|
|
200
200
|
},
|
|
201
|
-
children:
|
|
201
|
+
children: g.map((x) => /* @__PURE__ */ e.jsx(De.Item, { children: /* @__PURE__ */ e.jsx(
|
|
202
202
|
Je,
|
|
203
203
|
{
|
|
204
|
-
label: q(x,
|
|
205
|
-
checked: Z.includes(I(x,
|
|
206
|
-
onChange: () => o(
|
|
204
|
+
label: q(x, m),
|
|
205
|
+
checked: Z.includes(I(x, c)),
|
|
206
|
+
onChange: () => o(D, I(x, c))
|
|
207
207
|
}
|
|
208
|
-
) }, I(x,
|
|
208
|
+
) }, I(x, c)))
|
|
209
209
|
}
|
|
210
210
|
)
|
|
211
211
|
] })
|
|
212
212
|
] });
|
|
213
213
|
}
|
|
214
|
-
const
|
|
215
|
-
({ image: r, label:
|
|
216
|
-
/* @__PURE__ */ e.jsx(H, { size: "sm", fw: 600, children:
|
|
214
|
+
const ja = sa(
|
|
215
|
+
({ image: r, label: u, description: w, origin: l, ...c }, m) => /* @__PURE__ */ e.jsx("div", { ref: m, ...c, children: /* @__PURE__ */ e.jsxs(te, { children: [
|
|
216
|
+
/* @__PURE__ */ e.jsx(H, { size: "sm", fw: 600, children: l ? l.name : "" }),
|
|
217
217
|
/* @__PURE__ */ e.jsx(sr, { w: "lg" })
|
|
218
218
|
] }) })
|
|
219
|
-
),
|
|
219
|
+
), ya = {
|
|
220
220
|
// Campos de identificação
|
|
221
221
|
showNickname: !0,
|
|
222
222
|
// Campos de perfil e grupos
|
|
@@ -235,27 +235,28 @@ const ga = oa(
|
|
|
235
235
|
requiredNickname: !0,
|
|
236
236
|
avatarMaxSizeKB: 2e3,
|
|
237
237
|
avatarImageQuality: 1,
|
|
238
|
+
avatarMaxOutputSizePx: 512,
|
|
238
239
|
allowEditEmail: !0
|
|
239
|
-
},
|
|
240
|
-
const [
|
|
240
|
+
}, wa = (r) => {
|
|
241
|
+
const [u, w] = U(""), l = { ...ya, ...r.options ?? {} }, c = _(X.Group), { dataSource: m } = Ue({
|
|
241
242
|
name: "dsGroups",
|
|
242
|
-
service:
|
|
243
|
+
service: c,
|
|
243
244
|
pageSize: 9999,
|
|
244
245
|
loadOnStart: !0,
|
|
245
246
|
sort: ["name:asc"],
|
|
246
|
-
onError: (i,
|
|
247
|
-
Q.showError(t().t("archbase:WARNING"), i,
|
|
247
|
+
onError: (i, d) => {
|
|
248
|
+
Q.showError(t().t("archbase:WARNING"), i, d);
|
|
248
249
|
}
|
|
249
250
|
});
|
|
250
251
|
console.log("versão 12/05/2026");
|
|
251
|
-
const S = _(X.Profile), { dataSource:
|
|
252
|
+
const S = _(X.Profile), { dataSource: h } = Ue({
|
|
252
253
|
name: "dsProfiles",
|
|
253
254
|
service: S,
|
|
254
255
|
pageSize: 9999,
|
|
255
256
|
loadOnStart: !0,
|
|
256
257
|
sort: ["name:asc"],
|
|
257
|
-
onError: (i,
|
|
258
|
-
Q.showError(t().t("archbase:WARNING"), i,
|
|
258
|
+
onError: (i, d) => {
|
|
259
|
+
Q.showError(t().t("archbase:WARNING"), i, d);
|
|
259
260
|
}
|
|
260
261
|
});
|
|
261
262
|
Re(() => {
|
|
@@ -263,13 +264,13 @@ const ga = oa(
|
|
|
263
264
|
}, [r.dataSource.getFieldValue("password")]);
|
|
264
265
|
const P = async () => {
|
|
265
266
|
if (r.dataSource.isInserting()) {
|
|
266
|
-
if (
|
|
267
|
-
const i =
|
|
268
|
-
|
|
267
|
+
if (l.userDefaultProfile) {
|
|
268
|
+
const i = Ee(Te.eq("name", l.userDefaultProfile)), d = await S.findAllWithFilter(i, 0, 1);
|
|
269
|
+
d && d.content.length > 0 && r.dataSource.setFieldValue("profile", d.content[0]);
|
|
269
270
|
}
|
|
270
|
-
if (
|
|
271
|
-
const i =
|
|
272
|
-
|
|
271
|
+
if (l.userDefaultGroups) {
|
|
272
|
+
const i = Ee(Te.in("name", l.userDefaultGroups)), d = await c.findAllWithFilter(i, 0, 500);
|
|
273
|
+
d && d.content.length > 0 && r.dataSource.setFieldValue("groups", d.content.map((L) => er.newInstance(L)));
|
|
273
274
|
}
|
|
274
275
|
}
|
|
275
276
|
};
|
|
@@ -282,8 +283,8 @@ const ga = oa(
|
|
|
282
283
|
w(t().t("archbase:Informe a senha"));
|
|
283
284
|
return;
|
|
284
285
|
}
|
|
285
|
-
r.onCustomSave ? r.onCustomSave(i, (
|
|
286
|
-
|
|
286
|
+
r.onCustomSave ? r.onCustomSave(i, (d) => {
|
|
287
|
+
d && r.onAfterSave && r.onAfterSave(i), r.onClickOk(i, d);
|
|
287
288
|
}) : r.onClickOk(i, !0);
|
|
288
289
|
}, C = () => {
|
|
289
290
|
r.onClickCancel(r.dataSource.getCurrentRecord());
|
|
@@ -298,9 +299,9 @@ const ga = oa(
|
|
|
298
299
|
styles: { content: { maxWidth: 1e3 } },
|
|
299
300
|
children: [
|
|
300
301
|
/* @__PURE__ */ e.jsx(ye, { style: { height: "500px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
|
|
301
|
-
|
|
302
|
-
/* @__PURE__ */ e.jsxs(
|
|
303
|
-
/* @__PURE__ */ e.jsx(
|
|
302
|
+
l?.customContentBefore && /* @__PURE__ */ e.jsx(e.Fragment, { children: l.customContentBefore(r.dataSource.getCurrentRecord()) }),
|
|
303
|
+
/* @__PURE__ */ e.jsxs(z, { children: [
|
|
304
|
+
/* @__PURE__ */ e.jsx(z.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsxs($, { children: [
|
|
304
305
|
/* @__PURE__ */ e.jsx(
|
|
305
306
|
ee,
|
|
306
307
|
{
|
|
@@ -312,18 +313,18 @@ const ga = oa(
|
|
|
312
313
|
width: "calc(100% - 208px)"
|
|
313
314
|
}
|
|
314
315
|
),
|
|
315
|
-
|
|
316
|
+
l.showNickname && /* @__PURE__ */ e.jsx(
|
|
316
317
|
ee,
|
|
317
318
|
{
|
|
318
319
|
label: `${t().t("archbase:Apelido")}`,
|
|
319
320
|
placeholder: `${t().t("archbase:Apelido")}`,
|
|
320
321
|
dataSource: r.dataSource,
|
|
321
322
|
dataField: "nickname",
|
|
322
|
-
required:
|
|
323
|
+
required: l.requiredNickname
|
|
323
324
|
}
|
|
324
325
|
)
|
|
325
326
|
] }) }),
|
|
326
|
-
/* @__PURE__ */ e.jsx(
|
|
327
|
+
/* @__PURE__ */ e.jsx(z.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
|
|
327
328
|
ee,
|
|
328
329
|
{
|
|
329
330
|
label: `${t().t("archbase:Descrição do usuário")}`,
|
|
@@ -334,8 +335,8 @@ const ga = oa(
|
|
|
334
335
|
}
|
|
335
336
|
) })
|
|
336
337
|
] }),
|
|
337
|
-
/* @__PURE__ */ e.jsxs(
|
|
338
|
-
/* @__PURE__ */ e.jsx(
|
|
338
|
+
/* @__PURE__ */ e.jsxs(z, { children: [
|
|
339
|
+
/* @__PURE__ */ e.jsx(z.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
|
|
339
340
|
ee,
|
|
340
341
|
{
|
|
341
342
|
label: `${t().t("archbase:E-mail")}`,
|
|
@@ -343,39 +344,39 @@ const ga = oa(
|
|
|
343
344
|
dataSource: r.dataSource,
|
|
344
345
|
onChangeValue: (i) => r.dataSource.setFieldValue("userName", i),
|
|
345
346
|
dataField: "email",
|
|
346
|
-
readOnly: r.dataSource.isEditing() ? !
|
|
347
|
+
readOnly: r.dataSource.isEditing() ? !l.allowEditEmail : !1,
|
|
347
348
|
required: !0
|
|
348
349
|
}
|
|
349
350
|
) }),
|
|
350
|
-
/* @__PURE__ */ e.jsx(
|
|
351
|
-
|
|
351
|
+
/* @__PURE__ */ e.jsx(z.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
|
|
352
|
+
_r,
|
|
352
353
|
{
|
|
353
354
|
label: `${t().t("archbase:Senha usuário")}`,
|
|
354
355
|
dataSource: r.dataSource,
|
|
355
356
|
dataField: "password",
|
|
356
|
-
error:
|
|
357
|
+
error: u,
|
|
357
358
|
required: r.dataSource.getFieldValue("isNewUser")
|
|
358
359
|
}
|
|
359
360
|
) })
|
|
360
361
|
] }),
|
|
361
|
-
/* @__PURE__ */ e.jsx(
|
|
362
|
-
|
|
362
|
+
/* @__PURE__ */ e.jsx(z, { children: l.showProfile && /* @__PURE__ */ e.jsx(z.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
|
|
363
|
+
ea,
|
|
363
364
|
{
|
|
364
365
|
label: `${t().t("archbase:Perfil do usuário")}`,
|
|
365
366
|
dataSource: r.dataSource,
|
|
366
367
|
dataField: "profile",
|
|
367
|
-
options:
|
|
368
|
+
options: h,
|
|
368
369
|
allowDeselect: !0,
|
|
369
370
|
optionsLabelField: "nome",
|
|
370
|
-
itemComponent:
|
|
371
|
+
itemComponent: ja,
|
|
371
372
|
getOptionLabel: (i) => i.name,
|
|
372
373
|
getOptionValue: (i) => i.id
|
|
373
374
|
}
|
|
374
375
|
) }) }),
|
|
375
|
-
/* @__PURE__ */ e.jsxs(
|
|
376
|
-
/* @__PURE__ */ e.jsx(
|
|
377
|
-
/* @__PURE__ */ e.jsx(
|
|
378
|
-
|
|
376
|
+
/* @__PURE__ */ e.jsxs(z, { children: [
|
|
377
|
+
/* @__PURE__ */ e.jsx(z.Col, { span: { base: 12 }, children: l.showAccountConfigLabel && /* @__PURE__ */ e.jsx(H, { fz: 14, fw: 500, children: "Informe" }) }),
|
|
378
|
+
/* @__PURE__ */ e.jsx(z.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(oe, { gap: "lg", children: [
|
|
379
|
+
l.showChangePasswordOnNextLogin && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
|
|
379
380
|
xe,
|
|
380
381
|
{
|
|
381
382
|
dataSource: r.dataSource,
|
|
@@ -383,7 +384,7 @@ const ga = oa(
|
|
|
383
384
|
label: `${t().t("archbase:Deve alterar senha próximo login ?")}`
|
|
384
385
|
}
|
|
385
386
|
) }),
|
|
386
|
-
|
|
387
|
+
l.showAllowPasswordChange && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
|
|
387
388
|
xe,
|
|
388
389
|
{
|
|
389
390
|
dataSource: r.dataSource,
|
|
@@ -391,7 +392,7 @@ const ga = oa(
|
|
|
391
392
|
label: `${t().t("archbase:Pode alterar a senha ?")}`
|
|
392
393
|
}
|
|
393
394
|
) }),
|
|
394
|
-
|
|
395
|
+
l.showPasswordNeverExpires && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
|
|
395
396
|
xe,
|
|
396
397
|
{
|
|
397
398
|
dataSource: r.dataSource,
|
|
@@ -400,8 +401,8 @@ const ga = oa(
|
|
|
400
401
|
}
|
|
401
402
|
) })
|
|
402
403
|
] }) }),
|
|
403
|
-
/* @__PURE__ */ e.jsx(
|
|
404
|
-
|
|
404
|
+
/* @__PURE__ */ e.jsx(z.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(oe, { gap: "lg", children: [
|
|
405
|
+
l.showAccountDeactivated && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
|
|
405
406
|
xe,
|
|
406
407
|
{
|
|
407
408
|
dataSource: r.dataSource,
|
|
@@ -409,7 +410,7 @@ const ga = oa(
|
|
|
409
410
|
label: `${t().t("archbase:Conta desativada ?")}`
|
|
410
411
|
}
|
|
411
412
|
) }),
|
|
412
|
-
|
|
413
|
+
l.showAccountLocked && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
|
|
413
414
|
xe,
|
|
414
415
|
{
|
|
415
416
|
dataSource: r.dataSource,
|
|
@@ -417,7 +418,7 @@ const ga = oa(
|
|
|
417
418
|
label: `${t().t("archbase:Conta bloqueada ?")}`
|
|
418
419
|
}
|
|
419
420
|
) }),
|
|
420
|
-
|
|
421
|
+
l.showIsAdministrator && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
|
|
421
422
|
xe,
|
|
422
423
|
{
|
|
423
424
|
dataSource: r.dataSource,
|
|
@@ -426,27 +427,28 @@ const ga = oa(
|
|
|
426
427
|
}
|
|
427
428
|
) })
|
|
428
429
|
] }) }),
|
|
429
|
-
/* @__PURE__ */ e.jsx(
|
|
430
|
-
|
|
430
|
+
/* @__PURE__ */ e.jsx(z.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsx(oe, { gap: "lg", children: /* @__PURE__ */ e.jsx(
|
|
431
|
+
ra,
|
|
431
432
|
{
|
|
432
433
|
label: t().t("archbase:Foto do usuário"),
|
|
433
434
|
dataSource: r.dataSource,
|
|
434
435
|
dataField: "avatar",
|
|
435
436
|
width: 120,
|
|
436
437
|
height: 120,
|
|
437
|
-
maxSizeKB:
|
|
438
|
-
imageQuality:
|
|
438
|
+
maxSizeKB: l.avatarMaxSizeKB,
|
|
439
|
+
imageQuality: l.avatarImageQuality,
|
|
440
|
+
maxOutputSizePx: l.avatarMaxOutputSizePx
|
|
439
441
|
}
|
|
440
442
|
) }) })
|
|
441
443
|
] }),
|
|
442
|
-
|
|
443
|
-
/* @__PURE__ */ e.jsx(
|
|
444
|
-
/* @__PURE__ */ e.jsx(
|
|
445
|
-
|
|
444
|
+
l.showGroups && /* @__PURE__ */ e.jsxs(z, { children: [
|
|
445
|
+
/* @__PURE__ */ e.jsx(z.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(H, { fz: 14, fw: 500, children: "Grupos" }) }),
|
|
446
|
+
/* @__PURE__ */ e.jsx(z.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
|
|
447
|
+
ga,
|
|
446
448
|
{
|
|
447
449
|
titleAvailable: t().t("archbase:Disponíveis"),
|
|
448
450
|
titleAssigned: t().t("archbase:Selecionados"),
|
|
449
|
-
assignedItemsDS: new
|
|
451
|
+
assignedItemsDS: new ta("dsDualList", {
|
|
450
452
|
records: r.dataSource.getFieldValue("groups"),
|
|
451
453
|
grandTotalRecords: r.dataSource.getFieldValue("groups").length,
|
|
452
454
|
currentPage: 0,
|
|
@@ -455,7 +457,7 @@ const ga = oa(
|
|
|
455
457
|
}),
|
|
456
458
|
width: "100%",
|
|
457
459
|
height: "200px",
|
|
458
|
-
availableItemsDS:
|
|
460
|
+
availableItemsDS: m,
|
|
459
461
|
handleCreateAssociationObject: (i) => er.newInstance(i),
|
|
460
462
|
idFieldAssigned: (i) => i && i.group ? i.group.id : "",
|
|
461
463
|
idFieldAvailable: "id",
|
|
@@ -464,36 +466,36 @@ const ga = oa(
|
|
|
464
466
|
}
|
|
465
467
|
) })
|
|
466
468
|
] }),
|
|
467
|
-
|
|
469
|
+
l?.customContentAfter && /* @__PURE__ */ e.jsx(e.Fragment, { children: l.customContentAfter(r.dataSource.getCurrentRecord()) }),
|
|
468
470
|
/* @__PURE__ */ e.jsx(sr, { h: "12px" })
|
|
469
471
|
] }) }),
|
|
470
472
|
/* @__PURE__ */ e.jsxs($, { justify: "flex-end", mt: "md", children: [
|
|
471
|
-
/* @__PURE__ */ e.jsx(
|
|
472
|
-
/* @__PURE__ */ e.jsx(
|
|
473
|
+
/* @__PURE__ */ e.jsx(M, { variant: "default", onClick: C, children: t().t("archbase:Cancelar") }),
|
|
474
|
+
/* @__PURE__ */ e.jsx(M, { onClick: p, children: t().t("archbase:Salvar") })
|
|
473
475
|
] })
|
|
474
476
|
]
|
|
475
477
|
}
|
|
476
478
|
);
|
|
477
|
-
},
|
|
478
|
-
const
|
|
479
|
-
r.onCustomSave ? r.onCustomSave(r.dataSource.getCurrentRecord(), (
|
|
480
|
-
|
|
479
|
+
}, va = (r) => {
|
|
480
|
+
const u = { ...r.options ?? {} }, w = () => {
|
|
481
|
+
r.onCustomSave ? r.onCustomSave(r.dataSource.getCurrentRecord(), (c) => {
|
|
482
|
+
c && r.onAfterSave && r.onAfterSave(r.dataSource.getCurrentRecord()), r.onClickOk(r.dataSource.getCurrentRecord(), c);
|
|
481
483
|
}) : r.onClickOk(r.dataSource.getCurrentRecord(), !0);
|
|
482
|
-
},
|
|
484
|
+
}, l = () => {
|
|
483
485
|
r.onClickCancel(r.dataSource.getCurrentRecord());
|
|
484
486
|
};
|
|
485
487
|
return /* @__PURE__ */ e.jsx(
|
|
486
488
|
Fe,
|
|
487
489
|
{
|
|
488
490
|
opened: r.opened,
|
|
489
|
-
onClose:
|
|
491
|
+
onClose: l,
|
|
490
492
|
title: t().t("archbase:Grupo"),
|
|
491
493
|
size: "60%",
|
|
492
494
|
styles: { content: { maxWidth: 1e3 } },
|
|
493
495
|
children: /* @__PURE__ */ e.jsx(ye, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
|
|
494
|
-
|
|
495
|
-
/* @__PURE__ */ e.jsxs(
|
|
496
|
-
/* @__PURE__ */ e.jsx(
|
|
496
|
+
u?.customContentBefore && u.customContentBefore(r.dataSource.getCurrentRecord()),
|
|
497
|
+
/* @__PURE__ */ e.jsxs(z, { children: [
|
|
498
|
+
/* @__PURE__ */ e.jsx(z.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
|
|
497
499
|
ee,
|
|
498
500
|
{
|
|
499
501
|
label: `${t().t("archbase:Nome do grupo")}`,
|
|
@@ -502,7 +504,7 @@ const ga = oa(
|
|
|
502
504
|
dataField: "name"
|
|
503
505
|
}
|
|
504
506
|
) }),
|
|
505
|
-
/* @__PURE__ */ e.jsx(
|
|
507
|
+
/* @__PURE__ */ e.jsx(z.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
|
|
506
508
|
ee,
|
|
507
509
|
{
|
|
508
510
|
label: `${t().t("archbase:Descrição do grupo")}`,
|
|
@@ -512,47 +514,47 @@ const ga = oa(
|
|
|
512
514
|
}
|
|
513
515
|
) })
|
|
514
516
|
] }),
|
|
515
|
-
|
|
517
|
+
u?.customContentAfter && u.customContentAfter(r.dataSource.getCurrentRecord()),
|
|
516
518
|
/* @__PURE__ */ e.jsxs($, { justify: "flex-end", mt: "md", children: [
|
|
517
|
-
/* @__PURE__ */ e.jsx(
|
|
518
|
-
/* @__PURE__ */ e.jsx(
|
|
519
|
+
/* @__PURE__ */ e.jsx(M, { variant: "default", onClick: l, children: t().t("archbase:Cancelar") }),
|
|
520
|
+
/* @__PURE__ */ e.jsx(M, { onClick: w, children: t().t("archbase:Salvar") })
|
|
519
521
|
] })
|
|
520
522
|
] }) })
|
|
521
523
|
}
|
|
522
524
|
);
|
|
523
|
-
},
|
|
525
|
+
}, Ca = ({ image: r, label: u, description: w, ...l }) => /* @__PURE__ */ e.jsx("div", { ...l, children: /* @__PURE__ */ e.jsxs($, { grow: !0, children: [
|
|
524
526
|
/* @__PURE__ */ e.jsx("img", { style: { maxWidth: "32px" }, src: r }),
|
|
525
527
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
526
|
-
/* @__PURE__ */ e.jsx(H, { size: "sm", children:
|
|
528
|
+
/* @__PURE__ */ e.jsx(H, { size: "sm", children: u }),
|
|
527
529
|
/* @__PURE__ */ e.jsx(H, { size: "xs", opacity: 0.65, children: w })
|
|
528
530
|
] })
|
|
529
|
-
] }) }),
|
|
530
|
-
|
|
531
|
-
const [
|
|
531
|
+
] }) }), Sa = (r) => {
|
|
532
|
+
ua();
|
|
533
|
+
const [u, w] = U(), l = _(X.User), c = ke(
|
|
532
534
|
"ApiTokenModal",
|
|
533
535
|
r.dataSource,
|
|
534
536
|
"expirationDate",
|
|
535
537
|
""
|
|
536
|
-
),
|
|
538
|
+
), m = (p) => {
|
|
537
539
|
if (!p)
|
|
538
|
-
|
|
540
|
+
c.handleValueChange(void 0);
|
|
539
541
|
else {
|
|
540
|
-
const C = typeof p == "string" ? new Date(p) : p, i =
|
|
541
|
-
|
|
542
|
+
const C = typeof p == "string" ? new Date(p) : p, i = Qr(C);
|
|
543
|
+
c.handleValueChange(i);
|
|
542
544
|
}
|
|
543
545
|
w(p);
|
|
544
|
-
}, S = async (p, C) => new Promise(async (i,
|
|
546
|
+
}, S = async (p, C) => new Promise(async (i, d) => {
|
|
545
547
|
try {
|
|
546
|
-
const L =
|
|
548
|
+
const L = Ee(Te.or(Te.eq("name", `^*${C.trim()}*`))), g = await l.findAllWithFilter(L, p, 20);
|
|
547
549
|
i({
|
|
548
|
-
options:
|
|
549
|
-
page:
|
|
550
|
-
totalPages:
|
|
550
|
+
options: g.content,
|
|
551
|
+
page: g.pageable.pageNumber,
|
|
552
|
+
totalPages: g.totalPages
|
|
551
553
|
});
|
|
552
554
|
} catch (L) {
|
|
553
|
-
|
|
555
|
+
d(Ae(L));
|
|
554
556
|
}
|
|
555
|
-
}),
|
|
557
|
+
}), h = () => {
|
|
556
558
|
r.onCustomSave ? r.onCustomSave(r.dataSource.current, (p) => {
|
|
557
559
|
p && r.onAfterSave && r.onAfterSave(r.dataSource.current), r.onClickOk(r.dataSource.current, p);
|
|
558
560
|
}) : r.onClickOk(r.dataSource.current, !0);
|
|
@@ -587,17 +589,17 @@ const ga = oa(
|
|
|
587
589
|
}
|
|
588
590
|
),
|
|
589
591
|
/* @__PURE__ */ e.jsx(
|
|
590
|
-
|
|
592
|
+
da,
|
|
591
593
|
{
|
|
592
594
|
withSeconds: !0,
|
|
593
|
-
value:
|
|
594
|
-
onChange:
|
|
595
|
+
value: u,
|
|
596
|
+
onChange: m,
|
|
595
597
|
label: "Data/hora expiração",
|
|
596
598
|
placeholder: "Selecione a data de expiração"
|
|
597
599
|
}
|
|
598
600
|
),
|
|
599
601
|
/* @__PURE__ */ e.jsx(
|
|
600
|
-
|
|
602
|
+
aa,
|
|
601
603
|
{
|
|
602
604
|
label: `${t().t("archbase:Usuário")}`,
|
|
603
605
|
dataSource: r.dataSource,
|
|
@@ -608,23 +610,23 @@ const ga = oa(
|
|
|
608
610
|
getOptions: S,
|
|
609
611
|
debounceTime: 500,
|
|
610
612
|
minCharsToSearch: 1,
|
|
611
|
-
itemComponent:
|
|
613
|
+
itemComponent: Ca
|
|
612
614
|
}
|
|
613
615
|
)
|
|
614
616
|
] }),
|
|
615
617
|
/* @__PURE__ */ e.jsxs($, { justify: "flex-end", mt: "md", children: [
|
|
616
|
-
/* @__PURE__ */ e.jsx(
|
|
617
|
-
/* @__PURE__ */ e.jsx(
|
|
618
|
+
/* @__PURE__ */ e.jsx(M, { variant: "default", onClick: P, children: t().t("archbase:Cancelar") }),
|
|
619
|
+
/* @__PURE__ */ e.jsx(M, { onClick: h, children: t().t("archbase:Salvar") })
|
|
618
620
|
] })
|
|
619
621
|
]
|
|
620
622
|
}
|
|
621
623
|
);
|
|
622
624
|
}, or = (r) => {
|
|
623
|
-
const
|
|
624
|
-
return r.includes(
|
|
625
|
+
const u = "->";
|
|
626
|
+
return r.includes(u) ? r.split(u).map((c) => c.trim()).map((c) => t().t(c)).join(` ${u} `) : t().t(r);
|
|
625
627
|
};
|
|
626
|
-
function
|
|
627
|
-
const
|
|
628
|
+
function Me({ dataSource: r, opened: u, close: w }) {
|
|
629
|
+
const l = pe(() => r?.getFieldValue("name") || "", [r]), c = pe(() => r?.getFieldValue("id") || "", [r]), m = pe(() => r?.getFieldValue("type") || "", [r]), S = Ze(), h = Ze(), [P, p] = U([]), [C, i] = U([]), [d, L] = U(), [g, re] = U(), [J, ae] = U(""), [Z] = rr(J, 200), [D, N] = U(""), [I] = rr(D, 200), q = _(X.Resource), { colorScheme: o } = Oe(), F = 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
630
|
value: s.resourceId,
|
|
629
631
|
label: s.resourceDescription,
|
|
630
632
|
children: s.permissions.filter((n) => n.actionDescription.toLowerCase().includes(I.toLowerCase())).sort((n, G) => n.actionDescription.localeCompare(G.actionDescription)).map((n) => ({
|
|
@@ -636,7 +638,7 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
636
638
|
owner: s
|
|
637
639
|
}
|
|
638
640
|
}))
|
|
639
|
-
})), [C, I]), x = pe(() => C.map((s) => s.permissions.map((n) => n.actionId)).flat(), [C]),
|
|
641
|
+
})), [C, I]), x = pe(() => C.map((s) => s.permissions.map((n) => n.actionId)).flat(), [C]), j = pe(() => P.sort((s, n) => s.resourceDescription.localeCompare(n.resourceDescription)).map((s) => ({
|
|
640
642
|
value: s.resourceId,
|
|
641
643
|
label: s.resourceDescription,
|
|
642
644
|
children: s.permissions.filter((n) => n.actionDescription.toLowerCase().includes(Z.toLowerCase())).sort((n, G) => n.actionDescription.localeCompare(G.actionDescription)).map((n) => {
|
|
@@ -645,42 +647,42 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
645
647
|
value: n.actionId,
|
|
646
648
|
label: n.actionDescription,
|
|
647
649
|
nodeProps: {
|
|
648
|
-
granted: x.includes(n.actionId) && G?.types?.includes(le(
|
|
650
|
+
granted: x.includes(n.actionId) && G?.types?.includes(le(R, m)),
|
|
649
651
|
owner: s
|
|
650
652
|
}
|
|
651
653
|
};
|
|
652
654
|
})
|
|
653
|
-
})), [P, C, x,
|
|
654
|
-
if (
|
|
655
|
-
const s = await q.getPermissionsBySecurityId(
|
|
655
|
+
})), [P, C, x, m, Z]), b = ge(async () => {
|
|
656
|
+
if (c) {
|
|
657
|
+
const s = await q.getPermissionsBySecurityId(c, m), n = await q.getAllPermissionsAvailable();
|
|
656
658
|
p(n), i(s);
|
|
657
659
|
}
|
|
658
|
-
}, [
|
|
659
|
-
|
|
660
|
+
}, [c, m]), ce = ge(() => {
|
|
661
|
+
d?.value && c && q.createPermission(c, d.value, m).then((s) => {
|
|
660
662
|
if (s) {
|
|
661
663
|
i((E) => {
|
|
662
664
|
let A;
|
|
663
|
-
return E.map((
|
|
664
|
-
...
|
|
665
|
-
permissions:
|
|
666
|
-
(T) => T.actionId ===
|
|
665
|
+
return E.map((y) => y.resourceId).includes(s.resourceId) ? A = E.map((y) => y.resourceId === s.resourceId ? y.permissions.map((T) => T.actionId).includes(d.value) ? {
|
|
666
|
+
...y,
|
|
667
|
+
permissions: y.permissions.map(
|
|
668
|
+
(T) => T.actionId === d.value ? {
|
|
667
669
|
...T,
|
|
668
670
|
permissionId: s.permissionId,
|
|
669
|
-
types: [...T.types ?? [], le(
|
|
671
|
+
types: [...T.types ?? [], le(R, m)]
|
|
670
672
|
} : T
|
|
671
673
|
)
|
|
672
674
|
} : {
|
|
673
|
-
...
|
|
675
|
+
...y,
|
|
674
676
|
permissions: [
|
|
675
|
-
...
|
|
677
|
+
...y.permissions ?? [],
|
|
676
678
|
{
|
|
677
679
|
actionId: s.actionId,
|
|
678
680
|
actionDescription: s.actionDescription,
|
|
679
681
|
permissionId: s.permissionId,
|
|
680
|
-
types: [le(
|
|
682
|
+
types: [le(R, m)]
|
|
681
683
|
}
|
|
682
684
|
]
|
|
683
|
-
} :
|
|
685
|
+
} : y) : A = [
|
|
684
686
|
...E,
|
|
685
687
|
{
|
|
686
688
|
resourceId: s.resourceId,
|
|
@@ -690,45 +692,45 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
690
692
|
actionId: s.actionId,
|
|
691
693
|
actionDescription: s.actionDescription,
|
|
692
694
|
permissionId: s.permissionId,
|
|
693
|
-
types: [le(
|
|
695
|
+
types: [le(R, m)]
|
|
694
696
|
}
|
|
695
697
|
]
|
|
696
698
|
}
|
|
697
699
|
], A;
|
|
698
700
|
});
|
|
699
|
-
const n =
|
|
700
|
-
v?.value && S.select(v.value),
|
|
701
|
+
const n = j.filter((E) => E.value === d?.nodeProps?.owner?.resourceId).map((E) => E.children).flat(), G = n.map((E) => E.value).indexOf(d.value), v = n.find((E, A) => !E?.nodeProps?.granted && E?.value !== d.value && (n.length > G + 1 ? A > G : !0));
|
|
702
|
+
v?.value && S.select(v.value), h.expand(s.resourceId), L(v);
|
|
701
703
|
}
|
|
702
704
|
});
|
|
703
|
-
}, [
|
|
704
|
-
|
|
705
|
+
}, [d, c, m, q, j, P, C, S, h]), ne = ge(() => {
|
|
706
|
+
g?.nodeProps?.permissionId && q.deletePermission(g.nodeProps.permissionId).then(() => {
|
|
705
707
|
i((v) => [...v].filter((A) => {
|
|
706
|
-
let
|
|
708
|
+
let y = !0;
|
|
707
709
|
return A.permissions?.forEach((T) => {
|
|
708
|
-
T.permissionId !== void 0 && T.permissionId ===
|
|
709
|
-
}),
|
|
710
|
+
T.permissionId !== void 0 && T.permissionId === g?.nodeProps?.permissionId && A.permissions.length === 1 && T?.types?.length === 1 && T.types[0] === le(R, m) && (y = !1);
|
|
711
|
+
}), y;
|
|
710
712
|
}).map((A) => {
|
|
711
|
-
const
|
|
712
|
-
return A.resourceId ===
|
|
713
|
+
const y = g?.nodeProps?.owner;
|
|
714
|
+
return A.resourceId === y.resourceId ? g?.nodeProps?.types?.length === 1 ? {
|
|
713
715
|
...A,
|
|
714
|
-
permissions: [...(A.permissions ?? []).filter((T) => T.permissionId !==
|
|
716
|
+
permissions: [...(A.permissions ?? []).filter((T) => T.permissionId !== g?.nodeProps?.permissionId)]
|
|
715
717
|
} : {
|
|
716
718
|
...A,
|
|
717
|
-
permissions: (A.permissions ?? []).map((T) => T.actionId ===
|
|
719
|
+
permissions: (A.permissions ?? []).map((T) => T.actionId === g.value ? {
|
|
718
720
|
actionId: T.actionId,
|
|
719
721
|
actionDescription: T.actionDescription,
|
|
720
|
-
types: [...T.types?.filter((de) => de && de !== le(
|
|
722
|
+
types: [...T.types?.filter((de) => de && de !== le(R, m)) ?? []]
|
|
721
723
|
} : T)
|
|
722
724
|
} : A;
|
|
723
725
|
}));
|
|
724
|
-
const s = W.filter((v) => v.value ===
|
|
725
|
-
G?.value &&
|
|
726
|
+
const s = W.filter((v) => v.value === g?.nodeProps?.owner?.resourceId).map((v) => v.children).flat(), n = s.map((v) => v.value).indexOf(g.value), G = s.find((v, E) => v?.nodeProps?.types.includes(le(R, m)) && v?.value !== g.value && (s.length > n + 1 ? E > n : !0));
|
|
727
|
+
G?.value && h.select(G.value), re(G);
|
|
726
728
|
});
|
|
727
|
-
}, [
|
|
729
|
+
}, [g, q, m, W, C, h]);
|
|
728
730
|
return Re(() => {
|
|
729
|
-
|
|
730
|
-
}, [
|
|
731
|
-
/* @__PURE__ */ e.jsx(
|
|
731
|
+
u && r && (L(void 0), re(void 0), ae(""), N(""), h.collapseAllNodes(), S.collapseAllNodes(), b());
|
|
732
|
+
}, [u, m, c, b]), r ? /* @__PURE__ */ e.jsx(Fe, { opened: u, onClose: w, title: `${t().t(`archbase:${m}`)}: ${l}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ e.jsxs(ha, { height: "540px", children: [
|
|
733
|
+
/* @__PURE__ */ e.jsx(xa, { 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
734
|
/* @__PURE__ */ e.jsxs("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
|
|
733
735
|
/* @__PURE__ */ e.jsxs($, { mb: 20, children: [
|
|
734
736
|
/* @__PURE__ */ e.jsx(H, { children: t().t("archbase:Available") }),
|
|
@@ -745,12 +747,12 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
745
747
|
/* @__PURE__ */ e.jsx(ye, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e.jsx(
|
|
746
748
|
Ye,
|
|
747
749
|
{
|
|
748
|
-
data:
|
|
750
|
+
data: j,
|
|
749
751
|
selectOnClick: !0,
|
|
750
752
|
allowRangeSelection: !1,
|
|
751
753
|
tree: S,
|
|
752
754
|
renderNode: ({ level: s, node: n, expanded: G, hasChildren: v, selected: E, elementProps: A }) => {
|
|
753
|
-
const
|
|
755
|
+
const y = n?.nodeProps?.granted, T = y ? "dimmed" : void 0, de = y ? "line-through" : void 0, V = ge((Pe) => {
|
|
754
756
|
L(n), A.onClick(Pe);
|
|
755
757
|
}, [n, A.onClick]);
|
|
756
758
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -759,7 +761,7 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
759
761
|
ml: v ? 0 : 5,
|
|
760
762
|
gap: 5,
|
|
761
763
|
...A,
|
|
762
|
-
bg: E && s === 2 ?
|
|
764
|
+
bg: E && s === 2 ? F : "",
|
|
763
765
|
onClick: V,
|
|
764
766
|
children: [
|
|
765
767
|
v && /* @__PURE__ */ e.jsx(
|
|
@@ -792,8 +794,8 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
792
794
|
) })
|
|
793
795
|
] }),
|
|
794
796
|
/* @__PURE__ */ e.jsx("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e.jsxs(oe, { gap: 5, align: "center", children: [
|
|
795
|
-
/* @__PURE__ */ e.jsx(se, { label: t().t("archbase:Add"), children: /* @__PURE__ */ e.jsx(B, { onClick: ce, disabled: !
|
|
796
|
-
/* @__PURE__ */ e.jsx(se, { label: t().t("archbase:Remove"), children: /* @__PURE__ */ e.jsx(B, { onClick: ne, disabled: !
|
|
797
|
+
/* @__PURE__ */ e.jsx(se, { label: t().t("archbase:Add"), children: /* @__PURE__ */ e.jsx(B, { onClick: ce, disabled: !d || d?.nodeProps?.granted || !d.nodeProps, children: /* @__PURE__ */ e.jsx(lr, {}) }) }),
|
|
798
|
+
/* @__PURE__ */ e.jsx(se, { label: t().t("archbase:Remove"), children: /* @__PURE__ */ e.jsx(B, { onClick: ne, disabled: !g || !g?.nodeProps?.permissionId || !g.nodeProps, children: /* @__PURE__ */ e.jsx(cr, {}) }) })
|
|
797
799
|
] }) }),
|
|
798
800
|
/* @__PURE__ */ e.jsxs("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
|
|
799
801
|
/* @__PURE__ */ e.jsxs($, { mb: 20, children: [
|
|
@@ -802,7 +804,7 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
802
804
|
Qe,
|
|
803
805
|
{
|
|
804
806
|
size: "xs",
|
|
805
|
-
value:
|
|
807
|
+
value: D,
|
|
806
808
|
onChange: (s) => N(s.target.value),
|
|
807
809
|
placeholder: t().t("archbase:Filter granted permissions")
|
|
808
810
|
}
|
|
@@ -814,9 +816,9 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
814
816
|
data: W,
|
|
815
817
|
selectOnClick: !0,
|
|
816
818
|
allowRangeSelection: !1,
|
|
817
|
-
tree:
|
|
819
|
+
tree: h,
|
|
818
820
|
renderNode: ({ level: s, node: n, expanded: G, hasChildren: v, selected: E, elementProps: A }) => {
|
|
819
|
-
const
|
|
821
|
+
const y = ge((T) => {
|
|
820
822
|
re(n), A.onClick(T);
|
|
821
823
|
}, [n, A.onClick]);
|
|
822
824
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -825,8 +827,8 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
825
827
|
ml: v ? 0 : 5,
|
|
826
828
|
gap: 5,
|
|
827
829
|
...A,
|
|
828
|
-
bg: E && s === 2 ?
|
|
829
|
-
onClick:
|
|
830
|
+
bg: E && s === 2 ? F : "",
|
|
831
|
+
onClick: y,
|
|
830
832
|
children: [
|
|
831
833
|
v && /* @__PURE__ */ e.jsx(
|
|
832
834
|
Ke,
|
|
@@ -854,22 +856,22 @@ function Ue({ dataSource: r, opened: h, close: w }) {
|
|
|
854
856
|
) })
|
|
855
857
|
] })
|
|
856
858
|
] }) }) }),
|
|
857
|
-
/* @__PURE__ */ e.jsx(
|
|
859
|
+
/* @__PURE__ */ e.jsx(pa, { size: "40px", children: /* @__PURE__ */ e.jsx($, { justify: "flex-end", children: /* @__PURE__ */ e.jsx(M, { onClick: w, children: t().t("archbase:Close") }) }) })
|
|
858
860
|
] }) }) : null;
|
|
859
861
|
}
|
|
860
|
-
const Ne = "data:image/png;base64,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",
|
|
861
|
-
function
|
|
862
|
+
const Ne = "data:image/png;base64,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", Aa = (r) => r.groups ? /* @__PURE__ */ e.jsx("div", { style: { display: "flex" }, children: r.groups.slice().sort((u, w) => (u.group?.name ?? "").localeCompare(w.group?.name ?? "")).map((u, w) => /* @__PURE__ */ e.jsx("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e.jsx(Se, { color: "blue", children: u.group?.name }) }, w)) }) : null, Ta = (r) => r.profile ? /* @__PURE__ */ e.jsx(Se, { color: "green", children: r.profile?.name }) : null;
|
|
863
|
+
function La({
|
|
862
864
|
height: r = "400px",
|
|
863
|
-
width:
|
|
865
|
+
width: u = "100%",
|
|
864
866
|
createEntitiesWithId: w = !0,
|
|
865
|
-
userModalOptions:
|
|
866
|
-
profileModalOptions:
|
|
867
|
-
groupModalOptions:
|
|
867
|
+
userModalOptions: l,
|
|
868
|
+
profileModalOptions: c,
|
|
869
|
+
groupModalOptions: m,
|
|
868
870
|
options: S
|
|
869
871
|
}) {
|
|
870
|
-
const
|
|
872
|
+
const h = nr();
|
|
871
873
|
ir("securityStore");
|
|
872
|
-
const P =
|
|
874
|
+
const P = Yr(), { colorScheme: p } = Oe(), [C, i] = U(void 0), [d, L] = U("users"), g = _(X.User), re = _(X.Group), J = _(X.Resource), ae = _(X.Profile), [Z, D] = U(""), [N, I] = U(""), q = _(X.AccessToken), { t: o } = Xr(), F = je(null), W = je(null), x = je(null), j = je(null), b = je(null), ce = (a) => a.id, ne = (a) => a.id, s = (a) => a.id, n = (a) => a.id, G = (a) => a.id, {
|
|
873
875
|
dataSource: v,
|
|
874
876
|
isLoading: E,
|
|
875
877
|
refreshData: A
|
|
@@ -879,20 +881,20 @@ function $a({
|
|
|
879
881
|
validator: P,
|
|
880
882
|
pageSize: 25,
|
|
881
883
|
defaultSortFields: ["user.email", "expirationTime:desc"],
|
|
882
|
-
onError: (a,
|
|
883
|
-
i(a), Q.showError(`${o("archbase:WARNING")}`, a,
|
|
884
|
+
onError: (a, k) => {
|
|
885
|
+
i(a), Q.showError(`${o("archbase:WARNING")}`, a, k);
|
|
884
886
|
}
|
|
885
887
|
}), {
|
|
886
|
-
dataSource:
|
|
888
|
+
dataSource: y,
|
|
887
889
|
isLoading: T,
|
|
888
890
|
refreshData: de
|
|
889
891
|
} = we({
|
|
890
892
|
name: "dsUsers",
|
|
891
|
-
service:
|
|
893
|
+
service: g,
|
|
892
894
|
validator: P,
|
|
893
895
|
pageSize: 25,
|
|
894
|
-
onError: (a,
|
|
895
|
-
i(a), Q.showError(`${o("archbase:WARNING")}`, a,
|
|
896
|
+
onError: (a, k) => {
|
|
897
|
+
i(a), Q.showError(`${o("archbase:WARNING")}`, a, k);
|
|
896
898
|
}
|
|
897
899
|
}), {
|
|
898
900
|
dataSource: V,
|
|
@@ -903,8 +905,8 @@ function $a({
|
|
|
903
905
|
service: re,
|
|
904
906
|
validator: P,
|
|
905
907
|
pageSize: 25,
|
|
906
|
-
onError: (a,
|
|
907
|
-
i(a), Q.showError(`${o("archbase:WARNING")}`, a,
|
|
908
|
+
onError: (a, k) => {
|
|
909
|
+
i(a), Q.showError(`${o("archbase:WARNING")}`, a, k);
|
|
908
910
|
}
|
|
909
911
|
}), {
|
|
910
912
|
dataSource: O,
|
|
@@ -915,8 +917,8 @@ function $a({
|
|
|
915
917
|
service: ae,
|
|
916
918
|
validator: P,
|
|
917
919
|
pageSize: 25,
|
|
918
|
-
onError: (a,
|
|
919
|
-
i(a), Q.showError(`${o("archbase:WARNING")}`, a,
|
|
920
|
+
onError: (a, k) => {
|
|
921
|
+
i(a), Q.showError(`${o("archbase:WARNING")}`, a, k);
|
|
920
922
|
}
|
|
921
923
|
}), {
|
|
922
924
|
dataSource: xr,
|
|
@@ -927,16 +929,16 @@ function $a({
|
|
|
927
929
|
service: J,
|
|
928
930
|
validator: P,
|
|
929
931
|
pageSize: 25,
|
|
930
|
-
onError: (a,
|
|
931
|
-
i(a), Q.showError(`${o("archbase:WARNING")}`, a,
|
|
932
|
+
onError: (a, k) => {
|
|
933
|
+
i(a), Q.showError(`${o("archbase:WARNING")}`, a, k);
|
|
932
934
|
}
|
|
933
935
|
});
|
|
934
936
|
Re(() => {
|
|
935
|
-
A({ filter:
|
|
937
|
+
A({ filter: Ee(Te.eq("revoked", "false")) }), de(), dr(), hr(), fr();
|
|
936
938
|
}, []);
|
|
937
939
|
const mr = /* @__PURE__ */ e.jsxs(me, { children: [
|
|
938
940
|
/* @__PURE__ */ e.jsx(
|
|
939
|
-
|
|
941
|
+
f,
|
|
940
942
|
{
|
|
941
943
|
dataField: "user.avatar",
|
|
942
944
|
dataType: "image",
|
|
@@ -950,11 +952,12 @@ function $a({
|
|
|
950
952
|
}
|
|
951
953
|
),
|
|
952
954
|
inputFilterType: "text",
|
|
953
|
-
align: "center"
|
|
955
|
+
align: "center",
|
|
956
|
+
exportable: !1
|
|
954
957
|
}
|
|
955
958
|
),
|
|
956
959
|
/* @__PURE__ */ e.jsx(
|
|
957
|
-
|
|
960
|
+
f,
|
|
958
961
|
{
|
|
959
962
|
dataField: "user.userName",
|
|
960
963
|
dataType: "text",
|
|
@@ -964,7 +967,7 @@ function $a({
|
|
|
964
967
|
}
|
|
965
968
|
),
|
|
966
969
|
/* @__PURE__ */ e.jsx(
|
|
967
|
-
|
|
970
|
+
f,
|
|
968
971
|
{
|
|
969
972
|
dataField: "user.email",
|
|
970
973
|
dataType: "text",
|
|
@@ -974,7 +977,7 @@ function $a({
|
|
|
974
977
|
}
|
|
975
978
|
),
|
|
976
979
|
/* @__PURE__ */ e.jsx(
|
|
977
|
-
|
|
980
|
+
f,
|
|
978
981
|
{
|
|
979
982
|
dataField: "expirationDate",
|
|
980
983
|
dataType: "text",
|
|
@@ -985,7 +988,7 @@ function $a({
|
|
|
985
988
|
}
|
|
986
989
|
),
|
|
987
990
|
/* @__PURE__ */ e.jsx(
|
|
988
|
-
|
|
991
|
+
f,
|
|
989
992
|
{
|
|
990
993
|
dataField: "revoked",
|
|
991
994
|
dataType: "boolean",
|
|
@@ -994,7 +997,7 @@ function $a({
|
|
|
994
997
|
}
|
|
995
998
|
),
|
|
996
999
|
/* @__PURE__ */ e.jsx(
|
|
997
|
-
|
|
1000
|
+
f,
|
|
998
1001
|
{
|
|
999
1002
|
dataField: "expired",
|
|
1000
1003
|
dataType: "boolean",
|
|
@@ -1003,7 +1006,7 @@ function $a({
|
|
|
1003
1006
|
}
|
|
1004
1007
|
),
|
|
1005
1008
|
/* @__PURE__ */ e.jsx(
|
|
1006
|
-
|
|
1009
|
+
f,
|
|
1007
1010
|
{
|
|
1008
1011
|
dataField: "token",
|
|
1009
1012
|
dataType: "text",
|
|
@@ -1014,7 +1017,7 @@ function $a({
|
|
|
1014
1017
|
)
|
|
1015
1018
|
] }), br = /* @__PURE__ */ e.jsxs(me, { children: [
|
|
1016
1019
|
/* @__PURE__ */ e.jsx(
|
|
1017
|
-
|
|
1020
|
+
f,
|
|
1018
1021
|
{
|
|
1019
1022
|
dataField: "avatar",
|
|
1020
1023
|
dataType: "image",
|
|
@@ -1030,41 +1033,45 @@ function $a({
|
|
|
1030
1033
|
enableSorting: !1,
|
|
1031
1034
|
enableColumnFilter: !1,
|
|
1032
1035
|
enableGlobalFilter: !1,
|
|
1033
|
-
align: "center"
|
|
1036
|
+
align: "center",
|
|
1037
|
+
exportable: !1
|
|
1034
1038
|
}
|
|
1035
1039
|
),
|
|
1036
1040
|
/* @__PURE__ */ e.jsx(
|
|
1037
|
-
|
|
1041
|
+
f,
|
|
1038
1042
|
{
|
|
1039
1043
|
dataField: "name",
|
|
1040
1044
|
dataType: "text",
|
|
1041
1045
|
size: 300,
|
|
1042
1046
|
header: `${o("archbase:Nome")}`,
|
|
1043
|
-
inputFilterType: "text"
|
|
1047
|
+
inputFilterType: "text",
|
|
1048
|
+
truncate: !0
|
|
1044
1049
|
}
|
|
1045
1050
|
),
|
|
1046
1051
|
/* @__PURE__ */ e.jsx(
|
|
1047
|
-
|
|
1052
|
+
f,
|
|
1048
1053
|
{
|
|
1049
1054
|
dataField: "nickname",
|
|
1050
1055
|
dataType: "text",
|
|
1051
1056
|
size: 120,
|
|
1052
1057
|
header: `${o("archbase:Apelido")}`,
|
|
1053
|
-
inputFilterType: "text"
|
|
1058
|
+
inputFilterType: "text",
|
|
1059
|
+
truncate: !0
|
|
1054
1060
|
}
|
|
1055
1061
|
),
|
|
1056
1062
|
/* @__PURE__ */ e.jsx(
|
|
1057
|
-
|
|
1063
|
+
f,
|
|
1058
1064
|
{
|
|
1059
1065
|
dataField: "email",
|
|
1060
1066
|
dataType: "text",
|
|
1061
1067
|
header: `${o("archbase:Email")}`,
|
|
1062
1068
|
size: 300,
|
|
1063
|
-
inputFilterType: "text"
|
|
1069
|
+
inputFilterType: "text",
|
|
1070
|
+
truncate: !0
|
|
1064
1071
|
}
|
|
1065
1072
|
),
|
|
1066
1073
|
/* @__PURE__ */ e.jsx(
|
|
1067
|
-
|
|
1074
|
+
f,
|
|
1068
1075
|
{
|
|
1069
1076
|
dataField: "accountDeactivated",
|
|
1070
1077
|
dataType: "boolean",
|
|
@@ -1074,31 +1081,32 @@ function $a({
|
|
|
1074
1081
|
}
|
|
1075
1082
|
),
|
|
1076
1083
|
/* @__PURE__ */ e.jsx(
|
|
1077
|
-
|
|
1084
|
+
f,
|
|
1078
1085
|
{
|
|
1079
1086
|
dataField: "profile.name",
|
|
1080
1087
|
dataType: "text",
|
|
1081
1088
|
header: `${o("archbase:Perfil")}`,
|
|
1082
1089
|
size: 200,
|
|
1083
|
-
render: (a) =>
|
|
1090
|
+
render: (a) => Ta(a.row),
|
|
1084
1091
|
inputFilterType: "text"
|
|
1085
1092
|
}
|
|
1086
1093
|
),
|
|
1087
1094
|
/* @__PURE__ */ e.jsx(
|
|
1088
|
-
|
|
1095
|
+
f,
|
|
1089
1096
|
{
|
|
1090
1097
|
dataField: "groups",
|
|
1091
1098
|
dataType: "text",
|
|
1092
1099
|
size: 300,
|
|
1093
1100
|
header: `${o("archbase:Grupos")}`,
|
|
1094
|
-
render: (a) =>
|
|
1101
|
+
render: (a) => Aa(a.row),
|
|
1102
|
+
exportValue: (a) => a.groups?.slice().sort((k, Jr) => (k.group?.name ?? "").localeCompare(Jr.group?.name ?? "")).map((k) => k.group?.name).filter(Boolean).join(", ") || "",
|
|
1095
1103
|
enableSorting: !1,
|
|
1096
1104
|
enableColumnFilter: !1,
|
|
1097
1105
|
enableGlobalFilter: !1
|
|
1098
1106
|
}
|
|
1099
1107
|
),
|
|
1100
1108
|
/* @__PURE__ */ e.jsx(
|
|
1101
|
-
|
|
1109
|
+
f,
|
|
1102
1110
|
{
|
|
1103
1111
|
dataField: "isAdministrator",
|
|
1104
1112
|
dataType: "boolean",
|
|
@@ -1107,7 +1115,7 @@ function $a({
|
|
|
1107
1115
|
}
|
|
1108
1116
|
),
|
|
1109
1117
|
/* @__PURE__ */ e.jsx(
|
|
1110
|
-
|
|
1118
|
+
f,
|
|
1111
1119
|
{
|
|
1112
1120
|
dataField: "changePasswordOnNextLogin",
|
|
1113
1121
|
dataType: "boolean",
|
|
@@ -1117,7 +1125,7 @@ function $a({
|
|
|
1117
1125
|
}
|
|
1118
1126
|
),
|
|
1119
1127
|
/* @__PURE__ */ e.jsx(
|
|
1120
|
-
|
|
1128
|
+
f,
|
|
1121
1129
|
{
|
|
1122
1130
|
dataField: "allowPasswordChange",
|
|
1123
1131
|
dataType: "boolean",
|
|
@@ -1127,7 +1135,7 @@ function $a({
|
|
|
1127
1135
|
}
|
|
1128
1136
|
),
|
|
1129
1137
|
/* @__PURE__ */ e.jsx(
|
|
1130
|
-
|
|
1138
|
+
f,
|
|
1131
1139
|
{
|
|
1132
1140
|
dataField: "allowMultipleLogins",
|
|
1133
1141
|
dataType: "boolean",
|
|
@@ -1137,7 +1145,7 @@ function $a({
|
|
|
1137
1145
|
}
|
|
1138
1146
|
),
|
|
1139
1147
|
/* @__PURE__ */ e.jsx(
|
|
1140
|
-
|
|
1148
|
+
f,
|
|
1141
1149
|
{
|
|
1142
1150
|
dataField: "passwordNeverExpires",
|
|
1143
1151
|
dataType: "boolean",
|
|
@@ -1147,7 +1155,7 @@ function $a({
|
|
|
1147
1155
|
}
|
|
1148
1156
|
),
|
|
1149
1157
|
/* @__PURE__ */ e.jsx(
|
|
1150
|
-
|
|
1158
|
+
f,
|
|
1151
1159
|
{
|
|
1152
1160
|
dataField: "accountLocked",
|
|
1153
1161
|
dataType: "boolean",
|
|
@@ -1157,7 +1165,7 @@ function $a({
|
|
|
1157
1165
|
}
|
|
1158
1166
|
),
|
|
1159
1167
|
/* @__PURE__ */ e.jsx(
|
|
1160
|
-
|
|
1168
|
+
f,
|
|
1161
1169
|
{
|
|
1162
1170
|
dataField: "unlimitedAccessHours",
|
|
1163
1171
|
dataType: "boolean",
|
|
@@ -1168,7 +1176,7 @@ function $a({
|
|
|
1168
1176
|
)
|
|
1169
1177
|
] }), gr = /* @__PURE__ */ e.jsxs(me, { children: [
|
|
1170
1178
|
/* @__PURE__ */ e.jsx(
|
|
1171
|
-
|
|
1179
|
+
f,
|
|
1172
1180
|
{
|
|
1173
1181
|
dataField: "name",
|
|
1174
1182
|
dataType: "text",
|
|
@@ -1178,7 +1186,7 @@ function $a({
|
|
|
1178
1186
|
}
|
|
1179
1187
|
),
|
|
1180
1188
|
/* @__PURE__ */ e.jsx(
|
|
1181
|
-
|
|
1189
|
+
f,
|
|
1182
1190
|
{
|
|
1183
1191
|
dataField: "description",
|
|
1184
1192
|
dataType: "text",
|
|
@@ -1189,7 +1197,7 @@ function $a({
|
|
|
1189
1197
|
)
|
|
1190
1198
|
] }), jr = /* @__PURE__ */ e.jsxs(me, { children: [
|
|
1191
1199
|
/* @__PURE__ */ e.jsx(
|
|
1192
|
-
|
|
1200
|
+
f,
|
|
1193
1201
|
{
|
|
1194
1202
|
dataField: "name",
|
|
1195
1203
|
dataType: "text",
|
|
@@ -1199,7 +1207,7 @@ function $a({
|
|
|
1199
1207
|
}
|
|
1200
1208
|
),
|
|
1201
1209
|
/* @__PURE__ */ e.jsx(
|
|
1202
|
-
|
|
1210
|
+
f,
|
|
1203
1211
|
{
|
|
1204
1212
|
dataField: "description",
|
|
1205
1213
|
dataType: "text",
|
|
@@ -1210,7 +1218,7 @@ function $a({
|
|
|
1210
1218
|
)
|
|
1211
1219
|
] }), yr = /* @__PURE__ */ e.jsxs(me, { children: [
|
|
1212
1220
|
/* @__PURE__ */ e.jsx(
|
|
1213
|
-
|
|
1221
|
+
f,
|
|
1214
1222
|
{
|
|
1215
1223
|
dataField: "name",
|
|
1216
1224
|
dataType: "text",
|
|
@@ -1220,7 +1228,7 @@ function $a({
|
|
|
1220
1228
|
}
|
|
1221
1229
|
),
|
|
1222
1230
|
/* @__PURE__ */ e.jsx(
|
|
1223
|
-
|
|
1231
|
+
f,
|
|
1224
1232
|
{
|
|
1225
1233
|
dataField: "description",
|
|
1226
1234
|
dataType: "text",
|
|
@@ -1230,34 +1238,34 @@ function $a({
|
|
|
1230
1238
|
}
|
|
1231
1239
|
)
|
|
1232
1240
|
] }), wr = () => {
|
|
1233
|
-
const a =
|
|
1234
|
-
w || (a.id = void 0),
|
|
1241
|
+
const a = na.newInstance();
|
|
1242
|
+
w || (a.id = void 0), y.insert(a), D(R.USER);
|
|
1235
1243
|
}, vr = (a) => {
|
|
1236
|
-
|
|
1244
|
+
y.isEmpty() || y.gotoRecordByData(a) && (y.edit(), D(R.USER));
|
|
1237
1245
|
}, Cr = (a) => {
|
|
1238
|
-
|
|
1246
|
+
y.isEmpty() || y.gotoRecordByData(a) && K.showConfirmDialogYesNo(
|
|
1239
1247
|
`${o("archbase:Confirme")}`,
|
|
1240
1248
|
`${o("archbase:Deseja remover o usuário ")}${a.name} ?`,
|
|
1241
1249
|
() => {
|
|
1242
|
-
|
|
1250
|
+
y.remove();
|
|
1243
1251
|
},
|
|
1244
1252
|
() => {
|
|
1245
1253
|
}
|
|
1246
1254
|
);
|
|
1247
1255
|
}, Sr = (a) => {
|
|
1248
|
-
|
|
1256
|
+
y.isEmpty() || y.gotoRecordByData(a) && D(R.USER);
|
|
1249
1257
|
}, Ar = (a) => /* @__PURE__ */ e.jsxs($, { gap: 1, wrap: "nowrap", children: [
|
|
1250
1258
|
S?.beforeDefaultUserActions?.(a),
|
|
1251
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Sr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: p === "dark" ?
|
|
1252
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => vr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color: p === "dark" ?
|
|
1253
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Cr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: p === "dark" ?
|
|
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" ?
|
|
1259
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Sr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: p === "dark" ? h.colors.blue[8] : h.colors.blue[4] }) }),
|
|
1260
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => vr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color: p === "dark" ? h.colors.yellow[8] : h.colors.yellow[4] }) }),
|
|
1261
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Cr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: p === "dark" ? h.colors.red[8] : h.colors.red[4] }) }),
|
|
1262
|
+
/* @__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" ? h.colors.green[8] : h.colors.green[4] }) }) }),
|
|
1255
1263
|
S?.afterDefaultUserActions?.(a)
|
|
1256
1264
|
] }), Tr = () => {
|
|
1257
|
-
const a =
|
|
1258
|
-
w || (a.id = void 0), V.insert(a),
|
|
1265
|
+
const a = ia.newInstance();
|
|
1266
|
+
w || (a.id = void 0), V.insert(a), D(R.GROUP);
|
|
1259
1267
|
}, kr = (a) => {
|
|
1260
|
-
V.isEmpty() || V.gotoRecordByData(a) && (V.isEditing() || V.edit(),
|
|
1268
|
+
V.isEmpty() || V.gotoRecordByData(a) && (V.isEditing() || V.edit(), D(R.GROUP));
|
|
1261
1269
|
}, Rr = (a) => {
|
|
1262
1270
|
V.isEmpty() || V.gotoRecordByData(a) && K.showConfirmDialogYesNo(
|
|
1263
1271
|
`${o("archbase:Confirme")}`,
|
|
@@ -1269,47 +1277,47 @@ function $a({
|
|
|
1269
1277
|
}
|
|
1270
1278
|
);
|
|
1271
1279
|
}, Fr = (a) => {
|
|
1272
|
-
V.isEmpty() || V.gotoRecordByData(a) &&
|
|
1280
|
+
V.isEmpty() || V.gotoRecordByData(a) && D(R.GROUP);
|
|
1273
1281
|
}, Dr = (a) => /* @__PURE__ */ e.jsxs($, { gap: 1, wrap: "nowrap", children: [
|
|
1274
1282
|
S?.beforeDefaultGroupActions?.(a),
|
|
1275
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Fr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: p === "dark" ?
|
|
1276
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => kr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color: p === "dark" ?
|
|
1277
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Rr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: p === "dark" ?
|
|
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" ?
|
|
1283
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Fr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: p === "dark" ? h.colors.blue[8] : h.colors.blue[4] }) }),
|
|
1284
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => kr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color: p === "dark" ? h.colors.yellow[8] : h.colors.yellow[4] }) }),
|
|
1285
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Rr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: p === "dark" ? h.colors.red[8] : h.colors.red[4] }) }),
|
|
1286
|
+
/* @__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" ? h.colors.green[8] : h.colors.green[4] }) }) }),
|
|
1279
1287
|
S?.afterDefaultGroupActions?.(a)
|
|
1280
|
-
] }), ue =
|
|
1288
|
+
] }), ue = Kr(), zr = async () => {
|
|
1281
1289
|
try {
|
|
1282
|
-
await
|
|
1290
|
+
await y.save();
|
|
1283
1291
|
} catch {
|
|
1284
1292
|
return;
|
|
1285
1293
|
}
|
|
1286
|
-
|
|
1287
|
-
},
|
|
1288
|
-
|
|
1289
|
-
},
|
|
1294
|
+
D(""), ue?.clearAll();
|
|
1295
|
+
}, Ir = () => {
|
|
1296
|
+
D(""), y.isBrowsing() || y.cancel(), ue?.clearAll();
|
|
1297
|
+
}, Er = async () => {
|
|
1290
1298
|
try {
|
|
1291
1299
|
await V.save();
|
|
1292
1300
|
} catch {
|
|
1293
1301
|
return;
|
|
1294
1302
|
}
|
|
1295
|
-
|
|
1303
|
+
D(""), ue?.clearAll();
|
|
1296
1304
|
}, Pr = () => {
|
|
1297
|
-
|
|
1305
|
+
D(""), V.isBrowsing() || V.cancel(), ue?.clearAll();
|
|
1298
1306
|
}, Gr = async () => {
|
|
1299
1307
|
try {
|
|
1300
1308
|
await O.save();
|
|
1301
1309
|
} catch {
|
|
1302
1310
|
return;
|
|
1303
1311
|
}
|
|
1304
|
-
|
|
1312
|
+
D(""), ue?.clearAll();
|
|
1305
1313
|
}, $r = () => {
|
|
1306
|
-
|
|
1314
|
+
D(""), O.isBrowsing() || O.cancel(), ue?.clearAll();
|
|
1307
1315
|
}, Lr = () => {
|
|
1308
|
-
const a =
|
|
1309
|
-
w || (a.id = void 0), O.insert(a),
|
|
1316
|
+
const a = la.newInstance();
|
|
1317
|
+
w || (a.id = void 0), O.insert(a), D(R.PROFILE);
|
|
1310
1318
|
}, Vr = (a) => {
|
|
1311
|
-
O.isEmpty() || O.gotoRecordByData(a) && (O.isEditing() || O.edit(),
|
|
1312
|
-
},
|
|
1319
|
+
O.isEmpty() || O.gotoRecordByData(a) && (O.isEditing() || O.edit(), D(R.PROFILE));
|
|
1320
|
+
}, Mr = (a) => {
|
|
1313
1321
|
O.isEmpty() || O.gotoRecordByData(a) && K.showConfirmDialogYesNo(
|
|
1314
1322
|
`${o("archbase:Confirme")}`,
|
|
1315
1323
|
`${o("archbase:Deseja remover o perfil ")}${a.name} ?`,
|
|
@@ -1319,14 +1327,14 @@ function $a({
|
|
|
1319
1327
|
() => {
|
|
1320
1328
|
}
|
|
1321
1329
|
);
|
|
1322
|
-
},
|
|
1323
|
-
O.isEmpty() || O.gotoRecordByData(a) &&
|
|
1330
|
+
}, Ur = (a) => {
|
|
1331
|
+
O.isEmpty() || O.gotoRecordByData(a) && D(R.PROFILE);
|
|
1324
1332
|
}, Nr = (a) => /* @__PURE__ */ e.jsxs($, { gap: 1, wrap: "nowrap", children: [
|
|
1325
1333
|
S?.beforeDefaultProfileActions?.(a),
|
|
1326
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () =>
|
|
1327
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Vr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color: p === "dark" ?
|
|
1328
|
-
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () =>
|
|
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" ?
|
|
1334
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Ur(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: p === "dark" ? h.colors.blue[8] : h.colors.blue[4] }) }),
|
|
1335
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Vr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color: p === "dark" ? h.colors.yellow[8] : h.colors.yellow[4] }) }),
|
|
1336
|
+
/* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Mr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: p === "dark" ? h.colors.red[8] : h.colors.red[4] }) }),
|
|
1337
|
+
/* @__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" ? h.colors.green[8] : h.colors.green[4] }) }) }),
|
|
1330
1338
|
S?.afterDefaultProfileActions?.(a)
|
|
1331
1339
|
] }), Or = () => {
|
|
1332
1340
|
const a = v.getCurrentRecord();
|
|
@@ -1339,11 +1347,11 @@ function $a({
|
|
|
1339
1347
|
`${o("mentors:Informação")}`,
|
|
1340
1348
|
`${o("mentors:Token de Acesso revogado com sucesso!")}`
|
|
1341
1349
|
), v.refreshData();
|
|
1342
|
-
}).catch((
|
|
1350
|
+
}).catch((k) => {
|
|
1343
1351
|
K.showErrorWithDetails(
|
|
1344
1352
|
`${o("mentors:Atenção")}`,
|
|
1345
|
-
Ae(
|
|
1346
|
-
|
|
1353
|
+
Ae(k),
|
|
1354
|
+
ze(k)
|
|
1347
1355
|
);
|
|
1348
1356
|
});
|
|
1349
1357
|
},
|
|
@@ -1351,33 +1359,33 @@ function $a({
|
|
|
1351
1359
|
}
|
|
1352
1360
|
);
|
|
1353
1361
|
}, Be = () => {
|
|
1354
|
-
I(
|
|
1362
|
+
I(R.USER);
|
|
1355
1363
|
}, We = () => {
|
|
1356
|
-
I(
|
|
1364
|
+
I(R.GROUP);
|
|
1357
1365
|
}, qe = () => {
|
|
1358
|
-
I(
|
|
1366
|
+
I(R.PROFILE);
|
|
1359
1367
|
}, Ge = () => {
|
|
1360
1368
|
I("");
|
|
1361
1369
|
}, Br = () => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", style: { width: "50%" }, children: [
|
|
1362
1370
|
/* @__PURE__ */ e.jsxs($, { align: "end", gap: "4px", wrap: "nowrap", children: [
|
|
1363
|
-
/* @__PURE__ */ e.jsx(
|
|
1364
|
-
/* @__PURE__ */ e.jsx(
|
|
1371
|
+
/* @__PURE__ */ e.jsx(M, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Ie, {}), onClick: wr, children: `${o("archbase:New")}` }),
|
|
1372
|
+
/* @__PURE__ */ e.jsx(M, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(fe, {}), onClick: Be, children: `${o("archbase:Edit permissions")}` })
|
|
1365
1373
|
] }),
|
|
1366
1374
|
/* @__PURE__ */ e.jsx(te, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
|
|
1367
1375
|
] }), Wr = () => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", style: { width: "50%" }, children: [
|
|
1368
1376
|
/* @__PURE__ */ e.jsxs($, { align: "end", gap: "4px", wrap: "nowrap", children: [
|
|
1369
|
-
/* @__PURE__ */ e.jsx(
|
|
1370
|
-
/* @__PURE__ */ e.jsx(
|
|
1377
|
+
/* @__PURE__ */ e.jsx(M, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Ie, {}), onClick: Tr, children: `${o("archbase:New")}` }),
|
|
1378
|
+
/* @__PURE__ */ e.jsx(M, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(fe, {}), onClick: We, children: `${o("archbase:Edit permissions")}` })
|
|
1371
1379
|
] }),
|
|
1372
1380
|
/* @__PURE__ */ e.jsx(te, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
|
|
1373
1381
|
] }), qr = () => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", style: { width: "50%" }, children: [
|
|
1374
1382
|
/* @__PURE__ */ e.jsxs($, { align: "end", gap: "4px", wrap: "nowrap", children: [
|
|
1375
|
-
/* @__PURE__ */ e.jsx(
|
|
1376
|
-
/* @__PURE__ */ e.jsx(
|
|
1383
|
+
/* @__PURE__ */ e.jsx(M, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Ie, {}), onClick: Lr, children: `${o("archbase:New")}` }),
|
|
1384
|
+
/* @__PURE__ */ e.jsx(M, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(fe, {}), onClick: qe, children: `${o("archbase:Edit permissions")}` })
|
|
1377
1385
|
] }),
|
|
1378
1386
|
/* @__PURE__ */ e.jsx(te, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
|
|
1379
1387
|
] }), 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
|
-
|
|
1388
|
+
M,
|
|
1381
1389
|
{
|
|
1382
1390
|
disabled: !v.getCurrentRecord(),
|
|
1383
1391
|
color: "red",
|
|
@@ -1387,7 +1395,7 @@ function $a({
|
|
|
1387
1395
|
}
|
|
1388
1396
|
) }) });
|
|
1389
1397
|
return /* @__PURE__ */ e.jsxs(Y, { p: "md", style: { height: r, display: "flex", flexDirection: "column" }, children: [
|
|
1390
|
-
/* @__PURE__ */ e.jsx(ie, { variant: "pills", value:
|
|
1398
|
+
/* @__PURE__ */ e.jsx(ie, { variant: "pills", value: d, onChange: L, children: /* @__PURE__ */ e.jsxs(ie.List, { children: [
|
|
1391
1399
|
/* @__PURE__ */ e.jsx(ie.Tab, { value: "users", children: `${o("Usuários")}` }),
|
|
1392
1400
|
/* @__PURE__ */ e.jsx(ie.Tab, { value: "groups", children: `${o("Grupos")}` }),
|
|
1393
1401
|
/* @__PURE__ */ e.jsx(ie.Tab, { value: "profiles", children: `${o("Perfis")}` }),
|
|
@@ -1400,7 +1408,7 @@ function $a({
|
|
|
1400
1408
|
withBorder: !0,
|
|
1401
1409
|
mt: "md",
|
|
1402
1410
|
style: {
|
|
1403
|
-
display:
|
|
1411
|
+
display: d === "users" ? "flex" : "none",
|
|
1404
1412
|
width: "100%",
|
|
1405
1413
|
flex: 1,
|
|
1406
1414
|
minHeight: 0,
|
|
@@ -1409,12 +1417,12 @@ function $a({
|
|
|
1409
1417
|
children: /* @__PURE__ */ e.jsx(
|
|
1410
1418
|
be,
|
|
1411
1419
|
{
|
|
1412
|
-
gridRef:
|
|
1420
|
+
gridRef: F,
|
|
1413
1421
|
printTitle: "Usuários",
|
|
1414
1422
|
width: "100%",
|
|
1415
1423
|
height: "100%",
|
|
1416
1424
|
withBorder: !1,
|
|
1417
|
-
dataSource:
|
|
1425
|
+
dataSource: y,
|
|
1418
1426
|
withColumnBorders: !0,
|
|
1419
1427
|
striped: !0,
|
|
1420
1428
|
enableTopToolbar: !0,
|
|
@@ -1439,7 +1447,7 @@ function $a({
|
|
|
1439
1447
|
withBorder: !0,
|
|
1440
1448
|
mt: "md",
|
|
1441
1449
|
style: {
|
|
1442
|
-
display:
|
|
1450
|
+
display: d === "groups" ? "flex" : "none",
|
|
1443
1451
|
flex: 1,
|
|
1444
1452
|
minHeight: 0,
|
|
1445
1453
|
overflow: "auto"
|
|
@@ -1477,7 +1485,7 @@ function $a({
|
|
|
1477
1485
|
withBorder: !0,
|
|
1478
1486
|
mt: "md",
|
|
1479
1487
|
style: {
|
|
1480
|
-
display:
|
|
1488
|
+
display: d === "profiles" ? "flex" : "none",
|
|
1481
1489
|
flex: 1,
|
|
1482
1490
|
minHeight: 0,
|
|
1483
1491
|
overflow: "auto"
|
|
@@ -1515,7 +1523,7 @@ function $a({
|
|
|
1515
1523
|
withBorder: !0,
|
|
1516
1524
|
mt: "md",
|
|
1517
1525
|
style: {
|
|
1518
|
-
display:
|
|
1526
|
+
display: d === "resources" ? "flex" : "none",
|
|
1519
1527
|
flex: 1,
|
|
1520
1528
|
minHeight: 0,
|
|
1521
1529
|
overflow: "auto"
|
|
@@ -1523,7 +1531,7 @@ function $a({
|
|
|
1523
1531
|
children: /* @__PURE__ */ e.jsx(
|
|
1524
1532
|
be,
|
|
1525
1533
|
{
|
|
1526
|
-
gridRef:
|
|
1534
|
+
gridRef: j,
|
|
1527
1535
|
printTitle: "Recursos",
|
|
1528
1536
|
width: "100%",
|
|
1529
1537
|
height: "100%",
|
|
@@ -1550,7 +1558,7 @@ function $a({
|
|
|
1550
1558
|
withBorder: !0,
|
|
1551
1559
|
mt: "md",
|
|
1552
1560
|
style: {
|
|
1553
|
-
display:
|
|
1561
|
+
display: d === "accessTokens" ? "flex" : "none",
|
|
1554
1562
|
width: "100%",
|
|
1555
1563
|
flex: 1,
|
|
1556
1564
|
minHeight: 0,
|
|
@@ -1559,7 +1567,7 @@ function $a({
|
|
|
1559
1567
|
children: /* @__PURE__ */ e.jsx(
|
|
1560
1568
|
be,
|
|
1561
1569
|
{
|
|
1562
|
-
gridRef:
|
|
1570
|
+
gridRef: b,
|
|
1563
1571
|
printTitle: "Tokens de API",
|
|
1564
1572
|
width: "100%",
|
|
1565
1573
|
height: "100%",
|
|
@@ -1581,54 +1589,54 @@ function $a({
|
|
|
1581
1589
|
)
|
|
1582
1590
|
}
|
|
1583
1591
|
),
|
|
1584
|
-
Z ===
|
|
1585
|
-
|
|
1592
|
+
Z === R.USER ? /* @__PURE__ */ e.jsx(
|
|
1593
|
+
wa,
|
|
1586
1594
|
{
|
|
1587
|
-
onClickOk:
|
|
1595
|
+
onClickOk: zr,
|
|
1588
1596
|
opened: !0,
|
|
1589
|
-
dataSource:
|
|
1590
|
-
onClickCancel:
|
|
1591
|
-
options:
|
|
1597
|
+
dataSource: y,
|
|
1598
|
+
onClickCancel: Ir,
|
|
1599
|
+
options: l
|
|
1592
1600
|
}
|
|
1593
1601
|
) : null,
|
|
1594
|
-
Z ===
|
|
1595
|
-
|
|
1602
|
+
Z === R.GROUP ? /* @__PURE__ */ e.jsx(
|
|
1603
|
+
va,
|
|
1596
1604
|
{
|
|
1597
|
-
onClickOk:
|
|
1605
|
+
onClickOk: Er,
|
|
1598
1606
|
opened: !0,
|
|
1599
1607
|
dataSource: V,
|
|
1600
1608
|
onClickCancel: Pr,
|
|
1601
|
-
options:
|
|
1609
|
+
options: m
|
|
1602
1610
|
}
|
|
1603
1611
|
) : null,
|
|
1604
|
-
Z ===
|
|
1605
|
-
|
|
1612
|
+
Z === R.PROFILE ? /* @__PURE__ */ e.jsx(
|
|
1613
|
+
ba,
|
|
1606
1614
|
{
|
|
1607
1615
|
onClickOk: Gr,
|
|
1608
1616
|
opened: !0,
|
|
1609
1617
|
dataSource: O,
|
|
1610
1618
|
onClickCancel: $r,
|
|
1611
|
-
options:
|
|
1619
|
+
options: c
|
|
1612
1620
|
}
|
|
1613
1621
|
) : null,
|
|
1614
|
-
N ===
|
|
1615
|
-
|
|
1622
|
+
N === R.USER ? /* @__PURE__ */ e.jsx(
|
|
1623
|
+
Me,
|
|
1616
1624
|
{
|
|
1617
|
-
dataSource:
|
|
1625
|
+
dataSource: y,
|
|
1618
1626
|
opened: !!N,
|
|
1619
1627
|
close: Ge
|
|
1620
1628
|
}
|
|
1621
1629
|
) : null,
|
|
1622
|
-
N ===
|
|
1623
|
-
|
|
1630
|
+
N === R.GROUP ? /* @__PURE__ */ e.jsx(
|
|
1631
|
+
Me,
|
|
1624
1632
|
{
|
|
1625
1633
|
dataSource: V,
|
|
1626
1634
|
opened: !!N,
|
|
1627
1635
|
close: Ge
|
|
1628
1636
|
}
|
|
1629
1637
|
) : null,
|
|
1630
|
-
N ===
|
|
1631
|
-
|
|
1638
|
+
N === R.PROFILE ? /* @__PURE__ */ e.jsx(
|
|
1639
|
+
Me,
|
|
1632
1640
|
{
|
|
1633
1641
|
dataSource: O,
|
|
1634
1642
|
opened: !!N,
|
|
@@ -1637,48 +1645,48 @@ function $a({
|
|
|
1637
1645
|
) : null
|
|
1638
1646
|
] });
|
|
1639
1647
|
}
|
|
1640
|
-
function
|
|
1648
|
+
function Va({ height: r = "400px", width: u = "100%" }) {
|
|
1641
1649
|
nr();
|
|
1642
|
-
const w = ir("apiTokenStore"),
|
|
1650
|
+
const w = ir("apiTokenStore"), l = { validateEntity: () => [] }, { colorScheme: c } = Oe(), [m, S] = U(void 0), h = _(X.ApiToken), [P, p] = U(""), C = je(null), i = (F) => F.id, { dataSource: d } = oa({
|
|
1643
1651
|
initialData: [],
|
|
1644
1652
|
name: "dataSource"
|
|
1645
1653
|
}), L = ke(
|
|
1646
1654
|
"ArchbaseApiTokenView-LocalDataSource",
|
|
1647
|
-
|
|
1655
|
+
d,
|
|
1648
1656
|
void 0,
|
|
1649
1657
|
void 0
|
|
1650
|
-
), { dataSource:
|
|
1658
|
+
), { dataSource: g, isLoading: re } = Ue({
|
|
1651
1659
|
name: "dsApiToken",
|
|
1652
|
-
service:
|
|
1660
|
+
service: h,
|
|
1653
1661
|
store: w,
|
|
1654
|
-
validator:
|
|
1662
|
+
validator: l,
|
|
1655
1663
|
pageSize: 25,
|
|
1656
1664
|
loadOnStart: !0,
|
|
1657
|
-
onLoadComplete: (
|
|
1665
|
+
onLoadComplete: (F) => {
|
|
1658
1666
|
},
|
|
1659
|
-
onDestroy: (
|
|
1667
|
+
onDestroy: (F) => {
|
|
1660
1668
|
},
|
|
1661
|
-
onError: (
|
|
1662
|
-
S(
|
|
1669
|
+
onError: (F, W) => {
|
|
1670
|
+
S(F), Q.showError(t().t("archbase:WARNING"), F, W);
|
|
1663
1671
|
}
|
|
1664
1672
|
}), J = ke(
|
|
1665
1673
|
"ArchbaseApiTokenView-RemoteDataSource",
|
|
1666
|
-
|
|
1674
|
+
g,
|
|
1667
1675
|
void 0,
|
|
1668
1676
|
void 0
|
|
1669
1677
|
), ae = `calc(${r} - 40px)`, Z = /* @__PURE__ */ e.jsxs(me, { children: [
|
|
1670
1678
|
/* @__PURE__ */ e.jsx(
|
|
1671
|
-
|
|
1679
|
+
f,
|
|
1672
1680
|
{
|
|
1673
1681
|
dataField: "user.avatar",
|
|
1674
1682
|
dataType: "image",
|
|
1675
1683
|
size: 80,
|
|
1676
1684
|
header: "Foto",
|
|
1677
|
-
render: (
|
|
1685
|
+
render: (F) => /* @__PURE__ */ e.jsx(
|
|
1678
1686
|
"img",
|
|
1679
1687
|
{
|
|
1680
1688
|
style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
|
|
1681
|
-
src:
|
|
1689
|
+
src: F.row.user && F.row.user.avatar ? atob(F.row.user.avatar) : Ne
|
|
1682
1690
|
}
|
|
1683
1691
|
),
|
|
1684
1692
|
inputFilterType: "text",
|
|
@@ -1686,7 +1694,7 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1686
1694
|
}
|
|
1687
1695
|
),
|
|
1688
1696
|
/* @__PURE__ */ e.jsx(
|
|
1689
|
-
|
|
1697
|
+
f,
|
|
1690
1698
|
{
|
|
1691
1699
|
dataField: "user.userName",
|
|
1692
1700
|
dataType: "text",
|
|
@@ -1696,7 +1704,7 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1696
1704
|
}
|
|
1697
1705
|
),
|
|
1698
1706
|
/* @__PURE__ */ e.jsx(
|
|
1699
|
-
|
|
1707
|
+
f,
|
|
1700
1708
|
{
|
|
1701
1709
|
dataField: "user.email",
|
|
1702
1710
|
dataType: "text",
|
|
@@ -1706,7 +1714,27 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1706
1714
|
}
|
|
1707
1715
|
),
|
|
1708
1716
|
/* @__PURE__ */ e.jsx(
|
|
1709
|
-
|
|
1717
|
+
f,
|
|
1718
|
+
{
|
|
1719
|
+
dataField: "name",
|
|
1720
|
+
dataType: "text",
|
|
1721
|
+
header: "Nome",
|
|
1722
|
+
size: 240,
|
|
1723
|
+
inputFilterType: "text"
|
|
1724
|
+
}
|
|
1725
|
+
),
|
|
1726
|
+
/* @__PURE__ */ e.jsx(
|
|
1727
|
+
f,
|
|
1728
|
+
{
|
|
1729
|
+
dataField: "description",
|
|
1730
|
+
dataType: "text",
|
|
1731
|
+
header: "Descrição",
|
|
1732
|
+
size: 300,
|
|
1733
|
+
inputFilterType: "text"
|
|
1734
|
+
}
|
|
1735
|
+
),
|
|
1736
|
+
/* @__PURE__ */ e.jsx(
|
|
1737
|
+
f,
|
|
1710
1738
|
{
|
|
1711
1739
|
dataField: "token",
|
|
1712
1740
|
dataType: "text",
|
|
@@ -1717,7 +1745,7 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1717
1745
|
}
|
|
1718
1746
|
),
|
|
1719
1747
|
/* @__PURE__ */ e.jsx(
|
|
1720
|
-
|
|
1748
|
+
f,
|
|
1721
1749
|
{
|
|
1722
1750
|
dataField: "tenantId",
|
|
1723
1751
|
dataType: "text",
|
|
@@ -1728,41 +1756,41 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1728
1756
|
}
|
|
1729
1757
|
),
|
|
1730
1758
|
/* @__PURE__ */ e.jsx(
|
|
1731
|
-
|
|
1759
|
+
f,
|
|
1732
1760
|
{
|
|
1733
1761
|
dataField: "expirationDate",
|
|
1734
1762
|
dataType: "text",
|
|
1735
1763
|
size: 240,
|
|
1736
1764
|
header: "Validade",
|
|
1737
|
-
render: (
|
|
1738
|
-
if (!
|
|
1765
|
+
render: (F) => {
|
|
1766
|
+
if (!F.row.expirationDate)
|
|
1739
1767
|
return /* @__PURE__ */ e.jsx(H, { c: "dimmed", children: "Sem expiração" });
|
|
1740
1768
|
const W = /* @__PURE__ */ new Date();
|
|
1741
1769
|
W.setHours(0, 0, 0, 0);
|
|
1742
|
-
const x = new Date(
|
|
1770
|
+
const x = new Date(F.row.expirationDate);
|
|
1743
1771
|
x.setHours(0, 0, 0, 0);
|
|
1744
|
-
const
|
|
1745
|
-
let ne = Math.max(0, Math.min(100,
|
|
1746
|
-
|
|
1747
|
-
const G =
|
|
1772
|
+
const j = x.getTime() - W.getTime(), b = Math.ceil(j / (1e3 * 60 * 60 * 24));
|
|
1773
|
+
let ne = Math.max(0, Math.min(100, b / 365 * 100)), s = "green", n = "";
|
|
1774
|
+
b < 0 ? (s = "red", ne = 100, n = `Vencido há ${Math.abs(b)} dia${Math.abs(b) !== 1 ? "s" : ""}`) : b === 0 ? (s = "red", ne = 5, n = "Vence hoje") : b <= 7 ? (s = "red", n = `${b} dia${b !== 1 ? "s" : ""}`) : b <= 30 ? (s = "orange", n = `${b} dias`) : b <= 90 ? (s = "yellow", n = `${b} dias`) : (s = "green", n = `${b} dias`);
|
|
1775
|
+
const G = b < 0 ? `Vencido em ${x.toLocaleDateString()}` : `Expira em ${x.toLocaleDateString()}`;
|
|
1748
1776
|
return /* @__PURE__ */ e.jsx(se, { label: G, withArrow: !0, children: /* @__PURE__ */ e.jsxs($, { gap: "xs", wrap: "nowrap", children: [
|
|
1749
1777
|
/* @__PURE__ */ e.jsx(
|
|
1750
|
-
|
|
1778
|
+
Zr,
|
|
1751
1779
|
{
|
|
1752
1780
|
size: 36,
|
|
1753
1781
|
thickness: 4,
|
|
1754
1782
|
roundCaps: !0,
|
|
1755
|
-
sections: [{ value:
|
|
1783
|
+
sections: [{ value: b < 0 ? 100 : ne, color: s }]
|
|
1756
1784
|
}
|
|
1757
1785
|
),
|
|
1758
|
-
/* @__PURE__ */ e.jsx(H, { size: "sm", c:
|
|
1786
|
+
/* @__PURE__ */ e.jsx(H, { size: "sm", c: b < 0 ? "red" : void 0, fw: b <= 7 ? 600 : void 0, children: n })
|
|
1759
1787
|
] }) });
|
|
1760
1788
|
},
|
|
1761
1789
|
inputFilterType: "text"
|
|
1762
1790
|
}
|
|
1763
1791
|
),
|
|
1764
1792
|
/* @__PURE__ */ e.jsx(
|
|
1765
|
-
|
|
1793
|
+
f,
|
|
1766
1794
|
{
|
|
1767
1795
|
dataField: "activated",
|
|
1768
1796
|
dataType: "boolean",
|
|
@@ -1771,7 +1799,7 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1771
1799
|
}
|
|
1772
1800
|
),
|
|
1773
1801
|
/* @__PURE__ */ e.jsx(
|
|
1774
|
-
|
|
1802
|
+
f,
|
|
1775
1803
|
{
|
|
1776
1804
|
dataField: "revoked",
|
|
1777
1805
|
dataType: "boolean",
|
|
@@ -1779,23 +1807,23 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1779
1807
|
inputFilterType: "checkbox"
|
|
1780
1808
|
}
|
|
1781
1809
|
)
|
|
1782
|
-
] }),
|
|
1783
|
-
|
|
1810
|
+
] }), D = () => {
|
|
1811
|
+
d.insert(ca.newInstance()), d && !L.isDataSourceV2 && L.v1State.forceUpdate(), p("apiToken");
|
|
1784
1812
|
}, N = () => {
|
|
1785
|
-
|
|
1813
|
+
g.getCurrentRecord() && K.showConfirmDialogYesNo(
|
|
1786
1814
|
`${t().t("archbase:Confirme")}`,
|
|
1787
|
-
`${t().t("archbase:Deseja revogar o token de API do usuário ")}${
|
|
1815
|
+
`${t().t("archbase:Deseja revogar o token de API do usuário ")}${g.getCurrentRecord().user.name} ?`,
|
|
1788
1816
|
async () => {
|
|
1789
|
-
await
|
|
1817
|
+
await h.revoke(g.getCurrentRecord().token).then(async () => {
|
|
1790
1818
|
Q.showSuccess(
|
|
1791
1819
|
`${t().t("mentors:Informação")}`,
|
|
1792
1820
|
`${t().t("mentors:Token de API revogado com sucesso!")}`
|
|
1793
|
-
),
|
|
1794
|
-
}).catch((
|
|
1821
|
+
), g.refreshData(), g && !J.isDataSourceV2 && J.v1State.forceUpdate();
|
|
1822
|
+
}).catch((F) => {
|
|
1795
1823
|
K.showErrorWithDetails(
|
|
1796
1824
|
`${t().t("mentors:Atenção")}`,
|
|
1797
|
-
Ae(
|
|
1798
|
-
|
|
1825
|
+
Ae(F),
|
|
1826
|
+
ze(F)
|
|
1799
1827
|
);
|
|
1800
1828
|
});
|
|
1801
1829
|
},
|
|
@@ -1804,11 +1832,11 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1804
1832
|
);
|
|
1805
1833
|
}, I = () => {
|
|
1806
1834
|
p("");
|
|
1807
|
-
}, q = async (
|
|
1808
|
-
const x =
|
|
1835
|
+
}, q = async (F, W) => {
|
|
1836
|
+
const x = d.getCurrentRecord();
|
|
1809
1837
|
if (x)
|
|
1810
1838
|
try {
|
|
1811
|
-
if (
|
|
1839
|
+
if (d.validate(), !x.user || !x.user.email) {
|
|
1812
1840
|
K.showErrorWithDetails(
|
|
1813
1841
|
`${t().t("archbase:WARNING")}`,
|
|
1814
1842
|
`${t().t("archbase:Selecione um usuário para o token de API")}`,
|
|
@@ -1816,28 +1844,28 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1816
1844
|
);
|
|
1817
1845
|
return;
|
|
1818
1846
|
}
|
|
1819
|
-
await
|
|
1820
|
-
|
|
1847
|
+
await h.create(x.user.email, x.expirationDate, x.name, x.description).then(async (j) => {
|
|
1848
|
+
d.cancel(), d && !L.isDataSourceV2 && L.v1State.forceUpdate(), g.append(j), g && !J.isDataSourceV2 && J.v1State.forceUpdate(), Q.showSuccess(
|
|
1821
1849
|
`${t().t("mentors:Informação")}`,
|
|
1822
1850
|
`${t().t("mentors:Token de API gerado com sucesso!")}`
|
|
1823
1851
|
), W && W(!0);
|
|
1824
|
-
}).catch((
|
|
1852
|
+
}).catch((j) => {
|
|
1825
1853
|
K.showErrorWithDetails(
|
|
1826
1854
|
`${t().t("mentors:Atenção")}`,
|
|
1827
|
-
Ae(
|
|
1828
|
-
|
|
1855
|
+
Ae(j),
|
|
1856
|
+
ze(j)
|
|
1829
1857
|
);
|
|
1830
1858
|
});
|
|
1831
|
-
} catch (
|
|
1859
|
+
} catch (j) {
|
|
1832
1860
|
K.showErrorWithDetails(
|
|
1833
1861
|
`${t().t("mentors:Atenção")}`,
|
|
1834
|
-
Ae(
|
|
1835
|
-
|
|
1862
|
+
Ae(j),
|
|
1863
|
+
ze(j)
|
|
1836
1864
|
);
|
|
1837
1865
|
}
|
|
1838
1866
|
}, 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(
|
|
1840
|
-
/* @__PURE__ */ e.jsx(
|
|
1867
|
+
/* @__PURE__ */ e.jsx(M, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Ie, {}), onClick: D, children: t().t("archbase:New") }),
|
|
1868
|
+
/* @__PURE__ */ e.jsx(M, { disabled: !g.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e.jsx(Ce, {}), onClick: N, children: t().t("archbase:Revoke") })
|
|
1841
1869
|
] }) });
|
|
1842
1870
|
return /* @__PURE__ */ e.jsxs(Y, { p: "md", style: { height: r, display: "flex", flexDirection: "column" }, children: [
|
|
1843
1871
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1860,15 +1888,15 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1860
1888
|
width: "100%",
|
|
1861
1889
|
height: "100%",
|
|
1862
1890
|
withBorder: !1,
|
|
1863
|
-
dataSource:
|
|
1891
|
+
dataSource: g,
|
|
1864
1892
|
withColumnBorders: !0,
|
|
1865
1893
|
striped: !0,
|
|
1866
1894
|
enableTopToolbar: !0,
|
|
1867
1895
|
enableRowActions: !1,
|
|
1868
1896
|
pageSize: 50,
|
|
1869
1897
|
isLoading: re,
|
|
1870
|
-
isError: !!
|
|
1871
|
-
error:
|
|
1898
|
+
isError: !!m,
|
|
1899
|
+
error: m,
|
|
1872
1900
|
enableGlobalFilter: !0,
|
|
1873
1901
|
getRowId: i,
|
|
1874
1902
|
toolbarLeftContent: o(),
|
|
@@ -1878,11 +1906,11 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1878
1906
|
}
|
|
1879
1907
|
),
|
|
1880
1908
|
P === "apiToken" ? /* @__PURE__ */ e.jsx(
|
|
1881
|
-
|
|
1909
|
+
Sa,
|
|
1882
1910
|
{
|
|
1883
1911
|
onClickOk: I,
|
|
1884
1912
|
opened: !0,
|
|
1885
|
-
dataSource:
|
|
1913
|
+
dataSource: d,
|
|
1886
1914
|
onCustomSave: q,
|
|
1887
1915
|
onClickCancel: I
|
|
1888
1916
|
}
|
|
@@ -1890,14 +1918,14 @@ function La({ height: r = "400px", width: h = "100%" }) {
|
|
|
1890
1918
|
] });
|
|
1891
1919
|
}
|
|
1892
1920
|
export {
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1921
|
+
Sa as ApiTokenModal,
|
|
1922
|
+
Va as ArchbaseApiTokenView,
|
|
1923
|
+
ga as ArchbaseDualListSelector,
|
|
1924
|
+
La as ArchbaseSecurityView,
|
|
1925
|
+
va as GroupModal,
|
|
1926
|
+
Me as PermissionsSelectorModal,
|
|
1927
|
+
ba as ProfileModal,
|
|
1928
|
+
ja as RenderProfileUserItem,
|
|
1929
|
+
wa as UserModal
|
|
1902
1930
|
};
|
|
1903
1931
|
//# sourceMappingURL=index.js.map
|