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