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