@argusoft/medplat-core 1.0.3 → 1.0.4
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/{AddFeatures-BxXCC6ex.js → AddFeatures-CkTu7sOI.js} +2 -2
- package/dist/{AddFeatures-BxXCC6ex.js.map → AddFeatures-CkTu7sOI.js.map} +1 -1
- package/dist/ImmunizationConfigurationBase.css +1 -1
- package/dist/{ManageDynamicFeature-CeeqiS3K.js → ManageDynamicFeature-BKkCnQvF.js} +911 -911
- package/dist/ManageDynamicFeature-BKkCnQvF.js.map +1 -0
- package/dist/{ManageRole-ByqBmjuc.js → ManageRole-CuXmWQyp.js} +167 -138
- package/dist/ManageRole-CuXmWQyp.js.map +1 -0
- package/dist/{RoleManagement-CLaEJ90J.js → RoleManagement-C0feJCuq.js} +2 -2
- package/dist/{RoleManagement-CLaEJ90J.js.map → RoleManagement-C0feJCuq.js.map} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/package.json +3 -3
- package/dist/ManageDynamicFeature-CeeqiS3K.js.map +0 -1
- package/dist/ManageRole-ByqBmjuc.js.map +0 -1
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { jsx as t, jsxs as s, Fragment as
|
|
2
|
-
import { executeAll as Ft, execute as
|
|
1
|
+
import { jsx as t, jsxs as s, Fragment as fe } from "react/jsx-runtime";
|
|
2
|
+
import { executeAll as Ft, execute as G } from "@/common/services/QueryBuilder";
|
|
3
3
|
import { useDebounceFn as fn } from "@/hooks/useDebounceFn.js";
|
|
4
|
-
import
|
|
4
|
+
import Ve from "@/views/custom-components/CustomDropdown";
|
|
5
5
|
import zi from "@/views/custom-components/CustomSvgUpload";
|
|
6
|
-
import
|
|
6
|
+
import ne from "@/views/custom-components/CustomTextField";
|
|
7
7
|
import { yupResolver as vn } from "@hookform/resolvers/yup";
|
|
8
8
|
import { Editor as Li } from "@monaco-editor/react";
|
|
9
9
|
import { generateUUID as hn } from "@/utils/UUIDgenerator";
|
|
10
10
|
import { getRoleList as $i, executeQuery as Qi } from "@/common/services/GlobalApis";
|
|
11
|
-
import { Dialog as Fn, DialogTitle as Tn, DialogContent as _n, DialogContentText as Ji, Grid2 as
|
|
12
|
-
import
|
|
13
|
-
import { t as
|
|
14
|
-
import nr, { useState as x, useRef as ir, useMemo as Nn, useEffect as
|
|
15
|
-
import { useForm as ft, Controller as
|
|
11
|
+
import { Dialog as Fn, DialogTitle as Tn, DialogContent as _n, DialogContentText as Ji, Grid2 as xe, Divider as Ye, Chip as ot, FormControl as te, TextField as Vn, IconButton as qe, Box as c, Alert as ji, DialogActions as En, Button as U, useTheme as Dn, debounce as Gi, Step as Hi, Typography as f, Accordion as kt, AccordionSummary as It, AccordionDetails as wt, Tooltip as Yi, RadioGroup as pn, FormControlLabel as lt, Radio as dt, Checkbox as gn, FormGroup as Ki, TableContainer as yn, Table as bn, TableHead as xn, TableRow as ct, TableCell as ee, TableBody as Sn, Stack as Pn, Select as Zi, MenuItem as Cn, Modal as Xi, Card as er, alpha as tr } from "@mui/material";
|
|
12
|
+
import H from "@mui/material/Grid2";
|
|
13
|
+
import { t as ut } from "./i18next-CTOWN_jH.js";
|
|
14
|
+
import nr, { useState as x, useRef as ir, useMemo as Nn, useEffect as ae, useCallback as rr } from "react";
|
|
15
|
+
import { useForm as ft, Controller as $, useWatch as mt } from "react-hook-form";
|
|
16
16
|
import { useSelector as ar } from "react-redux";
|
|
17
17
|
import { useLocation as sr, useNavigate as or } from "react-router";
|
|
18
|
-
import * as
|
|
19
|
-
import { showToast as
|
|
18
|
+
import * as O from "yup";
|
|
19
|
+
import { showToast as me } from "@/common/toaster/toaster";
|
|
20
20
|
import { FormConfiguratorService as kn } from "@/common/services/FormConfiguratorService";
|
|
21
21
|
import I from "prop-types";
|
|
22
22
|
import { useDebounceFn as lr } from "@/hooks/useDebounceFn";
|
|
23
|
-
import
|
|
24
|
-
import
|
|
23
|
+
import le from "@/common/fontAwesomeIcons/FontAwesomeIcons";
|
|
24
|
+
import Ee from "@/views/custom-components/CustomAutoComplete.jsx";
|
|
25
25
|
import { a as In } from "./Features-CKMmuqcs.js";
|
|
26
|
-
import
|
|
26
|
+
import Ie from "@/views/custom-components/CustomSwitch";
|
|
27
27
|
import dr from "@/views/custom-components/CustomTextArea";
|
|
28
28
|
import vt from "@/views/custom-components/CustomCheckBox";
|
|
29
29
|
import wn from "@/views/custom-components/CustomDatePicker";
|
|
30
|
-
import
|
|
30
|
+
import ge from "@/views/custom-components/FieldDescription";
|
|
31
31
|
import { useTranslateProvider as cr } from "@/common/languageTranslator/TranslationContext";
|
|
32
32
|
import { getFeatureData as ur, updateUserMenuItems as mr } from "@/common/services/Features";
|
|
33
33
|
import fr from "@/views/custom-components/CustomRadioComponent";
|
|
34
34
|
function An({
|
|
35
|
-
mainFormCtrl:
|
|
36
|
-
openAddFormModal:
|
|
37
|
-
setModal:
|
|
38
|
-
reloadForms:
|
|
35
|
+
mainFormCtrl: m,
|
|
36
|
+
openAddFormModal: M,
|
|
37
|
+
setModal: A,
|
|
38
|
+
reloadForms: E
|
|
39
39
|
}) {
|
|
40
|
-
const [l, b] = x(""), [C,
|
|
41
|
-
formName:
|
|
42
|
-
formCode:
|
|
40
|
+
const [l, b] = x(""), [C, Y] = x([]), [ie, R] = x(!0), W = O.object().shape({
|
|
41
|
+
formName: O.string().required("Enter form name"),
|
|
42
|
+
formCode: O.string().required("Enter form code").matches(
|
|
43
43
|
/^[A-Z_]*$/,
|
|
44
44
|
"Only uppercase letters and underscores are allowed"
|
|
45
45
|
),
|
|
46
|
-
state:
|
|
47
|
-
formType:
|
|
48
|
-
description:
|
|
46
|
+
state: O.string().required("Select state"),
|
|
47
|
+
formType: O.string().required("Select form type"),
|
|
48
|
+
description: O.string().required("Enter description")
|
|
49
49
|
}), v = ft({
|
|
50
50
|
defaultValues: {
|
|
51
51
|
formName: "",
|
|
@@ -57,44 +57,44 @@ function An({
|
|
|
57
57
|
formType: null,
|
|
58
58
|
navigationState: "medplat.form"
|
|
59
59
|
},
|
|
60
|
-
resolver: vn(
|
|
60
|
+
resolver: vn(W),
|
|
61
61
|
mode: "onChange"
|
|
62
|
-
}),
|
|
62
|
+
}), de = () => {
|
|
63
63
|
if (l.trim() && !C.includes(l)) {
|
|
64
64
|
const N = [...C, l];
|
|
65
|
-
|
|
65
|
+
Y(N), b(""), v.setValue("pageParams", N.join(","));
|
|
66
66
|
}
|
|
67
|
-
},
|
|
68
|
-
const S = C.filter((
|
|
69
|
-
|
|
70
|
-
},
|
|
67
|
+
}, Z = (N) => {
|
|
68
|
+
const S = C.filter((D) => D !== N);
|
|
69
|
+
Y(S), v.setValue("pageParams", S.join(","));
|
|
70
|
+
}, z = (N) => {
|
|
71
71
|
const S = N.target.value;
|
|
72
72
|
/^[a-zA-Z_]*$/.test(S) && b(S);
|
|
73
|
-
},
|
|
74
|
-
|
|
73
|
+
}, he = () => {
|
|
74
|
+
A(!1);
|
|
75
|
+
}, Q = (N) => {
|
|
76
|
+
J(N);
|
|
75
77
|
}, J = (N) => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (!re) {
|
|
79
|
-
fe({ message: "Form Code is already taken!", type: "error" });
|
|
78
|
+
if (!ie) {
|
|
79
|
+
me({ message: "Form Code is already taken!", type: "error" });
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
const S = () => {
|
|
83
|
-
const
|
|
84
|
-
return
|
|
83
|
+
const D = new FormData();
|
|
84
|
+
return D.append(
|
|
85
85
|
"form",
|
|
86
86
|
new Blob([JSON.stringify(N)], {
|
|
87
87
|
type: "application/json"
|
|
88
88
|
})
|
|
89
|
-
), console.log(
|
|
89
|
+
), console.log(D), D;
|
|
90
90
|
};
|
|
91
91
|
N.isSeparateFeature = !0, kn.saveForm(S()).then(() => {
|
|
92
|
-
|
|
92
|
+
me({
|
|
93
93
|
message: "Configuration created sucessfully!",
|
|
94
94
|
type: "success"
|
|
95
95
|
});
|
|
96
|
-
let
|
|
97
|
-
N.formName && N.formName.length > 0 &&
|
|
96
|
+
let D = [];
|
|
97
|
+
N.formName && N.formName.length > 0 && D.push({
|
|
98
98
|
code: "medplat_form_insert_into_translation_master",
|
|
99
99
|
parameters: {
|
|
100
100
|
translation_key: N.formName.replaceAll(" ", ""),
|
|
@@ -102,7 +102,7 @@ function An({
|
|
|
102
102
|
form_code: N.formCode
|
|
103
103
|
},
|
|
104
104
|
sequence: 1
|
|
105
|
-
}),
|
|
105
|
+
}), D.length > 0 && Ft(D), m.setValue("formCode", N.formCode), m.setValue("version", "DRAFT"), m.setValue("navigationState", N.navigationState), he(), v.reset({
|
|
106
106
|
formName: "",
|
|
107
107
|
formCode: "",
|
|
108
108
|
state: "ACTIVE",
|
|
@@ -111,20 +111,20 @@ function An({
|
|
|
111
111
|
pageParams: "",
|
|
112
112
|
formType: null,
|
|
113
113
|
navigationState: "medplat.form"
|
|
114
|
-
}),
|
|
114
|
+
}), E();
|
|
115
115
|
});
|
|
116
|
-
},
|
|
116
|
+
}, pe = lr(async (N) => {
|
|
117
117
|
if (!(N != null && N.trim())) return;
|
|
118
118
|
const S = (await kn.checkFormCodeAvailability(N)).data;
|
|
119
|
-
return
|
|
119
|
+
return R(S), S;
|
|
120
120
|
}, 500);
|
|
121
121
|
return /* @__PURE__ */ t(
|
|
122
122
|
Fn,
|
|
123
123
|
{
|
|
124
|
-
open:
|
|
124
|
+
open: M,
|
|
125
125
|
fullWidth: !0,
|
|
126
126
|
maxWidth: "lg",
|
|
127
|
-
onClose:
|
|
127
|
+
onClose: he,
|
|
128
128
|
slotProps: {
|
|
129
129
|
paper: {
|
|
130
130
|
style: {
|
|
@@ -137,16 +137,16 @@ function An({
|
|
|
137
137
|
{
|
|
138
138
|
noValidate: !0,
|
|
139
139
|
onSubmit: (N) => {
|
|
140
|
-
N.preventDefault(), N.stopPropagation(), v.handleSubmit(
|
|
140
|
+
N.preventDefault(), N.stopPropagation(), v.handleSubmit(Q)();
|
|
141
141
|
},
|
|
142
142
|
children: [
|
|
143
143
|
/* @__PURE__ */ t(Tn, { children: "Add new form" }),
|
|
144
144
|
/* @__PURE__ */ s(_n, { children: [
|
|
145
145
|
/* @__PURE__ */ t(Ji, { id: "alert-dialog-slide-description", children: "Please enter all details" }),
|
|
146
|
-
/* @__PURE__ */ s(
|
|
147
|
-
/* @__PURE__ */ t(
|
|
148
|
-
/* @__PURE__ */ t(
|
|
149
|
-
|
|
146
|
+
/* @__PURE__ */ s(xe, { container: !0, spacing: 2, columns: 12, sx: { mt: 1 }, children: [
|
|
147
|
+
/* @__PURE__ */ t(xe, { size: 12, children: /* @__PURE__ */ t(Ye, { children: /* @__PURE__ */ t(ot, { label: "Basic Details", size: "small" }) }) }),
|
|
148
|
+
/* @__PURE__ */ t(xe, { size: 4, children: /* @__PURE__ */ t(
|
|
149
|
+
ne,
|
|
150
150
|
{
|
|
151
151
|
control: v.control,
|
|
152
152
|
name: "formName",
|
|
@@ -158,8 +158,8 @@ function An({
|
|
|
158
158
|
required: !0
|
|
159
159
|
}
|
|
160
160
|
) }),
|
|
161
|
-
/* @__PURE__ */ t(
|
|
162
|
-
|
|
161
|
+
/* @__PURE__ */ t(xe, { size: 4, children: /* @__PURE__ */ t(
|
|
162
|
+
ne,
|
|
163
163
|
{
|
|
164
164
|
control: v.control,
|
|
165
165
|
name: "formCode",
|
|
@@ -169,7 +169,7 @@ function An({
|
|
|
169
169
|
label: "Code",
|
|
170
170
|
errors: {
|
|
171
171
|
...v.formState.errors,
|
|
172
|
-
...
|
|
172
|
+
...ie === !1 && {
|
|
173
173
|
formCode: { message: "Form Code is already taken!" }
|
|
174
174
|
}
|
|
175
175
|
},
|
|
@@ -179,12 +179,12 @@ function An({
|
|
|
179
179
|
v.setValue("formCode", S), v.setValue(
|
|
180
180
|
"navigationState",
|
|
181
181
|
`medplat.form.${S}`
|
|
182
|
-
),
|
|
182
|
+
), pe(S);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
) }),
|
|
186
|
-
/* @__PURE__ */ t(
|
|
187
|
-
|
|
186
|
+
/* @__PURE__ */ t(xe, { size: 2, children: /* @__PURE__ */ t(te, { required: !0, fullWidth: !0, size: "small", children: /* @__PURE__ */ t(
|
|
187
|
+
Ve,
|
|
188
188
|
{
|
|
189
189
|
control: v.control,
|
|
190
190
|
name: "state",
|
|
@@ -197,8 +197,8 @@ function An({
|
|
|
197
197
|
required: !0
|
|
198
198
|
}
|
|
199
199
|
) }) }),
|
|
200
|
-
/* @__PURE__ */ t(
|
|
201
|
-
|
|
200
|
+
/* @__PURE__ */ t(xe, { size: 2, children: /* @__PURE__ */ t(te, { required: !0, fullWidth: !0, size: "small", children: /* @__PURE__ */ t(
|
|
201
|
+
Ve,
|
|
202
202
|
{
|
|
203
203
|
control: v.control,
|
|
204
204
|
name: "formType",
|
|
@@ -211,8 +211,8 @@ function An({
|
|
|
211
211
|
required: !0
|
|
212
212
|
}
|
|
213
213
|
) }) }),
|
|
214
|
-
/* @__PURE__ */ t(
|
|
215
|
-
|
|
214
|
+
/* @__PURE__ */ t(xe, { size: 12, children: /* @__PURE__ */ t(
|
|
215
|
+
ne,
|
|
216
216
|
{
|
|
217
217
|
control: v.control,
|
|
218
218
|
name: "description",
|
|
@@ -226,10 +226,10 @@ function An({
|
|
|
226
226
|
required: !0
|
|
227
227
|
}
|
|
228
228
|
) }),
|
|
229
|
-
/* @__PURE__ */ t(
|
|
230
|
-
/* @__PURE__ */ s(
|
|
229
|
+
/* @__PURE__ */ t(xe, { size: 12, children: /* @__PURE__ */ t(Ye, { children: /* @__PURE__ */ t(ot, { label: "Page Param Details", size: "small" }) }) }),
|
|
230
|
+
/* @__PURE__ */ s(xe, { size: 12, children: [
|
|
231
231
|
/* @__PURE__ */ t(
|
|
232
|
-
|
|
232
|
+
$,
|
|
233
233
|
{
|
|
234
234
|
name: "pageParams",
|
|
235
235
|
control: v.control,
|
|
@@ -241,15 +241,15 @@ function An({
|
|
|
241
241
|
size: "small",
|
|
242
242
|
placeholder: "Add Page Params",
|
|
243
243
|
value: l,
|
|
244
|
-
onChange:
|
|
244
|
+
onChange: z,
|
|
245
245
|
onKeyDown: (S) => {
|
|
246
|
-
S.key === "Enter" && (S.preventDefault(),
|
|
246
|
+
S.key === "Enter" && (S.preventDefault(), de());
|
|
247
247
|
},
|
|
248
248
|
fullWidth: !0,
|
|
249
249
|
slotProps: {
|
|
250
250
|
input: {
|
|
251
|
-
endAdornment: /* @__PURE__ */ t(
|
|
252
|
-
|
|
251
|
+
endAdornment: /* @__PURE__ */ t(qe, { color: "primary", onClick: de, children: /* @__PURE__ */ t(
|
|
252
|
+
le,
|
|
253
253
|
{
|
|
254
254
|
iconName: "faArrowRightToBracket",
|
|
255
255
|
size: "xs"
|
|
@@ -262,20 +262,20 @@ function An({
|
|
|
262
262
|
}
|
|
263
263
|
),
|
|
264
264
|
/* @__PURE__ */ t(c, { sx: { display: "flex", flexWrap: "wrap", gap: 1, mt: 2 }, children: C.map((N, S) => /* @__PURE__ */ t(
|
|
265
|
-
|
|
265
|
+
ot,
|
|
266
266
|
{
|
|
267
267
|
label: N,
|
|
268
|
-
onDelete: () =>
|
|
268
|
+
onDelete: () => Z(N),
|
|
269
269
|
color: "primary"
|
|
270
270
|
},
|
|
271
271
|
S + 1
|
|
272
272
|
)) }),
|
|
273
273
|
C.length === 0 && /* @__PURE__ */ t(ji, { severity: "info", variant: "outlined", children: "No page params added" })
|
|
274
274
|
] }),
|
|
275
|
-
["FORM", "SEARCH"].includes(v.getValues("formType")) && /* @__PURE__ */ s(
|
|
276
|
-
/* @__PURE__ */ t(
|
|
275
|
+
["FORM", "SEARCH"].includes(v.getValues("formType")) && /* @__PURE__ */ s(fe, { children: [
|
|
276
|
+
/* @__PURE__ */ t(xe, { size: 12, children: /* @__PURE__ */ t(Ye, { children: /* @__PURE__ */ t(ot, { label: "Route Details", size: "small" }) }) }),
|
|
277
277
|
/* @__PURE__ */ t(
|
|
278
|
-
|
|
278
|
+
ne,
|
|
279
279
|
{
|
|
280
280
|
control: v.control,
|
|
281
281
|
name: "navigationState",
|
|
@@ -291,8 +291,8 @@ function An({
|
|
|
291
291
|
] })
|
|
292
292
|
] }),
|
|
293
293
|
/* @__PURE__ */ s(En, { children: [
|
|
294
|
-
/* @__PURE__ */ t(
|
|
295
|
-
/* @__PURE__ */ t(
|
|
294
|
+
/* @__PURE__ */ t(U, { type: "submit", color: "success", children: "Create" }),
|
|
295
|
+
/* @__PURE__ */ t(U, { onClick: he, children: "Close" })
|
|
296
296
|
] })
|
|
297
297
|
]
|
|
298
298
|
}
|
|
@@ -307,19 +307,19 @@ An.propTypes = {
|
|
|
307
307
|
reloadForms: I.any
|
|
308
308
|
};
|
|
309
309
|
const Tt = ({
|
|
310
|
-
permission:
|
|
311
|
-
index:
|
|
312
|
-
depth:
|
|
313
|
-
onEdit:
|
|
310
|
+
permission: m,
|
|
311
|
+
index: M,
|
|
312
|
+
depth: A = 0,
|
|
313
|
+
onEdit: E,
|
|
314
314
|
onRemove: l,
|
|
315
315
|
handleAddChildClick: b,
|
|
316
316
|
isLastChild: C = !1,
|
|
317
|
-
isDynamicFeature:
|
|
317
|
+
isDynamicFeature: Y
|
|
318
318
|
}) => {
|
|
319
|
-
var
|
|
320
|
-
const
|
|
321
|
-
return /* @__PURE__ */ s(c, { sx: { position: "relative", pl:
|
|
322
|
-
|
|
319
|
+
var W;
|
|
320
|
+
const ie = Dn(), R = (v) => v.replaceAll(".child.", ".");
|
|
321
|
+
return /* @__PURE__ */ s(c, { sx: { position: "relative", pl: A * 3 }, children: [
|
|
322
|
+
A > 0 && /* @__PURE__ */ s(fe, { children: [
|
|
323
323
|
/* @__PURE__ */ t(
|
|
324
324
|
c,
|
|
325
325
|
{
|
|
@@ -329,7 +329,7 @@ const Tt = ({
|
|
|
329
329
|
top: 0,
|
|
330
330
|
bottom: C ? "50%" : 0,
|
|
331
331
|
width: 2,
|
|
332
|
-
bgcolor:
|
|
332
|
+
bgcolor: ie.palette.divider
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
),
|
|
@@ -342,7 +342,7 @@ const Tt = ({
|
|
|
342
342
|
top: 22,
|
|
343
343
|
width: 24,
|
|
344
344
|
height: 2,
|
|
345
|
-
bgcolor:
|
|
345
|
+
bgcolor: ie.palette.divider
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
)
|
|
@@ -354,90 +354,90 @@ const Tt = ({
|
|
|
354
354
|
display: "flex",
|
|
355
355
|
alignItems: "center",
|
|
356
356
|
gap: 1.5,
|
|
357
|
-
border: `1px solid ${
|
|
357
|
+
border: `1px solid ${ie.palette.divider}`,
|
|
358
358
|
borderRadius: 2,
|
|
359
359
|
padding: "8px 12px",
|
|
360
|
-
backgroundColor:
|
|
361
|
-
ml:
|
|
360
|
+
backgroundColor: A === 0 ? ie.palette.background.paper : tr(ie.palette.background.paper, 0.8),
|
|
361
|
+
ml: A > 0 ? 3 : 0,
|
|
362
362
|
position: "relative"
|
|
363
363
|
},
|
|
364
364
|
children: [
|
|
365
|
-
|
|
366
|
-
|
|
365
|
+
A === 0 && /* @__PURE__ */ s(f, { sx: { width: 24, color: "text.secondary" }, children: [
|
|
366
|
+
M + 1,
|
|
367
367
|
"."
|
|
368
368
|
] }),
|
|
369
|
-
/* @__PURE__ */ t(
|
|
370
|
-
|
|
371
|
-
|
|
369
|
+
/* @__PURE__ */ t(f, { sx: { flexGrow: 1, fontWeight: 500 }, children: R(m.permissionId) }),
|
|
370
|
+
A === 0 && /* @__PURE__ */ t(
|
|
371
|
+
U,
|
|
372
372
|
{
|
|
373
373
|
variant: "outlined",
|
|
374
374
|
size: "small",
|
|
375
|
-
startIcon: /* @__PURE__ */ t(
|
|
376
|
-
onClick: () => b(
|
|
375
|
+
startIcon: /* @__PURE__ */ t(le, { iconName: "faPlus" }),
|
|
376
|
+
onClick: () => b(m),
|
|
377
377
|
children: "Add Child"
|
|
378
378
|
}
|
|
379
379
|
),
|
|
380
|
-
(!
|
|
381
|
-
|
|
380
|
+
(!m.isDefault || m.isDefault && !Y) && /* @__PURE__ */ t(
|
|
381
|
+
qe,
|
|
382
382
|
{
|
|
383
383
|
color: "secondary",
|
|
384
|
-
onClick: () =>
|
|
385
|
-
children: /* @__PURE__ */ t(
|
|
384
|
+
onClick: () => E(m, M),
|
|
385
|
+
children: /* @__PURE__ */ t(le, { iconName: "faEdit", size: "sm" })
|
|
386
386
|
}
|
|
387
387
|
),
|
|
388
|
-
!
|
|
388
|
+
!m.isDefault && /* @__PURE__ */ t(qe, { color: "error", onClick: () => l(m), children: /* @__PURE__ */ t(le, { iconName: "faTrash", size: "sm" }) })
|
|
389
389
|
]
|
|
390
390
|
}
|
|
391
391
|
),
|
|
392
|
-
((
|
|
392
|
+
((W = m.childPermissions) == null ? void 0 : W.length) > 0 && /* @__PURE__ */ t(Pn, { spacing: 1, sx: { mt: 1 }, children: m.childPermissions.map((v, de) => /* @__PURE__ */ t(
|
|
393
393
|
Tt,
|
|
394
394
|
{
|
|
395
395
|
permission: v,
|
|
396
|
-
index:
|
|
397
|
-
depth:
|
|
398
|
-
onEdit:
|
|
396
|
+
index: de,
|
|
397
|
+
depth: A + 1,
|
|
398
|
+
onEdit: E,
|
|
399
399
|
onRemove: l,
|
|
400
400
|
handleAddChildClick: b,
|
|
401
|
-
isLastChild:
|
|
402
|
-
isDynamicFeature:
|
|
401
|
+
isLastChild: de === m.childPermissions.length - 1,
|
|
402
|
+
isDynamicFeature: Y
|
|
403
403
|
},
|
|
404
|
-
|
|
404
|
+
de
|
|
405
405
|
)) })
|
|
406
406
|
] });
|
|
407
407
|
}, Wn = ({
|
|
408
|
-
permissions:
|
|
409
|
-
onEdit:
|
|
410
|
-
onRemove:
|
|
411
|
-
handleAddChildClick:
|
|
408
|
+
permissions: m,
|
|
409
|
+
onEdit: M,
|
|
410
|
+
onRemove: A,
|
|
411
|
+
handleAddChildClick: E,
|
|
412
412
|
isDynamicFeature: l
|
|
413
|
-
}) => /* @__PURE__ */ t(Pn, { spacing: 1, children:
|
|
413
|
+
}) => /* @__PURE__ */ t(Pn, { spacing: 1, children: m.map((b, C) => /* @__PURE__ */ t(
|
|
414
414
|
Tt,
|
|
415
415
|
{
|
|
416
416
|
permission: b,
|
|
417
417
|
index: C,
|
|
418
418
|
depth: 0,
|
|
419
|
-
onEdit:
|
|
420
|
-
onRemove:
|
|
421
|
-
handleAddChildClick:
|
|
422
|
-
isLastChild: C ===
|
|
419
|
+
onEdit: M,
|
|
420
|
+
onRemove: A,
|
|
421
|
+
handleAddChildClick: E,
|
|
422
|
+
isLastChild: C === m.length - 1,
|
|
423
423
|
isDynamicFeature: l
|
|
424
424
|
},
|
|
425
425
|
C
|
|
426
426
|
)) }), qn = ({
|
|
427
|
-
open:
|
|
428
|
-
onClose:
|
|
429
|
-
onSave:
|
|
430
|
-
formCtrl:
|
|
427
|
+
open: m,
|
|
428
|
+
onClose: M,
|
|
429
|
+
onSave: A,
|
|
430
|
+
formCtrl: E,
|
|
431
431
|
editData: l,
|
|
432
432
|
parentPermissionId: b = null,
|
|
433
433
|
mode: C = "add-parent",
|
|
434
|
-
permissionTypes:
|
|
435
|
-
setPermissionTypes:
|
|
436
|
-
existingPermissionIds:
|
|
437
|
-
isDynamicFeature:
|
|
434
|
+
permissionTypes: Y,
|
|
435
|
+
setPermissionTypes: ie,
|
|
436
|
+
existingPermissionIds: R,
|
|
437
|
+
isDynamicFeature: W = !0
|
|
438
438
|
}) => {
|
|
439
|
-
var
|
|
440
|
-
const [v,
|
|
439
|
+
var Be, Oe, be;
|
|
440
|
+
const [v, de] = x(""), [Z, z] = x([]), [he, Q] = x(""), J = {
|
|
441
441
|
permissionType: "",
|
|
442
442
|
permissionId: "--",
|
|
443
443
|
permissionName: "",
|
|
@@ -445,53 +445,53 @@ const Tt = ({
|
|
|
445
445
|
enabled: !0,
|
|
446
446
|
permissionSuffix: "",
|
|
447
447
|
parentPermissionSuffix: ""
|
|
448
|
-
},
|
|
448
|
+
}, pe = {
|
|
449
449
|
backendUrl: "",
|
|
450
450
|
urlType: "",
|
|
451
|
-
queryCodeRequired: l ? (
|
|
451
|
+
queryCodeRequired: l ? (Be = l == null ? void 0 : l.backendUrl) != null && Be.trim() && ((Oe = l == null ? void 0 : l.urlType) != null && Oe.trim()) ? !1 : (be = l == null ? void 0 : l.queryCode) != null && be.trim() ? !0 : void 0 : void 0,
|
|
452
452
|
queryCode: ""
|
|
453
|
-
}, N =
|
|
453
|
+
}, N = W ? J : { ...J, ...pe }, {
|
|
454
454
|
control: S,
|
|
455
|
-
watch:
|
|
456
|
-
handleSubmit:
|
|
457
|
-
reset:
|
|
458
|
-
setValue:
|
|
459
|
-
getValues:
|
|
460
|
-
setError:
|
|
461
|
-
clearErrors:
|
|
462
|
-
formState:
|
|
455
|
+
watch: D,
|
|
456
|
+
handleSubmit: Ke,
|
|
457
|
+
reset: Se,
|
|
458
|
+
setValue: B,
|
|
459
|
+
getValues: De,
|
|
460
|
+
setError: ye,
|
|
461
|
+
clearErrors: we,
|
|
462
|
+
formState: Pe
|
|
463
463
|
} = ft({
|
|
464
464
|
mode: "onChange",
|
|
465
465
|
defaultValues: N
|
|
466
|
-
}),
|
|
466
|
+
}), j = D("queryCodeRequired"), V = D("permissionType"), Re = D("permissionSuffix"), Ze = D("backendUrl"), ve = D("queryCode"), ht = [
|
|
467
467
|
{ label: "Query", value: !0 },
|
|
468
468
|
{ label: "API", value: !1 }
|
|
469
|
-
],
|
|
470
|
-
(
|
|
471
|
-
).join(""),
|
|
472
|
-
const
|
|
469
|
+
], L = (p = {}) => ({ ...W ? J : { ...J, ...pe }, ...p }), Ce = D("parentPermissionSuffix"), Ae = (p) => p.trim().toLowerCase().split(/\s+/).map(
|
|
470
|
+
(g, w) => w === 0 ? g : g.charAt(0).toUpperCase() + g.slice(1)
|
|
471
|
+
).join(""), Xe = async (p) => {
|
|
472
|
+
const g = (await G({
|
|
473
473
|
code: "GET_ALL_QUERY_CODE",
|
|
474
|
-
parameters: { search:
|
|
474
|
+
parameters: { search: p }
|
|
475
475
|
})).data;
|
|
476
|
-
|
|
476
|
+
z((g == null ? void 0 : g.result) || []);
|
|
477
477
|
};
|
|
478
|
-
|
|
479
|
-
!
|
|
480
|
-
const
|
|
478
|
+
ae(() => {
|
|
479
|
+
!W && (async () => {
|
|
480
|
+
const g = (await G({
|
|
481
481
|
code: "GET_ALL_QUERY_CODE",
|
|
482
482
|
parameters: {
|
|
483
|
-
search:
|
|
483
|
+
search: De("queryCode") ? De("queryCode") : ""
|
|
484
484
|
}
|
|
485
485
|
})).data;
|
|
486
|
-
|
|
486
|
+
z((g == null ? void 0 : g.result) || []), Q(De("queryCode"));
|
|
487
487
|
})();
|
|
488
|
-
}, [
|
|
489
|
-
|
|
490
|
-
}, [
|
|
491
|
-
var
|
|
492
|
-
if (
|
|
488
|
+
}, [ve]), ae(() => {
|
|
489
|
+
j === !0 && !Ze ? (B("backendUrl", ""), B("urlType", "")) : j === !1 && !ve && B("queryCode", "");
|
|
490
|
+
}, [j]), ae(() => {
|
|
491
|
+
var p, g, w;
|
|
492
|
+
if (m) {
|
|
493
493
|
if (C === "edit" && l) {
|
|
494
|
-
const
|
|
494
|
+
const T = {
|
|
495
495
|
permissionType: l.permissionType || "",
|
|
496
496
|
permissionId: l.permissionId || "--",
|
|
497
497
|
permissionName: l.permissionName || "",
|
|
@@ -499,25 +499,25 @@ const Tt = ({
|
|
|
499
499
|
enabled: !!l.enabled,
|
|
500
500
|
permissionSuffix: ""
|
|
501
501
|
};
|
|
502
|
-
if (
|
|
503
|
-
|
|
502
|
+
if (W)
|
|
503
|
+
Se(T);
|
|
504
504
|
else {
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
...
|
|
505
|
+
const re = ((p = l == null ? void 0 : l.backendUrl) == null ? void 0 : p.trim()) && ((g = l == null ? void 0 : l.urlType) == null ? void 0 : g.trim()), _ = (w = l == null ? void 0 : l.queryCode) == null ? void 0 : w.trim();
|
|
506
|
+
Se({
|
|
507
|
+
...T,
|
|
508
508
|
urlType: l.urlType || "",
|
|
509
509
|
backendUrl: l.backendUrl || "",
|
|
510
510
|
queryCode: l.queryCode || "",
|
|
511
|
-
queryCodeRequired: l ?
|
|
511
|
+
queryCodeRequired: l ? re ? !1 : _ ? !0 : void 0 : void 0
|
|
512
512
|
});
|
|
513
513
|
}
|
|
514
514
|
return;
|
|
515
515
|
}
|
|
516
516
|
if (C === "add-child" && b) {
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
permissionType:
|
|
517
|
+
const T = b.split(".")[0] || "";
|
|
518
|
+
Se(
|
|
519
|
+
L({
|
|
520
|
+
permissionType: T,
|
|
521
521
|
permissionId: b,
|
|
522
522
|
permissionName: "",
|
|
523
523
|
permissionDesc: "",
|
|
@@ -531,52 +531,52 @@ const Tt = ({
|
|
|
531
531
|
);
|
|
532
532
|
return;
|
|
533
533
|
}
|
|
534
|
-
|
|
534
|
+
Se(L());
|
|
535
535
|
}
|
|
536
|
-
}, [
|
|
536
|
+
}, [m, C, l, b, Se]), ae(() => {
|
|
537
537
|
if (C === "add-parent") {
|
|
538
|
-
const
|
|
539
|
-
if (!
|
|
540
|
-
|
|
538
|
+
const p = (V == null ? void 0 : V.type) === "menu" ? "view" : V == null ? void 0 : V.type;
|
|
539
|
+
if (!p) {
|
|
540
|
+
B("permissionId", "--");
|
|
541
541
|
return;
|
|
542
542
|
}
|
|
543
|
-
const
|
|
544
|
-
let
|
|
545
|
-
if (
|
|
546
|
-
|
|
543
|
+
const g = E.getValues("menuType") || "menuType", w = E.getValues("featureConstant") || "feature";
|
|
544
|
+
let T;
|
|
545
|
+
if (W)
|
|
546
|
+
T = `${p}.${g}.${w}`;
|
|
547
547
|
else {
|
|
548
|
-
const
|
|
549
|
-
|
|
548
|
+
const re = E.getValues("menuName");
|
|
549
|
+
T = `${p}.${g}.${Ae(re)}`;
|
|
550
550
|
}
|
|
551
|
-
|
|
551
|
+
Ce != null && Ce.trim() && (T = `${T}.${Ce.trim()}`), B("permissionId", T);
|
|
552
552
|
}
|
|
553
|
-
}, [
|
|
554
|
-
|
|
555
|
-
}, [
|
|
553
|
+
}, [V, Ce, C]), ae(() => {
|
|
554
|
+
j === !0 && !Ze ? (B("backendUrl", ""), B("urlType", "")) : j === !1 && !ve && B("queryCode", "");
|
|
555
|
+
}, [j]), ae(() => {
|
|
556
556
|
if (C === "add-child" && b !== null) {
|
|
557
|
-
const
|
|
558
|
-
|
|
557
|
+
const p = b.split(".")[0] || "", g = `${b}.child`, w = Re ? `${g}.${Re}` : g;
|
|
558
|
+
B("permissionId", w), B("permissionType", p);
|
|
559
559
|
}
|
|
560
|
-
}, [
|
|
561
|
-
const
|
|
562
|
-
const
|
|
563
|
-
permissionId:
|
|
564
|
-
permissionType:
|
|
565
|
-
permissionName:
|
|
566
|
-
permissionDesc:
|
|
567
|
-
enabled:
|
|
568
|
-
backendUrl:
|
|
569
|
-
urlType:
|
|
570
|
-
queryCode:
|
|
560
|
+
}, [Re, C, b, B]);
|
|
561
|
+
const et = (p) => {
|
|
562
|
+
const g = {
|
|
563
|
+
permissionId: p.permissionId,
|
|
564
|
+
permissionType: p.permissionType || (b ? b.split(".")[0] : ""),
|
|
565
|
+
permissionName: p.permissionName,
|
|
566
|
+
permissionDesc: p.permissionDesc,
|
|
567
|
+
enabled: p.enabled,
|
|
568
|
+
backendUrl: p != null && p.backendUrl && !j ? p.backendUrl : null,
|
|
569
|
+
urlType: p != null && p.urlType && !j ? p.urlType : null,
|
|
570
|
+
queryCode: p != null && p.queryCode && j ? p.queryCode : null,
|
|
571
571
|
childPermissions: [],
|
|
572
572
|
isDefault: l != null && l.isDefault ? l == null ? void 0 : l.isDefault : !1
|
|
573
573
|
};
|
|
574
|
-
|
|
575
|
-
},
|
|
574
|
+
A(g), Se(), M();
|
|
575
|
+
}, Me = async (p) => !p || p === "--" ? void 0 : (await G({
|
|
576
576
|
code: "CHECK_UNIQUE_PERMISSION_ID",
|
|
577
|
-
parameters: { permissionId:
|
|
577
|
+
parameters: { permissionId: p }
|
|
578
578
|
})).data.result[0].exists;
|
|
579
|
-
return /* @__PURE__ */ s(Fn, { open:
|
|
579
|
+
return /* @__PURE__ */ s(Fn, { open: m, onClose: M, fullWidth: !0, maxWidth: "sm", children: [
|
|
580
580
|
/* @__PURE__ */ t(Tn, { children: C === "edit" ? "Edit Permission" : "Add Permission" }),
|
|
581
581
|
/* @__PURE__ */ s(
|
|
582
582
|
_n,
|
|
@@ -585,7 +585,7 @@ const Tt = ({
|
|
|
585
585
|
children: [
|
|
586
586
|
C !== "add-child" && C !== "edit" && /* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
587
587
|
/* @__PURE__ */ s(
|
|
588
|
-
|
|
588
|
+
f,
|
|
589
589
|
{
|
|
590
590
|
sx: { minWidth: 160, fontWeight: 500, color: "text.secondary" },
|
|
591
591
|
children: [
|
|
@@ -594,14 +594,14 @@ const Tt = ({
|
|
|
594
594
|
]
|
|
595
595
|
}
|
|
596
596
|
),
|
|
597
|
-
/* @__PURE__ */ t(
|
|
598
|
-
|
|
597
|
+
/* @__PURE__ */ t(te, { fullWidth: !0, size: "small", children: /* @__PURE__ */ t(
|
|
598
|
+
$,
|
|
599
599
|
{
|
|
600
600
|
name: "permissionType",
|
|
601
601
|
control: S,
|
|
602
602
|
rules: { required: !0 },
|
|
603
|
-
render: ({ field:
|
|
604
|
-
|
|
603
|
+
render: ({ field: p }) => /* @__PURE__ */ t(
|
|
604
|
+
Ee,
|
|
605
605
|
{
|
|
606
606
|
id: "permissionType",
|
|
607
607
|
name: "permissionType",
|
|
@@ -611,36 +611,36 @@ const Tt = ({
|
|
|
611
611
|
freeSolo: !0,
|
|
612
612
|
disableClearable: !1,
|
|
613
613
|
placeholder: "Choose permission type",
|
|
614
|
-
options:
|
|
615
|
-
(
|
|
616
|
-
) ?
|
|
617
|
-
...
|
|
614
|
+
options: Y ? !v || Y.some(
|
|
615
|
+
(g) => g.type.toLowerCase() === v.toLowerCase()
|
|
616
|
+
) ? Y : [
|
|
617
|
+
...Y,
|
|
618
618
|
{ type: `__add_new__${v}`, isNew: !0 }
|
|
619
619
|
] : [],
|
|
620
|
-
getOptionLabel: (
|
|
621
|
-
onInputChange: (
|
|
622
|
-
onChange: (
|
|
620
|
+
getOptionLabel: (g) => g.isNew ? `Add "${g.type.replace("__add_new__", "")}"` : g.type,
|
|
621
|
+
onInputChange: (g, w) => de(w),
|
|
622
|
+
onChange: (g, w) => {
|
|
623
623
|
if (!w) {
|
|
624
|
-
|
|
624
|
+
p.onChange(null), B("permissionId", "--");
|
|
625
625
|
return;
|
|
626
626
|
}
|
|
627
627
|
if (w.isNew) {
|
|
628
|
-
const
|
|
629
|
-
|
|
630
|
-
(
|
|
631
|
-
),
|
|
628
|
+
const T = w.type.replace("__add_new__", ""), re = { type: T };
|
|
629
|
+
ie(
|
|
630
|
+
(_) => _.some((Fe) => Fe.type === T) ? _ : [..._, re]
|
|
631
|
+
), p.onChange(re);
|
|
632
632
|
return;
|
|
633
633
|
}
|
|
634
|
-
|
|
634
|
+
p.onChange(w);
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
)
|
|
638
638
|
}
|
|
639
639
|
) })
|
|
640
640
|
] }),
|
|
641
|
-
C === "add-child" ? /* @__PURE__ */ t(
|
|
641
|
+
C === "add-child" ? /* @__PURE__ */ t(fe, { children: /* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
642
642
|
/* @__PURE__ */ s(
|
|
643
|
-
|
|
643
|
+
f,
|
|
644
644
|
{
|
|
645
645
|
sx: {
|
|
646
646
|
minWidth: 160,
|
|
@@ -655,7 +655,7 @@ const Tt = ({
|
|
|
655
655
|
),
|
|
656
656
|
/* @__PURE__ */ s(c, { sx: { display: "flex", gap: 1, flexGrow: 1 }, children: [
|
|
657
657
|
/* @__PURE__ */ t(
|
|
658
|
-
|
|
658
|
+
ne,
|
|
659
659
|
{
|
|
660
660
|
control: S,
|
|
661
661
|
name: "parentPermissionDisplay",
|
|
@@ -665,42 +665,42 @@ const Tt = ({
|
|
|
665
665
|
}
|
|
666
666
|
),
|
|
667
667
|
/* @__PURE__ */ t(
|
|
668
|
-
|
|
668
|
+
ne,
|
|
669
669
|
{
|
|
670
670
|
control: S,
|
|
671
671
|
name: "permissionSuffix",
|
|
672
672
|
placeholder: "Enter child suffix",
|
|
673
|
-
errors:
|
|
673
|
+
errors: Pe.errors,
|
|
674
674
|
fullWidth: !0,
|
|
675
|
-
onChange: async (
|
|
676
|
-
const
|
|
677
|
-
if (
|
|
678
|
-
|
|
675
|
+
onChange: async (p) => {
|
|
676
|
+
const g = p.target.value.trim();
|
|
677
|
+
if (B("permissionSuffix", g), g.toLowerCase() === "child") {
|
|
678
|
+
ye("permissionSuffix", {
|
|
679
679
|
type: "manual",
|
|
680
680
|
message: "Suffix cannot be 'child'"
|
|
681
681
|
});
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
|
-
|
|
685
|
-
const w = `${b}.child.${
|
|
686
|
-
if (
|
|
687
|
-
|
|
684
|
+
we("permissionSuffix");
|
|
685
|
+
const w = `${b}.child.${g}`;
|
|
686
|
+
if (B("permissionId", w), R != null && R.has(w)) {
|
|
687
|
+
ye("permissionSuffix", {
|
|
688
688
|
type: "manual",
|
|
689
689
|
message: "Permission ID already exists"
|
|
690
690
|
});
|
|
691
691
|
return;
|
|
692
692
|
}
|
|
693
|
-
await
|
|
693
|
+
await Me(w) ? ye("permissionSuffix", {
|
|
694
694
|
type: "manual",
|
|
695
695
|
message: "Permission ID already exists in DB"
|
|
696
|
-
}) :
|
|
696
|
+
}) : we("permissionSuffix");
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
699
|
)
|
|
700
700
|
] })
|
|
701
|
-
] }) }) : C === "add-parent" ?
|
|
701
|
+
] }) }) : C === "add-parent" ? V != null && V.type ? /* @__PURE__ */ t(fe, { children: /* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
702
702
|
/* @__PURE__ */ s(
|
|
703
|
-
|
|
703
|
+
f,
|
|
704
704
|
{
|
|
705
705
|
sx: {
|
|
706
706
|
minWidth: 160,
|
|
@@ -714,52 +714,52 @@ const Tt = ({
|
|
|
714
714
|
}
|
|
715
715
|
),
|
|
716
716
|
/* @__PURE__ */ t(
|
|
717
|
-
|
|
717
|
+
ne,
|
|
718
718
|
{
|
|
719
719
|
control: S,
|
|
720
720
|
name: "baseId",
|
|
721
|
-
value: `${(
|
|
721
|
+
value: `${(V == null ? void 0 : V.type) === "menu" ? "view" : V == null ? void 0 : V.type}.${E.getValues("menuType")}.${W ? E.getValues("featureConstant") : Ae(E.getValues("menuName"))}.`,
|
|
722
722
|
disabled: !0,
|
|
723
723
|
fullWidth: !0
|
|
724
724
|
}
|
|
725
725
|
),
|
|
726
726
|
/* @__PURE__ */ t(
|
|
727
|
-
|
|
727
|
+
ne,
|
|
728
728
|
{
|
|
729
729
|
control: S,
|
|
730
730
|
name: "parentPermissionSuffix",
|
|
731
731
|
placeholder: "Enter suffix",
|
|
732
|
-
errors:
|
|
732
|
+
errors: Pe.errors,
|
|
733
733
|
fullWidth: !0,
|
|
734
|
-
onChange: async (
|
|
735
|
-
const
|
|
736
|
-
if (
|
|
737
|
-
|
|
734
|
+
onChange: async (p) => {
|
|
735
|
+
const g = p.target.value.trim();
|
|
736
|
+
if (B("parentPermissionSuffix", g), g.toLowerCase() === "child") {
|
|
737
|
+
ye("parentPermissionSuffix", {
|
|
738
738
|
type: "manual",
|
|
739
739
|
message: "Suffix cannot be 'child'"
|
|
740
740
|
});
|
|
741
741
|
return;
|
|
742
742
|
}
|
|
743
|
-
|
|
744
|
-
const w = (
|
|
745
|
-
let
|
|
746
|
-
if (
|
|
747
|
-
|
|
743
|
+
we("parentPermissionSuffix");
|
|
744
|
+
const w = (V == null ? void 0 : V.type) === "menu" ? "view" : (V == null ? void 0 : V.type) || V || "", T = E.getValues("menuType"), re = E.getValues("featureConstant");
|
|
745
|
+
let _;
|
|
746
|
+
if (W ? _ = `${w}.${T}.${re}.${g}` : _ = `${w}.${T}.${Ae(E.getValues("menuName"))}.${g}`, B("permissionId", _), R != null && R.has(_)) {
|
|
747
|
+
ye("parentPermissionSuffix", {
|
|
748
748
|
type: "manual",
|
|
749
749
|
message: "Permission ID already exists"
|
|
750
750
|
});
|
|
751
751
|
return;
|
|
752
752
|
}
|
|
753
|
-
await
|
|
753
|
+
await Me(_) ? ye("parentPermissionSuffix", {
|
|
754
754
|
type: "manual",
|
|
755
755
|
message: "Permission ID already exists in DB"
|
|
756
|
-
}) :
|
|
756
|
+
}) : we("parentPermissionSuffix");
|
|
757
757
|
}
|
|
758
758
|
}
|
|
759
759
|
)
|
|
760
760
|
] }) }) : /* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
761
761
|
/* @__PURE__ */ s(
|
|
762
|
-
|
|
762
|
+
f,
|
|
763
763
|
{
|
|
764
764
|
sx: { minWidth: 160, fontWeight: 500, color: "text.secondary" },
|
|
765
765
|
children: [
|
|
@@ -769,7 +769,7 @@ const Tt = ({
|
|
|
769
769
|
}
|
|
770
770
|
),
|
|
771
771
|
/* @__PURE__ */ t(
|
|
772
|
-
|
|
772
|
+
ne,
|
|
773
773
|
{
|
|
774
774
|
control: S,
|
|
775
775
|
name: "permissionId",
|
|
@@ -780,7 +780,7 @@ const Tt = ({
|
|
|
780
780
|
)
|
|
781
781
|
] }) : /* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
782
782
|
/* @__PURE__ */ s(
|
|
783
|
-
|
|
783
|
+
f,
|
|
784
784
|
{
|
|
785
785
|
sx: {
|
|
786
786
|
minWidth: 160,
|
|
@@ -794,7 +794,7 @@ const Tt = ({
|
|
|
794
794
|
}
|
|
795
795
|
),
|
|
796
796
|
/* @__PURE__ */ t(
|
|
797
|
-
|
|
797
|
+
ne,
|
|
798
798
|
{
|
|
799
799
|
control: S,
|
|
800
800
|
name: "permissionId",
|
|
@@ -806,7 +806,7 @@ const Tt = ({
|
|
|
806
806
|
] }),
|
|
807
807
|
/* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
808
808
|
/* @__PURE__ */ s(
|
|
809
|
-
|
|
809
|
+
f,
|
|
810
810
|
{
|
|
811
811
|
sx: { minWidth: 160, fontWeight: 500, color: "text.secondary" },
|
|
812
812
|
children: [
|
|
@@ -816,16 +816,16 @@ const Tt = ({
|
|
|
816
816
|
}
|
|
817
817
|
),
|
|
818
818
|
/* @__PURE__ */ t(
|
|
819
|
-
|
|
819
|
+
$,
|
|
820
820
|
{
|
|
821
821
|
name: "permissionName",
|
|
822
822
|
control: S,
|
|
823
823
|
rules: { required: !0 },
|
|
824
|
-
render: ({ field:
|
|
825
|
-
|
|
824
|
+
render: ({ field: p }) => /* @__PURE__ */ t(
|
|
825
|
+
ne,
|
|
826
826
|
{
|
|
827
827
|
control: S,
|
|
828
|
-
...
|
|
828
|
+
...p,
|
|
829
829
|
placeholder: "Enter name"
|
|
830
830
|
}
|
|
831
831
|
)
|
|
@@ -834,7 +834,7 @@ const Tt = ({
|
|
|
834
834
|
] }),
|
|
835
835
|
/* @__PURE__ */ s(c, { display: "flex", alignItems: "flex-start", gap: 2, children: [
|
|
836
836
|
/* @__PURE__ */ t(
|
|
837
|
-
|
|
837
|
+
f,
|
|
838
838
|
{
|
|
839
839
|
sx: {
|
|
840
840
|
minWidth: 160,
|
|
@@ -846,15 +846,15 @@ const Tt = ({
|
|
|
846
846
|
}
|
|
847
847
|
),
|
|
848
848
|
/* @__PURE__ */ t(
|
|
849
|
-
|
|
849
|
+
$,
|
|
850
850
|
{
|
|
851
851
|
name: "permissionDesc",
|
|
852
852
|
control: S,
|
|
853
|
-
render: ({ field:
|
|
853
|
+
render: ({ field: p }) => /* @__PURE__ */ t(
|
|
854
854
|
dr,
|
|
855
855
|
{
|
|
856
856
|
control: S,
|
|
857
|
-
...
|
|
857
|
+
...p,
|
|
858
858
|
placeholder: "Enter description (optional)",
|
|
859
859
|
minRows: 2
|
|
860
860
|
}
|
|
@@ -862,9 +862,9 @@ const Tt = ({
|
|
|
862
862
|
}
|
|
863
863
|
)
|
|
864
864
|
] }),
|
|
865
|
-
!
|
|
865
|
+
!W && /* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
866
866
|
/* @__PURE__ */ s(
|
|
867
|
-
|
|
867
|
+
f,
|
|
868
868
|
{
|
|
869
869
|
sx: {
|
|
870
870
|
minWidth: 160,
|
|
@@ -888,10 +888,10 @@ const Tt = ({
|
|
|
888
888
|
}
|
|
889
889
|
)
|
|
890
890
|
] }),
|
|
891
|
-
!
|
|
891
|
+
!W && j !== void 0 && /* @__PURE__ */ t(fe, { children: j === !1 ? /* @__PURE__ */ s(fe, { children: [
|
|
892
892
|
/* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
893
893
|
/* @__PURE__ */ t(
|
|
894
|
-
|
|
894
|
+
f,
|
|
895
895
|
{
|
|
896
896
|
sx: {
|
|
897
897
|
minWidth: 160,
|
|
@@ -901,21 +901,21 @@ const Tt = ({
|
|
|
901
901
|
children: "URL Type"
|
|
902
902
|
}
|
|
903
903
|
),
|
|
904
|
-
/* @__PURE__ */ t(
|
|
905
|
-
|
|
904
|
+
/* @__PURE__ */ t(te, { fullWidth: !0, size: "small", children: /* @__PURE__ */ t(
|
|
905
|
+
$,
|
|
906
906
|
{
|
|
907
907
|
name: "urlType",
|
|
908
908
|
control: S,
|
|
909
|
-
render: ({ field:
|
|
909
|
+
render: ({ field: p }) => /* @__PURE__ */ s(Zi, { ...p, displayEmpty: !0, children: [
|
|
910
910
|
/* @__PURE__ */ t(Cn, { value: "", children: /* @__PURE__ */ t("em", { children: "Select Type" }) }),
|
|
911
|
-
["GET", "POST", "PUT", "DELETE"].map((
|
|
911
|
+
["GET", "POST", "PUT", "DELETE"].map((g) => /* @__PURE__ */ t(Cn, { value: g, children: g }, g))
|
|
912
912
|
] })
|
|
913
913
|
}
|
|
914
914
|
) })
|
|
915
915
|
] }),
|
|
916
916
|
/* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
917
917
|
/* @__PURE__ */ t(
|
|
918
|
-
|
|
918
|
+
f,
|
|
919
919
|
{
|
|
920
920
|
sx: {
|
|
921
921
|
minWidth: 160,
|
|
@@ -926,15 +926,15 @@ const Tt = ({
|
|
|
926
926
|
}
|
|
927
927
|
),
|
|
928
928
|
/* @__PURE__ */ t(
|
|
929
|
-
|
|
929
|
+
$,
|
|
930
930
|
{
|
|
931
931
|
name: "backendUrl",
|
|
932
932
|
control: S,
|
|
933
|
-
render: ({ field:
|
|
934
|
-
|
|
933
|
+
render: ({ field: p }) => /* @__PURE__ */ t(
|
|
934
|
+
ne,
|
|
935
935
|
{
|
|
936
936
|
control: S,
|
|
937
|
-
...
|
|
937
|
+
...p,
|
|
938
938
|
placeholder: "Enter URL"
|
|
939
939
|
}
|
|
940
940
|
)
|
|
@@ -943,7 +943,7 @@ const Tt = ({
|
|
|
943
943
|
] })
|
|
944
944
|
] }) : /* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
945
945
|
/* @__PURE__ */ t(
|
|
946
|
-
|
|
946
|
+
f,
|
|
947
947
|
{
|
|
948
948
|
sx: {
|
|
949
949
|
minWidth: 160,
|
|
@@ -954,31 +954,31 @@ const Tt = ({
|
|
|
954
954
|
}
|
|
955
955
|
),
|
|
956
956
|
/* @__PURE__ */ t(
|
|
957
|
-
|
|
957
|
+
$,
|
|
958
958
|
{
|
|
959
959
|
name: "queryCode",
|
|
960
960
|
control: S,
|
|
961
|
-
render: ({ field:
|
|
962
|
-
|
|
961
|
+
render: ({ field: p, fieldState: { error: g } }) => /* @__PURE__ */ t(
|
|
962
|
+
Ee,
|
|
963
963
|
{
|
|
964
964
|
id: "queryCode",
|
|
965
965
|
name: "queryCode",
|
|
966
966
|
control: S,
|
|
967
|
-
options:
|
|
967
|
+
options: Z,
|
|
968
968
|
getOptionLabel: (w) => (w == null ? void 0 : w.code) || "",
|
|
969
969
|
checkEquality: "code",
|
|
970
|
-
inputValue:
|
|
970
|
+
inputValue: he,
|
|
971
971
|
disableClearable: !1,
|
|
972
|
-
value: (
|
|
973
|
-
onInputChange: (w,
|
|
974
|
-
|
|
972
|
+
value: (Z == null ? void 0 : Z.find((w) => w.code === p.value)) || null,
|
|
973
|
+
onInputChange: (w, T, re) => {
|
|
974
|
+
re === "input" && (Q(T), Xe(T));
|
|
975
975
|
},
|
|
976
976
|
singleSelect: !0,
|
|
977
|
-
onChange: (w,
|
|
978
|
-
|
|
977
|
+
onChange: (w, T) => {
|
|
978
|
+
p.onChange((T == null ? void 0 : T.code) || ""), Q((T == null ? void 0 : T.code) || "");
|
|
979
979
|
},
|
|
980
980
|
placeholder: "Search Query Code...",
|
|
981
|
-
errors:
|
|
981
|
+
errors: g,
|
|
982
982
|
fullWidth: !0,
|
|
983
983
|
freeSolo: !1
|
|
984
984
|
}
|
|
@@ -988,7 +988,7 @@ const Tt = ({
|
|
|
988
988
|
] }) }),
|
|
989
989
|
/* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
990
990
|
/* @__PURE__ */ s(
|
|
991
|
-
|
|
991
|
+
f,
|
|
992
992
|
{
|
|
993
993
|
sx: { minWidth: 160, fontWeight: 500, color: "text.secondary" },
|
|
994
994
|
children: [
|
|
@@ -998,17 +998,17 @@ const Tt = ({
|
|
|
998
998
|
}
|
|
999
999
|
),
|
|
1000
1000
|
/* @__PURE__ */ t(
|
|
1001
|
-
|
|
1001
|
+
$,
|
|
1002
1002
|
{
|
|
1003
1003
|
name: "enabled",
|
|
1004
1004
|
control: S,
|
|
1005
|
-
render: ({ field:
|
|
1006
|
-
|
|
1005
|
+
render: ({ field: p }) => /* @__PURE__ */ t(
|
|
1006
|
+
Ie,
|
|
1007
1007
|
{
|
|
1008
|
-
...
|
|
1009
|
-
disabled: (l == null ? void 0 : l.isDefault) && !
|
|
1010
|
-
checked:
|
|
1011
|
-
onChange: (
|
|
1008
|
+
...p,
|
|
1009
|
+
disabled: (l == null ? void 0 : l.isDefault) && !W,
|
|
1010
|
+
checked: p.value,
|
|
1011
|
+
onChange: (g) => p.onChange(g.target.checked)
|
|
1012
1012
|
}
|
|
1013
1013
|
)
|
|
1014
1014
|
}
|
|
@@ -1018,26 +1018,26 @@ const Tt = ({
|
|
|
1018
1018
|
}
|
|
1019
1019
|
),
|
|
1020
1020
|
/* @__PURE__ */ s(En, { children: [
|
|
1021
|
-
/* @__PURE__ */ t(
|
|
1021
|
+
/* @__PURE__ */ t(U, { onClick: M, children: "Cancel" }),
|
|
1022
1022
|
/* @__PURE__ */ t(
|
|
1023
|
-
|
|
1023
|
+
U,
|
|
1024
1024
|
{
|
|
1025
|
-
onClick:
|
|
1025
|
+
onClick: Ke(et),
|
|
1026
1026
|
variant: "contained",
|
|
1027
|
-
disabled: !
|
|
1027
|
+
disabled: !Pe.isValid || Object.keys(Pe.errors).length > 0,
|
|
1028
1028
|
children: C === "edit" ? "Update" : C === "add-child" ? "Add Child" : "Add"
|
|
1029
1029
|
}
|
|
1030
1030
|
)
|
|
1031
1031
|
] })
|
|
1032
1032
|
] });
|
|
1033
1033
|
}, Rn = ({
|
|
1034
|
-
open:
|
|
1035
|
-
onClose:
|
|
1036
|
-
onSave:
|
|
1037
|
-
entityData:
|
|
1034
|
+
open: m,
|
|
1035
|
+
onClose: M,
|
|
1036
|
+
onSave: A,
|
|
1037
|
+
entityData: E,
|
|
1038
1038
|
permissions: l = []
|
|
1039
1039
|
}) => {
|
|
1040
|
-
const { control: b, watch: C, getValues:
|
|
1040
|
+
const { control: b, watch: C, getValues: Y } = ft({
|
|
1041
1041
|
defaultValues: {
|
|
1042
1042
|
noStartDate: !0,
|
|
1043
1043
|
noEndDate: !0,
|
|
@@ -1045,45 +1045,45 @@ const Tt = ({
|
|
|
1045
1045
|
endDate: null,
|
|
1046
1046
|
isBackendOnly: !1
|
|
1047
1047
|
}
|
|
1048
|
-
}),
|
|
1049
|
-
const
|
|
1050
|
-
|
|
1051
|
-
},
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1054
|
-
if (
|
|
1055
|
-
const
|
|
1056
|
-
|
|
1057
|
-
...
|
|
1048
|
+
}), ie = C("noStartDate"), R = C("noEndDate"), W = C("startDate"), v = C("endDate"), de = () => {
|
|
1049
|
+
const z = Y();
|
|
1050
|
+
Z(z);
|
|
1051
|
+
}, Z = (z) => {
|
|
1052
|
+
const he = [];
|
|
1053
|
+
E.forEach((Q) => {
|
|
1054
|
+
if (Q.type === "user") {
|
|
1055
|
+
const J = Array.isArray(Q.id) ? Q.id : [Q.id];
|
|
1056
|
+
he.push(
|
|
1057
|
+
...J.map((pe) => ({
|
|
1058
1058
|
entityType: "user",
|
|
1059
|
-
user_id:
|
|
1060
|
-
name:
|
|
1061
|
-
startDate:
|
|
1062
|
-
endDate:
|
|
1063
|
-
isBackendOnly:
|
|
1059
|
+
user_id: pe,
|
|
1060
|
+
name: Q.name,
|
|
1061
|
+
startDate: z.noStartDate ? null : z.startDate,
|
|
1062
|
+
endDate: z.noEndDate ? null : z.endDate,
|
|
1063
|
+
isBackendOnly: z.isBackendOnly,
|
|
1064
1064
|
permissions: JSON.parse(JSON.stringify(l))
|
|
1065
1065
|
}))
|
|
1066
1066
|
);
|
|
1067
1067
|
}
|
|
1068
|
-
|
|
1069
|
-
|
|
1068
|
+
Q.type === "role" && Q.ids.forEach((J, pe) => {
|
|
1069
|
+
he.push({
|
|
1070
1070
|
entityType: "role",
|
|
1071
|
-
role_id:
|
|
1072
|
-
name:
|
|
1073
|
-
startDate:
|
|
1074
|
-
endDate:
|
|
1075
|
-
isBackendOnly:
|
|
1071
|
+
role_id: J,
|
|
1072
|
+
name: Q.names[pe],
|
|
1073
|
+
startDate: z.noStartDate ? null : z.startDate,
|
|
1074
|
+
endDate: z.noEndDate ? null : z.endDate,
|
|
1075
|
+
isBackendOnly: z.isBackendOnly,
|
|
1076
1076
|
permissions: JSON.parse(JSON.stringify(l))
|
|
1077
1077
|
});
|
|
1078
1078
|
});
|
|
1079
|
-
}),
|
|
1079
|
+
}), he.forEach((Q) => A(Q)), M();
|
|
1080
1080
|
};
|
|
1081
|
-
return /* @__PURE__ */ t(Xi, { open:
|
|
1082
|
-
/* @__PURE__ */ s(
|
|
1083
|
-
/* @__PURE__ */ t(
|
|
1084
|
-
/* @__PURE__ */ t(
|
|
1081
|
+
return /* @__PURE__ */ t(Xi, { open: m, onClose: M, children: /* @__PURE__ */ t(c, { className: "fixed inset-0 flex items-start justify-center z-50 bg-opacity-10 overflow-y-auto", children: /* @__PURE__ */ s(er, { className: "relative mt-10 p-4 shadow-lg flex flex-col rounded-xl", children: [
|
|
1082
|
+
/* @__PURE__ */ s(H, { className: "flex justify-between items-center mb-4", children: [
|
|
1083
|
+
/* @__PURE__ */ t(f, { variant: "h6", children: "Grant Access" }),
|
|
1084
|
+
/* @__PURE__ */ t(qe, { onClick: M, children: /* @__PURE__ */ t(le, { iconName: "faXmark", size: "sm" }) })
|
|
1085
1085
|
] }),
|
|
1086
|
-
/* @__PURE__ */ t(
|
|
1086
|
+
/* @__PURE__ */ t(H, { container: !0, spacing: 2, children: /* @__PURE__ */ s(H, { item: !0, xs: 12, display: "flex", gap: 2, children: [
|
|
1087
1087
|
/* @__PURE__ */ s(c, { display: "flex", flexDirection: "column", flex: 1, children: [
|
|
1088
1088
|
/* @__PURE__ */ t(
|
|
1089
1089
|
vt,
|
|
@@ -1099,7 +1099,7 @@ const Tt = ({
|
|
|
1099
1099
|
{
|
|
1100
1100
|
name: "startDate",
|
|
1101
1101
|
control: b,
|
|
1102
|
-
disabled:
|
|
1102
|
+
disabled: ie,
|
|
1103
1103
|
maxDate: v || void 0
|
|
1104
1104
|
}
|
|
1105
1105
|
)
|
|
@@ -1119,8 +1119,8 @@ const Tt = ({
|
|
|
1119
1119
|
{
|
|
1120
1120
|
name: "endDate",
|
|
1121
1121
|
control: b,
|
|
1122
|
-
disabled:
|
|
1123
|
-
minDate:
|
|
1122
|
+
disabled: R,
|
|
1123
|
+
minDate: W || void 0
|
|
1124
1124
|
}
|
|
1125
1125
|
)
|
|
1126
1126
|
] })
|
|
@@ -1133,14 +1133,14 @@ const Tt = ({
|
|
|
1133
1133
|
control: b
|
|
1134
1134
|
}
|
|
1135
1135
|
) }),
|
|
1136
|
-
/* @__PURE__ */ s(
|
|
1137
|
-
/* @__PURE__ */ t(
|
|
1138
|
-
/* @__PURE__ */ t(
|
|
1136
|
+
/* @__PURE__ */ s(H, { className: "flex justify-end gap-2 mt-4", children: [
|
|
1137
|
+
/* @__PURE__ */ t(U, { type: "button", variant: "outlined", onClick: M, children: "Cancel" }),
|
|
1138
|
+
/* @__PURE__ */ t(U, { variant: "contained", type: "button", onClick: de, children: "Save" })
|
|
1139
1139
|
] })
|
|
1140
1140
|
] }) }) });
|
|
1141
|
-
}, _t = ({ permissions:
|
|
1142
|
-
const
|
|
1143
|
-
return
|
|
1141
|
+
}, _t = ({ permissions: m, onToggle: M, isChild: A = !1 }) => {
|
|
1142
|
+
const E = (l) => l.replaceAll(".child", "");
|
|
1143
|
+
return m.map((l, b) => {
|
|
1144
1144
|
var C;
|
|
1145
1145
|
return /* @__PURE__ */ s(
|
|
1146
1146
|
c,
|
|
@@ -1148,30 +1148,30 @@ const Tt = ({
|
|
|
1148
1148
|
display: "flex",
|
|
1149
1149
|
flexDirection: "column",
|
|
1150
1150
|
gap: 1,
|
|
1151
|
-
ml:
|
|
1151
|
+
ml: A ? 2 : 0,
|
|
1152
1152
|
children: [
|
|
1153
1153
|
/* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 1, children: [
|
|
1154
1154
|
/* @__PURE__ */ t(
|
|
1155
|
-
|
|
1155
|
+
Ie,
|
|
1156
1156
|
{
|
|
1157
1157
|
sx: {
|
|
1158
1158
|
transform: "scale(0.75)",
|
|
1159
1159
|
transformOrigin: "left center"
|
|
1160
1160
|
},
|
|
1161
1161
|
checked: !!l.enabled,
|
|
1162
|
-
disabled:
|
|
1162
|
+
disabled: A,
|
|
1163
1163
|
onChange: () => {
|
|
1164
|
-
|
|
1164
|
+
A || M(l);
|
|
1165
1165
|
}
|
|
1166
1166
|
}
|
|
1167
1167
|
),
|
|
1168
|
-
/* @__PURE__ */ t(
|
|
1168
|
+
/* @__PURE__ */ t(f, { variant: "subtitle1", children: E(l.permissionId) })
|
|
1169
1169
|
] }),
|
|
1170
1170
|
((C = l.childPermissions) == null ? void 0 : C.length) > 0 && /* @__PURE__ */ t(
|
|
1171
1171
|
_t,
|
|
1172
1172
|
{
|
|
1173
1173
|
permissions: l.childPermissions,
|
|
1174
|
-
onToggle:
|
|
1174
|
+
onToggle: M,
|
|
1175
1175
|
isChild: !0
|
|
1176
1176
|
}
|
|
1177
1177
|
)
|
|
@@ -1183,34 +1183,34 @@ const Tt = ({
|
|
|
1183
1183
|
};
|
|
1184
1184
|
function Jr() {
|
|
1185
1185
|
var tn, nn, rn, an, sn, on, ln, dn, cn, un, mn;
|
|
1186
|
-
const { translate:
|
|
1187
|
-
() => new URLSearchParams(
|
|
1188
|
-
[
|
|
1189
|
-
), C = Dn(), [
|
|
1186
|
+
const { translate: m } = cr(), M = ir(null), A = sr(), E = or(), { isNew: l } = A.state || {}, b = Nn(
|
|
1187
|
+
() => new URLSearchParams(A.search),
|
|
1188
|
+
[A.search]
|
|
1189
|
+
), C = Dn(), [Y, ie] = x([]), [R, W] = x(!1), [v, de] = x([]), [Z, z] = x([]), [he, Q] = x(), [J, pe] = x({}), [N, S] = x(!1), [D, Ke] = x(!1), [Se, B] = x(""), [De, ye] = x(""), [we, Pe] = x(""), [j, V] = x(), [Re, Ze] = x([]), [ve, ht] = x(!1), [L, Ce] = x(0), [Ae, Xe] = x(!1), [et, Me] = x([]), [Be, Oe] = x([]), [be, p] = x([]), [g, w] = x([]), [T, re] = x([]), [_, Fe] = x({}), [Ue, ze] = x([]), [Le, Mn] = x({}), [ce, $e] = x([]), [Bn, Qe] = x(!1), [Je, tt] = x("add-parent"), [pt, nt] = x(null), [On, it] = x(null), [Un, rt] = x(null), [zn, gt] = x(!1), [Ln, $n] = x(null), [Ne, We] = x([]), [Qn, Vt] = x(!1), [Te, at] = x(!1), [Et, Jn] = x(!1), [K, Dt] = x({ value: !1, length: 0 }), [jn, Gn] = x([
|
|
1190
1190
|
{ type: "update" },
|
|
1191
1191
|
{ type: "menu" },
|
|
1192
1192
|
{ type: "create" },
|
|
1193
1193
|
{ type: "download" },
|
|
1194
1194
|
{ type: "execute" }
|
|
1195
|
-
]), [
|
|
1195
|
+
]), [ke, Hn] = x([]), [Yn, je] = x(""), [Kn, Ge] = x(""), [yt, bt] = x({
|
|
1196
1196
|
basicConfig: !0,
|
|
1197
1197
|
trainingConfig: !1,
|
|
1198
1198
|
notificationConfig: !1
|
|
1199
|
-
}), [Pt, Zn] = nr.useState(null), Xn = (e) =>
|
|
1199
|
+
}), [Pt, Zn] = nr.useState(null), Xn = (e) => et.includes(e), [ei, At] = x(/* @__PURE__ */ new Set()), ti = ar((e) => e.theme.mode), q = [
|
|
1200
1200
|
{ key: "featureDetails", label: "Feature Details" },
|
|
1201
1201
|
{ key: "mobileConfig", label: "Mobile Config" },
|
|
1202
1202
|
{ key: "formLinking", label: "Form Linking" },
|
|
1203
1203
|
{ key: "additionalPermissions", label: "Permission Management" },
|
|
1204
1204
|
{ key: "assignFeatures", label: "Assignment" },
|
|
1205
1205
|
{ key: "submit", label: "Submit" }
|
|
1206
|
-
], ni =
|
|
1207
|
-
menuName:
|
|
1208
|
-
featureConstant:
|
|
1206
|
+
], ni = O.object().shape({
|
|
1207
|
+
menuName: O.string().required("Enter Feature Name"),
|
|
1208
|
+
featureConstant: O.string().when("isDynamicFeature", {
|
|
1209
1209
|
is: !0,
|
|
1210
1210
|
then: (e) => e.required("Enter Feature Constant"),
|
|
1211
1211
|
otherwise: (e) => e.notRequired()
|
|
1212
1212
|
}),
|
|
1213
|
-
navigationState:
|
|
1213
|
+
navigationState: O.string().when("isDynamicFeature", {
|
|
1214
1214
|
is: !1,
|
|
1215
1215
|
then: (e) => e.required("Enter Navigation State").matches(
|
|
1216
1216
|
/^(techo\.[a-zA-Z]+\.[a-zA-Z]+|medplat\.form\.[a-zA-Z_]+)$/,
|
|
@@ -1218,29 +1218,29 @@ function Jr() {
|
|
|
1218
1218
|
),
|
|
1219
1219
|
otherwise: (e) => e.notRequired()
|
|
1220
1220
|
}),
|
|
1221
|
-
menuType:
|
|
1222
|
-
icon:
|
|
1221
|
+
menuType: O.string().required("Enter Feature Type"),
|
|
1222
|
+
icon: O.string().when("$showMobileFields", {
|
|
1223
1223
|
is: !0,
|
|
1224
1224
|
then: (e) => e.required("Please upload an icon"),
|
|
1225
1225
|
otherwise: (e) => e.notRequired()
|
|
1226
1226
|
}),
|
|
1227
|
-
conditions:
|
|
1228
|
-
mobileMode:
|
|
1227
|
+
conditions: O.string().transform((e) => e ? e.trim() : ""),
|
|
1228
|
+
mobileMode: O.string().when("$showMobileFields", {
|
|
1229
1229
|
is: !0,
|
|
1230
1230
|
then: (e) => e.required("Please select a mode"),
|
|
1231
1231
|
otherwise: (e) => e.notRequired()
|
|
1232
1232
|
}),
|
|
1233
|
-
trainingQuery:
|
|
1233
|
+
trainingQuery: O.string().when("trainingRequired", {
|
|
1234
1234
|
is: !0,
|
|
1235
1235
|
then: (e) => e.required("Please select a training query"),
|
|
1236
1236
|
otherwise: (e) => e.notRequired()
|
|
1237
1237
|
}),
|
|
1238
|
-
notificationBadgeType:
|
|
1238
|
+
notificationBadgeType: O.string().when("notificationBadgeEnabled", {
|
|
1239
1239
|
is: !0,
|
|
1240
1240
|
then: (e) => e.required("Please select a badge type"),
|
|
1241
1241
|
otherwise: (e) => e.notRequired()
|
|
1242
1242
|
}),
|
|
1243
|
-
notificationBadgeQuery:
|
|
1243
|
+
notificationBadgeQuery: O.string().when(
|
|
1244
1244
|
["notificationBadgeEnabled", "notificationBadgeType"],
|
|
1245
1245
|
(e, n) => {
|
|
1246
1246
|
const [i, r] = e;
|
|
@@ -1249,13 +1249,13 @@ function Jr() {
|
|
|
1249
1249
|
) : n.notRequired();
|
|
1250
1250
|
}
|
|
1251
1251
|
),
|
|
1252
|
-
updatedFields:
|
|
1252
|
+
updatedFields: O.array().when(
|
|
1253
1253
|
["isDynamicFeature", "isNew", "isUpdate", "showFields"],
|
|
1254
1254
|
(e, n) => {
|
|
1255
1255
|
const [i, r, o, u] = e;
|
|
1256
1256
|
return i === !1 && (r == null ? void 0 : r.val) === !1 && (o == null ? void 0 : o.value) === !0 && u === !0 ? n.of(
|
|
1257
|
-
|
|
1258
|
-
value:
|
|
1257
|
+
O.object().shape({
|
|
1258
|
+
value: O.string().required("Right is required")
|
|
1259
1259
|
})
|
|
1260
1260
|
) : n.optional();
|
|
1261
1261
|
}
|
|
@@ -1289,7 +1289,7 @@ function Jr() {
|
|
|
1289
1289
|
},
|
|
1290
1290
|
resolver: vn(ni),
|
|
1291
1291
|
mode: "onChange"
|
|
1292
|
-
}),
|
|
1292
|
+
}), P = mt({
|
|
1293
1293
|
control: a.control,
|
|
1294
1294
|
name: "isDynamicFeature"
|
|
1295
1295
|
}), Wt = mt({
|
|
@@ -1300,14 +1300,14 @@ function Jr() {
|
|
|
1300
1300
|
name: "isWebFeature"
|
|
1301
1301
|
}), ii = mt({
|
|
1302
1302
|
control: a.control,
|
|
1303
|
-
name: ai((tn =
|
|
1303
|
+
name: ai((tn = q[L]) == null ? void 0 : tn.key)
|
|
1304
1304
|
}), ri = a.watch();
|
|
1305
1305
|
function ai(e) {
|
|
1306
1306
|
switch (e) {
|
|
1307
1307
|
case "featureDetails":
|
|
1308
|
-
return
|
|
1308
|
+
return P ? ["menuName", "featureConstant", "menuType"] : ["menuName", "navigationState", "menuType"];
|
|
1309
1309
|
case "mobileConfig":
|
|
1310
|
-
return
|
|
1310
|
+
return R ? [
|
|
1311
1311
|
"icon",
|
|
1312
1312
|
"mobileMode",
|
|
1313
1313
|
"trainingRequired",
|
|
@@ -1317,32 +1317,32 @@ function Jr() {
|
|
|
1317
1317
|
"notificationBadgeQuery"
|
|
1318
1318
|
] : [];
|
|
1319
1319
|
case "formLinking":
|
|
1320
|
-
return
|
|
1320
|
+
return P ? ["formCode", "version"] : [];
|
|
1321
1321
|
case "additionalPermissions":
|
|
1322
|
-
return !
|
|
1322
|
+
return !P && (l == null ? void 0 : l.val) === !1 ? ["updatedFields"] : ["additionalPermissions"];
|
|
1323
1323
|
default:
|
|
1324
1324
|
return [];
|
|
1325
1325
|
}
|
|
1326
1326
|
}
|
|
1327
1327
|
const Rt = Nn(() => {
|
|
1328
1328
|
var n;
|
|
1329
|
-
switch ((n =
|
|
1329
|
+
switch ((n = q[L]) == null ? void 0 : n.key) {
|
|
1330
1330
|
case "featureDetails": {
|
|
1331
1331
|
const i = !!a.formState.errors.navigationState, r = !!a.formState.errors.featureConstant;
|
|
1332
|
-
return a.formState.isValid && !!a.getValues("menuName") && (
|
|
1332
|
+
return a.formState.isValid && !!a.getValues("menuName") && (P ? !!a.getValues("featureConstant") && !r : !!a.getValues("navigationState") && !i) && !!a.getValues("menuType");
|
|
1333
1333
|
}
|
|
1334
1334
|
case "mobileConfig": {
|
|
1335
|
-
if (!
|
|
1336
|
-
const i = !!a.getValues("icon"), r = !!a.getValues("mobileMode"), o = a.getValues("trainingRequired"), u = a.getValues("trainingQuery"), d = a.getValues("notificationBadgeEnabled"),
|
|
1337
|
-
return i && r && (!o || !!u) && (!d || !!
|
|
1335
|
+
if (!R) return !0;
|
|
1336
|
+
const i = !!a.getValues("icon"), r = !!a.getValues("mobileMode"), o = a.getValues("trainingRequired"), u = a.getValues("trainingQuery"), d = a.getValues("notificationBadgeEnabled"), h = a.getValues("notificationBadgeType"), y = a.getValues("notificationBadgeQuery");
|
|
1337
|
+
return i && r && (!o || !!u) && (!d || !!h) && (!d || !h || !!y);
|
|
1338
1338
|
}
|
|
1339
1339
|
case "formLinking": {
|
|
1340
|
-
if (!
|
|
1340
|
+
if (!P) return !0;
|
|
1341
1341
|
const i = a.getValues("formCode"), r = a.getValues("version");
|
|
1342
1342
|
return !!i && !!r;
|
|
1343
1343
|
}
|
|
1344
1344
|
case "additionalPermissions": {
|
|
1345
|
-
if (!
|
|
1345
|
+
if (!P && (l == null ? void 0 : l.val) === !1 && Te)
|
|
1346
1346
|
return (a.getValues("updatedFields") || []).every(
|
|
1347
1347
|
(o) => o.value && o.value.trim()
|
|
1348
1348
|
);
|
|
@@ -1350,8 +1350,8 @@ function Jr() {
|
|
|
1350
1350
|
const i = a.getValues("additionalPermissions") || [];
|
|
1351
1351
|
return i.length > 0 && i.every(
|
|
1352
1352
|
(o) => {
|
|
1353
|
-
var u, d,
|
|
1354
|
-
return ((u = o.permissionId) == null ? void 0 : u.trim()) && ((d = o.permissionName) == null ? void 0 : d.trim()) && ((
|
|
1353
|
+
var u, d, h, y;
|
|
1354
|
+
return ((u = o.permissionId) == null ? void 0 : u.trim()) && ((d = o.permissionName) == null ? void 0 : d.trim()) && ((y = (h = o.permissionType) == null ? void 0 : h.type) == null ? void 0 : y.trim());
|
|
1355
1355
|
}
|
|
1356
1356
|
);
|
|
1357
1357
|
}
|
|
@@ -1362,39 +1362,39 @@ function Jr() {
|
|
|
1362
1362
|
}, [
|
|
1363
1363
|
ii,
|
|
1364
1364
|
a.formState.isValid,
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
]),
|
|
1368
|
-
(e) => (e.key !== "mobileConfig" ||
|
|
1365
|
+
L,
|
|
1366
|
+
R
|
|
1367
|
+
]), He = q.filter(
|
|
1368
|
+
(e) => (e.key !== "mobileConfig" || R) && (e.key !== "formLinking" || P)
|
|
1369
1369
|
), xt = async () => {
|
|
1370
|
-
const e =
|
|
1370
|
+
const e = q[L].key;
|
|
1371
1371
|
if (Xn(e)) {
|
|
1372
1372
|
Mt();
|
|
1373
1373
|
return;
|
|
1374
1374
|
}
|
|
1375
|
-
await a.trigger(Bt(e)) && (At((i) => new Set(i).add(e)),
|
|
1375
|
+
await a.trigger(Bt(e)) && (At((i) => new Set(i).add(e)), Me((i) => i.filter((r) => r !== e)), Mt());
|
|
1376
1376
|
}, Mt = () => {
|
|
1377
|
-
const e =
|
|
1377
|
+
const e = q[L].key, n = He.findIndex(
|
|
1378
1378
|
(r) => r.key === e
|
|
1379
|
-
), i =
|
|
1379
|
+
), i = He[n + 1];
|
|
1380
1380
|
if (i) {
|
|
1381
|
-
i.key === "additionalPermissions" &&
|
|
1382
|
-
li(
|
|
1381
|
+
i.key === "additionalPermissions" && ce.length === 0 && ci(), e === "additionalPermissions" && i.key === "assignFeatures" && We(
|
|
1382
|
+
li(ce, Ne)
|
|
1383
1383
|
);
|
|
1384
|
-
const r =
|
|
1384
|
+
const r = q.findIndex(
|
|
1385
1385
|
(o) => o.key === i.key
|
|
1386
1386
|
);
|
|
1387
|
-
|
|
1387
|
+
Ce(r);
|
|
1388
1388
|
}
|
|
1389
1389
|
};
|
|
1390
|
-
|
|
1391
|
-
if (
|
|
1390
|
+
ae(() => {
|
|
1391
|
+
if (D === !0) {
|
|
1392
1392
|
const e = a.getValues("mobileMode");
|
|
1393
1393
|
Zn(e);
|
|
1394
1394
|
}
|
|
1395
|
-
}, [
|
|
1396
|
-
|
|
1397
|
-
}, [
|
|
1395
|
+
}, [D, a]), ae(() => {
|
|
1396
|
+
P ? a.setValue("navigationState", "medplat.form") : (b.get("featureId") === null && a.setValue("navigationState", ""), a.setValue("featureConstant", ""), B(""), a.clearErrors("featureConstant"));
|
|
1397
|
+
}, [P]);
|
|
1398
1398
|
const Bt = (e) => {
|
|
1399
1399
|
switch (e) {
|
|
1400
1400
|
case "formLinking":
|
|
@@ -1405,24 +1405,24 @@ function Jr() {
|
|
|
1405
1405
|
return [];
|
|
1406
1406
|
}
|
|
1407
1407
|
}, si = () => {
|
|
1408
|
-
|
|
1409
|
-
const e =
|
|
1408
|
+
L === 0 && E("/ui/medplat/manage/menu");
|
|
1409
|
+
const e = q[L].key, n = He.findIndex(
|
|
1410
1410
|
(r) => r.key === e
|
|
1411
|
-
), i =
|
|
1411
|
+
), i = He[n - 1];
|
|
1412
1412
|
if (i) {
|
|
1413
|
-
const r =
|
|
1413
|
+
const r = q.findIndex(
|
|
1414
1414
|
(o) => o.key === i.key
|
|
1415
1415
|
);
|
|
1416
|
-
|
|
1416
|
+
Ce(r);
|
|
1417
1417
|
}
|
|
1418
1418
|
}, oi = (e) => {
|
|
1419
|
-
const n =
|
|
1419
|
+
const n = q[e].key;
|
|
1420
1420
|
return ei.has(n);
|
|
1421
1421
|
};
|
|
1422
|
-
|
|
1422
|
+
ae(() => {
|
|
1423
1423
|
(async () => {
|
|
1424
1424
|
var e;
|
|
1425
|
-
if (await hi(), await pi(), await gi(), ht(!0), await Lt(), await yi(), await
|
|
1425
|
+
if (await hi(), await pi(), await gi(), ht(!0), await Lt(), await yi(), await _e(), b.get("featureId") && P) {
|
|
1426
1426
|
const { data: n } = await In(b.get("featureId"));
|
|
1427
1427
|
if (n != null && n.permissions) {
|
|
1428
1428
|
const i = Ot(
|
|
@@ -1436,15 +1436,15 @@ function Jr() {
|
|
|
1436
1436
|
...u,
|
|
1437
1437
|
permissions: St(u.permissions)
|
|
1438
1438
|
}));
|
|
1439
|
-
|
|
1439
|
+
We(o);
|
|
1440
1440
|
}
|
|
1441
|
-
|
|
1441
|
+
$e(i);
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
1444
|
})();
|
|
1445
|
-
}, []),
|
|
1446
|
-
if (
|
|
1447
|
-
const e = a.getValues("updatedFields") || [], n = e == null ? void 0 : e.reduce((r, o) => (r[o.name] = o.enabled, r), {}), i =
|
|
1445
|
+
}, []), ae(() => {
|
|
1446
|
+
if (Le != null && Le.userMenuItemDtos) {
|
|
1447
|
+
const e = a.getValues("updatedFields") || [], n = e == null ? void 0 : e.reduce((r, o) => (r[o.name] = o.enabled, r), {}), i = Le.userMenuItemDtos.map((r) => {
|
|
1448
1448
|
let o = {};
|
|
1449
1449
|
try {
|
|
1450
1450
|
o = r.featureJson ? JSON.parse(r.featureJson) : {};
|
|
@@ -1460,9 +1460,9 @@ function Jr() {
|
|
|
1460
1460
|
featureJson: JSON.stringify(u)
|
|
1461
1461
|
};
|
|
1462
1462
|
});
|
|
1463
|
-
|
|
1463
|
+
ze(i);
|
|
1464
1464
|
}
|
|
1465
|
-
}, [
|
|
1465
|
+
}, [Le]), ae(() => {
|
|
1466
1466
|
try {
|
|
1467
1467
|
const e = b.get("featureId");
|
|
1468
1468
|
if (b.get("featureType") && e) {
|
|
@@ -1475,59 +1475,59 @@ function Jr() {
|
|
|
1475
1475
|
o.permissions
|
|
1476
1476
|
);
|
|
1477
1477
|
if (((r = o == null ? void 0 : o.userMenuItemDtos) == null ? void 0 : r.length) > 0) {
|
|
1478
|
-
const
|
|
1478
|
+
const h = Ut(
|
|
1479
1479
|
u,
|
|
1480
1480
|
o.userMenuItemDtos
|
|
1481
|
-
).map((
|
|
1482
|
-
...
|
|
1483
|
-
permissions: St(
|
|
1481
|
+
).map((y) => ({
|
|
1482
|
+
...y,
|
|
1483
|
+
permissions: St(y.permissions)
|
|
1484
1484
|
}));
|
|
1485
|
-
|
|
1485
|
+
We(h);
|
|
1486
1486
|
}
|
|
1487
|
-
|
|
1487
|
+
$e(u);
|
|
1488
1488
|
}
|
|
1489
1489
|
Dt((u) => ({ ...u, value: !0, length: 0 }));
|
|
1490
1490
|
} else {
|
|
1491
1491
|
const { data: o } = await ur(e);
|
|
1492
1492
|
Mn(o), await zt();
|
|
1493
|
-
const u = JSON.parse(o.featureJson || "{}"), d = Object.keys(u).map((
|
|
1494
|
-
id:
|
|
1495
|
-
value:
|
|
1496
|
-
checkbox: u[
|
|
1493
|
+
const u = JSON.parse(o.featureJson || "{}"), d = Object.keys(u).map((h, y) => ({
|
|
1494
|
+
id: y + 1,
|
|
1495
|
+
value: h,
|
|
1496
|
+
checkbox: u[h],
|
|
1497
1497
|
updated: !0
|
|
1498
1498
|
}));
|
|
1499
|
-
a.setValue("updatedFields", d),
|
|
1499
|
+
a.setValue("updatedFields", d), at(d.length > 0), d.length > 0 && Vt(!0), Dt((h) => ({ ...h, value: !0, length: u.length || 0 })), Jn(o == null ? void 0 : o.isSeparateFeature);
|
|
1500
1500
|
}
|
|
1501
1501
|
};
|
|
1502
1502
|
Ct(), i();
|
|
1503
1503
|
}
|
|
1504
1504
|
} catch (e) {
|
|
1505
|
-
|
|
1505
|
+
me({
|
|
1506
1506
|
type: "error",
|
|
1507
1507
|
message: `error :${e == null ? void 0 : e.message}`
|
|
1508
1508
|
});
|
|
1509
1509
|
}
|
|
1510
|
-
}, [b, a.setValue,
|
|
1510
|
+
}, [b, a.setValue, ve, j]);
|
|
1511
1511
|
const Ot = (e) => {
|
|
1512
1512
|
const n = a.getValues("menuType"), i = a.getValues("featureConstant"), r = (d) => d.trim().toLowerCase().split(/\s+/).map(
|
|
1513
|
-
(
|
|
1513
|
+
(h, y) => y === 0 ? h : h.charAt(0).toUpperCase() + h.slice(1)
|
|
1514
1514
|
).join("");
|
|
1515
1515
|
let o;
|
|
1516
|
-
if (!
|
|
1516
|
+
if (!P || (i == null ? void 0 : i.length) === 0) {
|
|
1517
1517
|
const d = a.getValues("menuName");
|
|
1518
1518
|
o = `view.${n}.${r(d)}`;
|
|
1519
1519
|
} else
|
|
1520
1520
|
o = `view.${n}.${i}`;
|
|
1521
1521
|
const u = (d) => {
|
|
1522
|
-
const
|
|
1522
|
+
const h = d.id === o;
|
|
1523
1523
|
return {
|
|
1524
1524
|
permissionId: d.id,
|
|
1525
1525
|
permissionType: { type: d.type },
|
|
1526
1526
|
permissionName: d.name,
|
|
1527
1527
|
permissionDesc: d.desc || "",
|
|
1528
1528
|
enabled: d.is_active,
|
|
1529
|
-
isDefault:
|
|
1530
|
-
childPermissions: d.child ? d.child.map((
|
|
1529
|
+
isDefault: h,
|
|
1530
|
+
childPermissions: d.child ? d.child.map((y) => u(y)) : [],
|
|
1531
1531
|
urlType: (d == null ? void 0 : d.httpMethod) || "",
|
|
1532
1532
|
backendUrl: (d == null ? void 0 : d.url) || "",
|
|
1533
1533
|
queryCodeRequired: !(d != null && d.url),
|
|
@@ -1538,15 +1538,15 @@ function Jr() {
|
|
|
1538
1538
|
}, Ut = (e, n) => {
|
|
1539
1539
|
if (!Array.isArray(n)) return [];
|
|
1540
1540
|
const i = (r, o) => {
|
|
1541
|
-
var
|
|
1542
|
-
const u = ((
|
|
1541
|
+
var y;
|
|
1542
|
+
const u = ((y = r.childPermissions) == null ? void 0 : y.map(
|
|
1543
1543
|
(F) => i(F, o)
|
|
1544
|
-
)) || [], d = u.some((F) => F.enabled),
|
|
1545
|
-
return { ...r, enabled:
|
|
1544
|
+
)) || [], d = u.some((F) => F.enabled), h = o.includes(r.permissionId) || d;
|
|
1545
|
+
return { ...r, enabled: h, childPermissions: u };
|
|
1546
1546
|
};
|
|
1547
1547
|
return n.map((r) => {
|
|
1548
|
-
var
|
|
1549
|
-
const o = ((
|
|
1548
|
+
var y, F, k, ue, X, se, oe;
|
|
1549
|
+
const o = ((y = r.permissions) == null ? void 0 : y.map((Nt) => Nt.id)) || [], u = !!r.roleName || !!r.designationId || !!r.roleId, d = !!r.userId || !!r.fullName, h = e.map(
|
|
1550
1550
|
(Nt) => i(Nt, o)
|
|
1551
1551
|
);
|
|
1552
1552
|
return {
|
|
@@ -1555,9 +1555,9 @@ function Jr() {
|
|
|
1555
1555
|
role_id: u && (r.designationId || r.roleId) || null,
|
|
1556
1556
|
name: d ? r.fullName || "" : r.roleName || "",
|
|
1557
1557
|
startDate: ((k = (F = r.permissions) == null ? void 0 : F[0]) == null ? void 0 : k.startDate) || null,
|
|
1558
|
-
endDate: ((
|
|
1559
|
-
isBackendOnly: ((
|
|
1560
|
-
permissions:
|
|
1558
|
+
endDate: ((X = (ue = r.permissions) == null ? void 0 : ue[0]) == null ? void 0 : X.endDate) || null,
|
|
1559
|
+
isBackendOnly: ((oe = (se = r.permissions) == null ? void 0 : se[0]) == null ? void 0 : oe.isBackendOnly) || !1,
|
|
1560
|
+
permissions: h
|
|
1561
1561
|
};
|
|
1562
1562
|
});
|
|
1563
1563
|
}, St = (e) => {
|
|
@@ -1566,15 +1566,15 @@ function Jr() {
|
|
|
1566
1566
|
let r = [];
|
|
1567
1567
|
if ((o = i.childPermissions) != null && o.length) {
|
|
1568
1568
|
r = i.childPermissions.map(n);
|
|
1569
|
-
const d = r.every((
|
|
1569
|
+
const d = r.every((h) => h.enabled);
|
|
1570
1570
|
i.enabled = i.enabled || d;
|
|
1571
1571
|
}
|
|
1572
1572
|
return i.enabled && ((u = i.childPermissions) != null && u.length) && (r = r.map((d) => {
|
|
1573
|
-
var
|
|
1573
|
+
var h;
|
|
1574
1574
|
return {
|
|
1575
1575
|
...d,
|
|
1576
1576
|
enabled: !0,
|
|
1577
|
-
childPermissions: (
|
|
1577
|
+
childPermissions: (h = d.childPermissions) != null && h.length ? St(d.childPermissions) : []
|
|
1578
1578
|
};
|
|
1579
1579
|
})), {
|
|
1580
1580
|
...i,
|
|
@@ -1585,19 +1585,19 @@ function Jr() {
|
|
|
1585
1585
|
}, li = (e, n) => {
|
|
1586
1586
|
const i = /* @__PURE__ */ new Map(), r = (u) => {
|
|
1587
1587
|
u.forEach((d) => {
|
|
1588
|
-
var
|
|
1589
|
-
i.set(d.permissionId, d), (
|
|
1588
|
+
var h;
|
|
1589
|
+
i.set(d.permissionId, d), (h = d.childPermissions) != null && h.length && r(d.childPermissions);
|
|
1590
1590
|
});
|
|
1591
1591
|
};
|
|
1592
1592
|
r(e);
|
|
1593
|
-
const o = (u, d) => u.map((
|
|
1594
|
-
const
|
|
1595
|
-
|
|
1596
|
-
|
|
1593
|
+
const o = (u, d) => u.map((h) => {
|
|
1594
|
+
const y = (d == null ? void 0 : d.find((k) => k.permissionId === h.permissionId)) || {}, F = o(
|
|
1595
|
+
h.childPermissions || [],
|
|
1596
|
+
y.childPermissions || []
|
|
1597
1597
|
);
|
|
1598
1598
|
return {
|
|
1599
|
-
...
|
|
1600
|
-
enabled:
|
|
1599
|
+
...h,
|
|
1600
|
+
enabled: y.enabled ?? h.enabled,
|
|
1601
1601
|
childPermissions: F
|
|
1602
1602
|
};
|
|
1603
1603
|
});
|
|
@@ -1607,7 +1607,7 @@ function Jr() {
|
|
|
1607
1607
|
}));
|
|
1608
1608
|
}, di = async () => {
|
|
1609
1609
|
try {
|
|
1610
|
-
const e = (await
|
|
1610
|
+
const e = (await G({
|
|
1611
1611
|
code: "RETREIVE_DYNAMIC_FEATURE_INFO",
|
|
1612
1612
|
parameters: {
|
|
1613
1613
|
id: parseInt(b.get("featureId")),
|
|
@@ -1623,7 +1623,7 @@ function Jr() {
|
|
|
1623
1623
|
return {};
|
|
1624
1624
|
}
|
|
1625
1625
|
})(), o = ((i == null ? void 0 : i.mobile_entities_sync) ?? []).map(
|
|
1626
|
-
(
|
|
1626
|
+
(h) => Z == null ? void 0 : Z.find((y) => y.tableName === h)
|
|
1627
1627
|
).filter(Boolean);
|
|
1628
1628
|
a.reset({
|
|
1629
1629
|
menuName: n.menuName ? n.menuName : "",
|
|
@@ -1646,19 +1646,19 @@ function Jr() {
|
|
|
1646
1646
|
notificationBadgeEnabled: (i == null ? void 0 : i.notification_badge_enabled) ?? !1,
|
|
1647
1647
|
notificationBadgeType: (i == null ? void 0 : i.notification_badge_type) ?? "",
|
|
1648
1648
|
notificationBadgeQuery: (i == null ? void 0 : i.notification_badge_query) ?? ""
|
|
1649
|
-
}),
|
|
1649
|
+
}), re(o), n.isMobileFeature && W(!0);
|
|
1650
1650
|
const u = (i == null ? void 0 : i.training_query) ?? "", d = (i == null ? void 0 : i.notification_badge_query) ?? "";
|
|
1651
|
-
u && (
|
|
1651
|
+
u && (je(u), _e(u)), d && (Ge(d), _e(d)), n.formCode && (ye(n.formCode), Pe(n.formCode)), Ct(), Ke(!0);
|
|
1652
1652
|
}
|
|
1653
1653
|
} catch (e) {
|
|
1654
|
-
|
|
1654
|
+
me({
|
|
1655
1655
|
message: e.message,
|
|
1656
1656
|
type: "error"
|
|
1657
1657
|
});
|
|
1658
1658
|
}
|
|
1659
1659
|
}, zt = async () => {
|
|
1660
1660
|
try {
|
|
1661
|
-
const e = (await
|
|
1661
|
+
const e = (await G({
|
|
1662
1662
|
code: "RETREIVE_DYNAMIC_FEATURE_INFO",
|
|
1663
1663
|
parameters: {
|
|
1664
1664
|
id: parseInt(b.get("featureId")),
|
|
@@ -1673,14 +1673,14 @@ function Jr() {
|
|
|
1673
1673
|
} catch {
|
|
1674
1674
|
return {};
|
|
1675
1675
|
}
|
|
1676
|
-
})(), r = (
|
|
1676
|
+
})(), r = (y, F = null) => {
|
|
1677
1677
|
try {
|
|
1678
|
-
return !
|
|
1678
|
+
return !y || typeof y != "string" ? F : JSON.parse(y);
|
|
1679
1679
|
} catch {
|
|
1680
1680
|
return F;
|
|
1681
1681
|
}
|
|
1682
1682
|
}, u = ((i == null ? void 0 : i.mobile_entities_sync) ?? []).map(
|
|
1683
|
-
(
|
|
1683
|
+
(y) => Z == null ? void 0 : Z.find((F) => F.tableName === y)
|
|
1684
1684
|
).filter(Boolean);
|
|
1685
1685
|
a.setValue("menuName", n.menuName ? n.menuName : ""), a.setValue(
|
|
1686
1686
|
"navigationState",
|
|
@@ -1712,22 +1712,22 @@ function Jr() {
|
|
|
1712
1712
|
), a.setValue(
|
|
1713
1713
|
"notificationBadgeQuery",
|
|
1714
1714
|
(i == null ? void 0 : i.notification_badge_query) ?? ""
|
|
1715
|
-
),
|
|
1716
|
-
const d = (i == null ? void 0 : i.training_query) ?? "",
|
|
1717
|
-
d && (
|
|
1715
|
+
), re(u), n.isMobileFeature && W(!0);
|
|
1716
|
+
const d = (i == null ? void 0 : i.training_query) ?? "", h = (i == null ? void 0 : i.notification_badge_query) ?? "";
|
|
1717
|
+
d && (je(d), _e(d)), h && (Ge(h), _e(h)), Ke(!0);
|
|
1718
1718
|
}
|
|
1719
1719
|
} catch (e) {
|
|
1720
|
-
|
|
1720
|
+
me({
|
|
1721
1721
|
message: e.message,
|
|
1722
1722
|
type: "error"
|
|
1723
1723
|
});
|
|
1724
1724
|
}
|
|
1725
1725
|
}, ci = () => {
|
|
1726
1726
|
const e = a.getValues("menuType") || "menuType", n = a.getValues("featureConstant") || "feature", i = (u) => u.trim().toLowerCase().split(/\s+/).map(
|
|
1727
|
-
(d,
|
|
1727
|
+
(d, h) => h === 0 ? d : d.charAt(0).toUpperCase() + d.slice(1)
|
|
1728
1728
|
).join("");
|
|
1729
1729
|
let r;
|
|
1730
|
-
if (
|
|
1730
|
+
if (P)
|
|
1731
1731
|
r = `view.${e}.${n}`;
|
|
1732
1732
|
else {
|
|
1733
1733
|
const u = a.getValues("menuName");
|
|
@@ -1741,47 +1741,47 @@ function Jr() {
|
|
|
1741
1741
|
enabled: !0,
|
|
1742
1742
|
isDefault: !0,
|
|
1743
1743
|
childPermissions: [],
|
|
1744
|
-
...
|
|
1744
|
+
...P === !1 && {
|
|
1745
1745
|
backendUrl: "",
|
|
1746
1746
|
urlType: "",
|
|
1747
1747
|
queryCode: ""
|
|
1748
1748
|
}
|
|
1749
1749
|
};
|
|
1750
|
-
|
|
1750
|
+
$e([o]);
|
|
1751
1751
|
}, ui = (e) => {
|
|
1752
1752
|
w(e);
|
|
1753
1753
|
}, mi = (e) => {
|
|
1754
1754
|
const n = (e == null ? void 0 : e.map((i) => i == null ? void 0 : i.tableName)) || [];
|
|
1755
|
-
|
|
1755
|
+
re(e), a.setValue("mobileEntitiesSync", n);
|
|
1756
1756
|
}, fi = (e, n) => {
|
|
1757
|
-
|
|
1757
|
+
Fe(n);
|
|
1758
1758
|
};
|
|
1759
|
-
|
|
1759
|
+
ae(() => {
|
|
1760
1760
|
const e = (b == null ? void 0 : b.get("staticOrDynamic")) === "STATIC";
|
|
1761
|
-
|
|
1762
|
-
}, [
|
|
1761
|
+
ve && j && b.get("featureId") && !e && di();
|
|
1762
|
+
}, [ve, j]);
|
|
1763
1763
|
const hi = async () => {
|
|
1764
|
-
const e = (await
|
|
1764
|
+
const e = (await G({
|
|
1765
1765
|
code: "fetch_menu_groups"
|
|
1766
1766
|
})).data;
|
|
1767
|
-
|
|
1767
|
+
Ze(e.result.map((n) => n.menu_type)), V(e.result);
|
|
1768
1768
|
}, pi = async () => {
|
|
1769
|
-
const e = (await
|
|
1769
|
+
const e = (await G({
|
|
1770
1770
|
code: "mfa_retreive_all_table_names"
|
|
1771
1771
|
})).data;
|
|
1772
|
-
|
|
1772
|
+
de(e.result.map((n) => n.table_name));
|
|
1773
1773
|
}, gi = async () => {
|
|
1774
|
-
const e = (await
|
|
1774
|
+
const e = (await G({
|
|
1775
1775
|
code: "retrieve_synced_tables"
|
|
1776
1776
|
})).data;
|
|
1777
|
-
|
|
1777
|
+
z(e == null ? void 0 : e.result);
|
|
1778
1778
|
}, Lt = async () => {
|
|
1779
|
-
const e = (await
|
|
1779
|
+
const e = (await G({
|
|
1780
1780
|
code: "mfa_retrieve_separate_feature_forms"
|
|
1781
1781
|
})).data;
|
|
1782
1782
|
if (e.result) {
|
|
1783
1783
|
let n = e.result;
|
|
1784
|
-
|
|
1784
|
+
Q(n);
|
|
1785
1785
|
let i = {};
|
|
1786
1786
|
return n.forEach((r) => {
|
|
1787
1787
|
try {
|
|
@@ -1790,25 +1790,25 @@ function Jr() {
|
|
|
1790
1790
|
} catch (o) {
|
|
1791
1791
|
console.error("Invalid JSON in form.versions:", r.versions, o), i[r.form_code] = [];
|
|
1792
1792
|
}
|
|
1793
|
-
}),
|
|
1793
|
+
}), pe(i), i;
|
|
1794
1794
|
}
|
|
1795
1795
|
}, yi = async () => {
|
|
1796
1796
|
try {
|
|
1797
|
-
const { data: e } = await
|
|
1797
|
+
const { data: e } = await G({
|
|
1798
1798
|
code: "user_search_for_selectize",
|
|
1799
1799
|
parameters: {
|
|
1800
1800
|
searchString: ""
|
|
1801
1801
|
}
|
|
1802
1802
|
});
|
|
1803
|
-
|
|
1803
|
+
Oe(e == null ? void 0 : e.result);
|
|
1804
1804
|
const n = await $i();
|
|
1805
|
-
|
|
1805
|
+
p(n.data);
|
|
1806
1806
|
} catch (e) {
|
|
1807
1807
|
console.error("Error fetching users or roles:", e);
|
|
1808
1808
|
}
|
|
1809
|
-
},
|
|
1809
|
+
}, _e = async (e = "") => {
|
|
1810
1810
|
try {
|
|
1811
|
-
const n = (await
|
|
1811
|
+
const n = (await G({
|
|
1812
1812
|
code: "GET_ALL_QUERY_CODE",
|
|
1813
1813
|
parameters: { search: e }
|
|
1814
1814
|
})).data;
|
|
@@ -1816,28 +1816,28 @@ function Jr() {
|
|
|
1816
1816
|
} catch (n) {
|
|
1817
1817
|
console.error("Error fetching query codes:", n);
|
|
1818
1818
|
}
|
|
1819
|
-
}, $t = () => a.getValues("isMobileFeature") && a.getValues("isWebFeature") ?
|
|
1819
|
+
}, $t = () => a.getValues("isMobileFeature") && a.getValues("isWebFeature") ? be : be.filter((e) => {
|
|
1820
1820
|
const { roleType: n } = e;
|
|
1821
1821
|
return !!(n === null || a.getValues("isMobileFeature") && (n === "MOBILE" || n === "BOTH") || a.getValues("isWebFeature") && (n === "WEB" || n === "BOTH"));
|
|
1822
1822
|
});
|
|
1823
|
-
|
|
1824
|
-
if (!(
|
|
1825
|
-
const e =
|
|
1823
|
+
ae(() => {
|
|
1824
|
+
if (!(be != null && be.length)) return;
|
|
1825
|
+
const e = Ue.filter((n) => {
|
|
1826
1826
|
if (!n.roleName) return !0;
|
|
1827
|
-
const i =
|
|
1827
|
+
const i = be.find((o) => o.name === n.roleName);
|
|
1828
1828
|
if (!i) return !0;
|
|
1829
1829
|
const { roleType: r } = i;
|
|
1830
1830
|
return !(!Wt && r === "MOBILE" || !qt && r === "WEB");
|
|
1831
1831
|
});
|
|
1832
|
-
|
|
1833
|
-
}, [Wt, qt,
|
|
1832
|
+
ze(e);
|
|
1833
|
+
}, [Wt, qt, be]);
|
|
1834
1834
|
const bi = (e) => {
|
|
1835
1835
|
const { firstName: n, lastName: i, userName: r } = e;
|
|
1836
1836
|
return !n && !i && !r ? "" : n && !i && !r ? n : `${n} ${i} (${r})`;
|
|
1837
1837
|
}, Ct = () => {
|
|
1838
|
-
|
|
1838
|
+
ie(() => {
|
|
1839
1839
|
const e = a.getValues("menuType") ? JSON.parse(
|
|
1840
|
-
|
|
1840
|
+
j == null ? void 0 : j.find(
|
|
1841
1841
|
(i) => i.menu_type === a.getValues("menuType")
|
|
1842
1842
|
).groupNames
|
|
1843
1843
|
) : null, n = e == null ? void 0 : e.filter((i) => i.id !== null);
|
|
@@ -1846,15 +1846,15 @@ function Jr() {
|
|
|
1846
1846
|
}, xi = (e) => {
|
|
1847
1847
|
a.setValue("menuGroup", e.target.value);
|
|
1848
1848
|
}, Si = (e) => {
|
|
1849
|
-
e.target.checked ?
|
|
1849
|
+
e.target.checked ? W(!0) : (W(!1), a.setValue("entityName", null), a.setValue("icon", null), a.setValue("mobileEntitiesSync", null), a.setValue("conditions", null), a.setValue("mobileMode", null));
|
|
1850
1850
|
}, Ci = (e) => {
|
|
1851
1851
|
e.target.checked || (a.setValue("formCode", null), a.setValue("version", null));
|
|
1852
1852
|
}, Ni = () => {
|
|
1853
|
-
|
|
1853
|
+
tt("add-parent"), nt(null), it(null), rt(null), Qe(!0);
|
|
1854
1854
|
}, ki = (e) => {
|
|
1855
|
-
|
|
1855
|
+
tt("add-child"), nt(e.permissionId), it(null), rt(null), Qe(!0);
|
|
1856
1856
|
}, Ii = (e) => {
|
|
1857
|
-
|
|
1857
|
+
tt("edit"), nt(null), it(e), rt(e.permissionId), Qe(!0);
|
|
1858
1858
|
}, Qt = (e, n, i) => e.map((r) => r.permissionId === n ? {
|
|
1859
1859
|
...r,
|
|
1860
1860
|
childPermissions: [...r.childPermissions || [], i]
|
|
@@ -1882,17 +1882,17 @@ function Jr() {
|
|
|
1882
1882
|
n
|
|
1883
1883
|
)
|
|
1884
1884
|
})), wi = (e) => {
|
|
1885
|
-
|
|
1885
|
+
$e((n) => {
|
|
1886
1886
|
let i = [...n];
|
|
1887
|
-
if (
|
|
1887
|
+
if (Je === "add-parent")
|
|
1888
1888
|
i = [...n, e];
|
|
1889
|
-
else if (
|
|
1890
|
-
const r = (d,
|
|
1891
|
-
var
|
|
1889
|
+
else if (Je === "add-child") {
|
|
1890
|
+
const r = (d, h) => {
|
|
1891
|
+
var y;
|
|
1892
1892
|
for (const F of d) {
|
|
1893
|
-
if (F.permissionId ===
|
|
1894
|
-
if ((
|
|
1895
|
-
const k = r(F.childPermissions,
|
|
1893
|
+
if (F.permissionId === h) return F;
|
|
1894
|
+
if ((y = F.childPermissions) != null && y.length) {
|
|
1895
|
+
const k = r(F.childPermissions, h);
|
|
1896
1896
|
if (k) return k;
|
|
1897
1897
|
}
|
|
1898
1898
|
}
|
|
@@ -1906,94 +1906,94 @@ function Jr() {
|
|
|
1906
1906
|
pt,
|
|
1907
1907
|
u
|
|
1908
1908
|
);
|
|
1909
|
-
} else
|
|
1909
|
+
} else Je === "edit" && (i = Jt(
|
|
1910
1910
|
n,
|
|
1911
1911
|
Un,
|
|
1912
1912
|
e
|
|
1913
1913
|
));
|
|
1914
1914
|
return i;
|
|
1915
|
-
}),
|
|
1915
|
+
}), Qe(!1), tt("add-parent"), nt(null), it(null), rt(null);
|
|
1916
1916
|
}, vi = (e) => {
|
|
1917
1917
|
const n = typeof e == "string" ? e : e.permissionId;
|
|
1918
|
-
|
|
1918
|
+
$e((i) => jt(i, n));
|
|
1919
1919
|
};
|
|
1920
|
-
|
|
1921
|
-
a.setValue("additionalPermissions",
|
|
1922
|
-
}, [
|
|
1923
|
-
const
|
|
1920
|
+
ae(() => {
|
|
1921
|
+
a.setValue("additionalPermissions", ce);
|
|
1922
|
+
}, [ce, a]);
|
|
1923
|
+
const st = (e, n = null) => {
|
|
1924
1924
|
let i = [];
|
|
1925
1925
|
return e.forEach((r) => {
|
|
1926
1926
|
const {
|
|
1927
1927
|
permissionId: o,
|
|
1928
1928
|
permissionType: u,
|
|
1929
1929
|
permissionName: d,
|
|
1930
|
-
permissionDesc:
|
|
1931
|
-
enabled:
|
|
1930
|
+
permissionDesc: h,
|
|
1931
|
+
enabled: y,
|
|
1932
1932
|
backendUrl: F,
|
|
1933
1933
|
urlType: k,
|
|
1934
|
-
queryCode:
|
|
1934
|
+
queryCode: ue
|
|
1935
1935
|
} = r;
|
|
1936
1936
|
i.push({
|
|
1937
1937
|
permissionId: o,
|
|
1938
1938
|
permissionType: u == null ? void 0 : u.type,
|
|
1939
1939
|
permissionName: d,
|
|
1940
|
-
permissionDesc:
|
|
1940
|
+
permissionDesc: h,
|
|
1941
1941
|
parentPermissionId: n,
|
|
1942
|
-
enabled:
|
|
1942
|
+
enabled: y,
|
|
1943
1943
|
backendUrl: F,
|
|
1944
1944
|
urlType: k,
|
|
1945
|
-
queryCode:
|
|
1945
|
+
queryCode: ue
|
|
1946
1946
|
}), r.childPermissions && r.childPermissions.length > 0 && (i = i.concat(
|
|
1947
|
-
|
|
1947
|
+
st(r.childPermissions, o)
|
|
1948
1948
|
));
|
|
1949
1949
|
}), i;
|
|
1950
1950
|
}, Fi = () => {
|
|
1951
1951
|
(async () => {
|
|
1952
1952
|
let e = await Lt();
|
|
1953
|
-
|
|
1953
|
+
pe(e), ye(a.getValues("formCode"));
|
|
1954
1954
|
})();
|
|
1955
1955
|
}, Gt = JSON.stringify(
|
|
1956
|
-
(nn =
|
|
1956
|
+
(nn = K.value ? a.getValues("updatedFields") : a.getValues("fields")) == null ? void 0 : nn.reduce((e, n) => {
|
|
1957
1957
|
var i;
|
|
1958
1958
|
return (i = n.value) != null && i.trim() && (e[n.value.trim()] = n.checkbox), e;
|
|
1959
1959
|
}, {})
|
|
1960
1960
|
), Ti = () => {
|
|
1961
|
-
if (!
|
|
1961
|
+
if (!P && (l == null ? void 0 : l.val) === !1)
|
|
1962
1962
|
try {
|
|
1963
1963
|
const e = [];
|
|
1964
|
-
|
|
1964
|
+
_ != null && _.id && e.push({
|
|
1965
1965
|
designationId: null,
|
|
1966
|
-
userId:
|
|
1967
|
-
fullName: `${
|
|
1966
|
+
userId: _.id,
|
|
1967
|
+
fullName: `${_.firstName || ""} ${_.lastName || ""}`.trim(),
|
|
1968
1968
|
featureJson: Gt
|
|
1969
|
-
}), (
|
|
1970
|
-
...
|
|
1969
|
+
}), (g == null ? void 0 : g.length) > 0 && e.push(
|
|
1970
|
+
...g.map((n) => ({
|
|
1971
1971
|
designationId: n.id,
|
|
1972
1972
|
roleName: n.name,
|
|
1973
1973
|
featureJson: Gt
|
|
1974
1974
|
}))
|
|
1975
|
-
),
|
|
1975
|
+
), ze((n) => [...n, ...e]), me({
|
|
1976
1976
|
message: "Menu item added successfully",
|
|
1977
1977
|
type: "success"
|
|
1978
|
-
}), w([]),
|
|
1978
|
+
}), w([]), Fe({});
|
|
1979
1979
|
} catch (e) {
|
|
1980
|
-
console.error(e),
|
|
1980
|
+
console.error(e), me({
|
|
1981
1981
|
message: "Cannot add menu item",
|
|
1982
1982
|
type: "error"
|
|
1983
1983
|
});
|
|
1984
1984
|
}
|
|
1985
1985
|
else {
|
|
1986
1986
|
const e = [];
|
|
1987
|
-
if (
|
|
1987
|
+
if (_ != null && _.id && e.push({
|
|
1988
1988
|
type: "user",
|
|
1989
|
-
id:
|
|
1990
|
-
name:
|
|
1991
|
-
}),
|
|
1989
|
+
id: _.id,
|
|
1990
|
+
name: _.firstName + " " + _.lastName
|
|
1991
|
+
}), g.length > 0 && e.push({
|
|
1992
1992
|
type: "role",
|
|
1993
|
-
ids:
|
|
1994
|
-
names:
|
|
1993
|
+
ids: g.map((n) => n.id),
|
|
1994
|
+
names: g.map((n) => n.name)
|
|
1995
1995
|
}), e.length === 0) return;
|
|
1996
|
-
$n(e), gt(!0),
|
|
1996
|
+
$n(e), gt(!0), Fe(null), w([]);
|
|
1997
1997
|
}
|
|
1998
1998
|
}, Ht = (e) => {
|
|
1999
1999
|
const n = [], i = (r, o) => {
|
|
@@ -2011,7 +2011,7 @@ function Jr() {
|
|
|
2011
2011
|
i(r.permissions || [], r);
|
|
2012
2012
|
return n;
|
|
2013
2013
|
}, _i = (e, n) => {
|
|
2014
|
-
|
|
2014
|
+
We((i) => {
|
|
2015
2015
|
const r = [...i];
|
|
2016
2016
|
return r[e] = {
|
|
2017
2017
|
...r[e],
|
|
@@ -2031,15 +2031,15 @@ function Jr() {
|
|
|
2031
2031
|
childPermissions: (u = o.childPermissions) != null && u.length ? Kt(o.childPermissions, i) : []
|
|
2032
2032
|
};
|
|
2033
2033
|
if ((d = o.childPermissions) != null && d.length) {
|
|
2034
|
-
const
|
|
2034
|
+
const h = Yt(
|
|
2035
2035
|
o.childPermissions,
|
|
2036
2036
|
n,
|
|
2037
2037
|
i
|
|
2038
|
-
),
|
|
2038
|
+
), y = h.length > 0 && h.every((F) => F.enabled === !0);
|
|
2039
2039
|
return {
|
|
2040
2040
|
...o,
|
|
2041
|
-
enabled:
|
|
2042
|
-
childPermissions:
|
|
2041
|
+
enabled: y,
|
|
2042
|
+
childPermissions: h
|
|
2043
2043
|
};
|
|
2044
2044
|
}
|
|
2045
2045
|
return o;
|
|
@@ -2051,7 +2051,7 @@ function Jr() {
|
|
|
2051
2051
|
childPermissions: (r = i.childPermissions) != null && r.length ? Kt(i.childPermissions, n) : []
|
|
2052
2052
|
};
|
|
2053
2053
|
}), Vi = async (e) => {
|
|
2054
|
-
(await
|
|
2054
|
+
(await G({
|
|
2055
2055
|
code: "check_unique_feature_constant",
|
|
2056
2056
|
parameters: {
|
|
2057
2057
|
featureConstant: e
|
|
@@ -2059,9 +2059,9 @@ function Jr() {
|
|
|
2059
2059
|
})).data.result[0].exists ? a.setError("featureConstant", {
|
|
2060
2060
|
type: "manual",
|
|
2061
2061
|
message: "Feature constant already exists"
|
|
2062
|
-
}) :
|
|
2062
|
+
}) : B(`${e} Feature constant is available`);
|
|
2063
2063
|
}, Ei = async (e) => {
|
|
2064
|
-
(await
|
|
2064
|
+
(await G({
|
|
2065
2065
|
code: "CHECK_UNIQUE_NAVIGATION_STATE",
|
|
2066
2066
|
parameters: {
|
|
2067
2067
|
featureState: e
|
|
@@ -2069,13 +2069,13 @@ function Jr() {
|
|
|
2069
2069
|
})).data.result[0].exists ? a.setError("navigationState", {
|
|
2070
2070
|
type: "manual",
|
|
2071
2071
|
message: "Feature State already exists"
|
|
2072
|
-
}) :
|
|
2072
|
+
}) : B(`${e} Feature State is available`);
|
|
2073
2073
|
}, Di = fn(Vi, 500), Pi = fn(
|
|
2074
2074
|
Ei,
|
|
2075
2075
|
500
|
|
2076
2076
|
), Zt = Gi(
|
|
2077
2077
|
async (e, n, i) => {
|
|
2078
|
-
const { data: r } = await
|
|
2078
|
+
const { data: r } = await G({
|
|
2079
2079
|
code: "user_search_for_selectize",
|
|
2080
2080
|
parameters: {
|
|
2081
2081
|
searchString: e
|
|
@@ -2085,15 +2085,15 @@ function Jr() {
|
|
|
2085
2085
|
},
|
|
2086
2086
|
500
|
|
2087
2087
|
), Ai = async (e) => {
|
|
2088
|
-
const n =
|
|
2088
|
+
const n = st(ce);
|
|
2089
2089
|
let i = {
|
|
2090
2090
|
code: "insert_dynamic_feature_into_menu_config",
|
|
2091
2091
|
parameters: {
|
|
2092
2092
|
menuName: e.menuName ? e.menuName : null,
|
|
2093
2093
|
featureConstant: e.featureConstant ? e.featureConstant : null,
|
|
2094
2094
|
formCode: e.formCode && e.formCode !== "" ? e.formCode : null,
|
|
2095
|
-
prevFormCode:
|
|
2096
|
-
deLinkPrevForm:
|
|
2095
|
+
prevFormCode: we || null,
|
|
2096
|
+
deLinkPrevForm: we !== e.formCode,
|
|
2097
2097
|
menuType: e.menuType ? e.menuType : null,
|
|
2098
2098
|
menuGroup: e.menuGroup ? parseInt(e.menuGroup) : null,
|
|
2099
2099
|
navigationState: e.navigationState && e.formCode && e.formCode !== "" ? e.navigationState : null,
|
|
@@ -2116,7 +2116,7 @@ function Jr() {
|
|
|
2116
2116
|
}
|
|
2117
2117
|
};
|
|
2118
2118
|
try {
|
|
2119
|
-
if (await
|
|
2119
|
+
if (await G(i)) {
|
|
2120
2120
|
let o = [];
|
|
2121
2121
|
e.menuName && e.menuName.length > 0 && o.push({
|
|
2122
2122
|
code: "medplat_form_insert_into_translation_master",
|
|
@@ -2127,20 +2127,20 @@ function Jr() {
|
|
|
2127
2127
|
},
|
|
2128
2128
|
sequence: 1
|
|
2129
2129
|
}), o.length > 0 && await Ft(o);
|
|
2130
|
-
const u = Ht(
|
|
2131
|
-
u && await
|
|
2130
|
+
const u = Ht(Ne);
|
|
2131
|
+
u && await G({
|
|
2132
2132
|
code: "GRANT_PERMISSION_USER_MAP",
|
|
2133
2133
|
parameters: {
|
|
2134
2134
|
permissionUserMap: JSON.stringify(u)
|
|
2135
2135
|
}
|
|
2136
2136
|
});
|
|
2137
2137
|
}
|
|
2138
|
-
|
|
2138
|
+
me({
|
|
2139
2139
|
message: b.get("featureId") ? "Feature updated successfully" : "New Dynamic feature created successfully!",
|
|
2140
2140
|
type: "success"
|
|
2141
|
-
}),
|
|
2141
|
+
}), Xe(!0);
|
|
2142
2142
|
} catch (r) {
|
|
2143
|
-
|
|
2143
|
+
me({
|
|
2144
2144
|
message: r.message,
|
|
2145
2145
|
type: "error"
|
|
2146
2146
|
});
|
|
@@ -2148,13 +2148,13 @@ function Jr() {
|
|
|
2148
2148
|
}, Wi = async (e) => {
|
|
2149
2149
|
var n, i, r, o;
|
|
2150
2150
|
try {
|
|
2151
|
-
let u = null, d = null,
|
|
2152
|
-
const
|
|
2151
|
+
let u = null, d = null, h = null;
|
|
2152
|
+
const y = hn();
|
|
2153
2153
|
(n = e == null ? void 0 : e.menuGroup) != null && n.length && (u = hn());
|
|
2154
|
-
const F =
|
|
2154
|
+
const F = st(ce), k = {
|
|
2155
2155
|
code: "insert_menu_config",
|
|
2156
2156
|
parameters: {
|
|
2157
|
-
UUID:
|
|
2157
|
+
UUID: y,
|
|
2158
2158
|
featureJson: null,
|
|
2159
2159
|
menuGroup: e.menuGroup ? parseInt(e.menuGroup) : null,
|
|
2160
2160
|
groupUUID: u,
|
|
@@ -2162,7 +2162,7 @@ function Jr() {
|
|
|
2162
2162
|
menuType: e.menuType ? e.menuType : null,
|
|
2163
2163
|
navigationState: e.navigationState ? e.navigationState : null,
|
|
2164
2164
|
subgroupId: d,
|
|
2165
|
-
subgroupUUID:
|
|
2165
|
+
subgroupUUID: h,
|
|
2166
2166
|
isMobileFeature: e != null && e.isMobileFeature ? e == null ? void 0 : e.isMobileFeature : null,
|
|
2167
2167
|
isWebFeature: e != null && e.isWebFeature ? e == null ? void 0 : e.isWebFeature : null,
|
|
2168
2168
|
permissions: JSON.stringify(F),
|
|
@@ -2181,21 +2181,21 @@ function Jr() {
|
|
|
2181
2181
|
})
|
|
2182
2182
|
}
|
|
2183
2183
|
};
|
|
2184
|
-
if (
|
|
2184
|
+
if (K.value && (l == null ? void 0 : l.val) === !1) {
|
|
2185
2185
|
k.code = "update_menu_config";
|
|
2186
|
-
const { fields:
|
|
2187
|
-
a.setValue("featureJson",
|
|
2186
|
+
const { fields: X, updatedFields: se } = e, oe = K.value && Te ? en(se) : (i = X[0]) != null && i.value && Te ? en(X) : {};
|
|
2187
|
+
a.setValue("featureJson", oe), delete k.parameters.UUID, delete k.parameters.groupUUID, delete k.parameters.subgroupUUID, delete k.parameters.permissions, delete k.parameters.isNewFeature, k.parameters.featureType = b.get("featureType"), k.parameters.featureId = b.get("featureId"), k.parameters.featureJson = oe;
|
|
2188
2188
|
}
|
|
2189
|
-
let
|
|
2190
|
-
if (
|
|
2191
|
-
const { data:
|
|
2192
|
-
|
|
2189
|
+
let ue;
|
|
2190
|
+
if (K.value && (l == null ? void 0 : l.val) === !1) {
|
|
2191
|
+
const { data: X } = await Qi(k);
|
|
2192
|
+
ue = X, await mr((r = X == null ? void 0 : X.result[0]) == null ? void 0 : r.id, Ue);
|
|
2193
2193
|
} else {
|
|
2194
|
-
|
|
2195
|
-
const { data:
|
|
2196
|
-
if (
|
|
2197
|
-
let
|
|
2198
|
-
e.menuName && e.menuName.length > 0 &&
|
|
2194
|
+
K.value && (delete k.parameters.UUID, delete k.parameters.groupUUID, delete k.parameters.subgroupUUID, delete k.parameters.isNewFeature, k.parameters.featureType = b.get("featureType"), k.parameters.featureId = b.get("featureId"));
|
|
2195
|
+
const { data: X } = await G(k);
|
|
2196
|
+
if (ue = X, X) {
|
|
2197
|
+
let se = [];
|
|
2198
|
+
e.menuName && e.menuName.length > 0 && se.push({
|
|
2199
2199
|
code: "medplat_form_insert_into_translation_master",
|
|
2200
2200
|
parameters: {
|
|
2201
2201
|
translation_key: e.menuName.replaceAll(" ", ""),
|
|
@@ -2203,49 +2203,49 @@ function Jr() {
|
|
|
2203
2203
|
form_code: "General"
|
|
2204
2204
|
},
|
|
2205
2205
|
sequence: 1
|
|
2206
|
-
}),
|
|
2207
|
-
const
|
|
2208
|
-
|
|
2206
|
+
}), se.length > 0 && await Ft(se);
|
|
2207
|
+
const oe = Ht(Ne);
|
|
2208
|
+
oe && await G({
|
|
2209
2209
|
code: "GRANT_PERMISSION_USER_MAP",
|
|
2210
2210
|
parameters: {
|
|
2211
|
-
permissionUserMap: JSON.stringify(
|
|
2211
|
+
permissionUserMap: JSON.stringify(oe)
|
|
2212
2212
|
}
|
|
2213
2213
|
});
|
|
2214
2214
|
}
|
|
2215
2215
|
}
|
|
2216
|
-
(o =
|
|
2217
|
-
message:
|
|
2216
|
+
(o = ue == null ? void 0 : ue.result) != null && o.length ? me({
|
|
2217
|
+
message: K.value ? "FEATURE EDITED SUCCESFULLY" : "FEATURE ADDED SUCCESFULLY",
|
|
2218
2218
|
type: "success"
|
|
2219
|
-
}) :
|
|
2219
|
+
}) : me({
|
|
2220
2220
|
message: "FEATURE CONFIGURATION ALREADY EXISTS ",
|
|
2221
2221
|
type: "error"
|
|
2222
|
-
}),
|
|
2222
|
+
}), Xe(!0);
|
|
2223
2223
|
} catch (u) {
|
|
2224
|
-
|
|
2224
|
+
me({
|
|
2225
2225
|
message: u.message,
|
|
2226
2226
|
type: "error"
|
|
2227
2227
|
});
|
|
2228
2228
|
}
|
|
2229
2229
|
}, Xt = async (e) => {
|
|
2230
|
-
|
|
2230
|
+
P ? Ai(e) : Wi(e);
|
|
2231
2231
|
}, en = (e) => JSON.stringify(
|
|
2232
2232
|
e == null ? void 0 : e.reduce((n, i) => (n[i.value] = i.checkbox, n), {})
|
|
2233
2233
|
), qi = (e, n) => {
|
|
2234
2234
|
e && e.type === "change" && Ri(n);
|
|
2235
2235
|
}, Ri = rr(
|
|
2236
2236
|
(e) => {
|
|
2237
|
-
Zt(e,
|
|
2237
|
+
Zt(e, Oe, Fe);
|
|
2238
2238
|
},
|
|
2239
2239
|
[Zt]
|
|
2240
2240
|
), Mi = () => {
|
|
2241
|
-
|
|
2241
|
+
at(!Te), Te || (K.value ? a.setValue("updatedFields", [
|
|
2242
2242
|
{ id: 1, value: "", checkbox: !1 }
|
|
2243
2243
|
]) : a.setValue("fields", [{ id: 1, value: "", checkbox: !1 }]));
|
|
2244
2244
|
}, Bi = (e) => {
|
|
2245
|
-
const i = (
|
|
2246
|
-
|
|
2245
|
+
const i = (K.value ? a.getValues("updatedFields") : a.getValues("fields")).map((r) => r.id === e ? { ...r, checkbox: !r.checkbox } : r);
|
|
2246
|
+
K.value ? a.setValue("updatedFields", i) : a.setValue("fields", i);
|
|
2247
2247
|
}, Oi = () => {
|
|
2248
|
-
const e =
|
|
2248
|
+
const e = K.value ? a.getValues("updatedFields") : a.getValues("fields"), n = e[(e == null ? void 0 : e.length) - 1];
|
|
2249
2249
|
if ((n == null ? void 0 : n.value.trim()) === "") {
|
|
2250
2250
|
alert("Enter the right name before adding a new one.");
|
|
2251
2251
|
return;
|
|
@@ -2255,16 +2255,16 @@ function Jr() {
|
|
|
2255
2255
|
value: "",
|
|
2256
2256
|
checkbox: !1
|
|
2257
2257
|
};
|
|
2258
|
-
|
|
2258
|
+
K.value ? a.setValue("updatedFields", [...e, i]) : a.setValue("fields", [...e, i]);
|
|
2259
2259
|
}, Ui = (e) => {
|
|
2260
|
-
const i = (
|
|
2261
|
-
|
|
2260
|
+
const i = (K.value ? a.getValues("updatedFields") : a.getValues("fields")).filter((r) => r.id !== e);
|
|
2261
|
+
K.value ? a.setValue("updatedFields", i) : a.setValue("fields", i), (i == null ? void 0 : i.length) === 0 && (K.value ? at(!0) : at(!1));
|
|
2262
2262
|
};
|
|
2263
2263
|
return /* @__PURE__ */ t(
|
|
2264
2264
|
"form",
|
|
2265
2265
|
{
|
|
2266
2266
|
noValidate: !0,
|
|
2267
|
-
ref:
|
|
2267
|
+
ref: M,
|
|
2268
2268
|
onSubmit: a.handleSubmit(Xt),
|
|
2269
2269
|
method: "POST",
|
|
2270
2270
|
children: /* @__PURE__ */ t(c, { sx: { width: "100%", p: 3, borderRadius: 2 }, children: /* @__PURE__ */ s(c, { sx: { display: "flex" }, children: [
|
|
@@ -2285,10 +2285,10 @@ function Jr() {
|
|
|
2285
2285
|
justifyContent: "center",
|
|
2286
2286
|
gap: 5
|
|
2287
2287
|
},
|
|
2288
|
-
children:
|
|
2289
|
-
const i = n ===
|
|
2290
|
-
let d = "transparent",
|
|
2291
|
-
return i ? (d = "#BEE2FD",
|
|
2288
|
+
children: q.map((e, n) => {
|
|
2289
|
+
const i = n === L, r = oi(n), o = He.some((F) => F.key === e.key) && !r && !i, u = !o && !r && !i;
|
|
2290
|
+
let d = "transparent", h = "2px solid rgba(255,255,255,0.5)", y = "white";
|
|
2291
|
+
return i ? (d = "#BEE2FD", y = "#1e3a8a", h = "2px solid #BEE2FD") : r ? (d = "white", y = "#4caf50", h = "2px solid #4caf50") : o ? (d = "transparent", y = "white", h = "2px solid #BEE2FD") : u && (d = "transparent", y = "rgba(255,255,255,0.5)", h = "2px solid rgba(255,255,255,0.2)"), /* @__PURE__ */ t(Hi, { sx: { p: 0, m: 0 }, children: /* @__PURE__ */ s(
|
|
2292
2292
|
c,
|
|
2293
2293
|
{
|
|
2294
2294
|
sx: {
|
|
@@ -2303,7 +2303,7 @@ function Jr() {
|
|
|
2303
2303
|
minHeight: 64
|
|
2304
2304
|
},
|
|
2305
2305
|
children: [
|
|
2306
|
-
n < (
|
|
2306
|
+
n < (q == null ? void 0 : q.length) - 1 && /* @__PURE__ */ t(
|
|
2307
2307
|
c,
|
|
2308
2308
|
{
|
|
2309
2309
|
sx: {
|
|
@@ -2327,8 +2327,8 @@ function Jr() {
|
|
|
2327
2327
|
height: 32,
|
|
2328
2328
|
borderRadius: "50%",
|
|
2329
2329
|
backgroundColor: d,
|
|
2330
|
-
border:
|
|
2331
|
-
color:
|
|
2330
|
+
border: h,
|
|
2331
|
+
color: y,
|
|
2332
2332
|
fontWeight: "bold",
|
|
2333
2333
|
fontSize: 14,
|
|
2334
2334
|
display: "flex",
|
|
@@ -2337,12 +2337,12 @@ function Jr() {
|
|
|
2337
2337
|
zIndex: 1,
|
|
2338
2338
|
flexShrink: 0
|
|
2339
2339
|
},
|
|
2340
|
-
children: r && !i ? /* @__PURE__ */ t(
|
|
2340
|
+
children: r && !i ? /* @__PURE__ */ t(le, { iconName: "faCheck", size: "lg" }) : n + 1
|
|
2341
2341
|
}
|
|
2342
2342
|
),
|
|
2343
2343
|
/* @__PURE__ */ s(c, { sx: { ml: 2 }, children: [
|
|
2344
2344
|
/* @__PURE__ */ s(
|
|
2345
|
-
|
|
2345
|
+
f,
|
|
2346
2346
|
{
|
|
2347
2347
|
variant: "caption",
|
|
2348
2348
|
sx: {
|
|
@@ -2359,7 +2359,7 @@ function Jr() {
|
|
|
2359
2359
|
}
|
|
2360
2360
|
),
|
|
2361
2361
|
/* @__PURE__ */ t(
|
|
2362
|
-
|
|
2362
|
+
f,
|
|
2363
2363
|
{
|
|
2364
2364
|
variant: "subtitle2",
|
|
2365
2365
|
sx: {
|
|
@@ -2393,9 +2393,9 @@ function Jr() {
|
|
|
2393
2393
|
overflowY: "auto"
|
|
2394
2394
|
},
|
|
2395
2395
|
children: [
|
|
2396
|
-
((rn =
|
|
2396
|
+
((rn = q[L]) == null ? void 0 : rn.key) === "featureDetails" && /* @__PURE__ */ t(c, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ s(c, { width: "80%", children: [
|
|
2397
2397
|
/* @__PURE__ */ t(
|
|
2398
|
-
|
|
2398
|
+
f,
|
|
2399
2399
|
{
|
|
2400
2400
|
variant: "h5",
|
|
2401
2401
|
sx: {
|
|
@@ -2404,45 +2404,45 @@ function Jr() {
|
|
|
2404
2404
|
marginBottom: 1,
|
|
2405
2405
|
marginTop: 2
|
|
2406
2406
|
},
|
|
2407
|
-
children:
|
|
2407
|
+
children: m("Feature Details")
|
|
2408
2408
|
}
|
|
2409
2409
|
),
|
|
2410
2410
|
/* @__PURE__ */ t(
|
|
2411
|
-
|
|
2411
|
+
f,
|
|
2412
2412
|
{
|
|
2413
2413
|
sx: { textAlign: "center", marginBottom: 4, color: "grey" },
|
|
2414
2414
|
children: "Please provide the necessary details for the new feature, including its name, constant, and where it should be linked in the menu."
|
|
2415
2415
|
}
|
|
2416
2416
|
),
|
|
2417
|
-
/* @__PURE__ */ t(
|
|
2418
|
-
|
|
2417
|
+
/* @__PURE__ */ t(H, { children: /* @__PURE__ */ s(
|
|
2418
|
+
te,
|
|
2419
2419
|
{
|
|
2420
2420
|
variant: "outlined",
|
|
2421
2421
|
className: "m-3 flex flex-row items-center w-[80%] justify-between",
|
|
2422
2422
|
children: [
|
|
2423
2423
|
/* @__PURE__ */ s(
|
|
2424
|
-
|
|
2424
|
+
f,
|
|
2425
2425
|
{
|
|
2426
2426
|
variant: "subtitle1",
|
|
2427
2427
|
className: "whitespace-nowrap",
|
|
2428
2428
|
children: [
|
|
2429
|
-
|
|
2429
|
+
m("Is"),
|
|
2430
2430
|
" ",
|
|
2431
|
-
|
|
2431
|
+
m("dynamic"),
|
|
2432
2432
|
" ",
|
|
2433
|
-
|
|
2433
|
+
m("feature? "),
|
|
2434
2434
|
":"
|
|
2435
2435
|
]
|
|
2436
2436
|
}
|
|
2437
2437
|
),
|
|
2438
2438
|
/* @__PURE__ */ t(c, { className: "w-[60%]", children: /* @__PURE__ */ t(
|
|
2439
|
-
|
|
2439
|
+
$,
|
|
2440
2440
|
{
|
|
2441
2441
|
name: "isDynamicFeature",
|
|
2442
2442
|
control: a.control,
|
|
2443
2443
|
rules: { required: "Required field" },
|
|
2444
2444
|
render: ({ field: e }) => /* @__PURE__ */ t(
|
|
2445
|
-
|
|
2445
|
+
Ie,
|
|
2446
2446
|
{
|
|
2447
2447
|
checked: e.value,
|
|
2448
2448
|
disabled: !!b.get("featureId"),
|
|
@@ -2456,21 +2456,21 @@ function Jr() {
|
|
|
2456
2456
|
]
|
|
2457
2457
|
}
|
|
2458
2458
|
) }),
|
|
2459
|
-
/* @__PURE__ */ t(
|
|
2460
|
-
|
|
2459
|
+
/* @__PURE__ */ t(H, { children: /* @__PURE__ */ s(
|
|
2460
|
+
te,
|
|
2461
2461
|
{
|
|
2462
2462
|
variant: "outlined",
|
|
2463
2463
|
className: " m-3 flex flex-row items-center w-[80%] justify-between",
|
|
2464
2464
|
children: [
|
|
2465
|
-
/* @__PURE__ */ s(
|
|
2466
|
-
|
|
2465
|
+
/* @__PURE__ */ s(f, { variant: "subtitle1", children: [
|
|
2466
|
+
m("Feature"),
|
|
2467
2467
|
" ",
|
|
2468
|
-
|
|
2468
|
+
m("Name"),
|
|
2469
2469
|
/* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" }),
|
|
2470
2470
|
" :"
|
|
2471
2471
|
] }),
|
|
2472
2472
|
/* @__PURE__ */ t(c, { className: "w-[60%]", children: /* @__PURE__ */ t(
|
|
2473
|
-
|
|
2473
|
+
ne,
|
|
2474
2474
|
{
|
|
2475
2475
|
control: a.control,
|
|
2476
2476
|
id: "menuName",
|
|
@@ -2483,50 +2483,50 @@ function Jr() {
|
|
|
2483
2483
|
]
|
|
2484
2484
|
}
|
|
2485
2485
|
) }),
|
|
2486
|
-
|
|
2487
|
-
|
|
2486
|
+
P ? /* @__PURE__ */ t(H, { children: /* @__PURE__ */ s(
|
|
2487
|
+
te,
|
|
2488
2488
|
{
|
|
2489
2489
|
variant: "outlined",
|
|
2490
2490
|
className: " m-3 flex flex-row items-center w-[80%] justify-between",
|
|
2491
2491
|
children: [
|
|
2492
|
-
/* @__PURE__ */ s(
|
|
2493
|
-
|
|
2492
|
+
/* @__PURE__ */ s(f, { variant: "subtitle1", children: [
|
|
2493
|
+
m("Feature"),
|
|
2494
2494
|
" ",
|
|
2495
|
-
|
|
2495
|
+
m("Constant"),
|
|
2496
2496
|
/* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" }),
|
|
2497
2497
|
" :"
|
|
2498
2498
|
] }),
|
|
2499
2499
|
/* @__PURE__ */ t(c, { className: "w-[60%]", children: /* @__PURE__ */ t(
|
|
2500
|
-
|
|
2500
|
+
ne,
|
|
2501
2501
|
{
|
|
2502
2502
|
control: a.control,
|
|
2503
2503
|
id: "featureConstant",
|
|
2504
2504
|
name: "featureConstant",
|
|
2505
2505
|
errors: a.formState.errors,
|
|
2506
|
-
successMessage:
|
|
2506
|
+
successMessage: Se,
|
|
2507
2507
|
placeholder: "Feature Constant",
|
|
2508
|
-
disabled:
|
|
2508
|
+
disabled: D,
|
|
2509
2509
|
onChange: (e) => Di(e.target.value)
|
|
2510
2510
|
}
|
|
2511
2511
|
) })
|
|
2512
2512
|
]
|
|
2513
2513
|
}
|
|
2514
|
-
) }, "static-feature") : /* @__PURE__ */ t(
|
|
2515
|
-
|
|
2514
|
+
) }, "static-feature") : /* @__PURE__ */ t(H, { children: /* @__PURE__ */ s(
|
|
2515
|
+
te,
|
|
2516
2516
|
{
|
|
2517
2517
|
variant: "outlined",
|
|
2518
2518
|
className: " m-2 flex flex-row items-center w-[80%] justify-between",
|
|
2519
2519
|
children: [
|
|
2520
|
-
/* @__PURE__ */ s(
|
|
2521
|
-
|
|
2520
|
+
/* @__PURE__ */ s(f, { variant: "subtitle1", children: [
|
|
2521
|
+
m("Feature"),
|
|
2522
2522
|
" ",
|
|
2523
|
-
|
|
2523
|
+
m("State"),
|
|
2524
2524
|
/* @__PURE__ */ t("span", { className: "text-red-500 mx-1", children: "*" }),
|
|
2525
2525
|
/* @__PURE__ */ t(
|
|
2526
|
-
|
|
2526
|
+
ge,
|
|
2527
2527
|
{
|
|
2528
2528
|
title: /* @__PURE__ */ t(
|
|
2529
|
-
|
|
2529
|
+
f,
|
|
2530
2530
|
{
|
|
2531
2531
|
fontSize: 12,
|
|
2532
2532
|
maxWidth: 200,
|
|
@@ -2541,14 +2541,14 @@ function Jr() {
|
|
|
2541
2541
|
)
|
|
2542
2542
|
] }),
|
|
2543
2543
|
/* @__PURE__ */ t(c, { className: "w-[60%]", children: /* @__PURE__ */ t(
|
|
2544
|
-
|
|
2544
|
+
ne,
|
|
2545
2545
|
{
|
|
2546
2546
|
control: a.control,
|
|
2547
2547
|
id: "navigationState",
|
|
2548
2548
|
name: "navigationState",
|
|
2549
2549
|
placeholder: "Feature State",
|
|
2550
|
-
disabled: Et ||
|
|
2551
|
-
successMessage:
|
|
2550
|
+
disabled: Et || D,
|
|
2551
|
+
successMessage: Se,
|
|
2552
2552
|
dataTestId: "managefeature-textfield-feature-state",
|
|
2553
2553
|
errors: a.formState.errors,
|
|
2554
2554
|
onChange: (e) => Pi(
|
|
@@ -2559,27 +2559,27 @@ function Jr() {
|
|
|
2559
2559
|
]
|
|
2560
2560
|
}
|
|
2561
2561
|
) }, "dynamic-feature"),
|
|
2562
|
-
/* @__PURE__ */ t(
|
|
2563
|
-
|
|
2562
|
+
/* @__PURE__ */ t(H, { children: /* @__PURE__ */ s(
|
|
2563
|
+
te,
|
|
2564
2564
|
{
|
|
2565
2565
|
variant: "outlined",
|
|
2566
2566
|
className: " m-3 flex flex-row items-center w-[80%] justify-between",
|
|
2567
2567
|
children: [
|
|
2568
|
-
/* @__PURE__ */ s(
|
|
2569
|
-
|
|
2568
|
+
/* @__PURE__ */ s(f, { variant: "subtitle1", children: [
|
|
2569
|
+
m("Link"),
|
|
2570
2570
|
" ",
|
|
2571
|
-
|
|
2571
|
+
m("to"),
|
|
2572
2572
|
" ",
|
|
2573
|
-
|
|
2573
|
+
m("Menu"),
|
|
2574
2574
|
/* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" }),
|
|
2575
2575
|
" :"
|
|
2576
2576
|
] }),
|
|
2577
2577
|
/* @__PURE__ */ t(c, { className: " w-[60%]", children: /* @__PURE__ */ t(
|
|
2578
|
-
|
|
2578
|
+
Ve,
|
|
2579
2579
|
{
|
|
2580
2580
|
control: a.control,
|
|
2581
2581
|
name: "menuType",
|
|
2582
|
-
options:
|
|
2582
|
+
options: Re,
|
|
2583
2583
|
errors: a.formState.errors,
|
|
2584
2584
|
disableClearable: !1,
|
|
2585
2585
|
onChange: (e) => {
|
|
@@ -2590,27 +2590,27 @@ function Jr() {
|
|
|
2590
2590
|
]
|
|
2591
2591
|
}
|
|
2592
2592
|
) }),
|
|
2593
|
-
/* @__PURE__ */ t(
|
|
2594
|
-
|
|
2593
|
+
/* @__PURE__ */ t(H, { children: (Y == null ? void 0 : Y.length) > 0 && /* @__PURE__ */ s(
|
|
2594
|
+
te,
|
|
2595
2595
|
{
|
|
2596
2596
|
variant: "outlined",
|
|
2597
2597
|
className: " m-3 flex flex-row items-center w-[80%] justify-between",
|
|
2598
2598
|
children: [
|
|
2599
|
-
/* @__PURE__ */ s(
|
|
2600
|
-
|
|
2599
|
+
/* @__PURE__ */ s(f, { variant: "subtitle1", children: [
|
|
2600
|
+
m("Menu"),
|
|
2601
2601
|
" ",
|
|
2602
|
-
|
|
2602
|
+
m("SubGroup"),
|
|
2603
2603
|
" :"
|
|
2604
2604
|
] }),
|
|
2605
2605
|
/* @__PURE__ */ t(c, { className: " w-[60%]", children: /* @__PURE__ */ t(
|
|
2606
|
-
|
|
2606
|
+
Ve,
|
|
2607
2607
|
{
|
|
2608
2608
|
control: a.control,
|
|
2609
2609
|
name: "menuGroup",
|
|
2610
2610
|
errors: a.formState.errors,
|
|
2611
2611
|
displayName: "name",
|
|
2612
2612
|
optionValue: "id",
|
|
2613
|
-
options:
|
|
2613
|
+
options: Y,
|
|
2614
2614
|
disableClearable: !1,
|
|
2615
2615
|
onChange: xi
|
|
2616
2616
|
}
|
|
@@ -2618,37 +2618,37 @@ function Jr() {
|
|
|
2618
2618
|
]
|
|
2619
2619
|
}
|
|
2620
2620
|
) }),
|
|
2621
|
-
/* @__PURE__ */ t(
|
|
2622
|
-
|
|
2621
|
+
/* @__PURE__ */ t(H, { children: /* @__PURE__ */ s(
|
|
2622
|
+
te,
|
|
2623
2623
|
{
|
|
2624
2624
|
variant: "outlined",
|
|
2625
2625
|
className: "m-3 flex flex-row items-center w-[80%] justify-between",
|
|
2626
2626
|
children: [
|
|
2627
2627
|
/* @__PURE__ */ s(
|
|
2628
|
-
|
|
2628
|
+
f,
|
|
2629
2629
|
{
|
|
2630
2630
|
variant: "subtitle1",
|
|
2631
2631
|
className: "whitespace-nowrap",
|
|
2632
2632
|
children: [
|
|
2633
|
-
|
|
2633
|
+
m("Enable"),
|
|
2634
2634
|
" ",
|
|
2635
|
-
|
|
2635
|
+
m("feature"),
|
|
2636
2636
|
" ",
|
|
2637
|
-
|
|
2637
|
+
m("for"),
|
|
2638
2638
|
":"
|
|
2639
2639
|
]
|
|
2640
2640
|
}
|
|
2641
2641
|
),
|
|
2642
2642
|
/* @__PURE__ */ s(c, { className: "w-[60%] flex flex-row gap-6 items-center", children: [
|
|
2643
2643
|
/* @__PURE__ */ s(c, { className: "flex items-center gap-1", children: [
|
|
2644
|
-
/* @__PURE__ */ t(
|
|
2644
|
+
/* @__PURE__ */ t(f, { variant: "subtitle1", children: m("Web") }),
|
|
2645
2645
|
/* @__PURE__ */ t(
|
|
2646
|
-
|
|
2646
|
+
$,
|
|
2647
2647
|
{
|
|
2648
2648
|
name: "isWebFeature",
|
|
2649
2649
|
control: a.control,
|
|
2650
2650
|
render: ({ field: e }) => /* @__PURE__ */ t(
|
|
2651
|
-
|
|
2651
|
+
Ie,
|
|
2652
2652
|
{
|
|
2653
2653
|
...e,
|
|
2654
2654
|
checked: e.value,
|
|
@@ -2659,14 +2659,14 @@ function Jr() {
|
|
|
2659
2659
|
)
|
|
2660
2660
|
] }),
|
|
2661
2661
|
/* @__PURE__ */ s(c, { className: "flex items-center gap-1", children: [
|
|
2662
|
-
/* @__PURE__ */ t(
|
|
2662
|
+
/* @__PURE__ */ t(f, { variant: "subtitle1", children: m("Mobile") }),
|
|
2663
2663
|
/* @__PURE__ */ t(
|
|
2664
|
-
|
|
2664
|
+
$,
|
|
2665
2665
|
{
|
|
2666
2666
|
name: "isMobileFeature",
|
|
2667
2667
|
control: a.control,
|
|
2668
2668
|
render: ({ field: e }) => /* @__PURE__ */ t(
|
|
2669
|
-
|
|
2669
|
+
Ie,
|
|
2670
2670
|
{
|
|
2671
2671
|
...e,
|
|
2672
2672
|
checked: e.value,
|
|
@@ -2683,17 +2683,17 @@ function Jr() {
|
|
|
2683
2683
|
}
|
|
2684
2684
|
) })
|
|
2685
2685
|
] }) }),
|
|
2686
|
-
((an =
|
|
2686
|
+
((an = q[L]) == null ? void 0 : an.key) === "mobileConfig" && R && /* @__PURE__ */ t(c, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ s(c, { width: "95%", children: [
|
|
2687
2687
|
/* @__PURE__ */ t(
|
|
2688
|
-
|
|
2688
|
+
f,
|
|
2689
2689
|
{
|
|
2690
2690
|
variant: "h5",
|
|
2691
2691
|
sx: { fontWeight: "bold", textAlign: "center", mb: 1 },
|
|
2692
|
-
children:
|
|
2692
|
+
children: m("Mobile Setup")
|
|
2693
2693
|
}
|
|
2694
2694
|
),
|
|
2695
2695
|
/* @__PURE__ */ t(
|
|
2696
|
-
|
|
2696
|
+
f,
|
|
2697
2697
|
{
|
|
2698
2698
|
sx: { textAlign: "center", mb: 3, color: "grey" },
|
|
2699
2699
|
children: "Set up how this feature should behave and appear in the mobile app, including its entity, icon and condition query."
|
|
@@ -2720,7 +2720,7 @@ function Jr() {
|
|
|
2720
2720
|
/* @__PURE__ */ t(
|
|
2721
2721
|
It,
|
|
2722
2722
|
{
|
|
2723
|
-
expandIcon: /* @__PURE__ */ t(
|
|
2723
|
+
expandIcon: /* @__PURE__ */ t(le, { iconName: "faChevronDown", size: "sm" }),
|
|
2724
2724
|
sx: {
|
|
2725
2725
|
backgroundColor: "rgba(33, 150, 243, 0.06)",
|
|
2726
2726
|
"&:hover": {
|
|
@@ -2728,7 +2728,7 @@ function Jr() {
|
|
|
2728
2728
|
},
|
|
2729
2729
|
minHeight: 52
|
|
2730
2730
|
},
|
|
2731
|
-
children: /* @__PURE__ */ t(
|
|
2731
|
+
children: /* @__PURE__ */ t(f, { fontWeight: 700, fontSize: 15, children: "Basic Config" })
|
|
2732
2732
|
}
|
|
2733
2733
|
),
|
|
2734
2734
|
/* @__PURE__ */ s(
|
|
@@ -2752,18 +2752,18 @@ function Jr() {
|
|
|
2752
2752
|
sx: { width: "50%" },
|
|
2753
2753
|
children: [
|
|
2754
2754
|
/* @__PURE__ */ s(
|
|
2755
|
-
|
|
2755
|
+
f,
|
|
2756
2756
|
{
|
|
2757
2757
|
variant: "subtitle1",
|
|
2758
2758
|
sx: { minWidth: "140px", flexShrink: 0 },
|
|
2759
2759
|
children: [
|
|
2760
|
-
|
|
2760
|
+
m("Feature Icon"),
|
|
2761
2761
|
" ",
|
|
2762
2762
|
/* @__PURE__ */ t("span", { style: { color: "#d32f2f" }, children: "* " }),
|
|
2763
2763
|
/* @__PURE__ */ t(
|
|
2764
|
-
|
|
2764
|
+
ge,
|
|
2765
2765
|
{
|
|
2766
|
-
title: /* @__PURE__ */ t(
|
|
2766
|
+
title: /* @__PURE__ */ t(f, { fontSize: 12, maxWidth: 200, children: "Upload Feature Icon" }),
|
|
2767
2767
|
size: "sm"
|
|
2768
2768
|
}
|
|
2769
2769
|
)
|
|
@@ -2787,7 +2787,7 @@ function Jr() {
|
|
|
2787
2787
|
formControl: a,
|
|
2788
2788
|
name: "icon",
|
|
2789
2789
|
accept: "image/svg+xml, image/svg",
|
|
2790
|
-
errors:
|
|
2790
|
+
errors: R ? a.formState.errors : null,
|
|
2791
2791
|
triggerType: "icon"
|
|
2792
2792
|
}
|
|
2793
2793
|
)
|
|
@@ -2806,18 +2806,18 @@ function Jr() {
|
|
|
2806
2806
|
sx: { width: "50%" },
|
|
2807
2807
|
children: [
|
|
2808
2808
|
/* @__PURE__ */ s(
|
|
2809
|
-
|
|
2809
|
+
f,
|
|
2810
2810
|
{
|
|
2811
2811
|
variant: "subtitle1",
|
|
2812
2812
|
sx: { minWidth: "140px", flexShrink: 0 },
|
|
2813
2813
|
children: [
|
|
2814
|
-
|
|
2814
|
+
m("Mode"),
|
|
2815
2815
|
" ",
|
|
2816
2816
|
/* @__PURE__ */ t("span", { style: { color: "#d32f2f" }, children: "* " }),
|
|
2817
2817
|
/* @__PURE__ */ t(
|
|
2818
|
-
|
|
2818
|
+
ge,
|
|
2819
2819
|
{
|
|
2820
|
-
title: /* @__PURE__ */ t(
|
|
2820
|
+
title: /* @__PURE__ */ t(f, { fontSize: 12, maxWidth: 200, children: "Choose whether this feature should work online or offline" }),
|
|
2821
2821
|
size: "sm"
|
|
2822
2822
|
}
|
|
2823
2823
|
)
|
|
@@ -2825,11 +2825,11 @@ function Jr() {
|
|
|
2825
2825
|
}
|
|
2826
2826
|
),
|
|
2827
2827
|
/* @__PURE__ */ t(c, { sx: { display: "flex", flex: 1 }, children: /* @__PURE__ */ t(
|
|
2828
|
-
|
|
2828
|
+
$,
|
|
2829
2829
|
{
|
|
2830
2830
|
name: "mobileMode",
|
|
2831
2831
|
control: a.control,
|
|
2832
|
-
render: ({ field: e, fieldState: { error: n } }) => /* @__PURE__ */ s(
|
|
2832
|
+
render: ({ field: e, fieldState: { error: n } }) => /* @__PURE__ */ s(fe, { children: [
|
|
2833
2833
|
/* @__PURE__ */ s(
|
|
2834
2834
|
pn,
|
|
2835
2835
|
{
|
|
@@ -2838,26 +2838,26 @@ function Jr() {
|
|
|
2838
2838
|
...e,
|
|
2839
2839
|
children: [
|
|
2840
2840
|
/* @__PURE__ */ t(
|
|
2841
|
-
|
|
2841
|
+
lt,
|
|
2842
2842
|
{
|
|
2843
2843
|
value: "ONLINE",
|
|
2844
2844
|
control: /* @__PURE__ */ t(
|
|
2845
|
-
|
|
2845
|
+
dt,
|
|
2846
2846
|
{
|
|
2847
|
-
disabled:
|
|
2847
|
+
disabled: D && Pt !== null
|
|
2848
2848
|
}
|
|
2849
2849
|
),
|
|
2850
2850
|
label: "Online"
|
|
2851
2851
|
}
|
|
2852
2852
|
),
|
|
2853
2853
|
/* @__PURE__ */ t(
|
|
2854
|
-
|
|
2854
|
+
lt,
|
|
2855
2855
|
{
|
|
2856
2856
|
value: "OFFLINE",
|
|
2857
2857
|
control: /* @__PURE__ */ t(
|
|
2858
|
-
|
|
2858
|
+
dt,
|
|
2859
2859
|
{
|
|
2860
|
-
disabled:
|
|
2860
|
+
disabled: D && Pt !== null
|
|
2861
2861
|
}
|
|
2862
2862
|
),
|
|
2863
2863
|
label: "Offline"
|
|
@@ -2867,7 +2867,7 @@ function Jr() {
|
|
|
2867
2867
|
}
|
|
2868
2868
|
),
|
|
2869
2869
|
(n == null ? void 0 : n.message) && /* @__PURE__ */ t(
|
|
2870
|
-
|
|
2870
|
+
f,
|
|
2871
2871
|
{
|
|
2872
2872
|
variant: "caption",
|
|
2873
2873
|
color: "error",
|
|
@@ -2886,17 +2886,17 @@ function Jr() {
|
|
|
2886
2886
|
),
|
|
2887
2887
|
/* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
2888
2888
|
/* @__PURE__ */ s(
|
|
2889
|
-
|
|
2889
|
+
f,
|
|
2890
2890
|
{
|
|
2891
2891
|
variant: "subtitle1",
|
|
2892
2892
|
sx: { minWidth: "140px", flexShrink: 0 },
|
|
2893
2893
|
children: [
|
|
2894
|
-
|
|
2894
|
+
m("Entity Name"),
|
|
2895
2895
|
" ",
|
|
2896
2896
|
/* @__PURE__ */ t(
|
|
2897
|
-
|
|
2897
|
+
ge,
|
|
2898
2898
|
{
|
|
2899
|
-
title: /* @__PURE__ */ t(
|
|
2899
|
+
title: /* @__PURE__ */ t(f, { fontSize: 12, maxWidth: 200, children: "Select Entity Name" }),
|
|
2900
2900
|
size: "sm"
|
|
2901
2901
|
}
|
|
2902
2902
|
)
|
|
@@ -2913,12 +2913,12 @@ function Jr() {
|
|
|
2913
2913
|
flex: 1
|
|
2914
2914
|
},
|
|
2915
2915
|
children: /* @__PURE__ */ t(
|
|
2916
|
-
|
|
2916
|
+
Ve,
|
|
2917
2917
|
{
|
|
2918
2918
|
control: a.control,
|
|
2919
2919
|
name: "entityName",
|
|
2920
2920
|
options: v || [],
|
|
2921
|
-
errors:
|
|
2921
|
+
errors: R ? a.formState.errors : null,
|
|
2922
2922
|
size: "small",
|
|
2923
2923
|
disableClearable: !1,
|
|
2924
2924
|
sx: { flex: 1 }
|
|
@@ -2936,7 +2936,7 @@ function Jr() {
|
|
|
2936
2936
|
my: 2,
|
|
2937
2937
|
children: [
|
|
2938
2938
|
/* @__PURE__ */ s(
|
|
2939
|
-
|
|
2939
|
+
f,
|
|
2940
2940
|
{
|
|
2941
2941
|
variant: "subtitle1",
|
|
2942
2942
|
sx: {
|
|
@@ -2945,13 +2945,13 @@ function Jr() {
|
|
|
2945
2945
|
pt: 0.5
|
|
2946
2946
|
},
|
|
2947
2947
|
children: [
|
|
2948
|
-
|
|
2948
|
+
m("Condition Query"),
|
|
2949
2949
|
" :",
|
|
2950
2950
|
" ",
|
|
2951
2951
|
/* @__PURE__ */ t(
|
|
2952
|
-
|
|
2952
|
+
ge,
|
|
2953
2953
|
{
|
|
2954
|
-
title: /* @__PURE__ */ t(
|
|
2954
|
+
title: /* @__PURE__ */ t(f, { fontSize: 12, maxWidth: 200, children: "Write Condition Query in the editor" }),
|
|
2955
2955
|
size: "sm"
|
|
2956
2956
|
}
|
|
2957
2957
|
)
|
|
@@ -2970,11 +2970,11 @@ function Jr() {
|
|
|
2970
2970
|
boxShadow: "0 1px 6px rgba(0, 0, 0, 0.08)"
|
|
2971
2971
|
},
|
|
2972
2972
|
children: /* @__PURE__ */ t(
|
|
2973
|
-
|
|
2973
|
+
$,
|
|
2974
2974
|
{
|
|
2975
2975
|
name: "conditions",
|
|
2976
2976
|
control: a.control,
|
|
2977
|
-
render: ({ field: e, fieldState: { error: n } }) => /* @__PURE__ */ s(
|
|
2977
|
+
render: ({ field: e, fieldState: { error: n } }) => /* @__PURE__ */ s(fe, { children: [
|
|
2978
2978
|
/* @__PURE__ */ t(
|
|
2979
2979
|
Li,
|
|
2980
2980
|
{
|
|
@@ -2996,7 +2996,7 @@ function Jr() {
|
|
|
2996
2996
|
}
|
|
2997
2997
|
),
|
|
2998
2998
|
(n == null ? void 0 : n.message) && /* @__PURE__ */ t(
|
|
2999
|
-
|
|
2999
|
+
f,
|
|
3000
3000
|
{
|
|
3001
3001
|
variant: "caption",
|
|
3002
3002
|
color: "error",
|
|
@@ -3014,17 +3014,17 @@ function Jr() {
|
|
|
3014
3014
|
),
|
|
3015
3015
|
/* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
3016
3016
|
/* @__PURE__ */ s(
|
|
3017
|
-
|
|
3017
|
+
f,
|
|
3018
3018
|
{
|
|
3019
3019
|
variant: "subtitle1",
|
|
3020
3020
|
sx: { minWidth: "140px", flexShrink: 0 },
|
|
3021
3021
|
children: [
|
|
3022
|
-
|
|
3022
|
+
m("Tables to sync"),
|
|
3023
3023
|
" ",
|
|
3024
3024
|
/* @__PURE__ */ t(
|
|
3025
|
-
|
|
3025
|
+
ge,
|
|
3026
3026
|
{
|
|
3027
|
-
title: /* @__PURE__ */ t(
|
|
3027
|
+
title: /* @__PURE__ */ t(f, { fontSize: 12, maxWidth: 200, children: "Select at least one table to sync" }),
|
|
3028
3028
|
size: "sm"
|
|
3029
3029
|
}
|
|
3030
3030
|
)
|
|
@@ -3041,18 +3041,18 @@ function Jr() {
|
|
|
3041
3041
|
flex: 1
|
|
3042
3042
|
},
|
|
3043
3043
|
children: /* @__PURE__ */ t(
|
|
3044
|
-
|
|
3044
|
+
Ee,
|
|
3045
3045
|
{
|
|
3046
3046
|
id: "mobileEntitiesSync",
|
|
3047
3047
|
name: "mobileEntitiesSync",
|
|
3048
3048
|
control: a.control,
|
|
3049
|
-
options:
|
|
3049
|
+
options: Z,
|
|
3050
3050
|
onChange: (e, n) => mi(n),
|
|
3051
3051
|
getOptionLabel: (e) => e == null ? void 0 : e.tableName,
|
|
3052
3052
|
checkEquality: "tableName",
|
|
3053
|
-
errors:
|
|
3053
|
+
errors: R ? a.formState.errors : null,
|
|
3054
3054
|
dataTestId: "syncentities-select-table",
|
|
3055
|
-
value:
|
|
3055
|
+
value: T,
|
|
3056
3056
|
fullWidth: !0
|
|
3057
3057
|
}
|
|
3058
3058
|
)
|
|
@@ -3086,7 +3086,7 @@ function Jr() {
|
|
|
3086
3086
|
/* @__PURE__ */ t(
|
|
3087
3087
|
It,
|
|
3088
3088
|
{
|
|
3089
|
-
expandIcon: /* @__PURE__ */ t(
|
|
3089
|
+
expandIcon: /* @__PURE__ */ t(le, { iconName: "faChevronDown", size: "sm" }),
|
|
3090
3090
|
sx: {
|
|
3091
3091
|
backgroundColor: "rgba(76, 175, 80, 0.06)",
|
|
3092
3092
|
"&:hover": {
|
|
@@ -3094,7 +3094,7 @@ function Jr() {
|
|
|
3094
3094
|
},
|
|
3095
3095
|
minHeight: 52
|
|
3096
3096
|
},
|
|
3097
|
-
children: /* @__PURE__ */ t(
|
|
3097
|
+
children: /* @__PURE__ */ t(f, { fontWeight: 700, fontSize: 15, children: "Training Config" })
|
|
3098
3098
|
}
|
|
3099
3099
|
),
|
|
3100
3100
|
/* @__PURE__ */ s(
|
|
@@ -3110,17 +3110,17 @@ function Jr() {
|
|
|
3110
3110
|
justifyContent: "space-between",
|
|
3111
3111
|
children: [
|
|
3112
3112
|
/* @__PURE__ */ s(
|
|
3113
|
-
|
|
3113
|
+
f,
|
|
3114
3114
|
{
|
|
3115
3115
|
variant: "subtitle1",
|
|
3116
3116
|
sx: { minWidth: "200px", flexShrink: 0 },
|
|
3117
3117
|
children: [
|
|
3118
|
-
|
|
3118
|
+
m("Training Required"),
|
|
3119
3119
|
" ",
|
|
3120
3120
|
/* @__PURE__ */ t(
|
|
3121
|
-
|
|
3121
|
+
ge,
|
|
3122
3122
|
{
|
|
3123
|
-
title: /* @__PURE__ */ t(
|
|
3123
|
+
title: /* @__PURE__ */ t(f, { fontSize: 12, maxWidth: 220, children: ut(
|
|
3124
3124
|
"Enable if the user must complete training before accessing this feature"
|
|
3125
3125
|
) }),
|
|
3126
3126
|
size: "sm"
|
|
@@ -3130,17 +3130,17 @@ function Jr() {
|
|
|
3130
3130
|
}
|
|
3131
3131
|
),
|
|
3132
3132
|
/* @__PURE__ */ t(c, { sx: { flex: 1 }, children: /* @__PURE__ */ t(
|
|
3133
|
-
|
|
3133
|
+
$,
|
|
3134
3134
|
{
|
|
3135
3135
|
name: "trainingRequired",
|
|
3136
3136
|
control: a.control,
|
|
3137
3137
|
render: ({ field: e }) => /* @__PURE__ */ t(
|
|
3138
|
-
|
|
3138
|
+
Ie,
|
|
3139
3139
|
{
|
|
3140
3140
|
...e,
|
|
3141
3141
|
checked: !!e.value,
|
|
3142
3142
|
onChange: (n) => {
|
|
3143
|
-
e.onChange(n.target.checked), n.target.checked || (a.setValue("trainingQuery", ""),
|
|
3143
|
+
e.onChange(n.target.checked), n.target.checked || (a.setValue("trainingQuery", ""), je(""));
|
|
3144
3144
|
}
|
|
3145
3145
|
}
|
|
3146
3146
|
)
|
|
@@ -3151,17 +3151,17 @@ function Jr() {
|
|
|
3151
3151
|
),
|
|
3152
3152
|
a.watch("trainingRequired") && /* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
3153
3153
|
/* @__PURE__ */ s(
|
|
3154
|
-
|
|
3154
|
+
f,
|
|
3155
3155
|
{
|
|
3156
3156
|
variant: "subtitle1",
|
|
3157
3157
|
sx: { minWidth: "200px", flexShrink: 0 },
|
|
3158
3158
|
children: [
|
|
3159
|
-
|
|
3159
|
+
m("Training Query"),
|
|
3160
3160
|
" ",
|
|
3161
3161
|
/* @__PURE__ */ t(
|
|
3162
|
-
|
|
3162
|
+
ge,
|
|
3163
3163
|
{
|
|
3164
|
-
title: /* @__PURE__ */ t(
|
|
3164
|
+
title: /* @__PURE__ */ t(f, { fontSize: 12, maxWidth: 220, children: ut(
|
|
3165
3165
|
"Select a query that returns a boolean — true if training is completed, false otherwise"
|
|
3166
3166
|
) }),
|
|
3167
3167
|
size: "sm"
|
|
@@ -3171,30 +3171,30 @@ function Jr() {
|
|
|
3171
3171
|
}
|
|
3172
3172
|
),
|
|
3173
3173
|
/* @__PURE__ */ t(c, { sx: { flex: 1 }, children: /* @__PURE__ */ t(
|
|
3174
|
-
|
|
3174
|
+
$,
|
|
3175
3175
|
{
|
|
3176
3176
|
name: "trainingQuery",
|
|
3177
3177
|
control: a.control,
|
|
3178
3178
|
render: ({ field: e, fieldState: { error: n } }) => /* @__PURE__ */ t(
|
|
3179
|
-
|
|
3179
|
+
Ee,
|
|
3180
3180
|
{
|
|
3181
3181
|
id: "trainingQuery",
|
|
3182
3182
|
name: "trainingQuery",
|
|
3183
3183
|
control: a.control,
|
|
3184
|
-
options:
|
|
3184
|
+
options: ke,
|
|
3185
3185
|
getOptionLabel: (i) => (i == null ? void 0 : i.code) || "",
|
|
3186
3186
|
checkEquality: "code",
|
|
3187
3187
|
inputValue: Yn,
|
|
3188
3188
|
disableClearable: !1,
|
|
3189
3189
|
singleSelect: !0,
|
|
3190
|
-
value: (
|
|
3190
|
+
value: (ke == null ? void 0 : ke.find(
|
|
3191
3191
|
(i) => i.code === e.value
|
|
3192
3192
|
)) || null,
|
|
3193
3193
|
onInputChange: (i, r, o) => {
|
|
3194
|
-
o === "input" && (
|
|
3194
|
+
o === "input" && (je(r), _e(r));
|
|
3195
3195
|
},
|
|
3196
3196
|
onChange: (i, r) => {
|
|
3197
|
-
e.onChange((r == null ? void 0 : r.code) || ""),
|
|
3197
|
+
e.onChange((r == null ? void 0 : r.code) || ""), je((r == null ? void 0 : r.code) || "");
|
|
3198
3198
|
},
|
|
3199
3199
|
placeholder: "Search training query code...",
|
|
3200
3200
|
errors: n,
|
|
@@ -3232,7 +3232,7 @@ function Jr() {
|
|
|
3232
3232
|
/* @__PURE__ */ t(
|
|
3233
3233
|
It,
|
|
3234
3234
|
{
|
|
3235
|
-
expandIcon: /* @__PURE__ */ t(
|
|
3235
|
+
expandIcon: /* @__PURE__ */ t(le, { iconName: "faChevronDown", size: "sm" }),
|
|
3236
3236
|
sx: {
|
|
3237
3237
|
backgroundColor: "rgba(255, 152, 0, 0.06)",
|
|
3238
3238
|
"&:hover": {
|
|
@@ -3240,8 +3240,8 @@ function Jr() {
|
|
|
3240
3240
|
},
|
|
3241
3241
|
minHeight: 52
|
|
3242
3242
|
},
|
|
3243
|
-
children: /* @__PURE__ */ s(
|
|
3244
|
-
|
|
3243
|
+
children: /* @__PURE__ */ s(f, { fontWeight: 700, fontSize: 15, children: [
|
|
3244
|
+
m("Notification Config"),
|
|
3245
3245
|
" "
|
|
3246
3246
|
] })
|
|
3247
3247
|
}
|
|
@@ -3259,17 +3259,17 @@ function Jr() {
|
|
|
3259
3259
|
justifyContent: "space-between",
|
|
3260
3260
|
children: [
|
|
3261
3261
|
/* @__PURE__ */ s(
|
|
3262
|
-
|
|
3262
|
+
f,
|
|
3263
3263
|
{
|
|
3264
3264
|
variant: "subtitle1",
|
|
3265
3265
|
sx: { minWidth: "200px", flexShrink: 0 },
|
|
3266
3266
|
children: [
|
|
3267
|
-
|
|
3267
|
+
m("Enable Notification Badge"),
|
|
3268
3268
|
" ",
|
|
3269
3269
|
/* @__PURE__ */ t(
|
|
3270
|
-
|
|
3270
|
+
ge,
|
|
3271
3271
|
{
|
|
3272
|
-
title: /* @__PURE__ */ t(
|
|
3272
|
+
title: /* @__PURE__ */ t(f, { fontSize: 12, maxWidth: 220, children: ut(
|
|
3273
3273
|
"Show a count or nudge badge on this feature's icon in the mobile app"
|
|
3274
3274
|
) }),
|
|
3275
3275
|
size: "sm"
|
|
@@ -3279,12 +3279,12 @@ function Jr() {
|
|
|
3279
3279
|
}
|
|
3280
3280
|
),
|
|
3281
3281
|
/* @__PURE__ */ t(c, { sx: { flex: 1 }, children: /* @__PURE__ */ t(
|
|
3282
|
-
|
|
3282
|
+
$,
|
|
3283
3283
|
{
|
|
3284
3284
|
name: "notificationBadgeEnabled",
|
|
3285
3285
|
control: a.control,
|
|
3286
3286
|
render: ({ field: e }) => /* @__PURE__ */ t(
|
|
3287
|
-
|
|
3287
|
+
Ie,
|
|
3288
3288
|
{
|
|
3289
3289
|
...e,
|
|
3290
3290
|
checked: !!e.value,
|
|
@@ -3295,7 +3295,7 @@ function Jr() {
|
|
|
3295
3295
|
), a.setValue(
|
|
3296
3296
|
"notificationBadgeQuery",
|
|
3297
3297
|
""
|
|
3298
|
-
),
|
|
3298
|
+
), Ge(""));
|
|
3299
3299
|
}
|
|
3300
3300
|
}
|
|
3301
3301
|
)
|
|
@@ -3304,20 +3304,20 @@ function Jr() {
|
|
|
3304
3304
|
]
|
|
3305
3305
|
}
|
|
3306
3306
|
),
|
|
3307
|
-
a.watch("notificationBadgeEnabled") && /* @__PURE__ */ s(
|
|
3307
|
+
a.watch("notificationBadgeEnabled") && /* @__PURE__ */ s(fe, { children: [
|
|
3308
3308
|
/* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
3309
3309
|
/* @__PURE__ */ s(
|
|
3310
|
-
|
|
3310
|
+
f,
|
|
3311
3311
|
{
|
|
3312
3312
|
variant: "subtitle1",
|
|
3313
3313
|
sx: { minWidth: "200px", flexShrink: 0 },
|
|
3314
3314
|
children: [
|
|
3315
|
-
|
|
3315
|
+
m("Badge Type"),
|
|
3316
3316
|
" ",
|
|
3317
3317
|
/* @__PURE__ */ t(
|
|
3318
|
-
|
|
3318
|
+
ge,
|
|
3319
3319
|
{
|
|
3320
|
-
title: /* @__PURE__ */ t(
|
|
3320
|
+
title: /* @__PURE__ */ t(f, { fontSize: 12, maxWidth: 220, children: ut(
|
|
3321
3321
|
`Count Based: query returns a number.
|
|
3322
3322
|
|
|
3323
3323
|
Nudge Based: query returns true/false.`
|
|
@@ -3329,24 +3329,24 @@ function Jr() {
|
|
|
3329
3329
|
}
|
|
3330
3330
|
),
|
|
3331
3331
|
/* @__PURE__ */ t(c, { sx: { flex: 1 }, children: /* @__PURE__ */ t(
|
|
3332
|
-
|
|
3332
|
+
$,
|
|
3333
3333
|
{
|
|
3334
3334
|
name: "notificationBadgeType",
|
|
3335
3335
|
control: a.control,
|
|
3336
3336
|
render: ({ field: e }) => /* @__PURE__ */ s(pn, { row: !0, ...e, children: [
|
|
3337
3337
|
/* @__PURE__ */ t(
|
|
3338
|
-
|
|
3338
|
+
lt,
|
|
3339
3339
|
{
|
|
3340
3340
|
value: "COUNT",
|
|
3341
|
-
control: /* @__PURE__ */ t(
|
|
3341
|
+
control: /* @__PURE__ */ t(dt, {}),
|
|
3342
3342
|
label: "Count Based"
|
|
3343
3343
|
}
|
|
3344
3344
|
),
|
|
3345
3345
|
/* @__PURE__ */ t(
|
|
3346
|
-
|
|
3346
|
+
lt,
|
|
3347
3347
|
{
|
|
3348
3348
|
value: "NUDGE",
|
|
3349
|
-
control: /* @__PURE__ */ t(
|
|
3349
|
+
control: /* @__PURE__ */ t(dt, {}),
|
|
3350
3350
|
label: "Nudge Based"
|
|
3351
3351
|
}
|
|
3352
3352
|
)
|
|
@@ -3356,7 +3356,7 @@ function Jr() {
|
|
|
3356
3356
|
] }),
|
|
3357
3357
|
a.watch("notificationBadgeType") && /* @__PURE__ */ s(c, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
3358
3358
|
/* @__PURE__ */ s(
|
|
3359
|
-
|
|
3359
|
+
f,
|
|
3360
3360
|
{
|
|
3361
3361
|
variant: "subtitle1",
|
|
3362
3362
|
sx: { minWidth: "200px", flexShrink: 0 },
|
|
@@ -3364,9 +3364,9 @@ function Jr() {
|
|
|
3364
3364
|
a.watch("notificationBadgeType") === "COUNT" ? "Count Query" : "Nudge Query",
|
|
3365
3365
|
" ",
|
|
3366
3366
|
/* @__PURE__ */ t(
|
|
3367
|
-
|
|
3367
|
+
ge,
|
|
3368
3368
|
{
|
|
3369
|
-
title: /* @__PURE__ */ t(
|
|
3369
|
+
title: /* @__PURE__ */ t(f, { fontSize: 12, maxWidth: 220, children: a.watch(
|
|
3370
3370
|
"notificationBadgeType"
|
|
3371
3371
|
) === "COUNT" ? "Select a query that returns a numeric count for the badge" : "Select a query that returns true/false to show or hide the badge" }),
|
|
3372
3372
|
size: "sm"
|
|
@@ -3376,7 +3376,7 @@ function Jr() {
|
|
|
3376
3376
|
}
|
|
3377
3377
|
),
|
|
3378
3378
|
/* @__PURE__ */ t(c, { sx: { flex: 1 }, children: /* @__PURE__ */ t(
|
|
3379
|
-
|
|
3379
|
+
$,
|
|
3380
3380
|
{
|
|
3381
3381
|
name: "notificationBadgeQuery",
|
|
3382
3382
|
control: a.control,
|
|
@@ -3384,25 +3384,25 @@ function Jr() {
|
|
|
3384
3384
|
field: e,
|
|
3385
3385
|
fieldState: { error: n }
|
|
3386
3386
|
}) => /* @__PURE__ */ t(
|
|
3387
|
-
|
|
3387
|
+
Ee,
|
|
3388
3388
|
{
|
|
3389
3389
|
id: "notificationBadgeQuery",
|
|
3390
3390
|
name: "notificationBadgeQuery",
|
|
3391
3391
|
control: a.control,
|
|
3392
|
-
options:
|
|
3392
|
+
options: ke,
|
|
3393
3393
|
getOptionLabel: (i) => (i == null ? void 0 : i.code) || "",
|
|
3394
3394
|
checkEquality: "code",
|
|
3395
3395
|
inputValue: Kn,
|
|
3396
3396
|
disableClearable: !1,
|
|
3397
3397
|
singleSelect: !0,
|
|
3398
|
-
value: (
|
|
3398
|
+
value: (ke == null ? void 0 : ke.find(
|
|
3399
3399
|
(i) => i.code === e.value
|
|
3400
3400
|
)) || null,
|
|
3401
3401
|
onInputChange: (i, r, o) => {
|
|
3402
|
-
o === "input" && (
|
|
3402
|
+
o === "input" && (Ge(r), _e(r));
|
|
3403
3403
|
},
|
|
3404
3404
|
onChange: (i, r) => {
|
|
3405
|
-
e.onChange((r == null ? void 0 : r.code) || ""),
|
|
3405
|
+
e.onChange((r == null ? void 0 : r.code) || ""), Ge(
|
|
3406
3406
|
(r == null ? void 0 : r.code) || ""
|
|
3407
3407
|
);
|
|
3408
3408
|
},
|
|
@@ -3425,9 +3425,9 @@ function Jr() {
|
|
|
3425
3425
|
}
|
|
3426
3426
|
)
|
|
3427
3427
|
] }) }),
|
|
3428
|
-
((on =
|
|
3428
|
+
((on = q[L]) == null ? void 0 : on.key) === "formLinking" && P && /* @__PURE__ */ t(c, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ s(c, { width: "80%", children: [
|
|
3429
3429
|
/* @__PURE__ */ t(
|
|
3430
|
-
|
|
3430
|
+
f,
|
|
3431
3431
|
{
|
|
3432
3432
|
variant: "h5",
|
|
3433
3433
|
sx: {
|
|
@@ -3436,19 +3436,19 @@ function Jr() {
|
|
|
3436
3436
|
marginBottom: 1,
|
|
3437
3437
|
marginTop: 2
|
|
3438
3438
|
},
|
|
3439
|
-
children:
|
|
3439
|
+
children: m("Form Linking")
|
|
3440
3440
|
}
|
|
3441
3441
|
),
|
|
3442
3442
|
/* @__PURE__ */ t(
|
|
3443
|
-
|
|
3443
|
+
f,
|
|
3444
3444
|
{
|
|
3445
3445
|
sx: { textAlign: "center", mb: 4, color: "grey" },
|
|
3446
3446
|
children: "Link this feature to an existing form, or create a new form to be associated with it."
|
|
3447
3447
|
}
|
|
3448
3448
|
),
|
|
3449
|
-
/* @__PURE__ */ s(
|
|
3449
|
+
/* @__PURE__ */ s(H, { container: !0, mt: 3, className: "flex flex-col w-[98%]", children: [
|
|
3450
3450
|
/* @__PURE__ */ t(
|
|
3451
|
-
|
|
3451
|
+
f,
|
|
3452
3452
|
{
|
|
3453
3453
|
variant: "subtitle1",
|
|
3454
3454
|
sx: {
|
|
@@ -3459,24 +3459,24 @@ function Jr() {
|
|
|
3459
3459
|
children: "Use Existing Form"
|
|
3460
3460
|
}
|
|
3461
3461
|
),
|
|
3462
|
-
/* @__PURE__ */ t(
|
|
3463
|
-
|
|
3462
|
+
/* @__PURE__ */ t(H, { container: !0, sx: { alignItems: "center" }, children: /* @__PURE__ */ s(
|
|
3463
|
+
te,
|
|
3464
3464
|
{
|
|
3465
3465
|
variant: "outlined",
|
|
3466
3466
|
className: "m-3 flex flex-row items-center w-[80%] justify-between",
|
|
3467
3467
|
children: [
|
|
3468
|
-
/* @__PURE__ */ s(
|
|
3469
|
-
|
|
3468
|
+
/* @__PURE__ */ s(f, { variant: "subtitle1", children: [
|
|
3469
|
+
m("Select"),
|
|
3470
3470
|
" ",
|
|
3471
|
-
|
|
3471
|
+
m("Form"),
|
|
3472
3472
|
":"
|
|
3473
3473
|
] }),
|
|
3474
3474
|
/* @__PURE__ */ t(c, { className: "w-[60%]", children: /* @__PURE__ */ t(
|
|
3475
|
-
|
|
3475
|
+
Ve,
|
|
3476
3476
|
{
|
|
3477
3477
|
control: a.control,
|
|
3478
3478
|
name: "formCode",
|
|
3479
|
-
options:
|
|
3479
|
+
options: he || [],
|
|
3480
3480
|
getOptionDisabled: (e) => e.menu_config_id && e.menu_config_id !== parseInt(b.get("featureId")),
|
|
3481
3481
|
displayName: "form_name",
|
|
3482
3482
|
optionValue: "form_code",
|
|
@@ -3487,7 +3487,7 @@ function Jr() {
|
|
|
3487
3487
|
e.target.value ? (a.setValue(
|
|
3488
3488
|
"navigationState",
|
|
3489
3489
|
`medplat.form.${e.target.value}`
|
|
3490
|
-
),
|
|
3490
|
+
), ye(e.target.value)) : (a.setValue("version", null), a.setValue(
|
|
3491
3491
|
"navigationState",
|
|
3492
3492
|
"medplat.form."
|
|
3493
3493
|
));
|
|
@@ -3498,23 +3498,23 @@ function Jr() {
|
|
|
3498
3498
|
}
|
|
3499
3499
|
) }),
|
|
3500
3500
|
/* @__PURE__ */ s(
|
|
3501
|
-
|
|
3501
|
+
te,
|
|
3502
3502
|
{
|
|
3503
3503
|
variant: "outlined",
|
|
3504
3504
|
className: "m-3 flex flex-row items-center w-[80%] justify-between",
|
|
3505
3505
|
children: [
|
|
3506
|
-
/* @__PURE__ */ s(
|
|
3507
|
-
|
|
3506
|
+
/* @__PURE__ */ s(f, { variant: "subtitle1", children: [
|
|
3507
|
+
m("Select"),
|
|
3508
3508
|
" ",
|
|
3509
|
-
|
|
3509
|
+
m("Version"),
|
|
3510
3510
|
":"
|
|
3511
3511
|
] }),
|
|
3512
3512
|
/* @__PURE__ */ t(c, { className: "w-[60%]", children: /* @__PURE__ */ t(
|
|
3513
|
-
|
|
3513
|
+
Ve,
|
|
3514
3514
|
{
|
|
3515
3515
|
control: a.control,
|
|
3516
3516
|
name: "version",
|
|
3517
|
-
options: Array.isArray(
|
|
3517
|
+
options: Array.isArray(J == null ? void 0 : J[De]) ? J[De].map(
|
|
3518
3518
|
(e) => e.version
|
|
3519
3519
|
) : [],
|
|
3520
3520
|
errors: a.formState.errors,
|
|
@@ -3526,7 +3526,7 @@ function Jr() {
|
|
|
3526
3526
|
}
|
|
3527
3527
|
),
|
|
3528
3528
|
/* @__PURE__ */ t(
|
|
3529
|
-
|
|
3529
|
+
Ye,
|
|
3530
3530
|
{
|
|
3531
3531
|
sx: {
|
|
3532
3532
|
width: "80%",
|
|
@@ -3534,7 +3534,7 @@ function Jr() {
|
|
|
3534
3534
|
position: "relative"
|
|
3535
3535
|
},
|
|
3536
3536
|
children: /* @__PURE__ */ t(
|
|
3537
|
-
|
|
3537
|
+
f,
|
|
3538
3538
|
{
|
|
3539
3539
|
variant: "caption",
|
|
3540
3540
|
sx: {
|
|
@@ -3552,7 +3552,7 @@ function Jr() {
|
|
|
3552
3552
|
),
|
|
3553
3553
|
/* @__PURE__ */ s(c, { className: "flex justify-center", children: [
|
|
3554
3554
|
/* @__PURE__ */ t(
|
|
3555
|
-
|
|
3555
|
+
U,
|
|
3556
3556
|
{
|
|
3557
3557
|
variant: "outlined",
|
|
3558
3558
|
size: "small",
|
|
@@ -3576,9 +3576,9 @@ function Jr() {
|
|
|
3576
3576
|
] })
|
|
3577
3577
|
] })
|
|
3578
3578
|
] }) }),
|
|
3579
|
-
((ln =
|
|
3579
|
+
((ln = q[L]) == null ? void 0 : ln.key) === "additionalPermissions" && /* @__PURE__ */ t(H, { item: !0, xs: 12, md: 6, children: /* @__PURE__ */ s(c, { mt: 3, className: "flex flex-col w-full", children: [
|
|
3580
3580
|
/* @__PURE__ */ t(
|
|
3581
|
-
|
|
3581
|
+
f,
|
|
3582
3582
|
{
|
|
3583
3583
|
variant: "h5",
|
|
3584
3584
|
sx: { fontWeight: "bold", textAlign: "center", mb: 1 },
|
|
@@ -3586,25 +3586,25 @@ function Jr() {
|
|
|
3586
3586
|
}
|
|
3587
3587
|
),
|
|
3588
3588
|
/* @__PURE__ */ t(
|
|
3589
|
-
|
|
3589
|
+
f,
|
|
3590
3590
|
{
|
|
3591
3591
|
sx: { textAlign: "center", mb: 4, color: "grey" },
|
|
3592
3592
|
children: "Define custom permissions for this feature. These will be used to control fine-grained permissions beyond default roles."
|
|
3593
3593
|
}
|
|
3594
3594
|
),
|
|
3595
|
-
!
|
|
3596
|
-
/* @__PURE__ */ t(
|
|
3597
|
-
|
|
3595
|
+
!P && (l == null ? void 0 : l.val) === !1 ? /* @__PURE__ */ s(fe, { children: [
|
|
3596
|
+
/* @__PURE__ */ t(H, { children: /* @__PURE__ */ s(
|
|
3597
|
+
te,
|
|
3598
3598
|
{
|
|
3599
3599
|
variant: "outlined",
|
|
3600
3600
|
className: "flex flex-row items-center ml-3 ",
|
|
3601
3601
|
children: [
|
|
3602
|
-
/* @__PURE__ */ t(
|
|
3602
|
+
/* @__PURE__ */ t(f, { variant: "body2", children: m("Add feature JSON access rights") }),
|
|
3603
3603
|
/* @__PURE__ */ t(
|
|
3604
3604
|
gn,
|
|
3605
3605
|
{
|
|
3606
3606
|
disabled: Qn,
|
|
3607
|
-
checked:
|
|
3607
|
+
checked: Te,
|
|
3608
3608
|
onChange: Mi,
|
|
3609
3609
|
"data-testid": "managefeature-checkbox-access-rights"
|
|
3610
3610
|
}
|
|
@@ -3612,15 +3612,15 @@ function Jr() {
|
|
|
3612
3612
|
]
|
|
3613
3613
|
}
|
|
3614
3614
|
) }),
|
|
3615
|
-
/* @__PURE__ */ t(
|
|
3615
|
+
/* @__PURE__ */ t(H, { children: K.value && Te && /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(Ki, { className: "ml-2", children: (dn = a.getValues("updatedFields")) == null ? void 0 : dn.map((e, n) => {
|
|
3616
3616
|
var i;
|
|
3617
3617
|
return /* @__PURE__ */ s(
|
|
3618
|
-
|
|
3618
|
+
H,
|
|
3619
3619
|
{
|
|
3620
3620
|
className: " mb-2.5 flex flex-row items-center ",
|
|
3621
3621
|
children: [
|
|
3622
|
-
/* @__PURE__ */ t(
|
|
3623
|
-
|
|
3622
|
+
/* @__PURE__ */ t(te, { children: /* @__PURE__ */ t(
|
|
3623
|
+
$,
|
|
3624
3624
|
{
|
|
3625
3625
|
name: `updatedFields[${n}].value`,
|
|
3626
3626
|
control: a.control,
|
|
@@ -3628,7 +3628,7 @@ function Jr() {
|
|
|
3628
3628
|
Vn,
|
|
3629
3629
|
{
|
|
3630
3630
|
...r,
|
|
3631
|
-
label: `${
|
|
3631
|
+
label: `${m("Right")} ${n + 1}`,
|
|
3632
3632
|
value: r.value || "",
|
|
3633
3633
|
sx: {
|
|
3634
3634
|
"& .MuiInputLabel-root": {
|
|
@@ -3653,7 +3653,7 @@ function Jr() {
|
|
|
3653
3653
|
}
|
|
3654
3654
|
),
|
|
3655
3655
|
n + 1 === ((i = a.getValues("updatedFields")) == null ? void 0 : i.length) && /* @__PURE__ */ t(
|
|
3656
|
-
|
|
3656
|
+
U,
|
|
3657
3657
|
{
|
|
3658
3658
|
variant: "contained",
|
|
3659
3659
|
color: "primary",
|
|
@@ -3664,18 +3664,18 @@ function Jr() {
|
|
|
3664
3664
|
(r) => r.id === (e == null ? void 0 : e.id) && r.value
|
|
3665
3665
|
),
|
|
3666
3666
|
"data-testid": "managefeature-button-add-updated",
|
|
3667
|
-
children:
|
|
3667
|
+
children: m("Add")
|
|
3668
3668
|
}
|
|
3669
3669
|
),
|
|
3670
3670
|
!e.updated && /* @__PURE__ */ t(
|
|
3671
|
-
|
|
3671
|
+
U,
|
|
3672
3672
|
{
|
|
3673
3673
|
variant: "contained",
|
|
3674
3674
|
size: "small",
|
|
3675
3675
|
color: "secondary",
|
|
3676
3676
|
onClick: () => Ui(e.id),
|
|
3677
3677
|
"data-testid": `managefeature-button-delete-updated-${n + 1}`,
|
|
3678
|
-
children:
|
|
3678
|
+
children: m("Delete")
|
|
3679
3679
|
}
|
|
3680
3680
|
)
|
|
3681
3681
|
]
|
|
@@ -3683,9 +3683,9 @@ function Jr() {
|
|
|
3683
3683
|
e.id
|
|
3684
3684
|
);
|
|
3685
3685
|
}) }) }) })
|
|
3686
|
-
] }) : /* @__PURE__ */ s(
|
|
3687
|
-
(
|
|
3688
|
-
|
|
3686
|
+
] }) : /* @__PURE__ */ s(fe, { children: [
|
|
3687
|
+
(ce == null ? void 0 : ce.length) === 0 ? /* @__PURE__ */ t(
|
|
3688
|
+
f,
|
|
3689
3689
|
{
|
|
3690
3690
|
variant: "subtitle1",
|
|
3691
3691
|
color: "text.secondary",
|
|
@@ -3696,11 +3696,11 @@ function Jr() {
|
|
|
3696
3696
|
) : /* @__PURE__ */ t(
|
|
3697
3697
|
Wn,
|
|
3698
3698
|
{
|
|
3699
|
-
permissions:
|
|
3699
|
+
permissions: ce,
|
|
3700
3700
|
onEdit: (e) => Ii(e),
|
|
3701
3701
|
onRemove: (e) => vi(e),
|
|
3702
3702
|
handleAddChildClick: (e) => ki(e),
|
|
3703
|
-
isDynamicFeature:
|
|
3703
|
+
isDynamicFeature: P
|
|
3704
3704
|
}
|
|
3705
3705
|
),
|
|
3706
3706
|
/* @__PURE__ */ t(
|
|
@@ -3712,11 +3712,11 @@ function Jr() {
|
|
|
3712
3712
|
mt: 2
|
|
3713
3713
|
},
|
|
3714
3714
|
children: /* @__PURE__ */ t(
|
|
3715
|
-
|
|
3715
|
+
U,
|
|
3716
3716
|
{
|
|
3717
3717
|
variant: "outlined",
|
|
3718
3718
|
size: "small",
|
|
3719
|
-
startIcon: /* @__PURE__ */ t(
|
|
3719
|
+
startIcon: /* @__PURE__ */ t(le, { iconName: "faPlus" }),
|
|
3720
3720
|
onClick: Ni,
|
|
3721
3721
|
sx: {
|
|
3722
3722
|
textTransform: "none",
|
|
@@ -3735,49 +3735,49 @@ function Jr() {
|
|
|
3735
3735
|
qn,
|
|
3736
3736
|
{
|
|
3737
3737
|
open: Bn,
|
|
3738
|
-
onClose: () =>
|
|
3738
|
+
onClose: () => Qe(!1),
|
|
3739
3739
|
onSave: wi,
|
|
3740
3740
|
formCtrl: a,
|
|
3741
3741
|
editData: On,
|
|
3742
|
-
parentPermissionId:
|
|
3743
|
-
mode:
|
|
3742
|
+
parentPermissionId: Je === "add-child" ? pt : null,
|
|
3743
|
+
mode: Je,
|
|
3744
3744
|
permissionTypes: jn,
|
|
3745
3745
|
setPermissionTypes: Gn,
|
|
3746
3746
|
existingPermissionIds: new Set(
|
|
3747
|
-
|
|
3747
|
+
st(ce).map(
|
|
3748
3748
|
(e) => e.permissionId
|
|
3749
3749
|
)
|
|
3750
3750
|
),
|
|
3751
|
-
isDynamicFeature:
|
|
3751
|
+
isDynamicFeature: P
|
|
3752
3752
|
}
|
|
3753
3753
|
)
|
|
3754
3754
|
] })
|
|
3755
3755
|
] }) }),
|
|
3756
|
-
((cn =
|
|
3756
|
+
((cn = q[L]) == null ? void 0 : cn.key) === "assignFeatures" && /* @__PURE__ */ s(c, { mt: 3, className: "flex flex-col w-full", children: [
|
|
3757
3757
|
/* @__PURE__ */ t(
|
|
3758
|
-
|
|
3758
|
+
f,
|
|
3759
3759
|
{
|
|
3760
3760
|
variant: "h5",
|
|
3761
3761
|
sx: { fontWeight: "bold", textAlign: "center", mb: 1 },
|
|
3762
|
-
children:
|
|
3762
|
+
children: m("Assign Features")
|
|
3763
3763
|
}
|
|
3764
3764
|
),
|
|
3765
|
-
/* @__PURE__ */ t(
|
|
3765
|
+
/* @__PURE__ */ t(f, { sx: { textAlign: "center", mb: 4, color: "grey" }, children: "Assign this feature to specific users or roles. You can toggle individual permissions below after assigning." }),
|
|
3766
3766
|
/* @__PURE__ */ s(c, { display: "flex", gap: 2, flexWrap: "wrap", mb: 3, children: [
|
|
3767
3767
|
/* @__PURE__ */ s(c, { flex: "1 1 300px", minWidth: 300, children: [
|
|
3768
|
-
/* @__PURE__ */ t(
|
|
3768
|
+
/* @__PURE__ */ t(f, { variant: "subtitle1", sx: { mb: 1 }, children: m("User") }),
|
|
3769
3769
|
/* @__PURE__ */ t(
|
|
3770
|
-
|
|
3770
|
+
Ee,
|
|
3771
3771
|
{
|
|
3772
3772
|
id: "roles",
|
|
3773
3773
|
name: "roles",
|
|
3774
3774
|
control: a.control,
|
|
3775
|
-
options: !
|
|
3776
|
-
(e) => !
|
|
3775
|
+
options: !P && (l == null ? void 0 : l.val) === !1 ? Be.filter(
|
|
3776
|
+
(e) => !Ne.some(
|
|
3777
3777
|
(n) => n.entityType === "user" && n.user_id === e.id
|
|
3778
3778
|
)
|
|
3779
|
-
) :
|
|
3780
|
-
value:
|
|
3779
|
+
) : Be,
|
|
3780
|
+
value: _,
|
|
3781
3781
|
singleSelect: !0,
|
|
3782
3782
|
onChange: fi,
|
|
3783
3783
|
onInputChange: qi,
|
|
@@ -3788,22 +3788,22 @@ function Jr() {
|
|
|
3788
3788
|
)
|
|
3789
3789
|
] }),
|
|
3790
3790
|
/* @__PURE__ */ s(c, { flex: "1 1 300px", minWidth: 300, children: [
|
|
3791
|
-
/* @__PURE__ */ t(
|
|
3791
|
+
/* @__PURE__ */ t(f, { variant: "subtitle1", sx: { mb: 1 }, children: m("Role") }),
|
|
3792
3792
|
/* @__PURE__ */ t(
|
|
3793
|
-
|
|
3793
|
+
Ee,
|
|
3794
3794
|
{
|
|
3795
3795
|
id: "selectedRoles",
|
|
3796
3796
|
name: "selectedRoles",
|
|
3797
3797
|
control: a.control,
|
|
3798
|
-
options: !
|
|
3799
|
-
(e) => !
|
|
3798
|
+
options: !P && (l == null ? void 0 : l.val) === !1 ? $t().filter(
|
|
3799
|
+
(e) => !Ne.some(
|
|
3800
3800
|
(n) => n.entityType === "role" && n.role_id === e.id
|
|
3801
3801
|
)
|
|
3802
3802
|
) : $t(),
|
|
3803
3803
|
onChange: (e, n) => ui(n),
|
|
3804
3804
|
getOptionLabel: (e) => e == null ? void 0 : e.name,
|
|
3805
3805
|
dataTestId: "accessrights-select-role",
|
|
3806
|
-
value:
|
|
3806
|
+
value: g,
|
|
3807
3807
|
fullWidth: !0
|
|
3808
3808
|
}
|
|
3809
3809
|
)
|
|
@@ -3816,43 +3816,43 @@ function Jr() {
|
|
|
3816
3816
|
flexShrink: 0,
|
|
3817
3817
|
sx: { minWidth: 120 },
|
|
3818
3818
|
children: /* @__PURE__ */ t(
|
|
3819
|
-
|
|
3819
|
+
U,
|
|
3820
3820
|
{
|
|
3821
3821
|
variant: "contained",
|
|
3822
3822
|
size: "medium",
|
|
3823
3823
|
fullWidth: !0,
|
|
3824
|
-
disabled: !(
|
|
3824
|
+
disabled: !(g.length > 0 || _ != null && _.id),
|
|
3825
3825
|
"data-testid": "accessrights-add-button",
|
|
3826
3826
|
onClick: Ti,
|
|
3827
3827
|
sx: { minWidth: 120, marginBottom: "10px" },
|
|
3828
|
-
children:
|
|
3828
|
+
children: m("Add")
|
|
3829
3829
|
}
|
|
3830
3830
|
)
|
|
3831
3831
|
}
|
|
3832
3832
|
)
|
|
3833
3833
|
] }),
|
|
3834
|
-
!
|
|
3835
|
-
/* @__PURE__ */ t(xn, { children: /* @__PURE__ */ s(
|
|
3836
|
-
/* @__PURE__ */ t(
|
|
3837
|
-
/* @__PURE__ */ t(
|
|
3838
|
-
/* @__PURE__ */ t(
|
|
3839
|
-
/* @__PURE__ */ t(
|
|
3834
|
+
!P && (l == null ? void 0 : l.val) === !1 ? /* @__PURE__ */ t(yn, { sx: { maxHeight: 360, overflowY: "auto" }, children: /* @__PURE__ */ s(bn, { size: "small", children: [
|
|
3835
|
+
/* @__PURE__ */ t(xn, { children: /* @__PURE__ */ s(ct, { children: [
|
|
3836
|
+
/* @__PURE__ */ t(ee, { sx: { fontWeight: "bold" }, children: m("Type") }),
|
|
3837
|
+
/* @__PURE__ */ t(ee, { sx: { fontWeight: "bold" }, children: m("Name") }),
|
|
3838
|
+
/* @__PURE__ */ t(ee, { sx: { fontWeight: "bold" }, children: m("Access Right") }),
|
|
3839
|
+
/* @__PURE__ */ t(ee, { sx: { fontWeight: "bold" }, children: m("Actions") })
|
|
3840
3840
|
] }) }),
|
|
3841
|
-
/* @__PURE__ */ t(Sn, { children:
|
|
3842
|
-
/* @__PURE__ */ t(
|
|
3843
|
-
/* @__PURE__ */ t(
|
|
3844
|
-
/* @__PURE__ */ t(
|
|
3841
|
+
/* @__PURE__ */ t(Sn, { children: Ue.map((e, n) => /* @__PURE__ */ s(ct, { children: [
|
|
3842
|
+
/* @__PURE__ */ t(ee, { children: e.designationId ? "Role" : "User" }),
|
|
3843
|
+
/* @__PURE__ */ t(ee, { children: e.roleName || e.fullName }),
|
|
3844
|
+
/* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(
|
|
3845
3845
|
c,
|
|
3846
3846
|
{
|
|
3847
3847
|
display: "flex",
|
|
3848
3848
|
flexDirection: "column",
|
|
3849
3849
|
gap: 1,
|
|
3850
3850
|
children: (() => {
|
|
3851
|
-
const i =
|
|
3851
|
+
const i = K.value ? a.getValues("updatedFields") : a.getValues("fields"), r = i == null ? void 0 : i.reduce((h, y) => (h[y.value] = y.checkbox, h), {}), o = e.featureJson ? JSON.parse(e.featureJson) : {}, u = Object.fromEntries(
|
|
3852
3852
|
Object.entries(o).map(
|
|
3853
|
-
([
|
|
3854
|
-
|
|
3855
|
-
|
|
3853
|
+
([h, y]) => [
|
|
3854
|
+
h,
|
|
3855
|
+
y === !0 || y === "true"
|
|
3856
3856
|
]
|
|
3857
3857
|
)
|
|
3858
3858
|
), d = {
|
|
@@ -3861,12 +3861,12 @@ function Jr() {
|
|
|
3861
3861
|
Object.entries(
|
|
3862
3862
|
r || {}
|
|
3863
3863
|
).filter(
|
|
3864
|
-
([
|
|
3864
|
+
([h]) => !(h in u)
|
|
3865
3865
|
)
|
|
3866
3866
|
)
|
|
3867
3867
|
};
|
|
3868
3868
|
return Object.entries(d).map(
|
|
3869
|
-
([
|
|
3869
|
+
([h, y]) => /* @__PURE__ */ s(
|
|
3870
3870
|
c,
|
|
3871
3871
|
{
|
|
3872
3872
|
display: "flex",
|
|
@@ -3874,67 +3874,67 @@ function Jr() {
|
|
|
3874
3874
|
gap: 1,
|
|
3875
3875
|
children: [
|
|
3876
3876
|
/* @__PURE__ */ t(
|
|
3877
|
-
|
|
3877
|
+
Ie,
|
|
3878
3878
|
{
|
|
3879
3879
|
sx: {
|
|
3880
3880
|
transform: "scale(0.75)",
|
|
3881
3881
|
transformOrigin: "left center"
|
|
3882
3882
|
},
|
|
3883
|
-
checked: !!
|
|
3883
|
+
checked: !!y,
|
|
3884
3884
|
onChange: () => {
|
|
3885
3885
|
const F = [
|
|
3886
|
-
...
|
|
3886
|
+
...Ue
|
|
3887
3887
|
];
|
|
3888
3888
|
let k = {};
|
|
3889
3889
|
try {
|
|
3890
3890
|
k = e.featureJson ? JSON.parse(
|
|
3891
3891
|
e.featureJson
|
|
3892
3892
|
) : {};
|
|
3893
|
-
} catch (
|
|
3893
|
+
} catch (se) {
|
|
3894
3894
|
console.warn(
|
|
3895
3895
|
"Invalid JSON in featureJson:",
|
|
3896
|
-
|
|
3896
|
+
se
|
|
3897
3897
|
);
|
|
3898
3898
|
}
|
|
3899
|
-
const
|
|
3899
|
+
const X = (K.value ? a.getValues(
|
|
3900
3900
|
"updatedFields"
|
|
3901
3901
|
) : a.getValues(
|
|
3902
3902
|
"fields"
|
|
3903
3903
|
) || []).reduce(
|
|
3904
|
-
(
|
|
3904
|
+
(se, oe) => (se[oe.value] = oe.value in k ? k[oe.value] : oe.checkbox, se),
|
|
3905
3905
|
{}
|
|
3906
3906
|
);
|
|
3907
|
-
|
|
3907
|
+
X[h] = !y, F[n] = {
|
|
3908
3908
|
...e,
|
|
3909
3909
|
featureJson: JSON.stringify(
|
|
3910
|
-
|
|
3910
|
+
X
|
|
3911
3911
|
)
|
|
3912
|
-
},
|
|
3912
|
+
}, ze(F);
|
|
3913
3913
|
}
|
|
3914
3914
|
}
|
|
3915
3915
|
),
|
|
3916
|
-
/* @__PURE__ */ t(
|
|
3916
|
+
/* @__PURE__ */ t(f, { variant: "subtitle1", children: h })
|
|
3917
3917
|
]
|
|
3918
3918
|
},
|
|
3919
|
-
|
|
3919
|
+
h
|
|
3920
3920
|
)
|
|
3921
3921
|
);
|
|
3922
3922
|
})()
|
|
3923
3923
|
}
|
|
3924
3924
|
) }),
|
|
3925
|
-
/* @__PURE__ */ t(
|
|
3926
|
-
|
|
3925
|
+
/* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(
|
|
3926
|
+
qe,
|
|
3927
3927
|
{
|
|
3928
3928
|
size: "small",
|
|
3929
3929
|
color: "error",
|
|
3930
3930
|
onClick: () => {
|
|
3931
|
-
const i =
|
|
3931
|
+
const i = Ue.filter(
|
|
3932
3932
|
(r, o) => o !== n
|
|
3933
3933
|
);
|
|
3934
|
-
|
|
3934
|
+
ze(i);
|
|
3935
3935
|
},
|
|
3936
3936
|
children: /* @__PURE__ */ t(
|
|
3937
|
-
|
|
3937
|
+
le,
|
|
3938
3938
|
{
|
|
3939
3939
|
iconName: "faTrashAlt",
|
|
3940
3940
|
size: "sm"
|
|
@@ -3943,40 +3943,40 @@ function Jr() {
|
|
|
3943
3943
|
}
|
|
3944
3944
|
) })
|
|
3945
3945
|
] }, n)) })
|
|
3946
|
-
] }) }) : /* @__PURE__ */ t(
|
|
3946
|
+
] }) }) : /* @__PURE__ */ t(fe, { children: Ne.length > 0 && /* @__PURE__ */ t(
|
|
3947
3947
|
yn,
|
|
3948
3948
|
{
|
|
3949
3949
|
sx: { maxHeight: 360, overflowY: "auto" },
|
|
3950
3950
|
children: /* @__PURE__ */ s(bn, { size: "small", children: [
|
|
3951
|
-
/* @__PURE__ */ t(xn, { children: /* @__PURE__ */ s(
|
|
3952
|
-
/* @__PURE__ */ t(
|
|
3953
|
-
/* @__PURE__ */ t(
|
|
3954
|
-
/* @__PURE__ */ t(
|
|
3955
|
-
/* @__PURE__ */ t(
|
|
3951
|
+
/* @__PURE__ */ t(xn, { children: /* @__PURE__ */ s(ct, { children: [
|
|
3952
|
+
/* @__PURE__ */ t(ee, { sx: { fontWeight: "bold" }, children: m("Type") }),
|
|
3953
|
+
/* @__PURE__ */ t(ee, { sx: { fontWeight: "bold" }, children: m("Name") }),
|
|
3954
|
+
/* @__PURE__ */ t(ee, { sx: { fontWeight: "bold" }, children: m("Permissions") }),
|
|
3955
|
+
/* @__PURE__ */ t(ee, { sx: { fontWeight: "bold" }, children: m("Actions") })
|
|
3956
3956
|
] }) }),
|
|
3957
|
-
/* @__PURE__ */ t(Sn, { children:
|
|
3958
|
-
/* @__PURE__ */ t(
|
|
3959
|
-
/* @__PURE__ */ t(
|
|
3960
|
-
/* @__PURE__ */ t(
|
|
3957
|
+
/* @__PURE__ */ t(Sn, { children: Ne.map((e, n) => /* @__PURE__ */ s(ct, { children: [
|
|
3958
|
+
/* @__PURE__ */ t(ee, { children: e.entityType === "role" ? "Role" : "User" }),
|
|
3959
|
+
/* @__PURE__ */ t(ee, { children: e.name }),
|
|
3960
|
+
/* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(
|
|
3961
3961
|
_t,
|
|
3962
3962
|
{
|
|
3963
3963
|
permissions: e.permissions,
|
|
3964
3964
|
onToggle: (i) => _i(n, i)
|
|
3965
3965
|
}
|
|
3966
3966
|
) }),
|
|
3967
|
-
/* @__PURE__ */ t(
|
|
3968
|
-
|
|
3967
|
+
/* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(
|
|
3968
|
+
qe,
|
|
3969
3969
|
{
|
|
3970
3970
|
size: "small",
|
|
3971
3971
|
color: "error",
|
|
3972
3972
|
onClick: () => {
|
|
3973
|
-
const i =
|
|
3973
|
+
const i = Ne.filter(
|
|
3974
3974
|
(r, o) => o !== n
|
|
3975
3975
|
);
|
|
3976
|
-
|
|
3976
|
+
We(i);
|
|
3977
3977
|
},
|
|
3978
3978
|
children: /* @__PURE__ */ t(
|
|
3979
|
-
|
|
3979
|
+
le,
|
|
3980
3980
|
{
|
|
3981
3981
|
iconName: "faTrashAlt",
|
|
3982
3982
|
size: "sm"
|
|
@@ -3993,15 +3993,15 @@ function Jr() {
|
|
|
3993
3993
|
{
|
|
3994
3994
|
open: zn,
|
|
3995
3995
|
onClose: () => gt(!1),
|
|
3996
|
-
permissions:
|
|
3996
|
+
permissions: ce,
|
|
3997
3997
|
entityData: Ln,
|
|
3998
3998
|
onSave: (e) => {
|
|
3999
|
-
|
|
3999
|
+
We((n) => [...n, e]), gt(!1);
|
|
4000
4000
|
}
|
|
4001
4001
|
}
|
|
4002
4002
|
)
|
|
4003
4003
|
] }),
|
|
4004
|
-
((un =
|
|
4004
|
+
((un = q[L]) == null ? void 0 : un.key) === "submit" && Ae && /* @__PURE__ */ s(
|
|
4005
4005
|
c,
|
|
4006
4006
|
{
|
|
4007
4007
|
sx: {
|
|
@@ -4022,9 +4022,9 @@ function Jr() {
|
|
|
4022
4022
|
p: 6
|
|
4023
4023
|
},
|
|
4024
4024
|
children: [
|
|
4025
|
-
/* @__PURE__ */ t(c, { sx: { color: "success.main", fontSize: 40, mb: 2 }, children: /* @__PURE__ */ t(
|
|
4025
|
+
/* @__PURE__ */ t(c, { sx: { color: "success.main", fontSize: 40, mb: 2 }, children: /* @__PURE__ */ t(le, { iconName: "faCheckCircle" }) }),
|
|
4026
4026
|
/* @__PURE__ */ s(
|
|
4027
|
-
|
|
4027
|
+
f,
|
|
4028
4028
|
{
|
|
4029
4029
|
variant: "h6",
|
|
4030
4030
|
gutterBottom: !0,
|
|
@@ -4036,46 +4036,46 @@ function Jr() {
|
|
|
4036
4036
|
]
|
|
4037
4037
|
}
|
|
4038
4038
|
),
|
|
4039
|
-
/* @__PURE__ */ t(
|
|
4040
|
-
/* @__PURE__ */ s(
|
|
4039
|
+
/* @__PURE__ */ t(Ye, { sx: { my: 2, width: "100%" } }),
|
|
4040
|
+
/* @__PURE__ */ s(f, { variant: "subtitle1", gutterBottom: !0, children: [
|
|
4041
4041
|
/* @__PURE__ */ t("strong", { children: "Feature Name:" }),
|
|
4042
4042
|
" ",
|
|
4043
4043
|
a.getValues("menuName")
|
|
4044
4044
|
] }),
|
|
4045
|
-
|
|
4045
|
+
P && /* @__PURE__ */ s(f, { variant: "subtitle1", gutterBottom: !0, children: [
|
|
4046
4046
|
/* @__PURE__ */ t("strong", { children: "Feature Constant:" }),
|
|
4047
4047
|
" ",
|
|
4048
4048
|
a.getValues("featureConstant")
|
|
4049
4049
|
] }),
|
|
4050
4050
|
/* @__PURE__ */ t(c, { mt: 5, width: "100%", display: "flex", justifyContent: "center", children: a.getValues("formCode") && a.getValues("version") ? /* @__PURE__ */ t(
|
|
4051
|
-
|
|
4051
|
+
U,
|
|
4052
4052
|
{
|
|
4053
4053
|
variant: "contained",
|
|
4054
4054
|
color: "primary",
|
|
4055
4055
|
onClick: () => {
|
|
4056
4056
|
var r;
|
|
4057
|
-
const e = a.getValues("formCode"), n = a.getValues("version"), i = (r =
|
|
4057
|
+
const e = a.getValues("formCode"), n = a.getValues("version"), i = (r = J == null ? void 0 : J[e]) == null ? void 0 : r.find(
|
|
4058
4058
|
(o) => o.version === n
|
|
4059
4059
|
);
|
|
4060
|
-
i != null && i.uuid ?
|
|
4060
|
+
i != null && i.uuid ? E(
|
|
4061
4061
|
`/ui/medplat/admin/medplatForms/form/${i.uuid}`
|
|
4062
4062
|
) : console.warn("Could not find matching version UUID");
|
|
4063
4063
|
},
|
|
4064
4064
|
children: "Configure Form"
|
|
4065
4065
|
}
|
|
4066
4066
|
) : /* @__PURE__ */ t(
|
|
4067
|
-
|
|
4067
|
+
U,
|
|
4068
4068
|
{
|
|
4069
4069
|
variant: "outlined",
|
|
4070
4070
|
color: "primary",
|
|
4071
|
-
onClick: () =>
|
|
4071
|
+
onClick: () => E("/ui/medplat/manage/menu"),
|
|
4072
4072
|
children: "Go Back to Menu"
|
|
4073
4073
|
}
|
|
4074
4074
|
) })
|
|
4075
4075
|
]
|
|
4076
4076
|
}
|
|
4077
4077
|
),
|
|
4078
|
-
!
|
|
4078
|
+
!Ae && /* @__PURE__ */ s(
|
|
4079
4079
|
c,
|
|
4080
4080
|
{
|
|
4081
4081
|
mt: "auto",
|
|
@@ -4085,7 +4085,7 @@ function Jr() {
|
|
|
4085
4085
|
sx: { paddingTop: 4 },
|
|
4086
4086
|
children: [
|
|
4087
4087
|
/* @__PURE__ */ t(
|
|
4088
|
-
|
|
4088
|
+
U,
|
|
4089
4089
|
{
|
|
4090
4090
|
variant: "outlined",
|
|
4091
4091
|
sx: { color: "text.secondary" },
|
|
@@ -4093,36 +4093,36 @@ function Jr() {
|
|
|
4093
4093
|
children: "Back"
|
|
4094
4094
|
}
|
|
4095
4095
|
),
|
|
4096
|
-
((mn =
|
|
4097
|
-
var
|
|
4098
|
-
const e = (
|
|
4099
|
-
(
|
|
4100
|
-
Xt(
|
|
4101
|
-
const F =
|
|
4096
|
+
((mn = q[L]) == null ? void 0 : mn.key) !== "submit" && (() => {
|
|
4097
|
+
var h;
|
|
4098
|
+
const e = (h = q[L]) == null ? void 0 : h.key, n = ["formLinking"].includes(e), i = et.includes(e), [r, o] = a.getValues(Bt(e)), u = e === "formLinking" ? !!(r != null && r.trim()) || !!(o != null && o.trim()) : e === "additionalPermissions" ? Array.isArray(r) && r.length > 0 : !1, d = a.handleSubmit(
|
|
4099
|
+
(y) => {
|
|
4100
|
+
Xt(y);
|
|
4101
|
+
const F = q.findIndex(
|
|
4102
4102
|
(k) => k.key === "submit"
|
|
4103
4103
|
);
|
|
4104
|
-
At((k) => new Set(k).add(e)),
|
|
4104
|
+
At((k) => new Set(k).add(e)), Ce(F);
|
|
4105
4105
|
}
|
|
4106
4106
|
);
|
|
4107
4107
|
return e === "assignFeatures" || e === "accessRights" ? /* @__PURE__ */ t(
|
|
4108
|
-
|
|
4108
|
+
U,
|
|
4109
4109
|
{
|
|
4110
4110
|
variant: "contained",
|
|
4111
4111
|
onClick: d,
|
|
4112
4112
|
children: "Save"
|
|
4113
4113
|
}
|
|
4114
|
-
) : n ? Rt ? /* @__PURE__ */ t(
|
|
4115
|
-
|
|
4114
|
+
) : n ? Rt ? /* @__PURE__ */ t(U, { variant: "contained", onClick: xt, children: "Next" }) : u ? /* @__PURE__ */ t(U, { variant: "contained", disabled: !0, children: "Next" }) : /* @__PURE__ */ t(
|
|
4115
|
+
U,
|
|
4116
4116
|
{
|
|
4117
4117
|
variant: "outlined",
|
|
4118
4118
|
color: "secondary",
|
|
4119
4119
|
onClick: () => {
|
|
4120
|
-
i ||
|
|
4120
|
+
i || Me((y) => [...y, e]), xt();
|
|
4121
4121
|
},
|
|
4122
4122
|
children: "Skip for now"
|
|
4123
4123
|
}
|
|
4124
4124
|
) : /* @__PURE__ */ t(
|
|
4125
|
-
|
|
4125
|
+
U,
|
|
4126
4126
|
{
|
|
4127
4127
|
variant: "contained",
|
|
4128
4128
|
onClick: xt,
|
|
@@ -4186,4 +4186,4 @@ Rn.propTypes = {
|
|
|
4186
4186
|
export {
|
|
4187
4187
|
Jr as default
|
|
4188
4188
|
};
|
|
4189
|
-
//# sourceMappingURL=ManageDynamicFeature-
|
|
4189
|
+
//# sourceMappingURL=ManageDynamicFeature-BKkCnQvF.js.map
|