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