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